Petroleum chemical accident traceability and decision method and device
By combining IoT data collection, deep learning, and reinforcement learning, rapid source tracing and decision-making for petrochemical accidents have been achieved, solving the problems of slow response speed and low analysis accuracy in existing technologies, and improving emergency response capabilities and production safety.
Patent Information
- Application Number
- CN202511233632.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-01
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2045-09-01
AI Technical Summary
Existing methods for analyzing and responding to petrochemical accidents suffer from slow response times, low analytical accuracy, and information lag, making it difficult to provide optimal emergency response measures and impacting emergency response capabilities and production safety.
By acquiring multi-source data through the Industrial Internet of Things, anomaly detection is performed using the Z-score algorithm and the Isolation Forest algorithm. Deep learning and reinforcement learning are then combined to conduct accident tracing and decision-making, generate emergency strategies, and execute emergency responses.
It has improved the efficiency and accuracy of accident tracing and decision-making, ensured timely and effective emergency response, and enhanced the emergency response capabilities and production safety of the petrochemical industry.
Smart Images

Figure CN120725476B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of petrochemical industry and safety management, and particularly relates to a petrochemical industry accident traceability and decision-making method and device. BACKGROUND
[0002] In the petrochemical industry, it is crucial to quickly trace the cause of an accident and make scientific emergency decisions. Due to the complexity and high risk of the production process in this industry, once an accident occurs, it will not only cause serious property losses, but also threaten the safety of workers. Traditional accident analysis and emergency decision-making methods rely on manual experience and traditional data mining techniques, which can provide some support, but have problems such as slow response speed, low analysis accuracy, and information lag.
[0003] Therefore, due to the defects in response speed, analysis accuracy, and timeliness of information transmission and reception of the existing accident analysis and emergency decision-making methods, it is difficult to provide the best emergency response measures, and it is difficult to ensure timely and effective decision-making, so the emergency response capability of the petrochemical industry in the face of accidents and the production safety need to be further improved. SUMMARY
[0004] Therefore, it is necessary to provide a petrochemical industry accident traceability and decision-making method and device that can improve the emergency response capability of the petrochemical industry in the face of accidents and the production safety.
[0005] The present application provides a petrochemical industry accident traceability and decision-making method, which comprises:
[0006] Obtain multi-source data of a petrochemical production device through an industrial Internet of Things or a local area network, and preprocess the multi-source data;
[0007] Perform anomaly detection on the preprocessed multi-source data using a Z-score algorithm and an isolation forest algorithm to obtain an anomaly label, and trigger an accident traceability and emergency decision-making instruction based on the anomaly label;
[0008] Vectorize historical accident data in the multi-source data, and perform similarity matching between a current accident feature vector and a historical accident feature vector in response to the accident traceability and emergency decision-making instruction to obtain a historical case with the highest similarity;
[0009] Call a pre-trained generation model to process the context of the current accident and the historical case to generate a traceability report result for the current accident;
[0010] Analyze the traceability report result and real-time multi-source data through reinforcement learning to generate an emergency strategy, and execute an emergency response according to the emergency strategy;
[0011] The multi-source data is collected in the form of a time series data stream, including device operation parameters, device state information, environmental parameters, and historical accident data, the preprocessing includes cleaning, denoising, interpolation, and normalization processing, the emergency response includes emergency shutdown, alarm signals, and personnel evacuation signals, and the generation model is a deep learning model based on natural language processing.
[0012] In one of the embodiments, the multi-source data of the petrochemical production device is obtained through the industrial Internet of Things or the local area network, and the multi-source data is preprocessed, including:
[0013] Linear interpolation or average algorithm based on sliding window is used for missing value filling, and sliding average or band pass filtering is performed on the data with a sampling frequency exceeding a first threshold, to denoise the multi-source data.
[0014] The multi-source data is normalized by maximum-minimum normalization, and standardized based on the mean and standard deviation of the samples in the multi-source data.
[0015] In one of the embodiments, the Z-score algorithm and the isolation forest algorithm are used for anomaly detection on the preprocessed multi-source data, to obtain an anomaly label, and the anomaly label is used to trigger accident tracing and emergency decision instructions, including:
[0016] The Z-score value of the preprocessed multi-source data is calculated, and when the absolute value of the Z-score value exceeds an adjustable coefficient, the corresponding data is determined as an abnormal value.
[0017] The isolation forest algorithm is used for scoring on the preprocessed multi-source data, and a logical judgment is made based on the Z-score value and the scoring result, to obtain the anomaly label.
[0018] The calculation formula of the Z-score value is:
[0019]
[0020] In the formula, and are the mean and standard deviation of the samples in the multi-source data, is the preprocessed sample data, is the Z-score value.
[0021] The scoring formula of the isolation forest algorithm is:
[0022]
[0023] In the formula, The score result of the sample data The score result of the sample data The average path length in the isolated forest The number of samples The average path length in the complete binary tree The adjustable coefficient for controlling the amplification or reduction of the abnormal amplitude
[0024] In one of the embodiments, the historical accident data in the multi-source data is represented by a vector, and the current accident feature vector is similarity matched with the historical accident feature vector in response to the accident tracing and emergency decision instruction to obtain the most similar historical case, including:
[0025] The current accident is converted into the current accident feature vector, and the similarity between the current accident feature vector and the historical accident feature vector is measured by cosine similarity, and the expression of the similarity measurement is:
[0026]
[0027] In the formula, The current accident feature vector is The historical accident feature vector is The similarity is
[0028] In one of the embodiments, the pre-trained generation model is called to process the context of the current accident and the historical case to generate a tracing report result for the current accident, including:
[0029] The context of the current accident and the most similar historical case are taken together as the input of the pre-trained generation model to call the generation model to generate the tracing report result according to the text data of the current accident and the historical case;
[0030] An adjustable coefficient is introduced in the tracing report result to balance the dependence of the tracing report result on the historical case;
[0031] The tracing report result includes the cause of the current accident, the involved equipment and components, and the solution and solution suggestion of the historical case.
[0032] In one of the embodiments, the tracing report result and real-time multi-source data are analyzed by reinforcement learning to generate an emergency strategy, and the emergency response is performed according to the emergency strategy, including:
[0033] On the basis of the Q-learning formula, a first adjustment coefficient is introduced to the immediate reward to construct a Q-learning algorithm in reinforcement learning for updating the state-action value function and optimizing the emergency strategy through learning historical case experience, and the expression is:
[0034]
[0035] In the formula, Q(s,a) is the Q value of the current state and action , is the learning rate, is the immediate reward of the current accident, is the first adjustment coefficient, is the discount factor, is the maximum Q value in all possible actions in the next state , is the next state, indicating the new state transferred after performing the action .
[0036] In one embodiment, the analysis of the traceability report result and real-time multi-source data through reinforcement learning to generate an emergency strategy and the execution of the emergency response according to the emergency strategy further includes:
[0037] A second adjustment coefficient is introduced in the state transition probability, and interpolation is performed between the original state transition probability and the real-time observation probability to dynamically adjust the state transition probability according to real-time data and historical data, and the expression is:
[0038]
[0039] In the formula, P(s'|s,a) is the probability of the next state caused by the current state and action , is the second adjustment coefficient, is the state transition probability calculated from real-time data.
[0040] The present application also provides a petroleum chemical accident traceability and decision device, the device comprises:
[0041] A data preprocessing module is used to acquire multi-source data of a petroleum chemical production device through an industrial Internet of Things or a local area network, and pre-process the multi-source data;
[0042] An anomaly detection module is configured to perform anomaly detection on the preprocessed multi-source data by using a Z-score algorithm and an isolation forest algorithm, to obtain an anomaly label, and trigger an accident traceability and emergency decision instruction based on the anomaly label;
[0043] A similarity matching module is configured to perform vectorization representation on historical accident data in the multi-source data, and perform similarity matching between a current accident feature vector and a historical accident feature vector in response to the accident traceability and emergency decision instruction, to obtain a historical case with the highest similarity;
[0044] A traceability report generation module is configured to call a pre-trained generation model to process a context of a current accident and the historical case, to generate a traceability report result for the current accident;
[0045] An emergency strategy generation module is configured to analyze the traceability report result and real-time multi-source data by reinforcement learning, to generate an emergency strategy, and perform emergency response according to the emergency strategy;
[0046] The multi-source data is collected in the form of a time series data stream, and includes device operation parameters, device state information, environmental parameters and historical accident data. The preprocessing includes cleaning, denoising, interpolation and normalization processing. The emergency response includes emergency shutdown, alarm signals and personnel evacuation signals. The generation model is a deep learning model based on natural language processing.
[0047] The present application also provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the petroleum chemical industry accident traceability and decision method according to any one of the above when executing the computer program.
[0048] The present application also provides a computer storage medium storing a computer program, wherein the computer program is executed by a processor to implement the petroleum chemical industry accident traceability and decision method according to any one of the above.
[0049] The present application also provides a computer program product comprising a computer program, wherein the computer program is executed by a processor to implement the petroleum chemical industry accident traceability and decision method according to any one of the above.
[0050] The petroleum chemical industry accident traceability and decision method and device automatically perform traceability analysis on accident data by combining real-time data acquisition, deep learning and natural language processing technology, and provides intelligent decision support based on historical accident data. The method first acquires data of an accident site in real time through an Internet of Things device, including key information such as pressure, temperature, flow, etc., then performs data preprocessing and feature extraction using a deep learning algorithm, and then performs rapid traceability on the accident through a search and generation model in the search-generation model technology to generate a related report. Finally, based on the traceability result and real-time data, the best emergency response measures are provided using reinforcement learning and decision tree algorithms to ensure timely and effective decision-making, which improves the efficiency and accuracy of accident traceability and decision support to a certain extent, solves the problems of hysteresis and low efficiency in the prior art in handling sudden accidents, and the application of the method can greatly improve the emergency response capability of the petroleum chemical industry in the face of accidents, reduce the loss caused by accidents, and ensure production safety. BRIEF DESCRIPTION OF DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the present application or prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0052] Figure 1 The flowchart of the petroleum chemical industry accident traceability and decision method provided by the present application;
[0053] Figure 2 The overall architecture diagram of the petroleum chemical industry accident traceability and decision method in the specific embodiment provided by the present application;
[0054] Figure 3 The abnormality detection flowchart of the petroleum chemical industry accident traceability and decision method in the specific embodiment provided by the present application;
[0055] Figure 4 The traceability report generation flowchart of the petroleum chemical industry accident traceability and decision method in the specific embodiment provided by the present application;
[0056] Figure 5 The structure diagram of the petroleum chemical industry accident traceability and decision device provided by the present application;
[0057] Figure 6 The internal structure diagram of the electronic device provided by the present application. DETAILED DESCRIPTION
[0058] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0059] The petroleum chemical accident tracing and decision method and device of the present application will be described below with reference to the drawings. Figures 1 to 6 The petroleum chemical accident tracing and decision method and device of the present application will be described below with reference to the drawings.
[0060] As shown in the figure, in one embodiment, a petroleum chemical accident tracing and decision method comprises the following steps: Figure 1
[0061] Step S110, acquiring multi-source data of a petroleum chemical production device through an industrial Internet of Things or a local area network, and pre-processing the multi-source data.
[0062] The multi-source data is collected in the form of time series data flow, including device operating parameters, device state information, environmental parameters and historical accident data, and the pre-processing includes cleaning, denoising, interpolation and normalization processing.
[0063] In some embodiments, the petroleum chemical accident tracing and decision method provided by the present application, the multi-source data is collected in the form of time series data flow, including device operating parameters, device state information, environmental parameters and historical accident data, and the pre-processing includes cleaning, denoising, interpolation and normalization processing, and specifically comprises the following steps:
[0064] Step S111, using linear interpolation or average algorithm based on sliding window to fill in missing values, and performing sliding average or band-pass filtering on data with a sampling frequency exceeding a first threshold, to denoise the multi-source data.
[0065] Step S112, normalizing the multi-source data by maximum-minimum normalization, and standardizing the multi-source data based on the mean and standard deviation of the samples in the multi-source data.
[0066] Step S120, using Z-score algorithm and Isolation Forest algorithm to detect anomalies in the pre-processed multi-source data, obtaining anomaly labels, and triggering accident tracing and emergency decision instructions based on the anomaly labels.
[0067] In some embodiments, the petroleum chemical industry accident tracing and decision method provided by the present application adopts Z-score algorithm and isolated forest algorithm to perform abnormality detection on the preprocessed multi-source data, obtains an abnormality mark, and triggers an accident tracing and emergency decision instruction based on the abnormality mark, and specifically includes the following steps:
[0068] In step S121, the Z-score value of the preprocessed multi-source data is calculated, and when the absolute value of the Z-score value exceeds an adjustable coefficient, the corresponding data is determined as an abnormal value.
[0069] In step S122, the isolated forest algorithm is used to score the preprocessed multi-source data, and a logical judgment is made based on the Z-score value and the scoring result to obtain an abnormality mark.
[0070] The calculation formula of the Z-score value is as follows:
[0071]
[0072] In the formula, and are the mean and standard deviation of the samples in the multi-source data, is the preprocessed sample data, is the Z-score value.
[0073] The scoring formula of the isolated forest algorithm is as follows:
[0074]
[0075] In the formula, is the scoring result of the sample data , is the average path length of the sample data in the isolated forest, is the average path length of the sample number in the complete binary tree, is an adjustable coefficient for controlling the amplification or reduction of the abnormality amplitude.
[0076] In step S130, the historical accident data in the multi-source data is represented by a vector, and the current accident feature vector is matched with the historical accident feature vector in response to the accident tracing and emergency decision instruction to obtain the historical case with the highest similarity.
[0077] In some embodiments, the petroleum chemical industry accident tracing and decision method provided by the present application represents the historical accident data in the multi-source data by a vector, and matches the current accident feature vector with the historical accident feature vector in response to the accident tracing and emergency decision instruction to obtain the historical case with the highest similarity, and specifically includes the following steps:
[0078] Step S131, the current accident is converted into a current accident feature vector, and the similarity between the current accident feature vector and the historical accident feature vector is measured by cosine similarity, and the expression of the similarity measurement is:
[0079]
[0080] In the formula, is the current accident feature vector, is the historical accident feature vector, is the similarity.
[0081] Step S140, calling a pre-trained generation model to process the context of the current accident and the historical cases to generate a traceability report result for the current accident,
[0082] Wherein, the generation model is a deep learning model based on natural language processing.
[0083] In some embodiments, the petroleum chemical industry accident traceability and decision method provided by the application calls a pre-trained generation model to process the context of the current accident and the historical cases to generate a traceability report result for the current accident, which specifically includes the following steps:
[0084] Step S141, taking the context of the current accident and the historical case with the highest similarity as the input of the pre-trained generation model to call the generation model to generate a traceability report result according to the text data of the current accident and the historical case.
[0085] Step S142, introducing an adjustable coefficient in the traceability report result to balance the dependence of the traceability report result on the historical cases.
[0086] Wherein, the traceability report result includes the cause of the current accident, the involved equipment and components, and the solution and solution suggestion of the historical cases.
[0087] Step S150, analyzing the traceability report result and real-time multi-source data by reinforcement learning to generate an emergency strategy, and executing an emergency response according to the emergency strategy.
[0088] Wherein, the emergency response includes emergency shutdown, alarm signal and personnel evacuation signal.
[0089] In some embodiments, the petroleum chemical industry accident traceability and decision method provided by the application analyzes the traceability report result and real-time multi-source data by reinforcement learning to generate an emergency strategy, and executes an emergency response according to the emergency strategy, which specifically includes the following steps:
[0090] Step S151, introducing a first adjustment coefficient to the immediate reward on the basis of the Q-learning formula to construct a Q-learning algorithm in reinforcement learning for updating the state-action value function and optimizing the emergency strategy through learning historical case experience, and the expression is:
[0091]
[0092] wherein, Q(s, a) is the Q value of the current state s and action a, s' is the next state, a' is the action, is the learning rate, is the immediate reward of the current accident, is the first adjustment coefficient, is the discount factor, is the maximum Q value in all possible actions a' in the next state s', s' is the next state, a' is the action, is the new state transferred after performing the action a'.
[0093] In some embodiments, the petrochemical accident tracing and decision method provided by the present application analyzes the tracing report results and real-time multi-source data through reinforcement learning to generate an emergency strategy, and performs emergency response according to the emergency strategy, and further includes the following steps:
[0094] Step S152, introducing a second adjustment coefficient in the state transition probability, interpolating between the original state transition probability and the real-time observation probability to dynamically adjust the state transition probability according to real-time data and historical data, and the expression is:
[0095]
[0096] wherein, P(s'|s, a) is the probability of the next state s' caused by the current state s and action a, is the second adjustment coefficient, is the state transition probability calculated by real-time data. In combination with FIG. 1, in specific embodiments, the petrochemical accident tracing and decision method provided by the present application includes steps 1-7: Step 1, multi-source data acquisition.
[0097] Figures 2 to 4 Data source composition: petrochemical production devices usually contain a plurality of sensors and monitoring equipment, such as pressure (P),
[0098] Step 1, multi-source data acquisition.
[0099] Data source composition: petrochemical production devices usually contain a plurality of sensors and monitoring equipment, such as pressure (P), ), temperature ( ), flow ( ) sensors, and a production control system such as a PLC, DCS, or SCADA. Among them, the collection objects include but are not limited to: equipment operating parameters: pressure, temperature, flow, liquid level, rotating speed, etc.; equipment state information: switch state, valve position, alarm signal; environmental parameters: ambient temperature and humidity, combustible gas concentration, etc.; historical accident data: record past accident cases, disposal process, expert opinions, etc.
[0100] Data collection form: through industrial Internet of Things (IoT) or local area network, real-time upload of multi-source data collected on site to a central server or cloud platform to form a time series data stream. Let t be the sampling time, the corresponding sensor data can be expressed as:
[0101]
[0102] In the formula, d represents the number of types of sensors and monitoring indicators, and the data can be passed and shared between subsequent modules.
[0103] Step 2, data preprocessing.
[0104] In order to improve the accuracy of subsequent anomaly detection and accident analysis, the present application performs cleaning, denoising, interpolation, normalization and other preprocessing operations on the original collected data to obtain processed data . Mainly includes the following steps and formulas:
[0105] Missing value filling and denoising:
[0106] Missing value filling: linear interpolation or average method based on sliding window, let be the interpolated data, reducing the influence of collection faults on subsequent analysis.
[0107] Denoising: for data with high sampling frequency, sliding average or bandpass filtering can be performed to reduce the influence of sensor jitter, random noise, etc.
[0108] Normalization processing:
[0109] Min-Max normalization: where and represent the minimum and maximum values of the index in a statistical window, respectively;
[0110] Standardization processing (Z-score normalization): where and are the mean and standard deviation of the index in the statistical sample, respectively.
[0111] Step 3, anomaly detection.
[0112] In the anomaly detection step, the Z-score method is combined with the Isolation Forest method. An adjustable coefficient is used to flexibly control the sensitivity of anomaly detection according to the production conditions, and to timely discover possible hidden faults.
[0113] Z-score anomaly detection:
[0114] For the pre-processed data Calculate the Z-score value:
[0115]
[0116] If , it is determined as an outlier; is an adjustable coefficient that determines the threshold of Z-score detection. When is small, the detection is more sensitive; when is large, false positives are reduced.
[0117] Isolation Forest anomaly detection:
[0118] The Isolation Forest algorithm is used to score the data, and the scoring formula is:
[0119] ;
[0120] In the formula, is the score result of the sample data , is the average path length of the sample data in the Isolation Forest, is the sample size , and is the average path length in a complete binary tree, is an adjustable coefficient used to control the amplification or reduction of abnormal amplitude. When is large, small amplitude anomalies may also get high abnormal scores. Multi-strategy fusion and alarm:
[0121] The Z-score result and the Isolation Forest score are logically judged (such as "or" logic) to get the final anomaly label
[0122] . If , it means may contain anomalies, and the subsequent accident tracing and emergency decision-making processes need to be triggered.
[0123] In this embodiment, after processing the data, both the Z-score method and the Isolation Forest method calculate a score indicating whether the data is likely to be abnormal. The Z-score method detects abnormalities by a statistical threshold (e.g., a Z-score above a certain value is deemed abnormal), while the Isolation Forest scores the degree of abnormality of the data through a tree structure.
[0124] Logical judgment (e.g., "or" logic) is used to determine the final abnormality flag. "Or" logic: if either the Z-score or the Isolation Forest score indicates that the data is abnormal (i.e., exceeds a certain threshold), then the final flag is 1, indicating that there is an abnormality. For example: if the Z-score exceeds a threshold of 2 or the Isolation Forest score exceeds 0.8, then the final flag is 1, indicating that there is an abnormality. If the final flag is 1, the subsequent steps such as accident tracing and emergency decision-making are triggered. This may include generating reports, notifying operators, and adjusting operation processes to reduce potential risks.
[0125] Step 4, accident tracing.
[0126] Historical accident case library: To support rapid tracing, the system maintains a historical accident case library , each of which contains information such as accident feature description, cause analysis, and treatment results. By vectorizing these cases, similarity matching can be performed with real-time accident data.
[0127] Case vectorization: Historical accidents are described by some features, such as accident type, cause, and solution method, which are numerically converted into multi-dimensional vectors through word embedding methods .
[0128] Similarity matching: For the current accident , it is also converted into a feature vector, and by comparing it with the historical accident vector, the most similar accident is found. The commonly used similarity measure is cosine similarity, and the calculation formula is:
[0129]
[0130] where is the current accident feature vector, is the historical accident feature vector, is the similarity. The value obtained indicates the similarity between the current accident and the historical accident, and the higher the similarity, the greater the reference value of the historical case for the current event.
[0131] Similarity measure: Let the feature vector of the current accident be , historical accident cases are represented as vectors , cosine similarity is used for retrieval, to enhance the flexibility of similarity control, adjustable coefficients are introduced:
[0132]
[0133] Then select the most similar case to the current accident:
[0134]
[0135] and : the length of the vector (i.e. the size of the feature vector), the calculation formula is: where, is the element in the vector . If is larger, the impact of historical cases is more important, if is smaller, more dependent on the current accident data.
[0136] Generate model: after retrieving the most similar historical case, with the help of pre-trained generation model (such as GPT series), input the current accident context and retrieval results to the model, generate a traceability report for the current accident :
[0137]
[0138] In the formula, is the generation model parameter, which is learned through the optimization process during model training, controlling how the generation model generates output based on input content; is the context of the current accident, including various information about the accident, such as time, location, device status, etc. is the most similar historical accident case retrieved from the historical case library.
[0139] After retrieving the most similar historical case, the context of the current accident and the historical case are input together as input into the pre-trained generation model. The generation model is a deep learning model based on natural language processing (NLP), which is used to generate relevant output based on input text data. The generation model will generate a traceability report for the current accident based on the input of the current accident context and historical cases The generated traceability report will describe in detail the possible causes of the current accident, the devices and components involved, the solutions of the historical cases and related suggestions, etc.
[0140] Adjustable coefficient: If it is necessary to balance the dependence on historical cases, an adjustable coefficient can be added to the generated results. :
[0141]
[0142] when At that time, generative models tend to draw more inspiration from historical events. In this context, generative models place greater emphasis on adaptive analysis of real-time data. By combining retrieval and generation, they can provide tracing conclusions in a very short time, indicating possible causes of the accident, involved components, and feasible solutions.
[0143] Step 5, Intelligent Decision Support.
[0144] Multiple decision-making methods are used to comprehensively analyze the source tracing results and real-time data to generate response strategies, including reinforcement learning (Q-learning).
[0145] Reinforcement learning: Based on the traditional Q-learning formula, an adjustable coefficient k is introduced for the immediate reward r:
[0146]
[0147] In the formula, Current state and actions The Q value is the expected reward for taking the action in that state; The learning rate represents the degree to which new information affects the update of the existing Q value, and its range is 0 to 1; The immediate reward for the current step represents the immediate feedback reward obtained after performing action a in state s. The variable is k. If k > 1, the impact of immediate rewards on decision-making is amplified; if k < 1, the reward and punishment response is smoothed. This is the discount factor, which controls the degree of discount on future rewards. A larger value indicates that the model pays more attention to future rewards, while a smaller value indicates that it pays more attention to current rewards. For the next state All possible actions The maximum Q value in the equation is the maximum expected reward derived from the optimal action in predicting the next state. The next state indicates that an action will be performed. The new state to which the user transitions. This formula is from the Q-learning algorithm in reinforcement learning, used to update the state-action value function. We can optimize decision-making strategies by learning from historical experiences.
[0148] State transition probability adjustment: In order to balance historical experience and current real-time situation, a coefficient is introduced in the state transition probability to interpolate between the original estimated and real-time observation :
[0149]
[0150] where is the probability of the next state caused by the current state and action , and represents the probability of moving to state after performing action from state ; is an adjustable coefficient to balance historical estimates and real-time observations. A larger value indicates more reliance on historical data, and a smaller value indicates more reliance on real-time data; is the state transition probability calculated from real-time data, representing the predicted probability of the next state given the current state and action. When is larger, the decision relies more on historical statistical laws, is smaller, the strategy is more flexible to adjust according to the current monitoring data. This formula is used to dynamically adjust the state transition probability based on real-time data and historical data, so that the decision strategy can be flexibly adjusted when new situations arise.
[0151] Step 6, emergency response execution.
[0152] After the decision support module generates the emergency strategy, the system will automatically or semi-automatically perform the following key operations to minimize the loss of the accident.
[0153] Emergency shutdown:
[0154] where is the basic shutdown time designed by the equipment itself, is an adjustable coefficient that takes into account equipment type, shutdown method, and operator quality.
[0155] Alarm: Set the basic alarm signal strength as , then the actual alarm signal can be represented as: When is higher than the system threshold, it will send out alarms of various levels to the scene and dispatch center. If , the alarm is more sensitive, is an adjustable coefficient.
[0156] Personnel evacuation:
[0157] in, The value is related to factors such as the degree of obstruction in the on-site passages and explosion-proof requirements. A higher value indicates a more complex environment or higher safety requirements, requiring more evacuation time. This is an adjustable coefficient.
[0158] Step 7, Feedback and Adaptive Optimization.
[0159] To continuously improve the system's adaptability and decision-making accuracy, this invention evaluates the performance of each module after execution and feeds the results back to the system.
[0160] Adjustable coefficient update: If the false alarm rate of anomaly detection is high, it can be corrected using historical data. or If the retrieved historical cases are not relevant enough, adjustments can be made. or If the decision-making tendency is too aggressive or conservative, it can be reset in reinforcement learning. and Or change in the decision tree Emergency response procedures should be revised based on actual execution results. , , Equal coefficients.
[0161] Anomaly detection false alarm rate correction:
[0162] If the false alarm rate of anomaly detection is high, parameters can be adjusted using historical data. or These parameters affect the sensitivity and threshold of anomaly detection algorithms. Adjusting these values can optimize detection accuracy and reduce false alarms.
[0163] Adjustments to address insufficient relevance of historical cases:
[0164] If the retrieved historical cases are not relevant enough (i.e., not similar enough to the current incident), the coefficients can be adjusted. or This can be done to increase the model's reliance on historical cases, or to adjust the feature vector matching strategy.
[0165] Adjustments that are either too radical or too conservative in their decision-making:
[0166] If the system is too aggressive or conservative in its decision-making, it can be reprogrammed through reinforcement learning. and Parameters, or adjustments made in the decision tree. Parameters. These parameters control the trade-offs in the decision-making process, such as the degree of emphasis placed on immediate rewards versus long-term rewards.
[0167] In reinforcement learning, and parameters: control the influence of immediate rewards on decisions, control the reliance on historical experiences.
[0168] In decision trees, : control the sensitivity of decision trees to different situations, adjusting this parameter can make decisions more adaptive to the current environment.
[0169] Emergency response operation adjustment:
[0170] According to the actual execution results, adjust the coefficients in the emergency response process (such as , , etc.), these coefficients control the activation degree of emergency response, such as the intensity of shutdown, alarm or evacuation.
[0171] These correction steps help the system to adjust the decision strategy more accurately when facing complex and variable situations, and optimize the response effect of the system.
[0172] Online adaptation: the system can accumulate more case library data in daily life, use incremental training or transfer learning to expand the model capability, and constantly update the generated model parameters, so as to maintain high traceability accuracy for new fault modes.
[0173] In this embodiment, by combining RAG technology (retrieval-generation model) with intelligent decision support system, rapid traceability and efficient decision of petrochemical industry accidents are realized. The retrieval-generation model (RAG) using deep learning and natural language processing is used for automatic retrieval and generation of historical accident data, which improves the traceability efficiency and accuracy. Adjustable coefficients are introduced in each step (such as anomaly detection, accident traceability, decision support and emergency response, etc.), so that the system has higher flexibility and adaptability. The combination of reinforcement learning and decision tree algorithm can make accurate emergency decisions based on real-time data and historical cases, and automatically optimize.
[0174] The RAG technology (retrieval-generation model) generates an accident traceability report by retrieving historical accident cases and combining a generation model, significantly improving the speed and accuracy of accident traceability and reducing the need for manual intervention. Multi-algorithm fusion: Combining various algorithms such as isolation forest, reinforcement learning Q-learning, and decision tree, it can flexibly respond to different application scenarios and improve the accuracy of traceability and decision support. Adjustable coefficients: Introducing adjustable coefficients in key formulas such as anomaly detection, reward function, and decision tree index, can flexibly adjust the decision preference according to the actual working conditions and different production lines, and optimize the response efficiency. Feedback and adaptive optimization: Through online feedback mechanism to continuously adjust and optimize the model, the system has self-learning and adaptive ability, can adjust according to new emerging accident mode, improve the long-term decision accuracy and reliability.
[0175] The petroleum chemical accident traceability and decision device provided by the present application is described below. The petroleum chemical accident traceability and decision device described below can be correspondingly referred to the petroleum chemical accident traceability and decision method described above.
[0176] As shown in Figure 5 In one embodiment, a petroleum chemical accident traceability and decision device includes a data preprocessing module 510, an anomaly detection module 520, a similarity matching module 530, a traceability report generation module 540, and an emergency strategy generation module 550.
[0177] The data preprocessing module 510 is configured to acquire multi-source data of a petroleum chemical production device through an industrial Internet of Things or a local area network, and preprocess the multi-source data.
[0178] The anomaly detection module 520 is configured to detect anomalies in the preprocessed multi-source data using a Z-score algorithm and an isolation forest algorithm, obtain anomaly labels, and trigger accident traceability and emergency decision instructions based on the anomaly labels.
[0179] The similarity matching module 530 is configured to vectorize historical accident data in the multi-source data, and perform similarity matching between a current accident feature vector and a historical accident feature vector in response to the accident traceability and emergency decision instructions, to obtain a historical case with the highest similarity.
[0180] The traceability report generation module 540 is configured to call a pre-trained generation model to process a context of a current accident and a historical case, and generate a traceability report result for the current accident.
[0181] The emergency strategy generation module 550 is configured to analyze the traceability report result and real-time multi-source data through reinforcement learning to generate an emergency strategy, and execute an emergency response according to the emergency strategy.
[0182] The multi-source data is collected in the form of time-series data streams, including equipment operating parameters, equipment status information, environmental parameters and historical accident data. Preprocessing includes cleaning, noise reduction, interpolation and normalization. Emergency response includes emergency shutdown, alarm signals and personnel evacuation signals. The generation model is a deep learning model based on natural language processing.
[0183] In this embodiment, the data preprocessing module 510 of the petrochemical accident tracing and decision-making device provided by the present invention is specifically used for:
[0184] Missing values are filled using linear interpolation or a sliding window-based averaging algorithm, and moving average or bandpass filtering is applied to data with sampling frequencies exceeding a first threshold to denoise multi-source data.
[0185] Multi-source data is normalized using max-min normalization and standardized based on the mean and standard deviation of the samples in the multi-source data.
[0186] In this embodiment, the anomaly detection module 520 of the petrochemical accident tracing and decision-making device provided by the present invention is specifically used for:
[0187] Calculate the Z-score value of the preprocessed multi-source data, and determine the corresponding data as outliers when the absolute value of the Z-score value exceeds the adjustable coefficient.
[0188] The Isolation Forest algorithm is used to score the preprocessed multi-source data, and logical judgment is made based on the Z-score value and the scoring results to obtain anomaly labels.
[0189] The formula for calculating the Z-score is as follows:
[0190]
[0191] In the formula, and These are the mean and standard deviation of samples from multiple data sources, respectively. For the preprocessed sample data, This is the Z-score value.
[0192] The scoring formula for the Isolation Forest algorithm is:
[0193]
[0194] In the formula, For sample data The scoring results For sample data Average path length in an isolated forest For sample size The average path length in a complete binary tree. It is an adjustable coefficient used to control the amplification or reduction of abnormal amplitude.
[0195] In this embodiment, the similarity matching module 530 of the petrochemical accident tracing and decision-making device provided by the present invention is specifically used for:
[0196] The current accident is transformed into a feature vector, and the similarity between the current accident feature vector and historical accident feature vectors is measured using cosine similarity. The expression for the similarity measurement is as follows:
[0197]
[0198] In the formula, This is the current accident feature vector. For historical accident feature vectors, For similarity.
[0199] In this embodiment, the petrochemical accident tracing and decision-making device provided by the present invention, specifically uses the tracing report generation module 540 for:
[0200] The context of the current incident and the historical case with the highest similarity are used as input to a pre-trained generative model, which is then used to generate a source tracing report based on the text data of the current incident and the historical case.
[0201] An adjustable coefficient is introduced into the source tracing report results to balance the dependence of the source tracing report results on historical cases.
[0202] The source tracing report includes the cause of the current accident, the equipment and components involved, and solutions and recommendations for handling historical cases.
[0203] In this embodiment, the emergency strategy generation module 550 of the petrochemical accident tracing and decision-making device provided by the present invention is specifically used for:
[0204] Based on the Q-learning formula, a first adjustment coefficient is introduced to the immediate reward to construct a Q-learning algorithm in reinforcement learning for updating the state-action value function and optimizing the contingency strategy by learning from historical case experience. Its expression is:
[0205]
[0206] In the formula, Current state and actions Q value, For learning rate, As an immediate reward for the current incident, is a first adjustment coefficient, is a discount factor, is a next state all possible actions the maximum Q value, is a next state, indicating a new state transferred after performing the action .
[0207] In the embodiment, the petroleum chemical accident tracing and decision device provided by the application is specifically used for:
[0208] The second adjustment coefficient is introduced into the state transition probability, interpolation is performed between the original state transition probability and the real-time observation probability, and the state transition probability is dynamically adjusted according to the real-time data and the historical data, and the expression is:
[0209]
[0210] In the formula, is a current state and the action causes the next state probability, is a second adjustment coefficient, is a state transition probability calculated by real-time data.
[0211] Figure 6 An example of an entity structure diagram of an electronic device is shown in the figure. The electronic device can be a smart terminal, and its internal structure diagram can be as shown in Figure 6 The electronic device includes a processor, a memory and a network interface connected by a system bus. The processor of the electronic device is used to provide computing and control capability. The memory of the electronic 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 operating system and the computer program in the non-volatile storage medium to run. The network interface of the electronic device is used to communicate with external terminals through network connection. The computer program is executed by the processor to implement a petroleum chemical accident tracing and decision method, which includes:
[0212] Obtain multi-source data of a petroleum chemical production device through an industrial Internet of Things or a local area network, and pre-process the multi-source data;
[0213] Anomaly detection is performed on the pre-processed multi-source data by using a Z-score algorithm and an isolation forest algorithm, to obtain an anomaly label, and an accident tracing and emergency decision instruction is triggered based on the anomaly label;
[0214] vectorize historical accident data in the multi-source data, and perform similarity matching between a current accident feature vector and historical accident feature vectors in response to the accident tracing and emergency decision instruction to obtain a historical case with the highest similarity;
[0215] call a pre-trained generation model to process a context of the current accident and the historical case to generate a tracing report result for the current accident;
[0216] analyze the tracing report result and real-time multi-source data through reinforcement learning to generate an emergency strategy, and perform emergency response according to the emergency strategy;
[0217] The multi-source data is collected in the form of a time series data stream, and includes device operation parameters, device state information, environmental parameters, and historical accident data. The preprocessing includes cleaning, denoising, interpolation, and normalization processing. The emergency response includes emergency shutdown, alarm signals, and personnel evacuation signals. The generation model is a deep learning model based on natural language processing.
[0218] Those skilled in the art can understand that Figure 6 The structure shown in the figure is only a block diagram of part of the structure related to the scheme, and does not constitute a limitation on the electronic device to which the scheme is applied. The specific electronic device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0219] In another aspect, the present application also provides a computer storage medium storing a computer program, which, when executed by a processor, implements the oil and chemical accident tracing and decision method. The method comprises:
[0220] Obtain multi-source data of an oil and chemical production device through an industrial Internet of Things or a local area network, and preprocess the multi-source data;
[0221] Detect anomalies in the preprocessed multi-source data using Z-score algorithm and isolation forest algorithm to obtain anomaly labels, and trigger the accident tracing and emergency decision instruction based on the anomaly labels;
[0222] Vectorize historical accident data in the multi-source data, and perform similarity matching between a current accident feature vector and historical accident feature vectors in response to the accident tracing and emergency decision instruction to obtain a historical case with the highest similarity;
[0223] Call a pre-trained generation model to process a context of the current accident and the historical case to generate a tracing report result for the current accident;
[0224] The traceability report result and real-time multi-source data are analyzed by reinforcement learning to generate an emergency strategy, and an emergency response is performed according to the emergency strategy;
[0225] The multi-source data is collected in the form of a time series data stream, including device operation parameters, device state information, environmental parameters, and historical accident data, the preprocessing includes cleaning, denoising, interpolation, and normalization processing, the emergency response includes emergency shutdown, alarm signals, and personnel evacuation signals, and the generation model is a deep learning model based on natural language processing.
[0226] In another aspect, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor implements the oil and chemical industry accident traceability and decision-making method when executing the computer instructions, the method comprising:
[0227] Multi-source data of the oil and chemical production device is obtained through an industrial Internet of Things or a local area network, and the multi-source data is preprocessed;
[0228] The Z-score algorithm and the isolation forest algorithm are used for anomaly detection on the preprocessed multi-source data to obtain an anomaly label, and an accident traceability and emergency decision-making instruction is triggered based on the anomaly label;
[0229] The historical accident data in the multi-source data is vectorized, and the current accident feature vector is matched with the historical accident feature vector in response to the accident traceability and emergency decision-making instruction to obtain a historical case with the highest similarity;
[0230] The pre-trained generation model is called to process the context of the current accident and the historical case to generate a traceability report result for the current accident;
[0231] The traceability report result and real-time multi-source data are analyzed by reinforcement learning to generate an emergency strategy, and an emergency response is performed according to the emergency strategy;
[0232] The multi-source data is collected in the form of a time series data stream, including device operation parameters, device state information, environmental parameters, and historical accident data, the preprocessing includes cleaning, denoising, interpolation, and normalization processing, the emergency response includes emergency shutdown, alarm signals, and personnel evacuation signals, and the generation model is a deep learning model based on natural language processing.
[0233] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiment methods. Any reference to memory, storage, database or other medium used in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory.
[0234] By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0235] The technical features of the above embodiments can be combined in any way. In order to make the description simple, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not contradict, they should be considered as the scope of the present application.
[0236] The above embodiments only express several embodiments of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the scope of protection of the patent of the present application should be subject to the appended claims.
Claims
1. A petrochemical accident traceability and decision method, characterized in that, The method comprises: obtaining multi-source data of a petrochemical production device through an industrial Internet of Things or a local area network, and preprocessing the multi-source data; adopting a Z-score algorithm and an isolation forest algorithm to perform anomaly detection on the preprocessed multi-source data, obtaining an anomaly label, and triggering accident tracing and emergency decision-making instructions based on the anomaly label; vectorizing historical accident data in the multi-source data, and performing similarity matching between a current accident feature vector and a historical accident feature vector in response to the accident tracing and emergency decision-making instructions to obtain a historical case with the highest similarity; calling a pre-trained generation model to process a context of the current accident and the historical case, and generating a tracing report result for the current accident; analyzing the tracing report result and real-time multi-source data through reinforcement learning to generate an emergency strategy, and executing an emergency response according to the emergency strategy; wherein the multi-source data is collected in the form of a time series data stream, including device operating parameters, device state information, environmental parameters, and historical accident data, the preprocessing includes cleaning, denoising, interpolation, and normalization processing, the emergency response includes emergency shutdown, alarm signals, and personnel evacuation signals, and the generation model is a deep learning model based on natural language processing.
2. The petrochemical incident root cause analysis and decision method of claim 1, wherein, The method comprises: adopting linear interpolation or a sliding window-based average algorithm to fill in missing values, and performing sliding average or bandpass filtering on data with a sampling frequency exceeding a first threshold to denoise the multi-source data; normalizing the multi-source data through maximum-minimum normalization, and standardizing the multi-source data based on the mean and standard deviation of samples in the multi-source data.
3. The petrochemical accident forensics and decision method of claim 2, wherein, The method comprises: calculating the Z-score value of the preprocessed multi-source data, and determining that the corresponding data is an abnormal value when the absolute value of the Z-score value exceeds an adjustable coefficient; adopting an isolation forest algorithm to score the preprocessed multi-source data, and performing logical judgment based on the Z-score value and the scoring result to obtain the anomaly label; wherein the calculation formula of the Z-score value is: wherein, and are the mean and standard deviation of the samples in the multi-source data, respectively, is the pre-processed sample data, is the Z-score value; the scoring formula of the isolation forest algorithm is: wherein the score result of the sample data , the score result of the sample data the average path length in the isolated forest the number of samples the average path length in the complete binary tree is an adjustable coefficient for controlling the amplification or reduction of the abnormal amplitude.
4. The petrochemical accident forensics and decision method of claim 3, wherein, The method comprises: converting the current accident into the current accident feature vector, and measuring the similarity of the current accident feature vector and the historical accident feature vector through cosine similarity, and the expression of the similarity measurement is: wherein, is the current incident feature vector, is the historical incident feature vector, is the similarity.
5. The petrochemical incident root cause analysis and decision method of claim 4, wherein, The calling of the pre-trained generation model processes the context of the current accident and the historical cases to generate a root cause analysis report result for the current accident, including: The context of the current accident and the historical case with the highest similarity are taken as inputs of the pre-trained generation model to call the generation model to generate the root cause analysis report result according to the text data of the current accident and the historical case; An adjustable coefficient is introduced in the root cause analysis report result to balance the degree of dependence of the root cause analysis report result on the historical cases; The root cause analysis report result includes the cause of the current accident, the involved equipment and components, and the solution and solution suggestion of the historical cases.
6. The petrochemical incident root cause analysis and decision method of claim 5, wherein, The analysis of the root cause analysis report result and real-time multi-source data through reinforcement learning to generate an emergency strategy, and the execution of an emergency response according to the emergency strategy, includes: A first adjustment coefficient is introduced into the Q-learning formula to construct a Q-learning algorithm in reinforcement learning for updating the state-action value function and optimizing the emergency strategy through learning historical case experience, and the expression is: wherein is the current state and action Q-value, is the learning rate, is the immediate reward for the current episode, is the first adjustment coefficient, is the discount factor, is the maximum Q-value among all possible actions in the next state , is the next state, representing the new state to which the agent is transferred after performing the action .
7. The petrochemical incident root cause analysis and decision method of claim 6, wherein, The analysis of the root cause analysis report result and real-time multi-source data through reinforcement learning to generate an emergency strategy, and the execution of an emergency response according to the emergency strategy, also includes: A second adjustment coefficient is introduced into the state transition probability to interpolate between the original state transition probability and the real-time observation probability to dynamically adjust the state transition probability according to real-time data and historical data, and the expression is: wherein is the current state and action results in the next state with probability is a second adjustment coefficient, is the state transition probability computed from real-time data.
8. A petrochemical accident tracing and decision device, characterized in that, The device includes: A data preprocessing module for obtaining multi-source data of a petrochemical production device through an industrial Internet of Things or a local area network and preprocessing the multi-source data; An anomaly detection module for detecting anomalies in the preprocessed multi-source data using Z-score and Isolation Forest algorithms to obtain anomaly labels and trigger accident root cause analysis and emergency decision-making instructions based on the anomaly labels; A similarity matching module for vectorizing historical accident data in the multi-source data and responding to the accident root cause analysis and emergency decision-making instructions to match current accident feature vectors with historical accident feature vectors to obtain the historical case with the highest similarity; A root cause analysis report generation module for calling a pre-trained generation model to process the context of the current accident and the historical cases to generate a root cause analysis report result for the current accident; An emergency strategy generation module for analyzing the root cause analysis report result and real-time multi-source data through reinforcement learning to generate an emergency strategy and executing an emergency response according to the emergency strategy; The multi-source data is collected in the form of time series data flow, including device operating parameters, device state information, environmental parameters, and historical accident data, the preprocessing includes cleaning, denoising, interpolation, and normalization, the emergency response includes emergency shutdown, alarm signals, and personnel evacuation signals, and the generation model is a deep learning model based on natural language processing. 9.An electronic device comprising a memory and a processor, the memory storing a computer program, wherein, The computer program is executed by the processor to implement the steps of the petrochemical accident tracing and decision method in any one of claims 1 to 7.
10. A computer storage medium storing a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the petrochemical accident tracing and decision method in any one of claims 1 to 7.
Citation Information
Patent Citations
Emergency accident handling method based on historical case and experience knowledge learning
CN115829061A
Abnormal temperature detection early warning method and system based on video analysis, and medium
CN118274977A