A method and system for recording and exporting PLC data
By setting up an intelligent monitoring device in the GCB device, collecting and analyzing PLC working status data, and combining multiple abnormal detection models for intelligent processing, the shortcomings of PLC data collection and recording are solved, and multi-dimensional monitoring and intelligent abnormality detection are realized, which improves the reliability and data security of PLC operation.
Patent Information
- Application Number
- CN202411427883.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-10-14
AI Technical Summary
The prior art has problems such as single acquisition methods, lack of multimodal data fusion support, and it is difficult to realize intelligent abnormal detection and reliability evaluation in terms of PLC data acquisition and recording.
By setting up an intelligent monitoring device in the GCB device, integrating the data acquisition module, edge data processing module and communication module, real-time acquisition and pre-processing of PLC working status data is realized, and sent to the PLC module through industrial Ethernet. Combining two-way shared memory and multiple anomaly detection models (based on rules, statistics and deep learning), data analysis and anomaly detection are carried out to generate anomaly event analysis report.
It realizes comprehensive and efficient acquisition of all working status parameters of PLC, integrates video, audio and sensor data, performs multi-dimensional monitoring and intelligent abnormality detection, improves the intelligent evaluation ability of PLC operation reliability, and ensures data security through encrypted transmission.
Smart Images

Figure CN118963329B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of industrial automation control, and in particular to a method and system for recording and exporting PLC data. Background Art
[0002] In the automation control system, the programmable logic controller (PLC) is the core control device, and the stability and reliability of its working state are crucial to the normal operation of the entire system. PLC realizes automatic control of the controlled objects (such as motors, actuators, etc.) by collecting various switch quantities (digital quantities) and analog quantities on site and executing pre-designed and programmed logic control algorithms. Therefore, real-time monitoring and recording of PLC working status data (such as input / output port status, internal data variables, etc.) is of great significance for evaluating system operation status, analyzing fault causes, and optimizing control strategies.
[0003] However, the existing technology still has some shortcomings in the collection and recording of PLC data. Traditional data collection methods are usually passive and can only obtain limited data, making it difficult to fully and efficiently monitor the various working status parameters of the PLC. In addition, the existing technology lacks the ability to combine PLC data with other auxiliary information (such as equipment video / audio), and cannot provide multi-dimensional data support for abnormal diagnosis. At the same time, most methods only stay at the data collection level, lack the processing means for intelligent analysis and abnormality detection of the collected data, and it is difficult to make timely and effective reliability assessments of the operating status of the PLC. Summary of the invention
[0004] In view of the problems that the existing PLC data recording technology has a single collection method, lacks multimodal data fusion support, and is difficult to achieve intelligent anomaly detection and reliability assessment, the present invention is proposed.
[0005] Therefore, the problem to be solved by the present invention is how to achieve comprehensive and efficient collection of all working status parameters of PLC, integrate PLC data with heterogeneous data sources such as video and audio, and analyze and automatically detect anomalies of the fused data based on intelligent algorithms, thereby providing an intelligent evaluation of the PLC operation reliability.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0007] In the first aspect, an embodiment of the present invention provides a method for recording and exporting PLC data, which includes setting an intelligent monitoring device in a GCB device, wherein the intelligent monitoring device integrates a data acquisition module, an edge data processing module and a communication module; the data acquisition module monitors and collects the working status data of the GCB in real time, including DI / DO / AI channel status data and corresponding timestamps; the edge data processing module performs real-time preprocessing on the collected working status data; the communication module periodically sends the preprocessed working status data to the PLC module via industrial Ethernet; after receiving the working status data, the PLC module feeds back a response data frame to the intelligent monitoring device, and sends the response data frame and the corresponding timestamp is stored in the bidirectional shared memory; the PLC controller monitors the response data frame in the bidirectional shared memory in real time to determine whether a working abnormality occurs; if a working abnormality occurs, the intelligent monitoring device receives the abnormality notification data packet sent by the PLC, and extracts all working status data within the preset time window before and after the time point of the abnormality from the bidirectional shared memory; the extracted working status data is subjected to edge intelligent analysis and processing to identify the type, severity and time node of key abnormal events, and generate an abnormal event analysis report; the generated abnormal event analysis report is sent to the remote data center through an encrypted channel for archiving, and is output to the on-site large-screen display unit for on-site personnel to review.
[0008] As a preferred solution of the method for recording and exporting PLC data described in the present invention, the following steps are included in the following: an intelligent monitoring device is set in the GCB device: the intelligent monitoring device is installed in the control cabinet or other appropriate location of the GCB device, and a wired or wireless connection is established with the GCB control system; a communication link is established with the GCB control system through the data acquisition module of the intelligent monitoring device, and the GCB working status data is monitored and collected in real time, including video stream, audio stream, DI / DO / AI data and corresponding high-precision timestamp; the data acquisition module is configured, the DI / DO / AI channel type to be monitored and the corresponding device endpoint address are specified, and the data acquisition cycle and timestamp accuracy requirements are set; the edge data processing module is configured, and the data preprocessing algorithm is loaded; the communication module is configured, the IP address of the PLC module is specified, and the communication protocol and sending cycle with the PLC module are set; incremental learning and heterogeneous computing units are deployed to give the edge AI model the ability of online autonomous evolution and computing power support; and each module is comprehensively verified to be operating normally.
[0009] As a preferred solution of the method for recording and exporting PLC data described in the present invention, wherein: storing the response data frame and the corresponding timestamp in the bidirectional shared memory includes: the PLC module establishes an industrial Ethernet or 5G / wireless communication connection, sends a ready signal to the intelligent monitoring device, and prepares to receive the working status data; after the intelligent monitoring device receives the PLC ready signal, it starts to periodically send the working status data packet processed by the edge; after the PLC module receives the working status data packet, it parses and verifies it according to the agreed protocol, generates a response data frame with a timestamp and returns it to the intelligent monitoring device; after the intelligent monitoring device receives the PLC response data frame, it checks whether it is correct. If it is correct, it continues to periodically send the next batch of working status data packets, otherwise it retransmits the corresponding data packet; the two parties periodically exchange status according to the agreed protocol, and perform error checking and data retransmission; the PLC module opens a bidirectional shared memory area locally, and stores the received working status data, response data frame and timestamp in the bidirectional shared memory; the intelligent monitoring device periodically reads the data in the bidirectional shared memory area according to the agreed protocol, confirms the data interaction status, and notifies the PLC to retransmit the corresponding data if an abnormality is found.
[0010] As a preferred solution of the PLC data recording and exporting method described in the present invention, determining whether a working abnormality occurs includes the following steps: the PLC controller periodically scans the bidirectional shared memory area at a set time interval to obtain the latest response data frame; parses the obtained response data frame to extract key status parameters; performs abnormality detection on the extracted key status parameters one by one according to a pre-configured set of abnormality judgment rules; if any criterion is triggered, the timestamp of the abnormality is recorded, and all working status data of the current response data frame is saved; and the corresponding exception handling strategy is executed according to the type of abnormality judgment triggered.
[0011] As a preferred solution of the method for recording and exporting PLC data described in the present invention, wherein: performing abnormality detection on the extracted key state parameters one by one includes the following steps: constructing an abnormality detection model set M={M1, M2, M3}, wherein M1 is a rule model based on domain knowledge, M2 is a parameter density model based on statistical learning, and M3 is a time series pattern model based on deep learning; the rule model M1 is based on an expert knowledge base, and defines the legal value range of the state parameter X through the IF-THEN rule, and if X is out of bounds, it is judged as abnormal; the parameter density model M2 is based on the law of large numbers to estimate the probability distribution of the normal state parameter X , if the new sample probability , it is judged as abnormal, where is the confidence level threshold, Representing new samples; temporal pattern model Based on the LSTM / GRU recurrent neural network F, the state parameter time series X is input, and the high-order pattern features are automatically extracted through the network's recurrent computing unit , extract the high-order features high-order pattern features Input the classifier to determine whether the state parameter time series X is abnormal; the integrated model M outputs the abnormality score ,in Represents the model weight coefficient, which is determined by cross-validation; sets the abnormality judgment threshold ,like , then the state parameter time series X is determined to be abnormal, the proportion of each model score is analyzed and the possible abnormal type is determined; when an abnormality occurs, the current time window is cached [ t − Δ t , t + Δ t ] All state data X and timestamp t in the system are collected to provide original information for subsequent diagnostic analysis; the newly collected annotated data are regularly used to incrementally learn the model set M, and the anomaly detection capability is optimized online and adaptively; an industrial human-computer interaction system is designed to visualize the detection results y and anomaly information, and expert feedback is input to adjust the anomaly detection model set M parameters and optimize the threshold ; For industrial application scenarios, the optimized anomaly detection model set M is deployed on the FPGA / GPU platform through model compression and heterogeneous computing.
[0012] As a preferred solution of the method for recording and exporting PLC data of the present invention, analyzing the proportion of each model score and determining the possible abnormal type includes the following steps: according to the integrated abnormal score y and the abnormal judgment threshold Determine abnormal status, if , it is marked as abnormal state, otherwise it is normal state; calculate the normalized anomaly score ratio corresponding to the rule model M1, parameter density model M2, and time series pattern model M3 ,in represents the model weight coefficient, Represents the anomaly score of the i-th sub-model in the anomaly detection model set; determines the dominant anomaly type ,in They represent the normalized anomaly scores corresponding to the rule model M1, parameter density model M2, and time series pattern model M3 respectively; if s max =s1, then the dominant exception type is rule violation. In this case, check whether the rule base needs to be updated and analyze the cause of the violation parameter. max =s2, then the dominant abnormal type is data outliers. In this case, we analyze the distribution interval of the outlier data to determine whether it comes from abnormal conditions. If s max =s3, the dominant anomaly type is time series pattern deviation, and the changing trend of the recent time series data is analyzed; if there are situations with the same proportion, multiple possible anomaly types are combined.
[0013] As a preferred solution of the method for recording and exporting PLC data described in the present invention, the following steps are included in the method for identifying the type, severity and occurrence time of key abnormal events: separating three data sources, namely, video stream, audio stream and DI / DO / AI raw data, from the cached data; performing missing value filling and normalization processing on the DI / DO / AI data, and outputting normalized digital time series data; constructing a time series modeling model based on LSTM or Wavenet, modeling and learning normal DI / DO / AI data, inputting new data, calculating the probability density on the normal model, and marking it as abnormal data and time point if it is lower than the threshold; decoding the video stream, preprocessing the image, and outputting a normalized video frame sequence; using a dual-branch video Transformer model, one branch performs target detection, and the other branch performs behavior recognition, using a DETR model for target detection, and using a time series modeling model based on LSTM or Wavenet. The Transformer's spatiotemporal model is used for behavior recognition, and the two-way results are fused and input into the event discrimination model to identify abnormal events in the video scene; the audio stream is denoised and feature extracted to output a speech feature sequence; the Conformer or Transformer-Transducer model is used for self-supervised speech recognition and text transcription, and sentiment analysis and keyword extraction are performed on the transcription results to determine whether there is abnormal content; the three-way abnormal detection results of DI / DO / AI data, video stream, and audio stream are fused and input into the Transformer's self-attention layer to comprehensively output the type, level, and time of occurrence of abnormal events; the time window is determined according to the abnormal event results, and the multimedia data before, during, and after the event are extracted, and the abnormal event analysis report is generated by organizing it according to the timeline; the PLC controller generates a historical curve with the channel status response data frame and timestamp, and outputs it to the display unit.
[0014] In the second aspect, an embodiment of the present invention provides a PLC data recording and exporting system, which includes an intelligent monitoring device module, which is used to set up an intelligent monitoring device in a GCB device, and the intelligent monitoring device integrates a data acquisition module, an edge data processing module and a communication module; a PLC control module, which is used for the PLC controller to monitor the response data frames in the bidirectional shared memory in real time to determine whether a working abnormality occurs; a data extraction module, which is used to extract and cache all working status data within a preset time window before and after the abnormality occurs from the bidirectional shared memory; an edge intelligent analysis module, which is used to perform edge intelligent analysis and processing on the cached working status data, identify the type, severity and exact occurrence time node of key abnormal events, and generate an abnormal event analysis report; a data transmission and visualization module, which is used to send the generated abnormal event analysis report to a remote data center through an encrypted channel for archiving, and at the same time output it to the on-site large-screen display unit for on-site personnel to review.
[0015] In a third aspect, an embodiment of the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program instructions are executed by the processor, the steps of the method for recording and exporting PLC data as described in the first aspect of the present invention are implemented.
[0016] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program instructions are executed by a processor, the steps of the method for recording and exporting PLC data as described in the first aspect of the present invention are implemented.
[0017] The beneficial effects of the present invention are as follows: the present invention integrates video, audio and sensor data for multi-dimensional comprehensive monitoring, implements edge intelligent analysis and processing by deploying deep learning models on site, avoids data transmission delays, and uses incremental learning mechanisms to enable continuous adaptive optimization of the model. It integrates a variety of anomaly detection models based on rules, statistics and deep learning, and improves the accuracy and interpretability of anomaly detection by fusing the anomaly score outputs of each model. After an anomaly occurs, the system automatically generates a rich text analysis report, and presents it on the large screen on site in a graphical and animated manner, providing on-site personnel with an intuitive overview and analysis of abnormal events. At the same time, the solution uses mechanisms such as encrypted transmission and VPN tunnels to ensure data security, and the anomaly detection module can be deployed in isolation for the core system. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 The framework flow chart of the PLC data recording and exporting method.
[0020] Figure 2 PLC controller configuration diagram for recording and exporting PLC data.
[0021] Figure 3 Computer equipment diagram for recording and exporting methods of PLC data. DETAILED DESCRIPTION
[0022] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.
[0023] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0024] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.
[0025] Example 1
[0026] Reference Figure 1~Figure 3 , which is the first embodiment of the present invention, and provides a method for recording and exporting PLC data, including:
[0027] S1: Set up an intelligent monitoring device in the on-site GCB equipment.
[0028] It should be noted that the intelligent monitoring device integrates a data acquisition module, an edge data processing module and a communication module, wherein the data acquisition module is used to monitor and collect the working status data of the GCB in real time, including DI / DO / AI channel status data and corresponding high-precision timestamps, and the monitored objects include the position status of the GCB isolation switch and the grounding switches DS1, ES1 and ES2; the edge data processing module is used to perform real-time pre-processing of the working status data collected by the data acquisition module; the communication module is used to periodically send the working status data pre-processed by the edge data processing module to the PLC module through industrial Ethernet.
[0029] Specifically, install an intelligent monitoring device in the control cabinet or other appropriate locations of the GCB equipment, and establish a wired or wireless connection with the GCB control system; establish a communication link with the GCB control system through the data acquisition module of the intelligent monitoring device, monitor and collect GCB working status data in real time, including video stream, audio stream, DI / DO / AI data and corresponding high-precision timestamps; configure the data acquisition module, specify the DI / DO / AI channel type to be monitored and the corresponding device endpoint address, and set the data acquisition cycle and timestamp accuracy requirements; configure the edge data processing module, load data preprocessing algorithms including deep learning models, machine vision algorithms, and speech recognition algorithms; configure the communication module, specify the IP address of the PLC module, and set the communication protocol and sending cycle with the PLC module; deploy incremental learning and heterogeneous computing units to give the edge AI model online autonomous evolution and computing power support capabilities; and fully verify the normal operation of each module.
[0030] It should be noted that the data acquisition cycle is three real-time cycles, each with a sub-cycle of 75ms. The opening and closing states of the knife switch are detected by the distance sensor, and the state signal is input into the PLC module.
[0031] S2: After receiving the working status data, the PLC module feeds back a response data frame to the intelligent monitoring device, and stores the response data frame and the corresponding timestamp in the bidirectional shared memory between the PLC module and the intelligent monitoring device.
[0032] Specifically, the PLC module establishes an industrial Ethernet or 5G / wireless communication connection, sends a ready signal to the intelligent monitoring device, and prepares to receive working status data; after receiving the PLC ready signal, the intelligent monitoring device begins to periodically send edge-processed working status data packets; after receiving the working status data packets, the PLC module parses and verifies them according to the agreed protocol, generates a response data frame with a timestamp, and transmits it back to the intelligent monitoring device; after receiving the PLC response data frame, the intelligent monitoring device checks whether it is correct. If correct, it continues to periodically send the next batch of working status data packets, otherwise it retransmits the previous data packet; the two parties periodically exchange status according to the agreed protocol, and perform error checking and data retransmission; the PLC module opens a bidirectional shared memory area locally, and stores the received working status data, response data frame and timestamp in the bidirectional shared memory; according to the agreed protocol, the intelligent monitoring device periodically reads the data in the bidirectional shared memory area to confirm the data interaction status, and notifies the PLC to retransmit the corresponding data if an abnormality is found.
[0033] It should be noted that if no response data frame is received within the preset time, it is determined that the data channel is disconnected; if a response data frame is received, it is determined that the data channel is connected, and the response data frame is analyzed to determine whether the GCB is faulty.
[0034] S3: The PLC controller monitors the response data frame in the bidirectional shared memory in real time to determine whether a working abnormality occurs.
[0035] Specifically, the following steps are included:
[0036] S3.1: The PLC controller periodically scans the bidirectional shared memory area at a set time interval to obtain the latest response data frame.
[0037] S3.2: Parse the acquired response data frame and extract key status parameters.
[0038] S3.3: According to the pre-configured anomaly judgment rule set, anomaly detection is performed on the extracted key status parameters one by one.
[0039] Specifically, we construct anomaly detection model set M={M1, M2, M3}, where M1 is a rule model based on domain knowledge, M2 is a parameter density model based on statistical learning, and M3 is a time series pattern model based on deep learning. The rule model M1 is based on the expert knowledge base and defines the legal value range of the state parameter X through the IF-THEN rule. If X is out of bounds, it is considered abnormal. The parameter density model M2 is based on the law of large numbers to estimate the probability distribution of the normal state parameter X. , if the new sample probability , it is judged as abnormal, among which, is the confidence level threshold, Representing new samples; temporal pattern model Based on the LSTM / GRU recurrent neural network F, the state parameter time series X is input, and the high-order pattern features are automatically extracted through the network's recurrent computing unit , extract the high-order features high-order pattern features Input the classifier to determine whether the state parameter time series X is abnormal; the integrated model M outputs the abnormality score ,in Represents the model weight coefficient, which is determined by cross-validation; sets the abnormality judgment threshold ,like , then the state parameter time series X is determined to be abnormal, the proportion of each model score is analyzed and the possible abnormal type is determined; when an abnormality occurs, the current time window is cached [ t − Δ t , t + Δ t ] All state data X and timestamp t in the system are collected to provide original information for subsequent diagnostic analysis; the newly collected annotated data are regularly used to incrementally learn the model set M, and the anomaly detection capability is optimized online and adaptively; an industrial human-computer interaction system is designed to visualize the detection results y and anomaly information, and expert feedback is input to adjust the anomaly detection model set M parameters and optimize the threshold ; For industrial application scenarios, the optimized anomaly detection model set M is deployed on the FPGA / GPU platform through model compression and heterogeneous computing to ensure real-time detection response and robust operation.
[0040] It should be noted that analyzing the proportion of each model score and determining the possible anomaly type includes the following steps: Determine abnormal status, if , it is marked as abnormal state, otherwise it is normal state; calculate the normalized anomaly score ratio corresponding to the rule model M1, parameter density model M2, and time series pattern model M3 ,in represents the model weight coefficient, Represents the anomaly score of the i-th sub-model in the anomaly detection model set; determines the dominant anomaly type ,in They represent the normalized anomaly scores corresponding to the rule model M1, parameter density model M2, and time series pattern model M3 respectively; if s max =s1, then the dominant exception type is rule violation. In this case, check whether the rule base needs to be updated and analyze the cause of the violation parameter. max =s2, then the dominant abnormal type is data outliers. In this case, we analyze the distribution interval of the outlier data to determine whether it comes from abnormal conditions. If s max =s3, the dominant anomaly type is time series pattern deviation, and the changing trend of the recent time series data is analyzed; if there are situations with the same proportion, multiple possible anomaly types are combined.
[0041] It should be noted that the M1 rule model: for each rule, the triggering condition of the rule (0 or 1) is used as the rule anomaly score. For all rules, the sum of the rule anomaly scores is calculated as the total anomaly score of M1. The M2 parameter density model: the probability density value of the new sample under the estimated normal probability distribution is used as the anomaly score. The M3 time series pattern model: for the LSTM / GRU-based time series model, an additional node is added to the output of the network and used as the output of the anomaly score. During training, the target anomaly score of the abnormal sample is set to 1, and the target anomaly score of the normal sample is set to 0. The output of the anomaly score is learned through back propagation.
[0042] S3.4: If any criterion is triggered, the timestamp of the abnormality is recorded, and all the working status data of the current response data frame is saved.
[0043] S3.5: Execute the corresponding exception handling strategy according to the type of exception criterion triggered.
[0044] S3.6: The PLC sends the abnormal notification data packet to the intelligent monitoring device via industrial Ethernet or wireless link to complete the abnormal information feedback.
[0045] S4: After receiving the abnormality notification data packet sent by the PLC, the intelligent monitoring device extracts and caches all working status data within a preset time window before and after the abnormality occurs from the bidirectional shared memory.
[0046] S5: Perform edge intelligent analysis and processing on the cached working status data to identify the type, severity and exact time of occurrence of key abnormal events, and generate an abnormal event analysis report.
[0047] Specifically, three data sources are separated from the data in the S4 cache: video stream, audio stream, and DI / DO / AI raw data; missing values are filled and normalized for DI / DO / AI data, and standardized digital time series data is output; a time series modeling model based on LSTM or Wavenet is constructed to model and learn normal DI / DO / AI data, input new data, and calculate the probability density on the normal model. If it is lower than the threshold, it is marked as abnormal data and time point; the video stream is decoded and the image is preprocessed, and a standardized video frame sequence is output; a dual-branch video Transformer model is used, one path performs target detection and the other path performs behavior recognition, the DETR model is used for target detection, and the Transformer-based spatiotemporal model is used for behavior recognition, the two-path results are fused and input into the event discrimination model to identify abnormal events in the video scene; the audio stream is denoised and feature extracted, and a speech feature sequence is output. The Conformer or Transformer-Transducer model is used for self-supervised speech recognition and text transcription, and sentiment analysis and keyword extraction are performed on the transcription results to determine whether there is any abnormal content; the three-way abnormal detection results of DI / DO / AI data, video stream, and audio stream are fused and input into the self-attention layer of the Transformer to comprehensively output the type, level, and time of occurrence of abnormal events; the time window is determined according to the abnormal event results, and the multimedia data before, during, and after the event are extracted, and the abnormal event analysis report is generated by organizing it according to the timeline; the PLC controller generates a historical curve with the channel status response data frame and timestamp, and outputs it to the display unit. According to the status of the monitoring device, it is classified and processed in text form according to the connection and disconnection status.
[0048] S6: The generated abnormal event analysis report is sent to the remote data center through an encrypted channel for archiving, and is output to the on-site large-screen display unit for on-site personnel to review.
[0049] Specifically, the generated abnormal event analysis report is hybrid encrypted, the file content is encrypted using the AES symmetric encryption algorithm, and the AES session key is encrypted using the RSA asymmetric encryption algorithm; based on the industrial Ethernet / 5G network, the IKE / IPSec protocol is used to establish a VPN secure communication tunnel with the remote data center; through the established VPN secure communication tunnel, the SFTP / FTPS secure file transfer protocol is used to upload the encrypted abnormal event analysis report to the designated directory of the remote data center; after decrypting the abnormal event analysis report, it is transmitted to the on-site large-screen display system via the industrial Ethernet, and the integrated visualization component presents the report content in a graphical and animated manner; security monitoring modules are deployed in the remote data center and the on-site large-screen system respectively to record report transmission and display operation logs, regularly check system vulnerabilities and update security policies.
[0050] Furthermore, the present embodiment also provides a PLC data recording and exporting system, including an intelligent monitoring device module, which is used to set up an intelligent monitoring device in the GCB equipment, and the intelligent monitoring device integrates a data acquisition module, an edge data processing module and a communication module; a PLC control module, which is used for the PLC controller to monitor the response data frame in the bidirectional shared memory in real time to determine whether a working abnormality occurs; after the data extraction module intelligent monitoring device receives the abnormal notification data packet sent by the PLC, it extracts and caches all working status data within a preset time window before and after the abnormality occurs from the bidirectional shared memory; an edge intelligent analysis module, which is used to perform edge intelligent analysis and processing on the cached working status data, identify the type, severity and accurate occurrence time node of key abnormal events, and generate an abnormal event analysis report; a data transmission and visualization module, which is used to send the generated abnormal event analysis report to a remote data center through an encrypted channel for archiving, and output it to the on-site large-screen display unit for on-site personnel to review.
[0051] This embodiment also provides a computer device, which is suitable for the case of a method for recording and exporting PLC data, and includes a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute computer-executable instructions to implement the method for recording and exporting PLC data proposed in the above embodiment.
[0052] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
[0053] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the method for recording and exporting PLC data as proposed in the above embodiment is implemented.
[0054] In summary, the present invention integrates video, audio and sensor data for multi-dimensional comprehensive monitoring, implements edge intelligent analysis and processing by deploying deep learning models on site, avoids data transmission delays, and uses incremental learning mechanisms to enable continuous adaptive optimization of the model. It integrates a variety of anomaly detection models based on rules, statistics and deep learning, and improves the accuracy and interpretability of anomaly detection by fusing the anomaly score outputs of each model. After an anomaly occurs, the system automatically generates a rich text analysis report and presents it on the large screen on site in a graphical and animated manner, providing on-site personnel with an intuitive overview and analysis of abnormal events. At the same time, the solution uses mechanisms such as encrypted transmission and VPN tunnels to ensure data security, and the anomaly detection module can be deployed in isolation for the core system.
[0055] Example 2
[0056] Reference Figure 1~Figure 3 , which is the second embodiment of the present invention, and this embodiment provides a method for recording and exporting PLC data. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments.
[0057] Specifically, in order to verify the effectiveness of this technical solution, the present invention deployed an intelligent monitoring system on the GCB equipment of a thermal power plant and conducted a system integration test. First, the intelligent monitoring device is installed in the control cabinet of the GCB equipment, connected to the GCB control system and configured with relevant parameters. Among them, the data acquisition module is set to monitor the DI signals of the three groups of isolation switches and grounding switches of the GCB, with an acquisition frequency of 100Hz; the edge processing module is loaded with a timing anomaly detection model based on LSTM; the communication module sets the communication protocol with the PLC module to Modbus TCP, and the sending period is 10ms.
[0058] During the experiment, the GCB knife switch was manually controlled to close and open, so that the system could operate under normal conditions and accumulate a large amount of normal state data. According to the collected knife switch position signal sequence, the abnormal data fragments were marked, and the marked data were used to train the anomaly detection model in the intelligent monitoring device. In the model training stage, the training data was randomly divided into a training set and a validation set with a ratio of 8:2. The model was trained on the training set, and the generalization ability of the model was monitored on the validation set. When the F1 score of the validation set reached 95%, the training was terminated and the trained model was loaded into the test environment.
[0059] Next, different types of abnormal conditions are simulated by artificially interfering with the GCB switch position sensor: oscillation caused by rapid closing, false locking signals, continuous abnormal jumps, etc. These abnormal events are monitored in real time by the intelligent monitoring device. After receiving the abnormal notification, the PLC module immediately caches the raw data of 1 second before and after the abnormality in the shared memory. These cached data are read by the intelligent monitoring device for further edge analysis and output as abnormal report files.
[0060] It should be noted that the first part of the abnormal report file is a descriptive abnormal summary, indicating the time, type and severity of the abnormality. Then the details of the abnormal event mined from the original data are given, including the switch position image and vibration waveform at the key time point. Through time series analysis and pattern recognition, the time nodes of abnormal occurrence and recovery are accurately located. For different types of abnormalities, there are also targeted analysis and diagnostic suggestions to provide judgment basis for on-site personnel.
[0061] Preferably, the comparison indicators of the present invention and the traditional method are shown in Table 1.
[0062] Table 1 Comparison index table of the present invention and the traditional method
[0063] index The present invention Traditional methods Anomaly detection accuracy 95% 70% Fault location cycle <5min 15min~20min Diagnostic report generation cycle <15min 3h~6h Anomaly Detection Model Model Collection Based on empirical rules Online Adaptive Learning support none Secure transmission capability encryption No encryption
[0064] Specifically, as can be seen from Table 1, the solution of the present invention has significant advantages over traditional methods. The present invention improves the accuracy of anomaly detection from 70% to 95%, shortens the fault location cycle to within 5 minutes, and shortens the diagnostic report generation cycle to within 15 minutes. The present invention uses a model set that integrates multiple models (rule models, statistical models, deep learning models) for anomaly detection, rather than a single empirical rule-based model, and has online adaptive learning capabilities. At the same time, this solution supports data encryption transmission, which improves data security, while traditional methods have no encryption protection.
[0065] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A method for recording and exporting PLC data, characterized in that: include, An intelligent monitoring device is provided in the GCB device, and the intelligent monitoring device integrates a data acquisition module, an edge data processing module and a communication module; The data acquisition module monitors and collects the working status data of GCB in real time, including DI / DO / AI channel status data and corresponding timestamps; The edge data processing module performs real-time preprocessing on the collected working status data; The communication module periodically sends the pre-processed working status data to the PLC module through industrial Ethernet; After receiving the working status data, the PLC module feeds back a response data frame to the intelligent monitoring device, and stores the response data frame and the corresponding timestamp in the bidirectional shared memory; The PLC controller monitors the response data frame in the bidirectional shared memory in real time to determine whether there is any abnormality in operation; If a working abnormality occurs, the intelligent monitoring device receives the abnormality notification data packet sent by the PLC and extracts all working status data within a preset time window before and after the abnormality occurs from the bidirectional shared memory; Perform edge intelligent analysis and processing on the extracted working status data to identify the type, severity and occurrence time of key abnormal events, and generate abnormal event analysis reports; The generated abnormal event analysis report is sent to the remote data center through an encrypted channel for archiving, and is also output to the on-site large-screen display unit for on-site personnel to review; The method of setting up an intelligent monitoring device in a GCB device comprises the following steps: Install intelligent monitoring devices in the control cabinet or other appropriate locations of the GCB equipment and establish wired or wireless connections with the GCB control system; Establish a communication link with the GCB control system through the data acquisition module of the intelligent monitoring device to monitor and collect GCB working status data in real time, including video stream, audio stream, DI / DO / AI data and corresponding high-precision timestamp; Configure the data acquisition module, specify the DI / DO / AI channel type to be monitored and the corresponding device endpoint address, and set the data acquisition cycle and timestamp accuracy requirements; Configure the edge data processing module and load the data preprocessing algorithm; Configure the communication module, specify the IP address of the PLC module, and set the communication protocol and sending cycle with the PLC module; Deploy incremental learning and heterogeneous computing units to give edge AI models the ability to evolve online and support computing power; Comprehensively verify whether each module is operating normally; The storing of the response data frame and the corresponding timestamp into the bidirectional shared memory includes: The PLC module establishes an industrial Ethernet or 5G / wireless communication connection, sends a ready signal to the intelligent monitoring device, and is ready to receive working status data; After receiving the PLC ready signal, the intelligent monitoring device starts to periodically send edge-processed working status data packets; After receiving the working status data packet, the PLC module parses and verifies it according to the agreed protocol, generates a response data frame with a timestamp and transmits it back to the intelligent monitoring device; After receiving the PLC response data frame, the intelligent monitoring device checks whether it is correct. If it is correct, it continues to periodically send the next batch of working status data packets, otherwise it retransmits the corresponding data packets; The two parties periodically exchange status according to the agreed protocol and perform error checking and data retransmission; The PLC module opens a bidirectional shared memory area locally and stores the received working status data, response data frame and timestamp into the bidirectional shared memory; The intelligent monitoring device periodically reads the data in the bidirectional shared memory area according to the agreed protocol, confirms the data interaction status, and notifies the PLC to retransmit the corresponding data if an abnormality is found; Determining whether a working abnormality occurs comprises the following steps: The PLC controller periodically scans the bidirectional shared memory area at a set time interval to obtain the latest response data frame; Parse the acquired response data frame and extract key status parameters; According to the pre-configured anomaly judgment rule set, anomaly detection is performed on the extracted key status parameters one by one; If any criterion is triggered, the timestamp of the abnormality is recorded, and all the working status data of the current response data frame is saved; Execute the corresponding exception handling strategy according to the type of exception criteria triggered; The abnormality detection of the extracted key state parameters one by one comprises the following steps: Construct anomaly detection model set M={M1, M2, M3}, where M1 is a rule model based on domain knowledge, M2 is a parameter density model based on statistical learning, and M3 is a time series pattern model based on deep learning; Rule model M1 is based on the expert knowledge base and defines the legal value range of the state parameter X through IF-THEN rules. If X exceeds the range, it is judged as abnormal; The parameter density model M2 is based on the law of large numbers and estimates the probability distribution of the normal state parameter X. , if the new sample probability , it is judged as abnormal, where is the confidence level threshold, represents a new sample; Timing Pattern Model Based on the LSTM / GRU recurrent neural network F, the state parameter time series X is input, and the high-order pattern features are automatically extracted through the network's recurrent computing unit , extract the high-order features high-order pattern features Input the classifier to determine whether the state parameter time series X is abnormal; The ensemble model M outputs anomaly scores ,in Represents the model weight coefficient, which is determined by cross-validation; Set the abnormality threshold ,like , then the state parameter time series X is determined to be abnormal, and the proportion of each model score is analyzed to determine the possible abnormal type; When an exception occurs, cache the current time window All status data X and timestamp t in the data provide original information for subsequent diagnostic analysis; Regularly use newly collected annotated data to perform incremental learning on the model set M, and optimize the anomaly detection capability online and adaptively; Design an industrial human-computer interaction system to visualize the detection results y and anomaly information, and input expert feedback to adjust the anomaly detection model set M parameters and optimize the threshold ; For industrial application scenarios, the optimized anomaly detection model set M is deployed on the FPGA / GPU platform through model compression and heterogeneous computing; Analyzing the proportion of each model score and determining the possible abnormality type includes the following steps: According to the integrated anomaly score y and the anomaly judgment threshold Determine abnormal status, if , it is marked as abnormal state, otherwise it is normal state; Calculate the normalized anomaly score ratios corresponding to the rule model M1, parameter density model M2, and time series pattern model M3 ,in represents the model weight coefficient, Represents the anomaly score of the i-th sub-model in the anomaly detection model set; Determine the dominant anomaly type ,in They represent the normalized anomaly score proportions corresponding to the rule model M1, parameter density model M2, and time series pattern model M3 respectively; If max =s1, then the dominant exception type is rule violation. In this case, check whether the rule base needs to be updated and analyze the reasons for the violation parameters. If max =s2, then the dominant abnormal type is data outliers. In this case, the distribution interval of the outlier data is analyzed to determine whether it comes from abnormal working conditions; If max =s3, then the dominant anomaly type is time series pattern deviation, and the change trend of the recent time series data is analyzed; If there are situations where the proportions are the same, multiple possible abnormal types are combined; The identification of the type, severity and occurrence time of key abnormal events includes the following steps: Separate the three data sources of video stream, audio stream, and DI / DO / AI raw data from the cached data; Fill missing values and normalize DI / DO / AI data, and output standardized digital time series data; Build a time series model based on LSTM or Wavenet, model and learn normal DI / DO / AI data, input new data, calculate the probability density on the normal model, and mark it as abnormal data and time point if it is lower than the threshold; Decode the video stream, preprocess the image, and output a normalized video frame sequence; A dual-branch video Transformer model is used, with one branch performing target detection and the other performing behavior recognition. The DETR model is used for target detection, and a Transformer-based spatiotemporal model is used for behavior recognition. The two results are fused and input into the event discrimination model to identify abnormal events in video scenes. Perform noise reduction and feature extraction on the audio stream and output a speech feature sequence; Use the Conformer or Transformer-Transducer model for self-supervised speech recognition and text transcription, perform sentiment analysis and keyword extraction on the transcription results, and determine whether there is any abnormal content; The anomaly detection results of DI / DO / AI data, video stream, and audio stream are integrated and input into the self-attention layer of Transformer to comprehensively output the type, level, and time of occurrence of abnormal events. Determine the time window based on the abnormal event results, extract multimedia data before, during and after the event, and generate an abnormal event analysis report based on the timeline; The PLC controller generates a history curve based on the channel status response data frame and timestamp, and outputs it to the display unit.
2. A PLC data recording and exporting system, based on the PLC data recording and exporting method according to claim 1, characterized in that: Also includes, An intelligent monitoring module is used to set an intelligent monitoring device in the GCB equipment, wherein the intelligent monitoring device integrates a data acquisition module, an edge data processing module and a communication module; PLC control module, used for PLC controller to monitor the response data frame in the bidirectional shared memory in real time to determine whether there is any abnormality in operation; A data extraction module is used to extract and cache all working status data within a preset time window before and after the abnormality occurs from the bidirectional shared memory; The edge intelligent analysis module is used to perform edge intelligent analysis on the cached working status data, identify the type, severity and exact time of occurrence of key abnormal events, and generate abnormal event analysis reports; The data transmission and visualization module is used to send the generated abnormal event analysis report to the remote data center through an encrypted channel for archiving, and output it to the on-site large-screen display unit for on-site personnel to review.
3. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for recording and exporting PLC data according to claim 1 are implemented.
4. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for recording and exporting PLC data according to claim 1 are implemented.
Citation Information
Patent Citations
Preventive maintenance method and system for PLC controller network based on artificial intelligence
CN118092404A
Hybrid Machine Learning to Detect Anomalies
US20210281592A1