An oil pipeline abnormality early warning monitoring method and system based on a multi-source data fusion attention mechanism

By using a Transformer model with a multi-source data fusion attention mechanism, the problem of combining global and local features in oil pipeline anomaly early warning was solved. This enabled the effective capture of long-term data and accurate learning of variable correlation patterns, thereby improving the accuracy and reliability of early warning.

CN120067935BActive Publication Date: 2026-04-10NORTHEAST GASOLINEEUM UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-05
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing oil pipeline anomaly early warning algorithms cannot effectively capture global and local features over long periods of time, resulting in unsatisfactory anomaly early warning effects. Furthermore, there are biases in multi-source data fusion and variable correlation pattern learning, which affect the accuracy of early warning.

Method used

We employ a multi-source data fusion attention mechanism approach, which combines segmented sequence embedding, multi-layer variable internal and external attention mechanisms, and adversarial learning with a Gaussian distribution of learnable scale parameters to construct a Transformer model for early warning of oil pipeline anomalies.

Benefits of technology

It improves the accuracy and reliability of early warning for oil pipeline anomalies, and has important applications, especially in the detection of minute leaks. It can effectively capture long-term dependencies and correlations between variables, thus improving the accuracy and reliability of early warning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120067935B_ABST
    Figure CN120067935B_ABST
Patent Text Reader

Abstract

A kind of oil pipeline abnormal early warning monitoring method and system based on multi-source data fusion attention mechanism, oil pipeline abnormal early warning technology, to realize the early small leakage anomaly detection of oil pipeline by multi-source data fusion technology and deep learning technology.Technical points: collect pipeline operation state historical data from acoustic wave, temperature, negative pressure wave, vibration sensor, construct data set;Get time series segmentation code for algorithm training;Build fusion attention module for algorithm training;Based on the obtained multi-source data fusion attention Transformer model, adopt the training method of adversarial learning to predict the future operation state of oil pipeline;Use the Gaussian distribution with learnable scale parameter to train the oil pipeline early warning model;Use the trained multi-source data fusion attention Transformer model as the oil pipeline abnormal early warning model to identify the abnormal behavior of future operation state and obtain the failure probability.The present application effectively improves the accuracy and reliability of oil pipeline abnormal early warning by combining multi-source data analysis technology and deep learning technology, and using innovative Gaussian kernel scaling parameter and failure probability calculation method, which has important application value in small leakage detection.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to an oil pipeline abnormality early warning monitoring method and system based on a multi-source data fusion attention mechanism, in particular to an oil pipeline abnormality early warning technology, and belongs to the field of pipeline intelligent operation and maintenance. BACKGROUND

[0002] As an important energy transportation channel, oil pipelines bear a large amount of energy transportation tasks. With the increasing global energy demand, oil pipelines are being used more and more widely. However, oil pipelines are susceptible to external environment, pipeline aging, corrosion, mechanical damage and other factors during long-term use, and are prone to leakage, explosion or other safety accidents, causing huge social and economic losses. In order to ensure public safety and the stability of energy supply, it is crucial to discover and handle potential pipeline abnormalities in a timely manner.

[0003] Although deep learning technology has made significant progress in various fields and shows great potential in oil pipeline abnormality early warning, there are still some deficiencies in practical application. First, the state monitoring data of oil pipelines come from multiple different sensors (such as pressure, temperature, sound 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 big problem faced by current abnormality early warning technology. Secondly, 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 sharp changes in short time). The existing models have limited ability to combine global features and local features, and often cannot capture both global trends and short-term abnormalities, which may lead to unsatisfactory results of abnormality early warning. Therefore, how to combine existing advanced technologies to achieve accurate abnormality early warning of oil pipelines is an urgent problem to be solved. There are few studies in existing literature that are specifically aimed at oil pipeline abnormality early warning.

[0004] Transformers capture global dependencies through self-attention mechanisms, effectively model long time span data, and are particularly suitable for handling complex long-term trends and short-term fluctuations coexisting scenarios. Among them, the multi-head attention mechanism enables it to focus on the interaction of multi-dimensional features at the same time, showing strong multi-time scale feature extraction and adaptability to complex dynamic systems. However, existing research has failed to consider the correlation between variables and the correlation between variables, which may lead to bias when learning the correlation patterns between different variables from a blurred perspective. 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 indicators (such as mean squared error (MSE), mean absolute error (MAE), or likelihood loss) to minimize the point-by-point difference between the true value and the predicted value. However, this point-by-point optimization objective has difficulties in modeling the random behavior of real-world time series, resulting in unreliable future data trends in predictions, thereby reducing the accuracy of early warning.

[0005] Therefore, the existing intelligent method cannot achieve the accuracy of oil pipeline early warning. It has become extremely important and imperative to design a new algorithm to effectively model long time span multivariate time series and effectively detect early micro-leakage in the field of intelligent operation and maintenance of oil pipelines. SUMMARY

[0006] To solve the technical problems mentioned in the background art: existing anomaly early warning algorithms cannot effectively capture long-term dependencies when processing long time span time series data. This makes it difficult for them to identify long-period abnormal patterns such as slow device degradation, long-term environmental impact, etc., and these abnormalities often represent potential major risks, so the present application 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 application 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 pipeline operation state historical data 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 backtracking window, and D = 4 is the dimensionality of the variables (i.e., the number of sensors).

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

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

[0011]

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

[0013] Where, x i,d It is the i-th time series segment with length L. seg The dimension is d; x t,d It is the t-th step size of the i-th paragraph, with dimension d.

[0014] 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:

[0015]

[0016] Among them, u i,d Represents the embedded vector. It is a learnable projection matrix used for segmented embedding.

[0017] It is a learnable positional encoding of position (i,d), designed to provide the sequentiality of temporal patterns. Then, the representation can be obtained. Two-dimensional vector array As shown below:

[0018]

[0019] in,

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

[0021] Step 3.1: First, using the two-dimensional array obtained in Step 2.2... Based on this, and using it as input to the segmented intra-variable attention submodule within the fusion attention module, the dependencies between different segments in the d-dimensional dimension are then learned using the following method:

[0022]

[0023] in, represent all segments within d-dimensional inner of the l-1th layer, 1≤d≤D is the dimension of time series (consistent with the number of sensors described in step one, 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 segmented variable intra-attention sub-module, 1≤l≤L is the number of layers of MSWAA, where is the query vector, key vector and value vector of MSWAA. respectively, is the parameter matrix of the lth layer.

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

[0025]

[0026] where, represents the output of the MSWAA layer. is the query vector, key vector and value vector of MSWEA. respectively, is the parameter matrix of the 1th layer. The variable dependency relationship of the kth layer can be captured by:

[0027]

[0028] where, is the query vector, key vector and value vector of the kth layer of MSWEA. respectively, is the parameter matrix of the kth layer.

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

[0030] Step 4.1: First, by optimizing the following function, let the multi-source data fusion attention Transformer model generate a value close to the true future running 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 synthetic sequence obtained by the following function:

[0033]

[0034] where Concat represents the concatenation operation. represents the time series within future time steps.

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

[0036]

[0037] where, represents the expectation, and D(·) represents the output of the discriminator, which outputs 1 if the input is real data, and 0 otherwise. 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] where, is the real data, and is obtained by the following function:

[0040]

[0041] Step 4.3: L D represents the objective function of the real sequence and the synthetic sequence, which is expressed 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 correlation weight of the ith time point relative to the jth time point:

[0045]

[0046] where, represents the learnable scale parameter distribution, where i represents the ith time point in. Rescale represents a rescaling operation that converts Gaussian distance to discrete distribution.

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

[0048]

