Method and system for identifying abnormal working conditions of oil and gas station
By establishing an abnormal working condition recognition method in the oil and gas station yard, and using adaptive smoothing and graph neural network for data fusion, the problem of isolated system for oil and gas station monitoring is solved, and efficient abnormal detection and safety improvement is achieved.
Patent Information
- Application Number
- CN202410130431.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-31
- Publication Date
- 2025-08-01
AI Technical Summary
Various states and abnormal monitoring in the oil and gas station are isolated systems, and there is a lack of overall overall solution, resulting in a high rate of abnormal alarm false alarms and failure to detect abnormal situations in time, posing safety hazards.
Establish an abnormal working condition recognition method for oil and gas station site, pre-process the sensor historical data, train an abnormal working condition recognition model, use adaptive smoothing and graph neural networks to perform data fusion and feature extraction, build an abnormal detection model, and deploy it in the abnormal working condition recognition system for real-time identification and visual display.
The overall perception and data fusion of oil and gas stations has been realized, the abnormal alarm false alarm rate has been reduced, the station safety and production operation stability have been improved, and the intelligent development of the stations has been promoted.
Smart Images

Figure CN120408423A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of data analysis, and in particular relates to a method and system for identifying abnormal operating conditions of an oil and gas station. Background Art
[0002] As transit points for pressurization and diversion during oil and gas transportation, oil and gas stations play an irreplaceable and crucial role throughout the entire oil and gas production cycle, from extraction and storage to transportation and production. Therefore, the safety of oil and gas stations is crucial to the stable operation of the entire oil and gas transportation system. If inspection and protective measures are not fully implemented and abnormalities during transportation cannot be detected in a timely manner, serious safety accidents can easily occur, causing irreparable losses to the company.
[0003] In recent years, my country has made significant progress in multi-source data fusion technology for oil and gas stations. However, current status and anomaly monitoring within oil and gas stations is still largely isolated, lacking a comprehensive solution. This results in a high rate of false alarms. There is an urgent need for a method that is highly stable, has strong generalization capabilities, a low false alarm rate, and can integrate data from multiple sources for comprehensive analysis. Summary of the Invention
[0004] In view of the deficiencies in the background technology, the present invention proposes a method and system for identifying abnormal operating conditions of an oil and gas station.
[0005] The present invention achieves the above-mentioned purpose through the following technical solutions: A method for identifying abnormal operating conditions of an oil and gas station, comprising the following steps:
[0006] Step 1: Obtain historical operating data from production-related sensors within the site and preprocess it as a training set;
[0007] Step 2: Use the training data to train the station abnormal operating condition recognition model so that it can recognize abnormal operating conditions;
[0008] Step 3: Deploy the model in the abnormal operating condition identification system of the oil and gas station to identify abnormal operating conditions of the station in real time, and build a visual interface to associate and display the abnormal detection results with the corresponding sensors.
[0009] The data preprocessing includes the following steps:
[0010] Step 1-1: All sensor data X=[x1,x2,…,x n ] Each sensor data Normalize; where n represents the number of sensors;
[0011] Step 1-2: Split the standardized sensor data into fixed time windows to obtain training data in Indicates that the data of a training batch after segmentation is used as the input of the model; Indicates the data of each sensor after segmentation, and t represents the time window size;
[0012] The training abnormal condition recognition model includes the following steps:
[0013] Step 2-1: Use the time series data processing method based on adaptive stationary to perform stationary processing on the data of each sensor within the time window;
[0014] Step 2-2: Use the multi-source data feature extraction method based on graph neural network to fuse and extract features from multiple processed sensor data;
[0015] Step 2-3: Establish an anomaly detection model based on autoencoder for each node, and use the obtained features as input for training to output the anomaly detection results.
[0016] The time series data processing algorithm based on adaptive stationary includes the following steps:
[0017] Step 2-1-1: Perform instance normalization processing on each sensor data in the input data within its time window to obtain the processed data
[0018] Step 2-1-2: Calculate the adaptive attention weight according to the processed data:
[0019] se(X) = σ(W2δ(W1X))
[0020] where σ represents the sigmoid activation function, and δ represents the Relu activation function; W1 and W2 represent the parameters of two fully connected layers. The parameter W1 reduces the dimension of the feature at a reduction rate of r, and then after passing through the Relu activation, the result is dimensionally increased to the same dimension as the source feature through the parameter W2;
[0021] Step 2-1-3: For each sensor, calculate the adaptive stationary feature:
[0022]
[0023] Finally, obtain the processed input feature
[0024] The multi-source data feature extraction method based on graph convolutional neural network is as follows:
[0025] Step 2-2-1: Treat each data source as a node in a graph structure, construct an adjacency matrix through a graph adjacency relationship construction method to form a graph structure; the graph structure uses edges to describe the adjacency relationship between two nodes.
[0026] Step 2-2-2: Establish a graph neural network according to the graph structure.
[0027] Step 2-2-3: Input the graph structure into a graph convolutional neural network for feature extraction.
[0028] The described graph adjacency relationship construction method is a graph relationship construction method that fuses prior connection knowledge, and its steps are as follows:
[0029] Step 2-2-1-1: Define a set of candidate relationship matrices according to the prior information of the connection relationship between sensors i: Among them, initially, the candidates for sensor i are all sensors except itself.
[0030] Step 2-2-1-2: Calculate the similarity between the feature vector of sensor i and the feature vector of its candidate relationship sensor j:
[0031]
[0032] Step 2-2-1-3: Select the K sensors with the closest distance to establish an adjacency relationship and add edges in the graph structure.
[0033] Step 2-2-1-4: Repeat steps 2-2-1-1 to 2-2-1-3 until relationships are established for all sensors to obtain the final adjacency matrix and graph structure.
[0034] The abnormal detection of the obtained features includes: establishing an anomaly detection model based on an autoencoder for each node and performing anomaly detection on each node.
[0035] The anomaly detection model is:
[0036] h = σ(W1x′ + b1)
[0037]
[0038] where h represents the encoded feature, represents the decoded feature as the model output, and x is the input of the entire anomaly detection and recognition model.
[0039] The loss function during training is
[0040] An abnormal condition recognition system for oil and gas stations includes a data acquisition module, an abnormal condition recognition module, and a result display module.
[0041] The data acquisition module is used to interface with the SCADA system in the station and regularly read real-time sensor parameter information from the system;
[0042] The abnormal condition identification module is deployed with a trained abnormal condition identification model for analyzing the data obtained in the data acquisition module;
[0043] The result display module is used to correspond the analysis result of the abnormal condition identification result module with the on-site sensors and display it on the visualization interface, providing the station management personnel with real-time viewing of the abnormal condition detection results of the station operating conditions.
[0044] The present invention has the following beneficial effects and advantages:
[0045] The present invention is a method for identifying abnormal conditions in an oil and gas station. By establishing an abnormal condition identification model that can integrate all sensors in the station, it completes the overall perception, data fusion, and abnormal detection in the oil and gas station, which is of great significance for improving the safety of the station, enhancing production operation, and promoting the intelligent development of the station. Brief Description of the Drawings
[0046] Figure 1 It is a method and system for identifying abnormal conditions in an oil and gas station;
[0047] Figure 2 It is a data waveform diagram detected by a certain sensor in the present invention during a certain period of time;
[0048] Figure 3 It corresponds to Figure 2 The abnormal score diagram of the sensor calculated by the abnormal detection method during the time period. Detailed Embodiment
[0049] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following detailed description of the specific implementation method of the present invention will be given in conjunction with the drawings. Many specific details are set forth in the following description in order to fully understand the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without departing from the connotation of the invention. Therefore, the present invention is not limited by the specific implementation disclosed below.
[0050] Such as Figure 1As shown in the figure, it is the method flow chart of the present invention. The specific working process is as follows: Obtain the historical operation data of the sensors related to the production operation in the station, and perform preprocessing as the training set; Use the training data to train the abnormal condition recognition model for the station yard; Deploy the model in the abnormal condition recognition system for the oil and gas station yard to perform real-time abnormal condition recognition on the station yard; Associate the abnormal detection results with the corresponding sensors and display them. The programming languages used for the execution of the program of the present invention are not limited to Python, Java, C++, etc.
[0051] Taking a certain oil and gas station yard as an example, the specific implementation steps are as follows:
[0052] Step 1: Obtain the historical operation data of the sensors related to the production operation in the station yard, and perform preprocessing as the training set, which specifically includes the following steps:
[0053] Step 1-1: First, collect the sensor data X = [x1, x2,..., x n within the historical time T in the station yard, mainly including variables such as inlet pressure, inlet flow rate, outlet pressure, outlet flow rate, cooling water temperature, cooling water flow rate, inlet pressure, outlet pressure of each compressor, temperature of each valve chamber in the station, opening degree of regulating valve, regulating valve pressure, etc., where n is the number of sensors. Then perform dimensionless normalization preprocessing on each sensor;
[0054] Step 1-2: Segment the standardized sensor data according to a fixed time window to obtain the training data and divide the training data into a training set and a validation set according to 8:2;
[0055] Step 2: Establish an abnormal condition recognition model and use the training set obtained in Step 1 for training. The specific steps are as follows:
[0056] Step 2-1: Establish an abnormal detection and recognition model. According to the data situation collected from the station yard, establish a time series data processing model based on adaptive stationary, a multi-source data feature extraction model based on graph neural network, and an abnormal detection model. The specific establishment steps of the model are as follows:
[0057] Step 2-2-1: Establish a time series data processing model based on adaptive stationary: For each sensor data [[ID=e26]] in the input data perform instance normalization processing within its time window to obtain the processed data Then calculate the adaptive attention weight according to the processed data:
[0058] se(X) = σ(W2δ(W1X))
[0059] where σ represents the sigmoid activation function, and δ represents the Relu activation function; W1 and W2 represent the parameters of two fully connected layers. The parameter W1 reduces the dimension of the features at a reduction rate of r, and then after passing through the Relu activation, the result is upscaled to the same dimension as the source features through the parameter W2. Finally, for each sensor, adaptive attention weights are used to calculate the adaptive stationary features:
[0060]
[0061] Finally, the processed input features are obtained.
[0062] Step 2-2-2: Establish a multi-source data feature extraction model based on a graph neural network: First, establish a data model: According to the prior information of the connection relationship between sensors i, a set of candidate relationship matrices are defined: Among them, in the absence of prior information, the candidates for sensor i are all sensors except itself. Then, calculate the similarity between the feature vector of sensor i and the feature vectors of its candidate relationship sensors j:
[0063]
[0064] Then, based on the similarity, select the K most similar sensors to establish relationships. Finally, repeat this process until relationships are established for all sensors to obtain the final relationship matrix.
[0065] Then, establish a graph convolutional neural network based on the obtained graph structure:
[0066]
[0067] Perform feature extraction, where x is the model input, W is the parameter of the model's fully connected layer, is the adjacency matrix, is the degree matrix. The model first transforms the input features xW, and then completes the weighted sum aggregation of neighbor information through to obtain the final output feature x';
[0068] Step 2-2-3: Construct an anomaly detection model with a single hidden layer based on an autoencoder for each node. The calculation process is as follows:
[0069] h = σ(W1x' + b1)
[0070]
[0071] The loss function during training is where h represents the encoded features, represents the decoded features as the model output, and x is the input of the entire anomaly detection and recognition model.
[0072] Step 2-2: Use the gradient descent method to train the established model and validate it on the validation set;
[0073] Step 2-3: Repeat Step 2-2 by setting different hyperparameters such as the learning rate. After repeating multiple times, select the model with the best performance (i.e., the minimum loss on the validation set) for saving for subsequent deployment;
[0074] Step 3: Convert the model into the Open Neural Network Exchange (ONNX) format and deploy it in the abnormal condition recognition system for oil and gas stations. The working steps of the system are as follows:
[0075] Step 3-1: Regularly read the latest sensor parameter information from the system;
[0076] Step 3-2: Load the trained and converted Open Neural Network Exchange (ONNX) format model, perform inference on the collected information, and use to calculate the anomaly scores of the measurement data of each currently read sensor. If the score exceeds the threshold, it is confirmed that there is an anomaly; if it does not exceed, it is considered that there is no anomaly. The threshold is set and dynamically adjusted according to the actual situation of the station yard;
[0077] Step 3-3: Since each sensor was used as a node in the graph structure during the early feature extraction and an anomaly detection model was established for each node during anomaly detection, it is possible to perform anomaly detection on the readings of all sensors in the station yard within a time window. Finally, it is found that the data monitored by a certain sensor may be abnormal, and the abnormal points are displayed on the visualization interface.
[0078] The present invention also provides an abnormal condition recognition system for oil and gas stations, including a data acquisition module, an abnormal condition recognition module, and a result display module; the data acquisition module is used to interface with the SCADA system in the station yard and regularly read the real-time sensor parameter information from the system; the abnormal condition recognition module is deployed with a trained abnormal condition recognition model for analyzing the data obtained from the data acquisition module; the result display module is used to correspond the analysis results of the abnormal condition recognition result module with the on-site sensors and display them on the visualization interface, providing the station yard management personnel with real-time viewing of the abnormal condition detection results of the station yard operating conditions.
[0079] As Figure 2 shown, it is the data waveform detected by a certain sensor during a certain period. The blue part is the normal period, and the red part is the abnormal period. As Figure 3 shown, it is the anomaly score of this sensor calculated by the anomaly detection method during this period. It can be observed that the proposed method can detect anomalies well.
[0080] The above are only the preferred embodiments of the present invention, and do not impose any limitations on the present invention. Any simple modifications, changes, and equivalent structural changes made to the above embodiments based on the technical essence of the present invention still fall within the protection scope of the technical solution of the present invention.
Claims
1. A method for identifying abnormal operating conditions in an oil and gas station, characterized in that, It includes the following execution steps: Step 1: Obtain the historical operation data of sensors related to production operation in the station, and preprocess it as the training set; Step 2: Use the training data to train the abnormal condition recognition model for the station yard, so that it can recognize abnormal conditions; Step 3: Deploy the model in the abnormal condition recognition system for oil and gas station yards, conduct real-time abnormal condition recognition for the station yard, and construct a visualization interface to associate and display the abnormal detection results and the corresponding sensors.
2. The abnormal condition identification method for oil and gas stations according to claim 1, characterized in that The data preprocessing includes the following steps: Step 1-1: Normalize each sensor data in all sensor data X = [x1, x2, …, x n within a fixed time period T; where n represents the number of sensors; Step 1-2: Segment the standardized sensor data according to a fixed time window to obtain training data where represents the data of one training batch after segmentation as the input of the model; represents the data of each sensor after segmentation, and t represents the size of the time window.
3. The abnormal condition identification method for oil and gas stations according to claim 1, wherein, The training of the abnormal condition recognition model includes the following steps: Step 2-1: Use the time series data processing method based on adaptive stationary to perform stationary processing on the data of each sensor within the time window; Step 2-2: Use the multi-source data feature extraction method based on graph neural network to fuse and extract features from the processed data of multiple sensors; Step 2-3: Establish an anomaly detection model based on autoencoder for each node, and use the obtained features as input for training to output anomaly detection results.
4. The abnormal condition identification method for oil and gas station fields according to claim 3, wherein, The time series data processing algorithm based on adaptive stationary includes the following steps: Step 2-1-1: Normalize each sensor data in the input data within its time window to obtain the processed data Step 2-1-2: Calculate the adaptive attention weight according to the processed data: se(X) = σ(W2δ(W1X)) Among them, σ represents the sigmoid activation function, and δ represents the Relu activation function; W1 and W2 represent the parameters of two fully connected layers. The parameter W1 reduces the dimension of the features at a reduction rate of r, and then after passing through the Relu activation, the result is dimensionally increased to the same dimension as the source features through the parameter W2; Step 2-1-3: For each sensor, calculate the adaptive stationary feature: Finally, the processed input features are obtained 5. The abnormal condition recognition method for oil and gas stations according to claim 3, characterized in that, The multi-source data feature extraction method based on graph convolutional neural network has the following steps: Step 2-2-1: Treat each data source as a node of the graph structure, construct the adjacency matrix through the graph adjacency relationship construction method to form the graph structure; the graph structure uses edges to describe the adjacency relationship between two nodes; Step 2-2-2: Establish a graph neural network according to the graph structure; Step 2-2-3: Input the graph structure into the graph convolutional neural network for feature extraction.
6. The abnormal condition identification method for oil and gas stations according to claim 5, characterized in that, The graph adjacency relationship construction method is a graph relationship construction method that fuses prior connection knowledge, and its steps are as follows: Step 2-2-1-1: Define a set of candidate relationship matrices according to the prior information of the connection relationships among sensors i: Among them, in the initial case, the candidates for sensor i are all sensors except itself; Step 2-2-1-2: Calculate the similarity between the feature vector of sensor i and the feature vector of its candidate relationship sensor j; Step 2-2-1-3: Select the K sensors with the closest distance to establish the adjacency relationship and add edges in the graph structure; Step 2-2-1-4: Repeat steps 2-2-1-1 to 2-2-1-3 until the relationships for all sensors are established to obtain the final adjacency matrix and the graph structure.
7. The abnormal condition identification method for oil and gas station fields according to claim 3, wherein The anomaly detection for the obtained features includes: establishing an anomaly detection model based on autoencoder for each node and performing anomaly detection on each node; The anomaly detection model is: h = σ(W1x′ + b1) where h represents the encoded feature, the decoded feature is represented as the model output, and x is the input to the entire anomaly detection and recognition model; The loss function during training is 8. The abnormal condition recognition system for oil and gas stations according to claim 1, characterized in that It includes a data acquisition module, an abnormal condition recognition module, and a result display module; The data acquisition module is used to interface with the SCADA system in the station yard and regularly read the real-time sensor parameter information from the system; The abnormal condition recognition module is deployed with a trained abnormal condition recognition model, which is used to analyze the data obtained from the data acquisition module; The result display module is used to correspond the analysis results of the abnormal working condition identification result module with the on-site sensors and display them on the visualization interface, providing the station managers with real-time viewing of the abnormal detection results of the station working conditions.