我们正在与Azure IoT集线器合作,它将数据发送到Azure,并且我们正在使用TSI从它获取数据。
格式的数据-
原始的遥测数据看起来-
{"status":0, "timestamp":123456, plc_id:1}
{"status":0, "timestamp":123456, plc_id:1}
{"status":0, "timestamp":123456, plc_id:1}
{"status":0, "timestamp":123456, plc_id:1}
{"status":1, "timestamp":123456, plc_id:1}
{"status":1, "timestamp":123456, plc_id:1}
{"status":1, "timestamp":123456, plc_id:1}
{"status":1, "timestamp":123456, plc_id:1}
{"status":0, "timestamp":123456, plc_id:1}例如,我在时间戳中使用了123456。
我需要计算停机时间(最后一次出现0-第一次出现0 ),然后忽略状态1,再次计算1之后下一个0的停机时间。
我们只需要使用TSI Rest来完成这个任务。有什么想法吗?
发布于 2022-01-07 19:56:54
TSI查询引擎不提供事件之间的加窗计算。通过比较两个时间戳计算停机时间是不可能的。
TSI只支持基于时间间隔的窗口化,使用聚合序列API。您需要使用GetEvents API检索原始事件,并在客户端执行/应用自定义窗口计算。
https://stackoverflow.com/questions/70185581
复制相似问题