SlideShare uma empresa Scribd logo
1 de 21
Baixar para ler offline
Phil Day
Director of Engineering
Policy driven real-time
data filtering from IoT
sensors with Flux
| Agenda
• Background to Configured Things
• Data challenges in Connected Spaces such as Smart
Cities
• The role of a data gateway, and how we built one with
Flux
• Short Demo
| Configured Things
UK based company, founded in 2018
We build declarative systems to securely configure smart spaces.
Alumni of the NCSC Cyber Accelerator and Smart Cities programs
| Declarative systems
Our Platform is a declarative model based configuration system.
We model and manage the changes as first order objects, where
changes can
• come from multiple sources
• be added and removed in any order
• be constrained to specific areas of the overall model
• be authenticated, verified, and potentially signed
| Declarative systems
In a declarative system the interface is constrained to statements about
the desired state of all or some part of the systems.
When properly implemented they are:
• Simple to interact with
• Robust
• Easy to reason about from a security and audit perspective.
| Data Challenges in Smart Cities and other Connected Places
Smart Cities are formed of multiple co-operating systems.
Most existing systems focused on single data owner, where sharing is a
binary choice.
Data owners need to be able control the content and quality of data they
share
The drivers and policy for sharing data can change dynamically.
The policies and changes to policies need to be auditable.
| ConfigureThings Data Gateway
The ConfiguredThings Data Gateway is a software appliance for
providing controlled processing and sharing of streaming data
Policy is define via a declarative model, which configures and queries
an underlying Influx DB platform.
Policy can be can change dynamically at any time
| Data Gateway Context
IoT
System
Data
Gateway
Policy
Data
Gateway
Policy
Data
Gateway
Policy
Sensor
Owner
Data Stream Policy
Controlled
Data Streams
Sensors
Radio
Network
Sensor
Owner
Data Stream
| Data Gateway Requirements
• Policy to control data visibility & quality
• Support different policies, and map multiple users to
each policy
• Provide a real time and historical data streams
• Support user defined filtering and analytics
| Architecture
Ingest
IoT System
MQTT, https
Collected
Data
Policy 1
Data
Policy 2
Data
Policy 3
Data
P2
P1
P3
Policy
Mgr
Notify
Policies (Flux) User Filters (Flux)
User Filter
User Filter
User Filter
User Filter
User Filter
Filter
Mgr
Notify
User
Data
Streams
| What can you define in a Policy ?
Data Scope
 What time period (Historical data)
 Which measurements
 Which metadata (device ID, device name, ...)
 Which fields (some series can contain multiple values)
Data Quality
 Aggregation (sample, sum, count, average, min, max) - e.g. calculate average in every 10 minute
period
 Resolution
 Mapping (map value ranges to a new enumeration)
Policies and User Filters have the same format and capabilities
| Policy Definition (JSON)
{
"period": "2h", // Limit data to last 2 hours
"measurements": {
"temp_ave": { // Derive a new measurement called “temp_ave”
"from": "_Lora", // from the data source “_Lora”
"source": "sim.temp", // and the measurement “sim.temp”
"filter": {
"devName": "/Sim-Dev-1.*/", // Match any source where devName starts “Sim-Dev-1”
"devEUI": null // Include the metadata “devEUI”
},
"fields": ["1", "2"], // Include just the fields “1” and “2”
"window": { // Average the data over 40 seconds
"duration": "40s",
"function": "average"
},
"resolution": 1 // Limit the resolution to 1 decimal place
}
}
}
| Policy Definition (Mapped to Flux)
{
"period": "2h", // Set the retention period of the Policy bucket
"measurements": {
"temp_ave": {
"from": "_Lora", temp_ave = from(bucket: "_Lora")
|> range(start: <start>, stop: <stop>)
"source": "sim.temp", |> filter(fn: (r) => r._measurement == "sim.temp"
"filter": {
"devName": "/Sim-Dev-1.*/", and (r.devName =~ /Sim-Dev-1.*/)
"devEUI": null
},
"fields": ["1", "2“], and (r._field == "1" or r._field == "2"))
|> keep(columns: ["_time", "_field", "_value", "devName", "devEUI"])
"window": {
"duration": "40s", |> aggregateWindow(every: 40s, fn: mean)
"function": "average“ |> map(fn: (r) => ({ r with _time:
experimental.addDuration(d: 20s, to: r._start)}))
}, |> drop(columns: ["_start", "_stop"])
"resolution": 1 |> map(fn: (r) => ({ r with _value: rnd(x: r._value, n: 1)}))
}
} |> yield temp_ave
}
| Handling time periods
Query period #1
t0
t0 - policy.period
#results > 0
#results > 0
#results = 0
t1 t2 t3
The flux query is run when the
policy or filter is defined /
updated, and then every time we
get a notification that a new
value has been added to the
source
initial notification notification notification
#4
#3
#2
| Handling time periods with windows
Query period #1
t0
t0 - policy.period
notification
#results > 0
#results > 0
notification
#results = 0
notification
#2
#3
#4
t1 t2 t3
When the policy includes a
window we have to ensure we
don’t leak data.
• Always align windows to the
same boundary
• Only include full windows
initial
00:00
| Location Handling
Location data can have particular value and security considerations.
During ingest we calculate the S2 Cell Id for any point with location fields at a
range of resolutions, e.g.
Level 18 (27m), Level 16 (153m), Level 13 (850m), …
We add a metadata value for each calculated level.
Policy can then be used to filter only the level(s) a user is allowed to know
Also looking at using the Flux Geo package to allow rules such as:
“All sensors within xxx meters of this location”
"filter": {
"S2_Cell_13": null,
| Policy Definition - Sampling
{
"period": "2h", // Limit data to last 2 hours
"measurements": {
"temp_sample": { // Derive a new measurement called “temp_sample”
"from": "_Lora", // from the data source “_Lora”
"source": "sim.temp", // and the measurement “sim.temp”
"window": {
"duration": "5m",
"function": "sample", // Sample the values in 5 minute windows
"frequency": 3, // Return every 3rd point
"limit": 4 // with a limit of at most 4 points in each window
},
}
}
}
| Policy Definition - Sampling
{
"period": "2h", // Set the retention period of the Policy bucket
"measurements": {
"temp_sample": {
"from": "_Lora", temp_sample = from(bucket: "_Lora")
|> range(start: <start>, stop: <stop>)
"source": "sim.temp", |> filter(fn: (r) => r._measurement == "sim.temp“)
"window": {
"duration": "5m", |> window(every: 5m)
"function": "sample“,
"frequency": 3, |> sample(n: 3, pos: 0)
"limit": 4 |> limit(n: 4)
}, |> drop(columns: ["_start", "_stop"])
}
} |> yield temp_sample
}
| Creating a default policy or filter
We can inspect a bucket and create a policy or filter definition which
matches all of the data in the bucket
filter: object of all of <key_name>: null
filter_values: object of arrays giving <key_values> for each key
fields: array of all <field_names>
Default filter available to each user so they can inspect the data available to
them from a policy, and modify as needed.
Demo
Thank You
To find out more:
https://configuredthings.com
getconfigured@configuredthings.com

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Using InfluxDB for Full Observability of a SaaS Platform by Aleksandr Tavgen,...
Using InfluxDB for Full Observability of a SaaS Platform by Aleksandr Tavgen,...Using InfluxDB for Full Observability of a SaaS Platform by Aleksandr Tavgen,...
Using InfluxDB for Full Observability of a SaaS Platform by Aleksandr Tavgen,...
 
Using OPC-UA to Extract IIoT Time Series Data from PLC and SCADA Systems
Using OPC-UA to Extract IIoT Time Series Data from PLC and SCADA SystemsUsing OPC-UA to Extract IIoT Time Series Data from PLC and SCADA Systems
Using OPC-UA to Extract IIoT Time Series Data from PLC and SCADA Systems
 
Tim Hall [InfluxData] | InfluxDB Roadmap | InfluxDays Virtual Experience Lond...
Tim Hall [InfluxData] | InfluxDB Roadmap | InfluxDays Virtual Experience Lond...Tim Hall [InfluxData] | InfluxDB Roadmap | InfluxDays Virtual Experience Lond...
Tim Hall [InfluxData] | InfluxDB Roadmap | InfluxDays Virtual Experience Lond...
 
Change Data Capture - Scale by the Bay 2019
Change Data Capture - Scale by the Bay 2019Change Data Capture - Scale by the Bay 2019
Change Data Capture - Scale by the Bay 2019
 
Kurt Schneider [Discover Financial] | How Discover Modernizes Observability w...
Kurt Schneider [Discover Financial] | How Discover Modernizes Observability w...Kurt Schneider [Discover Financial] | How Discover Modernizes Observability w...
Kurt Schneider [Discover Financial] | How Discover Modernizes Observability w...
 
Monitoring and Troubleshooting a Real Time Pipeline
Monitoring and Troubleshooting a Real Time PipelineMonitoring and Troubleshooting a Real Time Pipeline
Monitoring and Troubleshooting a Real Time Pipeline
 
PCAP Graphs for Cybersecurity and System Tuning
PCAP Graphs for Cybersecurity and System TuningPCAP Graphs for Cybersecurity and System Tuning
PCAP Graphs for Cybersecurity and System Tuning
 
Data & Analytics Forum: Moving Telcos to Real Time
Data & Analytics Forum: Moving Telcos to Real TimeData & Analytics Forum: Moving Telcos to Real Time
Data & Analytics Forum: Moving Telcos to Real Time
 
Building Software to Scale
Building Software to Scale Building Software to Scale
Building Software to Scale
 
EDA Meets Data Engineering – What's the Big Deal?
EDA Meets Data Engineering – What's the Big Deal?EDA Meets Data Engineering – What's the Big Deal?
EDA Meets Data Engineering – What's the Big Deal?
 
Achieving scale and performance using cloud native environment
Achieving scale and performance using cloud native environmentAchieving scale and performance using cloud native environment
Achieving scale and performance using cloud native environment
 
Power Your Delta Lake with Streaming Transactional Changes
 Power Your Delta Lake with Streaming Transactional Changes Power Your Delta Lake with Streaming Transactional Changes
Power Your Delta Lake with Streaming Transactional Changes
 
How to Improve Data Labels and Feedback Loops Through High-Frequency Sensor A...
How to Improve Data Labels and Feedback Loops Through High-Frequency Sensor A...How to Improve Data Labels and Feedback Loops Through High-Frequency Sensor A...
How to Improve Data Labels and Feedback Loops Through High-Frequency Sensor A...
 
Digital transformation: Highly resilient streaming architecture and strategie...
Digital transformation: Highly resilient streaming architecture and strategie...Digital transformation: Highly resilient streaming architecture and strategie...
Digital transformation: Highly resilient streaming architecture and strategie...
 
Add Historical Analysis of Operational Data with Easy Configurations in Fivet...
Add Historical Analysis of Operational Data with Easy Configurations in Fivet...Add Historical Analysis of Operational Data with Easy Configurations in Fivet...
Add Historical Analysis of Operational Data with Easy Configurations in Fivet...
 
Case Study: Elasticsearch Ingest Using StreamSets at Cisco Intercloud
Case Study: Elasticsearch Ingest Using StreamSets at Cisco IntercloudCase Study: Elasticsearch Ingest Using StreamSets at Cisco Intercloud
Case Study: Elasticsearch Ingest Using StreamSets at Cisco Intercloud
 
Pivoting event streaming, from PROJECTS to a PLATFORM
Pivoting event streaming, from PROJECTS to a PLATFORMPivoting event streaming, from PROJECTS to a PLATFORM
Pivoting event streaming, from PROJECTS to a PLATFORM
 
Building Physical Industrial IoT Models with Kafka
Building Physical Industrial IoT Models with KafkaBuilding Physical Industrial IoT Models with Kafka
Building Physical Industrial IoT Models with Kafka
 
How a Data Mesh is Driving our Platform | Trey Hicks, Gloo
How a Data Mesh is Driving our Platform | Trey Hicks, GlooHow a Data Mesh is Driving our Platform | Trey Hicks, Gloo
How a Data Mesh is Driving our Platform | Trey Hicks, Gloo
 
Building a Graph Database in Neo4j with Spark & Spark SQL to gain new insight...
Building a Graph Database in Neo4j with Spark & Spark SQL to gain new insight...Building a Graph Database in Neo4j with Spark & Spark SQL to gain new insight...
Building a Graph Database in Neo4j with Spark & Spark SQL to gain new insight...
 

Semelhante a Phil Day [Configured Things] | Policy-Driven Real-Time Data Filtering from IoT Sensors with Flux | InfluxData EMEA 2021

Shree krishna 20140214
Shree krishna 20140214Shree krishna 20140214
Shree krishna 20140214
Shree Shrestha
 

Semelhante a Phil Day [Configured Things] | Policy-Driven Real-Time Data Filtering from IoT Sensors with Flux | InfluxData EMEA 2021 (20)

Intro to Time Series
Intro to Time Series Intro to Time Series
Intro to Time Series
 
DDS Tutorial -- Part I
DDS Tutorial -- Part IDDS Tutorial -- Part I
DDS Tutorial -- Part I
 
Emerson Exchange 3D plots Process Analysis
Emerson Exchange 3D plots Process AnalysisEmerson Exchange 3D plots Process Analysis
Emerson Exchange 3D plots Process Analysis
 
The Case for a Signal Oriented Data Stream Management System
The Case for a Signal Oriented Data Stream Management SystemThe Case for a Signal Oriented Data Stream Management System
The Case for a Signal Oriented Data Stream Management System
 
Testing in a distributed world
Testing in a distributed worldTesting in a distributed world
Testing in a distributed world
 
BDVe Webinar Series - Toreador Intro - Designing Big Data pipelines (Paolo Ce...
BDVe Webinar Series - Toreador Intro - Designing Big Data pipelines (Paolo Ce...BDVe Webinar Series - Toreador Intro - Designing Big Data pipelines (Paolo Ce...
BDVe Webinar Series - Toreador Intro - Designing Big Data pipelines (Paolo Ce...
 
Shree krishna 20140214
Shree krishna 20140214Shree krishna 20140214
Shree krishna 20140214
 
MongoDB for Time Series Data
MongoDB for Time Series DataMongoDB for Time Series Data
MongoDB for Time Series Data
 
ACMSE2022-Tutorial-Slides.pptx
ACMSE2022-Tutorial-Slides.pptxACMSE2022-Tutorial-Slides.pptx
ACMSE2022-Tutorial-Slides.pptx
 
Sherlock: an anomaly detection service on top of Druid
Sherlock: an anomaly detection service on top of Druid Sherlock: an anomaly detection service on top of Druid
Sherlock: an anomaly detection service on top of Druid
 
Building Reactive Applications with DDS
Building Reactive Applications with DDSBuilding Reactive Applications with DDS
Building Reactive Applications with DDS
 
Unit i
Unit iUnit i
Unit i
 
SenSocial
SenSocialSenSocial
SenSocial
 
SenSocial
SenSocialSenSocial
SenSocial
 
Influx data basic
Influx data basicInflux data basic
Influx data basic
 
Cyclone DDS Unleashed: Scalability in DDS and Dealing with Large Systems
Cyclone DDS Unleashed: Scalability in DDS and Dealing with Large SystemsCyclone DDS Unleashed: Scalability in DDS and Dealing with Large Systems
Cyclone DDS Unleashed: Scalability in DDS and Dealing with Large Systems
 
Monitoring with Prometheus
Monitoring with PrometheusMonitoring with Prometheus
Monitoring with Prometheus
 
BIRTE-13-Kawashima
BIRTE-13-KawashimaBIRTE-13-Kawashima
BIRTE-13-Kawashima
 
Monitoring InfluxEnterprise
Monitoring InfluxEnterpriseMonitoring InfluxEnterprise
Monitoring InfluxEnterprise
 
Monitoring federation open stack infrastructure
Monitoring federation open stack infrastructureMonitoring federation open stack infrastructure
Monitoring federation open stack infrastructure
 

Mais de InfluxData

How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
InfluxData
 
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
How Delft University's Engineering Students Make Their EV Formula-Style Race ...How Delft University's Engineering Students Make Their EV Formula-Style Race ...
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
InfluxData
 
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
InfluxData
 
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
InfluxData
 

Mais de InfluxData (20)

Announcing InfluxDB Clustered
Announcing InfluxDB ClusteredAnnouncing InfluxDB Clustered
Announcing InfluxDB Clustered
 
Best Practices for Leveraging the Apache Arrow Ecosystem
Best Practices for Leveraging the Apache Arrow EcosystemBest Practices for Leveraging the Apache Arrow Ecosystem
Best Practices for Leveraging the Apache Arrow Ecosystem
 
How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...
How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...
How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...
 
Power Your Predictive Analytics with InfluxDB
Power Your Predictive Analytics with InfluxDBPower Your Predictive Analytics with InfluxDB
Power Your Predictive Analytics with InfluxDB
 
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
 
Build an Edge-to-Cloud Solution with the MING Stack
Build an Edge-to-Cloud Solution with the MING StackBuild an Edge-to-Cloud Solution with the MING Stack
Build an Edge-to-Cloud Solution with the MING Stack
 
Meet the Founders: An Open Discussion About Rewriting Using Rust
Meet the Founders: An Open Discussion About Rewriting Using RustMeet the Founders: An Open Discussion About Rewriting Using Rust
Meet the Founders: An Open Discussion About Rewriting Using Rust
 
Introducing InfluxDB Cloud Dedicated
Introducing InfluxDB Cloud DedicatedIntroducing InfluxDB Cloud Dedicated
Introducing InfluxDB Cloud Dedicated
 
Gain Better Observability with OpenTelemetry and InfluxDB
Gain Better Observability with OpenTelemetry and InfluxDB Gain Better Observability with OpenTelemetry and InfluxDB
Gain Better Observability with OpenTelemetry and InfluxDB
 
How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...
How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...
How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...
 
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
How Delft University's Engineering Students Make Their EV Formula-Style Race ...How Delft University's Engineering Students Make Their EV Formula-Style Race ...
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
 
Introducing InfluxDB’s New Time Series Database Storage Engine
Introducing InfluxDB’s New Time Series Database Storage EngineIntroducing InfluxDB’s New Time Series Database Storage Engine
Introducing InfluxDB’s New Time Series Database Storage Engine
 
Start Automating InfluxDB Deployments at the Edge with balena
Start Automating InfluxDB Deployments at the Edge with balena Start Automating InfluxDB Deployments at the Edge with balena
Start Automating InfluxDB Deployments at the Edge with balena
 
Understanding InfluxDB’s New Storage Engine
Understanding InfluxDB’s New Storage EngineUnderstanding InfluxDB’s New Storage Engine
Understanding InfluxDB’s New Storage Engine
 
Streamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDB
Streamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDBStreamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDB
Streamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDB
 
Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...
Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...
Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...
 
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
 
Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022
 
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
 
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
 

Último

Último (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 

Phil Day [Configured Things] | Policy-Driven Real-Time Data Filtering from IoT Sensors with Flux | InfluxData EMEA 2021

  • 1. Phil Day Director of Engineering Policy driven real-time data filtering from IoT sensors with Flux
  • 2. | Agenda • Background to Configured Things • Data challenges in Connected Spaces such as Smart Cities • The role of a data gateway, and how we built one with Flux • Short Demo
  • 3. | Configured Things UK based company, founded in 2018 We build declarative systems to securely configure smart spaces. Alumni of the NCSC Cyber Accelerator and Smart Cities programs
  • 4. | Declarative systems Our Platform is a declarative model based configuration system. We model and manage the changes as first order objects, where changes can • come from multiple sources • be added and removed in any order • be constrained to specific areas of the overall model • be authenticated, verified, and potentially signed
  • 5. | Declarative systems In a declarative system the interface is constrained to statements about the desired state of all or some part of the systems. When properly implemented they are: • Simple to interact with • Robust • Easy to reason about from a security and audit perspective.
  • 6. | Data Challenges in Smart Cities and other Connected Places Smart Cities are formed of multiple co-operating systems. Most existing systems focused on single data owner, where sharing is a binary choice. Data owners need to be able control the content and quality of data they share The drivers and policy for sharing data can change dynamically. The policies and changes to policies need to be auditable.
  • 7. | ConfigureThings Data Gateway The ConfiguredThings Data Gateway is a software appliance for providing controlled processing and sharing of streaming data Policy is define via a declarative model, which configures and queries an underlying Influx DB platform. Policy can be can change dynamically at any time
  • 8. | Data Gateway Context IoT System Data Gateway Policy Data Gateway Policy Data Gateway Policy Sensor Owner Data Stream Policy Controlled Data Streams Sensors Radio Network Sensor Owner Data Stream
  • 9. | Data Gateway Requirements • Policy to control data visibility & quality • Support different policies, and map multiple users to each policy • Provide a real time and historical data streams • Support user defined filtering and analytics
  • 10. | Architecture Ingest IoT System MQTT, https Collected Data Policy 1 Data Policy 2 Data Policy 3 Data P2 P1 P3 Policy Mgr Notify Policies (Flux) User Filters (Flux) User Filter User Filter User Filter User Filter User Filter Filter Mgr Notify User Data Streams
  • 11. | What can you define in a Policy ? Data Scope  What time period (Historical data)  Which measurements  Which metadata (device ID, device name, ...)  Which fields (some series can contain multiple values) Data Quality  Aggregation (sample, sum, count, average, min, max) - e.g. calculate average in every 10 minute period  Resolution  Mapping (map value ranges to a new enumeration) Policies and User Filters have the same format and capabilities
  • 12. | Policy Definition (JSON) { "period": "2h", // Limit data to last 2 hours "measurements": { "temp_ave": { // Derive a new measurement called “temp_ave” "from": "_Lora", // from the data source “_Lora” "source": "sim.temp", // and the measurement “sim.temp” "filter": { "devName": "/Sim-Dev-1.*/", // Match any source where devName starts “Sim-Dev-1” "devEUI": null // Include the metadata “devEUI” }, "fields": ["1", "2"], // Include just the fields “1” and “2” "window": { // Average the data over 40 seconds "duration": "40s", "function": "average" }, "resolution": 1 // Limit the resolution to 1 decimal place } } }
  • 13. | Policy Definition (Mapped to Flux) { "period": "2h", // Set the retention period of the Policy bucket "measurements": { "temp_ave": { "from": "_Lora", temp_ave = from(bucket: "_Lora") |> range(start: <start>, stop: <stop>) "source": "sim.temp", |> filter(fn: (r) => r._measurement == "sim.temp" "filter": { "devName": "/Sim-Dev-1.*/", and (r.devName =~ /Sim-Dev-1.*/) "devEUI": null }, "fields": ["1", "2“], and (r._field == "1" or r._field == "2")) |> keep(columns: ["_time", "_field", "_value", "devName", "devEUI"]) "window": { "duration": "40s", |> aggregateWindow(every: 40s, fn: mean) "function": "average“ |> map(fn: (r) => ({ r with _time: experimental.addDuration(d: 20s, to: r._start)})) }, |> drop(columns: ["_start", "_stop"]) "resolution": 1 |> map(fn: (r) => ({ r with _value: rnd(x: r._value, n: 1)})) } } |> yield temp_ave }
  • 14. | Handling time periods Query period #1 t0 t0 - policy.period #results > 0 #results > 0 #results = 0 t1 t2 t3 The flux query is run when the policy or filter is defined / updated, and then every time we get a notification that a new value has been added to the source initial notification notification notification #4 #3 #2
  • 15. | Handling time periods with windows Query period #1 t0 t0 - policy.period notification #results > 0 #results > 0 notification #results = 0 notification #2 #3 #4 t1 t2 t3 When the policy includes a window we have to ensure we don’t leak data. • Always align windows to the same boundary • Only include full windows initial 00:00
  • 16. | Location Handling Location data can have particular value and security considerations. During ingest we calculate the S2 Cell Id for any point with location fields at a range of resolutions, e.g. Level 18 (27m), Level 16 (153m), Level 13 (850m), … We add a metadata value for each calculated level. Policy can then be used to filter only the level(s) a user is allowed to know Also looking at using the Flux Geo package to allow rules such as: “All sensors within xxx meters of this location” "filter": { "S2_Cell_13": null,
  • 17. | Policy Definition - Sampling { "period": "2h", // Limit data to last 2 hours "measurements": { "temp_sample": { // Derive a new measurement called “temp_sample” "from": "_Lora", // from the data source “_Lora” "source": "sim.temp", // and the measurement “sim.temp” "window": { "duration": "5m", "function": "sample", // Sample the values in 5 minute windows "frequency": 3, // Return every 3rd point "limit": 4 // with a limit of at most 4 points in each window }, } } }
  • 18. | Policy Definition - Sampling { "period": "2h", // Set the retention period of the Policy bucket "measurements": { "temp_sample": { "from": "_Lora", temp_sample = from(bucket: "_Lora") |> range(start: <start>, stop: <stop>) "source": "sim.temp", |> filter(fn: (r) => r._measurement == "sim.temp“) "window": { "duration": "5m", |> window(every: 5m) "function": "sample“, "frequency": 3, |> sample(n: 3, pos: 0) "limit": 4 |> limit(n: 4) }, |> drop(columns: ["_start", "_stop"]) } } |> yield temp_sample }
  • 19. | Creating a default policy or filter We can inspect a bucket and create a policy or filter definition which matches all of the data in the bucket filter: object of all of <key_name>: null filter_values: object of arrays giving <key_values> for each key fields: array of all <field_names> Default filter available to each user so they can inspect the data available to them from a policy, and modify as needed.
  • 20. Demo
  • 21. Thank You To find out more: https://configuredthings.com getconfigured@configuredthings.com