gpt4 book ai didi

azure - 从 1000 台设备获取连接状态的最佳方式 - Azure IoTHub

转载 作者:行者123 更新时间:2023-12-02 07:32:07 25 4
gpt4 key购买 nike

从 1000 个设备中获取 connectionState 的最佳方式。目前设备不多,但需要一个高效的解决方案。

根据我的理解,目前我可以使用

获取 connectionState
  1. IotHub Queries(select * from devices)registryManager.GetDevicesAsync(100); -- 这些方法在查询 1000 个设备时不是实时的,或者不会当设备数量增加时保持高效。
  2. HeartBeat - 我不喜欢这个,因为当设备数量很大时,这会导致配额重载,从而导致发送太多消息。
  3. 操作监控/诊断监控 - 第一个很好,但到 2018 年 10 月已被弃用,第二个需要大约 2 分钟才能在 eventhub 中获取消息(我自己尝试过并发现了这种延迟)。

请提出一些方法,如果我对上述任何内容有误,请纠正我。

最佳答案

ConnectionState 字段仅建议在开发和调试期间使用,而不是在产品解决方案中使用。

检索连接状态存在限制,因为 Maximum number of device identities returned in a single call is 1000 .

如果您的 IoT 解决方案需要了解设备是否已连接,您应该实现 heartbeat pattern .

考虑到您关心的心跳开销,您可以使用此 API 设置较小的超时时间:DeviceClient.OperationTimeoutInMilliseconds

This pattern achieves the same result as maintaining a device connection state registry using the heartbeat pattern, while being more efficient.

关于azure - 从 1000 台设备获取连接状态的最佳方式 - Azure IoTHub,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49877178/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com