简体   繁体   English

IoT中心中的设备原理

[英]Device principle in IoT Hub

I am using an IoT Hub to send telemetric to an IoT Hub. 我正在使用IoT中心将遥测发送到IoT中心。 This is working fine but I am a bit unsure on how to set the deviceid. 这工作正常,但是我不确定如何设置设备ID。

Eg the following scenario I have 100 buildings with 1-5 cooling system. 例如以下情况,我有100座带有1-5冷却系统的建筑物。 There are 8 different types of cooling systems (depend on size of building). 有8种不同类型的冷却系统(取决于建筑物的大小)。 Each of the cooling systems has a number of sensors and all of these sensor data are sendt to a computer in the building. 每个冷却系统都有许多传感器,所有这些传感器数据都发送到建筑物中的计算机。 This computer is connected to the IoT hub and sends this info to Azure via IoT Hub. 该计算机已连接到IoT中心,并通过IoT中心将此信息发送到Azure。

Should the device id be the buildingid or the individual cooling system id? 设备ID是建筑物ID还是单独的冷却系统ID? I know that in the device registry I can add properties for a device. 我知道可以在设备注册表中添加设备的属性。 So if I create a device for each cooling system I can add Model, BuildingId etc. So in this manner I would know what devices that belong to which building etc. 因此,如果为每个制冷系统创建一个设备,则可以添加Model,BuildingId等。这样,我将知道哪些设备属于哪个建筑物等。

So I would have to register each cooling system in the building as a device and the computer connected to the IoT hub would need to manage the credentials for each device (cooling system) and send their data using the correct credentials. 因此,我必须将建筑物中的每个制冷系统注册为一台设备,并且连接到IoT中心的计算机将需要管理每个设备(制冷系统)的凭据,并使用正确的凭据发送其数据。

Is this correct? 这个对吗? If someone could explain this I would appreciate it. 如果有人可以解释这一点,我将不胜感激。

(I'm very rusty...) with mqtt I'd use a topic like "building1/coolingSystem2/sensor3" and shove the sensor readings into the message. (我非常生锈...)使用mqtt时,我会使用“ building1 / coolingSystem2 / sensor3”之类的主题,并将传感器读数推入消息中。

The subscriber can then filter to things like: 然后,订户可以过滤以下内容:

  • all sensor info over all buildings 所有建筑物上的所有传感器信息
  • just sensor info for building1 etc. 只是building1等的传感器信息。

see: http://www.hivemq.com/blog/mqtt-essentials-part-5-mqtt-topics-best-practices 参见: http : //www.hivemq.com/blog/mqtt-essentials-part-5-mqtt-topics-best-practices

If you are trying to send Cloud device messages or you say , your devices have subscribed for change update from application, using separate deviceid for each device is reasonable and further as you already said , you can enrich meta data to identify which building or floor it is coming from. 如果您尝试发送Cloud设备消息,或者您说设备已从应用程序订阅了更改更新,则为每个设备使用单独的deviceid是合理的,而且正如您已经说过的那样,您可以丰富元数据以标识它在哪座建筑物或楼层上来自。 So using deviceID for each cooling system would be better for longer run. 因此,为每个冷却系统使用deviceID对于长期运行会更好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM