Rule Engine defines different fixed basic message formats for different message sources, providing a basis for rule-based SQL processing.
Device data point message is formatted as follows:
Parameter | Property | Type | Description | |
---|---|---|---|---|
sysProperty | messageType | string | Message type: fixed as deviceDatapoint | |
productId | string | Product id | ||
appProperty | deviceId | string | Device ID | |
dataTimestamp | int | A timestamp that specifies when the device data point occurred, in milliseconds, which can be carried as defined by user when uploaded to the device. | ||
datastream | string | Data stream name | ||
body | Object/string/... | Data point message details |
Json Example 1: Json Data
{
"sysProperty": {
"messageType": "deviceDatapoint",
"productId": "90273",
},
"appProperty":{
"deviceId": "102839",
"dataTimestamp": 15980987429000,
"datastream":"weather"
},
"body":{
"temperature": 30,
"humidity": "47%"
}
}
Json Example 2: Numeric Data
{
"sysProperty": {
"messageType": "deviceDatapoint",
"productId": "90273",
},
"appProperty":{
"deviceId": "102839",
"dataTimestamp": 15980987429000,
"datastream":"temperature"
},
"body": 10
}
Json Example 3: String
{
"sysProperty": {
"messageType": "deviceDatapoint",
"productId": "90273",
},
"appProperty":{
"deviceId": "102839",
"dataTimestamp": 15980987429000,
"datastream":"weather"
},
"body":"sunny with wind"
}
Json Example 4: Binary Data
Note:
{
"sysProperty": {
"messageType": "deviceDatapoint",
"productId": "90273",
},
"appProperty":{
"deviceId": "102839",
"dataTimestamp": 15980987429000,
"datastream":"weather"
},
"body":{
"index": "3491506_1475204886914_bin"
}
}
The device lifecycle event message format is as follows:
Parameter | Property | Type | Description |
---|---|---|---|
sysProperty | messageType | string | Message type: fixed as deviceLifeCycle |
productId | string | Product id | |
appProperty | deviceId | string | Device ID |
dataTimestamp | int | A timestamp that specifies when the device message occurred, in milliseconds | |
body | object | Created, deleted, online, offline created/deleted/online/offline |
Json Example
{
"sysProperty": {
"messageType": "deviceLifeCycle",
"productId": "90273",
},
"appProperty":{
"deviceId": "102839",
"dataTimestamp": 15980987429000,
},
"body":{
"event": "online"
}
}