简体   繁体   English

如果AWS IoT中没有Device Shadows概念,会发生什么

[英]What happens if no Device Shadows concept in AWS IoT

I am trying to work on AWS IoT.. From my understanding aws shadow copy the state information of the device/thing.. but i don't understand why.. what happen if its not stored any device state information ?? 我正在尝试在AWS IoT上工作。.据我了解,aws shadow复制了设备/事物的状态信息..但我不明白为什么..如果未存储任何设备状态信息会发生什么情况? I will be happy if anyone explains with simple example 如果有人用简单的例子解释我会很高兴

Device shadow is basically a copy of state of your device in the cloud. 设备影子基本上是云中设备状态的副本。 What it allows you to do is to make state changes on the device even when the device is disconnected from the network. 它允许您执行的操作是即使设备与网络断开连接也要在设备上进行状态更改。 Those changes are made on its shadow and once the device reconnects with cloud, states of the device and the shadow are synchronized. 这些更改是在其影子上进行的,一旦设备重新与云连接,设备和影子的状态就会同步。

Suppose that you have a smart lightbulb which is currently on. 假设您当前有一个智能灯泡。 You configured your system in such a way that the lightbulb should be turned off at 6am but there is network outage at 5:55am which lasts for 10 minutes. 您以如下方式配置系统:应在上午6点关闭灯泡,但在上午5:55出现网络中断,持续10分钟。 If you are not using device shadow, then the state change will try to reach your lightbulb but since it is disconnected at that particular time, the message is lost and your lightbulb will not be turned off. 如果您不使用设备阴影,则状态更改将尝试到达您的灯泡,但由于在特定时间已断开连接,该消息会丢失并且您的灯泡也不会关闭。

If you are using device shadow, this state change is performed on it so the shadow lightbulb will be turned off at 6am even if the real one is not connected to the cloud. 如果您使用的是设备阴影,则会对其执行此状态更改,因此即使真正的阴影灯泡未连接到云,阴影灯泡也会在上午6点关闭。 When the lightbulb is reconnected at 6:05am, device shadow sends synchronization message to it and it will be turned off. 当灯泡在上午6:05重新连接时,设备阴影将向其发送同步消息,并且它将关闭。

If you could ensure that your devices are always connected to the cloud, which you can't because networks are inherently unreliable, then using device shadow would be pointless. 如果您可以确保您的设备始终连接到云,而由于网络天生不可靠,则无法连接到云,那么使用设备影子将毫无意义。 Bottom line is that it allows you to perform offline state management with automatic synchronization. 最重要的是,它允许您通过自动同步执行脱机状态管理。

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

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