PLC high-concurrency communication system and method

By building dual-core modules and redundant communication links in the PLC controller, the communication bottleneck problem of PLC in high concurrent communication scenarios is solved, and an efficient and reliable communication system is realized, reducing costs and meeting the real-time requirements of Industry 4.0.

CN120378469APending Publication Date: 2025-07-25NINGBO HAITIAN ZHILIAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510675328.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

Existing PLCs have communication bottlenecks in high concurrent communication scenarios, resulting in excessive CPU resource utilization, system delay, data loss, and external solutions increase hardware, software and operation and maintenance costs. At the same time, the network dependence is high, resulting in insufficient reliability.

Method used

It adopts a dual-core PLC controller design, with the built-in first control module responsible for the main operating logic of the PLC, and the second control module provides the MQTT local server to realize dual-core parallel operation, handles high concurrent communication through the MQTT protocol, and deploys an MQTT server and database within the PLC, and configures redundant communication links to ensure reliability.

Benefits of technology

It realizes high concurrent communication while reducing system costs, improves communication efficiency and reliability, meets the microsecond response requirements of the Industry 4.0 era, and maintains real-time communication between local devices in the event of network failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120378469A_ABST
    Figure CN120378469A_ABST
Patent Text Reader

Abstract

The invention provides a PLC high-concurrency communication system and method, and relates to the technical field of communication, and the system comprises a plurality of wireless gateways which are used for generating an MQTT message from the collection data of each wireless terminal device and issuing the MQTT message; a second control module of the PLC communicates with each wireless gateway through a built-in MQTT local server by adopting an MQTT protocol, so as to obtain each MQTT message and synchronize the MQTT message to the first control module; and the first control module runs a PLC control program to generate a control instruction according to the acquired data contained in the MQTT message, and issues the control instruction to each wireless terminal device for execution through the second control module. The system has the beneficial effects that the PLC realizes dual-core parallel operation through two built-in control modules, so that the communication efficiency is improved while high-concurrency communication is realized; an upper computer or a high-end PLC does not need to be additionally deployed, so that the system cost is reduced; through local deployment of the MQTT server, network dependence is avoided, and system reliability is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technologies, and in particular, to a PLC high-concurrency communication system and method. Background Art

[0002] In the field of industrial automation, as the core control unit, the communication ability of a programmable logic controller (PLC) directly determines the efficiency and stability of the entire production system. However, traditional PLCs use a single master control module (CPU) to centrally process all logical operations and communication tasks. This design is efficient when dealing with simple control tasks, but exposes serious defects in high-concurrency communication scenarios. The core factor leading to the communication bottleneck is the inherent defect of this centralized architecture. Under this centralized architecture, the master control module needs to simultaneously undertake multiple tasks such as control algorithm execution, local I / O scanning, protocol parsing, and data forwarding, resulting in over-occupation of CPU resources. When the communication task volume exceeds its processing threshold, problems such as communication delay, data loss, and even system crash will occur in the system.

[0003] Facing the communication bottleneck of the single master control module, enterprises are often forced to seek external solutions, thus falling into a cost dilemma. The root cause of this dilemma is that the existing PLC architecture cannot directly meet the high-concurrency communication requirements, forcing enterprises to invest additional resources. The MQTT protocol has become the mainstream communication protocol in the industrial Internet of Things (IIoT) scenario due to its advantages such as lightweight and publish / subscribe mode. However, when the PLC itself cannot support high-concurrency MQTT communication, enterprises usually need to deploy a host computer (such as an industrial PC or an edge gateway) as the MQTT Broker. Although this solution solves the communication problem, it brings threefold cost:

[0004] 1. Hardware cost: The procurement cost of an industrial PC or an edge gateway is usually higher than that of the PLC itself, and additional redundant power supplies, cooling systems, etc. need to be configured;

[0005] 2. Software cost: It is necessary to purchase commercial MQTT Broker software (such as EMQX, HiveMQ) or invest in development resources to customize the server;

[0006] 3. Operation and maintenance cost: The operating system, database, security protection, etc. of the host computer need to be continuously maintained, increasing the workload of the IT team.

[0007] In addition, some manufacturers have also launched high-end PLC models that support high-concurrency communication, but their prices are usually 3-5 times that of standard PLCs. For enterprises with limited budgets, the procurement cost of high-end PLCs may exceed the total budget of the entire control system.

