Petroleum pipeline abnormity early warning and monitoring method and system based on multi-source data fusion attention mechanism

By adopting a multi-source data fusion attention mechanism in oil pipeline abnormal warning, the problem of difficulty in capturing long-term dependencies is solved in the existing technology, and higher warning accuracy and reliability are achieved, especially in micro leakage detection.

CN120067935AActive Publication Date: 2025-05-30NORTHEAST GASOLINEEUM UNIV

Patent Information

Application Number
CN202510129756.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-05
Publication Date
2025-05-30
Estimated Expiration
2045-02-05

AI Technical Summary

Technical Problem

Existing oil pipeline anomaly warning algorithms are difficult to effectively capture long-term dependencies, resulting in difficulties in identifying long-term abnormal patterns (such as slow equipment degradation, long-term environmental impact, etc.).

Method used

The oil pipeline abnormality warning and monitoring method is adopted based on the multi-source data fusion attention mechanism, and a multi-source data fusion attention Transformer model is built to improve the accuracy of pipeline abnormality warning through segmented sequence embedding, multi-source data fusion attention module and adversarial learning method.

Benefits of technology

Effectively capturing the correlation between long-term dependencies and complex variables improves the accuracy and reliability of abnormal warnings in oil pipelines, especially in the detection of micro leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120067935A_ABST
    Figure CN120067935A_ABST
Patent Text Reader

Abstract

The invention discloses a petroleum pipeline abnormity early warning and monitoring method and system based on a multi-source data fusion attention mechanism and a petroleum pipeline abnormity early warning technology, and aims to realize early-stage tiny leakage abnormity detection of a petroleum pipeline through a multi-source data fusion technology and a deep learning technology. According to the technical key points, historical data of pipeline operation states are collected from sound wave, temperature, negative pressure wave and vibration sensors, and a data set is constructed; obtaining a time sequence segment code for algorithm training; constructing a fusion attention module for algorithm training; on the basis of the obtained multi-source data, an attention Transform model is fused, and an adversarial learning method is adopted for training so as to predict the future operation state of the petroleum pipeline; training a petroleum pipeline early warning model by using Gaussian distribution with learnable scale parameters; the trained multi-source data is fused with an attention Transform model to serve as a petroleum pipeline abnormity early warning model, future operation state abnormal behaviors are recognized, and the failure probability is obtained. According to the method, the multi-source data analysis technology and the deep learning technology are fused, and the innovative Gaussian kernel scaling parameters and the failure probability calculation method are combined, so that the accuracy and reliability of early warning of the abnormity of the petroleum pipeline are effectively improved, and the method particularly has important application value in the aspect of micro leakage detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method and system for abnormal early warning and monitoring of oil pipelines based on a multi-source data fusion attention mechanism, and particularly relates to the abnormal early warning technology of oil pipelines, belonging to the field of intelligent pipeline operation and maintenance. Background Art

[0002] As an important energy transportation channel, oil pipelines undertake a large number of energy transportation tasks. With the increasing global energy demand, oil pipelines are used more and more widely. However, during long-term use, oil pipelines are affected by various factors such as the external environment, pipeline aging, corrosion, and mechanical damage, and are prone to leakage, explosion, or other safety accidents, resulting in huge social and economic losses. To ensure public safety and the stability of energy supply, it is crucial to detect and handle potential abnormalities in pipelines in a timely manner.

[0003] Although deep learning technology has made remarkable progress in various fields and shown great potential in the abnormal early warning of oil pipelines, there are still some deficiencies in practical applications at present. First, the state monitoring data of oil pipelines come from multiple different sensors (such as pressure, temperature, acoustic wave, stress, etc.), and these data are of various types and formats. How to effectively fuse these multi-source data and improve the accuracy and robustness of the model is a major problem faced by the current abnormal early warning technology. Second, for long time series, the occurrence of abnormalities may be related to both global features (such as long-term trends) and local features (such as sudden changes in a short period of time). Existing models have limited ability to combine global and local features and often cannot capture both global trends and short-term abnormalities simultaneously, which may lead to unsatisfactory abnormal early warning effects. Therefore, how to achieve precise abnormal early warning of oil pipelines by combining existing advanced technologies is an urgent problem to be solved. There are few studies in the existing literature specifically targeting the abnormal early warning of oil pipelines.

[0004] The Transformer captures global dependencies through the self-attention mechanism, can effectively model long-time-span data, and is especially suitable for dealing with scenarios where complex long-term trends and short-term fluctuations coexist. Among them, the multi-head attention mechanism enables it to simultaneously focus on the interaction relationships of multi-dimensional features, demonstrating powerful multi-time-scale feature extraction and the ability to adapt to complex dynamic systems. However, existing studies have failed to separately consider the associations within variables and between variables, which may lead to the model starting from a vague perspective when learning the association patterns between different variables, thus resulting in biases. In fact, different variables in multivariate time series represent various influencing factors in the research problem, and each variable has a unique data distribution and time pattern. In addition, another problem with existing methods is that they usually optimize specific statistical metrics (such as mean squared error (MSE), mean absolute error (MAE), or likelihood loss) to minimize the point-wise differences between the true values and the predicted values. However, this point-wise optimization objective has difficulties in modeling the random behavior in real-world time series, resulting in unreliable future data trends in predictions, thereby reducing the early warning accuracy.

[0005] Therefore, existing intelligent methods cannot achieve the accurate rate of oil pipeline early warning. Designing a new algorithm to effectively model long-time-span multivariate time series and effectively detect early tiny leaks has become extremely important and imperative in the field of intelligent operation and maintenance of oil pipelines. Summary of the Invention

[0006] To solve the technical problems mentioned in the background art: Existing anomaly early warning algorithms are unable to effectively capture long-term dependencies when dealing with time series data with a long time span. This makes it difficult for them to identify long-period anomaly patterns (such as slow equipment degradation, long-term environmental impacts, etc.), and these anomalies are often potential major risks. Therefore, the present invention proposes an oil pipeline anomaly early warning monitoring method and system based on a multi-source data fusion attention mechanism to improve the accuracy of pipeline anomaly early warning.

[0007] The technical solution adopted by the present invention to solve the above technical problems is: An oil pipeline anomaly early warning monitoring method based on a multi-source data fusion attention mechanism, the method comprising the following steps:

[0008] Step 1: Collect historical data on the operating status of the pipeline from acoustic wave, temperature, negative pressure wave, and vibration sensors, and construct a data set in the form of: where T is the length of the retrospective window, and D = 4 is the dimension of the variable (i.e., the number of sensors).

[0009] Step 2: Design a segmented sequence embedding method, and obtain the time series segmented encoding according to the following path for algorithm training:

[0010] Step 2.1: First, split the input sequence of each variable in the dataset collected in Step 1 into multiple non-overlapping sequences of length L seg :

[0011]

[0012] x i,d ={x t,d ||(i - 1)×L seg ≤t≤i×L seg} (2)

[0013] where x i,d is the i-th time series segment, with length L seg , and dimension d; x t,d is the t-th step of the i-th segment, with dimension d.

[0014] Step 2.2: Then, embed each time series segment obtained in Step 2.1 into a vector through a learnable linear transformation and trainable positional encoding:

[0015]

[0016] where u i,d represents the embedded vector, is the learnable projection matrix for segment embedding.

[0017] is the learnable positional encoding at position (i, d), aiming to provide the sequentiality of the time pattern. Then, the two-dimensional vector array representing can be obtained as follows:

[0018]

[0019] where

[0020] Step 3: Construct a multi-source data fusion attention module including intra-segment variable attention and inter-segment variable attention for Transformer model training:

[0021] Step 3.1: First, based on the two-dimensional array obtained in Step 2.2, as the input of the intra-segment variable attention sub-module in the fusion attention module, then learn the dependency relationships between different d-dimensional segments through the following method:

[0022]

[0023] where represent all segments within the d - dimension of the (l - 1)-th layer, where 1 ≤ d ≤ D is the dimension of the time series (consistent with the number of sensors described in Step 1, being the same variable), is the hidden representation of the l - th layer, and LayerNorm is the most commonly used activation function in Transformer training. Feed - Forward represents a fully connected neural network. MSWAA represents a multi - layer segmented variable - within attention sub - module, where 1 ≤ l ≤ L is the number of layers of MSWAA, and are the query vector, key vector, and value vector of MSWAA. are respectively the parameter matrices at the l - th layer.

[0024] Step 3.2: Further, the output of the L - th layer in MSWAA is transmitted to the first layer in the multi - layer segmented variable - between attention sub - module (MSWEA):

[0025]

[0026] where, represents the output of the MSWAA layer. are the query vector, key vector, and value vector of MSWEA. are respectively the parameter matrices at the first layer. The variable - dependency relationship of the k - th layer can be captured by the following:

[0027]

[0028] where, are the query vector, key vector, and value vector of the k - th layer of MSWEA. are respectively the parameter matrices at the k - th layer.

[0029] Step 4: Based on the multi - source data fusion attention Transformer model obtained in Step 3, an adversarial learning method is used for training to predict the future operating state of the oil pipeline.

[0030] Step 4.1: First, by optimizing the following function, make the multi - source data fusion attention Transformer model generate values close to the true future operating state of the oil pipeline:

[0031]

[0032] where, and represent the optimal parameters of the multi - source data fusion attention Transformer and the discriminator respectively. is the obtained synthetic sequence through the following function:

[0033]

[0034] Among them, Concat represents the association operation. Represents the time series within the next τ time steps.

[0035] Step 4.2: Based on the predicted operating state, construct the multi-source data fusion attention Transformer loss function as:

[0036]

[0037] Among them, Represents the expectation, D(·) represents the output of the discriminator. If the input is real data, the output is 1, otherwise the output is 0. The discriminator is implemented by three fully connected layers and a Sigmoid activation function. The discriminator is trained by optimizing the following function to distinguish between synthetic sequences and real sequences:

[0038]

[0039] Among them, Is the real data, obtained through the following function:

[0040]

[0041] Step 4.3: L D Represents the objective function of the real sequence and the synthetic sequence, and its expression is as follows:

[0042]

[0043] Step 5: Train the oil pipeline early warning model using a Gaussian distribution with a learnable scale parameter σ:

[0044] Step 5.1: First, calculate the association weight of the i-th time point relative to the j-th time point:

[0045]

[0046] Among them, Represents the learnable scale parameter Of the distribution, where i represents The i-th time point in. Rescale represents the replay operation of converting the Gaussian distance to a discrete distribution.

[0047] Step 5.2: Secondly, obtain the attention map in the multi-source data fusion attention Transformer from Step 3.2 as the prediction time series association weight:

[0048]

[0049] Among them, is the attention map, and Softmax is the activation function used to normalize the attention map.

[0050] are the query vector, key vector, and value vector of the l-th layer respectively.

[0051] Step 5.3: Finally, train the early warning model by minimizing the difference between the Gaussian distribution and the attention map:

[0052]

[0053] Among them, KL(·∥·) represents the Kullback-Leibler divergence.

[0054] Step 6: Use the multi-source data fusion attention Transformer model trained in Step 5.3 as the oil pipeline anomaly early warning model to identify abnormal behaviors in future operating states and obtain the failure probability in the following way:

[0055]

[0056] Among them, σ n and σ f are the normal critical value and failure critical value of the learnable scale parameter.

[0057] Furthermore, in Step 1, historical data on the pipeline operating state is collected from acoustic wave, temperature, negative pressure wave, and vibration sensors to construct a dataset for realizing the fusion of multi-source data.

[0058] Furthermore, in Step 3, Transformer is adopted as the basic framework of the anomaly early warning model.

[0059] Furthermore, in Step 3, the output of the multi-layer segmented variable intra-attention sub-module is used as the input of the multi-layer segmented variable inter-attention sub-module, and finally the time series of the future operating state of the oil pipeline is predicted.

[0060] Furthermore, in Step 4, a discriminator is introduced to train the multi-source data fusion attention Transformer model.

[0061] Furthermore, in Step 5, a Gaussian distribution with a learnable scale parameter σ is introduced as the standard for calculating the failure probability.

[0062] Further, in step 6, the trained multi-source data fusion attention Transformer model is used to identify future abnormal operating behaviors and obtain failure probabilities. After processing the oil pipeline data through steps 1 to 5, it is used as input for oil pipeline anomaly warning.

[0063] An oil pipeline anomaly warning and monitoring system based on a multi-source data fusion attention mechanism, the system has program modules corresponding to the steps of the above technical solution, and executes the steps in the oil pipeline anomaly warning and monitoring method based on the multi-source data fusion attention mechanism when running.

[0064] A computer-readable storage medium stores a computer program, and the computer program is configured to implement the steps of the oil pipeline anomaly warning and monitoring method based on the multi-source data fusion attention mechanism when called by a processor.

[0065] An oil pipeline anomaly warning and monitoring device includes at least one processor and a memory communicatively connected to the at least one processor. The memory stores instructions executable by the at least one processor. When the instructions are executed by the at least one processor, the at least one processor can execute the above-mentioned oil pipeline anomaly warning and monitoring method based on the multi-source data fusion attention mechanism to achieve anomaly warning of the oil pipeline.

[0066] The present invention has the following beneficial technical effects:

[0067] An oil pipeline anomaly warning model based on a multi-source data fusion attention mechanism according to the present invention aims to solve the deficiency that when using multi-variable time series as input, the associations within and between variables are not considered separately, resulting in the model tending to learn the association patterns between different variables from a fuzzy perspective.

[0068] Specifically, the present invention considers the following issues:

[0069] 1. Existing research does not consider the associations within and between variables separately (for example, using a convolutional network to directly capture dependencies from a multi-variable time series matrix), which may cause the model to tend to learn the association patterns between different variables from a fuzzy perspective.

[0070] 2. Existing studies usually optimize specific statistical metrics (such as mean squared error (MSE), mean absolute error (MAE), or likelihood loss) to minimize the difference between the true value and the predicted value point by point. However, this point-wise objective is difficult to simulate the random behavior inherent in real-world time series, resulting in unreliable predicted future data trends. In addition, MSE achieves global optimality by optimizing the average of all possible outcomes of the model, which may lead to the loss of fine-grained features of the time series.

[0071] The present invention aims to achieve early detection of minor leakage anomalies in oil pipelines through multi-source data fusion technology and deep learning technology. The method includes the following steps: Step 1, collect historical data on the operating status of the pipeline from acoustic wave, temperature, negative pressure wave, and vibration sensors to construct a data set; Step 2, obtain time series segment encoding for algorithm training; Step 3, construct a fusion attention module for Transformer model training; Step 4, based on the multi-source data fusion attention Transformer model obtained in Step 3, use adversarial learning methods for training to predict the future operating status of the oil pipeline; Step 5, train an oil pipeline warning model using a Gaussian distribution with a learnable scale parameter σ; Step 6, use the multi-source data fusion attention Transformer model that has been trained in Step 5 as an oil pipeline anomaly warning model to identify abnormal behaviors in the future operating status and obtain the failure probability. By integrating multi-source data analysis technology and deep learning technology, and combining an innovative Gaussian kernel scaling parameter and failure probability calculation method, the present invention effectively improves the accuracy and reliability of oil pipeline anomaly warning, especially having important application value in minor leakage detection.

[0072] The effectiveness of the method of the present invention is reflected in the following aspects in the invention content:

[0073] 1. The method of the present invention first introduces a segmented sequence embedding method, which divides the input sequence into multiple segments and embeds them into a two-dimensional vector array corresponding to time and factors.

[0074] 2. The method of the present invention proposes a multi-source data fusion attention mechanism composed of intra-segment variable attention and inter-segment variable attention to integrate the time-dependent information within a single variable and the interaction effect information between different variables.

[0075] 3. The method of the present invention introduces an auxiliary discriminator to learn the comprehensive representation of the historical sequence and form the distribution of the predicted value. The adversarial learning process between the discriminator and the multi-source data fusion attention Transformer model pushes the prediction towards the region with a higher probability of containing real features in the solution space, which helps to overcome the weakness of the point-to-single objective function and improve the accuracy of sequence-level inference.

[0076] 4. The method of the present invention constructs a loss function for the anomaly warning model using a Gaussian kernel with a learnable scale parameter, converts the predicted state into a failure probability, and the evolution pattern of the target historical sequence can be effectively transferred to future time points. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] Figure 1 is the core diagram of the multi-source data fusion attention Transformer model according to an embodiment of the present invention;

[0078] Figure 2 is the core diagram of the segmented variable intra-attention sub-module network according to an embodiment of the present invention;

[0079] Figure 3 is the core diagram of the segmented variable inter-attention sub-module network according to an embodiment of the present invention;

[0080] Figure 4 、 Figure 5 、 Figure 6 are the visualization result diagrams according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0081] The following is a further description of the present invention in conjunction with the attached Figures 1-6 drawings:

[0082] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application.

[0083] Figure 1 is the anomaly warning flow chart of the multi-source data fusion attention Transformer model in the technical solution of the present invention, and the entire flow chart is completely implemented by programming in the Python language (of course, other programming languages can also be used to implement it). According to Figure 1 it can be seen that first, historical data on the pipeline operation status needs to be collected from acoustic wave, temperature, negative pressure wave, and vibration sensors to construct a data set; obtain time series segmented encoding for algorithm training; construct a fusion attention module for algorithm training; use an adversarial learning method to train a multi-source data fusion attention Transformer model to predict the future operation status of the oil pipeline; train an oil pipeline warning model using a Gaussian distribution with a learnable scale parameter σ; use the trained multi-source data fusion attention Transformer model as an oil pipeline anomaly warning model to identify abnormal behaviors in the future operation status and obtain the failure probability.

