物联网学习日记6

1.Event和Reading关系
解析:Event has a one-to-many relationship with Reading.

2.Modbus设备
解析:电机控制器,接近传感器,恒温器,电表等。

3.CommandResponse
解析:Contains the target and parameters and expected responses, that describe a REST call.

4.GoKit logger
解析:package log provides a minimal interface for structured logging in services. It may be wrapped to encode conventions, enforce type-safety, provide leveled logging, and so on. It can be used for both typical application log events, and log-structured data streams.

5.规则引擎Data Dictionary
解析:
[1]Action:The command that is executed when a Condition is met.
[2]Condition:The object describing the device and its ValueCheck condition that embodies a Rule.
[3]Rule:The object containing the Condition and Action that define the Rule.
[4]ValueCheck:The mathematical expression evaluated for a Condition.

6.EdgeX系统管理代理[SMA]
解析:
[1]Metrics of a service
[2]Configuration of a service
[3]Start a service
[4]Stop a service
[5]Restart a service
[6]Health check on a service

7.EdgeX调度器Data Dictionary
解析:
[1]Interval:An object defining a specific “period” in time.
[2]IntervalAction:The action taken by a Service when the Interval occurs.

8.EdgeX Security特点
解析:
[1]Secret creation, store and retrieve [password, cert, access key etc.]
[2]API gateway for other existing EdgeX microservice REST APIs
[3]User account creation with optional either OAuth2 or JWT authentication
[4]User account with arbitrary Access Control List groups [ACL]

9.EdgeX应用服务
解析:Application Services will replace Export Services in a future EdgeX release.

10.客户端注册微服务
解析:输出客户端注册微服务让客户端注册为数据接收者,按需过滤流转数据。Clients on-gateway:包括本地分析服务,事件处理器,规则引擎等。Clients off-gateway:经典企业云系统或网关聚合系统,提供历史数据和更深层次数据分析能力。通过REST API创建新请求,更新存在请求,删除请求。

11.分发微服务
解析:分发微服务,基于EAI技术,管道过滤体系。通过消息队列,接收数据,过滤、传输和格式化数据,通过REST,MQTT,0MQ分发数据到特定注册客户端。

12.虚拟设备微服务
解析:模拟不同协议设备,生成Events and Readings到核心数据微服务,通过H2 database存储虚拟设备资源。用户通过命令微服务下发命令到。虚拟设备服务依赖数据微服务和元数据微服务,启动会ping核心数据和元数据微服务,超时时间600秒,未ping通,启动失败。虚拟设备服务启动初始化过程中,会在元数据微服务创建设备,设备配置,设备服务。

13.日志微服务
解析:通过RESTful APIs提交日志请求、查询历史日志、移除历史日志,用LOGBack做日志框架,可以通过文件或MongoDB持久化日志。

14.默认EdgeX Core Data发布数据事件主题
解析:EdgeX Core Data publishes data to the events topic on port 5563.

15.Addressables
解析:通过rest api设置一些设备的物理地址,device server的ip地址,端口号等信息。

POST to http://localhost:48081/api/v1/addressable

BODY: {"name":"camera1 address","protocol":"HTTP","address":"172.17.0.1","port":49999,"path":"/camera1","publisher":"none","user":"none","password":"none","topic":"none"}

16.value description
解析:主要是对某一个值的描述。

POST to http://localhost:48080/api/v1/valuedescriptor

BODY: {"name":"humancount",
"description":"people count", "min":"0","max":"100","type":"I","uomLabel":"count","defaultValue":"0","formatting":"%s","labels":["count","humans"]}

17.增加Device Profile
解析:

POST to http://localhost:48081/api/v1/deviceprofile/uploadfile

18.注册device service
解析:向meta data中发送post请求。

POST to http://localhost:48081/api/v1/deviceservice

BODY: {
"name":"camera control device service", //unique
"description":"Manage human and dog counting cameras",
"labels":["camera","counter"],
"adminState":"unlocked",//locked代表不响应任何command请求和发送device data
"operatingState":"enabled", //不能被其它的服务设置,是该服务操作状态的一个标志
"addressable":{"name":"camera control"}
}

19.创建设备
解析:提供设备必需在meta data server中将device profile、deivce service、addressable联系起来。

POST to http://localhost:48081/api/v1/device

BODY: {"name":"countcamera1",
"description":"human and dog counting camera #1",
"adminState":"unlocked",
"operatingState":"enabled",
"addressable":{"name":"camera1 address"},//addressable中的name
"labels":["camera","counter"],
"location":"",
"service":{"name":"camera control device service"},//device service中的name
"profile":{"name":"camera monitor profile"}}//device profile中的name

[1]GET to http://localhost:48081/api/v1/deviceservice:得到所有的deviceservice的信息
[2]GET to http://localhost:48081/api/v1/deviceservice/label/camera:得到label为camera的device service的信息

20.列出设备命令
解析:列出名字为countcamera1的设备的信息。

GET to http://localhost:48082/api/v1/device/name/countcamera1

21.查看一个值的描述
解析:

GET to http://localhost:48080/api/v1/valuedescriptor

22.调用command
解析:首先查看设备的命令列表得到相关的url,然后就可以调用了。

PUT to http://localhost:48082/api/v1/device/<system specific device id>/command/<system specific command id>

23.设备主动发送事件数据
解析:数据会以event的形式上报,通过对一个值的value decription来读取events。多个值通过key/value对组合成一个event进行发送。

POST to http://localhost:48080/api/v1/event

BODY: {"device":"countcamera1","readings":[{"name":"humancount","value":"5"},{"name":"caninecount","value":"3"}]}

也可以在每个value中添加一个时间戳:

BODY: {"device":"countcamera1","origin":1471806386919, "readings":[{"name":"humancount","value":"1","origin":1471806386919},{"name":"caninecount","value":"0","origin":1471806386919}]}

24.采集存到数据库中的设备的数据
解析:
[1]得到event的数量:GET to http://localhost:48080/api/v1/event/count
[2]获得countcameral设备的10条信息:GET to http://localhost:48080/api/v1/event/device/countcamera1/10
3]获得countcameral设备中关于humancount的10条数据:GET to http://localhost:48080/api/v1/reading/name/humancount/10

25.export设备的数据到云
解析:如果注册一个新的设备来接受core data中的数据,那么要注册export service。

POST to http://localhost:48071/api/v1/registration

参考文献:
[1]EdgeX Foundry理论篇:https://yq.aliyun.com/articles/608708
[2]edgex-foundry框架下的应用开发:https://blog.csdn.net/margin_0px/article/details/87879514

发布了400 篇原创文章 · 获赞 423 · 访问量 38万+

猜你喜欢

转载自blog.csdn.net/shengshengwang/article/details/104534907