基礎消息格式

規則引擎對不同的消息源定義了不同的固定基礎消息格式,作為規則SQL的處理依據

设备数据点消息

設備數據點消息

設備數據點消息數據格式如下:

參數 屬性 類型 說明
sysProperty messageType string 消息類型:固定為deviceDatapoint
productId string 產品ID
appProperty deviceId string 設備ID
dataTimestamp int 設備數據點生產時間戳記,單位毫秒,設備上載時可自訂攜帶
datastream string 數據流名稱
body object/string/... 詳細的數據點消息內容

數據json示例1,json數據

{
    "sysProperty": {
        "messageType": "deviceDatapoint",
        "productId": "90273",
    },
    "appProperty":{
        "deviceId": "102839",
        "dataTimestamp": 15980987429000,
        "datastream":"weather"
    },
    "body":{
        "temperature": 30,
        "humidity": "47%"
    }
}

數據json示例2,數值型數據

{
    "sysProperty": {
        "messageType": "deviceDatapoint",
        "productId": "90273",
    },
    "appProperty":{
        "deviceId": "102839",
        "dataTimestamp": 15980987429000,
        "datastream":"temperature"
    },
    "body": 10
}

數據json示例3,字串型數據

{
    "sysProperty": {
        "messageType": "deviceDatapoint",
        "productId": "90273",
    },
    "appProperty":{
        "deviceId": "102839",
        "dataTimestamp": 15980987429000,
        "datastream":"weather"
    },
    "body":"sunny with wind"
}

數據json示例4,二進位數據

说明: 數據格式為二進位數據時,body中數據為二進位數據的索引號index,示例如下,用戶可以通過該索引號通過API獲取該數據

{
    "sysProperty": {
        "messageType": "deviceDatapoint",
        "productId": "90273",
    },
    "appProperty":{
        "deviceId": "102839",
        "dataTimestamp": 15980987429000,
        "datastream":"weather"
    },
    "body":{
        "index": "3491506_1475204886914_bin"
    }
}

設備生命周期事件消息

設備生命週期事件消息數據格式如下:

參數 屬性 類型 說明
sysProperty messageType string 消息類型:固定為deviceLifeCycle
productId string 產品ID
appProperty deviceId string 設備ID
dataTimestamp int 設備消息生產時間戳記,單位毫秒
body object 創建、刪除、上線、離線created/deleted/online/offline

數據json示例

{
    "sysProperty": {
        "messageType": "deviceLifeCycle",
        "productId": "90273",
    },
    "appProperty":{
        "deviceId": "102839",
        "dataTimestamp": 15980987429000,
    },
    "body":{
        "event": "online"
    }
}

个搜索结果,搜索内容 “

    0 个搜索结果,搜索内容 “