Managing context information at large scale presentation by Fermín Galán Márquez (@fermingalan) for Developers Week
(Madrid, March 2nd 2015)
www.fiware.org
4. Being “Smart” requires first being “Aware”
• Implementing a Smart Application requires gathering and
managing context information
• Context information refers to the values of attributes
characterizing entities relevant to the application
4
Bus
• Location
• No. passengers
• Driver
• Licence plate
Citizen
• Name-Surname
• Birthday
• Preferences
• Location
• ToDo list
Shop
• Location
• Business name
• Franchise
• offerings
Context Information
Application
5. Being “Smart” requires first being “Aware”
• Implementing a Smart Application requires gathering and
managing context information
• Context information refers to the values of attributes
characterizing entities relevant to the application
5
Boiler
• Manufacturer
• Last revision
• Product id
• temperature
Users
• Name-Surname
• Birthday
• Preferences
• Location
• ToDo list
Flowerpot
• Humidity
• Watering plan
Context Information
Application
6. Different sources of context need to be handle
• Context information may come from many sources:
– Existing systems
– Users, through mobile apps
– Sensor networks (Internet of Things)
• Source of info for a given entity.attribute may vary over
time
6
Place = “X”, temperature = 30º
What’s the current
temperature in place “X”?
Standard API
A sensor in a
pedestrian street
The Public Bus Transport
Management systemA person from his smartphone
It’s too hot!
Notify me the changes of
temperature in place “X”
7. A non-intrusive approach is required
• Capable to integrate with existing or future systems dealing with
management of municipal services without impact in their
architectures
• Info about attributes of one entity may come from different
systems, which work either as Context Producers or Context
Providers
• Applications rely on a single model adapting to systems of each city
7
Application/Service
Standard API
System A System B
Context Producer Context Provider
attribute “location” attribute “driver”
8. FIWARE NGSI: “The SNMP for IoT”
• Capturing data from, or Acting upon, IoT devices becomes
as easy as to read/change the value of attributes linked to
context entities using a Context Broker
8
Context Broker
NGSI APINGSI API
GET <Oauth token>
/V1/contextEntities/lamp1/attributes/presenceSensor
PUT <Oauth token>
/V1/contextEntities/lamp1/attributes/status
“light on”
Setting up the value of attribute
“status” to “light on” triggers
execution of a function in the IoT
device that switches the lamp on
Issuing a get operation on the
“presenceSensor” attribute
enables the application to get
info about presence of people
near the lamp
9. Connecting to the Internet of Things
• Capturing data from, or Acting upon, IoT devices becomes
as easy as to read/change the value of attributes linked to
context entities using a Context Broker
9
Context Broker
Standard APIStandard API
GET <Oauth token>
/V1/contextEntities/lamp1/attributes/presenceSensor
PUT <Oauth token>
/V1/contextEntities/lamp1/attributes/status
“light on”
Setting up the value of attribute
“status” to “watering” triggers
execution of a function in the IoT
device that waters the plant
Issuing a get operation on the
“humidity” attribute enables the
application to find out whether
the plant has to be watered
10. Context Management in FIWARE
• The FIWARE Context Broker GE implements the OMA NGSI-
9/10 API: a simple yet powerful standard API for managing
Context information complying with the requirements of a
smart city
• The FIWARE NGSI API is Restful: any web/backend
programmer gets quickly used to it
10
Application/Service
Context Broker
NGSI API
Boiler
• Manufacturer
• Last revision
• Product id
• temperature
Users
• Name-Surname
• Birthday
• Preferences
• Location
• ToDo list
Flowerpot
• Humidity
• Watering plan
16. Context Broker in a nutshell
16
Context Broker GE
Context
Producers
Context
Consumers
subscriptions
update
query
notify
notify
update
update
17. Context Management at the heart of FIWARE
17
CKAN
Big Data
Context Broker
Accounting&Payment&Billing
IDM&Auth
Short-term
historic
data
BigData
Processing
Data
Quering/Action,
Publish/Subscr
Open Data
publishing
Real-time
processing
BI
ETL
RULES
DEFINITION
TOOL
OPERATIONAL
DASHBOARD
KPI GOVERNANCE OPEN DATA PORTALS
Service
orchestrator
Context
Adapters
CEP
IoT Backend
Device Management
measures /
commands
IoT Broker & Config
Management
(from sensors to things)
IoT/Senso
r
Open Dataactuators
Media
streams
Real Time
Media
Stream
Processing
City Services
GIS
Inventory
Specific Enablers
Generic Enablers
18. Orion features
• Real-time context production and consumption
• Push & pull context consumption
• Geo-location aware
• Scalable
• Multi-tenancy
• Security
– Using FIWARE general framework OAuth2-based
18
30. Standard based context management
• Context Management in FIWARE is standard based
– Open Mobile Alliance (OMA) Next Generation Service Interfaces (NGSI)
9/10
30
Attributes
• Name
• Type
• Value
Entity
• EntityId
• EntityType
1 n
“has”
31. Integration with sensor networks
• The backend IoT Device Management GE enables creation and
configuration of NGSI IoT Agents that connect to sensor networks
• Each NGSI IoT Agent can behave as Context Consumers or Context
Providers, or both
31
FIWARE Context Broker
IoT
Agent-1
IoT
Agent-2
IoT
Agent-n
IoT Agent
Manager
create/monitor
FIWARE Backend IoT
Device Management
OMA NGSI API (northbound interface)
(southbound interfaces)
MQTTETSI M2M IETF CoAP
32. 32
• Federation of infrastructures (private/public regions)
• Automated GE deploymentCloud
• Complete Context Management Platform
• Integration of Data and Media ContentData
•Easy plug&play of devices using multiple protocols
•Automated Measurements/Action Context updatesIoT
•Visualization of data (operation dashboards)
•Publication of data sets/servicesApps
•Easy support of UIs with advanced web-based 3D and AR
capabilities
•Visual representation of context information.
Web UI
•Advanced networking capabilities (SDN) and Middleware
•Interface to robotsI2ND
•Security Monitoring
•Built-in Identity/Access/Privacy ManagementSecurity
Context Management in FIWARE
33. FI-WARE Context/Data Management Platform
33
Context/Data Management Platform
Applications
OMA NGSI-9/10
Processing/Analysis
Algorithms
Gathered data is
injected for
processing/analysis
Distributed
Context
Sources Complex Event
Processing
(PROTON)
BigData
(COSMOS)
Processed data is
injected for
processing/analysi
s
Data generated either by CEP
or BigData is published
Gathered data injected
for CEP-like processing
Direct
bigdata
injection
Programming of
rules
35. Weather Bot
• Running at FIWARE Campus stand
35
FIWARE
Lab
Cloud
IoTA
Orion
orionlive.fiware.org
Campus Party
Net
Internet
REST client REST client REST client
…
UDP 60001
orion2twitter
Internet
Internet
@FIWAREOrionLiveTCP 80
36. FIWARE Overall Architecture
36
CKAN
Big Data
Context Broker
Accounting&Payment&Billing
IDM&Auth
Short-term
historic
data
BigData
Processing
Data
Quering/Action,
Publish/Subscr
Open Data
publishing
Real-time
processing
BI
ETL
RULES
DEFINITION
TOOL
OPERATIONAL
DASHBOARD
KPI GOVERNANCE OPEN DATA PORTALS
Service
orchestrator
Context
Adapters
CEP
IoT Backend
Device Management
measures /
commands
IoT Broker & Config
Management
(from sensors to things)
IoT/Senso
r
Open Dataactuators
Media
streams
Real Time
Media
Stream
Processing
City Services
GIS
Inventory
Specific Enablers
Generic Enablers
Editor's Notes
What is context management?
Why use the context management parading in applications?
Taking into account these two cases, we can see two of the main values of context management as design paradigm for applications. First, its simplicity. Everything is about entities and attributes. No complex modeling needed. No complex data relationships or complicated SQL statements to get your data. Modeling your application in terms of entities and attributes is generally easy, as these concepts naturally arise from your application design. Second, its flexibility. Context is a rather generic concept, so it is suited for many applications, no matter whether the application is related to weather measurement, traffic or whatever other domain. As part of this flexibility, take into account that an entity doesn’t necessarily model things in the real world (such as sensors or cars). It can also model things in the virtual world, such as an “alarm” in a trouble ticket system (which doesn’t have any physical representation and only exists within the IT system which manages alarms).
Taking into account these two cases, we can see two of the main values of context management as design paradigm for applications. First, its simplicity. Everything is about entities and attributes. No complex modeling needed. No complex data relationships or complicated SQL statements to get your data. Modeling your application in terms of entities and attributes is generally easy, as these concepts naturally arise from your application design. Second, its flexibility. Context is a rather generic concept, so it is suited for many applications, no matter whether the application is related to weather measurement, traffic or whatever other domain. As part of this flexibility, take into account that an entity doesn’t necessarily model things in the real world (such as sensors or cars). It can also model things in the virtual world, such as an “alarm” in a trouble ticket system (which doesn’t have any physical representation and only exists within the IT system which manages alarms).
Why use the context management parading in applications?
How to implement context management? -> Orion Context Broker
Context management as provided by FIWARE introduces two basic actors: context producers and context consumers. Context producers are the sources of context, the ones that create or update context information. A typical case of context producer is a sensor measuring some metrics. On the other side, context consumers are the sinks for context, the ones that receive context information and do something interesting with it. Of course, the particular actions to do depend on the application. For example, it could draw the temperature evolution over time in a chart or provide dress tips to users (“don’t forget your coat, it’s cold out there!”) depending on the weather context in the case of a weather application. Another example could be recommending alternative routes to a driver based on the overall traffic context of the city, in the case of a traffic application.
It is important to note that producer and consumer are independent roles. Although a given application may play both roles at the same time (for example, a smartphone application running in a smartphone that at the same time produces some context information measured by the phone and consumes context coming from other sources), context consumers don’t need to know about producers and vice versa. Some big applications have some parts playing the producer role and others playing the consumer role to provide a global service. For example, a weather application could have two parts: the first one runs in the sensors (context producers) and the second in the users’ smartphones (context consumers) to provide real-time weather information and recommendations.
How to implement context management? -> Orion Context Broker
References:
Málaga City Sense:
Video: https://www.youtube.com/watch?v=2kkJb7VpwB8
Blogpost: http://www.fiware.org/2014/11/19/malaga-citysense-citizen-as-a-sensor/
FI-Guardian
Video: https://www.youtube.com/watch?v=UKfHfZRbZZA
FoneSense:
Vídeo: https://www.youtube.com/watch?v=1GdfIJslF_0
EsAccesible
Video (Spanish): https://www.youtube.com/watch?v=Md2ZRL10PNM