Remote control method and device based on software programmable logic controller

By introducing remote control methods at the server layer, control board layer, and industrial gateway layer into the SoftPLC system, and optimizing traffic and task allocation based on demand and heartbeat information, the problem of low system access smoothness was solved, and more efficient system resource management and fault handling were achieved.

CN121284075APending Publication Date: 2026-01-06CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511319128.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-15
Publication Date
2026-01-06

AI Technical Summary

Technical Problem

Existing SoftPLC-based control systems suffer from poor access smoothness when facing centralized access and task assignment, resulting in poor system performance.

Method used

The system receives demand and heartbeat information from the server in the remote control system, determines control strategies, including traffic distribution, task allocation, and primary/backup switching, and optimizes system access smoothness.

Benefits of technology

This improves system access smoothness and ensures that the system can adjust in a timely manner and maintain stable operation when faced with high loads and equipment failures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121284075A_ABST
    Figure CN121284075A_ABST
Patent Text Reader

Abstract

The invention discloses a remote control method and device based on a software programmable logic controller. The method comprises the following steps: a server in a remote control system receives demand information sent by other hierarchical devices in the remote control system, and receives heartbeat information of a SoftPLC (SoftProgrammable Logic Controller) in each hierarchical device through a monitoring module in each hierarchical device, each layer sequentially comprises a server layer, a control single board layer and an industrial gateway layer from top to bottom, and the server layer comprises a server; a control strategy of the remote control system is determined according to the demand information and the heartbeat information, and the control strategy at least comprises one of the following steps that flow of the SoftPLC is allocated, operation tasks of the SoftPLC are shunted, and main and standby switching is conducted on the SoftPLC; and controlling the remote control system according to the control strategy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and more specifically, to a remote control method and apparatus based on a software programmable logic controller. Background Technology

[0002] PLCs (Programmable Logic Controllers) are core control devices in the field of automation. By storing and executing user-written programs, they achieve precise control of various industrial equipment and production processes. Widely used in manufacturing, energy, transportation, and smart buildings, they offer advantages such as high reliability, strong anti-interference capabilities, simple programming, and ease of maintenance. With the continuous development of industrial technology, SoftPLC (Soft Programmable Logic Controller) technology has gradually emerged. Based on general-purpose computer hardware platforms, they require no dedicated hardware and can flexibly adjust hardware configurations according to actual enterprise needs, reducing the types, quantities, and procurement costs of hardware equipment, thus adapting to flexible production requirements. By using general-purpose computer hardware and standard operating systems and related virtualization containers, SoftPLCs reduce hardware failure points and maintenance workload in production equipment. Furthermore, SoftPLCs support remote firmware upgrades, are easily integrated with commonly used enterprise systems, and can collaborate with big data analytics and artificial intelligence applications, enabling better integration into the industrial internet and smart manufacturing environments. This allows for interconnectivity and data sharing between devices, thereby achieving functions such as production process optimization, fault prediction, and quality control, providing support for enterprise decision-making. Based on the performance requirements of the controlled equipment, such as latency, computing power, storage, and maintenance, and combined with the cost control requirements of manufacturing enterprises in procurement and maintenance, SoftPLC can be deployed in devices such as servers, base station intelligent computing boards, and industrial gateways, and achieve automatic business traffic offloading based on 5G communication technology. Furthermore, considering production safety requirements, SoftPLC also needs to be designed with redundancy backups to meet the requirements of seamless switching and continuous operation of the control system in the event of equipment failure or external factors, thereby improving system availability and disaster recovery capabilities. However, most existing SoftPLC-based control systems are simply replacements and modifications of equipment and supporting settings on the original physical PLC control architecture. When facing centralized access and task assignment, the smoothness of control system access is relatively low. Summary of the Invention

[0003] This application provides a remote control method and apparatus based on a software programmable logic controller (PLC), which at least solves the technical problem in the related art of low access smoothness of the control system due to unreasonable centralized access and task assignment.

[0004] According to one aspect of the embodiments of this application, a remote control method based on a software programmable logic controller (SoftPLC) is provided, comprising: a server in a remote control system receiving demand information sent by other level devices in the remote control system, and receiving heartbeat information of the SoftPLCs in each level device through a monitoring module in the other level devices, wherein the levels, from top to bottom, include: a server layer, a control board layer, and an industrial gateway layer, and the server layer includes the server; determining a control strategy for the remote control system based on the demand information and the heartbeat information, wherein the control strategy includes at least one of the following: distributing the traffic of the SoftPLC, diverting the work tasks of the SoftPLC, and performing master-slave switching of the SoftPLC; and controlling the remote control system according to the control strategy.

[0005] Optionally, determining the control strategy of the remote control system based on the demand information includes: when the demand information is a first type of demand information, determining the control strategy to distribute the traffic of the SoftPLC, wherein the first type of demand information indicates that the SoftPLC in the industrial gateway needs to distribute traffic; and when the connection load rate of the industrial gateway that reported the demand information is greater than a first threshold, determining that the industrial gateway that reported the demand information sends the first type of demand information; and when the demand information is a second type of demand information, determining the control strategy to distribute the work tasks of the SoftPLC, wherein the second type of demand information indicates that the SoftPLC in the industrial gateway needs to distribute work tasks.

[0006] Optionally, the method further includes: when the control strategy is to distribute the traffic of the SoftPLC, obtaining a device preference table from the industrial gateway that reported the demand information, and determining the available distribution devices in the device preference table; obtaining the distribution ratio of each available distribution device, and sending a distribution message to the available distribution device through the industrial gateway that reported the demand information, wherein the distribution message is used to instruct the available distribution device to establish a forwarding connection with the industrial gateway that reported the demand information, the forwarding connection is used to execute a traffic distribution process, and the traffic distribution process is used to forward the traffic to be distributed in the industrial gateway that reported the demand information to the available distribution device according to the distribution ratio.

[0007] Optionally, the method further includes: obtaining the execution time of the traffic sharing process through the server; if the execution time of the traffic sharing process is greater than a preset time threshold, obtaining the connection load rate of the industrial gateway that reported the demand information; if the connection load rate is less than a second threshold, determining to stop the traffic sharing process; and if the connection load rate is greater than the second threshold, determining to continue executing the traffic sharing process.

[0008] Optionally, the method further includes: when the control strategy is determined to be to distribute the job tasks of the SoftPLC, obtaining the resource availability index of the industrial gateway that reported the demand information; determining the task priority of the task to be executed based on the resource availability index of the industrial gateway that reported the demand information; when the resource availability index of the industrial gateway that reported the demand information is less than the resource index required by the task to be executed, obtaining the resource availability index of the control board if the priority of the task to be executed is lower than that of the concurrent task to be executed; and when the resource availability index of the control board is greater than the resource index required by the task to be executed, forwarding the task to be executed to the control board for execution.

[0009] Optionally, determining the control strategy of the remote control system based on the heartbeat information includes: acquiring heartbeat information sent by the SoftPLC in each level of equipment; determining that the device corresponding to the heartbeat information is an abnormal device when the heartbeat monitoring waiting time corresponding to the heartbeat information is greater than a preset time threshold; and determining that the control strategy is to perform a master-slave switchover on the SoftPLC when the device corresponding to the heartbeat information is an abnormal device.

[0010] Optionally, the method further includes: if the abnormal device is the industrial gateway and a preset preferred backup exists for the SoftPLC in the industrial gateway, obtaining the preset preferred backup and replacing the SoftPLC in the industrial gateway; if the abnormal device is the industrial gateway and no preset preferred backup exists for the SoftPLC in the industrial gateway, obtaining a backup corresponding to the SoftPLC in the industrial gateway from the control board and replacing the SoftPLC in the industrial gateway; if the abnormal device is the control board, obtaining a backup corresponding to the SoftPLC in the control board from the server and replacing the SoftPLC in the control board; if the abnormal device is the server, obtaining a backup corresponding to the SoftPLC in the server and replacing the SoftPLC in the control board.

[0011] According to another aspect of the embodiments of this application, a remote control device based on a software programmable logic controller (SoftPLC) is also provided, comprising: a receiving module, configured to receive demand information sent by other level devices in the remote control system via a server in the remote control system, and to receive heartbeat information of the SoftPLC in each level device via a monitoring module in the other level devices, wherein the levels, from top to bottom, include: a server layer, a control board layer, and an industrial gateway layer, and the server layer includes the server; a determining module, configured to determine a control strategy for the remote control system based on the demand information and the heartbeat information, wherein the control strategy includes at least one of the following: distributing the traffic of the SoftPLC, diverting the work tasks of the SoftPLC, and performing master-slave switching of the SoftPLC; and a control module, configured to control the remote control system according to the control strategy.

[0012] According to another aspect of the embodiments of this application, a remote control system based on a software programmable logic controller (SoftPLC) is also provided, including: a server, a control board, and an industrial gateway; the server is used to receive demand information and heartbeat information sent by devices at each level in the remote control system; the server is also used to determine the control strategy of the remote control system according to the demand information and the heartbeat information respectively, wherein the control strategy includes at least one of the following: distributing the traffic of the SoftPLC, diverting the work tasks of the SoftPLC, performing master-slave switching of the SoftPLC, and controlling the SoftPLC in the remote control system according to the control strategy.

[0013] According to another aspect of the embodiments of this application, a computer device is also provided, including: a memory and a processor, wherein the memory is used to store program instructions; the processor, connected to the memory, is used to execute the above-described remote control method based on a software programmable logic controller.

[0014] According to another aspect of the embodiments of this application, a computer program product is also provided, including computer instructions that, when executed by a processor, implement the above-described remote control method based on a software programmable logic controller.

[0015] In this embodiment, a server in a remote control system receives demand information sent by other devices at different levels within the remote control system, and receives heartbeat information from the Software Programmable Logic Controllers (SoftPLCs) at each level through monitoring modules in those devices. The levels, from top to bottom, include: a server layer, a control board layer, and an industrial gateway layer. The server layer includes the server itself. Control strategies for the remote control system are determined based on the demand information and the heartbeat information. These control strategies include at least one of the following: distributing traffic to the SoftPLC, diverting tasks for the SoftPLC, or performing primary / backup switching for the SoftPLC. The remote control system is controlled according to these control strategies. By receiving demand information and SoftPLC heartbeat information from other devices in the remote control system through the server in the remote control system, and determining different control strategies based on the received demand information and heartbeat information, different control strategies are determined according to the different needs of the SoftPLC. This achieves the technical effect of improving system access flow and solves the technical problem in related technologies where low access smoothness of the control system is caused by centralized access and unreasonable task allocation. Attached Figure Description

[0016] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0017] Figure 1 This is a hardware structure block diagram of a computer terminal for implementing a remote control method based on a software programmable logic controller, according to an embodiment of this application.

[0018] Figure 2 This is a flowchart of a remote control method based on a software programmable logic controller according to an embodiment of this application;

[0019] Figure 3 This is a schematic diagram of the structure of a remote control system based on a software programmable logic controller according to an embodiment of this application;

[0020] Figure 4 This is a flowchart of a traffic diversion method for a remote control system based on a software programmable logic controller, according to an embodiment of this application.

[0021] Figure 5 This is a flowchart of a backup switching method for a remote control system based on a software programmable logic controller, according to an embodiment of this application.

[0022] Figure 6 This is a schematic diagram of another remote control system based on a software programmable logic controller according to an embodiment of this application;

[0023] Figure 7 This is a schematic diagram of a message body communication process between devices at different layers involved in traffic sharing according to an embodiment of this application;

[0024] Figure 8 This is a schematic diagram of the communication process between devices at different layers involved in task routing according to an embodiment of this application;

[0025] Figure 9 This is a schematic diagram of the communication process between devices at each layer in a gateway SoftPLC backup switching (with a preferred backup PLC) according to an embodiment of this application.

[0026] Figure 10 This is a schematic diagram of the communication process between devices at each layer in a gateway SoftPLC backup switching (without a preferred backup PLC) according to an embodiment of this application;

[0027] Figure 11 This is a schematic diagram of the communication process of various parts within a server SoftPLC backup and switching cluster according to an embodiment of this application;

[0028] Figure 12 This is a comparative diagram of SoftPLC backup switching time in four scenarios according to embodiments of this application;

[0029] Figure 13 This is a comparative diagram showing the processing time of SoftPLC recovery from abnormal state in four scenarios according to embodiments of this application.

[0030] Figure 14 This is a structural diagram of a remote control device based on a software programmable logic controller according to an embodiment of this application. Detailed Implementation

[0031] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0032] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0033] The information collected in this application embodiment is information and data authorized by the user or fully authorized by all parties. The collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data all comply with the relevant laws, regulations and standards of the relevant regions, and necessary confidentiality measures have been taken. It does not violate public order and good morals, and provides corresponding operation entry points for users to choose to authorize or reject the automated decision results. If the user chooses to reject, the process will proceed to the expert decision-making process.

[0034] To address the problems existing in related technologies, embodiments of this application provide a remote control method based on a software programmable logic controller (PLC). This method can operate in... Figure 1 The computer terminal shown is explained below.

[0035] The remote control method based on a software programmable logic controller provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware block diagram of a computer terminal for implementing a remote control method based on a software programmable logic controller is shown. Figure 1 As shown, the computer terminal 10 may include one or more processors (shown as 102a, 102b, ..., 102n in the figure) (the processor may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission module 106 for communication functions connected via wired and / or wireless networks. In addition, it may also include: a display, a keyboard, a cursor control device, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, and a BUS bus. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0036] It should be noted that the aforementioned one or more processors and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be implemented wholly or partially as software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be wholly or partially integrated into any other element in the computer terminal 10. As involved in the embodiments of this application, the data processing circuits serve as processor control (e.g., selection of a variable resistor termination path connected to an interface).

[0037] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the remote control method based on a software programmable logic controller in this embodiment of the application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the aforementioned remote control method based on a software programmable logic controller. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0038] The transmission module 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission module 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission module 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0039] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10.

[0040] It should be noted here that, in some optional embodiments, the above... Figure 1The computer terminal shown may include hardware elements (including circuitry), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware and software elements. It should be noted that... Figure 1 This is only one instance of a specific particular instance, and is intended to illustrate the types of components that may exist in the aforementioned computer terminal.

[0041] In the above operating environment, this application provides an embodiment of a remote control method based on a software programmable logic controller. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Also, although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than that shown here.

[0042] Figure 2 This is a flowchart illustrating a remote control method based on a software programmable logic controller according to an embodiment of this application, such as... Figure 2 As shown, the method includes the following steps:

[0043] Step S202: The server in the remote control system receives the demand information sent by other level devices in the remote control system, and receives the heartbeat information of the software programmable logic controller (SoftPLC) in each level device through the monitoring module in each level device. The levels, from top to bottom, include: server layer, control board layer and industrial gateway layer. The server layer includes the server.

[0044] Step S204: Determine the control strategy of the remote control system based on the demand information and the heartbeat information respectively, wherein the control strategy includes at least one of the following: distributing the traffic of the SoftPLC, diverting the job tasks of the SoftPLC, and switching the SoftPLC to a primary or backup position.

[0045] Step S206: Control the remote control system according to the control strategy.

[0046] Through steps S202 to S206 above, the server in the remote control system receives demand information sent by other level devices in the remote control system, and the monitoring module in the other level devices receives heartbeat information from the Software Programmable Logic Controllers (SoftPLCs) in each level device. The levels, from top to bottom, include: a server layer, a control board layer, and an industrial gateway layer, with the server layer including the server itself. The control strategy of the remote control system is determined based on the demand information and the heartbeat information, wherein the control strategy includes at least one of the following: distributing the traffic of the SoftPLC, and... The tasks of C are distributed, and the SoftPLC is switched between primary and backup. The remote control system is controlled according to the control strategy. The server in the remote control system receives the demand information and heartbeat information of the SoftPLC sent by other level devices in the remote control system. Different control strategies are determined according to the received demand information and heartbeat information, thereby achieving the purpose of determining different control strategies according to different needs of SoftPLC. This achieves the technical effect of improving the system access flow and solves the technical problem of low access smoothness of the control system due to centralized access and unreasonable task allocation in related technologies.

[0047] This application proposes a remote control system based on a software programmable logic controller, such as... Figure 3As shown, the control system consists of a three-tiered structure from top to bottom: the server layer, the intelligent computing board layer (control board layer), and the 5G industrial gateway layer (industrial gateway layer). Devices at each layer can communicate with each other via the enterprise intranet. The server-level SoftPLC controls the boards, gateway SoftPLCs, and a few non-latency-sensitive production devices. This layer also includes global traffic distribution event monitoring, board SoftPLC data backup and migration, and high-computing-power-requirement task execution functions. It is typically used and maintained in a cluster within the enterprise's centralized IT data center. The server layer includes primary and backup server SoftPLCs, a global traffic distribution monitoring module, a task execution module, a server monitoring module, an intelligent computing board monitoring module, a server SoftPLC data sharing module, a data backup module, and a container management module. The intelligent computing board is responsible for logical control and execution of regional or workshop gateway SoftPLCs and some non-latency-sensitive scenarios with computing power requirements. It has the capability to distribute and execute tasks with certain computing power requirements and can perform backup switching and data migration for some gateway SoftPLCs. Generally, one board is deployed in each production workshop or area. The intelligent computing board layer includes a board SoftPLC, a traffic distribution module, a task execution module, a gateway monitoring module, a data backup module, and a container management module. 5G industrial gateways are directly connected to production equipment such as PLCs, robots, and sensors, responsible for executing control logic on most production equipment on-site, and capable of performing tasks with low computing power requirements. These are the most numerous, and some experience high-concurrency access scenarios. Gateways within the same production area are directly connected via switches or network cables to ensure direct communication, achieving traffic sharing and backup switching functions. The 5G industrial gateway integrates a gateway SoftPLC, a task execution module, a traffic sharing module, and a data backup module.

[0048] After the control system starts operating, the SoftPLCs and related modules in each device initialize. Each SoftPLC at each level notifies its corresponding backup monitoring module that initialization is complete. The corresponding backup monitoring module confirms that there are no other running SoftPLCs at that node and returns a confirmation message. Each SoftPLC then starts running its pre-downloaded logic control program and notifies its corresponding backup monitoring module to start running. Subsequently, it periodically sends heartbeat monitoring messages to its corresponding SoftPLC and starts a timer. The SoftPLCs in each layer of devices only complete their own pre-set device control or operation tasks and basic inter-layer device communication. If the corresponding backup monitoring module receives a heartbeat reply message from the SoftPLC before the timer reaches its set maximum waiting time, the timer is reset. At this point, the control system is in normal operating condition.

[0049] When the control system encounters the following two situations, the corresponding processing methods will be triggered: 1) If the SoftPLC in the 5G industrial gateway device experiences high concurrent access in a short period of time, or if the 5G industrial gateway or intelligent computing board (control board) is unable to execute a high computing power demand task due to the current shortage of software and hardware resources, the control system will trigger multi-level business diversion; 2) When a SoftPLC service at a certain layer of the control system becomes inaccessible due to a fault, the control system will trigger multi-level backup switching.

[0050] In some embodiments of this application, the specific steps for determining the control strategy of the remote control system based on the demand information are as follows: When the demand information is a first type of demand information, the control strategy is determined to be to distribute the traffic of the SoftPLC, wherein the first type of demand information indicates that the SoftPLC in the industrial gateway needs to distribute traffic; when the connection load rate of the industrial gateway that reported the demand information is greater than a first threshold, the industrial gateway that reported the demand information sends the first type of demand information; when the demand information is a second type of demand information, the control strategy is determined to be to distribute the work tasks of the SoftPLC, wherein the second type of demand information indicates that the SoftPLC in the industrial gateway needs to distribute work tasks.

[0051] When the control strategy is to distribute the traffic of the SoftPLC, a device preference table is obtained from the industrial gateway that reported the demand information, and the available distribution devices in the device preference table are determined; the distribution ratio of each available distribution device is obtained, and a distribution message is sent to the available distribution devices through the industrial gateway that reported the demand information. The distribution message is used to instruct the available distribution devices to establish a forwarding connection with the industrial gateway that reported the demand information. The forwarding connection is used to execute the traffic distribution process, which is used to forward the traffic to be distributed in the industrial gateway that reported the demand information to the available distribution devices according to the distribution ratio.

[0052] The traffic sharing process can be stopped based on the connection load rate. The execution time of the traffic sharing process is obtained through the server. If the execution time of the traffic sharing process is greater than a preset time threshold, the connection load rate of the industrial gateway that reported the demand information is obtained. If the connection load rate is less than a second threshold, the traffic sharing process is stopped. If the connection load rate is greater than the second threshold, the traffic sharing process is continued.

[0053] Taking a server comprising: a global traffic distribution monitoring module and a task execution module; a smart computing board (control board) comprising: a SoftPLC, a traffic distribution processing module, and a task execution module; and a 5G industrial gateway comprising: a SoftPLC, a task execution module, and a traffic allocation module, as an example, the process of allocating traffic to the SoftPLC in the control strategy is as follows: Figure 4 As shown, the process includes: First, running the control system, where the global traffic monitoring module in the server listens for traffic distribution events on the SoftPLC of the 5G industrial gateway and the SoftPLC of the intelligent computing board in the production area corresponding to the node.

[0054] The second step involves the global flow diversion monitoring module detecting the flow diversion request event reported by SoftPLC, parsing the message body, locating the flow diversion request device, and recording the information.

[0055] The third step is to further determine whether the detected traffic sharing demand event is reported by the 5G industrial gateway device after parsing the module message body.

[0056] If the requirement is for traffic sharing (Type 1 requirement information), it indicates that the connection load rate L of the SoftPLC deployed within the reporting gateway is... r Reaching the set threshold L t The formula for calculating the load rate of SoftPLC connection is shown in formula (1). r C represents the number of established connections under the current communication protocol of this SoftPLC. max The maximum number of connections that can be established under the current communication protocol of the SoftPLC is pre-configured for the user. This parameter value must be less than the maximum number of connections supported by the current communication protocol, and a number of communication connections can be reserved for the SoftPLC to establish.

[0057]

[0058] The global traffic splitting monitoring module returns an acknowledgment message to the reporting gateway SoftPLC. The module then reads the user-pre-configured traffic splitting device preference table from the SoftPLC configuration and obtains the user-configured device splitting coefficient α. i Calculate the remaining communication connection capacity W of the gateway SoftPLC in the list according to formula (2). i Then, calculate the flow allocation ratio D of the M SoftPLCs within the area according to formulas (3) and (4). i It should be noted that if the α of the i-th SoftPLC... i W i The value is greater than C max Then use C maxThe allocation ratio D of the SoftPLC is recalculated using numerical substitution. i W j ′ This represents the available communication connection capacity of the j-th amortizable SoftPLC.

[0059] W i =C max -C i #(2)

[0060]

[0061] The global traffic distribution monitoring module sends the traffic distribution ratio of each distribution gateway to the reporting gateway. The traffic distribution module of the reporting gateway sends a traffic distribution start message to the traffic distribution module of the distribution gateway. After receiving the message, each distribution gateway establishes a forwarding connection with the reporting gateway's SoftPLC. The gateway where the distribution SoftPLC is located encapsulates and forwards short-term intensive access traffic to the distribution gateway according to the distribution ratio through NAT or load balancing. Subsequently, the reporting gateway sends a message to the global traffic distribution monitoring module to notify that distribution has started, and the global traffic distribution module updates the event status.

[0062] At this time, the global traffic distribution monitoring module starts a timer. When the timer reaches the traffic distribution monitoring duration T... d At that time, recalculate whether the communication connection resources of the SoftPLC reporting the request are sufficient (i.e., not exceeding L). t (85% of the traffic sharing is allocated, with a safety margin reserved to protect existing sharing connections.) If this is insufficient, the forwarding communication connection continues to be maintained, and the timer is reset. If sufficient, the global traffic sharing monitoring unit stops the timer and notifies the traffic sharing module of the requesting gateway to stop traffic sharing. The traffic sharing module of the requesting gateway then sends a forwarding stop message to the traffic sharing modules of each sharing gateway. The traffic sharing of each sharing gateway terminates the forwarding connection and notifies the requesting gateway's SoftPLC. Upon receiving the message, the requesting gateway's SoftPLC sends a message to the global traffic sharing monitoring module to indicate that traffic sharing has ended.

[0063] If the control strategy is determined to be to distribute the job tasks of the SoftPLC, the resource availability index of the industrial gateway that reported the demand information is obtained; the task priority of the task to be executed is determined based on the resource availability index of the industrial gateway that reported the demand information; if the resource availability index of the industrial gateway that reported the demand information is less than the resource index required by the task to be executed, and the priority of the task to be executed is lower than that of the concurrent task to be executed, the resource availability index of the control board is obtained; if the resource availability index of the control board is greater than the resource index required by the task to be executed, the task to be executed is forwarded to the control board for execution.

[0064] It should be noted that the resource availability index includes, but is not limited to, the CPU availability index and the memory availability index.

[0065] Specifically, if it is not a traffic sharing requirement, then it is a high-computing-power task distribution requirement of the gateway SoftPLC (second type of requirement information), indicating that the available hardware resources of the gateway reporting the requirement do not meet the conditions for task execution. Before the gateway SoftPLC intends to execute a high-computing-power task, the gateway task processing module obtains the gateway's CPU and memory usage rates and calculates the CPU availability index A according to formulas (5) and (6). G_cpu Memory availability index A G_mem And further calculate the priority index Pri_Value for each task. G_i In the formula, S G_cpu For the gateway CPU resource security factor (default), S G_mem λ is the gateway memory resource security factor (preset). G To calculate the density coefficient, μ G The two coefficients are memory intensity coefficients, configured according to the task's bias towards computational or memory intensity, satisfying the numerical relationship λ + μ = 1. i U represents the original priority index of the i-th task. G_cpu Indicates the gateway's CPU utilization, U G_mem T represents the gateway's memory usage. G_cpu T represents the total amount of gateway CPU resources. G_mem This indicates the total amount of gateway memory resources.

[0066]

[0067] Pri_Value G_i =(λ G ·A G_cpu +μ G ·A G_mem )·Pri i #(7)

[0068] When the available index does not meet the threshold for task execution, or when concurrent tasks are generated, the gateway task execution module cannot execute. The gateway SoftPLC sends a message to the global traffic distribution monitoring module to report the traffic distribution requirement. After receiving the traffic distribution requirement, the global traffic distribution monitoring module records the traffic distribution requirement and sends an acknowledgment message to the gateway. After receiving the message, the gateway establishes a connection with the single-board traffic distribution processing module and sends tasks whose available index does not meet the execution threshold, or tasks with lower priority index among concurrent tasks, to it. Similar to the previous steps, the single-board task execution module obtains the CPU and memory utilization of the intelligent computing board and calculates the CPU available index A according to formulas (8) and (9) respectively. B_cpu Memory availability index AB_mem U B_cpu This indicates the CPU utilization rate of the intelligent computing board, U. B_mem T represents the memory utilization rate of the intelligent computing board. B_cpu T represents the total CPU resources of the intelligent computing board. B_mem This indicates the total memory resources of the intelligent computing board.

[0069]

[0070] If the calculated available index meets the threshold for task execution, the intelligent computing board task execution module executes the task. Upon completion, it returns the execution result to the gateway SoftPLC. The gateway SoftPLC then sends a task completion message to the global traffic distribution monitoring module, which completes the traffic distribution request work order upon receiving the message. If the threshold for task execution is not met, the intelligent computing board traffic distribution module reports a traffic distribution request to the global traffic distribution monitoring module. Upon receiving the request, the global traffic distribution monitoring module confirms it with the intelligent computing board traffic distribution module. The intelligent computing board then establishes a connection with the server task execution module and sends it tasks whose available index does not meet the task execution threshold. The server task execution module receives this confirmation and begins running the task. It should be noted that if a task intended to be executed by the SoftPLC within the intelligent computing board cannot be executed due to insufficient hardware available index, the same steps are followed. After the server's task execution module completes the execution of the sent tasks in queue order, it returns the execution result to the board traffic distribution processing module, and the board sends a task completion message to the global traffic distribution monitoring module. If the task is routed upwards from the gateway, the single-board traffic processing module continues to return the execution result to the lower-level traffic processing module of the gateway, and the gateway sends a task completion message to the global traffic monitoring module.

[0071] The fourth step is to parse the task completion message body received by the global traffic diversion monitoring module, find the corresponding event in the recorded traffic diversion request event list, and complete the completion operation.

[0072] In this embodiment of the application, the specific steps for determining the control strategy of the remote control system based on the heartbeat information are as follows: acquiring the heartbeat information sent by the SoftPLC in each level of the device; determining that the device corresponding to the heartbeat information is an abnormal device when the heartbeat monitoring waiting time corresponding to the heartbeat information is greater than a preset time threshold; and determining that the control strategy is to perform a master-slave switchover on the SoftPLC when the device corresponding to the heartbeat information is an abnormal device.

[0073] If the faulty device is the industrial gateway and a preset preferred backup exists for the SoftPLC in the industrial gateway, the preset preferred backup is obtained, and the SoftPLC in the industrial gateway is replaced. If the faulty device is the industrial gateway and no preset preferred backup exists for the SoftPLC in the industrial gateway, a backup corresponding to the SoftPLC in the industrial gateway is obtained from the control board, and the SoftPLC in the industrial gateway is replaced. If the faulty device is the control board, a backup corresponding to the SoftPLC in the control board is obtained from the server, and the SoftPLC in the control board is replaced. If the faulty device is the server, a backup corresponding to the SoftPLC in the server is obtained from the server, and the SoftPLC in the control board is replaced.

[0074] Taking the control system, which includes the following main modules and application services: Server: main SoftPLC, one or more backup SoftPLCs, server monitoring module, intelligent computing board monitoring module, server SoftPLC data sharing module, data backup module, and container management module; Intelligent computing board: SoftPLC, gateway monitoring module, data backup module, and container management module; 5G industrial gateway: SoftPLC and data backup module, as an example... Figure 5 As shown, the specific steps for switching the SoftPLC to a primary / standby configuration include: First, the control system proposed in this invention operates, and the gateway monitoring module in the single board sends a heartbeat monitoring message body MAg to all gateway SoftPLCs. i The single-board monitoring module in the server sends a heartbeat monitoring message body MAb to all intelligent computing single-board SoftPLCs. i The server monitoring module sends a heartbeat monitoring message body MAs to the server master SoftPLC. i The three modules each start their timer TAG. i ,TAb i TAs i This is used to record the duration of receiving the corresponding SoftPLC response message body.

[0075] The second step will be explained using the i-th SoftPLC on a certain layer as an example. If the timer exceeds the maximum heartbeat monitoring waiting time, a TAG will appear. i Duration_H g ,TAb i Duration_H b , and TAs i Duration_H sIn such cases, the corresponding SoftPLC is determined to be abnormal.

[0076] The third step is to initiate a backup and switchover operation for the malfunctioning SoftPLC. The backup and switchover operation differs for different levels of SoftPLCs, and will be explained in detail below.

[0077] If the gateway SoftPLC malfunctions, the gateway monitoring module on the board establishes communication with the gateway's data backup module. When the user manually configures the preferred backup SoftPLC for this malfunctioning SoftPLC, the gateway monitoring module requests information about the backup SoftPLC from the data backup module of the gateway containing the malfunctioning SoftPLC. The gateway's data backup module returns the IP address of the backup SoftPLC to the monitoring module. The gateway monitoring module then requests a backup from the data backup module of the gateway containing the backup SoftPLC. The data backup module confirms, activates the pre-downloaded backup control program, establishes communication with the data backup module of the gateway containing the malfunctioning SoftPLC, and completes the migration of runtime data to achieve runtime data synchronization and complete the backup switchover operation. If the user has not manually configured the preferred backup SoftPLC for this malfunctioning SoftPLC, the intelligent computing board gateway monitoring module requests a backup from the board's data backup module. The board's data backup module returns a backup confirmation message, notifying the board's container management module to create a container and load the backup control program stored within the board. Upon completion, it informs the board's data backup module. The single-board data backup module communicates with the data backup module of the gateway where the abnormal SoftPLC is located to complete the migration of running data, and then synchronizes with the backup SoftPLC data in the container to complete the backup switch operation.

[0078] If the intelligent computing board SoftPLC malfunctions, the server board monitoring module sends a backup request to the server data backup module. The data backup module confirms the request and notifies the container management module to load the board SoftPLC control program using the backup SoftPLC in the idle container. It then establishes communication with the data backup module of the malfunctioning board SoftPLC to migrate the running data and complete the backup switchover operation.

[0079] If the main SoftPLC on the server malfunctions, the server monitoring module sends a backup request to the backup SoftPLC within the server, informing it to become the new main SoftPLC. The backup SoftPLC, having already downloaded the control program from the main SoftPLC, confirms with the server monitoring module and then directly reads the main SoftPLC's operating data and related configurations from the upper-level data backup module. This allows the backup SoftPLC to take over global control of the main SoftPLC, completing the backup operation.

[0080] The fourth step is that after each layer of backup SoftPLC completes the switch, it sends a backup switch success message to the corresponding monitoring module. Upon receiving the message, the monitoring module records the backup switch.

[0081] The fifth step is to troubleshoot and restore operation of the abnormal SoftPLC, which is explained according to the different levels of SoftPLC.

[0082] When the faulty gateway SoftPLC recovers, it sends a SoftPLC initialization completion message to the gateway monitoring module of the single board. The gateway monitoring module confirms that a running SoftPLC exists on this node. It instructs the recovered SoftPLC to switch to a paused state and notifies the backup SoftPLC to stop backup operation. If the backup SoftPLC is located at the gateway layer: the backup SoftPLC migrates the corresponding data to the recovered SoftPLC before stopping the backup control program, and then informs the gateway monitoring module that backup has stopped. If the backup SoftPLC is located on the intelligent computing single board side: the backup SoftPLC migrates the corresponding data to the recovered SoftPLC before stopping the backup control program. Subsequently, the single board container management module deletes the container where the SoftPLC resides, and then informs the gateway monitoring module that backup has stopped. After receiving the message that the backup SoftPLC has stopped running, the gateway monitoring module notifies the recovered SoftPLC to start running.

[0083] Upon recovery of the abnormal intelligent computing board SoftPLC, a SoftPLC initialization completion message is sent to the server-level board monitoring module. The board monitoring module confirms that a running SoftPLC exists on this node, instructs the recovered SoftPLC to switch to a paused state, and notifies the backup SoftPLC to stop backup operation. After the backup SoftPLC in the server container migrates the corresponding data to the board SoftPLC, it stops running and clears the backup control program, informing the board monitoring module. Upon receiving the message, the board monitoring module notifies the board SoftPLC to start running.

[0084] When the abnormal server SoftPLC recovers, it sends a SoftPLC initialization completion message to the server monitoring module. The server monitoring module confirms that there is a running SoftPLC at this time and informs the recovered SoftPLC to switch to the backup waiting state as the new backup SoftPLC. Its running data is shared with the running SoftPLC through the SoftPLC data sharing module.

[0085] The sixth step is for each monitoring module to update the main SoftPLC information of the current node.

[0086] To better understand the remote control method based on a software programmable logic controller (PLC) proposed in the embodiments of this application, another embodiment will be used to illustrate the remote control method based on a PLC proposed in the embodiments of this application.

[0087] The overall architecture of this embodiment is as follows: Figure 6 As shown, the control system consists of a three-layer structure from top to bottom: servers, intelligent computing boards, and a 5G industrial gateway. The server layer is a cluster of multiple servers, which improves the processing speed of the control system and the execution speed of tasks with high computing power requirements through load balancing. The redundant architecture ensures the continuity, stability, and reliability of the control system services. Devices at each layer can communicate with each other through the enterprise intranet, and it is also connected to external production systems such as ERP (Enterprise Resource Planning), MES (Manufacturing Execution System), IoT platforms, and OT (Operational Technology) platforms to achieve production data visualization, production process transparency, and the ability to remotely access and control equipment.

[0088] After the control system proposed in this embodiment starts running, the SoftPLC and each module are initialized and establish corresponding communication connections according to the user's pre-configuration. Each SoftPLC and module within the control system communicates according to the message body format shown in Table 1. The message body communication process between devices at each layer involved in traffic sharing in this embodiment is as follows: Figure 7 As shown, it includes:

[0089] Table 1

[0090]

[0091]

[0092] The SoftPLC within the 5G industrial gateway sends an initialization completion message to the gateway monitoring module within the intelligent computing board. The main SoftPLC within the intelligent computing board sends an initialization completion message to the board monitoring module within the server, and the main SoftPLC within the server sends an initialization completion message to the server monitoring module. All three backup monitoring modules, upon receiving the message, confirm that no SoftPLC is running on the corresponding control node and return "agree_start". Each SoftPLC, upon receiving this message, starts running its pre-downloaded logic control program and sends a "plc_start" message to the corresponding backup monitoring module. Each backup monitoring module sends a heartbeat monitoring message to the corresponding SoftPLC and starts a timer. In this embodiment, the system Duration_H g Duration_H b Duration_H s All are set to 200ms.

[0093] In this embodiment, the L of the SoftPLC in the 5G industrial gateway of production area 1# is... r The value reaches the set connection load rate threshold of 80%, i.e., L r =L t =80%. The SoftPLC sends a traffic allocation request message body with the content "req_load" to the server's global traffic allocation monitoring module. After receiving the message body, the global traffic allocation monitoring module records the work order and returns an acknowledgment message body with the content "req_aff". The module then reads the SoftPLC traffic allocation device preference table of gateway #1 (as shown in Table 2), calculates the allocation ratio, and sends the result "[0.40,0.24,0.36]" to the traffic allocation module of gateway #1.

[0094] Table 2

[0095]

[0096] After obtaining the allocation ratio, the traffic allocation module of gateway #1 sends a "forw_start" message to the traffic allocation modules of the three gateways (gateways #5, #7, and #8). The modules of these three gateways establish a forwarding connection with the SoftPLC of gateway #1. The SoftPLC of gateway #1 sends a message body (msg) with the content "load_start" to the global traffic allocation monitoring module. The global traffic allocation module updates the work order status and starts a timer. In this embodiment, T... d Set to 10 seconds. When the timer expires, send a message with the content "read_load" to the gateway traffic sharing module. The gateway traffic sharing module returns the current load rate, such as L at this time. rIf it still exceeds 80%, the timer will reset, such as L. r No more than 68% (i.e., L) t If the traffic sharing rate reaches 85%, the global traffic sharing monitoring module sends a "req_lend" message to the traffic sharing module of gateway #1. Upon receiving the message, the traffic sharing module of gateway #1 sends a "forw_end" message to the traffic sharing modules of gateways #5, #7, and #8. Upon receiving the message, the corresponding modules stop forwarding communication and return a message body containing "fcon_end". The SoftPLC of gateway #1 then sends a "load_end" message to the global traffic sharing monitoring module, which then completes the work order. This traffic sharing process ends.

[0097] In this embodiment, task routing involves communication processes between devices at different layers, such as... Figure 8 As shown, in this embodiment, concurrent device scheduling tasks occur in the SoftPLC of gateway #3 within production area #1. Task 1: Pri1 = 2, λ1 = 0.7, μ1 = 0.3; Task 2: Pri2 = 3, λ1 = 0.4, μ1 = 0.6. The security factor S of this gateway is... G_mem S G_cpu Set them to 1.5 and 1.2 respectively. A G_cpu A G_cpu The calculated values ​​are 0.608 and 0.242, both meeting the execution thresholds for both tasks. Since Pri_Value1 = 0.996 and Pri_Value2 = 1.165, Task 1 is split into two tasks. Gateway #3 (SoftPLC) sends a "req_task" message to the global task splitting monitoring module. Upon receiving the message, the global task splitting monitoring module records the work order and returns a "req_aff" confirmation message. Subsequently, the gateway sends Task 1 to the task splitting processing module of the #1 intelligent computing board in the same production area. The memory availability index A of the intelligent computing board... B_mem =0.148, which does not meet the task execution requirements. The system sends a task allocation request to the global allocation monitoring module with the message content "req_task". Upon receiving the message, the global allocation monitoring module returns an acknowledgment message with the content "req_aff". The intelligent computing board then sends the task to the server's task execution module. The server's task execution module returns an acknowledgment message "exec_aff". After executing the sent task in the queue order, the task execution module returns the execution result to the board's allocation processing module. The intelligent computing board then sends a task completion message with the content "task_end" to the global allocation monitoring module, and then returns the execution result to the SoftPLC allocation processing module of gateway #3. The gateway then sends a task completion message with the content "task_end" to the global allocation monitoring module. The global allocation monitoring module receives and completes the work order.

[0098] In this embodiment, the communication process between devices at each layer during gateway SoftPLC backup switching (configuring preferred backup PLC) is as follows: Figure 9 As shown, in this embodiment, the gateway monitoring module of the 1# intelligent computing board in production area 1# detects a heartbeat monitoring response timeout in the SoftPLC of gateway 4#. This gateway monitoring module sends a message with the content "ask_bac" to the data backup module of gateway 4#. Gateway 4# configures the SoftPLC of gateway 10# as the primary backup SoftPLC and sends its IP address "16.0.1.54" as the message content to the gateway monitoring module of board 1#. The backup monitoring module sends a message with the content "req_bac" to the data backup module of gateway 10#. After receiving the message, the data backup module of gateway 10# activates the pre-downloaded backup control program, sends "read_rdata" to gateway 4# to synchronize running data, takes over its control logic, and finally sends a "bac_start" message to the gateway monitoring module of board 1#. The gateway monitoring and backup module of board 1# records the backup switch after receiving the message. When the SoftPLC of Gateway #4 recovers from the anomaly, it sends a "plc_ready" message to the gateway monitoring module. The gateway monitoring module confirms that a SoftPLC with IP address "16.0.1.54" is running on this node, and sends a "ask_swd" message to the SoftPLC of Gateway #4, while simultaneously sending a "ask_bstop" message to the SoftPLC of Gateway #10. After receiving the message bodies, the SoftPLC of Gateway #10 performs data migration with the SoftPLC of Gateway #4. After receiving the running data, the SoftPLC of Gateway #4 sends a "dmig_end" message to the SoftPLC of Gateway #10. The SoftPLC of Gateway #10 then aborts the backup control program and sends a "bac_end" message to the monitoring module of the gateway on board #1. The monitoring module of the gateway on board informs the SoftPLC of Gateway #4 to resume operation. Upon receiving the "plc_start" message, the monitoring module of the gateway on board #1 updates the SoftPLC information of this node.

[0099] In this embodiment, the communication process between devices at each layer during gateway SoftPLC backup switching (without a preferred backup PLC configured) is as follows: Figure 10As shown, in this embodiment, the gateway monitoring module of the 1# intelligent computing board in production area 1# detects a heartbeat monitoring timeout in the SoftPLC of gateway 6#, and the handling steps are the same as those for the SoftPLC of gateway 4#. However, the SoftPLC of gateway 6# is not configured with a preferred backup PLC, that is, it returns a message content of "null" to the gateway monitoring module of the 1# board. At this time, the gateway monitoring module sends a "req_bac" message body to the board data backup module, and the board data backup module returns "bac_aff" and sends "ask_acont" to the container management module. The container management module creates a SoftPLC container and replies to the data backup module with "acont_fin". The data backup module sends "read_rdata" to the data backup module of gateway 6# to obtain running data and synchronizes it with the backup SoftPLC data in the container. Subsequently, the SoftPLC in the container starts execution and sends a "bac_start" message to the gateway monitoring module of the 1# board. After receiving the message body, the gateway monitoring module of the 1# board records the backup switch. When the SoftPLC of Gateway #6 recovers from the error, it sends a "plc_ready" message to the Gateway Monitoring Module of Board #1. The Gateway Monitoring Module confirms that the SoftPLC service created in Board #1 already exists on this node, and sends an "ask_swd" message to the SoftPLC of Gateway #6, while simultaneously sending "ask_bstop" to the SoftPLC service created in Board #1. Upon receiving the message bodies, the SoftPLC created in Board #1 performs data migration with the SoftPLC of Gateway #6. After receiving the running data, the SoftPLC of Gateway #6 sends "dmig_end" to the SoftPLC created in Board #1. The SoftPLC created in Board #1 then aborts the backup control program and destroys the container where the backup SoftPLC resides. After completing these two steps, it sends "bac_end" to the Backup Monitoring Module of Board #1. The Backup Monitoring Module of Board #1 then sends "ask_start" to the SoftPLC of Gateway #6. The SoftPLC of Gateway #6 runs and returns "plc_start," and the Backup Monitoring Module of Board #1 updates the SoftPLC information for this node.

[0100] In this embodiment, the communication process of the various parts of the server SoftPLC backup and switching cluster is as follows: Figure 11 As shown, in this embodiment, the server's single-board monitoring module detects a heartbeat monitoring timeout in the SoftPLC of the 1# intelligent computing board in production area 1#. The handling steps are similar to those for the SoftPLC of gateway 6#, and will not be repeated here. It should be noted that the server container management module has idle containers with the SoftPLC service already deployed. During master-slave switchover, only the control program needs to be loaded or cleared; there is no need to create or destroy containers.

[0101] In this embodiment, after the server monitoring module detects a heartbeat monitoring timeout in the main server SoftPLC (1#SoftPLC), it immediately sends a "req_bac" message to the running backup SoftPLC (2#SoftPLC) within the server. Upon receiving this message, 2#SoftPLC returns "bac_aff," synchronizes the relevant configuration and running data of 1#SoftPLC from the SoftPLC data sharing module, and replies with a "bac_start" message to the server monitoring module, thus taking over global control of 1#SoftPLC. The server monitoring module records the backup switchover upon receiving the message. When 1#SoftPLC recovers, it sends "plc_ready" to the server monitoring module. The server monitoring module confirms that 2#SoftPLC is running and sends a "swi_bac" message to 1#SoftPLC. Upon receiving this message, 1#SoftPLC returns "plc_bacready," and the server monitoring module updates the SoftPLC information for that node. At this point, 1#SoftPLC switches to the backup SoftPLC.

[0102] In this embodiment, the time delay test for SoftPLC backup switching under the above four scenarios is as follows: Figure 12 As shown, it can be seen that because the server's main SoftPLC has an already running SoftPLC #2 that shares running data, and all modules communicate and interact within the same device, the backup switching time of the SoftPLC in this scenario is significantly better than the other three scenarios. The gateway SoftPLC #4, being configured as the primary backup PLC, only needs to communicate with the corresponding module of gateway #10 and activate the SoftPLC backup program segment; therefore, its backup switching time in this scenario is better than that of gateway #6. The backup switching steps for the intelligent computing board SoftPLC are similar to those for gateway #6, but it does not require creating or destroying containers, thus its switching time is even better.

[0103] Regarding the recovery strategies for SoftPLC from anomalies, a comparative test of the recovery time for different SoftPLC recovery strategies in four scenarios is presented. Figure 13 As shown, since the server directly uses the restored SoftPLC #1 as the new backup SoftPLC, this scenario has the shortest processing time. The other three scenarios all involve communication, data synchronization, and control program operations between devices at different levels, so their processing time is significantly longer than that of the server SoftPLC scenario.

[0104] It is understood that the remote control method based on a software programmable logic controller (PLC) proposed in this application constructs a multi-level control system architecture. Leveraging the advantages of 5G communication technology and the flexible deployment of SoftPLC in different devices, a multi-level control system architecture is designed from top to bottom, consisting of a server, a base station intelligent computing board, and a 5G industrial gateway. The architecture considers the differences in latency, computing power, and maintenance methods of SoftPLC deployed in different devices. Each layer of SoftPLC performs its own function, and the communication interaction between modules related to traffic distribution and backup between layers ensures the stable and continuous operation of the control system. Furthermore, this control system can be integrated with external production systems such as MES and ERP, adapting to the multi-level and regional collaborative production needs of unmanned factories. The server layer deploys a global traffic distribution monitoring module, which collaborates with modules related to traffic distribution processing and task execution at each layer, as well as the traffic sharing module at the gateway layer. This enables rapid traffic distribution for tasks with high concurrency and high computing power requirements in a short time, ensuring smooth communication access and job execution for node devices, improving product quality and production efficiency, and helping to achieve transparency in the production process. Through various backup detection and data backup modules, corresponding backup SoftPLC switching and heartbeat monitoring mechanisms, data migration and backup switching operations are initiated at the same or higher level according to the level of the abnormal SoftPLC, reducing equipment switching latency, minimizing downtime and impact on production, optimizing the utilization of hardware and software resources, and ensuring the continuity and reliability of actual production.

[0105] Figure 14 A remote control device based on a software programmable logic controller is shown, the device comprising:

[0106] The receiving module 140 is used for the server in the remote control system to receive the demand information sent by other level devices in the remote control system, and to receive the heartbeat information of the software programmable logic controller (SoftPLC) in each level device through the monitoring module in the other level devices. The levels, from top to bottom, include: server layer, control board layer and industrial gateway layer, and the server layer includes the server.

[0107] The determination module 142 is used to determine the control strategy of the remote control system based on the demand information and the heartbeat information, wherein the control strategy includes at least one of the following: distributing the traffic of the SoftPLC, diverting the job tasks of the SoftPLC, and switching the SoftPLC to a primary or backup position.

[0108] The control module 144 is used to control the remote control system according to the control strategy.

[0109] The aforementioned remote control device based on a software programmable logic controller (SoftPLC) employs a server in the remote control system to receive demand information sent by other devices at different levels within the remote control system. It also receives heartbeat information from the SoftPLCs at each level through monitoring modules within those other devices. The levels, from top to bottom, include: a server layer, a control board layer, and an industrial gateway layer. The server layer includes the server itself. The device determines a control strategy for the remote control system based on the demand information and the heartbeat information. This control strategy includes at least one of the following: distributing the traffic to the SoftPLC; and... The PLC's tasks are distributed, and the SoftPLC is switched between primary and backup. The remote control system is controlled according to the control strategy. The server in the remote control system receives demand information from other levels of equipment and heartbeat information from the SoftPLC. Different control strategies are determined based on the received demand and heartbeat information, thus achieving the goal of determining different control strategies according to the different needs of the SoftPLC. This improves the system access flow and solves the technical problem of low control system access smoothness caused by centralized access and unreasonable task allocation in related technologies.

[0110] It should be noted that, Figure 14 The remote control device based on a software programmable logic controller shown is used to perform... Figure 2 The remote control method based on a software programmable logic controller (PLC) is shown above. Therefore, the relevant explanations and descriptions in the above-mentioned remote control method based on a PLC also apply to this remote control device based on a PLC, and will not be repeated here.

[0111] This application also provides a computer device, including: a memory and a processor, wherein the memory is used to store program instructions; and the processor, connected to the memory, is used to execute the above-described remote control method based on a software programmable logic controller.

[0112] This application also provides a computer program product, including computer instructions that, when executed by a processor, implement the steps of the remote control method based on a software programmable logic controller in this application.

[0113] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0114] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0115] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0116] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0117] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0118] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0119] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A remote control method based on a software programmable logic controller, characterized by, The method comprises the following steps: A server in a remote control system receives demand information sent by other hierarchical devices in the remote control system, and receives heartbeat information of a software programmable logic controller (SoftPLC) in each hierarchical device through a monitoring module in each hierarchical device, wherein the hierarchies from top to bottom comprise a server layer, a control single board layer and an industrial gateway layer, and the server layer comprises the server; A control strategy of the remote control system is determined according to the demand information and the heartbeat information respectively, wherein the control strategy at least comprises one of the following: flow of the SoftPLC is apportioned, job tasks of the SoftPLC are shunted, and the SoftPLC is switched over between master and standby; The remote control system is controlled according to the control strategy.