[0049] wherein, is the attention map, and Softmax is an activation function for normalizing the attention map.

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

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

[0052]

[0053] wherein, 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 future operating state abnormal behavior and obtain the failure probability, in the following manner:

[0055]

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

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

[0058] Further, in step 3, Transformer is used as the basic framework of the anomaly early warning model.

[0059] Further, 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 predicted future operating state time series of the oil pipeline is obtained.

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

[0061] Further, 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 operating state abnormal behavior and obtain failure probability, and after the steps 1 to 5 are performed on the oil pipeline data, the oil pipeline abnormality early warning is performed as input.

[0063] An oil pipeline abnormality early warning monitoring system based on a multi-source data fusion attention mechanism, the system has a program module corresponding to the steps of the above technical solutions, and when running, the steps in the oil pipeline abnormality early warning monitoring method based on the multi-source data fusion attention mechanism are executed.

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

[0065] An oil pipeline abnormality early warning monitoring device, the oil pipeline abnormality early warning monitoring device comprises at least one processor, and a memory in communication connection with 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 oil pipeline abnormality early warning monitoring method based on the multi-source data fusion attention mechanism, and realize the abnormality early warning of the oil pipeline.

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

[0067] The oil pipeline abnormality early warning model based on the multi-source data fusion attention mechanism, aims to solve the problem that when a multivariate time series is used as input, the correlation between variables is not considered respectively, which may cause the model to learn the correlation pattern between different variables from a fuzzy perspective.

[0068] Specifically, the present application considers the following problems:

[0069] 1. The existing research does not consider the correlation between variables (for example, using a convolutional network to directly capture the dependence relationship from a multivariate time series matrix), which may cause the model to learn the correlation pattern between different variables from a fuzzy perspective.

[0070] 2. Existing research generally optimizes specific statistical indicators (such as mean squared error (MSE), mean absolute error (MAE), or likelihood loss) to minimize the difference between true values and predicted values point by point. However, this point-by-point objective is difficult to simulate the random behavior inherent in real-world time series, resulting in unreliable future data trends for predictions. In addition, MSE achieves global optimization by optimizing the average of all possible results of the model, which may result in the loss of fine-grained features of time series.

[0071] The present application aims to realize early detection of small leakage anomalies in oil pipelines through multi-source data fusion technology and deep learning technology. The method comprises the following steps: step one, collecting pipeline operation state historical data from acoustic wave, temperature, negative pressure wave and vibration sensors to construct a data set; step two, obtaining time series segmentation coding for algorithm training; step three, constructing a fusion attention module for Transformer model training; step four, based on the multi-source data fusion attention Transformer model obtained in step three, using an adversarial learning method to predict the future operation state of the oil pipeline; step five, training the oil pipeline early warning model using a Gaussian distribution with a learnable scale parameter σ; step six, using the multi-source data fusion attention Transformer model trained in step five as the oil pipeline anomaly early warning model to identify abnormal behavior of the future operation state and obtain the failure probability. The present application effectively improves the accuracy and reliability of oil pipeline anomaly early warning by combining multi-source data analysis technology and deep learning technology, innovative Gaussian kernel scaling parameters and failure probability calculation methods, and has important application value in small leakage detection.

[0072] The effectiveness of the method of the present application is embodied in the summary of the invention:

[0073] 1. The method of the present application 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 application proposes a multi-source data fusion attention mechanism composed of segmented variable intra-attention and segmented variable inter-attention to integrate time-dependent information within a single variable and interaction effect information between different variables.

[0075] 3. The method of the present application 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 to the area in the solution space that contains a higher probability of real characteristics, which helps to overcome the weaknesses of the point-to-single objective function and improve the accuracy of sequence-level reasoning.

[0076] 4. The method of the present application adopts a Gaussian kernel with a learnable scale parameter to construct an anomaly early warning model loss function, and converts the predicted state into a failure probability, wherein the evolution pattern of the target historical sequence can be effectively transferred to the future time point. BRIEF DESCRIPTION OF DRAWINGS

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

