PLC controller and fault on-line diagnosis and repair method
By introducing redundant structures and adaptability enhancement learning algorithms into the PLC controller, the problem that traditional PLC controllers cannot be switched and repaired in time during failure is solved, online fault diagnosis and repair is realized, and system stability and maintenance are improved efficiency.
Patent Information
- Application Number
- CN202410979926.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-11-12
AI Technical Summary
Traditional PLC controllers lack redundancy and fault detection functions, which leads to the inability to switch and repair the system in time during failure, reducing maintenance efficiency and system stability and increasing maintenance costs.
Design a PLC controller, including the main controller module, the secondary controller module, the switch switch, the redundant link, the fault diagnosis module and the automatic repair module, and realize the system redundancy through the redundant link and the power module, and adopt the adaptation Sex enhancement learning algorithms for troubleshooting and automatic repair.
The online fault diagnosis and repair of PLC controller is realized, the system operation efficiency and maintenance efficiency are improved, manual maintenance costs and time costs are reduced, and the stable operation of the system is ensured.
Smart Images

Figure CN118938852A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of industrial control technology, and in particular to a PLC controller and a fault online diagnosis and repair method. Background Art
[0002] PLC (Programmable Logic Controller) has been widely used in modern industrial control processes. It is used in various production lines and assembly lines to achieve various automation control tasks. The reliability of the PLC control system is a prerequisite for ensuring the stable operation of the entire industrial production process. Traditional PLC controllers have the following deficiencies:
[0003] 1. Lack of redundancy: Generally, only a single module is used for monitoring and control. If there is a problem with this module, the entire system will be affected. If the backup module cannot be switched in time when the main module fails, the main module cannot be replaced or repaired in time, which will cause the entire control system to stop.
[0004] 2. Lack of fault detection function: There is no way to automatically identify faults, and manual inspection is required. If manual judgment and feedback are wrong, it will cause system operation errors. In addition, if a fault occurs, it often requires manual repair, making it difficult to achieve online maintenance.
[0005] The above problems determine that the existing PLC controllers cannot meet current production requirements in many application scenarios, significantly reducing the maintenance efficiency and system stability of the PLC, and greatly increasing maintenance costs. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide a PLC controller and a fault online diagnosis and repair method in view of the problems existing in the prior art.
[0007] To solve the above technical problems, an embodiment of the present invention provides a PLC controller, comprising: a main controller module, a sub-controller module, a switch, a redundant link, an input and output module, a fault diagnosis module, an automatic repair module and a power supply module;
[0008] The main controller module and the sub-controller module are connected to the input and output modules through a redundant link, and the switch is set on the redundant link; the two controller modules are connected to each other, and the two operate simultaneously and maintain the same operating state and data;
[0009] The fault diagnosis module is connected to the main controller module, the automatic repair module and the switch, and is used to identify the faulty component through a fault detection algorithm, generate a fault diagnosis result and perform backup switching through the switch;
[0010] The automatic repair module is connected to the main controller module and the auxiliary controller module, and is used to automatically repair the faulty component according to the fault diagnosis result of the fault diagnosis module;
[0011] The power supply module is connected with the main controller module, the sub-controller module, the switch, the redundant link and the input and output module to provide power supply for each module.
[0012] In order to solve the above technical problems, an embodiment of the present invention provides a method for online fault diagnosis and repair of a PLC controller, which is applied to the PLC controller provided by the above technical solution, and the method includes:
[0013] The main controller module and the sub-controller module run simultaneously and maintain the same operating status and data;
[0014] The fault diagnosis module identifies the faulty component through a fault detection algorithm, generates a fault diagnosis result and performs backup switching through the switching switch;
[0015] The automatic repair module automatically repairs the faulty component according to the fault diagnosis result of the fault diagnosis module.
[0016] The beneficial effects of the present invention are as follows: the main controller module and the sub-controller module serve as the main operation and backup operation units of the system, the two controller modules run simultaneously and always maintain the same operation status and data, thereby realizing system redundancy; when the main controller module fails, it can quickly switch to the sub-controller module to ensure stable operation of the system; and the fault diagnosis module can identify the faulty component through the fault detection algorithm, and the automatic repair module can automatically repair the faulty component according to the fault diagnosis results, thereby realizing online diagnosis and repair of PLC controller faults, greatly improving the operation efficiency and maintenance efficiency of the system, and reducing manual maintenance costs and time costs.
[0017] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description or learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A structural block diagram of a PLC controller is shown as an exemplary embodiment of the present application;
[0019] Figure 2 A partial structural diagram of a PLC controller shown as an exemplary embodiment of the present application;
[0020] Figure 3 The present invention is a flowchart of a method for online fault diagnosis and repair of a PLC controller, which is shown as an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0021] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.
[0022] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0023] Figure 1 FIG. 1 is a block diagram of a PLC controller structure shown in an exemplary embodiment of the present application. Figure 1 As shown, in an exemplary embodiment, the PLC controller includes: a main controller module, a sub-controller module, a switch, a redundant link, an input and output module, a fault diagnosis module, an automatic repair module and a power supply module.
[0024] The main controller module and the sub-controller module are connected to the input and output modules through a redundant link, and the switch is set on the redundant link; the two controller modules are connected to each other, and the two operate simultaneously and maintain the same operating state and data;
[0025] The fault diagnosis module is connected to the main controller module, the automatic repair module and the switch, and is used to identify the faulty component through a fault detection algorithm, generate a fault diagnosis result and perform backup switching through the switch;
[0026] The automatic repair module is connected to the main controller module and the auxiliary controller module, and is used to automatically repair the faulty component according to the fault diagnosis result of the fault diagnosis module;
[0027] The power supply module is connected with the main controller module, the sub-controller module, the switch, the redundant link and the input and output module to provide power supply for each module.
[0028] In the embodiment of the present invention, the main controller module and the sub-controller module serve as the main operation and backup operation units of the system. The two controller modules run simultaneously and always maintain the same operation status and data. This is the core part of the PLC system, which is mainly responsible for processing input / output data, executing programs and making decisions. Two completely independent and identical controller modules are designed in a fully redundant structure. When one module fails, the other module can immediately take over the system. The embodiment of the present invention realizes system redundancy. When the main controller module fails, it can quickly switch to the sub-controller module to ensure stable operation of the system.
[0029] The input and output module is connected to the main controller module and the auxiliary control module. It is responsible for receiving input signals from external devices and sending output signals to external devices. For example, the input and output module can be connected to the controlled object through an actuator. The input and output module receives signals from industrial process equipment and converts them into a format that the PLC can understand. In addition, the module also converts the PLC's instructions into signals that can be accepted by the process equipment. In a fully redundant structure, the input and output modules also have backups to ensure that when a problem occurs in the main module, the backup module can immediately replace its work.
[0030] The redundant link connects the input and output modules and the main and sub-controller modules, and serves as a transmission channel for input and output signals. When the main communication link (connected to the main controller module) fails, the backup communication link (connected to the sub-controller module) can be started immediately.
[0031] The switch, which is set on the redundant link, is also called a redundant switch or redundant selector. It is a very important component in the fully redundant PLC system. When the main controller module has a problem, this switch can immediately switch to the secondary controller module to ensure the continuous operation of the system and increase the reliability of the system.
[0032] The fault diagnosis module continuously monitors the operating status of the main controller module and the redundant link. This monitoring may be by checking the power supply status, the integrity of data communication and the compatibility of signals. After detecting a fault, the switch will immediately switch to the backup module to enable the system to continue to operate. After the switch is completed, the fault diagnosis module will send a switch confirmation signal to the system, at which time the backup module starts working and the faulty module is isolated.
[0033] The automatic repair module can automatically execute the repair program after diagnosing the fault. The automatic repair module mainly repairs the faulty components detected by the fault diagnosis module by running the preset repair program. The preset repair program will include repair methods for various possible faults, such as restarting the faulty component, reconfiguring the parameters of the faulty component, replacing the faulty component, etc. When the fault diagnosis module detects that one or some components have failed, it will start the automatic repair module and pass the fault information to the automatic repair module. Then the automatic repair module will find a suitable repair method in the preset repair program to repair the faulty component based on the fault information. After the repair is completed, the system will use the fault diagnosis module again to detect whether the repaired component has returned to normal. If it is detected that the component has returned to normal, the system will continue to operate normally.
[0034] Under such a design structure, even if any failure occurs during system operation, the switch can immediately switch to the backup module to ensure the continuity and stability of system operation, greatly improving the reliability of the system.
[0035] The fault diagnosis module can identify faulty components through fault detection algorithms, and the automatic repair module can automatically repair faulty components based on the fault diagnosis results, thereby realizing online diagnosis and repair of PLC controller faults, greatly improving the system's operating efficiency and maintenance efficiency, and reducing manual maintenance costs and time costs.
[0036] Optionally, in an exemplary embodiment, when the fault diagnosis module detects a fault in the main controller module through a fault detection algorithm, it activates the sub-controller module and connects the switching device to the sub-controller module, and sends the fault diagnosis result of the main controller module fault to the automatic repair module; the automatic repair module automatically repairs the main controller module according to the fault diagnosis result.
[0037] In the embodiment of the present invention, when the fault diagnosis module detects a fault in the main controller module, it can immediately switch to the secondary controller module and automatically repair the main controller module through the automatic repair module, thereby ensuring stable operation of the system and realizing online fault diagnosis.
[0038] When the automatic repair module automatically repairs the main controller module according to the fault diagnosis result, when the fault diagnosis result indicates that the main controller module has a software fault, the automatic repair module controls the main controller module to reload the software, or roll back to the state before the fault; when the fault diagnosis result indicates that the main controller module has a hardware fault, the automatic repair module restarts or resets the main controller module. The embodiment of the present invention automatically repairs the main controller module through the repair program in the automatic repair module, thereby realizing online repair of the fault.
[0039] Optionally, in an exemplary embodiment, when the fault diagnosis module detects a fault in the main communication link corresponding to the main controller module in the redundant link through a fault detection algorithm, it activates the secondary controller module and connects the switching module to the secondary controller module, and sends the fault diagnosis result of the main communication link failure to the automatic repair module; the automatic repair module automatically repairs the main communication link according to the fault diagnosis result.
[0040] In the embodiment of the present invention, when the fault diagnosis module detects a fault in the primary communication link, it can immediately switch to the secondary communication link and automatically repair the primary communication link through the automatic repair module, thereby ensuring stable operation of the system and realizing online fault diagnosis.
[0041] The automatic repair module automatically repairs the main communication link according to the fault diagnosis result, including: reinitializing the main communication link, or trying to replace other communication links. The embodiment of the present invention automatically repairs the main communication link through the repair program in the automatic repair module, thereby realizing online fault repair.
[0042] Optionally, in an exemplary embodiment, the power supply module includes a main power supply module and a redundant power supply module connected in parallel. The power supply module and the redundant power supply module provide power for all the above modules, and when the main power supply module fails, the redundant power supply module can immediately take over the power supply.
[0043] The embodiment of the present invention provides a PLC controller, which improves the stability and operation continuity of the system through the design of backup modules and redundant power supplies, and can effectively deal with the failure of the main module controller module and the main power supply module to ensure the stable operation of the system. At the same time, the PLC controller provided by the embodiment of the present invention has an online maintenance function, which can perform fault diagnosis and repair without stopping the system, greatly improving the operation efficiency and maintenance efficiency of the system, and reducing the manual maintenance cost and time cost.
[0044] In the existing technology, the PLC controller lacks adaptability and intelligence: the system is relatively "rigid" and does not have the ability to adapt to the environment, self-learn and improve. It cannot adapt to local conditions and cannot deeply mine and understand data patterns. Difficulty in later maintenance and upgrades: Once the control system is set, it is difficult to modify and upgrade. Some unreasonable designs or new requirements that arise later cannot be well incorporated into the system, and there is a lack of sufficient flexibility and adaptability to the specific needs of users.
[0045] To solve the above technical problems, in an exemplary embodiment, the fault diagnosis algorithm in the fault diagnosis module adopts an adaptive boosting learning (AdaptiveBoosting, AdaBoost) model, and the adaptive boosting learning model is formed in the following manner, including: obtaining PLC historical operation data and performing data preprocessing; performing feature extraction on the preprocessed historical operation data to obtain data features that characterize the fault type; using the data features as input to the adaptive boosting learning model, and using a weak classifier as a decision tree; training the weak classifier in an iterative manner, combining the results of each weak classifier according to weights, and obtaining a trained adaptive boosting learning model.
[0046] The adaptive reinforcement learning model adopted in the embodiment of the present invention can combine multiple weak classifiers to form a strong classifier, which can more accurately determine which module of the PLC has a problem.
[0047] The adaptive reinforcement learning algorithm is as follows:
[0048] 1. Collect historical data: Collect a large amount of historical data from PLC operation from various sensors and actuators. The selection of representative data can reveal key information about the operating status of the PLC module.
[0049] Controller module status data: including operating status (such as normal operation, warning, fault), CPU load, memory usage, data processing speed, etc.
[0050] Input and output module data: Contains the input signal data of each sensor (such as temperature, pressure, humidity, etc.) and the output signal data of the actuator (such as valve opening, motor speed, etc.).
[0051] System performance data: including system running time, processing capacity, etc.
[0052] Power module data: voltage, current, frequency, power, etc. of the main power supply and redundant power supply.
[0053] Redundant link data: data transmission speed, data packet loss rate, network delay, etc.
[0054] 2. Data preprocessing: preprocess the collected historical data, such as normalization;
[0055] The purpose of normalization is to eliminate the influence of data scale, and the normalization method adopts maximum and minimum normalization.
[0056] 3. Feature selection: Select representative data features from the preprocessed data as input for model learning;
[0057] 4. Weak classifier determination: In the AdaBoost algorithm, each weak classifier only needs to be slightly better than random guessing, and the weak classifier used is a decision tree;
[0058] 5. AdaBoost training: AdaBoost trains weak classifiers in an iterative manner;
[0059] 6. System judgment: The results of each weak classifier are combined according to the weights to obtain the final strong classifier. When judging new input data, a voting method is adopted. Each weak classifier votes on the data to be judged according to its weight. The category with the most votes is judged as that category.
[0060] Furthermore, the AdaBoost training process is as follows:
[0061] Assume that the training data set is {(x1, y1), (x2, y2), ..., (xN, yN)}. Initially, the weight of each sample is initialized to W0(i) = 1 / N. For m, iterate from 1 to T times, where m represents the number of iterations.
[0062] (1) Use the current weight W0(i) = 1 / N to train a weak classifier h m :.
[0063] (2) For each weak classifier, calculate its weight α based on the sample weight distribution and classification error rate;
[0064] e m =∑Wi(m)(y≠h m (x))
[0065] α m =0.5*log((1-e m ) / e m )
[0066] Wi(m) represents the weight of the i-th sample in the m-th iteration. In each iteration, AdaBoost adjusts the weight of the sample according to the classification results of the previous round. If a sample is correctly classified in the previous round, the weight of this sample will be reduced; conversely, if this sample is incorrectly classified, its weight will be increased. Therefore, Wi(m) changes continuously as the iteration proceeds. The value of the weight Wi(m) is obtained through the weight update rule of the AdaBoost algorithm.
[0067] (3) Update sample weights. For correctly classified samples, their weights will decrease; for incorrectly classified samples, their weights will increase; the weight update formula is:
[0068] If the sample is correctly classified, Wi(m+1)=Wi(m)*exp(-α m y m h m (x m ));
[0069] If the sample is misclassified, Wi(m+1)=Wi(m)*exp(α m y m h m (x m ));
[0070] Then normalize the weights: Z m =∑Wi(m+1).
[0071] Where N is the total number of samples, Wi is the weight of the i-th sample, and e m is the error rate of the mth weak classifier, α m is the weight of the mth weak classifier, h m : is the mth weak classifier, y m is the true label of the mth sample (e.g., fault or not), x m is the feature vector of the mth sample, Z m is the normalization factor of the weight.
[0072] The weight Wi of each sample is adjusted during each iteration according to whether the sample is correctly classified. If sample i is correctly classified in the mth iteration, the weight Wi(m+1) of the sample in the m+1th iteration will be reduced; on the contrary, if sample i is misclassified in the mth iteration, the weight Wi(m+1) of the sample in the m+1th iteration will be increased.
[0073] The above steps (2)-(3) are iterated until the specified number of iterations T is reached.
[0074] The final strong classifier is a linear combination of all weak classifiers:
[0075] H(x)=sign[sum(α m *h m (x))]
[0076] Among them, H(x) is a strong classifier, h m (x) is a weak classifier, and m is from 1 to T.
[0077] The creativity of the AdaBoost algorithm is mainly reflected in the following aspects:
[0078] Adaptability: In each iteration, the AdaBoost algorithm adjusts the sample weights according to the performance of the current weak classifier, so that misclassified samples receive more attention in subsequent iterations. Therefore, the AdaBoost algorithm has strong adaptability and can be well applied in dynamically changing environments.
[0079] Ensemble learning: The AdaBoost algorithm can integrate multiple weak classifiers into a strong classifier, whose performance usually exceeds that of any individual weak classifier. This idea of ensemble learning is very creative, it effectively improves the performance of individual classifiers and has high practical value.
[0080] Excellent generalization ability: By combining multiple weak classifiers, the AdaBoost algorithm can effectively suppress overfitting and has excellent generalization ability. This has been demonstrated in many practical applications. For example, in PLC fault diagnosis, even when faced with previously unseen fault modes, accurate judgments can be made.
[0081] Easy to implement and understand: The principle of AdaBoost algorithm is simple and clear, easy to implement and understand, which facilitates its wide use in practical applications.
[0082] The adaptive boost learning algorithm adopted in the embodiment of the present invention can combine multiple weak classifiers to form a strong classifier, and can more accurately judge the faulty components of the PLC. AdaBoost, whose full name is Adaptive Boosting, is an iterative ensemble learning algorithm. Its working principle is to train a weak classifier in each iteration, and then adjust the weight of the training sample according to the performance of this weak classifier, so that the samples that were previously misclassified get more attention in the next iteration. In this way, after multiple iterations, AdaBoost can combine various weak classifiers to form a strong classifier with good performance. When the AdaBoost algorithm is used to judge the faulty module of the PLC controller, the working status of each module can be learned through multiple iterations, so as to more accurately identify the faulty module and improve the accuracy of fault diagnosis.
[0083] The embodiment of the present invention introduces an adaptive reinforcement learning algorithm to give the PLC controller the ability to self-learn and optimize, continuously improve the operating efficiency of the system, and enhance the intelligence of the system. The modular design also increases the adaptability and flexibility of the system, facilitating later maintenance and upgrades. In general, the PLC controller provided by the embodiment of the present invention can effectively improve the control efficiency and stability in the field of industrial automation, reduce production costs, and has important practical value.
[0084] Figure 2 FIG. 1 is a partial structural diagram of a PLC controller shown in an exemplary embodiment of the present application. Figure 2 As shown, in an exemplary embodiment, the main controller module and the sub-controller module are connected to each other. Specifically, the output ports D4, D1, D2 and D0 of the main controller module (main PLC controller) are connected to the input ports I3, I4, I1 and I0 of the sub-controller module (backup PLC controller); the output ports D0, D1, D2, D4 of the sub-controller module are connected to the input ports I0, I4, I1 and I3 of the main controller module.
[0085] The main controller module and the sub-controller module are both connected to the fault diagnosis module. Specifically, the output port D2 of the main controller module is connected to the fault diagnosis module via a communication link F11, the output port D2 of the sub-controller module is connected to the fault diagnosis module via a communication link F12, the output port D3 of the main controller module is connected to the fault diagnosis module via a communication link F10, and the output port D3 of the sub-controller module is connected to the fault diagnosis module via a communication link F13.
[0086] The main controller module and the secondary control module are both connected to the switch. Specifically, the output port D0 of the main controller module is connected to the switch via the main communication link F14, and the output port D0 of the secondary controller module is connected to the switch via the secondary communication link F15, and the main communication link F14 and the secondary communication link F15 constitute a redundant link.
[0087] The switching switch is connected to the input-output module, and the input-output module is connected to the main controller module and the sub-controller module. Specifically, the input-output module is connected to the main controller input port I2 and the sub-controller input port I2.
[0088] The present invention is explained below in conjunction with an exemplary embodiment.
[0089] First, a PLC controller system with a fully redundant structure that can be maintained online is built. The system is a modular redundant system that includes two identical controller modules. The system is a backup operation unit after the main operation. At the same time, a set of input and output modules are set up to connect with the two controller modules. A redundant link connects the input and output modules with the controller module as a signal transmission channel. When the main link fails, the backup link starts immediately. A switching switch is set up again. Once the main controller module or the main communication link of the redundant link fails, the backup module will be started. Finally, there is a power supply module and its redundant power supply module to provide power for all modules.
[0090] Secondly, introduce the fault diagnosis module and the automatic repair module. Set up a fault diagnosis module and use the AdaBoost algorithm to detect and identify faulty components. Assume that the existing historical fault data is as follows:
[0091] (temperature, current, data transmission speed, number of errors, fault conditions)
[0092] (80℃, 10A, 50Mbps, 3 times per minute, controller failure)
[0093] (60℃, 8A, 55Mbps, once per minute, IO module failure)
[0094] (90℃, 10A, 45Mbps, 4 times per minute, system normal)
[0095] By preprocessing and selecting features of these data, weak classifiers are trained, and AdaBoost models are established to identify faulty modules.
[0096] During fault detection, if the main controller module or the main communication link fails, the switch will immediately switch to the backup module to ensure the continuous operation of the system. The fault diagnosis module will identify the faulty component, and the automatic repair module will automatically execute the repair procedure after diagnosing the fault.
[0097] Finally, the repaired components are reintegrated, and all operating status information of the controller module is recorded and analyzed in real time through an operating status monitoring module. Once an abnormal phenomenon is found, the fault diagnosis module will be immediately started to determine whether any component has failed, and preventive measures can be taken in advance before the failure occurs.
[0098] Figure 3 FIG. 1 is a flow chart of a method for online fault diagnosis and repair of a PLC controller shown as an exemplary embodiment of the present application. Figure 3 As shown, the online diagnosis and maintenance method of the PLC controller is applied to the PLC controller provided by any of the above embodiments, and the method includes:
[0099] S301, the main controller module and the sub-controller module run simultaneously and maintain the same running state and data;
[0100] S302, the fault diagnosis module identifies the faulty component through a fault detection algorithm, generates a fault diagnosis result, and performs backup switching through the switching switch;
[0101] S303, the automatic repair module automatically repairs the faulty component according to the fault diagnosis result of the fault diagnosis module.
[0102] Optionally, in an exemplary embodiment, when the fault diagnosis module detects a fault in the main controller module through a fault detection algorithm, it activates the sub-controller module and connects the switching device to the sub-controller module, and sends the fault diagnosis result of the main controller module fault to the automatic repair module; the automatic repair module automatically repairs the main controller module according to the fault diagnosis result.
[0103] Optionally, in an exemplary embodiment, the automatic repair module automatically repairs the main controller module according to the fault diagnosis result, including:
[0104] When the fault diagnosis result indicates that the main controller module software is faulty, the automatic repair module controls the main controller module to reload the software or roll back to the state before the fault;
[0105] When the fault diagnosis result indicates that the main controller module has a hardware fault, the automatic repair module restarts or resets the main controller module.
[0106] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0107] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A PLC controller, characterized in that: include: Main controller module, sub-controller module, switch, redundant link, input and output module, fault diagnosis module, automatic repair module and power supply module; The main controller module and the sub-controller module are connected to the input-output module via the redundant link, and the switch is arranged on the redundant link; the two controller modules are connected to each other, and both operate simultaneously and maintain the same operating state and data; The fault diagnosis module is connected to the main controller module, the automatic repair module and the switch, and is used to identify the faulty component through a fault detection algorithm, generate a fault diagnosis result and perform backup switching through the switch; The automatic repair module is connected to the main controller module and the auxiliary controller module, and is used to automatically repair the faulty component according to the fault diagnosis result of the fault diagnosis module; The power supply module is connected to the main controller module, the sub-controller module, the switch, the redundant link and the input / output module, and is used to provide power supply to each module.
2. The PLC controller according to claim 1, characterized in that: When the fault diagnosis module detects a fault in the main controller module through a fault detection algorithm, it activates the sub-controller module and connects the switch to the sub-controller module, and sends the fault diagnosis result of the main controller module fault to the automatic repair module; The automatic repair module automatically repairs the main controller module according to the fault diagnosis result.
3. The PLC controller according to claim 2, characterized in that: The automatic repair module automatically repairs the main controller module according to the fault diagnosis result, including: When the fault diagnosis result indicates that the main controller module software is faulty, the automatic repair module controls the main controller module to reload software or roll back to a state before the fault; When the fault diagnosis result indicates a hardware fault of the main controller module, the automatic repair module restarts or resets the main controller module.
4. The PLC controller according to claim 1, characterized in that: When the fault diagnosis module detects a fault in the main communication link corresponding to the main controller module in the redundant link through a fault detection algorithm, it activates the secondary controller module and connects the switch to the secondary controller module, and sends the fault diagnosis result of the main communication link fault to the automatic repair module; The automatic repair module automatically repairs the main communication link according to the fault diagnosis result.
5. The PLC controller according to claim 4, characterized in that: The automatic repair module automatically repairs the main communication link according to the fault diagnosis result, including: The automatic repair module reinitializes the main communication link, or attempts to replace other communication links.
6. The PLC controller according to any one of claims 1 to 5, characterized in that: The fault diagnosis algorithm in the fault diagnosis module adopts an adaptive reinforcement learning model, and the adaptive reinforcement learning model is generated in the following manner, including: Obtain PLC historical operation data and perform data preprocessing; Perform feature extraction on the preprocessed historical operation data to obtain data features that characterize the fault type; Using the data features as input of the adaptive reinforcement learning model, and using weak classifiers as decision trees; The weak classifiers are trained in an iterative manner, and the results of each weak classifier are combined according to the weights to obtain a trained adaptive reinforcement learning model.
7. The PLC controller according to any one of claims 1 to 5, characterized in that: The power supply module comprises a main power supply module and a redundant power supply module connected in parallel.
8. A method for online diagnosis and repair of faults of a PLC controller, characterized in that: Applied to the PLC controller according to any one of claims 1 to 7, the method comprises: The main controller module and the sub-controller module run simultaneously and maintain the same operating status and data; The fault diagnosis module identifies the faulty component through a fault detection algorithm, generates a fault diagnosis result and performs backup switching through the switching switch; The automatic repair module automatically repairs the faulty component according to the fault diagnosis result of the fault diagnosis module.
9. The online diagnosis and maintenance method of a PLC controller according to claim 8, characterized in that: When the fault diagnosis module detects a fault in the main controller module through a fault detection algorithm, it activates the sub-controller module and connects the switch to the sub-controller module, and sends the fault diagnosis result of the main controller module fault to the automatic repair module; The automatic repair module automatically repairs the main controller module according to the fault diagnosis result.
10. The online diagnosis and maintenance method of a PLC controller according to claim 9, characterized in that: The automatic repair module automatically repairs the main controller module according to the fault diagnosis result, including: When the fault diagnosis result indicates that the main controller module software is faulty, the automatic repair module controls the main controller module to reload software or roll back to a state before the fault; When the fault diagnosis result indicates a hardware fault of the main controller module, the automatic repair module restarts or resets the main controller module.