[0008] In addition, the industrial communication system based on MQTT usually adopts a three-layer architecture of "PLC - MQTT Broker - cloud / local application". When the network is interrupted, the connection between the PLC and the MQTT Broker will immediately fail, resulting in problems such as real-time data loss, control instruction failure, and alarm delay.

[0009] In summary, the existing PLC communication solutions have significant deficiencies in terms of communication performance, cost structure, reliability, etc., and it is difficult to meet the requirements of high concurrency, low latency, and high reliability in the industrial 4.0 era. Summary of the Invention

[0010] In view of the problems existing in the prior art, the present invention provides a PLC high-concurrency communication system, including:

[0011] A plurality of wireless gateways, each wireless gateway is correspondingly connected to a plurality of wireless terminal devices, and is used to generate MQTT messages from the collected data of each wireless terminal device and publish them;

[0012] A PLC controller, connected to each wireless gateway, the PLC controller includes:

[0013] A first control module, the first control module has a PLC control program built therein;

[0014] A second control module, connected to the first control module, the second control module communicates with each wireless gateway by using the MQTT protocol through the built-in MQTT local server to obtain each MQTT message and synchronize it to the first control module;

[0015] The first control module runs the PLC control program to generate control instructions according to the collected data included in the MQTT message, and issues the control instructions to each wireless terminal device for execution through the second control module.

[0016] Preferably, the second control module further includes:

[0017] A database, connected to the MQTT local server, the MQTT local server is used to obtain the MQTT message and save it to the database;

[0018] A data forwarding module, connected to the database, and is used to synchronize the MQTT message in the database to the first control module.

[0019] Preferably, a Docker container is deployed inside the second control module, and the MQTT local server is configured inside the Docker container.

[0020] Preferably, the data forwarding module includes a data monitoring unit for monitoring the MQTT messages in the database in real time, and when the stored MQTT messages change in data, synchronizing the changed data to the first control module.

[0021] Preferably, it further includes:

[0022] A first network switch connected to each of the wireless gateways via Ethernet;

[0023] A second network switch configured inside the PLC controller and connected to the first network switch, the first control module, and the second control module via Ethernet respectively;

[0024] Each of the wireless gateways communicates with the PLC controller through the main communication link formed by the first network switch, the second network switch, and the second control module, and when the main communication link fails, switches to communicate with the PLC controller through the secondary communication link formed by the first network switch, the second network switch, and the first control module.

[0025] Preferably, communication between the first control module and the second control module is through TTL serial communication or Ethernet communication.

[0026] Preferably, the PLC controller has multiple control chips built in, and the first control module and the second control module are configured in different control chips.

[0027] Preferably, the first control module and the second control module run under different operating systems.

[0028] The present invention also provides a PLC high-concurrency communication method applied to the above PLC high-concurrency communication system. The PLC high-concurrency communication method includes:

[0029] Step S1, the wireless gateway establishes a wireless communication connection with multiple wireless terminal devices, generates MQTT messages from the collected data of each wireless terminal device and publishes them;

[0030] Step S2, the second control module in the PLC controller communicates with each of the wireless gateways through the built-in MQTT local server using the MQTT protocol to obtain each MQTT message and synchronize it to the first control module therein;

[0031] Step S3, the first control module of the PLC controller runs the built-in PLC control program to generate control instructions according to the collected data included in the MQTT messages, and sends the control instructions to each wireless terminal device for execution through the second control module.

[0032] The above technical solution has the following advantages or beneficial effects:

[0033] 1) The PLC controller is responsible for the main operation logic of the PLC through the built-in first control module. At the same time, the built-in second control module provides the MQTT local server function and is responsible for processing MQTT messages. The two control modules run in parallel with dual cores without disturbing each other, improving the communication efficiency while achieving high-concurrency communication, and meeting the requirements for microsecond-level response in the Industrial 4.0 era;

[0034] 2) There is no need to deploy an upper computer separately or use a high-end PLC, reducing the system cost;

[0035] 3) Through the local deployment of the MQTT server, even if the external network fails, the real-time communication between local devices can still be maintained, avoiding network dependence and improving the system reliability. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a schematic structural diagram of a PLC high-concurrency communication system in a preferred embodiment of the present invention;

