A control method for a PLC controller network with redundant CPUs
By setting up master-slave CPUs and PLC cloud gateways in the PLC controller network, and combining real-time monitoring and diagnostics from the cloud server, the problems of unstable communication and untimely fault handling in the existing redundant CPU network are solved. This enables rapid system switching and efficient fault diagnosis, improving production stability and operation and maintenance efficiency.
Patent Information
- Application Number
- CN202410595239.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-14
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-05-14
AI Technical Summary
Existing PLC controller networks with redundant CPUs suffer from communication delays and instability. Control takeover is not timely when the main CPU fails, and cloud server monitoring and diagnostics are not accurate enough, resulting in inefficient system fault handling.
The PLC controller network is configured with a master CPU and multiple slave CPUs connected via handshake lines. It is equipped with a status monitoring module and takeover priority. Combined with the PLC cloud gateway and cloud server, it realizes real-time data transmission and fault diagnosis, and uses machine learning and artificial intelligence for fault judgment and optimization.
This ensures that the system can quickly switch to the backup CPU in the event of a main CPU failure, improving system stability and reliability, enabling real-time monitoring and efficient fault diagnosis, and reducing production downtime and maintenance costs.
Smart Images

Figure CN118502346B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application provides a control method of a PLC controller network with redundant CPUs, and belongs to the technical field of PLC controllers. BACKGROUND
[0002] With the rapid development of industrial automation technology, programmable logic controllers (PLC) have become the core equipment in the field of industrial control. PLCs play an important role in industrial automation with their powerful control functions, flexible configuration methods, and stable and reliable performance. However, as the production scale expands and complexity increases, the stability and reliability of PLC controllers are increasingly required.
[0003] Traditional PLC controllers usually use a single CPU for control. Once the CPU fails, the entire control system will be in a paralyzed state, resulting in production line downtime and loss of production efficiency. Therefore, how to ensure the stability and reliability of PLC controllers and avoid production interruptions caused by CPU failures has become a problem that needs to be solved in the current industrial automation field.
[0004] In order to solve this problem, people began to explore the use of PLC controller networks with redundant CPUs. By setting up a master CPU and a slave CPU and establishing a communication mechanism between them, the control right is taken over when the master CPU fails, thereby improving the reliability and stability of the PLC controller network. At the same time, combined with the application of cloud servers, remote monitoring, fault diagnosis and debugging of the PLC controller network are realized, further improving the intelligent level of the industrial automation system.
[0005] However, the existing control method of PLC controller networks with redundant CPUs still has some shortcomings. For example, the communication mechanism between the master CPU and the slave CPU may have delays or instability problems, affecting the smooth takeover of control rights; the monitoring and fault diagnosis of the PLC controller network by the cloud server may not be accurate and timely enough, resulting in inefficient fault handling. SUMMARY
[0006] The application provides a control method of a PLC controller network with redundant CPUs to solve the problems mentioned in the background art:
[0007] The application provides a control method of a PLC controller network with redundant CPUs, which comprises:
[0008] S1, setting a master CPU and N slave CPUs in the PLC controller network, N≥2, the master CPU and the slave CPUs are connected through a handshake line; and detecting the working state of each CPU in real time through a state monitoring module;
[0009] S2, based on the control logic program of the master CPU and the slave CPU, when the state monitoring mechanism detects that the master CPU fails, then the control right is taken over by the slave CPU;
[0010] S3, a PLC cloud gateway is arranged between the PLC controller network and the cloud server, and the cloud server is configured, the cloud server is used for receiving, storing and processing data uploaded on the PLC controller network, and sending control instructions;
[0011] S4, the state of the PLC controller network is monitored in real time through the cloud server, and the cloud server diagnoses the fault of the PLC controller network according to the received data, and sends control instructions to remotely control and debug the PLC controller network if a fault is found.
[0012] Further, the S1 comprises:
[0013] S11, deploying a master CPU in the PLC controller network, and determining the number N of slave CPUs according to system requirements and reliability requirements, and configuring N slave CPUs in the network;
[0014] S12, allocating a unique identifier and takeover priority to each slave CPU, and connecting the master CPU and the slave CPU through a handshake line;
[0015] S13, resource configuration is performed on the master CPU and the slave CPU; the working state of each CPU is detected in real time through the state monitoring module of each CPU, and fault judgment is performed based on the built-in fault judgment model through the machine learning algorithm.
[0016] Further, the S12 comprises:
[0017] S121, according to the number of slave CPUs in the PLC network, a unique identifier generated based on an encryption algorithm is allocated to each slave CPU,
[0018] S122, based on the decision algorithm of artificial intelligence, the performance indicators, historical reliability data and network topology structure of the slave CPU are calculated to dynamically calculate the takeover priority of each slave CPU;
[0019] S123, through the priority adjustment mechanism, the takeover priority of the slave CPU is dynamically adjusted according to the real-time running state and performance data of the slave CPU;
[0020] S124, handshake line selection is performed, and redundant design is adopted, a plurality of parallel handshake lines are arranged, the master CPU and the slave CPU are connected through the handshake lines, and the state information between the master CPU and the slave CPU is synchronized through the state synchronization mechanism.
[0021] Further, the S13 comprises:
[0022] S131, based on the overall architecture and functional requirements of the PLC controller network, resource configuration is performed, including shared input / output modules and configuration of shared memory, and an independent state monitoring module is set for each CPU;
[0023] S132, the running state of the CPU is detected in real time by the state monitoring module, the machine learning algorithm is integrated in the state monitoring module, and the collected state data is processed and analyzed by using the built-in fault judgment model;
[0024] S133, according to the real-time state and workload of each CPU, the shared resource is allocated, when the state monitoring module detects that the CPU has potential faults or abnormal conditions, a warning signal is sent in time, and an emergency response mechanism is triggered.
[0025] Further, the S2 comprises:
[0026] S21, when the state monitoring module detects the main CPU failure, the state monitoring module immediately sends an alarm, and starts the takeover process of the slave CPU through the preset fault handling program;
[0027] S22, according to the preset takeover priority, the slave CPU tries to take over the control right in priority order, and the slave CPU with the highest priority tries to take over first;
[0028] S23, if the slave CPU with the highest priority succeeds in taking over, the task of the main CPU is immediately taken over, and the control logic and operation task are continued to be executed;
[0029] S24, if the slave CPU with the highest priority fails to take over, the next slave CPU with the next priority is immediately tried, and so on, until any slave CPU succeeds in taking over;
[0030] S25, after the slave CPU takes over the control right, the system state is updated.
[0031] Further, the S3 comprises:
[0032] S31, a PLC cloud gateway device is selected, and the PLC cloud gateway device is deployed on the communication link between the PLC controller network and the cloud server, and the network parameters and communication protocols of the PLC cloud gateway are configured;
[0033] S32, the PLC cloud gateway device receives the data collected by the PLC controller from the PLC controller network, and performs preprocessing and packaging, and transmits the processed and packaged data to the cloud server through the Internet;
[0034] S33, the cloud server receives the data processed and packaged through the PLC cloud gateway device and stores the data.
[0035] Further, the S32 comprises:
[0036] S321, the PLC cloud gateway device collects data from the PLC controller network in a time-based or event-triggered manner, and pre-processes the collected data.
[0037] S322, according to the data receiving requirements of the cloud server, the pre-processed data is converted into a unified format, the converted data is packaged, and metadata is added.
[0038] S323, the packaged data is encrypted by combining symmetric encryption and asymmetric encryption, the encrypted data is compressed by a compression algorithm, and the data is transmitted by a multi-channel transmission protocol.
[0039] S324, and dynamically adjust the transmission strategy according to the network condition, the transmission strategy includes using the breakpoint resume mechanism when the network is congested.
[0040] Further, the S33 comprises:
[0041] S331, the cloud server verifies the received data and decrypts and decompresses the data.
[0042] S332, according to the pre-defined data format and protocol, the received data is parsed, and the parsed data is further processed.
[0043] S333, a database is set up in the cloud server, the processed data is stored in different databases according to the data source, the data in different databases is sorted by time stamp, and an index is established.
[0044] S334, the data stored in the cloud server database is backed up regularly, a data recovery mechanism is designed, data is recovered when data loss or failure occurs, and the data stored in the cloud server database is protected by an encryption algorithm and an access control mechanism.
[0045] Further, the S4 comprises:
[0046] S41, the cloud server analyzes the received stored data in real time, and diagnoses the PLC controller network by a pre-set fault diagnosis model.
[0047] S42, if the fault diagnosis result shows that the PLC controller network has a fault, the cloud server generates corresponding control instructions according to the fault type and severity.
[0048] S43, send the control instruction to the PLC controller network through the PLC cloud gateway device, remotely control and debug the PLC controller network, repair the fault or adjust;
[0049] S44, during the remote control and debugging process, the cloud server continuously receives the state data of the PLC controller network, adjusts the control instruction according to the feedback result, and until the fault is repaired or the system returns to normal operation.
[0050] Further, the S44 comprises:
[0051] S441, the cloud server real-time monitors the state data stream of the PLC controller network, and analyzes and converts the received state data through a preset data analysis algorithm;
[0052] S442, the state data after analysis is subjected to noise filtering and outlier detection, and a time series analysis algorithm is used to predict the trend and identify the pattern of the state data;
[0053] S443, according to the preprocessed feedback data and fault diagnosis result, dynamically adjust the parameters and logic of the control instruction, and based on the adaptive control algorithm, automatically adjust the control instruction according to the change of real-time state data;
[0054] S444, using machine learning and optimization algorithm, optimizing the control instruction, through simulation or small-scale test, verifying the effectiveness and safety of the optimized control instruction;
[0055] S445, send the optimized control instruction to the PLC controller network, and according to the feedback result of the PLC controller network, judge whether the fault has been repaired or the system has returned to normal operation;
[0056] S446, if the fault has not been completely repaired or the system has not returned to normal, return to S441 step, continue to monitor the state data and adjust and optimize the control instruction again.
[0057] The application has the beneficial effects that: by setting the master CPU and the at least two slave CPUs and being equipped with the takeover priority, the control right can be quickly taken over by the slave CPUs in order of priority when the master CPU fails, the continuous operation of the control system is ensured, and the downtime and production loss are reduced; the master CPU and the slave CPUs share the input / output module and memory resources, the hardware is effectively utilized, and the cost is reduced; the state monitoring module monitors the working state of each CPU in real time, combines with the machine learning algorithm to perform fault prediction and judgment, and enhances the predictability and self-healing ability of the system; the two-way communication with the cloud server is realized through the deployment of the PLC cloud gateway, so that the data can be uploaded to the cloud in real time, and the control instructions from the cloud can be received; the cloud server not only stores and processes data, but also performs real-time monitoring and intelligent fault diagnosis, greatly improving the operation and maintenance efficiency and management level; the takeover priority is dynamically adjusted according to the real-time performance and state of the slave CPU, so that the optimal standby CPU can be quickly switched to in the case of failure, and the reaction speed and fault tolerance of the system are further improved; the encryption technology and breakpoint resume mechanism are adopted in the data transmission link, so that the safety and integrity of the data in the public network transmission process are ensured; the cloud server verifies, decrypts and stores the received data, and implements strict data protection measures, so that the safe storage and access of the data are ensured; the cloud server can accurately perform fault positioning and processing based on big data analysis and the preset fault diagnosis model, and then generate targeted control instructions to realize remote control and debugging. This intelligent management mode helps to timely discover and solve system problems, and improves the stability and efficiency of the overall system. BRIEF DESCRIPTION OF DRAWINGS
[0058] Figure 1 The method steps of the application are described. DETAILED DESCRIPTION
[0059] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the present application will be described in detail below in combination with the drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0060] In the following description, many specific details are set forth in order to provide a thorough understanding of the present application. The described embodiments are merely a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application.
[0062] One embodiment of the present application, as shown in Figure 1 A control method of a PLC controller network with redundant CPUs, the method comprising:
[0063] S1, setting a master CPU and N slave CPUs in the PLC controller network, and setting the takeover priority of the slave CPUs, N≥2, the master CPU and the slave CPUs are connected through a handshake line; the master CPU and the slave CPUs share input / output modules, memories and other resources, and detect the working state of each other in real time through a state monitoring module;
[0064] S2, based on the control logic program of the master CPU and the slave CPUs, when the state monitoring mechanism detects a master CPU failure, the control right is taken over by the slave CPU;
[0065] S3, setting a PLC cloud gateway between the PLC controller network and the cloud server, realizing data uploading and downloading, receiving and sending of remote control instructions; and configuring the cloud server, the cloud server is used for receiving, storing and processing the data uploaded by the PLC controller network, and sending control instructions;
[0066] S4, monitoring the state of the PLC controller network in real time through the cloud server, including the working state of the CPU, the data of the input / output module, etc.; the cloud server diagnoses the fault of the PLC controller network according to the received data, and sends control instructions to remotely control and debug the PLC controller network if a fault is found.
[0067] The working principle of the above technical solution is that the master CPU and the slave CPU are connected through a handshake line, forming a redundant CPU structure. The redundant CPU is set to quickly switch to the standby CPU when the master CPU fails, ensuring the continuity and stability of the system. When setting the slave CPU, the reasonableness of its takeover priority needs to be ensured to smoothly take over the control right when the master CPU fails; each CPU is equipped with a state monitoring module for real-time detection of the working state of the CPU. These state monitoring modules can monitor the running state, temperature, voltage and other parameters of the CPU, as well as the state of the input and output modules. When the master CPU fails, the state monitoring mechanism will trigger the action of the standby CPU taking over the control right; the PLC cloud gateway is a bridge connecting the PLC controller network and the cloud server. It is responsible for uploading data in the PLC controller network to the cloud server and receiving control instructions from the cloud server. Through the PLC cloud gateway, remote monitoring, data storage and remote control functions can be realized, thereby improving the intelligence and manageability of the system; the cloud server can timely discover abnormal conditions of the system by monitoring the state of the PLC controller network in real time. After the cloud server receives the data uploaded by the PLC controller network, it will perform fault diagnosis and generate corresponding alarm information. If a system failure is found, the cloud server can send control instructions to the PLC controller network for remote control and debugging to restore the normal operation of the system as soon as possible.
[0068] The effect of the above technical solution is that by setting the master CPU and multiple slave CPUs and establishing redundant connections between them, the system has high reliability. When the master CPU fails, the slave CPU can quickly take over the control right, ensuring the continuity and stability of the system; each CPU is equipped with a state monitoring module that can detect its own working state in real time, including the running state, temperature, voltage and other parameters of the CPU, as well as the state of the input and output modules. The cloud server can timely discover and handle abnormal conditions of the system by monitoring the state of the PLC controller network in real time and performing fault diagnosis on the uploaded data; through the PLC cloud gateway, the connection between the PLC controller network and the cloud server is realized, enabling data upload and download, remote control instruction reception and sending. The cloud server can monitor the state of the PLC controller network in real time and send control instructions for remote control and debugging as needed, improving the intelligence and manageability of the system; through remote monitoring and control functions, system failures can be discovered and handled in a timely manner, reducing production downtime and improving production efficiency. At the same time, the cloud server stores and analyzes the data of the PLC controller network, providing data support for equipment maintenance and optimization, reducing maintenance and labor costs.
[0069] In one embodiment of the present application, the S1 comprises:
[0070] S11, deploy a master CPU in a PLC controller network as a core processor of the control system, responsible for executing main control logic and operation tasks; and determine the number N of slave CPUs according to system requirements and reliability requirements, and configure N slave CPUs in the network; as backup and auxiliary processors of the master CPU.
[0071] S12, assign a unique identifier and takeover priority to each slave CPU, the priority being determined according to the performance, reliability and location of the slave CPU and other factors to ensure that the most suitable slave CPU can be selected for takeover in priority order when the master CPU fails; connect the master CPU and the slave CPU through a handshake line; realize data communication and state synchronization. The handshake line is designed redundantly to ensure the reliability and stability of communication.
[0072] S13, resource configuration for the master CPU and the slave CPU; the resource configuration includes shared input / output modules, memory, and setting independent and interrelated state monitoring modules for each CPU; the state monitoring module of each CPU detects its own working state in real time, including the running state, temperature, power consumption, etc., and judges the fault based on the built-in fault judgment model through the machine learning algorithm.
[0073] The working principle of the above technical solution is that the master CPU is the core processor of the control system, which executes the main control logic and operation tasks; the number N of slave CPUs is determined according to the system requirements and reliability requirements, and N slave CPUs are configured in the network as backup and auxiliary processors of the master CPU. Each slave CPU is assigned a unique identifier and a takeover priority, which is determined according to performance, reliability and location and other factors. The handshake line connects the master CPU and the slave CPU, realizing data communication and state synchronization. Redundant design is adopted to ensure the reliability and stability of communication. Shared input / output modules, memory, and independent and interrelated state monitoring modules are configured for each CPU. The state monitoring module of each CPU detects the working state in real time, including the running state, temperature, power consumption, etc. Through the built-in fault judgment model, the machine learning algorithm is used for fault judgment to discover system abnormalities in time and take corresponding measures.
[0074] The technical scheme has the effects that: by deploying the master CPU and multiple slave CPUs, and allocating unique identifiers and takeover priorities, the system can quickly select a suitable slave CPU to take over when the master CPU fails, thereby ensuring the continuous operation of the system; the redundant design of the handshake line and the real-time detection of the state monitoring module improve the stability and reliability of the system, reducing the possibility of system failure. Resource allocation is performed on the master CPU and slave CPUs, including shared input / output modules, memories, etc., to ensure rational use of system resources and performance optimization. The independent and interconnected state monitoring modules can monitor the working state of each CPU in real time, including running state, temperature, power consumption, etc., so as to discover and solve potential problems in time, ensuring the normal operation of the system. Through the machine learning algorithm based on the built-in fault judgment model, intelligent judgment of CPU faults is realized, improving the accuracy and efficiency of fault diagnosis. Timely discovery and handling of CPU faults ensure the stability and reliability of the system, reducing production interruptions and losses.
[0075] In one embodiment of the present application, the S12 comprises:
[0076] S121, according to the number of slave CPUs in the PLC network, allocating a unique identifier generated based on an encryption algorithm to each slave CPU, such as a serial number or MAC address,
[0077] S122, based on an artificial intelligence decision algorithm, calculating the dynamic takeover priority of each slave CPU by its performance indicators (such as processing speed, memory capacity, etc.), historical reliability data (such as fault history, maintenance records, etc.), and network topology structure.
[0078] S123, through a priority adjustment mechanism, dynamically adjusting the takeover priority of the slave CPU according to its real-time running state and performance data; for example, when the load of a certain slave CPU is low or its performance is good, its takeover priority can be temporarily raised; conversely, when a certain slave CPU fails or its performance decreases, its takeover priority should be lowered.
[0079] S124, selecting a handshake line and adopting a redundant design, setting multiple parallel handshake lines, connecting the master CPU and the slave CPUs through the handshake lines, and synchronizing the state information between the master CPU and the slave CPUs through a state synchronization mechanism.
[0080] The working principle of the above technical solution is as follows: first, according to the number of slave CPUs in the PLC network, a unique identifier generated based on an encryption algorithm, such as a serial number or a MAC address, is assigned to each slave CPU. This ensures that each slave CPU has a unique identity. Based on the artificial intelligence-based decision algorithm, the system combines the performance indicators of the slave CPUs (such as processing speed, memory capacity, etc.), historical reliability data (such as fault history, maintenance records, etc.), and network topology structure, etc. to dynamically calculate the takeover priority of each slave CPU. This can ensure that the system can select the most suitable slave CPU for takeover when the master CPU fails. The system dynamically adjusts the takeover priority of the slave CPU through the priority adjustment mechanism according to its real-time running state and performance data. For example, when the load of a certain slave CPU is low or its performance is good, the system can temporarily increase its takeover priority to maximize system resource utilization. Conversely, when a certain slave CPU fails or its performance decreases, the system should reduce its takeover priority to ensure system stability. The system performs handshake line selection and adopts a redundant design, setting multiple parallel handshake lines. These handshake lines are used to connect the master CPU and the slave CPU, ensuring the reliability and stability of communication. Through the state synchronization mechanism, the system can synchronize the state information between the master CPU and the slave CPU, ensuring the consistency and correctness of the system.
[0081] The effect of the above technical solution is as follows: through the artificial intelligence-based decision algorithm, the system can dynamically calculate the takeover priority of each slave CPU according to multiple factors, thereby realizing intelligent management of the PLC network. This enables the system to more effectively allocate resources and improve overall performance; the use of unique identifiers and redundant design ensures that each slave CPU has a unique identity, and multiple parallel handshake lines are set up for connection, thereby improving the reliability and stability of communication. Even if a certain slave CPU fails, the system can quickly switch to other available slave CPUs, ensuring normal operation of the system; through the priority adjustment mechanism, the system can dynamically adjust the takeover priority of the slave CPU according to its real-time running state and performance data. This enables the system to make timely adjustments according to actual conditions, ensuring the stability and efficiency of the system; through the state synchronization mechanism, the system can ensure that the state information between the master CPU and the slave CPU is synchronized, thereby ensuring the consistency and correctness of the system. This helps to avoid errors or data loss caused by inconsistent states; when a certain slave CPU fails, the system can quickly switch to other available slave CPUs, realizing rapid recovery from failure, minimizing production downtime, and improving the availability and stability of the production line.
[0082] In one embodiment of the present application, the S13 includes:
[0083] S131, based on the overall architecture and functional requirements of the PLC controller network, resource configuration is performed, including shared input / output modules and configuration of shared memory, and an independent state monitoring module is set for each CPU (including master CPU and slave CPU); these modules have the ability of data acquisition, processing and analysis, and can monitor the working state of the CPU in real time.
[0084] S132, the running state of the CPU is detected in real time by the state monitoring module, including running speed, memory occupancy, task execution, etc. At the same time, the monitoring module should also collect physical parameters such as temperature and power consumption of the CPU to comprehensively evaluate the health status and performance of the CPU; machine learning algorithms are integrated in the state monitoring module to process and analyze the collected state data using the built-in fault judgment model;
[0085] S133, according to the real-time state and workload of each CPU, shared resource allocation is performed, for example, when the load of a certain CPU is high, the allocation of shared input / output modules can be dynamically adjusted, or the memory access strategy can be optimized to improve the overall performance of the system; when the state monitoring module detects potential faults or abnormal conditions of the CPU, it will send out an early warning signal in time and trigger the emergency response mechanism.
[0086] The working principle of the above technical solution is as follows: first, for the entire PLC controller network, resource configuration is performed, including the setting of shared input / output modules and shared memory. Each CPU is configured with an independent state monitoring module, which has the ability of data acquisition, processing and analysis; the state monitoring module detects the running state of the CPU in real time, including running speed, memory occupancy, task execution, etc. At the same time, it also collects physical parameters such as temperature and power consumption of the CPU to comprehensively evaluate the health status and performance of the CPU. These data are sent to the built-in machine learning algorithm for processing and analysis; according to the real-time state and workload of each CPU, the system performs shared resource allocation. For example, when the load of a certain CPU is high, the system can dynamically adjust the allocation of shared input / output modules, or optimize the memory access strategy to improve the overall performance of the system; when the state monitoring module detects potential faults or abnormal conditions of the CPU, it will send out an early warning signal in time and trigger the emergency response mechanism. This can include automatically switching to a backup CPU, or notifying maintenance personnel for repair and repair.
[0087] The technical effects of the above technical solution are: the state monitoring module can detect various indicators of the CPU in real time, including running state, temperature, power consumption, etc., so that potential problems can be found and regulated in a timely manner to ensure stable system operation; according to the real-time state and workload of each CPU, shared resource allocation can be performed to optimize the resource utilization efficiency of the system and improve overall performance and response speed; the monitoring module can send early warning signals in a timely manner, and when potential faults or abnormal conditions are detected in the CPU, an emergency response mechanism can be triggered to prevent further expansion of the fault and ensure the stability and reliability of the system; by dynamically adjusting resource allocation, the system can better adapt to the needs under different workloads, thereby improving production efficiency, reducing the risk of production interruption, and reducing maintenance costs; the state monitoring module integrated with machine learning algorithms can intelligently analyze data to provide more accurate fault judgment and optimization suggestions, providing more reference for system management.
[0088] In one embodiment of the present application, the S2 comprises:
[0089] S21, when the state monitoring module detects a main CPU failure, the state monitoring module immediately sends an alarm and starts the takeover process of the slave CPU through the preset fault handling program;
[0090] S22, according to the preset takeover priority, the slave CPU tries to take over the control right in priority order, and the slave CPU with the highest priority tries to take over first;
[0091] S23, if the slave CPU with the highest priority successfully takes over, it immediately takes over the task of the main CPU and continues to execute the control logic and operation task;
[0092] S24, if the slave CPU with the highest priority fails to take over, the next slave CPU with the next priority is immediately tried, and so on, until any slave CPU successfully takes over;
[0093] S25, after the slave CPU takes over the control right, the system state is updated to ensure that all modules in the system can recognize the new main CPU and perform normal data exchange and communication with it.
[0094] The working principle of the technical solution is as follows: the state monitoring module monitors the state of the main CPU in real time, and immediately sends out an alarm signal once a main CPU failure is detected; the slave CPU takeover process is started: according to a preset failure handling program, the state monitoring module starts the takeover process of the slave CPU to ensure the continuity and stability of the system. According to the preset takeover priority, the slave CPU attempts to take over the control right in priority order, and the slave CPU with the highest priority attempts to take over first. If the slave CPU with the highest priority succeeds in taking over, the task of the main CPU is immediately taken over, and the control logic and operation task are continued to be executed; if the takeover fails, the slave CPU with the next priority is immediately attempted to take over, and so on, until any slave CPU succeeds in taking over; once the slave CPU succeeds in taking over the control right, the system is updated, and all modules can identify the new main CPU and perform normal data exchange and communication with the new main CPU to maintain the normal operation of the system.
[0095] The effects of the technical solution are as follows: through real-time monitoring of the state of the main CPU by the state monitoring module, the main CPU failure can be found and reported in time, which helps to quickly respond to and handle the failure, and reduces the system downtime; the preset failure handling program can automatically start the takeover process of the slave CPU without human intervention, which improves the automation degree of the system and reduces the possibility of human error; according to the preset takeover priority, the system can orderly attempt the slave CPU to take over the control right, and the slave CPU with the highest priority attempts to take over first, which ensures the priority execution of important tasks of the system; once the slave CPU succeeds in taking over the control right, the system can continue to execute the control logic and operation task, which ensures the continuity and stability of the system and avoids system interruption or data loss caused by the main CPU failure; through the rapid takeover process of the slave CPU, the system can quickly recover to the normal working state, which maximizes the reduction of the influence of system failure on production and operation, and improves the reliability and availability of the system; after the slave CPU takes over the control right, the system is updated, and all modules can identify the new main CPU and perform normal data exchange and communication with the new main CPU, which ensures the coordinated operation of all components of the system.
[0096] In an embodiment of the present application, the S3 comprises:
[0097] S31, a PLC cloud gateway device is selected and deployed on a communication link between a PLC controller network and a cloud server, and the network parameters and communication protocols of the PLC cloud gateway are configured;
[0098] S32, the PLC cloud gateway device receives data collected by the PLC controller from the PLC controller network, and performs preprocessing and packaging, and transmits the processed and packaged data to the cloud server through the Internet;
[0099] S33, the cloud server receives the processed and packaged data transmitted by the PLC cloud gateway device and stores it.
[0100] The working principle of the above technical solution is as follows: first, select a suitable PLC cloud gateway device in the system and deploy it on the communication link between the PLC controller network and the cloud server. Then, configure the network parameters and communication protocols of the PLC cloud gateway device to ensure that the device can correctly communicate with the PLC controller network and the cloud server. The PLC controllers in the PLC controller network are responsible for collecting real-time data such as sensor data, device status, etc. The PLC cloud gateway device receives data transmitted from the PLC controller network and performs preprocessing and packaging. Preprocessing includes data cleaning, format conversion, etc. to ensure the accuracy and availability of the data. Then, the processed and packaged data is transmitted to the cloud server through the Internet. The cloud server receives the processed and packaged data transmitted by the PLC cloud gateway device and stores it. The stored data can be used for subsequent analysis, monitoring, report generation, etc. to realize real-time monitoring and remote management of the system running state.
[0101] The effect of the above technical solution is as follows: through the deployment of the PLC cloud gateway device, users can monitor the data in the PLC controller network in real time and remotely manage the system running state. This allows users to monitor and control the system through the cloud server at any time and anywhere, improving the operability and real-time performance of the system; the PLC cloud gateway device performs preprocessing and packaging on the data collected by the PLC controller to ensure the accuracy and reliability of the data. This can reduce the data processing pressure of the cloud server, improve the data transmission efficiency and the stability of the system; by configuring the network parameters and communication protocols of the PLC cloud gateway device, stable communication between the device and the PLC controller network and the cloud server can be ensured. This helps to reduce communication failures and data loss, improving the reliability and stability of the system; the cloud server receives and stores the data transmitted by the PLC cloud gateway device, providing a basis for subsequent data analysis, report generation, etc. By analyzing the stored data, users can find problems and optimization space in the system running, thereby improving the efficiency and reliability of the system; the entire technical solution realizes intelligent management and remote control functions of the system, allowing users to more conveniently monitor and manage the system running state. This helps to improve production efficiency, reduce costs, and better adapt to the development trend of industrial automation.
[0102] In one embodiment of the present application, the S32 comprises:
[0103] S321, the PLC cloud gateway device collects data from the PLC controller network in a time-based or event-triggered manner; the collected data is preprocessed, including filtering and cleaning, and removing noise and invalid data;
[0104] S322, according to the data receiving requirements of the cloud server, the preprocessed data is converted into a unified format such as JSON or XML; the converted data is encapsulated and metadata such as data source and timestamp is added;
[0105] S323, the encapsulated data is encrypted by combining symmetric encryption and asymmetric encryption, and the encrypted data is compressed by compression algorithm, and the data is transmitted through multi-channel transmission protocol;
[0106] S324, and dynamically adjust the transmission strategy according to the network condition, the transmission strategy includes using the breakpoint resume mechanism when the network is congested.
[0107] The working principle of the above technical scheme is: the PLC cloud gateway device collects data from the PLC controller network according to the preset time interval or based on the triggering condition of the specific event; the collected data is preprocessed, including filtering, cleaning, denoising and removing invalid data; according to the data receiving requirements of the cloud server, the preprocessed data is converted into a unified format such as JSON or XML, and metadata such as data source and timestamp is added for subsequent data processing and analysis; the converted data is encrypted by combining symmetric encryption and asymmetric encryption to ensure the security of the data during transmission. At the same time, the encrypted data is compressed by compression algorithm to reduce the bandwidth occupation and transmission time of data transmission; the encrypted and compressed data is transmitted through multi-channel transmission protocol to ensure the fast and stable transmission of data to the cloud server. At the same time, the transmission strategy is dynamically adjusted according to the network condition, including using the breakpoint resume mechanism when the network is congested, to ensure the reliability and stability of data transmission.
[0108] The effect of the above technical scheme is that: by preprocessing the collected data, including filtering, cleaning, denoising and removing invalid data, etc., the quality of the data can be improved, errors and noise can be reduced, and the accuracy of subsequent processing can be ensured; symmetric encryption and asymmetric encryption are combined to encrypt the data, ensuring the security of the data during transmission. This effectively prevents data from being stolen or tampered with by unauthorized access; the compressed algorithm is used to compress the encrypted data, reducing the bandwidth occupation and transmission time of data transmission, improving the efficiency and speed of data transmission; a multi-channel transmission protocol is used to transmit the data, and the transmission strategy is dynamically adjusted according to the network status, including using the breakpoint resume mechanism when the network is congested, enhancing the stability and reliability of data transmission, and ensuring that the data can be timely and completely transmitted to the cloud server; according to the data receiving requirements of the cloud server, the preprocessed data is converted into a unified format and metadata is added, enhancing the compatibility with the cloud server, so that the data can be smoothly received and processed by the cloud system.
[0109] In one embodiment of the present application, the S33 comprises:
[0110] S331, the cloud server verifies the received data to ensure the integrity and authenticity of the data, prevents malicious attacks or data tampering, and performs decryption and decompression;
[0111] S332, according to the pre-defined data format and protocol, the received data is parsed, and the parsed data is further processed; the further processing includes data cleaning, aggregation and conversion;
[0112] S333, a database is set up in the cloud server, the processed data is stored in different databases according to the data source, and the data in different databases is sorted by time stamp and indexed;
[0113] S334, the data stored in the cloud server database is backed up regularly, and a data recovery mechanism is designed to recover the data when data loss or failure occurs; and the data stored in the cloud server database is protected by encryption algorithm and access control mechanism.
[0114] The working principle of the above technical solution is that: the cloud server first verifies the received data to ensure the integrity and authenticity of the data to prevent malicious attacks or data tampering. Then the data is decrypted and decompressed to restore the original data format for subsequent processing. According to the predefined data format and protocol, the received data is parsed and converted into a readable format. Then the parsed data is further processed, including data cleaning, aggregation and conversion, to ensure data quality and consistency. A database is set up in the cloud server to store the processed data according to the data source in different databases. The data in different databases is sorted by timestamp and indexed to facilitate fast retrieval and query of data. Regularly backup the data stored in the cloud server database to ensure data security and reliability. Design a data recovery mechanism to recover data in time when data loss or failure occurs to ensure data is not lost. Protect the data stored in the cloud server database through encryption algorithms and access control mechanisms to ensure data confidentiality and privacy.
[0115] The effect of the above technical solution is that: by verifying, decrypting and decompressing the received data, the integrity and authenticity of the data during transmission can be ensured, effectively preventing malicious attacks or data tampering. Further processing of parsed data, including data cleaning, aggregation and conversion, can improve data quality and consistency, making data easier to analyze and utilize. Storing processed data according to source in different databases and sorting and indexing data by timestamp can improve data retrieval efficiency and management efficiency, speeding up data processing and analysis. Regularly backing up data and designing a data recovery mechanism can ensure data security and reliability, avoiding information loss and business interruption due to data loss or failure. Protect the data stored in the cloud server database through encryption algorithms and access control mechanisms to ensure data confidentiality and privacy, preventing unauthorized access and operation.
[0116] In one embodiment of the present application, the S4 comprises:
[0117] S41, the cloud server analyzes the received stored data in real time, and diagnoses the PLC controller network through a preset fault diagnosis model;
[0118] S42, if the fault diagnosis result shows that the PLC controller network has a fault, the cloud server generates corresponding control instructions according to the fault type and severity;
[0119] S43, the control instructions are sent to the PLC controller network through the PLC cloud gateway device to remotely control and debug the PLC controller network, and the fault is repaired or adjusted.
[0120] S44, in the remote control and debugging process, the cloud server continuously receives the state data of the PLC controller network, adjusts the control instruction according to the feedback result until the fault is repaired or the system resumes normal operation.
[0121] The working principle of the above technical solution is that the cloud server analyzes the received storage data in real time, and uses a preset fault diagnosis model to diagnose the fault of the PLC controller network. This includes monitoring sensor data, controller status, etc., and applying machine learning or rule engine methods for fault detection and diagnosis; if the fault diagnosis result shows that the PLC controller network has a fault, the cloud server will generate corresponding control instructions according to the fault type and severity. These instructions may include restarting the device, adjusting the parameters, switching to the standby device, etc.; through the PLC cloud gateway device, the cloud server sends the generated control instructions to the PLC controller network, realizing remote control and debugging of the PLC controller in the network. This can be achieved through remote communication protocols such as Modbus, OPC UA, etc.; in the remote control and debugging process, the cloud server continuously receives the state data of the PLC controller network, and adjusts the control instruction according to the feedback result. This can realize dynamic adjustment of the control strategy until the fault is repaired or the system resumes normal operation.
[0122] The effect of the above technical solution is that by analyzing the stored data and the preset fault diagnosis model in real time, the fault in the PLC controller network can be found in time, improving the accuracy and efficiency of fault detection; once a fault is found, the cloud server can quickly generate corresponding control instructions and send them to the PLC controller network through the PLC cloud gateway device, realizing remote control and debugging. This can quickly respond to faults and make repairs or adjustments, reducing the time cost of fault handling; through remote control and debugging, manual on-site troubleshooting and repair can be avoided, thereby reducing downtime and improving device availability and production efficiency; in the remote control and debugging process, the cloud server continuously receives the state data of the PLC controller network and adjusts the control instruction according to the feedback result. This can realize continuous optimization and improvement, improving the stability and performance of the system.
[0123] An embodiment of the present application, the S44, comprises:
[0124] S441, the cloud server listens to the state data stream of the PLC controller network in real time, and through a preset data analysis algorithm, the received state data is analyzed and converted;
[0125] S442, the state data after analysis is subjected to noise filtering and outlier detection, and a time series analysis algorithm is used to predict trends and identify patterns in the state data;
[0126] S443、According to the pre-processed feedback data and fault diagnosis results, dynamically adjust the parameters and logic of the control instructions, based on the adaptive control algorithm, automatically adjust the control instructions according to the changes of real-time state data;
[0127] S444, using machine learning and optimization algorithm, optimizing the control instructions, through simulation or small-scale test, verifying the effectiveness and safety of the optimized control instructions;
[0128] S445, send the optimized control instructions to the PLC controller network, according to the feedback results of the PLC controller network, judge whether the fault has been repaired or the system has returned to normal operation;
[0129] S446, if the fault has not been completely repaired or the system has not returned to normal, return to step S441, continue to monitor the state data and adjust and optimize the control instructions again.
[0130] The working principle of the above technical solution is as follows: first, the cloud server real-time monitors the state data stream of the PLC controller network. This means that the server continuously receives real-time state data from the PLC controller network, which reflects the current running status of the PLC controller network. In order to transform these raw data into meaningful information, the cloud server uses a preset data analysis algorithm to parse and convert the received state data into a format that can be used for subsequent analysis and processing. Next, the cloud server further processes the parsed state data. This includes noise filtering and outlier detection to eliminate interference and errors in the data. At the same time, using time series analysis algorithms, the server performs trend prediction and pattern recognition on the state data. This helps to discover potential problems or fault patterns, providing a basis for subsequent fault repair or adjustment. Then, the cloud server dynamically adjusts the parameters and logic of the control instructions according to the pre-processed feedback data and fault diagnosis results. This means that the server will automatically adjust the control instructions according to the changes in real-time state data to adapt to the current needs and conditions of the PLC controller network. This adaptive control algorithm can improve the accuracy and response speed of control, enabling the PLC controller network to better cope with various complex situations. Next, the cloud server further optimizes the control instructions using machine learning and optimization algorithms. Through simulation or small-scale testing, the server verifies the effectiveness and safety of the optimized control instructions. This helps to ensure the reliability and stability of the control instructions in actual application. Finally, the cloud server sends the optimized control instructions to the PLC controller network. According to the feedback results of the PLC controller network, the server judges whether the fault has been repaired or the system has returned to normal operation. If the fault has not been completely repaired or the system has not returned to normal operation, the server will return to step S441 and continue to monitor the state data and adjust and optimize the control instructions again. This loop process will continue until the fault is completely repaired or the system returns to normal operation.
[0131] The effects of the above technical solutions are: through real-time monitoring of the state data stream of the PLC controller network by the cloud server, and using the preset data analysis algorithm for analysis and conversion, the technical solution can ensure the real-time and accuracy of the data. This makes the system able to quickly respond to the state changes of the PLC controller network, and make accurate decisions and adjustments based on the latest data. Through noise filtering and outlier detection, the technical solution can filter out noise and errors in the state data, improving the reliability and effectiveness of the data. At the same time, the use of time series analysis algorithm can further reveal the trend and pattern of the data, which helps to discover potential problems and fault patterns. According to the preprocessed feedback data and fault diagnosis results, the parameters and logic of the control instructions can be dynamically adjusted. The application of this adaptive control algorithm enables the system to automatically adjust the control strategy according to the changes of real-time state data, improving the intelligence and flexibility of control. Using machine learning and optimization algorithms to optimize the control instructions, and verifying through simulation or small-scale testing, can ensure the effectiveness and safety of the control instructions. This helps to avoid problems and failures that may occur in actual application, improving the stability and reliability of the system. If the fault is not completely repaired or the system is still not normal, the technical solution will automatically return to monitoring the state data and adjust and optimize the control instructions again. This iterative mechanism ensures that the system can continuously monitor and adjust the PLC controller network until the fault is completely repaired or the system returns to normal operation.
[0132] Obviously, those skilled in the art can make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application also intends to include these modifications and variations.
Claims
1. A control method of a PLC controller network having redundant CPUs, characterized by, The method comprises: S1, setting a master CPU and N slave CPUs in a PLC controller network, wherein N≥2, the master CPU and the slave CPUs are connected through a handshake line, and the working state of each CPU is detected in real time through a state monitoring module; S2, based on the control logic program of the master CPU and the slave CPUs, when the master CPU failure is monitored by the state monitoring mechanism, the control right is taken over by the slave CPUs; S3, setting a PLC cloud gateway between the PLC controller network and a cloud server, and configuring the cloud server, wherein the cloud server is used for receiving, storing and processing data uploaded by the PLC controller network, and sending control instructions; S4, monitoring the state of the PLC controller network in real time through the cloud server, and diagnosing the fault of the PLC controller network according to the received data, and if a fault is found, sending a control instruction to remotely control and debug the PLC controller network; The S4 comprises: S41, the cloud server analyzes the received and stored data in real time, and diagnoses the fault of the PLC controller network through a preset fault diagnosis model; S42, if the fault diagnosis result shows that the PLC controller network has a fault, the cloud server generates a corresponding control instruction according to the fault type and severity; S43, sending the control instruction to the PLC controller network through the PLC cloud gateway device to remotely control and debug the PLC controller network, and repairing the fault or adjusting; S44, during the remote control and debugging process, the cloud server continuously receives the state data of the PLC controller network, adjusts the control instruction according to the feedback result, and stops until the fault is repaired or the system returns to normal operation; The S44 comprises: S441, the cloud server listens to the state data stream of the PLC controller network in real time, and analyzes and converts the received state data through a preset data analysis algorithm; S442, noise filtering and outlier detection are performed on the analyzed state data, and a time series analysis algorithm is used to perform trend prediction and pattern recognition on the state data; S443, according to the preprocessed feedback data and fault diagnosis result, dynamically adjusting the parameters and logic of the control instruction, and based on an adaptive control algorithm, automatically adjusting the control instruction according to the change of real-time state data; S444, using machine learning and optimization algorithms to optimize the control instruction, and verifying the effectiveness and safety of the optimized control instruction through simulation or small-scale testing; S445, sending the optimized control instruction to the PLC controller network, and judging whether the fault has been repaired or the system has returned to normal operation according to the feedback result of the PLC controller network; S446, if the fault has not been completely repaired or the system has not returned to normal, returning to step S441 to continue listening to the state data and adjusting and optimizing the control instruction again.
2. The control method of the PLC controller network with redundant CPUs according to claim 1, characterized in that, The S1 comprises: S11, deploying a master CPU in the PLC controller network, and determining the number N of slave CPUs according to system requirements and reliability requirements, and configuring N slave CPUs in the network; S12, assign a unique identifier and takeover priority to each slave CPU, connect the master CPU and the slave CPU through a handshake line; S13, configure resources for the master CPU and the slave CPU; real-time detection of the working state of each CPU through the state monitoring module, and fault judgment based on the built-in fault judgment model through the machine learning algorithm.
3. The control method of the PLC controller network with redundant CPUs according to claim 2, characterized in that, S12 includes: S121, according to the number of slave CPUs in the PLC network, assign a unique identifier generated based on the encryption algorithm to each slave CPU, S122, based on the decision algorithm of artificial intelligence, calculate the dynamic takeover priority of each slave CPU through the performance indicators, historical reliability data and network topology structure of the slave CPU; S123, through the priority adjustment mechanism, dynamically adjust the takeover priority of the slave CPU according to its real-time running state and performance data; S124, select the handshake line, and adopt the redundancy design to set multiple parallel handshake lines, connect the master CPU and the slave CPU through the handshake line, and synchronize the state information between the master CPU and the slave CPU through the state synchronization mechanism.
4. The control method of the PLC controller network having the redundant CPU according to claim 2, wherein S13 includes: S131, based on the overall architecture and functional requirements of the PLC controller network, configure resources, including shared input / output modules and shared memory, and set independent state monitoring modules for each CPU; S132, real-time detection of the running state of the CPU through the state monitoring module, the state monitoring module integrates machine learning algorithm, and uses built-in fault judgment model to process and analyze the collected state data; S133, according to the real-time state and working load of each CPU, allocate shared resources, when the state monitoring module detects that the CPU has potential fault or abnormal situation, send early warning signal in time, and trigger emergency response mechanism.
5. The control method of the PLC controller network having a redundant CPU according to claim 1, wherein, S2 includes: S21, when the state monitoring module detects that the master CPU fails, the state monitoring module immediately sends an alarm, and starts the takeover process of the slave CPU through the preset fault handling program; S22, according to the preset takeover priority, the slave CPU tries to take over the control right in priority order, and the slave CPU with the highest priority tries to take over first; S23, if the slave CPU with the highest priority succeeds in taking over, it immediately takes over the task of the master CPU and continues to execute the control logic and operation task; S24, if the slave CPU with the highest priority fails to take over, the next slave CPU with the next priority is immediately tried, and so on, until any slave CPU succeeds in taking over; S25, after the slave CPU takes over the control right, update the system state.
6. The control method of a PLC controller network having a redundant CPU according to claim 1, wherein, S3 includes: S31, select PLC cloud gateway device, and deploy the PLC cloud gateway device on the communication link between the PLC controller network and the cloud server, configure the network parameters and communication protocol of the PLC cloud gateway; S32, the PLC cloud gateway device receives the data collected by the PLC controller network, and performs preprocessing and packaging, and transmits the processed and packaged data to the cloud server through the Internet; S33, the cloud server receives the processed and packaged data transmitted by the PLC cloud gateway device, and stores it.
7. The control method of a PLC controller network having a redundant CPU according to claim 6, wherein, The S32 comprises: S321, the PLC cloud gateway device collects data from the PLC controller network in a time-based or event-triggered manner; the collected data is preprocessed; S322, according to the data receiving requirements of the cloud server, the preprocessed data is converted into a unified format, the converted data is packaged, and metadata is added; S323, the packaged data is encrypted by combining symmetric encryption and asymmetric encryption, the encrypted data is compressed by a compression algorithm, and the data is transmitted by a multi-channel transmission protocol; S324, and dynamically adjust the transmission strategy according to the network condition, the transmission strategy includes using the breakpoint resume mechanism when the network is congested.
8. The control method of a PLC controller network having a redundant CPU according to claim 6, wherein, The S33 comprises: S331, the cloud server verifies the received data, and performs decryption and decompression; S332, according to the pre-defined data format and protocol, the received data is parsed, and the parsed data is further processed; S333, a database is set up in the cloud server, the processed data is stored in different databases according to the data source, the data in different databases is sorted by time stamp, and an index is established; S334, the data stored in the cloud server database is backed up regularly, and a data recovery mechanism is designed, when data loss or failure occurs, the data is recovered; and the data stored in the cloud server database is protected by encryption algorithm and access control mechanism.
Citation Information
Patent Citations
Intelligent system for diagnosing programmable controller Ethernet communication failures
CN105162630A
Multi-controller calculation redundant cluster based on Loongson processor
CN107733684A
Equipment redundancy method and device, equipment and computer readable storage medium
CN117872709A
Method and system for realizing virtual IP protocol
CN1855916A
Redundant constant temperature and humidity control system of dust free chamber
CN207585010U