提供参考的网站:
- www.eclipse.org/om2m
- https://iot.eclipse.org
- 论坛:http://www.eclipse.org/forums/eclipse.om2m
[TOC]
Om2m是一个横向的M2M(machine to machine)服务平台,目的是使得应用开发e和底层网络分离,适配各种异构设备。
OM2M提供一些RESTful API来创建和管理M2M资源。 它包括几个程序以实现机器认证,资源发现,应用程序注册,容器管理,同步和异步通信,访问权限授权,组织组织,重定向等
名词解释
This API operates on the following primary resource types:
- CseBase(Common Services Entity): describes the hosting CSE, and is the root for all other resources within the hosting CSE.(所有资源的根)
- remoteCse: stores information related to M2M CSEs residing on other M2M machines after successful mutual authentication. It enables Cses interactions using retargeting operations(CSE业务之间交互)
- AE(Application Entity): stores information about the Application Entity after a successful registration on the hosting CSE.(存应用实体信息)
- Container: acts as a mediator for data buffering to enable data exchange between applications and CSEs(数据缓存中介容器)
- AccessControlPolicies: manages permissions and permissions holders to limit and protect the access to the resource tree structure.(访问权限管理)
- Group: enhances resources tree operations and simplifying the interactions on the API interfaces by adding the grouping feature. It enables an issuer to send one request to a set of receivers instead of sending requests one by one.(群发)
- Subscription: stores information related to subscriptions for some resources. It allow subscribers to receive asynchronous notification when an event happens such as the reception of new sensor event or the creation, update, or delete of a resource.(通知)
注:CSE(CommonchannelSignalingEquipment),公共信道信令设备.公共信道信令系统提供的几种可能的电信业务之一,用于某种特殊业务进行信息传递。
- IN-CSE(Infrastructure Node CSE):can be seen as a centralized server deployed on the cloud.
- MN-CSE (Middle Node CSE):can be sees as a gateway deployed locally.
MNs has the possibility to register to IN and so enable one to obtain a highly distributed architecture covering various use cases.
You can consider an IoT architecture including only one IN if your prefer a centralized architecture, however this use case is not interesting because it requires that all your devices and applications are capable to reach the IN which is not the case for small sensors. The MN can act as a proxy to connect local constrained devices to the IN.
You can also consider an IoT architecture including only one MN deployed locally if you don’t need a centralized server, however this is not so recommended because it requires the MN to answer to all coming requests. In general, the MN is a constrained device which may represent a single point of failure in this case. Imagine a use case where your sensors are not deployed on the place which requires more than one MN. In this case, the IN will be the intermediate between all existing MNs.
For me, it is better to have a distributed IoT architecture including one IN and several MNs deployed in several places. The IN will be in charge to re-targeting requests from a Node to another in a seamless way. Applications can be deployed on the IN or on the MNs according to your needs. Each node can host customized services like cool dashboard in the IN, or dedicated interworking proxies in the MNs to connect local vendor-specific devices.
- Mca reference point is used to interface an AE and CSE
- Mcc reference point is used to interface CSEs
- 可以有多个IN-CSE
- OM2M基于JAVA的OSGi框架开发
oneM2M架构
通信流程
M2M通信有以下流程
- 注册:灯应用实体、网关应用、数据资源的访问权限控制创建
- 资源初始化:包括分组资源创建、特定访问通道的容器资源创建、实例资源的创建(初始化灯状态)、subscription resources creation for notifications
- 容器发现:网关检测满足特定过滤条件的容器并将它们编入分组
- 发现和检索灯的状态:智能手机通过M2M服务平台使用资源认证的方式检索特定过滤条件的容器
- 控制灯的开关:
上面流程的请求和响应都是通过oneM2M HTTP协议,使用XMXL和JSON传输数据.例如控制关灯的请求:
HTTP Request with XML payload
HTTP Response
|
|
注册流程
资源创建
在MN-CSE中创建container,灯的状态存储在MN-CSE中
容器发现
Discovery & Content Instance Retrieval
群容器:
light control
控制单个灯状态:
群控制: