🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# 物理模型 [TOC] ## 1、节点为设备物理模型 | 标签名 | 作用 | | --- | --- | | nodeType | 节点类型 dev/net | | properties | 属性 | ``` { "nodeType": "dev", "properties": { "identifier1": { "dataType": "int", "length": "", "small_num": "", "history": "on" }, "identifier2": { "dataType": "int", "length": "", "small_num": "", "history": "on" }, "identifier3": { "dataType": "int", "length": "", "small_num": "", "history": "on" } } } ``` ## 2、节点为网关物理模型 ``` { "nodeType": "net", "properties": { "netInfo": { "identifier1": { "dataType": "int", "length": "", "small_num": "", "history": "on" }, "identifier2": { "dataType": "int", "length": "", "small_num": "", "history": "on" } }, "devices": { "identifier1": { "dataType": "int", "length": "", "small_num": "", "history": "on" }, "identifier2": { "dataType": "int", "length": "", "small_num": "", "history": "on" }, "identifier3": { "dataType": "int", "length": "", "small_num": "", "history": "on" } } } } ``` ## 返回给硬件工程师得物理模型(未完成,参考) | 标签名 | 作用 | | --- | --- | ``` { "schema": "https://iotx-tsl.oss-ap-southeast-1.aliyuncs.com/schema.json", "profile": { "productKey": "a1nP2wiw40C" }, "services": [ { "outputData": [], "identifier": "set", "inputData": [ { "identifier": "switch", "dataType": { "specs": { "0": "关闭", "1": "开启" }, "type": "enum" }, "name": "开关状态" }, { "identifier": "Temperature", "dataType": { "specs": { "unit": "°C", "min": "-20", "max": "100", "step": "0.1" }, "type": "double" }, "name": "温度" } ], "method": "thing.service.property.set", "name": "set", "required": true, "callType": "async", "desc": "属性设置" }, { "outputData": [ { "identifier": "switch", "dataType": { "specs": { "0": "关闭", "1": "开启" }, "type": "enum" }, "name": "开关状态" }, { "identifier": "Temperature", "dataType": { "specs": { "unit": "°C", "min": "-20", "max": "100", "step": "0.1" }, "type": "double" }, "name": "温度" }, { "identifier": "Pa", "dataType": { "specs": { "unit": "kW", "min": "-10000000000", "unitName": "千瓦", "max": "10000000000", "step": "0.01" }, "type": "double" }, "name": "A相有功功率" } ], "identifier": "get", "inputData": [ "switch", "Temperature", "Pa" ], "method": "thing.service.property.get", "name": "get", "required": true, "callType": "async", "desc": "属性获取" }, { "outputData": [ { "identifier": "switch_on", "dataType": { "specs": { "min": "0", "max": "1", "step": "1" }, "type": "int" }, "name": "开启开关" } ], "identifier": "switch_console", "inputData": [ { "identifier": "switch_on", "dataType": { "specs": { "min": "0", "max": "1", "step": "1" }, "type": "int" }, "name": "开启" } ], "method": "thing.service.switch_console", "name": "控制开关状态", "required": false, "callType": "sync" } ], "properties": [ { "identifier": "switch", "dataType": { "specs": { "0": "关闭", "1": "开启" }, "type": "enum" }, "name": "开关状态", "accessMode": "rw", "required": true, "desc": "开关状态" }, { "identifier": "Temperature", "dataType": { "specs": { "unit": "°C", "min": "-20", "max": "100", "step": "0.1" }, "type": "double" }, "name": "温度", "accessMode": "rw", "required": false }, { "identifier": "Pa", "dataType": { "specs": { "unit": "kW", "min": "-10000000000", "unitName": "千瓦", "max": "10000000000", "step": "0.01" }, "type": "double" }, "name": "A相有功功率", "accessMode": "r", "required": false } ], "events": [ { "outputData": [ { "identifier": "switch", "dataType": { "specs": { "0": "关闭", "1": "开启" }, "type": "enum" }, "name": "开关状态" }, { "identifier": "Temperature", "dataType": { "specs": { "unit": "°C", "min": "-20", "max": "100", "step": "0.1" }, "type": "double" }, "name": "温度" }, { "identifier": "Pa", "dataType": { "specs": { "unit": "kW", "min": "-10000000000", "unitName": "千瓦", "max": "10000000000", "step": "0.01" }, "type": "double" }, "name": "A相有功功率" } ], "identifier": "post", "method": "thing.event.property.post", "name": "post", "type": "info", "required": true, "desc": "属性上报" }, { "outputData": [ { "identifier": "switch_on", "dataType": { "specs": { "min": "0", "max": "1", "step": "1" }, "type": "int" }, "name": "开关开启" } ], "identifier": "switch_status", "method": "thing.event.switch_status.post", "name": "开关的状态", "type": "error", "required": false } ] } ```