object models for interoperability
Post on 15-Jan-2015
245 Views
Preview:
DESCRIPTION
TRANSCRIPT
M2M Protocol Interoperability MQTT CoAP HTTP REST Bridge Using IoT Toolkit and the Smart Object API
Michael J Koster michaeljohnkoster@gmail.com
IoT Toolkit Goals • Interoperability – Any ApplicaJon, any connected object, using any M2M protocol
• Simple API arJculated through data models and high level informaJon models
• PlaOorm-‐as-‐a-‐Service and gateway enabled • Open Source, IPR-‐free • Distributed, event-‐driven applicaJon soSware runs anywhere in the network
• Web standard protocols and best pracJces
API
IoT 1.0 – Things Connected to Apps
M2M CoAP
M2M MQ
M2M XMPP
M2M HTTP
App
API
App
API
App
API
App
• App runs on single service – Single Points Of Failure
• Each app wriYen to a custom API
• Diverse M2M is someJmes required but can inhibit interoperability
• SoSware, User data, and Things are trapped in Silos
• Difficult to connect new types of things and deploy new plaOorms
• Very difficult to share resources or connect across plaOorms
• Apps are not network-‐effect enabled
Connected Things, Sensors, Actuators, Data Sources
IoT 2.0 – Interoperability
M2M CoAP M2M
MQTT M2M XMPP
M2M HTTP
Smart Object API IoT Toolkit
Discovery
ApplicaJons
Data Models
• Object Model • REST + Event Model • M2M Abstrac9ons
IoT Toolkit
Connected Things, Sensors, Actuators, Data Sources
Model Database
• Easy to deploy new things and applicaJons using data models
• Write once, run anywhere soSware
• Any app to any thing via any M2M, use-‐case appropriate M2M
• Network effect enabled Machine
Models
Graph-‐Structured, Event-‐Driven, Real Time Distributed ApplicaJons
SO
SO
SO
Gateways Server Cloud Endpoints
• Sensors • Devices
ApplicaJon Components
And Resources
Databases
Registry -‐ Instances
Repository -‐ Models
Models
• Discovery • Persistence • ReplicaJon • Resource Access
• Data Models • Sensor Models • Machine Models • Templates
HTTP
MQTT
CoAP
XMPP HTTP
CoAP
MQTT
Smart Objects
What Is The Smart Object API? • Virtual RepresentaJon of a physical Smart Object • Object Model – Web Object EncapsulaJon of properJes
• REST API using JSON, XML, RDF, core-‐link-‐format representaJons
• Data Models – Linked Data descripJons, Resource Discovery and Linkage
• Event Model – Asynchronous M2M and applicaJon soSware event handlers
Object Model Web Object EncapsulaJon
Smart Object
Web protocol interfaces, also M2M e.g. MQTT, XMPP, …
Event Model Links data with acJons Pub-‐Sub and event handlers
Encapsulates local soSware components and handlers
Self-‐describing data model For Resource Discovery
and Linkage, RDF and core-‐link-‐format
Sensor or other data JSON, XML, data feeds
API – DescripJon (Data Model)
• Contains graphs describing the resource data model
• RDF triples in many popular representaJons – create (POST) loads a graph into the descripJon delete (DELETE) removes a graph or subgraph from the descripJon
– set (PUT) updates a graph or subgraph – get (GET) returns a graph or subgraph
• SemanJc Proxy for core-‐link-‐format compaJbility
API – Observable Property
• Represents sensor data or a data feed • Can be JSON, xml, text, or other content type – create (POST): make new observable property – delete (DELETE) remove observable property – set (PUT) update ObservaJon Value or data feed – get (GET) returns the current ObservaJon Value
• Formats for embedded Jme + locaJon data
API – Agent
• Container for Event Handlers, soSware components invoked within the local context of a Smart Object
• Observer class invokes Event Handler code in the Agent
• Reference ImplementaJon – create (POST) make a new code object instance
• handler or daemon – delete (DELETE) remove code instance – set (PUT) updates segng of a code instance – get (GET) returns segng of a code instance
API – Observers
• Contains graphs which define the nodes and endpoints of event driven processing
• Publish, Subscribe, and Event Handler paYerns • Reference ImplementaJon – create (POST) make a new Observer – set (PUT) update an Observer’s segngs – get (GET) return an Observer’s segngs – delete (DELETE) remove an Observer
Smart Object Structure – Object Model
Smart Object
DescripJon
ObservableProperty
ObservableProperty…
Agent
Publisher Subscriber Handler
PropertyOfInterest
DescripJon
Observers
Handler Instance Daemon
Default Property
REST API • Python API – Local SoSware, Agents and Handlers – Resources (objects) are hierarchical properJes of other resources
– self.indoorTempValue = sensors.weather.indoor_temp.get()!
• Web API – HYp and CoAP REST Client access, MQTT topics – Resources are organized in hierarchical path – GET http:my_server:8000/sensors/weather/indoor_temp!– GET coap:my_server:5683/sensors/weather/indoor_temp!– MQTT subscribe my_server:1883 /sensors/weather/indoor_temp!
• Default Property – Returns a resource associated with a higher level resource – GET of Smart Object returns it’s DescripJon; GET of Observable Property returns it’s ObservaJon Value
Protocol Bridge Examples
• MQTT Endpoints and Bridge using Observer • CoAP Server Endpoint and link-‐data Proxy
MQTT Observer
MQTT Broker
REST Endpoint ObservableProperty
mqYObserver
PUT GET
Publish from data producer
Publish From REST API
Publish to Other Subscribers
SUB Publish to REST API
Connects REST Resource to MQTT Topic Publish and Subscribe
MQTT Observer
MQTT Broker
REST Endpoint ObservableProperty
mqYObserver
PUT GET
Publish from data producer
Publish From REST API
Publish to Other Subscribers
SUB Publish to REST API
Publisher Publishes REST Resource updates to the broker
MQTT Observer
MQTT Broker
REST Endpoint ObservableProperty
mqYObserver
PUT GET
Publish from data producer
Publish From REST API
Publish to Other Subscribers
SUB Publish to REST API
Subscriber Makes last published data available at the REST endpoint
MQTT Observer
MQTT Broker
REST Endpoint ObservableProperty
mqYObserver
PUT GET
Publish from data producer
Publish From REST API
Publish to Other Subscribers
SUB Publish to REST API
Pub+Sub Repeats data updates in both direcJons
MQTT Bridge to mulJple REST endpoints
MQTT Broker
REST Endpoint ObservableProperty
mqYObserver
PUT GET
Publish from data producer
Publish to Other Subscribers
REST Endpoint ObservableProperty
mqYObserver
PUT GET
CoAP Server Endpoint
Smart Object
JSON
JSON
JSON
RDF
SemanJc Proxy
RDF
link-‐format
• CompaJble Object Models
• Observer paYern • Standard JSON Resources
• SemanJc Proxy exposes stored RDF via core-‐link-‐format GET/POST operaJons
IoT Toolkit Protocol Interoperability
CoAP
MQTT
MQTT HTTP
smartobjectservice.com
ec2-‐54-‐200-‐106-‐25.us-‐west-‐2.compute.amazonaws.com
IoT Toolkit
• IoT Toolkit is a reference implementaJon of the Smart Object API and related tools
• REST API with real-‐Jme event model for the Internet of Things
• Lightweight server that can run on small computers e.g. Raspberry Pi, ARM/Linux PC, AWS t1.micro
• M2M using HTTP, MQTT, and CoAP, others
IoT Toolkit Project Status • Smart Object API is complete and stable • IoT Toolkit Demo • M2M interoperability: MQTT, CoAP, HTTP interfaces • Development Roadmap Examples – Harden code, excepJon handling, API Tests – Scalable server, mulJ-‐tenancy, persistence models – Graph-‐based resource access control – Data model API for resource discovery and linkage – XMPP endpoint and proxy for XEP-‐0060, XEP-‐0323, XEP-‐0325
– Programming model UI e.g. Node Red – Web UI for debug and demo, applicaJons
• Navigator, Dashboard, AnalyJcs, Graphs and Charts
top related