Azure IoT 中心 AMQP 通信多路复用 [英] Azure IoT Hub AMQP Communication Multiplexing

查看:35
本文介绍了Azure IoT 中心 AMQP 通信多路复用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一些 Microsoft 文档中在使用 Azure IoT 中心时,它提到可以在单个 TLS 连接(使用 AMQP 协议)下多路复用多个设备的通信,用于多个简单设备与一个功能强大的本地中心设备通信的场景物联网中心.是否有任何示例说明如何实现这种多路复用?DeviceClient 库 似乎不支持这一点(尽管我可以错误的).也有人提到了用于此场景的 IoT 网关 SDK,但我还没有找到有关如何使用它设置多路复用的明确示例.对其他材料的任何建议或参考将不胜感激.

In some of the Microsoft documentation for working with Azure IoT hubs, it mentions that it is possible to multiplex the communication of multiple devices under a single TLS connection (using the AMQP protocol) for scenarios where multiple simple devices talk to a local hub device that is powerful enough to communicate with the IoT Hub. Are there any examples of how one would implement this multiplexing? The DeviceClient library does not appear to support this (although I could be wrong). There have also been mentions of the IoT Gateway SDK for this scenario, but I haven't found a clear example of how to set multiplexing up using that either. Any advice or references to other material would be appreciated.

推荐答案

我最近搭建了一个这样的架构,或许可以作为参考.我们的玩家:

I've recently built such an architecture, maybe it will help you as a reference. Our players:

  • 现场网关 - 一个足够强大的本地中心,可以处理与 IoT 中心的通信并从边缘传感器接收数据.
  • 边缘传感器 - 无法直接连接到 IoT 中心的设备,但实施了一些通信协议,使它们能够连接到现场网关(Zwave、Zigbee...).
  • IoT 中心 - 处理现场网关和中心之间的 D2C 和 C2D.
  • 后端服务器 - 从 IoT 中心接收数据.
  • Field Gateway - A local hub that is strong enough to handle communication to the IoT Hub and receive data from edge sensors.
  • Edge Sensors - devices that are unable to connect directly to the IoT Hub but implement some communication protocol that enable them to connect to the field gateway(Zwave, Zigbee...).
  • IoT Hub - Handles the D2C and C2D between the Field Gateway and the Hub.
  • Back end server - Receives the data from the IoT Hub.

边缘传感器将其遥测数据发送到现场网关.现场网关保持与 IoT 中心的连接,而 IoT 中心唯一知道的设备是现场网关.

The Edge Sensor sends their telemetry to the Field Gateway. The Field Gateway maintains a connection to the IoT Hub and the only device that the IoT Hub knows is the Field Gateway.

在现场网关中从边缘传感器接收到的每个遥测数据在消息负载中都包含一个唯一的 ID.

Each telemetry that is being received in the Field Gateway from the Edge Sensors contains a unique id in the message payload.

当 IoT 中心接收到消息时,IoT 中心只知道现场网关.但是,当后端处理消息时,它会从有效负载中获取唯一 ID,因此知道哪个是发送遥测数据的正确设备.

When the message is being received in the IoT Hub, The IoT Hub knows only about the Field Gateway. But when the message is being processed by the Back End it takes the unique id from the payload and therefore knows which is the correct device that sent the telemetry.

所以我们有多个设备都在一个连接上运行".

So we have multiple devices that are all "riding" on one connection.

希望它会有所帮助.

这篇关于Azure IoT 中心 AMQP 通信多路复用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