[0084] Embodiment: Taking on-site pipeline monitoring data as an example, the effectiveness of the method of the present invention is verified.

[0085] Step 1: Collect historical data on the pipeline operating status from acoustic wave, temperature, negative pressure wave, and vibration sensors, and construct a dataset in the form of: where T is the length of the retrospective window, and D = 4 is the dimension of the variables (i.e., the number of sensors).

[0086] Step 2: Design a segmented sequence embedding method, and obtain time series segmented encodings according to the following path for algorithm training:

[0087] Step 2.1: First, split the input sequence of each variable in the dataset collected in Step 1 into multiple non-overlapping sequences of length L seg :

[0088]

[0089] x i,d ={x t,d ||(i - 1)×L seg ≤t≤i×L seg} (2)

[0090] where x i,d is the i-th time series segmentation segment, with a length of L seg , and a dimension of d; x t,d is the t-th step of the i-th paragraph, with a dimension of d.

[0091] Step 2.2: Then, through a learnable linear transformation and a trainable positional encoding, embed each time series segmentation segment obtained in Step 2.1 into a vector:

[0092]

[0093] where u i,d represents the embedded vector, is the learnable projection matrix for segmented embedding.

[0094] is the learnable positional encoding at position (i, d), designed to provide the sequentiality of time patterns. Then, a two-dimensional vector array representing can be obtained as follows:

[0095]

[0096] where,

[0097] Step 3: Construct a multi-source data fusion attention module including segmented intra-variable attention and segmented inter-variable attention for Transformer model training:

[0098] Step 3.1: First, based on the two-dimensional array obtained in Step 2.2, as the input of the segmented variable intra-attention sub-module in the fusion attention module, and then learn the dependencies between different segments of dimension d through the following method:

[0099]

[0100] where, represents all segments within dimension d of the (l - 1)-th layer, 1 ≤ d ≤ D is the dimension of the time series (consistent with the number of sensors described in Step 1, being the same variable), is the hidden representation of the l-th layer, LayerNorm is the activation function most commonly used in Transformer training. Feed-Forward represents a fully connected neural network. MSWAA represents a multi-layer segmented variable intra-attention sub-module, 1 ≤ l ≤ L is the number of layers of MSWAA, where are the query vector, key vector, and value vector of MSWAA. are respectively the parameter matrices at the l-th layer.

[0101] Step 3.2: Further, the output of the L-th layer in MSWAA is transmitted to the first layer in the multi-layer segmented variable inter-attention sub-module (MSWEA):

[0102]

[0103] where, represents the output of the MSWAA layer. are the query vector, key vector, and value vector of MSWEA. are respectively the parameter matrices at the first layer. The variable dependencies of the k-th layer can be captured through the following:

[0104]

[0105] where, are the query vector, key vector, and value vector of the k-th layer of MSWEA. are respectively the parameter matrices at the k-th layer.

[0106] Step 4: Based on the multi-source data fusion attention Transformer model obtained in Step 3, an adversarial learning method is adopted for training to predict the future operating state of the oil pipeline.

[0107] Step 4.1: First, by optimizing the following function, make the multi-source data fusion attention Transformer model generate future operating state values of the oil pipeline close to the real ones:

[0108]

[0109] Among them, and represent the optimal parameters of the multi-source data fusion attention Transformer and the discriminator respectively. is the synthetic sequence obtained through the following function:

[0110]

[0111] Among them, Concat represents the concatenation operation. represents the time series within the future τ time steps.

[0112] Step 4.2: Based on the predicted operating state, construct the loss function of the multi-source data fusion attention Transformer as:

[0113]

[0114] Among them, represents the expectation, D(·) represents the output of the discriminator. If the input is real data, the output is 1, otherwise the output is 0. The discriminator is implemented by three fully connected layers and a Sigmoid activation function. The discriminator is trained by optimizing the following function to distinguish between synthetic sequences and real sequences:

[0115]

[0116] Among them, is the real data, obtained through the following function:

[0117]

[0118] Step 4.3: L D represents the objective function of the real sequence and the synthetic sequence, and its expression is as follows:

[0119]

[0120] Figure 2 and Figure 3 explain the calculation process of the attention within the segmented variables and the attention between the segmented variables.

[0121] Step 5: Train the oil pipeline early warning model using a Gaussian distribution with a learnable scale parameter σ:

[0122] Step 5.1: First, calculate the correlation weight of the \(i\)-th time point relative to the \(j\)-th time point:

[0123]

[0124] where represents the learnable scale parameter of the distribution, where \(i\) represents the \(i\)-th time point in . Rescale represents the replay operation that converts the Gaussian distance to a discrete distribution.

[0125] Step 5.2: Secondly, obtain the attention map in the multi-source data fusion attention Transformer from Step 3.2 as the predicted time series correlation weight:

[0126]

[0127] where is the attention map, and Softmax is the activation function used to normalize the attention map.

[0128] are the query vector, key vector, and value vector of the \(l\)-th layer respectively.

[0129] Step 5.3: Finally, train the early warning model by minimizing the difference between the Gaussian distribution and the attention map:

[0130]

[0131] where KL(·∥·) represents the Kullback-Leibler divergence.

[0132] Step 6: Use the multi-source data fusion attention Transformer model trained in Step 5.3 as the oil pipeline anomaly early warning model to identify abnormal behaviors in future operating states and obtain the failure probability, as follows:

[0133]

[0134] where \(\sigma\) n and \(\sigma\) f are the normal critical value and failure critical value of the learnable scale parameter.

[0135] As can be seen from the attached Figures 4-6 provided, the present invention can learn the long-term time dependence relationship and complex variable correlation in the multi-sensor data of the oil pipeline, and further improve the prediction accuracy of the Transformer model by means of an auxiliary discriminator.

[0136] The present invention provides Figure 2 andFigure 3 collectively describe the calculation process of the fusion attention module in step 3, where Figure 2 shows the within-segment variable attention, Figure 3 shows the between-segment variable attention. Figure 4 is the effect diagram obtained after the laboratory fault data is monitored in real time by this technology; Figure 5 is the effect diagram obtained after the laboratory normal data is monitored in real time by this technology;

[0137] Figure 6 is the effect diagram obtained after the on-site fault data is monitored in real time by this technology. Prediction model training: First, the multi-source data is processed in a segmented manner. Each segment of data will be embedded into different vectors and marked with time points to obtain the corresponding position information encoding. Then, the embedded multi-source data vectors pass through Figure 2 (the within-segment variable attention mechanism) for processing to capture the internal relationship between each variable (each type of sensor data) at different time points, and then learn the evolution process of the pipeline's attributes over time. After completing the modeling of the internal relationships of all variables, use Figure 3 (the between-segment variable attention mechanism) to model the relationships between all sensor data, so as to learn the changes in the overall operating state of the pipeline during the co-evolution of various attributes. Detection model training: After Figure 3 obtain the attention distribution of multi-source data, and at the same time calculate and obtain the Gaussian distribution of multi-source data. Calculate the difference between the two, and use the learnable scale parameter in the Gaussian distribution to characterize the failure probability. Detection model usage: After the multi-source data is input into the prediction model, the future operating state of the pipeline is output. Anomaly detection is performed every 20 minutes by combining historical data and the future operating state. From the above description, the following conclusions can be drawn: The multi-source data fusion attention Transformer model can efficiently integrate information from different sensors and data sources, and accurately predict the future operating state of the oil pipeline. Based on this prediction model, the failure probability of the pipeline can be further calculated, so as to provide real-time and accurate early warnings, help maintenance personnel take effective measures before the occurrence of faults, reduce the risks in pipeline operation, and improve the safety and stability of the pipeline.

[0138] It has been verified that the method proposed in the present invention solves the technical problems proposed in the present invention. The method described in the present invention has been practically applied to verify the technical effects and practicality claimed in the present invention. The anomaly warning algorithm provided by the present invention can effectively capture long-term dependence relationships when processing time series data with a long time span. It overcomes the difficulties in identifying long-term anomaly patterns such as slow equipment degradation and long-term environmental impacts, and improves the accuracy of pipeline anomaly warning.

[0139] The method described in the present invention has been verified by simulation experiments and practical applications, and the technical effects claimed in the present invention have been verified.

[0140] The algorithm (method) proposed by the present invention is the underlying technical core of the present invention, and various products can be derived based on the algorithm.

[0141] Based on the algorithm (method) proposed by the present invention, a petroleum pipeline anomaly early warning and monitoring system based on a multi-source data fusion attention mechanism is developed using a programming language. The system has program modules corresponding to the steps of the above technical solution, and when running, executes the steps in the above-mentioned method for early warning and monitoring of petroleum pipeline anomalies based on a multi-source data fusion attention mechanism.

