Communication system and communication method based on controller and cloud platform
By introducing a communication module between the controller and the cloud platform, and using a wireless communication network card and a timed triggering unit, the scalability and adaptability issues of existing communication solutions are solved, enabling flexible data interaction and multi-scenario adaptation, and improving the reliability and applicability of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-27
- Publication Date
- 2026-05-01
AI Technical Summary
Existing communication solutions between controllers and cloud platforms suffer from poor scalability, weak adaptability, insufficient reliability, and limited application scenarios, failing to meet the needs of in-depth application of IoT technology in multiple fields.
The communication module has a built-in wireless communication network card, which connects to the controller via serial communication and wirelessly connects to the cloud platform. It is configured with a timed trigger unit and a power-on start unit to realize the automated processing of data requests and control commands. It supports 4G, 5G or LoRa modules and encapsulates and parses data through IoT communication protocols. The cloud platform configures the address configuration unit to adjust the data reading address without modifying the controller program.
It enables flexible data interaction and multi-scenario adaptation between the controller and the cloud platform, improves the reliability and applicability of the communication system, supports multiple wireless networks and protocols, and meets the data visualization and remote control needs of different scenarios.
Smart Images

Figure CN121967493A_ABST
Abstract
Description
A communication system and method based on a controller and cloud platform. Technical Field
[0001] This invention relates to the field of communication system technology, and more specifically, to a communication system and communication method based on a controller and a cloud platform. Background Technology
[0002] With the popularization of Internet of Things (IoT) technology in fields such as industrial monitoring, smart homes, and environmental monitoring, remote communication between controllers (such as PLCs and sensor controllers) and cloud platforms has become a core link in realizing "data visualization" and "remote control" of equipment. Acquiring real-time equipment operation data (such as temperature, pressure, and switch status) collected by the controller through the cloud platform and issuing control commands (such as starting and stopping equipment and adjusting parameters) to the controller has become a typical application mode of IoT systems.
[0003] Currently, communication between controllers and cloud platforms mainly relies on an architecture of "wireless module + specific protocol". The communication solution between controllers and cloud platforms has technical problems such as "poor scalability, weak adaptability, insufficient reliability and limited scenarios". There is an urgent need for a communication solution that can achieve "flexible data expansion, protocol standardization, control closed loop and multi-scenario adaptation" to meet the needs of the deep application of IoT technology in multiple fields. Summary of the Invention
[0004] In view of the shortcomings of the prior art, the present invention innovatively provides a communication system and communication method based on a controller and a cloud platform, which can solve the technical problems of poor reliability and limited applicable scenarios of the communication scheme between the controller and the cloud platform in the prior art.
[0005] To achieve the aforementioned technical objectives, in a first aspect, this invention discloses a communication system based on a controller and a cloud platform, comprising a communication module, a controller, and a cloud platform; the communication module has a built-in wireless communication network card, is connected to the controller via a serial port, and is connected to the cloud platform via a wireless network; the communication module is configured to send data requests and control commands to the controller; the controller is configured to receive the data request and return corresponding data to the communication module, and to receive the control command, execute an operation, and provide a response command; the cloud platform is configured to receive the data sent by the communication module and refresh the display, and to issue control commands to the communication module.
[0006] Furthermore, the communication module is equipped with a timed triggering unit, which is configured to send data requests to the controller according to a preset period.
[0007] Furthermore, the communication module is also equipped with a power-on startup unit, which is configured to automatically trigger an initial data request sending process when the module is powered on. After the controller responds, the wireless communication module pushes the initial data to the cloud platform in real time.
[0008] Furthermore, the cloud platform is equipped with an address configuration unit, which is configured to modify the target data address parameters according to the data display requirements. The communication module reads the corresponding data from the controller based on the modified address parameters without changing the controller's operating program.
[0009] Furthermore, the communication module is any one of a 4G module, a 5G module, or a LoRa module; and / or, the serial communication connection interface is any one of an RS-485 interface or an RS-232 interface.
[0010] In a second aspect, the present invention discloses a communication method for a communication system based on a controller and a cloud platform, comprising: the communication module sending a data request to the controller at a preset period; the controller receiving the data request and transmitting the target data to the wireless communication module; the wireless communication module parsing the received data and encapsulating the processed data into an Internet of Things (IoT) communication protocol format and sending it to the cloud platform; the cloud platform receiving the data in the IoT communication protocol format and updating the display interface to present the latest data; when the cloud platform initiates a control command, the wireless communication module receiving and parsing the control command and transmitting the parsed control command to the controller; the controller receiving the control command, executing the corresponding operation, and sending a response command back to the communication module; the communication module receiving the response command and synchronizing the response command to the cloud platform, thus completing the closed-loop execution of the control command.
[0011] Furthermore, in the control command issuance process, the control instructions include interactive operation instructions. When the cloud platform issues the interactive operation instructions, the communication module parses the interactive operation instructions and sends them to the controller. After receiving the interactive operation instructions, the controller triggers the corresponding execution component action. The controller returns its own operation data to the communication module according to the preset period. The communication module sends the received operation data to the cloud platform. When the cloud platform detects that the status parameters corresponding to the interactive operation instructions meet the preset conditions, the interactive elements of the control interface present a display state that matches the action of the execution component.
[0012] Furthermore, when the power is turned on, the communication module automatically sends an initial data request to the controller; after the controller responds to the initial data request and transmits the data, the communication module immediately encapsulates the data into an IoT communication protocol format and sends it to the cloud platform.
[0013] Furthermore, when the cloud platform adjusts the target data reading address according to the data display requirements, it does not need to modify the controller's operating program. It can achieve the reading and display of different types of data from the controller simply by changing the target data address parameters sent to the wireless communication module.
[0014] The beneficial effects of the present invention are as follows: The communication system based on the controller and cloud platform provided by the present invention addresses the deficiencies of existing solutions in terms of flexibility, reliability, and scenario adaptability through the structured design and functional adaptation of the communication module-controller-cloud platform. Data interaction, scenario adaptation, and control reliability are all achieved. Attached Figure Description
[0015] Figure 1 shows a structural block diagram of the communication system based on the controller and cloud platform according to an embodiment of the present invention; Figure 2 shows a data reading flowchart of the communication system based on the controller and cloud platform according to an embodiment of the present invention; Figure 3 shows a control flowchart of the communication system based on the controller and cloud platform according to an embodiment of the present invention. Detailed Implementation
[0016] The communication system based on the controller and cloud platform provided by the present invention will be explained and described in detail below with reference to the accompanying drawings.
[0017] The communication system based on a controller and cloud platform provided by this invention addresses the shortcomings of existing solutions in terms of flexibility, reliability, and scenario adaptability through a structured design and functional adaptation of the communication module-controller-cloud platform. It features reliable data interaction, scenario adaptation, and control. The following detailed description of specific embodiments further illustrates this invention: In some embodiments, this invention provides a communication system based on a controller and cloud platform, as shown in Figure 1. It includes a communication module, a controller, and a cloud platform. The communication module connects to the controller and wirelessly connects to the cloud platform. The communication module enables the transmission of communication data and control commands between the controller and the cloud platform. In this embodiment, the controller and communication module transmit data via the Modbus communication protocol.
[0018] Optionally, the communication module has a built-in wireless communication network card. The communication module is connected to the controller via a serial port and to the cloud platform via a wireless network. The communication module is configured to send data requests and control commands to the controller. For example, the communication module can be any one of a 4G module, a 5G module, or a LoRa module. For instance, the communication module can be a 4G module, with a built-in 4G network unit and a Modbus protocol processing unit, supporting an RS-485 serial communication interface (as a Modbus master device) and 4G wireless communication (supporting TD-LTE / FDD-LTE standards). The 4G network unit includes, for example, a SIM card slot (compatible with standard Nano-SIM cards), a power interface (12V DC), and a debugging interface (for parameter configuration). It establishes a TCP / IP connection with the cloud platform via the 4G network and simultaneously interacts with the controller via the RS-485 bus. In other embodiments, if the application scenario is in a remote area with no 4G signal coverage or weak signal, the 4G module can be replaced with a LoRa module (such as Semtech SX1278), and the corresponding wireless communication card can be replaced with a LoRa gateway. Data interaction can be achieved through the long-distance transmission characteristics of LoRa (maximum transmission distance of 10km). If the scenario has high requirements for transmission rate (such as high-definition equipment image transmission), it can be replaced with a 5G module (such as Huawei MH5000) to improve data upload bandwidth.
[0019] The controller is configured to receive the data request and return the corresponding data to the communication module, and to receive the control command, execute the operation, and provide a response command. For example, the controller is a PLC with a built-in RS-485 communication port (supporting Modbus RTU slave mode). The controller is configured with an analog input module and a digital output module. The analog input module is used to collect analog data such as temperature and pressure, while the digital output module is used to control actuators such as push-button lights and relays. The controller's Modbus slave address is set to 2, and it is directly connected to the RS-485 port of the 4G module via the RS-485 bus, with a power supply voltage of 24V DC. Optionally, if the controller only supports an RS-232 interface (such as some small sensor controllers), the RS-485 interface can be replaced with an RS-232 interface. In this case, it is necessary to shorten the communication distance (RS-232 has a maximum transmission distance of 15m, suitable for short-distance deployment scenarios) and add lightning protection circuitry (such as using a TVS diode) at the interface.
[0020] The cloud platform is configured to receive data sent by the communication module and refresh the display, and to issue control commands to the communication module. For example, the cloud platform includes an MQTT message server (port 1883), a data storage unit (using a MySQL database to store historical device data), a monitoring interface unit (web-based, supporting data visualization and control command issuance), and an address configuration unit (providing a "data read address modification" function interface). The cloud platform communicates with the communication module via a public IP address and supports simultaneous access to multiple similar devices. Optionally, if the cloud platform only supports the CoAP protocol (suitable for low-power devices), the MQTT protocol can be replaced with the CoAP protocol. The 4G module needs to be configured with a CoAP server address (e.g., coap: / / iot-platform.example.com:5683), and the structured data should be encapsulated in the CoAP protocol's "request / response" format (using a JSON data structure).
[0021] In some embodiments, the communication module includes a timer triggering unit configured to send data requests to the controller at a preset period. The timer triggering unit, for example, uses a built-in timer to generate a data request signal at a 1-second period, i.e., the preset period is set to 1 second, driving the Modbus master device (communication module) unit to send a data request frame to the controller.
[0022] The communication module also includes a power-on startup unit, which is configured to automatically trigger an initial data request sending process when the module is powered on. After the controller responds, the wireless communication module pushes the initial data to the cloud platform in real time. The module automatically executes initialization procedures after power-on, such as detecting 4G network signals, connecting to the MQTT server, and triggering the initial data request; this can be completed automatically without manual intervention.
[0023] The cloud platform has an address configuration unit, which is configured to modify the target data address parameters according to the data display requirements. The communication module reads the corresponding data from the controller based on the modified address parameters without changing the controller's running program.
[0024] In some embodiments, the present invention also provides a communication method for a communication system based on a controller and a cloud platform, as shown in Figures 2 and 3, comprising: connecting a communication module to a controller via a serial communication interface, and connecting the communication module to a cloud platform via a wireless network.
[0025] The communication module sends data requests to the controller at a preset period. After receiving the data request, the controller transmits the target data to the wireless communication module. The wireless communication module parses and processes the received data, encapsulates the processed data into an IoT communication protocol format, and sends it to the cloud platform. After receiving the data in the IoT communication protocol format, the cloud platform updates the display interface to present the latest data. When the cloud platform initiates a control command, the wireless communication module receives and parses the control command, and transmits the parsed control command to the controller. The controller accepts the control command, executes the corresponding operation, and sends a response command back to the communication module. After receiving the response command, the communication module synchronizes the response command to the cloud platform, completing the closed-loop execution of the control command.
[0026] Optionally, in the control command issuance process, the control instruction includes an interactive operation instruction. When the cloud platform issues the interactive operation instruction, the communication module parses the interactive operation instruction and sends it to the controller. After receiving the interactive operation instruction, the controller triggers the corresponding execution component action. The controller returns its own operation data to the communication module according to the preset period. The communication module sends the received operation data to the cloud platform. When the cloud platform detects that the status parameter corresponding to the interactive operation instruction meets the preset conditions, the interactive elements of the control interface present a display state that matches the action of the execution component.
[0027] When the communication module is powered on, it automatically sends an initial data request to the controller. After the controller responds to the initial data request and transmits the data, the communication module immediately encapsulates the data into an IoT communication protocol format and sends it to the cloud platform.
[0028] When the cloud platform adjusts the target data reading address according to the data display requirements, it does not need to modify the controller's operating program. It can read and display different types of data from the controller simply by changing the target data address parameters sent to the wireless communication module.
[0029] In this embodiment, the controller is a PLC, such as the S7-200 SMART, and the communication module is a 4G module, such as the ME909S-821. The serial communication interface is an RS-485 interface, the IoT communication protocol is the MQTT protocol, the preset period is set to 1 second, and the structured data is in the form of a structure array. The specific communication method includes: connecting the RS-485 interface (Pin A and B) of the 4G module to the RS-485 interface of the controller, ensuring good contact; for example, the continuity of the pins can be checked with a multimeter to avoid loose connections. A 4G SIM card with activated data traffic is inserted into the SIM card slot of the communication module (the operator should be a service provider with stable local signal coverage, such as China Mobile or China Unicom), and DC power is connected to both the 4G module and the controller (4G module power supply voltage 12V, controller power supply voltage 24V).
[0030] Using the debugging software that comes with the 4G module (such as Huawei IoT Link), set the module's operating parameters—including the Modbus master device address (set to 1), data request period (1 second), MQTT server address and port number—to ensure that the 4G module can normally access the 4G network and establish an initial connection with the cloud platform.
[0031] After the 4G module is powered on, it sends a data request frame to the controller (slave device address set to 2) as a Modbus master device at a preset period of 1 second. The request frame format follows the Modbus RTU protocol and includes "slave device address (0x02), function code (0x03, representing "read holding register"), target data start address (e.g., 0x0000, corresponding to the "device temperature" data collected by the controller), data length (0x0001, representing reading 1 data point) and CRC checksum".
[0032] After receiving a data request frame, the controller first verifies the CRC checksum (to ensure the data is not interfered with), then locates the register storing the "device temperature" data based on the "function code + start address" (e.g., if the register value is 25℃, it corresponds to hexadecimal 0x0019), and then generates a response frame containing "device address (0x02), function code (0x03), number of data bytes (0x02), data value (0x0019), and CRC checksum", and feeds it back to the 4G module via the Modbus bus.
[0033] After receiving the response frame, the 4G module parses it to obtain "Device temperature = 25℃" and encapsulates the data according to a preset structured data format (structure array). The specific members of the structure array are: char *name = "Device_Temperature" (MQTT display name), void *dataPoint = "Temperature", DATA_TYPEdataType = FLOAT (data type, floating point), and Bool flag = 1 (data validity flag, 1 represents valid). After encapsulation, the 4G module converts the structure array into an MQTT format message and sends it to the cloud platform through the 4G network. After receiving the response frame, the 4G module parses it to obtain "Device temperature = 25℃" and encapsulates the data according to a preset structured data format (structure array). The specific members of the structure array are: char *name = "Device_Temperature" (MQTT display name), void *dataPoint = "Temperature", DATA_TYPEdataType = FLOAT (data type, floating point), and Bool flag = 1 (data validity flag, 1 represents valid). After encapsulation, the 4G module converts the structure array into an MQTT format message and sends it to the cloud platform through the 4G network.
[0034] After receiving the message, the MQTT client on the cloud platform parses the data content in the structure array, updates the value to 25℃ in the "Device Temperature" display area of the monitoring interface, and records the data reception time (accurate to milliseconds) to achieve real-time data visualization.
[0035] When a user clicks the "Manual Button" control on the cloud platform monitoring interface (the interface element is set to gray and inactive), the cloud platform generates a control command—the command content is manual button light control: turn on, and sends the command to the 4G module in the form of an MQTT message. The message contains the control command type = manual button and the target state = 1 (1 represents on, 0 represents off).
[0036] After receiving the MQTT control message, the 4G module parses it to obtain the instruction to "light up the manual button light". It then converts it into a Modbus RTU protocol write command frame, which includes "slave device address (0x02), function code (0x06, representing "write a single holding register"), destination register address (0x0005, corresponding to the controller's "manual button light control register"), control value (0x0001, representing lighting up), and CRC checksum", and sends it to the Modbus bus.
[0037] After receiving the write command frame, the controller verifies it and sets the value of the "Manual Button Light Control Register" to 0x0001, triggering the corresponding relay to illuminate the manual button light (externally connected to the controller output terminal). Simultaneously, the controller generates a response frame and sends it back to the 4G module. Optionally, the response frame includes the slave device address 0x02, function code 0x06, target register address 0x0005, control value 0x0001, and CRC checksum.
[0038] After receiving the response frame, the 4G module confirms that the control command has been executed successfully and then sends an MQTT message of "control result feedback" to the cloud platform. The message contains "manual button light status = 1". After parsing the message, the cloud platform changes the "manual button" control on the interface from gray to green (on state), completing the closed-loop execution of the control command.
[0039] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," and "circumferential" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this invention and simplifying the description, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0040] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components, unless otherwise explicitly limited. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0041] In the description of this specification, the references to terms such as "this embodiment," "an embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in a suitable manner in any at least one embodiment or example. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0042] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0043] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, and simple improvements made on the substantive content of the present invention should be included within the protection scope of the present invention.
Claims
1. A communication system based on a controller and a cloud platform, characterized in that, The system includes a communication module, a controller, and a cloud platform. The communication module has a built-in wireless communication network card. It is connected to the controller via a serial port and to the cloud platform via a wireless network. The communication module is configured to send data requests and control commands to the controller. The controller is configured to receive the data request and return the corresponding data to the communication module, and to receive the control command, execute the operation, and provide a response command. The cloud platform is configured to receive the data sent by the communication module, refresh the display, and issue control commands to the communication module.
2. The communication system based on a controller and cloud platform according to claim 1, characterized in that, The communication module is equipped with a timed triggering unit, which is configured to send data requests to the controller according to a preset period.
3. The communication system based on a controller and cloud platform according to claim 2, characterized in that, The communication module is also equipped with a power-on start-up unit, which is configured to automatically trigger the initial data request sending process when the module is powered on. After the controller responds, the wireless communication module pushes the initial data to the cloud platform in real time.
4. The communication system based on a controller and cloud platform according to claim 2, characterized in that, The cloud platform is equipped with an address configuration unit, which is configured to modify the target data address parameters according to the data display requirements. The communication module reads the corresponding data from the controller based on the modified address parameters without changing the controller's operating program.
5. The communication system based on a controller and cloud platform according to claim 1, characterized in that, The communication module is any one of a 4G module, a 5G module, or a LoRa module; and / or, the serial communication connection interface is any one of an RS-485 interface or an RS-232 interface.
6. A communication method for a communication system based on a controller and a cloud platform as described in any one of claims 1-5, characterized in that, include: The communication module sends data requests to the controller at a preset period. After receiving the data request, the controller transmits the target data to the wireless communication module. The wireless communication module parses and processes the received data, encapsulates the processed data into an IoT communication protocol format, and sends it to the cloud platform. After receiving the data in the IoT communication protocol format, the cloud platform updates the display interface to present the latest data. When the cloud platform initiates a control command, the wireless communication module receives and parses the control command, and transmits the parsed control command to the controller. The controller accepts the control command, executes the corresponding operation, and sends a response command back to the communication module. After receiving the response command, the communication module synchronizes the response command to the cloud platform, completing the closed-loop execution of the control command.
7. The communication method of the communication system based on the controller and cloud platform according to claim 6, characterized in that, In the control command issuance process, the control instructions include interactive operation instructions. When the cloud platform issues the interactive operation instructions, the communication module parses the interactive operation instructions and sends them to the controller. After receiving the interactive operation instructions, the controller triggers the corresponding execution component action. The controller returns its own operation data to the communication module according to the preset period. The communication module sends the received operation data to the cloud platform. When the cloud platform detects that the status parameters corresponding to the interactive operation instructions meet the preset conditions, the interactive elements of the control interface present a display state that matches the action of the execution component.
8. The communication method of the communication system based on the controller and cloud platform according to claim 7, characterized in that, When the power is turned on, the communication module automatically sends an initial data request to the controller; after the controller responds to the initial data request and transmits the data, the communication module immediately encapsulates the data into an IoT communication protocol format and sends it to the cloud platform.
9. The communication method of the communication system based on the controller and cloud platform according to claim 8, characterized in that, When the cloud platform adjusts the target data reading address according to the data display requirements, it does not need to modify the controller's operating program. It can read and display different types of data from the controller simply by changing the target data address parameters sent to the wireless communication module.