[0037] Figure 2 It is a schematic flow diagram of a PLC high-concurrency communication method in a preferred embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0038] The present invention will be described in detail below with reference to the drawings and specific embodiments. The present invention is not limited to this embodiment, and other embodiments may also fall within the scope of the present invention as long as they conform to the gist of the present invention.

[0039] In a preferred embodiment of the present invention, in view of the above problems existing in the prior art, a PLC high-concurrency communication system is provided as Figure 1 shown, including:

[0040] A plurality of wireless gateways 1, each wireless gateway 1 is correspondingly connected to a plurality of wireless terminal devices 2, and is used to generate MQTT messages from the collected data of each wireless terminal device 2 and publish them;

[0041] A PLC controller 3, connected to each wireless gateway 1, the PLC controller 3 includes:

[0042] A first control module 31, the first control module 31 has a built-in PLC control program 311;

[0043] A second control module 32, connected to the first control module 31, the second control module 32 communicates with each wireless gateway 1 through the built-in MQTT local server 321 using the MQTT protocol to obtain each MQTT message and synchronize it to the first control module 31;

[0044] The first control module 31 runs the PLC control program 311 to generate control instructions based on the acquisition data included in the MQTT message, and sends the control instructions to each wireless terminal device 2 for execution through the second control module 32.

[0045] Specifically, a wireless communication connection is adopted between each wireless gateway 1 and multiple wireless terminal devices 2, and the wireless communication methods include but are not limited to wifi, 4G / 5G, Lora, etc. To achieve high-concurrency communication between multiple wireless terminal devices 2 and the PLC controller, in this embodiment, a dual-core is built into the PLC control 3, including a first control module 31 and a second control module 32. Among them, the first control module 31 is the main control module of the PLC controller 3, responsible for the main operation logic of the PLC, such as controlling I / O devices, executing programs, etc. The second control module 32 is built with an MQTT local server 321, which is responsible for processing MQTT messages and achieving high-concurrency communication with each wireless terminal device 2. In other words, the first control module 31 is responsible for the normal operation of the PLC controller 3, and the second control module 32 is responsible for processing high-concurrency MQTT messages, and the two do not interfere with each other, improving the communication efficiency while achieving high-concurrency communication, and meeting the requirements for microsecond-level response in the Industry 4.0 era.

[0046] Among them, the above-mentioned second control module 32 can be implemented by an edge module configured in the PLC controller 3, or can be implemented by the internal redundant computing power resources of the PLC controller 3 (such as unused CPU cores, idle memory spaces), that is, a traditional PLC controller can be used without hardware upgrade, without using a high-end PLC, and without deploying a host computer additionally, effectively saving deployment costs.

[0047] More specifically, in the actual communication process, the acquisition data of the wireless terminal device 2 generates an MQTT message through the connected wireless gateway 1 and publishes it to the MQTT local server 321. The second control module 32 subscribes to the topic, parses the MQTT message and synchronizes it to the first control module 31. The first control module 31 runs the PLC control program 311, generates control instructions according to the acquisition data representing the device state, and the control instructions are sent to the MQTT local server through the second control module 32, and the wireless terminal device 2 subscribes and executes.

[0048] Furthermore, since the MQTT local server 321 runs completely inside the PLC controller 3, the communication link is effectively shortened, the communication efficiency is improved, and at the same time, it is realized that even if the external network fails, the real-time communication between local devices can still be maintained, ensuring that the data interaction between the PLC and the wireless gateway is not affected, and realizing offline operation.

[0049] In a preferred embodiment of the present invention, the second control module 32 further includes:

[0050] A database 322 is connected to an MQTT local server 321. The MQTT local server 321 is used to obtain MQTT messages and save them to the database 322;

[0051] A data forwarding module 323 is connected to the database 322 and is used to synchronize the MQTT messages in the database 322 to the first control module 31.

[0052] Specifically, in this embodiment, by configuring the database 322, the caching mechanism is localized, so that even if there is an external network failure, caching can be performed to achieve automatic retransmission after the network is restored, avoiding data loss.

[0053] In a preferred embodiment of the present invention, a Docker container 324 is deployed inside the second control module 32, and the MQTT local server 321 is configured inside the Docker container 324.