[0142] The computer program of the developed system (software) is stored on a computer-readable storage medium. The computer program is configured to implement the steps of the above-mentioned method for early warning and monitoring of petroleum pipeline anomalies based on a multi-source data fusion attention mechanism when called by a processor. That is, the present invention is materialized on a carrier to become a computer program product.

[0143] A petroleum pipeline anomaly early warning and monitoring device based on a multi-source data fusion attention mechanism, the device includes at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the above-mentioned method for early warning and monitoring of petroleum pipeline anomalies based on a multi-source data fusion attention mechanism, so as to realize early warning of abnormal situations of petroleum pipelines.

[0144] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuitry, integrated circuit systems, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, the programmable processor can be a special or general programmable processor, and can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.

[0145] The computing procedures (also referred to as programs, software, software applications, or code) in the present invention include machine instructions for a programmable processor, and these computing procedures can be implemented using high-level procedures and / or object-oriented programming languages, and / or assembly / machine languages. As used in the present invention, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or apparatus (e.g., magnetic disks, optical disks, memories, programmable logic device PLD) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0146] It should be understood that various forms of the processes shown above can be used, steps can be reordered, added, or deleted. For example, the steps recited in the present application can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in the present application can be achieved, all within the protection scope of the present invention.

Claims

1. A method for abnormal early warning monitoring of oil pipelines based on multi-source data fusion attention mechanism, characterized in that: The oil pipeline abnormality early warning monitoring method is an oil pipeline abnormality early warning method for multi-sensor data sets, and the implementation process is: Step 1: Collect historical data on pipeline operation status and build a data set in the form of: Where T is the length of the lookback window, and D is the dimension of the variable, i.e., the number of sensors; Step 2: Design a segmented sequence embedding method and obtain the time series segment encoding according to the following path for algorithm training: Step 2.1: First, split the input sequence of each variable in the dataset collected in step 1 into L seg Multiple non-overlapping sequences of : x i,d ={x t,d ∣∣(i-1)×L seg ≤t≤i×L seg } (2) Among them, x i,d is the i-th time series segment, with a length of L seg , dimension is d; x t,d is the tth step length of the ith paragraph, with dimension d; Step 2.2: Then, each time series segment obtained from step 2.1 is embedded into a vector through a learnable linear transformation and a trainable positional encoding: Among them, u i,d represents the embedded vector, is a learnable projection matrix for piecewise embedding; is a learnable positional encoding of the position (i, d) that provides sequentiality of temporal patterns; it is represented A two-dimensional vector array As shown below: in, Step 3: Construct a multi-source data fusion attention module including segmented intra-variable attention and segmented inter-variable attention for Transformer model training: Step 3.1: First, take the two-dimensional array obtained in step 2.2 As the basis, it is used as the input of the attention submodule in the segmented variable in the fusion attention module, and then the dependencies between different segments in d dimension are learned by the following method: in, represents all segments in the d-dimensional layer of the l-1 layer. 1≤d≤D is the dimension of the time series, which is consistent with the number of sensors described in step 1 and is the same variable. is the hidden representation of the lth layer, LayerNorm is the most commonly used activation function in Transformer training; Feed-Forward represents a fully connected neural network; MSWAA represents a multi-layer piecewise variable intra-attention submodule, 1≤l≤L is the number of layers of MSWAA, where are the query vector, key vector and value vector of MSWAA; They are The parameter matrix at layer l; Step 3.2: Further, the output of the Lth layer in MSWAA is transferred to the first layer in the multi-layer piecewise inter-variable attention submodule (MSWEA): in, Represents the output of the MSWAA layer; are the query vector, key vector and value vector of MSWEA; They are In the parameter matrix at layer 1, the variable dependencies at layer k can be captured as follows: in, are the query vector, key vector, and value vector of the k-th layer of MSWEA; They are The parameter matrix at the kth layer; Step 4: Based on the multi-source data obtained in step 3, the attention Transformer model is fused and trained using the adversarial learning method to predict the future operation status of the oil pipeline; Step 4.1: First, the multi-source data fusion attention Transformer model generates a future operating state value of the oil pipeline that is close to the actual value by optimizing the following function: in, and They represent the optimal parameters of the multi-source data fusion attention Transformer and discriminator respectively; The synthetic sequence is obtained by the following function: Among them, Concat represents the association operation; Represents the time series in the future τ time steps; Step 4.2: Based on the predicted running status, construct the multi-source data fusion attention Transformer loss function as: in, represents the expectation, D(·) represents the output of the discriminator, if the input is real data, the output is 1, otherwise the output is 0; the discriminator is implemented by three fully connected layers and a Sigmoid activation function; the discriminator is trained by optimizing the following function to distinguish synthetic sequences from real sequences: in, It is real data, obtained through the following function: Step 4.3: L D The objective function representing the real sequence and the synthetic sequence is expressed as follows: Step 5: Train the oil pipeline early warning model using a Gaussian distribution with a learnable scale parameter σ: Step 5.1: First, calculate the association weight of the i-th time point relative to the j-th time point: in, Represents a learnable scale parameter The distribution of The i-th time point in ; Rescale represents the replay operation of converting the Gaussian distance into a discrete distribution; Step 5.2: Secondly, obtain the attention map in the multi-source data fusion attention Transformer from step 3.2 as the predicted time series association weight: in, is the attention map, and Softmax is the activation function used to normalize the attention map; are the query vector, key vector, and value vector of the lth layer respectively; Step 5.3: Finally, the early warning model is trained by minimizing the difference between the Gaussian distribution and the attention map: Where KL(·∥·) represents the Kullback-Leibler divergence; Step 6: Use the multi-source data fusion attention Transformer model trained in step 5.3 as the oil pipeline abnormality warning model to identify abnormal behaviors in future operating states and obtain failure probabilities as follows: Among them, σ n and σ f are the normal critical value and fault critical value of the learnable scale parameter.

