Summary of IoT communication architecture
This article introduces the communication architecture of IoT from a macro perspective, so that everyone can have a preliminary understanding of the working principles of the increasingly frequently used IoT devices. It is mainly divided into three modes: direct connection, gateway, and cloud.
1. Direct integration pattern
Usually, the IoT devices we use, such as Xiaomi bracelets, are directly connected to mobile phones, but they use Bluetooth and cannot provide a universal interface for access. The solution to this problem is to use Web technology that has been mature for many years, so some people have proposed the concept of Web of Things.
If the device supports HTTP and TCP/IP and can directly connect to the Internet, such as using Wi-Fi, then this direct connection mode can be used. Usually the device requires relatively powerful processing power and continuous power supply, such as smart home. To directly control the device through the Web, it needs to implement functions similar to the following figure, from hardware control, RESTFUL API design to HTTP server implementation.
2. Gateway integration pattern
If the device's resources are limited, or it cannot directly access the Internet (for example, it only supports Bluetooth or ZigBee), it can be accessed through the Web by connecting to a powerful gateway; the gateway converts other types of protocols into a unified external interface (such as converting the device's CoAP to HTTP for users), and can also provide security authentication, integration, temporary data storage, semantic description of the device, etc. Open source gateway projects include Open Hab [2]. In addition, many large manufacturers also have their own gateways to support their own devices.
3. Cloud integration pattern
The cloud model can be seen as an extension of the gateway model, except that the gateway is in the cloud and provides cloud services such as protocol conversion and data processing. Its biggest feature is that it can access various devices through the external network. At present, there are various platforms that provide IoT cloud services, such as AWS, Alibaba, Microsoft and other giants, as well as specialized platforms such as Xively and Gizwits. However, most of them adopt a structure similar to the one shown below, using the MQTT protocol to manage various devices. There are virtual devices in the cloud to save device status, store and manage data generated by devices, and use secret API KEYs to send management instructions through the REST API.
4. Conclusion
The cloud mode often makes the transmission of instructions very slow, so an IoT device may allow several of the above operation modes at the same time. Using the Web to control devices, you can also easily use third-party automation platforms such as IFTTT to design conditional automation to execute some functions and interact with common apps such as Twitter. Finally, I stole a few pictures of the protocol introduction in the book to facilitate the understanding of the various protocols involved in the Internet of Things, such as Bluetooth, MQTT, ZigBee, Apple Homekit, etc.
Original link: https://www.cnblogs.com/ascii0x03/p/7562498.html
Just scan and follow us~
If you feel good, please
Forward
Forward
Forward