[0078] Figure 2 is a segmented variable intra-attention submodule network core graph according to an embodiment of the present application;

[0079] Figure 3 is a segmented variable inter-attention submodule network core graph according to an embodiment of the present application;

[0080] Figure 4 、 Figure 5 、 Figure 6 is a visualization result graph according to an embodiment of the present application. DETAILED DESCRIPTION

[0081] The technical scheme of the present application will be further described below in combination with the accompanying drawings in the embodiments of the present application. Figures 1-6 The technical scheme of the present application will be further described below in combination with the accompanying drawings in the embodiments of the present application.

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

[0083] Figure 1 is a multi-source data fusion attention Transformer model anomaly early warning process block diagram in the technical scheme of the present application, and the entire process diagram is completely realized by programming in Python language (of course, other programming languages can also be used to realize it). According to the process diagram, first, the pipeline running state historical data is collected from the sound wave, temperature, negative pressure wave and vibration sensor to construct a data set; the time sequence segmentation code is obtained for algorithm training; the fusion attention module is constructed for algorithm training; the multi-source data fusion attention Transformer model is trained by using the adversarial learning method to predict the future running state of the oil pipeline; the Gaussian distribution with a learnable scale parameter σ is used to train the oil pipeline early warning model; and the trained multi-source data fusion attention Transformer model is used as the oil pipeline anomaly early warning model to identify the abnormal behavior of the future running state and obtain the failure probability. Figure 1

[0084] Embodiment: Taking the field pipeline monitoring data as an example, the effectiveness of the method of the present application is verified.

[0085] ​Step 1: Collect pipeline operation state historical data from acoustic waves, temperature, negative pressure waves, vibration sensors, build dataset, form: Where T is the length of the backtracking window, D=4 is the dimension of the variable (i.e. the number of sensors).

[0086] Step 2: Design a segmented sequence embedding method to obtain time series segment encoding according to the following path, which is used for algorithm training:

[0087] Step 2.1: First, divide the input sequence of each variable in the data set collected in step 1 into 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 segment, length L seg , dimension d; x t,d is the t-th step of the i-th segment, dimension d.

[0091] Step 2.2: Then, through a learnable linear transformation and a trainable position encoding, each time series segment obtained from step 2.1 is embedded into a vector:

[0092]

[0093] Where u i,d represents the embedded vector, is a learnable projection matrix used for segment embedding.

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

[0095]

[0096] Where,

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

[0098] Step 3.1: First, the two-dimensional array obtained in step 2.2 is as the input of the segmented variable intra-attention sub-module in the fusion attention module, and then the dependency between different segments of d dimensions is learned by the following method:

[0099]

[0100] wherein, represents all segments within the d-dimensional of the l-1 layer, 1≤d≤D is the dimension of the time series (consistent with the number of sensors explained in step one, for the same variable), is the hidden representation of the l-th 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 segmented variable intra-attention sub-module, 1≤l≤L is the number of layers of MSWAA, wherein is the query vector, key vector and value vector of MSWAA. respectively, is the parameter matrix of 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] wherein, represents the output of the MSWAA layer. is the query vector, key vector and value vector of MSWEA. respectively, is the parameter matrix of the 1st layer. The variable dependency of the k-th layer can be captured by the following way:

[0104]

[0105] wherein, is the query vector, key vector and value vector of the k-th layer of MSWEA. respectively, is the parameter matrix of 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 used to train to predict the future running state of the oil pipeline.

[0107] Step 4.1: First, the multi-source data fusion attention Transformer model generates the future running state value of the oil pipeline close to the true value by optimizing the following function:

[0108]

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

[0110]

[0111] where Concat represents the concatenation operation. represents the time series in the future τ time steps.

[0112] Step 4.2: Based on the predicted running state, the multi-source data fusion attention Transformer loss function is constructed as:

[0113]

[0114] where, represents the expectation, and D(·) represents the output of the discriminator, which outputs 1 if the input is real data, and 0 otherwise. 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 synthesized sequences and real sequences:

[0115]

[0116] where, is the real data, which is obtained by the following function:

[0117]

[0118] Step 4.3: L D represents the objective function of the real sequence and the synthesized sequence, which is expressed as follows:

[0119]

[0120] Figure 2 and Figure 3 To explain the calculation process of the intra-segment variable attention and inter-segment variable attention,

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

[0122] Step 5.1: First, the correlation weight of the i-th time point relative to the j-th time point is calculated:

[0123]

[0124] wherein, represents a learnable scale parameter of the distribution, wherein i represents the i-th time point in . Rescale represents a replay operation for converting the Gaussian distance into a discrete distribution.

[0125] Step 5.2: Second, the attention map in the multi-source data fusion attention Transformer obtained from step 3.2 is taken as the prediction time series correlation weight:

[0126]

[0127] wherein, is the attention map, and Softmax is an activation function for normalizing the attention map.

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

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

[0130]

[0131] wherein, KL(·||·) represents the Kullback-Leibler divergence.

[0132] Step 6: The multi-source data fusion attention Transformer model trained in step 5.3 is used as the oil pipeline anomaly early warning model to identify the abnormal behavior of the future running state and obtain the failure probability, in the following manner:

[0133]

[0134] wherein, σ n and σ f are the normal critical value and the failure critical value of the learnable scale parameter.

[0135] From the provided accompanying drawings, Figures 4-6 It can be seen that the present application can learn the long-term time dependence and the complex correlation between variables in the multi-sensor data of the oil pipeline, and further improve the prediction accuracy of the Transformer model with the aid of the auxiliary discriminator.

[0136] The present application provides Figure 2 andFigure 3 They jointly described the computation process of the fusion attention module in step 3, where Figure 2 This demonstrates piecewise intravariable attention. Figure 3 This demonstrates attention between piecewise variables. Figure 4 This is a diagram showing the effect of real-time monitoring of laboratory fault data using this technology. Figure 5 This is a diagram showing the effect of real-time monitoring of normal laboratory data using this technology.

[0137] Figure 6 This is a diagram showing the effect obtained after real-time monitoring of on-site fault data using this technology. Predictive model training: First, the multi-source data is segmented, with each segment embedded into a different vector, and the corresponding location information is encoded using a time point as a marker. Then, the embedded multi-source data vectors are... Figure 2 (A segmented intra-variable attention mechanism) is used to capture the intrinsic relationships between each variable (each type of sensor data) at different time points, thereby learning the evolution of this attribute over time. After modeling the intrinsic relationships of all variables, the process is then... Figure 3 (A piecewise inter-variable attention mechanism) models the relationships between all sensor data, thereby learning the changes in the overall operating state of the pipeline as various attributes co-evolve. Detection model training: After... Figure 3 The attention distribution of multi-source data is obtained, and the Gaussian distribution of the multi-source data is also calculated. The difference between the two is calculated, and the learnable scaling parameter in the Gaussian distribution is used to characterize the failure probability. The detection model uses multi-source data as input to the prediction model, outputting the future operating status of the pipeline. Anomaly detection is performed every 20 minutes by combining historical data and the future operating status. Based on 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, accurately predicting the future operating status of oil pipelines. Based on this prediction model, the failure probability of the pipeline can be further calculated, thereby providing real-time and accurate early warnings, helping maintenance personnel to take effective measures before failures occur, reducing the risks in pipeline operation, and improving the safety and stability of the pipeline.

[0138] Verification has shown that the method proposed in this invention solves the technical problems identified in this invention. Practical application has verified the claimed technical effects and practicality of this invention. This invention provides an anomaly early warning algorithm that can effectively capture long-term dependencies when processing time-series data with long time spans. It overcomes the difficulty of identifying long-period anomaly patterns such as slow equipment degradation and long-term environmental impacts, thus improving the accuracy of pipeline anomaly early warning.

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

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