2. The petroleum pipeline abnormality early warning monitoring method according to claim 1 is characterized in that: In step 1, historical data of pipeline operation status are collected from sound wave, temperature, negative pressure wave, and vibration sensors to construct a data set.

3. The petroleum pipeline abnormality early warning monitoring method according to claim 1 is characterized in that: In step 3, Transformer is used as the basic framework of the abnormal warning model.

4. The petroleum pipeline abnormality early warning monitoring method according to claim 1 is characterized in that: In step 3, the output of the multi-layer segmented variable intra-attention submodule is used as the input of the multi-layer segmented variable inter-attention submodule, and finally the predicted future operating status time series of the oil pipeline is obtained.

5. The petroleum pipeline abnormality early warning monitoring method according to claim 1 is characterized in that: In step 4, the discriminator is introduced to train the multi-source data fusion attention Transformer model.

6. The petroleum pipeline abnormality early warning monitoring method according to claim 1 is characterized in that: In step 5, a Gaussian distribution with a learnable scale parameter σ is introduced as a criterion for calculating the failure probability.

7. The petroleum pipeline abnormality early warning monitoring method according to claim 1 is characterized in that: In step 6, the trained multi-source data fusion attention Transformer model is used to identify abnormal behaviors in future operating states and obtain failure probabilities. The oil pipeline data needs to be processed in steps 1 to 5 and used as input for oil pipeline abnormality warning.

8. An abnormal early warning monitoring system for oil pipelines based on multi-source data fusion attention mechanism, characterized by: The system has a program module corresponding to the steps of any one of claims 1 to 7, and executes the steps in the oil pipeline abnormality early warning monitoring method based on multi-source data fusion attention mechanism during operation.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is configured to implement the steps of the oil pipeline abnormality early warning monitoring method based on multi-source data fusion attention mechanism described in any one of claims 1-7 when called by a processor.

10. An abnormal early warning monitoring device for oil pipelines, characterized in that: The oil pipeline abnormality early warning monitoring device includes at least one processor and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the oil pipeline abnormality early warning monitoring method based on multi-source data fusion attention mechanism described in any one of claims 1-7 to realize abnormal early warning of the oil pipeline.

Citation Information

Patent Citations

  • Power machine room anomaly detection method, device and equipment and readable storage medium

    CN115078894A

  • Time sequence anomaly detection method and system based on time sequence and multiple variables

    CN117313015A

  • Internet of Things time series data anomaly detection method and system based on dynamic graph attention

    CN118094427A

  • APT covert channel identification method and system based on multi-mode anomaly detection

    CN119066464A

  • Abnormality detection device, abnormality detection method, and program

    JP2020052740A

Cited By

  • Heterogeneous flow analysis method, device and system driven by intelligent large model

    CN120358103A

  • Petroleum transportation safety supervision method and system based on artificial intelligence

    CN120429724A

  • Multi-source sensor oil tank data monitoring and abnormity early warning method and system

    CN120820202A

  • Multi-disaster prediction method based on multi-source heterogeneous data fusion in process from open mining to underground mining

    CN121071823A

  • A multi-disaster prediction method for multi-source heterogeneous data fusion in open-pit to underground mining process

    CN121071823B