2. The method of claim 1, wherein, The control strategy of the remote control system is determined according to the demand information, comprising: In a case where the demand information is first type demand information, it is determined that the control strategy is to apportion the flow of the SoftPLC, wherein the first type demand information is used to indicate that the SoftPLC in the industrial gateway needs to be apportioned in flow, and in a case where a connection load rate of an industrial gateway reporting the demand information is greater than a first threshold value, it is determined that the industrial gateway reporting the demand information sends the first type demand information; In a case where the demand information is second type demand information, it is determined that the control strategy is to shunt the job tasks of the SoftPLC, wherein the second type demand information is used to indicate that the SoftPLC in the industrial gateway needs to be shunted in job tasks.

3. The method of claim 2, wherein, The method further comprises: In a case where the control strategy is to apportion the flow of the SoftPLC, a device preference table is acquired from an industrial gateway reporting the demand information, and available apportioning devices in the device preference table are determined; An apportioning proportion of each available apportioning device is acquired respectively, and an apportioning message is sent by the industrial gateway reporting the demand information to the available apportioning devices, the apportioning message being used to instruct the available apportioning devices to establish a forwarding connection with the industrial gateway reporting the demand information, the forwarding connection being used to execute a flow apportioning process, and the flow apportioning process being used to forward flow to be apportioned in the industrial gateway reporting the demand information to the available apportioning devices according to the apportioning proportion.

4. The method of claim 3, wherein, The method further comprises: An execution duration of the flow apportioning process is acquired by the server, in a case where the execution duration of the flow apportioning process is greater than a preset duration threshold value, a connection load rate of the industrial gateway reporting the demand information is acquired; In a case where the connection load rate is less than a second threshold value, it is determined to stop the flow apportioning process; In a case where the connection load rate is greater than the second threshold value, it is determined to continue to execute the flow apportioning process.

5. The method of claim 2, wherein, The method further comprises: In a case where it is determined that the control strategy is to shunt the job tasks of the SoftPLC, a resource availability index of an industrial gateway reporting the demand information is acquired; determining a task priority of a to-be-executed task according to a resource available index of an industrial gateway reporting the demand information; in a case where the resource available index of the industrial gateway reporting the demand information is less than a required resource index of the to-be-executed task, obtaining a priority of the to-be-executed task lower than a concurrent task of the to-be-executed task, obtaining a resource available index of the control board; in a case where the resource available index of the control board is greater than the required resource index of the to-be-executed task, forwarding the to-be-executed task to the control board for execution.

6. The method of claim 1, wherein, determining a control strategy of the remote control system according to the heartbeat information, including: obtaining heartbeat information sent by the SoftPLC in each hierarchical device respectively; in a case where a heartbeat monitoring waiting duration corresponding to the heartbeat information is greater than a preset duration threshold, determining that the device corresponding to the heartbeat information is an abnormal device; in a case where the device corresponding to the heartbeat information is an abnormal device, determining that the control strategy is to perform master-backup switching on the SoftPLC.

7. The method of claim 6, wherein, The method further includes: in a case where the abnormal device is the industrial gateway and there is a preset preferred backup for the SoftPLC in the industrial gateway, obtaining the preset preferred backup and replacing the SoftPLC in the industrial gateway; in a case where the abnormal device is the industrial gateway and there is no preset preferred backup for the SoftPLC in the industrial gateway, obtaining a backup corresponding to the SoftPLC in the industrial gateway from the control board and replacing the SoftPLC in the industrial gateway; in a case where the abnormal device is the control board, obtaining a backup corresponding to the SoftPLC in the control board from the server and replacing the SoftPLC in the control board; in a case where the abnormal device is the server, obtaining a backup corresponding to the SoftPLC in the server from the server and replacing the SoftPLC in the control board.

8. A remote control device based on a software programmable logic controller, characterized by including: a receiving module, configured to receive, by a server in a remote control system, demand information sent by other hierarchical devices in the remote control system, and receive, by a monitoring module in the other hierarchical devices, heartbeat information of a software programmable logic controller (SoftPLC) in each hierarchical device, wherein the hierarchical devices include, from top to bottom, a server layer, a control board layer, and an industrial gateway layer, and the server layer includes the server; a determining module, configured to determine a control strategy of the remote control system according to the demand information and the heartbeat information respectively, wherein the control strategy at least includes one of the following: splitting the traffic of the SoftPLC, splitting the job tasks of the SoftPLC, and performing master-backup switching on the SoftPLC; a control module, configured to control the remote control system according to the control strategy.

9. A software programmable logic controller based remote control system, characterized by, including: a server, a control board, and an industrial gateway; The server is configured to receive demand information and heartbeat information sent by devices at different levels in a remote control system; The server is further configured to determine a control strategy of the remote control system according to the demand information and the heartbeat information respectively, wherein the control strategy at least includes one of the following: apportioning flow of a SoftPLC, shunting job tasks of the SoftPLC, switching the SoftPLC between active and standby modes, and controlling the SoftPLC in the remote control system according to the control strategy.

10. A computer device, comprising: Comprise: a memory and a processor, wherein the memory is configured to store program instructions; The processor, connected with the memory, is configured to execute the remote control method based on the software programmable logic controller according to any one of claims 1 to 7.

11. A computer program product comprising computer instructions, characterized in that, The computer instructions are executed by the processor to implement the remote control method based on the software programmable logic controller according to any one of claims 1 to 7.