何时引发 EventGrid IoT 中心 DeviceConnected 和 DeviceDisconnected 事件

When are EventGrid IoT Hub DeviceConnected and DeviceDisconnected Events raised

IoT 中心通过事件网格发布事件“DeviceConnected”和“DeviceDisconnected”according to the documentation

我的问题是,实际物联网设备的哪个操作会触发这些事件?

对于“DeviceConnected”事件:

对于“DeviceDisconnected”事件:

我们目前已经实现了 here 所述的心跳模式,但我们想知道是否有更简单且最终更具成本效益的方法来实现相同的目标。

我在 documentation

中找到了这段话

The connection state is updated only for devices using MQTT or AMQP. Also, it is based on protocol-level pings (MQTT pings, or AMQP pings), and it can have a maximum delay of only 5 minutes. For these reasons, there can be false positives, such as devices reported as connected but that are disconnected.

这涵盖了我的大部分问题。