[0054] Specifically, since there are other gateway data forwarding services in the second control module 32, to ensure that other services are not affected and to ensure the reliability of the MQTT service, in this embodiment, by deploying the Docker container 324, isolation of the MQTT local server 321 application is achieved, ensuring isolation and high reliability of the software service. Preferably, in the Docker container 324, a Mosquitto server is installed, the listening port is configured, anonymous access is disabled, TLS encryption is enabled, and the maximum connection number and persistence settings are made to ensure stable operation in a high-load environment.

[0055] In a preferred embodiment of the present invention, the data forwarding module 323 includes a data monitoring unit for real-time monitoring of the MQTT messages in the database 322, and when the stored MQTT messages change, synchronizing the changed data to the first control module 31.

[0056] Specifically, in this embodiment, by monitoring the database 322, the data synchronization action is executed only when the data changes, further reducing the processing burden of the PLC control program 311. Through the above data forwarding synchronization, the PLC control program 311 can complete the communication with a large number of wireless terminal devices 2, and the PLC control program 311 does not need to participate in the high-concurrency communication of a large number of wireless terminal devices 2. It only needs to complete the data collection and control of the wireless terminal devices 2 by forwarding and synchronizing data, greatly reducing the workload of the PLC control program 311 and improving the reliability and real-time performance of the system.

[0057] In a preferred embodiment of the present invention, it further includes:

[0058] A first network switch 4 is connected to each wireless gateway 1 through Ethernet;

[0059] The second network switch 33 is configured inside the PLC controller 3 and is connected to the first network switch 4, the first control module 31, and the second control module 32 via Ethernet respectively.

[0060] Each wireless gateway 1 communicates with the PLC controller 3 through the main communication link formed by the first network switch 4, the second network switch 33, and the second control module 32, and switches to communicate with the PLC controller 3 through the secondary communication link formed by the first network switch 4, the second network switch 33, and the first control module 31 when the main communication link fails.

[0061] Specifically, in this embodiment, by configuring the first network switch 4 and the second network switch 33, it is realized to connect each wireless gateway 1, the first control module 31, and the second control module 32 via Ethernet. Ethernet has the advantages of high speed, stability, and strong compatibility, and can meet the needs of rapid transmission of a large amount of data in industrial automation control, ensuring real-time and accurate information exchange between the PLC controller 3 and the wireless gateway 1, and improving the overall operation efficiency of the system.

[0062] Furthermore, by designing the main communication link (the first network switch 4, the second network switch 33, and the second control module 32) and the secondary communication link (the first network switch 4, the second network switch 33, and the first control module 31), redundant backup is provided for the master-slave communication. When the main communication link fails, the system can automatically switch to the secondary communication link to ensure that the communication between the wireless gateway 1 and the PLC controller 3 is not interrupted, greatly improving the reliability and stability of the system, reducing the risk of production interruption caused by communication failures, and enhancing the fault tolerance ability of the system.

[0063] Even further, by configuring the second network switch 33 inside the PLC controller 3 and designing the first control module 31 and the second control module 32, a redundant configuration of key components is formed. This redundant design not only provides guarantee at the communication link level but also enhances the reliability of the system at the control level. Even if a certain control module fails, the other control module can take over the work to ensure that the control function of the PLC controller 3 on the wireless gateway 1 is not affected.

[0064] In addition, with the continuous development of industrial automation systems, it may be necessary to add more wireless gateways 1 or other network devices. This solution can conveniently access new devices through the first network switch 4 or the second network switch 33 without large-scale adjustment of the existing network structure, reducing the cost and difficulty of system expansion.

[0065] In a preferred embodiment of the present invention, the first control module 31 and the second control module 32 communicate with each other through a TTL serial port or Ethernet communication.

[0066] In a preferred embodiment of the present invention, the PLC controller 3 incorporates multiple control chips, and the first control module 31 and the second control module 32 are configured in different control chips.

[0067] In a preferred embodiment of the present invention, the first control module 31 and the second control module 32 operate under different operating systems.

[0068] Specifically, in this embodiment, the first control module 31 is preferably configured in an ARM M7 control chip and operates in the codesys system. The second control module 32 is preferably configured in an ARM A8 control chip and operates in the Linux system. Preferably, the Linux system of the ARM A8 can also be transformed for real-time performance through the PREEMPT patch, turning the Linux system into a fully preemptible real-time operating system to improve the real-time performance of the system.

