A multi-task learning method for abnormal location in petrochemical equipment based on digital twins
Through digital twin technology and multi-task learning models, anomaly detection and positioning label data are generated, which solves the problem of insufficient label data in petrochemical plants, realizes efficient and accurate anomaly detection and positioning, and improves the safety and production efficiency of petrochemical plants.
Patent Information
- Application Number
- CN202411757285.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2044-12-03
AI Technical Summary
Existing technologies make it difficult to obtain sufficient anomaly location tag data in petrochemical plants, resulting in insufficient accuracy and real-time performance of anomaly detection and location, and posing safety risks.
Digital twin technology is used to build a multi-task learning model. Anomaly detection and positioning label data are generated through simulation. The Transformer network is combined for feature representation learning and task optimization to achieve synchronous optimization of anomaly detection and positioning.
It improves the accuracy and real-time performance of anomaly detection in petrochemical plants, enhances the adaptability and generalization ability of the model, and reduces the possibility of safety accidents.
Smart Images

Figure CN119691643B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of petrochemical technology, and in particular relates to a petrochemical device anomaly positioning method based on multi-task learning of digital twins. Background Art
[0002] In recent years, with the rapid development of information and communication technologies in the petrochemical industry, the flow of information within petrochemical plants has increased and accelerated. While these technologies have improved production efficiency, they have also introduced more cybersecurity threats. Cyberattacks can infiltrate petrochemical plants through communication networks, tampering with process control instructions or injecting erroneous sensor data. These attacks gradually transcend the plant's information domain and compromise the plant's production processes. Due to the complex and unique characteristics of petrochemical plants, their process states are tightly coupled. Petrochemical plants often involve high temperatures, high pressures, flammable and explosive substances, and complex chemical reactions. Cyberattacks can further lead to production losses or cause safety accidents such as fires and explosions. Therefore, anomaly detection and analysis of petrochemical plants has become a hot topic in the field of petrochemical industry safety and security. This technology ensures that anomalies are identified and appropriate alarm signals are issued to safety and security systems, which is crucial for ensuring the safety and security of petrochemical plants.
[0003] Traditional anomaly detection technology focuses on determining whether a system anomaly exists but lacks further analysis of the anomaly's location. Anomaly localization technology can detect and locate abnormal process conditions or equipment, providing anomaly location alerts and promptly guiding petrochemical plant safety protection systems to take targeted and effective safety response actions. Traditional anomaly localization methods combine labeled data to construct and train classifiers, such as Convolutional Neural Network (CNN) and Graph Convolutional Network (GCN), to perform anomaly localization. However, since cyberattacks rarely occur in petrochemical plants, and simulating cyberattacks in actual petrochemical plants is difficult, costly, and carries the risk of causing safety incidents, obtaining sufficient labeled data for anomaly localization in actual petrochemical plants is impractical.
[0004] Through the above analysis, the problems and defects of the existing technology are as follows:
[0005] Since cyber attacks rarely occur in petrochemical plants, and simulating cyber attack incidents in actual petrochemical plants faces the risk of difficulty, high implementation costs, and causing safety accidents, it is not practical to obtain sufficient anomaly positioning label data from actual petrochemical plants. Summary of the Invention
[0006] In response to the problems existing in the prior art, the present invention provides a petrochemical device anomaly positioning method based on multi-task learning of digital twins.
[0007] The present invention is implemented as follows: a multi-task learning method for locating abnormalities in petrochemical equipment based on digital twins includes:
[0008] Step 1: Using digital twin technology, a digital twin model is constructed based on the historical process operation data and control and process parameters of the target petrochemical unit.
[0009] Step 2: Analyze the production process of the petrochemical plant;
[0010] Set up a simulated production process scenario that includes normal and abnormal operating conditions. Based on the digital twin model, generate state-extended petrochemical unit simulation process operation data in the set simulation scenario. Add anomaly detection labels and anomaly location labels to the operation data. Construct a multi-task joint training dataset based on the process simulation data and data labels.
[0011] Step 3: Build a multi-task learning anomaly localization model;
[0012] The model's front-end shared network learns feature representations for the training data. The output of the front-end shared network is synchronously connected to the two sub-task classifier networks of anomaly detection and anomaly localization. The two sub-networks predict anomaly detection and anomaly localization results respectively. During the training process, the two sub-task networks are jointly trained.
[0013] Step 4: During the online detection phase, the digital twin model is used to expand the process data of the petrochemical unit. The expanded state data is inferred and predicted based on the multi-task anomaly location model. The prediction results of the anomaly location subtask network are combined to obtain the alarm output of abnormal process state location.
[0014] Furthermore, the multi-task joint training dataset is constructed in the following way:
[0015] The digital twin model can simulate and predict the process measurement status X=[x1,x2,...,x d ], where x i is the characteristic data of the i-th sampling device, Based on the interrelationship between the sampling states in the petrochemical plant, the digital twin model can be used to predict and generate e additional extended process state data associated with the existing sampling states, such as the temperature, pressure, flow rate and other process states that have not been sampled on the petrochemical plant. Finally, the data X containing e+d process state extensions is obtained. E =[x1,x2,...,x d ,xd+1 ,...,x d+e ];
[0016] Use digital twin models to simulate and generate process simulation data for petrochemical plants under set normal and abnormal operating conditions It includes normal simulation data and abnormal simulation data; abnormal simulation data includes data with multiple process status abnormalities;
[0017] Add anomaly detection label A to the process data generated by digital twin model simulation AD With abnormal positioning label A AL ;
[0018] Anomaly detection tags in process simulation data tags Indicates whether the process data is abnormal, where N train is the number of training data, label data The value of 1 indicates that there is an anomaly in the process simulation data set, and 0 indicates that it is normal;
[0019] Abnormal location label in Indicates whether the j-th sampling state of the i-th data is abnormal. The value 1 indicates abnormality and 0 indicates normality.
[0020] The simulated running data is used as the input data for the subsequent multi-task anomaly localization model training process. The anomaly detection label and anomaly localization label are used as the training targets of the model to construct a multi-task joint training dataset containing two types of labels.
[0021] Furthermore, the method for generating process simulation data and data labels includes the following steps:
[0022] Set the proportion of abnormal simulation data in process simulation data to P A ∈(0,1), the number of abnormal simulation data in the simulation data in Indicates rounding down, then the number of normal simulation data N N =N train -N A ;
[0023] Use digital twin models to N Generate normal process data by simulating the number of
[0024] Set the injection ratio P for abnormal process status I ∈(0,1], indicating that in the process of using the digital twin model to generate abnormal simulation data, there will be The process status of each petrochemical unit will be randomly selected and abnormal injection will be performed;
[0025] Abnormal injection modes include denial of service injection DOS , step injection M STEP , maximum and minimum injection M MM , randomly inject M RAND , bias injection M BIAS ; where M DOS This is achieved by simulating the failure of selected sensors and actuators in the petrochemical plant, and the process state values obtained by simulation remain fixed to those before failure; STEP Indicates that the corresponding process status value has been tampered with to the set value; M MM Indicates that the process state value will be randomly injected into its maximum or minimum value; M RAND The value indicating the process status will be tampered with to a random value within a certain range; M BIAS Indicates that the value of the tampering process status is added with an offset value based on the original value;
[0026] Among them, for the abnormal injection mode M STEP 、M RAND and M BIAS Setting the injection intensity S of the abnormal state limits the injection amplitude of the abnormality;
[0027] From the exception injection pattern set M INTJ ={M DOS ,M STEP ,M MM ,M RAND ,M BIAS}Select the abnormal injection mode in turn, according to the total amount of abnormal simulation data N A Evenly divide the simulation time blocks and perform abnormal injection in the process of abnormal simulation of the digital twin model to obtain abnormal simulation data Then get complete process simulation data
[0028] Using digital twins to generate data without abnormal injection but with the same working conditions Maintain consistent normal simulation data
[0029] Set normal simulation data The corresponding data labels are set to where i∈[1,N train ]; Abnormal simulation data The corresponding label is set to a i AD =1, where i∈[N N ,N train], get the anomaly detection task label
[0030] Setting normal simulation data The abnormal location label is At this time, j∈[1,d], i∈[1,N N ];
[0031] For the abnormal location labels in the abnormal simulation data, calculate the absolute value deviation of the simulation data For process status x j , where j∈[1,d], the corresponding simulation data state deviation at time i is e ij , for the state where the state value deviates too much from the normal value range, such as when When the process status is considered abnormal, the abnormal location label is set. Otherwise, set it to Where τ∈(0,1) is the percentage deviation coefficient, i∈(N N , N train ], used to filter out abnormal process states affected by abnormal injection; obtain the abnormal location label of the data set
[0032] Furthermore, the multi-task learning anomaly localization model is constructed in the following manner:
[0033] Running data for the above training dataset Each process state x j Do normalization in and is the maximum and minimum value of the state in the data set, where j∈[1,d+e], corresponding to the maximum value in the normalized scale of each state in the input data of the joint training data set and minimum value
[0034] Construct a multi-task learning anomaly localization model. The network structure is as follows: a shared network is built based on Transformer. The output features of the shared network are passed to the subsequent anomaly detection and anomaly localization subtask networks. Both subtask networks are fully connected layer networks. The output layers of the anomaly detection subtask network and the anomaly localization subtask network both use a fully connected layer with Sigmoid as the activation function. The anomaly detection subtask network is used to predict the probability of anomalies in the current data, and the anomaly localization subtask network predicts the probability of anomalies in each process sampling state.
[0035] Set the binary cross entropy classification loss for the two subtask classifiers of the multi-task learning anomaly localization model, including the anomaly detection loss L ADand anomaly localization loss L AL :
[0036]
[0037] During training, the training losses of the two subtask networks are weighted:
[0038] L=λL AD +(1-λ)L AL
[0039] L is the total training loss, λ∈(0,1) is the loss weight;
[0040] After joint training, a multi-task learning anomaly localization model is obtained.
[0041] Furthermore, the online application of the anomaly location method is as follows:
[0042] For the online process data X collected at time t of the petrochemical plant t , first use the digital twin model to expand the state to obtain data
[0043] Process data Use normalized scale X max and X min Get normalized data
[0044] Will Input into the trained multi-task anomaly localization network for prediction to obtain the anomaly localization prediction result where p tj The model predicts the process state x at time t tj The probability of anomalies;
[0045] P t AL Medium tj >0.5, the corresponding state x tj Set alarm output when abnormality is detected p tj ≤0.5 Finally, the abnormal positioning alarm output of the process status is obtained
[0046] Another object of the present invention is to provide a petrochemical device anomaly positioning system based on digital twin multi-task learning, including:
[0047] A digital twin model building module is used to build a digital twin model based on the historical process operation data and control and process parameters of the target petrochemical unit using digital twin technology;
[0048] The analysis module is used to analyze the process production process of the petrochemical plant. It sets a simulated production process scenario that includes normal and abnormal operating conditions. Based on the digital twin model, it generates state-expanded petrochemical plant simulation process operation data in the set simulation scenario. It adds anomaly detection labels and anomaly location labels to the operation data, and constructs a multi-task joint training dataset based on the process simulation data and data labels.
[0049] The anomaly localization model construction module is used to build a multi-task learning anomaly localization model. The model's front-end shared network learns feature representations of the training data. The output of the front-end shared network is synchronously connected to the two sub-task classifier networks of anomaly detection and anomaly localization. The two sub-networks predict anomaly detection and anomaly localization results respectively. During the training process, the two sub-task networks are jointly trained.
[0050] The detection module is used in the online detection stage. It uses the digital twin model to expand the state of the process data of the petrochemical unit, and performs inference and prediction on the expanded state data based on the multi-task anomaly localization model. Combined with the prediction results of the anomaly localization subtask network, it obtains the alarm output of abnormal process state location.
[0051] Another object of the present invention is to provide a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the multi-task learning petrochemical device anomaly positioning method based on digital twins.
[0052] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to perform the steps of the multi-task learning petrochemical device anomaly positioning method based on digital twins.
[0053] Another object of the present invention is to provide an information data processing terminal, which is used to implement the multi-task learning petrochemical device anomaly positioning system based on digital twins.
[0054] In combination with the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solutions to be protected by the present invention are as follows:
[0055] First, before constructing an anomaly localization model based on multi-task learning, the present invention first combines digital twin simulation to generate a feature-expanded anomaly localization and anomaly detection multi-task joint learning dataset. The extended data features help to add additional petrochemical state temporal and spatial information to the data to improve the feature representation learning effect of the anomaly localization model; the label data generated by digital twin simulation helps to increase the label data available for training the anomaly localization model, avoids the anomaly localization model from overfitting to the existing label data, and solves the model's positioning ability for unknown and new anomalies when the label data is limited; at the same time, the present invention trains the anomaly localization task in parallel during the anomaly localization model training process, and by setting a weighted loss function for the two tasks of anomaly localization loss and anomaly detection, the knowledge learned in different task training is shared through the Transformer model, thereby improving the performance of the petrochemical device anomaly localization model.
[0056] Second, the technical solution of the present invention fills the technical gap in the industry at home and abroad:
[0057] The technical solution of the present invention breaks through the limitations of the existing technology and improves the accuracy of anomaly positioning through the digital twin model and the multi-task joint learning framework. Unlike traditional methods that rely on limited labeled data, this solution makes full use of the rich anomaly simulation data generated by digital twin technology, and at the same time enhances the expressiveness of the model under complex spatiotemporal features by generating extended features. This not only avoids the overfitting problem caused by insufficient labeled data, but also effectively improves the generalization ability of the model in new anomaly scenarios. In addition, the Transformer-based multi-task sharing mechanism introduced in this solution can share knowledge between anomaly positioning and detection tasks, further improving the overall performance of the model, thereby achieving accurate positioning of anomalies in petrochemical equipment, filling the gap in technology in the industry.
[0058] Third, the technical solution of this invention, based on digital twins and multi-task learning methods, achieves accurate detection and location of abnormal conditions in petrochemical plants, solving the technical difficulties existing in traditional methods for monitoring petrochemical plants and bringing significant technological progress, specifically in the following aspects:
[0059] 1. The introduction of digital twin models enables accurate working condition simulation
[0060] Traditional petrochemical plant monitoring usually relies on a single data source or simple threshold monitoring, which makes it difficult to accurately judge the abnormal status of the plant in a complex and changing process environment.
[0061] This invention uses digital twin technology to integrate historical data, control parameters, and process conditions of petrochemical plants to construct a realistic process operation model. This digital twin model accurately simulates both normal and abnormal plant conditions, generating state-expanded simulation data. This provides more comprehensive data for anomaly detection and location, significantly improving the simulation accuracy and judgment of the monitoring system.
[0062] 2. Multi-task learning method achieves simultaneous optimization of anomaly detection and localization
[0063] Traditional anomaly detection and localization are mostly single tasks, and the detection and localization steps are independent of each other, resulting in limited anomaly detection effects and low localization accuracy.
[0064] This paper adopts a multi-task learning approach, treating anomaly detection and localization as two related tasks. It simultaneously performs feature representation learning and task optimization via a shared front-end network. During training, by jointly optimizing the classifier networks for anomaly detection and localization, the model can simultaneously detect anomalies and accurately locate their source, achieving simultaneous optimization. This multi-task learning strategy not only improves detection accuracy, but also enhances the precision and real-time performance of anomaly localization.
[0065] 3. Labeling of simulated data enhances the adaptability and generalization ability of the model
[0066] Traditional anomaly monitoring systems usually rely on manually labeled data, which is not rich enough in data labels and has difficulty in dealing with complex anomaly patterns and changes in working conditions, resulting in poor model generalization ability.
[0067] This paper uses a digital twin model to generate simulated data covering various operating conditions. By adding anomaly detection and location labels to the simulated data, a multi-task joint training dataset is constructed. This labeled multi-task dataset enriches the model's training data, enabling it to maintain efficient anomaly detection and location capabilities even under complex operating conditions. This significantly enhances the model's adaptability and generalization capabilities, making it suitable for monitoring requirements across diverse petrochemical plants.
[0068] 4. Real-time extended status analysis improves the response speed of anomaly detection
[0069] Traditional petrochemical plant abnormality monitoring methods have a lag in the response speed of abnormality detection, making it difficult to detect and feedback abnormal conditions in a timely manner, affecting the safety of the plant.
[0070] During the online monitoring phase of this invention, real-time process data is fed into the digital twin model for state expansion. A multi-task learning model rapidly infers and predicts this expanded data, and the anomaly localization subtask network enables immediate location of abnormal conditions and generates alerts. Compared to traditional monitoring methods, this solution can capture abnormal changes in process conditions in real time with faster response speed and higher accuracy, providing operators with more timely warnings and reducing the likelihood of accidents.
[0071] 5. The reliability and security of industrial applications have been significantly improved
[0072] Traditional technologies for locating anomalies in petrochemical plants are limited by a single data source and monitoring method, resulting in low reliability and difficulty in ensuring the safe operation of complex production plants, which may lead to high economic losses and safety hazards.
[0073] This invention utilizes a digital twin model that fuses multi-source data and a precise multi-task learning model to achieve intelligent and automated anomaly detection and location in petrochemical plants. This solution not only significantly improves the accuracy of anomaly detection and location, but also enhances system reliability. It provides new technical support for plant monitoring and fault diagnosis in petrochemical companies, effectively reducing production risks and maintenance costs.
[0074] In summary, this invention achieves more efficient and accurate anomaly detection and location in the field of anomaly monitoring and location in petrochemical plants, representing a significant technological advancement. This solution can be widely applied in high-risk industrial sectors such as petrochemicals, chemicals, and oil refining, providing strong assurance for plant safety and production efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 This is a flow chart of the method for locating abnormalities in petrochemical equipment based on multi-task learning using digital twins provided by an embodiment of the present invention.
[0076] Figure 2 This is a structural block diagram of the petrochemical device anomaly positioning system based on digital twin multi-task learning provided by an embodiment of the present invention.
[0077] Figure 3 This is a flow chart of the main steps of the multi-task learning petrochemical device anomaly locating method based on digital twins provided by an embodiment of the present invention.
[0078] Figure 4 This is a schematic diagram of the steps for constructing a joint learning dataset for anomaly detection and localization tasks provided by an embodiment of the present invention.
[0079] Figure 5 This is a schematic diagram of the application process of the multi-task learning anomaly localization model provided by an embodiment of the present invention.
[0080] Figure 6It is a process and instrumentation diagram of an embodiment object of a fractionation unit in a catalytic cracking device provided by an embodiment of the present invention.
[0081] Figure 7 This is an abnormal data curve diagram under abnormal injection, in which abnormal data including FI4, PI1, FI6, FI2 and FI5 states is provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0082] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0083] The following are two specific embodiments of the present invention in the "Multi-task learning petrochemical device anomaly location method based on digital twins":
[0084] Example 1: Abnormal monitoring and location of cracking furnaces in a refinery
[0085] Application Scenario: Cracking furnaces are critical equipment in refineries, typically operating under high temperature and high pressure, subjecting them to heavy loads and making them prone to failure. Due to the complex reactions within cracking furnaces, process anomalies are difficult to quickly detect and accurately locate using traditional monitoring methods. Therefore, digital twin technology is being introduced for anomaly monitoring and location.
[0086] Implementation steps:
[0087] 1. Digital twin model construction: Using the historical operating data, temperature, pressure and other process parameters of the cracking furnace, a digital twin model of the cracking furnace is constructed, and this model is used to simulate the cracking furnace process.
[0088] 2. Dataset Generation: Set up a simulated production scenario that includes both normal and abnormal conditions. Generate process operation data for the cracking furnace under the digital twin model, and mark abnormal labels based on temperature fluctuations, pressure anomalies, and other conditions within the furnace to generate the training dataset required for multi-task learning.
[0089] 3. Multi-task learning model training: Data with anomaly detection and location labels is input into the multi-task learning model. Data features are extracted through the front-end shared network. The two sub-task networks of anomaly detection and anomaly location are trained separately to jointly improve the model's anomaly detection and location capabilities.
[0090] 4. Online Detection and Positioning: In actual monitoring, real-time process data is fed into the digital twin model for expansion, and the model then infers the expanded data. Once an anomaly is detected, such as unusual temperature or pressure fluctuations, the positioning network immediately outputs the specific anomaly location within the cracking furnace and an alarm message, enabling engineers to quickly take action.
[0091] This method realizes real-time monitoring of temperature and pressure anomalies in the cracking furnace and can accurately locate the source of the anomalies, avoiding production losses caused by long-term failure of the cracking furnace and ensuring the safe operation of the refinery.
[0092] Example 2: Fault Location and Early Warning of a Synthesis Tower in a Fertilizer Plant
[0093] In fertilizer production, ammonia synthesis towers operate under high temperature and pressure. Numerous chemical reactions occur within these towers, and any anomalies can lead to reduced production efficiency and even safety hazards. Traditional monitoring methods struggle to promptly identify and locate anomalies within these towers, so digital twins and multi-task learning methods are used for monitoring.
[0094] 1. Construction of digital twin model: Based on the historical operating data of the synthesis tower, and parameters such as temperature, pressure, and flow rate inside the tower, a digital twin model of the synthesis tower is established, which can simulate normal and abnormal operating conditions inside the tower.
[0095] 2. Dataset generation: By simulating different production scenarios, we generate data containing normal and abnormal operating conditions, such as rapid temperature rise and abnormal pressure fluctuations. We also label the abnormal conditions to generate a training dataset.
[0096] 3. Multi-task model training: The multi-task dataset is input into the front-end shared network of the model. Through the joint training of feature extraction, anomaly detection, and localization sub-networks, the accuracy of anomaly detection and the precision of localization are improved.
[0097] 4. Online Monitoring and Early Warning: Real-time process data is fed into the digital twin model. The model analyzes extended data to identify and locate abnormal process conditions within the synthesis tower. When an anomaly is detected, the model immediately issues an early warning, notifying the operator of the abnormal point within the tower so they can address it promptly.
[0098] This method realizes the real-time detection of abnormal conditions in the synthesis tower, can quickly locate abnormal areas in the tower, improves the emergency response speed of faults, and ensures the safety and stability of the fertilizer plant's production process.
[0099] like Figure 1 As shown, an embodiment of the present invention provides a multi-task learning method for locating abnormalities in a petrochemical device based on digital twins, comprising the following steps:
[0100] S101, using digital twin technology, builds a digital twin model based on the historical process operation data and control and process parameters of the target petrochemical unit;
[0101] S102, analyze the process of petrochemical equipment;
[0102] Set up a simulated production process scenario that includes normal and abnormal operating conditions. Based on the digital twin model, generate state-extended petrochemical unit simulation process operation data in the set simulation scenario. Add anomaly detection labels and anomaly location labels to the operation data. Construct a multi-task joint training dataset based on the process simulation data and data labels.
[0103] S103, building a multi-task learning anomaly localization model;
[0104] The model's front-end shared network learns feature representations for the training data. The output of the front-end shared network is synchronously connected to the two sub-task classifier networks of anomaly detection and anomaly localization. The two sub-networks predict anomaly detection and anomaly localization results respectively. During the training process, the two sub-task networks are jointly trained.
[0105] In S104, during the online detection phase, the digital twin model is used to expand the process data of the petrochemical unit. The expanded state data is inferred and predicted based on the multi-task anomaly location model. The prediction results of the anomaly location subtask network are combined to obtain the alarm output of the abnormal process state location.
[0106] Based on digital twin and multi-task learning technologies, this paper provides an effective method for locating anomalies in petrochemical plants. By simulating process flow and multi-task learning of data, the accuracy and real-time performance of anomaly detection and location are improved. The specific working principle is as follows:
[0107] 1. Digital twin model construction and data expansion
[0108] First, digital twin technology is used to construct a digital model of the target petrochemical unit. Based on the unit's historical process operating data, control parameters, and process parameters, a virtual "twin" is generated. This model can reflect and simulate the unit's process operating status in real time. This digital twin model enables detailed simulation of both normal and abnormal operating conditions. Next, simulated production scenarios encompassing both normal and abnormal operating conditions are set up to generate process operating data with anomaly labels. By adding anomaly detection and location labels to the simulated data, this provides the foundational data for the model's multi-task learning process.
[0109] 2. Construction of multi-task learning model
[0110] In multi-task learning, anomaly detection and anomaly localization are the two primary tasks. The model's front-end shared network is responsible for learning feature representations for the input data, extracting key features of the process operation and propagating them backward. The output of the shared network is connected to two subtask networks: anomaly detection and anomaly localization classifiers. The anomaly detection subnetwork is responsible for identifying abnormal conditions in process data, while the anomaly localization subnetwork focuses on determining the specific process location where the anomaly occurs. This front-end shared feature network allows the model to more effectively utilize data features during learning, while improving the accuracy of anomaly detection and localization.
[0111] 3. Multi-task joint training process
[0112] During the training phase, the model is trained using a pre-built multi-task joint dataset. The front-end shared network outputs synchronously to the two subtask networks, which undergo parameter optimization through joint training during the model training process. The anomaly detection subnetwork and the anomaly localization subnetwork receive anomaly detection and localization labels, respectively. Based on a common optimization objective, the prediction capabilities of both subtasks are continuously improved through alternating training and weight sharing. Joint training enables the model to simultaneously detect anomalies and localize them, achieving a dual optimization effect.
[0113] 4. Online detection and abnormal location output
[0114] During the online monitoring phase of practical applications, real-time process data from petrochemical units is fed into the digital twin model to generate extended status data, which is synchronized with the unit's operating status. A multi-task anomaly localization model performs real-time inference on the extended status data. Using the predictions from the anomaly detection and localization sub-networks, it rapidly identifies and locates abnormal process conditions. Once an anomaly is detected, the localization sub-task network outputs a warning signal indicating the location of the abnormal process, enabling real-time monitoring and accurate anomaly alert output.
[0115] The multi-task joint training dataset provided by the embodiment of the present invention is constructed in the following manner:
[0116] The digital twin model can simulate and predict the process measurement status X=[x1,x2,...,x d ], where x i is the characteristic data of the i-th sampling device, Based on the interrelationship between the sampling states in the petrochemical plant, the digital twin model can be used to predict and generate e additional extended process state data associated with the existing sampling states, such as the temperature, pressure, flow rate and other process states that have not been sampled on the petrochemical plant. Finally, the data X containing e+d process state extensions is obtained. E =[x1,x2,...,x d ,xd+1 ,...,x d+e ];
[0117] Use digital twin models to simulate and generate process simulation data for petrochemical plants under set normal and abnormal operating conditions It includes normal simulation data and abnormal simulation data; abnormal simulation data includes data with multiple process status abnormalities;
[0118] Add anomaly detection label A to the process data generated by digital twin model simulation AD With abnormal positioning label A AL ;
[0119] Anomaly detection tags in process simulation data tags Indicates whether the process data is abnormal, where N train is the number of training data, label data The value of 1 indicates that there is an anomaly in the process simulation data set, and 0 indicates that it is normal;
[0120] Abnormal location label in Indicates whether the j-th sampling state of the i-th data is abnormal. The value 1 indicates abnormality and 0 indicates normality.
[0121] The simulated running data is used as the input data for the subsequent multi-task anomaly localization model training process. The anomaly detection label and anomaly localization label are used as the training targets of the model to construct a multi-task joint training dataset containing two types of labels.
[0122] The method for generating process simulation data and data labels provided by an embodiment of the present invention includes the following steps:
[0123] Set the proportion of abnormal simulation data in process simulation data to P A ∈(0,1), the number of abnormal simulation data in the simulation data in Indicates rounding down, then the number of normal simulation data N N =N train -N A ;
[0124] Use digital twin models to N Generate normal process data by simulating the number of
[0125] Set the injection ratio P for abnormal process status I ∈(0,1], indicating that in the process of using the digital twin model to generate abnormal simulation data, there will be The process status of each petrochemical unit will be randomly selected and abnormal injection will be performed;
[0126] Abnormal injection modes include denial of service injection DOS , step injection M STEP , maximum and minimum injection M MM , randomly inject M RAND , bias injection M BIAS ; where M DOS This is achieved by simulating the failure of selected sensors and actuators in the petrochemical plant, and the process state values obtained by simulation remain fixed to those before failure; STEP Indicates that the corresponding process status value has been tampered with to the set value; M MM Indicates that the process state value will be randomly injected into its maximum or minimum value; M RAND The value indicating the process status will be tampered with to a random value within a certain range; M BIAS Indicates that the value of the tampering process status is added with an offset value based on the original value;
[0127] Among them, for the abnormal injection mode M STEP 、M RAND and M BIAS Setting the injection intensity S of the abnormal state limits the injection amplitude of the abnormality;
[0128] From the exception injection pattern set M INTJ ={M DOS ,M STEP ,M MM ,M RAND ,M BIAS}Select the abnormal injection mode in turn, according to the total amount of abnormal simulation data N A Evenly divide the simulation time blocks and perform abnormal injection in the process of abnormal simulation of the digital twin model to obtain abnormal simulation data Then get complete process simulation data
[0129] Using digital twins to generate data without abnormal injection but with the same working conditions Maintain consistent normal simulation data
[0130] Set normal simulation data The corresponding data labels are set to where i∈[1,N train ]; Abnormal simulation data The corresponding label is set to where i∈[N N ,N train ], get the anomaly detection task label
[0131] Setting normal simulation data The abnormal location label is At this time, j∈[1,d], i∈[1,N N ];
[0132] For the abnormal location labels in the abnormal simulation data, calculate the absolute value deviation of the simulation data For process status x j , where j∈[1,d], the corresponding simulation data state deviation at time i is e ij , for the state where the state value deviates too much from the normal value range, such as when When the process status is considered abnormal, the abnormal location label is set. Otherwise, set it to Where τ∈(0,1) is the percentage deviation coefficient, i∈(N N , N train ], used to filter out abnormal process states affected by abnormal injection; obtain the abnormal location label of the data set
[0133] The multi-task learning anomaly localization model provided by the embodiment of the present invention is constructed in the following manner:
[0134] Running data for the above training dataset Each process state x j Do normalization in and is the maximum and minimum value of the state in the data set, where j∈[1,d+e], corresponding to the maximum value of the normalized scale of each state in the input data of the joint training data set and minimum value
[0135] Construct a multi-task learning anomaly localization model. The network structure is as follows: a shared network is built based on Transformer. The output features of the shared network are passed to the subsequent anomaly detection and anomaly localization subtask networks. Both subtask networks are fully connected layer networks. The output layers of the anomaly detection subtask network and the anomaly localization subtask network both use a fully connected layer with Sigmoid as the activation function. The anomaly detection subtask network is used to predict the probability of anomalies in the current data, and the anomaly localization subtask network predicts the probability of anomalies in each process sampling state.
[0136] Set the binary cross entropy classification loss for the two subtask classifiers of the multi-task learning anomaly localization model, including the anomaly detection loss L AD and anomaly localization loss LAL :
[0137]
[0138] During training, the training losses of the two subtask networks are weighted:
[0139] L=λL AD +(1-λ)L AL
[0140] L is the total training loss, λ∈(0,1) is the loss weight;
[0141] After joint training, a multi-task learning anomaly localization model is obtained.
[0142] The online application of the anomaly location method provided by the embodiment of the present invention is as follows:
[0143] For the online process data X collected at time t of the petrochemical plant t First, the state is expanded through the digital twin model to obtain data
[0144] Process data Use normalized scale X max and X min Get normalized data
[0145] Will Input into the trained multi-task anomaly localization network for prediction to obtain the anomaly localization prediction result where p tj The model predicts the process state x at time t tj The probability of anomalies;
[0146] P t AL Medium tj >0.5, the corresponding state x tj Set alarm output when abnormality is detected p tj ≤0.5 Finally, the abnormal positioning alarm output of the process status is obtained
[0147] like Figure 2 As shown, an embodiment of the present invention provides a multi-task learning petrochemical device anomaly positioning system based on digital twins, including:
[0148] A digital twin model building module is used to build a digital twin model based on the historical process operation data and control and process parameters of the target petrochemical unit using digital twin technology;
[0149] The analysis module is used to analyze the process production process of the petrochemical plant. It sets a simulated production process scenario that includes normal and abnormal operating conditions. Based on the digital twin model, it generates state-expanded petrochemical plant simulation process operation data in the set simulation scenario. It adds anomaly detection labels and anomaly location labels to the operation data, and constructs a multi-task joint training dataset based on the process simulation data and data labels.
[0150] The anomaly localization model construction module is used to build a multi-task learning anomaly localization model. The model's front-end shared network learns feature representations of the training data. The output of the front-end shared network is synchronously connected to the two sub-task classifier networks of anomaly detection and anomaly localization. The two sub-networks predict anomaly detection and anomaly localization results respectively. During the training process, the two sub-task networks are jointly trained.
[0151] The detection module is used in the online detection stage. It uses the digital twin model to expand the state of the process data of the petrochemical unit, and performs inference and prediction on the expanded state data based on the multi-task anomaly localization model. Combined with the prediction results of the anomaly localization subtask network, it obtains the alarm output of abnormal process state location.
[0152] Another object of the present invention is to provide a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the multi-task learning petrochemical device anomaly positioning method based on digital twins.
[0153] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to perform the steps of the multi-task learning petrochemical device anomaly positioning method based on digital twins.
[0154] Another object of the present invention is to provide an information data processing terminal, which is used to implement the multi-task learning petrochemical device anomaly positioning system based on digital twins.
[0155] The present invention is specifically implemented:
[0156] Example 1
[0157] Figure 3 This is a flow chart of a multi-task learning petrochemical device anomaly location method based on digital twins in the present invention. Figure 3 Shown, including:
[0158] Using digital twin technology, a digital twin model is constructed based on the historical process operation data, control and process parameters of the target petrochemical unit;
[0159] Analyze the process production process of petrochemical plants, set up simulated production process scenarios that include normal and abnormal operating conditions, generate state-extended petrochemical plant simulated process operation data in the set simulation scenarios based on the digital twin model, add anomaly detection labels and anomaly location labels to the operation data, and construct a multi-task joint training dataset based on the operation data and data labels;
[0160] A multi-task learning anomaly localization model is constructed. The model's front-end shared network learns feature representations for the training data. The output of the front-end shared network is synchronously connected to the two sub-task classifier networks of anomaly detection and anomaly localization. The two sub-networks predict anomaly detection and anomaly localization results, respectively. During the training process, the two sub-task networks are jointly trained.
[0161] During the online detection phase, a digital twin model is used to expand the state of the process data of the petrochemical unit. The expanded data is inferred and predicted based on the multi-task anomaly localization model, and the alarm output of abnormal state localization is obtained by combining the prediction results of the anomaly localization subtask network.
[0162] As a preferred implementation method, the digital twin model of the petrochemical plant is constructed as follows:
[0163] The historical process operation data of the petrochemical plant primarily includes controller settings, actuator status, and sensor process status sampling data that reflect the plant's operating status. This data can be collected from the target petrochemical plant's DCS or other systems connected to sensors and actuators, or acquired from the plant's corresponding historical database. The control and process parameters encompass both petrochemical plant control behavior parameters and process parameters. Control behavior parameters can reflect the control logic and mode parameters of the petrochemical plant's DCS or other control system, such as the plant's production control logic parameters, the algorithms and parameters used by the controller, and so on. Process parameters can be parameters related to process equipment and mechanisms, such as the structure and dimensions of the plant's process equipment, the physical and chemical properties of the produced materials, and the parameters characteristic of the working environment during the production process. The acquired historical process data can be combined with the petrochemical plant's control and process parameters to establish a digital twin model that maps the petrochemical plant's virtual and real world.
[0164] As a preferred implementation method, the schematic diagram of the steps for constructing the joint learning dataset for anomaly detection and localization tasks is as follows: Figure 4 As shown, and combined with Figure 6 The fractionation unit in the catalytic cracking unit of the petrochemical plant is shown as an example object for explanation. The data set is constructed as follows:
[0165] The digital twin model can simulate and predict the process measurement status X = [x1, x2, ..., x d ], including the status of sensors (temperature, pressure, liquid level and flow) and actuators (valves) used in the control loops of the distillation tower, oil-gas separator and pipeline in the diversion unit of the catalytic cracking unit, as well as the status of other sensors used to monitor the distillation tower and pipeline.
[0166] Based on the interrelationship between process states in the diversion unit, the digital twin model is used to generate e = 8 extended state data associated with the existing sampling states. The existing sampling states are supplemented by the temperature (TI6, TI7, TI8), pressure (PI4), and liquid level (LI4) of different trays on the distillation tower that have not yet been sampled, the flow rate of oil and gas output from the top of the distillation tower (FI7), and the temperature (TI5) and pressure (PI3) of the oil and gas separator. The data X containing e + d = 26 process states is obtained. E =[x1,x2,...,x 26 ] to expand the spatial state information in the process data and provide a richer process data foundation for the subsequent multi-task learning anomaly localization model;
[0167] Use the digital twin model to simulate and generate process simulation data of the distillation unit under set normal and abnormal operating conditions It includes normal simulation data and abnormal simulation data. The abnormal simulation data includes data with multiple process status abnormalities.
[0168] Add anomaly detection label A to the process data generated by digital twin model simulation AD With abnormal positioning label A AL ;
[0169] Anomaly detection tags in process simulation data tags Indicates whether the process data is abnormal, where N train =10000 is the number of training data, label data The value of 1 indicates that there is an anomaly in the process simulation data set, and 0 indicates that it is normal;
[0170] Abnormal location label in Indicates whether the j-th sampling state of the i-th data is abnormal. The value 1 indicates abnormality and 0 indicates normality.
[0171] The simulated running data is used as the input data for the subsequent multi-task anomaly localization model training. The anomaly detection label and anomaly localization label are used as the training targets of the model to construct a multi-task joint training dataset containing two types of labels.
[0172] The method for generating the simulation operation data and data labels is constructed in the following manner:
[0173] Set the proportion of abnormal simulation data in process simulation data to P A =0.2, the number of abnormal simulation data in the simulation data in Indicates rounding down, then the number of normal simulation data N N =N train -N A =8000;
[0174] Use digital twin models to N The normal process simulation data is obtained by numerical simulation
[0175] Set the injection ratio P for abnormal process status I =0.2, which means that in the process of using the digital twin model to generate abnormal simulation data, there will be Each process state will be randomly selected and anomaly injected;
[0176] Abnormal injection modes include denial of service injection DOS , step injection M STEP , maximum and minimum injection M MM , randomly inject M RAND , bias injection M BIAS ; where M DOS This is achieved by simulating the failure of selected sensors and actuators in the petrochemical plant, and the process state values obtained by simulation remain fixed to those before failure; STEP Indicates that the corresponding process status value has been tampered with to the set value; M MM Indicates that the process state value will be randomly injected into its maximum or minimum value; M RAND The value indicating the process status will be tampered with to a random value within a certain range; M BIAS Indicates that the value of the tampering process status is added with an offset value based on the original value;
[0177] Among them, for the abnormal injection mode M STEP 、M RAND and M BIAS Set the injection intensity S=0.3 in the abnormal state to limit the abnormal injection amplitude;
[0178] From the exception injection pattern set M INTJ ={M DOS ,M STEP ,M MM ,MRAND ,M BIAS}Select the abnormal injection mode in turn, according to the total amount of abnormal simulation data N A , each mode is divided into 400 simulation data segments, and anomalies are injected into the digital twin model during the anomaly simulation process to obtain abnormal simulation data Then get complete process simulation data
[0179] Using digital twins to generate data without abnormal injection but with the same working conditions Maintain consistent normal simulation data
[0180] Set normal simulation data The corresponding data labels are set to Where i∈[1,8000]; abnormal simulation data The corresponding label is set to Where i∈[8001,10000], get the anomaly detection task label
[0181] Setting normal simulation data The abnormal location label is At this time, j∈[1,18], i∈[1,8000];
[0182] For abnormal positioning labels in abnormal simulation data, the simulation deviation is calculated For process status x j , where j∈[1,18], for states where the state value deviates too much from the normal value range, such as when When the process status is considered abnormal, the abnormal location label is set. Otherwise, set Where τ = 0.05 is the percentage deviation coefficient, i∈[8001,10000], which is used to filter out abnormal process states affected by abnormal injection; obtain the abnormal location label of the data set
[0183] The schematic diagram of the multi-task learning anomaly localization model construction process is as follows: Figure 5 The following method is used to construct:
[0184] Running data for the above joint training dataset Each process state x j Do normalization in and is the maximum and minimum value of the state in the data set, where j∈[1,26], corresponding to the state normalization scale of the input data set and
[0185] To better extract data features from the data, the Transformer used in the shared task network uses a self-attention mechanism to effectively capture long-range dependencies between different positions in the input sequence, compared to traditional deep neural networks or convolutional neural networks. This approach enables the Transformer to excel in processing long-sequence data and natural language processing tasks. It not only processes data in parallel and improves computational efficiency, but also more accurately extracts contextual information, thereby providing more powerful feature representation capabilities for subsequent subtask learning networks and improving the performance of multi-task joint learning.
[0186] Construct a multi-task learning anomaly localization model. The network structure is to build a shared network based on Transformer. The shared network setting includes 2 Transformer network layers, each layer contains 4 multi-head attentions, and each layer of Transformer network feedforward neural network contains 64 neurons. The final output features are passed to the subsequent anomaly detection and anomaly localization subtask networks. The middle layer of the two subtask networks contains 2 layers of fully connected layer networks. Each fully connected network layer includes 64 neurons. The output layers of the anomaly detection and anomaly localization subtask networks are both fully connected layers with Sigmoid as the activation function. The output layer dimension of the anomaly detection subtask is 1, and the output layer dimension of the anomaly localization subtask network is 18. The anomaly detection subtask network is used to predict the probability of anomalies in the current data, and the anomaly localization subtask network predicts the probability of anomalies in each process sampling state.
[0187] Set the binary cross entropy classification loss L for the two subtask classifiers of the multi-task learning anomaly localization model AD and L AL :
[0188]
[0189] During training, the training losses of the two subtask networks are weighted:
[0190] L=λL AD +(1-λ)L AL
[0191] L is the total training loss, set to loss weight λ = 0.3, and the training loss is tilted towards the anomaly localization task;
[0192] After joint training, a multi-task learning anomaly localization model is obtained.
[0193] The method of using the digital twin-based multi-task learning anomaly localization model for online process anomaly localization is as follows:
[0194] For the online process data X collected at time t of the petrochemical plant t First, the state is expanded through the digital twin model to obtain data
[0195] Process data Use normalized scale X max and X min Get normalized data
[0196] Will Input into the trained multi-task anomaly localization network for prediction to obtain the anomaly localization prediction result where p tj Predict the process state x for the model tj The probability of anomalies;
[0197] P t AL Medium tj >0.5, the corresponding state x tj Set alarm output when abnormality is detected p tj ≤0.5 Finally, the abnormal positioning alarm output of the process status is obtained
[0198] The digital twin-based multi-task learning method for petrochemical plant anomaly localization proposed in this embodiment overcomes the anomaly localization method's reliance on label data for petrochemical plant anomaly localization. By utilizing digital twin model simulation to generate a multi-task joint learning label dataset encompassing anomaly detection and anomaly localization, the extended features generated by digital twin simulations are used to increase the correlation information in the data, improving anomaly localization performance. Because anomalies in petrochemical plants are accompanied by abnormal states, multi-task learning allows the anomaly detection task and the anomaly localization task to be jointly learned. By sharing the parameters and knowledge learned by the two tasks through a shared network layer, the ability to identify process anomaly data is enhanced, and the training effect of the anomaly localization task is strengthened, thereby helping to improve the accuracy of anomaly localization.
[0199] In general, the present invention provides a multi-task learning method for abnormality localization of petrochemical plants based on digital twins. First, a digital twin model of the petrochemical plant is constructed, and normal and abnormal operation data with feature expansion are simulated and generated based on the digital twin model to construct a multi-task joint data set with labels for abnormality detection and abnormality localization; a multi-task learning abnormality localization model is constructed, and the front-end shared network of the model performs feature learning. Subsequently, the two sub-task networks are connected to output abnormality detection and abnormality localization results respectively, and the two tasks are jointly trained using the cross-entropy classification loss function; finally, the abnormality localization sub-task output in the multi-task model is used to perform online abnormal state localization of the process data of the petrochemical plant.
[0200] 1. Specific application fields or related products of the present invention.
[0201] This invention belongs to the field of information security protection technology for petrochemical industrial systems and is applicable to intrusion detection systems or attack detection equipment for petrochemical plants. It is used to monitor the operating status of petrochemical plants, locate abnormal conditions, and provide alarm information to operators and security protection mechanisms.
[0202] 2. Relevant evidence of the technical effects obtained by the embodiments of the present invention.
[0203] The dataset used in this example is simulation data from an open-source petroleum catalytic cracking agent fractionation unit simulation model. The original training data consists of 8,000 sets of data, including 6,000 sets of simulation data under fully normal operation and 2,000 sets of simulation data with abnormal conditions. The test data consists of 2,000 sets of data, including 1,000 sets of normal data and 1,000 sets of data with abnormal conditions.
[0204] In order to generate an additional 2,000 sets of abnormal simulation data based on the digital twin model, the digital twin model is derived from the modification of the petrochemical simulation model parameters, including the parameters of the proportional-integral controller, the physical properties of the components, the tower plate pressure calculation parameters, etc., to simulate the deviation of the digital twin modeling and construct a model that differs from the original simulation model.
[0205] Then, digital twin modeling simulation is combined to generate label abnormal data, and the abnormal simulation pattern set M INTJ ={M DOS ,M STEP ,M MM ,M RAND ,M BIAS} in turn according to the selected abnormal injection mode, inject into Figure 6 The simulation experiment object shown generates labeled abnormal data, such as Figure 7The abnormal data curves of FI4, PI1, FI6, FI2 and FI5 states under abnormal injection are displayed, which show obvious abnormal data patterns corresponding to the original normal data, thus obtaining 2000 sets of simulated data and corresponding data labels.
[0206] In order to evaluate the performance of the anomaly localization model designed in the present invention, decision tree (DT), deep neural network (DNN), convolutional neural network (CNN), and Transformer (TRAN) were selected as experimental comparison models. In order to analyze the effects of digital twin anomaly simulation and multi-task learning, the anomaly localization performance of the Transformer (E-TRAN) with expanded input data features, the model AS-TRAN with additional training of 2000 anomaly simulation data under feature expansion, the multi-task learning model MT-TRAN, and the model ASMT-TRAN that combines anomaly simulation data expansion and multi-task learning were evaluated.
[0207] To measure the performance of each anomaly localization model for abnormal conditions, we use common indicators for binary classification problems, including accuracy, false alarm rate (FAR), precision, recall, and F1 score.
[0208] The anomaly localization performance of each experimental comparison model is shown in Table 1.
[0209] Table 1 Anomaly location indicators of each test model
[0210] Model Accuracy FAR Precision Recall F1score DNN 0.9167 0.5000 0.5000 0.3333 0.4000 CNN 0.9167 0.0606 0.5000 0.6667 0.5714 LSTM 0.9332 0.0534 0.5723 0.7860 0.6624 GCN 0.9616 0.0000 1.0000 0.5387 0.7002 TRAN 0.9593 0.0427 0.6762 0.9810 0.8006 ETRAN 0.9734 0.0095 0.8821 0.7853 0.8309 AS-TRAN 0.9751 0.0115 0.8672 0.8273 0.8468 MT-TRAN 0.9825 0.0165 0.8429 0.9713 0.9026 ASMT-TRAN 0.9913 0.0095 0.9058 1.0000 0.9506
[0211] Through the abnormal positioning experimental indicators in the table, from the overall positioning effect, the method designed by the present invention has higher positioning accuracy than other methods, and the additional abnormal simulation data and multi-task
[0212] Acc:0.9593,FAR:0.0427,PRE:0.6762,REC:0.9810,F1:0.8006.
[0213] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware portion can be implemented using dedicated logic; the software portion can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. Those skilled in the art will appreciate that the above-mentioned devices and methods can be implemented using computer-executable instructions and / or contained in processor control code, for example, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The devices and modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, or can be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.
[0214] The above description is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with this technical field within the technical scope disclosed by the present invention and within the spirit and principles of the present invention should be covered by the scope of protection of the present invention.
Claims
1. A multi-task learning method for abnormal location of petrochemical equipment based on digital twins, characterized by: The following steps are involved: Step 1: Using digital twin technology, a digital twin model is constructed based on the historical process operation data and control and process parameters of the target petrochemical unit. Step 2: Analyze the production process of the petrochemical plant; Set up a simulated production process scenario that includes normal and abnormal operating conditions. Based on the digital twin model, generate state-extended petrochemical unit simulation process operation data in the set simulation scenario. Add anomaly detection labels and anomaly location labels to the operation data. Construct a multi-task joint training dataset based on the process simulation data and data labels. Step 3: Build a multi-task learning anomaly localization model; The model's front-end shared network learns feature representations for the training data. The output of the front-end shared network is synchronously connected to the two sub-task classifier networks of anomaly detection and anomaly localization. The two sub-networks predict anomaly detection and anomaly localization results respectively. During the training process, the two sub-task networks are jointly trained. Step 4: During the online detection phase, the digital twin model is used to expand the process data of the petrochemical unit. The expanded state data is then inferred and predicted based on the multi-task anomaly localization model. The prediction results of the anomaly localization subtask network are combined to generate an alarm output indicating the location of the abnormal process state. The multi-task joint training dataset is constructed in the following way: The digital twin model can simulate and predict the process measurement status X=[x1,x2,...,x d ], where x i is the characteristic data of the i-th sampling device, Based on the interrelationship between the sampling states in the petrochemical plant, the digital twin model can be used to predict and generate e additional extended process state data associated with the existing sampling states, such as the temperature, pressure, flow rate and other process states that have not been sampled on the petrochemical plant. Finally, the data X containing e+d process state extensions is obtained. E =[x1,x2,...,x d ,x d+1 ,...,x d+e ]; Use digital twin models to simulate and generate process simulation data for petrochemical plants under set normal and abnormal operating conditions It includes normal simulation data and abnormal simulation data; abnormal simulation data includes data with multiple process status abnormalities; Add anomaly detection label A to the process data generated by digital twin model simulation AD With abnormal positioning label A AL ; Anomaly detection tags in process simulation data tags Indicates whether the process data is abnormal, where N train is the number of training data, label data The value of 1 indicates that there is an anomaly in the process simulation data set, and 0 indicates that it is normal; Abnormal location label in Indicates whether the j-th sampling state of the i-th data is abnormal. The value 1 indicates abnormality and 0 indicates normality. The simulated running data is used as the input data for the subsequent multi-task anomaly localization model training process. The anomaly detection label and anomaly localization label are used as the training targets of the model to construct a multi-task joint training dataset containing two types of labels. The method for generating process simulation data and data labels includes the following steps: Set the proportion of abnormal simulation data in process simulation data to P A ∈(0,1), the number of abnormal simulation data in the simulation data in Indicates rounding down, then the number of normal simulation data N N =N train -N A ; Use digital twin models to N Generate normal process data by simulating the number of Set the injection ratio P for abnormal process status I ∈(0,1], indicating that in the process of using the digital twin model to generate abnormal simulation data, there will be The process status of each petrochemical unit will be randomly selected and abnormal injection will be performed; Abnormal injection modes include denial of service injection DOS , step injection M STEP , maximum and minimum injection M MM , randomly inject M RAND , bias injection M BIAS ; where M DOS This is achieved by simulating the failure of selected sensors and actuators in the petrochemical plant, and the process state values obtained by simulation remain fixed to those before failure; STEP Indicates that the corresponding process status value has been tampered with to the set value; M MM Indicates that the process state value will be randomly injected into its maximum or minimum value; M RAND The value indicating the process status will be tampered with to a random value within a certain range; M BIAS Indicates that the value of the tampering process status is added with an offset value based on the original value; Among them, for the abnormal injection mode M STEP 、M RAND and M BIAS Setting the injection intensity S of the abnormal state limits the injection amplitude of the abnormality; From the exception injection pattern set M INTJ ={M DOS ,M STEP ,M MM ,M RAND ,M BIAS }Select the abnormal injection mode in turn, according to the total amount of abnormal simulation data N A Evenly divide the simulation time blocks and perform abnormal injection in the process of abnormal simulation of the digital twin model to obtain abnormal simulation data Then get complete process simulation data Using digital twins to generate data without abnormal injection but with the same working conditions Maintain consistent normal simulation data Set normal simulation data The corresponding data labels are set to where i∈[1,N train ]; Abnormal simulation data The corresponding label is set to where i∈[N N ,N train ], get the anomaly detection task label Setting normal simulation data The abnormal location label is At this time, j∈[1,d], i∈[1,N N ]; For the abnormal location labels in the abnormal simulation data, calculate the absolute value deviation of the simulation data For process status x j , where j∈[1,d], the corresponding simulation data state deviation at time i is e ij , for the state where the state value deviates too much from the normal value range, such as when When the process status is considered abnormal, the abnormal location label is set. Otherwise, set it to Where τ∈(0,1) is the percentage deviation coefficient, i∈(N N , N train ], used to filter out abnormal process states affected by abnormal injection; obtain the abnormal location label of the data set 2. The method for locating abnormalities in a petrochemical plant based on multi-task learning of digital twins according to claim 1 is characterized in that: The multi-task learning anomaly localization model is constructed as follows: Running data for the above training dataset Each process state x j Do normalization in and is the maximum and minimum value of the state in the data set, where j∈[1,d+e], corresponding to the maximum value in the normalized scale of each state in the input data of the joint training data set and minimum value Construct a multi-task learning anomaly localization model. The network structure is as follows: a shared network is built based on Transformer. The output features of the shared network are passed to the subsequent anomaly detection and anomaly localization subtask networks. Both subtask networks are fully connected layer networks. The output layers of the anomaly detection subtask network and the anomaly localization subtask network both use a fully connected layer with Sigmoid as the activation function. The anomaly detection subtask network is used to predict the probability of anomalies in the current data, and the anomaly localization subtask network predicts the probability of anomalies in each process sampling state. Set the binary cross entropy classification loss for the two subtask classifiers of the multi-task learning anomaly localization model, including the anomaly detection loss L AD and anomaly localization loss L AL : During training, the training losses of the two subtask networks are weighted: L=λL AD +(1-λ)L AL L is the total training loss, λ∈(0,1) is the loss weight; After joint training, a multi-task learning anomaly localization model is obtained.
3. The method for locating abnormalities in a petrochemical plant based on multi-task learning using digital twins according to claim 1 is characterized in that: The online application of the anomaly location method is as follows: For the online process data X collected at time t of the petrochemical plant t , first use the digital twin model to expand the state to obtain data Process data Use normalized scale X max and X min Get normalized data Will Input into the trained multi-task anomaly localization network for prediction to obtain the anomaly localization prediction result where p tj The model predicts the process state x at time t tj The probability of anomalies; P t AL Medium tj >0.5, the corresponding state x tj Set alarm output when abnormality is detected p tj ≤0.5 Finally, the abnormal positioning alarm output of the process status is obtained 4. A digital twin-based multi-task learning petrochemical device anomaly location system implementing the digital twin-based multi-task learning petrochemical device anomaly location method according to any one of claims 1 to 3, characterized in that: The digital twin-based multi-task learning petrochemical device anomaly positioning system includes: A digital twin model building module is used to build a digital twin model based on the historical process operation data and control and process parameters of the target petrochemical unit using digital twin technology; The analysis module is used to analyze the process production process of the petrochemical plant. It sets a simulated production process scenario that includes normal and abnormal operating conditions. Based on the digital twin model, it generates state-expanded petrochemical plant simulation process operation data in the set simulation scenario. It adds anomaly detection labels and anomaly location labels to the operation data, and constructs a multi-task joint training dataset based on the process simulation data and data labels. The anomaly localization model construction module is used to build a multi-task learning anomaly localization model. The model's front-end shared network learns feature representations of the training data. The output of the front-end shared network is synchronously connected to the two sub-task classifier networks of anomaly detection and anomaly localization. The two sub-networks predict anomaly detection and anomaly localization results respectively. During the training process, the two sub-task networks are jointly trained. The detection module is used in the online detection stage. It uses the digital twin model to expand the state of the process data of the petrochemical unit, and performs inference and prediction on the expanded state data based on the multi-task anomaly localization model. Combined with the prediction results of the anomaly localization subtask network, it obtains the alarm output of abnormal process state location.
5. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the multi-task learning petrochemical device anomaly positioning method based on digital twins as described in any one of claims 1 to 3.
6. A computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the steps of the multi-task learning petrochemical device anomaly positioning method based on digital twins as described in any one of claims 1 to 3.
7. An information data processing terminal, characterized in that: The information data processing terminal is used to implement the multi-task learning petrochemical device anomaly positioning system based on digital twins as described in claim 4.
Citation Information
Patent Citations
Method for constructing anomaly detection model of industrial control system in process industry based on digital twinning
CN118068765A