[0141] Based on the algorithm (method) provided in the present application, a kind of oil pipeline abnormal early warning monitoring system based on multi-source data fusion attention mechanism is developed using program language, the system has the program module corresponding to the steps of the above technical solution, executes the step in the above one kind of oil pipeline abnormal early warning monitoring method based on multi-source data fusion attention mechanism when running.

[0142] The computer program of the developed system (software) is stored on a computer readable storage medium, and the computer program is configured to realize the steps of the above one kind of oil pipeline abnormal early warning monitoring method based on multi-source data fusion attention mechanism when called by processor.I.e. the present application is materialized on carrier, becomes a kind of computer program product.

[0143] An oil pipeline abnormal early warning monitoring device based on multi-source data fusion attention mechanism, the device includes at least one processor, and the memory connected with the at least one processor in communication, wherein the memory stores the instructions executable by the at least one processor, the instructions are executed by the at least one processor to enable the at least one processor to execute the above one kind of oil pipeline abnormal early warning monitoring method based on multi-source data fusion attention mechanism, realize the early warning to oil pipeline abnormal situation.

[0144] Various embodiments of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, specially designed ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

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

[0146] It should be understood that the various forms of flow shown above can be re-ordered, added to, or deleted from without departing from the scope of the present application. For example, the various steps recited in the present application can be performed in parallel, in series, or in different orders, as long as the desired results of the technology disclosed in the present application are achieved, and are within the scope of the present application.

Claims

1. A method for early warning monitoring of oil pipeline anomalies based on multi-source data fusion attention mechanism, characterized in that, The oil pipeline anomaly early warning and monitoring method is an oil pipeline anomaly early warning method oriented towards multi-sensor datasets, and its implementation process is as follows: Step 1: Collect pipeline operating state historical data, build dataset, form is: wherein is the length of the backtracking window, is the dimension of the variable, that is, the number of sensors; Step 2: Design a segmented sequence embedding method, and obtain the time series segment codes according to the following path for algorithm training: Step 2.1: First, the input sequence of each variable in the collected dataset in Step 1 is divided into multiple non-overlapping sequences of length ​ (1) (2) in, It is the first There are time series segments, each with a length of . , dimension ; It is the first The first paragraph Each step size, with dimensions of ; 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: (3) wherein, represents an embedded vector, is a learnable projection matrix for segment embedding; is a learnable positional encoding of positions to provide sequentiality of temporal patterns; resulting in a two-dimensional vector array representing as follows: (4) wherein ; Step 3: Construct a multi-source data fusion attention module, including piecewise intra-variable attention and piecewise inter-variable attention, for Transformer model training: Step 3.1: First, using the two-dimensional array obtained in Step 2.2... Based on this, it serves as the input to the segmented intra-variable attention submodule within the fusion attention module, and then learns through the following methods. Dependencies between different segments: (5) (6) wherein, represents the first layer of the neural network, represents all segments within the dimension of time, consistent with the number of sensors described in step one, for the same variable, represents the hidden representation of the first layer of the neural network, represents the activation function most commonly used in Transformer training; represents a fully connected neural network; represents a multi-layered segment-wise variable inner attention sub-module, represents the number of layers of , , , , represents the query vector, key vector, and value vector of , represents the parameter matrix of in the first layer of the neural network; Step 3.2: Further, in MSWAA... The output of the layer is transmitted to the first layer in the multi-layered segmented inter-variable attention submodule MSWEA: (7) (8) wherein, the output representing the MSWAA layer; , , are the query vector, key vector, and value vector of the MSWEA; are the The parameter matrix of the first layer; the variable dependency relationship of the first layer can be captured by the following way: (9) (10) in, It is the MSWEA number The query vector, key vector, and value vector of the layer; They are In the The parameter matrix of the layer; Step 4: Based on the multi-source data fusion attention Transformer model obtained in Step 3, an adversarial learning method is used to train it to predict the future operating status of the oil pipeline; Step 4.1: First, by optimizing the following function, the multi-source data fusion attention Transformer model generates values ​​that closely approximate the real future operating state of oil pipelines: (11) where, and represent the optimal parameters of the multi-source data fusion attention Transformer and the discriminator, respectively; is the obtained synthetic sequence by the following function: (12) wherein, representing an association operation; representing a future time series within a time step; Step 4.2: Based on the predicted running state, construct the multi-source data fusion attention Transformer loss function as follows: (13) wherein, representing the desired, representing the output of the discriminator, which outputs 1 if the input is real data and 0 otherwise; the discriminator is implemented by three fully connected layers and a sigmoid activation function; the discriminator is trained to distinguish between synthetic and real sequences by optimizing the following function: (14) wherein is the real data, obtained by the function: (15) Step 4.3: The objective function representing the real and synthetic sequences is expressed as follows: (16) Step 5: Train the oil pipeline early warning model with a Gaussian distribution with a learnable scale parameter ​ Step 5.1 : First, the correlation weight of the jth time point relative to the ith time point is calculated: Step 5.2: Then, the correlation weight of the ith time point relative to the jth time point is calculated:​ (17) wherein, represent learnable scale parameters of a distribution, wherein represent the first time point; denotes a replay operation that converts a Gaussian distance into a discrete distribution; Step 5.2: Next, obtain the attention map from the multi-source data fusion attention transformer in step 3.2 as the prediction time series association weights: (18) wherein, is an attention map, is an activation function for normalizing the attention map; are the query vector, key vector, value vector of the i-th layer, respectively; Step 5.3: Finally, train the early warning model by minimizing the difference between the Gaussian distribution and the attention map: (19) in, Represents the Kullback-Leibler divergence; Step 6: Utilize 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 operation and obtain the failure probability, as follows: (20) in, and These are the normal and fault threshold values ​​for the learnable scale parameter; In step 1, historical data on pipeline operation status are collected from sound wave, temperature, negative pressure wave, and vibration sensors to construct a dataset.

2. The method for early warning and monitoring of abnormalities in oil pipelines according to claim 1, characterized in that, In step 3, Transformer is used as the basic framework for the anomaly warning model.

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

4. The method for early warning and monitoring of abnormalities in oil pipelines according to claim 1, characterized in that, In step 4, a discriminator is introduced to train the multi-source data fusion attention Transformer model.

5. The method for early warning and monitoring of abnormalities in oil pipelines according to claim 1, characterized in that, In step 5, a learnable scale parameter is introduced. The Gaussian distribution is used as the standard for calculating the failure probability.

6. The method for early warning and monitoring of abnormalities in oil pipelines according to claim 1, characterized in that, In step 6, the trained multi-source data fusion attention Transformer model is used to identify abnormal behaviors in future operation and obtain failure probabilities. The oil pipeline data needs to be processed in steps 1 to 5 before being used as input for oil pipeline anomaly early warning.

7. An oil pipeline anomaly early warning and monitoring system based on a multi-source data fusion attention mechanism, characterized in that: The system has a program module corresponding to the steps of any one of claims 1-6, and executes the steps in the oil pipeline anomaly early warning and monitoring method based on multi-source data fusion attention mechanism when it is run.

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

9. An anomaly early warning and monitoring device for oil pipelines, characterized in that: The oil pipeline anomaly early warning and monitoring device includes at least one processor and a memory communicatively connected to the at least one processor. The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to execute the oil pipeline anomaly early warning and monitoring method based on multi-source data fusion attention mechanism as described in any one of claims 1-6, thereby realizing anomaly early warning for oil pipelines.