[0069] The present invention also provides a PLC high-concurrency communication method, which is applied to the above-mentioned PLC high-concurrency communication system, as Figure 2 shown, the PLC high-concurrency communication method includes:

[0070] Step S1, the wireless gateway establishes a wireless communication connection with multiple wireless terminal devices, generates MQTT messages from the collected data of each wireless terminal device and publishes them;

[0071] Step S2, the second control module in the PLC controller communicates with each wireless gateway through the built-in MQTT local server using the MQTT protocol to obtain each MQTT message and synchronize it to the first control module therein;

[0072] Step S3, the first control module of the PLC controller runs the built-in PLC control program to generate control instructions based on the collected data contained in the MQTT messages, and issues the control instructions to each wireless terminal device for execution through the second control module.

[0073] The above are only preferred embodiments of the present invention, and do not limit the implementation manners and protection scope of the present invention. For those skilled in the art, it should be realized that all equivalent replacements and obvious changes made by using the content of this specification and the drawings should be included in the protection scope of the present invention.

Claims

1. A PLC high-concurrency communication system, characterized in that, Including: A number of wireless gateways, each of which is correspondingly connected to a plurality of wireless terminal devices, and is used to generate and publish MQTT messages for the acquisition data of each of the wireless terminal devices; A PLC controller, connected to each of the wireless gateways, and the PLC controller includes: A first control module, which has a PLC control program built therein; A second control module, connected to the first control module, and the second control module communicates with each of the wireless gateways by using the MQTT protocol through the built-in MQTT local server to obtain each of the MQTT messages and synchronize them to the first control module; The first control module runs the PLC control program to generate control instructions according to the acquisition data included in the MQTT messages, and issues the control instructions to each of the wireless terminal devices for execution through the second control module.

2. The PLC high-concurrency communication system according to claim 1, characterized in that, The second control module further includes: A database, connected to the MQTT local server, and the MQTT local server is used to obtain the MQTT messages and save them to the database; A data forwarding module, connected to the database, and is used to synchronize the MQTT messages in the database to the first control module.

3. The PLC high-concurrency communication system according to claim 2, characterized in that, A Docker container is deployed inside the second control module, and the MQTT local server is configured inside the Docker container.

4. The PLC high-concurrency communication system according to claim 2, characterized in that, The data forwarding module includes a data monitoring unit, which is used to monitor the MQTT messages in the database in real time, and when the stored MQTT messages change in data, synchronize the changed data to the first control module.

5. The PLC high-concurrency communication system according to claim 1, characterized in that, Also including: A first network switch, connected to each of the wireless gateways through Ethernet; A second network switch, configured inside the PLC controller, and connected to the first network switch, the first control module and the second control module through Ethernet respectively; Each of the wireless gateways communicates with the PLC controller through the main communication link formed by the first network switch, the second network switch and the second control module, and when the main communication link fails, switches to communicate with the PLC controller through the secondary communication link formed by the first network switch, the second network switch and the first control module.

6. The PLC high-concurrency communication system according to claim 1, wherein Communication between the first control module and the second control module is through TTL serial port communication or Ethernet communication.

7. The PLC high-concurrency communication system according to claim 1, wherein, Multiple control chips are built in the PLC controller, and the first control module and the second control module are configured in different control chips.

8. The PLC high-concurrency communication system according to claim 1, characterized in that, The first control module and the second control module run under different operating systems.

9. A PLC high-concurrency communication method, characterized in that, Applied to the PLC high-concurrency communication system as described in any one of claims 1-8, the PLC high-concurrency communication method includes: Step S1, the wireless gateway establishes a wireless communication connection with a plurality of wireless terminal devices, generates and publishes MQTT messages for the acquisition data of each of the wireless terminal devices; Step S2, the second control module in the PLC controller communicates with each of the wireless gateways via the built-in MQTT local server using the MQTT protocol to obtain each of the MQTT messages and synchronize them to the first control module therein; Step S3, the first control module of the PLC controller runs the built-in PLC control program to generate control instructions based on the collected data included in the MQTT messages, and issues the control instructions to each of the wireless terminal devices for execution through the second control module.