Natural gas pipeline leakage detection method and related product

By combining convolutional long short-term memory autoencoders and K-means clustering with single-class support vector machines, the problem of insufficient sensitivity and accuracy in natural gas pipeline leak detection is solved, achieving efficient and accurate detection of natural gas pipeline leaks.

CN121363719APending Publication Date: 2026-01-20PETROCHINA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410974066.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2026-01-20

AI Technical Summary

Technical Problem

Existing natural gas pipeline leak detection methods have low sensitivity to small leaks, are easily affected by changes in pipeline operating conditions, and lack detection accuracy and reliability.

Method used

A convolutional long short-term memory autoencoder is constructed using convolutional neural networks and long short-term memory networks. Combined with K-means clustering and single-class support vector machines, a leak detection model with multiple distribution features is built by extracting and clustering features from pipeline operation data, and integrated decision-making is performed.

Benefits of technology

It improves the sensitivity and reliability of natural gas pipeline leak detection, effectively extracts nonlinear features from pipeline operation data, overcomes the limitations of the single distribution assumption model, and enhances detection performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121363719A_ABST
    Figure CN121363719A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of intelligent detection, in particular to a natural gas pipeline leakage detection method and related products, and the method comprises the steps: constructing an observation state data matrix; constructing an observation state data submatrix; constructing a convolutional long-short-term memory self-encoding model; an optimal convolution long and short term memory self-encoding model is obtained; the final pipeline operation characteristics are obtained; obtaining k feature clusters representing operation distribution characteristics of different pipelines; k OCSVM models are constructed; constructing a real-time observation state data matrix; k decision function values of leakage anomaly detection are obtained, and integrated decision making is carried out in a probabilistic mode; in order to solve the problem that complex characteristics such as nonlinearity, high dimension, multi-distribution and time dependence coexist in pipeline SCADA operation data, so that a traditional data-driven leakage detection method is poor in performance, a convolutional neural network and a long-short-term memory network are adopted to construct a convolutional long-short-term memory self-encoder. The method can effectively obtain long and short term dependence features of pipeline multivariable time series data in a low-dimensional feature space, improves the learning capability of the model for important features of process data, learns the multi-distribution features of pipeline operation data by using feature clustering on this basis, overcomes the leakage detection limitation of a single data distribution hypothesis model, and improves the detection efficiency. Therefore, the pipeline operation risk monitoring and control process is safer and more reliable.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of intelligent detection, in particular to a natural gas pipeline leakage detection method and related products. BACKGROUND

[0002] With the widespread use of natural gas as a clean energy, natural gas pipelines have become the main transportation carrier. However, due to factors such as aging, corrosion, mechanical damage and third-party damage of the pipeline, natural gas pipeline leakage accidents occur from time to time. Pipeline leakage not only causes resource waste and economic loss, but also can cause major safety accidents such as fire and explosion, and even serious environmental pollution. Therefore, how to efficiently and accurately detect the leakage state of the natural gas pipeline to ensure its safe operation has become a problem to be solved in the industry.

[0003] In recent years, with the popularization of natural gas pipeline SCADA (data acquisition and monitoring system), a large amount of pipeline operation data is collected in real time, which makes it possible to detect leakage based on data-driven methods. However, pipeline SCADA data usually has complex characteristics such as nonlinearity, high dimensionality and time dependence, and conventional data analysis methods are difficult to extract effective information from them, resulting in insufficient leakage detection performance. In addition, the running state of the natural gas pipeline is often unstable, and the data distribution is variable, so it is difficult for a model established based on a single data distribution assumption to accurately describe its running characteristics, resulting in frequent false positives and false negatives.

[0004] In order to fully and accurately mine the system process information contained in the pipeline SCADA operation data and meet the real needs of natural gas pipeline leakage detection, representation learning and ensemble learning are respectively used as a technical means for effective extraction and full characterization of system high-dimensional operation process data information, which provides great possibility for realizing effective representation of natural gas pipeline operation behavior and improving the accuracy of pipeline leakage detection. SUMMARY

[0005] The technical problem to be solved by the present application is that the existing natural gas pipeline leakage detection method has low detection sensitivity for small leakage, is easily disturbed by changes in pipeline operation state, and has insufficient detection accuracy and reliability. The purpose is to provide a natural gas pipeline leakage detection method and related products, which realizes efficient and accurate detection of natural gas pipeline leakage, can effectively extract nonlinear features from pipeline operation data, fully characterize its multi-distribution characteristics, and improves the sensitivity and reliability of leakage detection.

[0006] The present application is realized by the following technical scheme:

[0007] A natural gas pipeline leakage detection method, comprising:

[0008] Collecting time series data sequences in the healthy operation process of the natural gas pipeline, and constructing an observation state data matrix;

[0009] Based on the observation state data matrix, the observation state data sub-matrix of the natural gas pipeline at time t is constructed through a sliding window;

[0010] A one-dimensional convolutional neural network (CNN) and a long short-term memory network (LSTM) are selected as the basic learning network to construct a convolutional long short-term memory auto-encoder model;

[0011] The network structure parameters of the convolutional long short-term memory auto-encoder are trained through the observation state data sub-matrix to obtain an optimal convolutional long short-term memory auto-encoder model;

[0012] The final pipeline operation feature is obtained through the optimal convolutional long short-term memory auto-encoder model;

[0013] The pipeline operation features are clustered through a K-means clustering algorithm to obtain k feature clusters representing different pipeline operation distribution characteristics;

[0014] Based on a one-class support vector machine (OCSVM), k OCSVM models are constructed for the k obtained feature clusters;

[0015] Real-time online monitoring data of the natural gas pipeline are obtained, and a real-time observation state data matrix is constructed;

[0016] The real-time observation state data matrix is input into the k OCSVM models to obtain k decision function values of the leakage anomaly detection, and the obtained k decision function values are integrated in a probabilistic manner as the final detection result.

[0017] Specifically, the time series data sequence is collected through a natural gas pipeline SCADA system, and the data includes flow, pressure, and temperature. The observation state matrix is wherein, represents an m-row T-column matrix composed of real numbers, m is the number of sensors, and T is the length of the entire time series;

[0018] The observation state sub-matrix is wherein, l is the length of the sliding window, and t is the current time.

[0019] Specifically, the construction method of the convolutional long short-term memory auto-encoder model includes:

[0020] The observation state data sub-matrix of the pipeline operation is obtained l is the length of the sliding window, m is the number of sensors, and t is the current time;

[0021] The encoder maps the input X t to The decoder re-maps Z t to obtain the reconstructed input n is the dimension of the feature extracted by the encoder, where E(·) is the encoder established by the cascade structure of CNN and LSTM network, and D(·) is the decoder established by the cascade structure of CNN and LSTM network;

[0022] The encoder of the convolutional long short-term memory auto-encoder model is described as: where σ is the sigmoid activation function, * and ⊙ are convolution and dot product operations respectively, W conv and b conv are the weight and bias matrices of the CNN layer respectively, j t-1 is the information from the previous hidden state, W i , U i , W f , U f , W o , U o , W c and U c are the weight matrices of the LSTM input gate, the forgetting gate, the output gate and the new cell state respectively, b f , b i , b c , b o and b c are the corresponding biases, i t , f t , o t , c t are the corresponding outputs obtained by each unit, H t and Z t represent the features extracted by the convolutional layer and the final feature representation obtained by the convolutional long short-term memory network respectively;

[0023] The decoder of the convolutional long short-term memory auto-encoder model includes a replication layer, an LSTM layer and a deconvolutional layer. The replication layer is used to copy the Z t obtained by the encoder l window lengths to meet the input dimension requirement of the LSTM layer, and obtain the feature output H t * The deconvolutional layer is used to map the feature output of the LSTM layer back to the original high-dimensional input.

[0024] The optimization objective function of the auto-encoder is determined, i.e. the reconstruction error between the original input X t and the reconstructed input is minimized.

[0025] The optimization objective function E t is optimized, and the optimal encoder E(·) and decoder D(·) are obtained by training, so as to obtain the optimal convolutional long short-term memory auto-encoder model.

[0026] Specifically, the method for obtaining the final pipeline operation features through the optimal convolutional long short-term memory auto-encoding model is as follows:

[0027] The encoder in the optimal convolutional long short-term memory auto-encoding model is used to extract features from the observation state data sub-matrix, obtain long short-term time dependence representation in a low-dimensional feature space, and map the long short-term time dependence features back to the original data through the decoder in the optimal convolutional long short-term memory auto-encoding model, obtain reconstructed data, calculate the residual features between the original data and the reconstructed data, and splice the long short-term time dependence representation and the residual features according to the time points to form the final pipeline operation features.

[0028] Specifically, the method for clustering the pipeline operation features comprises:

[0029] obtaining the final pipeline operation features wherein, is the long short-term time dependence representation of the original data obtained by using the optimal convolutional long short-term memory auto-encoding model, is the reconstruction error of the optimal convolutional long short-term memory auto-encoding model, N is the number of samples, n is defined as the dimension of the features extracted by the encoder, and l is the length of the sliding window;

[0030] The pipeline operation features H are subjected to K-means clustering, and the clustering process is as follows: wherein, h i represents the i-th feature in the feature set H, μ j is the centroid of the j-th cluster, j = 1, 2,..., k, S j represents the set of all features belonging to the cluster c i ;

[0031] The clustering process is optimized until the centroid μ j no longer changes, and k feature clusters representing different operation distribution characteristics of the pipeline are obtained, H j ={h i / c i =j}, j = 1, 2,..., k.

[0032] Specifically, the method for constructing k OCSVM models comprises:

[0033] constructing an OCSVM model, 0, wherein w is the normal vector of the hyperplane, ρ is the threshold value of the decision function, ξ i is a relaxation variable for tolerating some normal data points falling on the wrong side of the hyperplane, v ∈ (0, 1] is used to control the weight between the two objectives, and φ is a feature mapping function;

[0034] and the given feature data set Hj Data that is closer to the decision plane than normal data is defined as leaked abnormal data.

[0035] Specifically, the methods for obtaining the final test results include:

[0036] Obtain the observation data X of the state to be measured from the real-time observation state data matrix. test,t The feature representation h is obtained through an optimal convolutional long short-term memory autoencoder. test,t ;

[0037] The feature representation h test,t Inputting data into k OCSVM models yields the results for each OCSVM model for feature h. test,t The decision function value, f i (h test,t )=w·φ(h test,t )-ρ j j = 1, 2, ..., k;

[0038] The sigmoid function is used to convert the decision function value of each OCSVM model into a probability value P. j =sigmoid(f j (h test,t ) / τ j ), j=1,2,...,k,where, P j For X test,t The leakage probability τ obtained on the j-th OCSVM model j This is the scaling factor;

[0039] Determining whether a natural gas pipeline is functioning correctly based on the maximum probability value, f(h) test,t = argmax([0.5, P1, P2, ..., P...) k ]), f(h test,t ) represents the integrated leakage probability;

[0040] If f(h) test,t If f(h) is greater than the set value, the test result is considered normal; if f(h) is greater than the set value, the test result is considered normal. test,t If the result is not greater than the set value, the detection result is considered abnormal.

[0041] Optionally, the set value for determining the test result is 0.5.

[0042] A natural gas pipeline leak detection terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the natural gas pipeline leak detection method described above.

[0043] A computer program product comprises computer programs / instructions which, when executed by a processor, implement the natural gas pipeline leakage detection method as described above.

[0044] Compared with the prior art, the present application has the following advantages and beneficial effects:

[0045] The present application aims at the problem that the pipeline SCADA operation data presents complex characteristics such as nonlinearity, high dimensionality, multi-distribution and time dependence coexistence, resulting in poor performance of traditional data-driven leakage detection methods, and adopts a convolutional long short-term memory autoencoder constructed by a convolutional neural network and a long short-term memory network to effectively obtain long short-term time dependence characteristics of pipeline multivariate time series data in a low-dimensional feature space, and improve the learning ability of the model to important features of process data.

[0046] On this basis, the features extracted by the encoder and the reconstruction error of the decoder are clustered to obtain a refined representation of pipeline operation multi-distribution data, different distribution features are constructed into exclusive leakage detection models by integrating the idea of ensemble learning and making an ensemble decision, the limitations of conventional single-distribution assumption models are overcome, and the leakage detection performance of the model is effectively improved, so as to ensure the safe and stable operation of the natural gas pipeline. BRIEF DESCRIPTION OF DRAWINGS

[0047] The accompanying drawings illustrate exemplary embodiments of the present application and together with the general description given above and the detailed description given below, serve to explain the principles of the present application. These drawings are included herewith and constitute a part of this specification, illustrate embodiments of the application and, together with the description, serve to explain the principles of the present application, and are included as part of this specification to provide a further understanding of the application. However, the present application may have other embodiments and can be practiced with other structures, components, implementations, etc., without departing from the spirit or scope of the present application.

[0048] Figure 1 is a flowchart of the natural gas pipeline leakage detection method according to the present application.

[0049] Figure 2 is a principle diagram of pipeline operation feature acquisition according to the present application. DETAILED DESCRIPTION

[0050] In order to make the objectives, technical solutions and advantages of the present application clearer, further detailed description will be made to the present application in combination with the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related content, and are not a limitation on the present application.

[0051] In addition, it should be further noted that only the parts related to the present application are shown in the drawings for ease of description.

[0052] In the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the drawings and in combination with the embodiments.

[0053] Embodiment one

[0054] As Figure 1 shown, a natural gas pipeline leak detection method is provided, comprising:

[0055] First, collect the time series data sequence of the natural gas pipeline in the healthy operation process, and construct an observation state data matrix; the time series data sequence refers to the operation data of the natural gas pipeline recorded in sequence at continuous time points according to a certain time interval. By collecting these time series data, an observation state data matrix can be constructed for subsequent data processing and analysis.

[0056] Second, based on the observation state data matrix, an observation state data sub-matrix of the natural gas pipeline at time t is constructed by a sliding window; by defining a window with a length of l on the time series data matrix, the window is gradually slid to intercept the data subset in different time periods. For each time point t, the sliding window from t-l+1 to t all data constitutes the observation state data sub-matrix at this time, so as to capture the short-term dynamic change of time series data and facilitate model learning.

[0057] Third, a one-dimensional convolutional neural network (CNN) and a long short-term memory network (LSTM) are selected as the basic learning network, and a convolutional long short-term memory auto-encoding model is constructed; CNN extracts local features in data through convolution operation, which is suitable for processing high-dimensional time series data. LSTM is a special recurrent neural network (RNN) that can effectively capture long-term dependencies in sequence data. By combining these two networks, a convolutional long short-term memory auto-encoding model can be constructed, which can simultaneously utilize the feature extraction capability of CNN and the time dependence modeling capability of LSTM, improving the accuracy and robustness of the model.

[0058] Fourth, the network structure parameters of the convolutional long short-term memory auto-encoder are trained by the observation state data sub-matrix to obtain the optimal convolutional long short-term memory auto-encoding model; the training process refers to using the observation state data sub-matrix as input to adjust the network parameters of the convolutional long short-term memory auto-encoder, so that the model can minimize the error between the input data and the reconstructed data. Through repeated iterative training, the model is gradually optimized, and finally an optimal auto-encoding model that can accurately represent the pipeline operation state is obtained.

[0059] Fifth, the final pipeline operation features are obtained by the optimal convolutional long short-term memory auto-encoding model; that is, the trained optimal auto-encoding model is used to extract features from the new observation state data sub-matrix.

[0060] Step 6, clustering the pipeline operation characteristics by the K-means clustering algorithm to obtain k characteristic clusters representing different pipeline operation distribution characteristics; the K-means clustering algorithm divides the data points in the characteristic space into k clusters, and the data points in each cluster have similar distribution characteristics. By clustering the pipeline operation characteristics, the feature mode of the pipeline in different operation states can be identified.

[0061] Step 7, based on the one-class support vector machine OCSVM, k OCSVM models are constructed for the k characteristic clusters; by learning the distribution of normal data, a decision boundary for identifying abnormal data is constructed, and for each characteristic cluster, an OCSVM model is trained.

[0062] Step 8, obtaining real-time online monitoring data of the natural gas pipeline and constructing a real-time observation state data matrix; through the pipeline operation data collected by the sensor network in real time, the current state of the pipeline is reflected.

[0063] Step 9, inputting the real-time observation state data matrix into the k OCSVM models to obtain k decision function values of the leakage anomaly detection, and integrating the obtained k decision function values in a probabilistic manner as the final detection result. Each decision function value distribution represents the abnormal detection result of the corresponding model for the input data, and by probabilistically integrating the k decision function values, the final leakage detection result can be obtained by comprehensively considering the judgments of each model, thereby realizing real-time monitoring and leakage detection of the natural gas pipeline.

[0064] Embodiment Two

[0065] This embodiment details each step of the natural gas pipeline leakage detection method described in the present application.

[0066] Step 1, collecting time series data sequences during the healthy operation of the natural gas pipeline to construct an observation state data matrix.

[0067] The time series data of the healthy pipeline operation process for constructing the data-driven leakage detection model is collected using the natural gas pipeline SCADA system; the collected data includes multiple sensor signals such as flow, pressure, and temperature, and is represented as an observation state matrix wherein, represents an m-row T-column matrix composed of real numbers, m is the number of sensors, T is the length of the entire time series, and the data is normalized using the z-score method.

[0068] Step 2, based on the observation state data matrix, an observation state data submatrix of the natural gas pipeline at time t is constructed by a sliding window.

[0069] An N-subsequence is constructed using a sliding window of length l wherein Observed state data of the natural gas pipeline at time t.

[0070] In the third step, a one-dimensional convolutional neural network (CNN) and a long short-term memory (LSTM) network are selected as the basic learning network, and a convolutional long short-term memory auto-encoder model is constructed.

[0071] In view of the nonlinear, high-dimensional and time-dependent characteristics of the pipeline multi-sensor time series data, a one-dimensional convolutional neural network (CNN) and a long short-term memory (LSTM) network are selected as the basic learning network, and a convolutional long short-term memory auto-encoder is constructed. The modeling process of the convolutional long short-term memory auto-encoder is as follows:

[0072] Obtaining the observed state data sub-matrix of the pipeline operation l is the length of the sliding window, m is the number of sensors, and t is the current time;

[0073] The encoder maps the input X t to The decoder re-maps Z t to obtain the reconstructed input n is the dimension of the features extracted by the encoder, wherein E(·) is an encoder established by the CNN and LSTM network in a cascaded structure, and D(·) is a decoder established by the CNN and LSTM network in a cascaded structure;

[0074] For the encoder of the convolutional long short-term memory auto-encoder model, it can be described as: wherein σ is a sigmoid activation function, * and ⊙ are convolution and dot product operations respectively, W conv and b conv are the weight and bias matrices of the CNN layer respectively, j t-1 is information from the previous hidden state, W i , U i , W f , U f , W o , U o , W c and U c are weight matrices of the LSTM input gate, the forgetting gate, the output gate and the new cell state respectively, b f , b i , b c , b o and b c are corresponding biases, i t , f t , o t , c tThe corresponding output obtained for each unit is H t and Z t respectively represent the features extracted by the convolutional layer and the final feature representation obtained by the convolutional long short-term memory network;

[0075] For the decoder of the convolutional long short-term memory autoencoder model, it includes a replication layer, an LSTM layer and a deconvolutional layer. The replication layer is used to replicate the Z t to meet the input dimension requirements of the LSTM layer, and obtain the feature output H t * The deconvolutional layer is used to map the feature output of the LSTM layer back to the original high-dimensional input.

[0076] The optimization objective function of the autoencoder is determined, that is, to minimize the reconstruction error between the original input X t and the reconstructed input

[0077] The optimization objective function E t is obtained by training the optimal encoder E(·) and decoder D(·), and the optimal convolutional long short-term memory autoencoder model is obtained.

[0078] Fourthly, the network structure parameters of the convolutional long short-term memory autoencoder are trained by observing the state data submatrix, and the optimal convolutional long short-term memory autoencoder model is obtained.

[0079] The input and output dimensions of each layer of the convolutional long short-term memory autoencoder are set as Input size -hidden size,1 -hidden size,2 -hidden size,2 -hidden size,1 -Input size , the learning rate is lr, the iteration number is n epoches , the training batch size is n batch , Adam is selected as the optimizer, the network structure parameters of the convolutional long short-term memory autoencoder are iteratively trained by the observation state data set X constructed in the second step, and the optimal convolutional long short-term memory autoencoder model is obtained.

[0080] Fifthly, the final pipeline operation features are obtained by the optimal convolutional long short-term memory autoencoder model;

[0081] As Figure 2 ​As shown, the observation state data sub-matrix is extracted by the encoder in the optimal convolutional long short-term memory auto-encoding model, long short-term time dependence representation in a low-dimensional feature space is obtained, the long short-term time dependence feature is mapped back to the original data by the decoder in the optimal convolutional long short-term memory auto-encoding model, the reconstructed data is obtained, the residual feature between the original data and the reconstructed data is calculated, and the long short-term time dependence representation and the residual feature are spliced according to the time point to form the final pipeline operation feature.

[0082] Given a pipeline operation state observation data set Wherein, N is the number of samples, for each sample The long short-term time dependence representation of the original data in the low-dimensional feature space is obtained by constructing a convolutional long short-term memory auto-encoder using the data set And the reconstruction error The two are spliced to obtain the final pipeline operation feature

[0083] Step 6, the pipeline operation features are clustered by the K-means clustering algorithm to obtain k feature clusters representing different pipeline operation distribution characteristics.

[0084] Obtain the final pipeline operation feature Wherein, is the long short-term time dependence representation of the original data obtained by the optimal convolutional long short-term memory auto-encoding model, is the reconstruction error of the optimal convolutional long short-term memory auto-encoding model, N is the number of samples, n is defined as the dimension of the features extracted by the encoder, and l is the length of the sliding window;

[0085] The pipeline operation features H are clustered by K-means clustering, and the clustering process is as follows: Wherein, h i represents the i-th feature in the feature set H, μ j is the centroid of the j-th cluster, j = 1, 2,..., k, S j represents the set of all features belonging to the cluster c i ;

[0086] The clustering process is optimized until the centroid μ j no longer changes, k feature clusters representing different pipeline operation distribution characteristics are obtained, H j = {h i / c i = j}, j = 1, 2,..., k.

[0087] Step 7, based on the one-class support vector machine OCSVM, k OCSVM models are constructed for the k feature clusters obtained.

[0088] Given a feature dataset H j = {h1, h2,..., h Q}, the goal of OCSVM is to make normal data points as far as possible from the decision plane in the feature space, thus, data points closer to the decision plane than normal data are considered as leakage anomaly data, the OCSVM modeling process can be described as: where w is the hyperplane normal vector, p is the threshold of the decision function, ξ i is the slack variable to tolerate some normal data points falling on the wrong side of the hyperplane, v e (0, 1] is used to control the weight between the two objectives, and f is the feature mapping function.

[0089] and set the data in the given feature dataset H j closer to the decision plane than normal data as leakage anomaly data.

[0090] Step 8, obtain the real-time online monitoring data of the natural gas pipeline, and construct a real-time observation state data matrix.

[0091] Collect new pipeline SCADA system real-time online monitoring data, normalize it using the trained z-score parameters, and construct a real-time observation state data matrix X test,t .

[0092] Step 9, input the real-time observation state data matrix into k OCSVM models to obtain k decision function values of leakage anomaly detection, and integrate the obtained k decision function values in a probabilistic manner as the final detection result.

[0093] Obtain the to-be-tested state observation data X test,t in the real-time observation state data matrix, and obtain its feature representation h test,t through the optimal convolutional long short-term memory autoencoder.

[0094] Input the feature representation h test,t into k OCSVM models to obtain the decision function value of each OCSVM model for the feature h test,t , f i (h test,t ) = w · f (h test,t ) - p j , j = 1, 2,..., k; the closer the value is to negative, the more likely it is to be judged as a leakage anomaly.

[0095] In view of the fact that the to-be-tested state observation data may belong to one or more normal running distribution states other than leakage, the decision function value of each OCSVM model is converted into a probability value P j=sigmoid(f j (h test,t ) / τ j ), j=1,2,...,k,where, P j For X test,t The leakage probability τ obtained on the j-th OCSVM model j This is the scaling factor;

[0096] Determining whether a natural gas pipeline is functioning correctly based on the maximum probability value, f(h) test,t = argmax([0.5, P1, P2, ..., P...) k ]), f(h test,t ) represents the integrated leakage probability;

[0097] If f(h) test,t If f(h) is greater than the set value, the test result is considered normal; if f(h) is greater than the set value, the test result is considered normal. test,t If the result is not greater than the set value, the detection result is considered abnormal. The set value for determining the detection result is 0.5.

[0098] Example 3

[0099] A natural gas pipeline leak detection terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the natural gas pipeline leak detection method described above.

[0100] The processor implements the above-mentioned natural gas pipeline leak detection method when executing computer programs.

[0101] Memory is used to store software programs and modules. The processor executes various terminal functions and data processing by running the software programs and modules stored in memory. Memory can mainly consist of a program storage area and a data storage area. The program storage area can store the operating system, at least one executable program required for a given function, etc.

[0102] The storage data area can store data created based on the use of the terminal. Furthermore, the memory can include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory, or other volatile solid-state storage devices.

[0103] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned natural gas pipeline leak detection method.

[0104] Without loss of generality, computer-readable media can include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EPROM, EEPROM, flash memory or other solid state memory technology, CD-ROM, DVD, or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Computer storage media does not include communication media. The system memory and the large capacity storage device can be the same device.

[0105] A computer program product comprising computer programs / instructions that, when executed by a processor, implement the natural gas pipeline leak detection method as above.

[0106] A computer program product comprises computer programs or instruction sets for performing specific tasks or implementing specific functions. These programs or instructions are designed to be executed by a processor, thereby implementing a series of predefined steps or operations. The program product can be stored in various forms of computer storage media, such as memory, hard disk, solid state drive, optical disk or other forms of digital storage devices. It can exist in the form of compiled binary code or in the form of scripts or bytecodes executable by an interpreter. The program product, through carefully designed algorithms and logical instructions, enables the processor to process data in a specific order and manner, completing various functions such as data analysis, user interaction, device control, etc.

[0107] In the description of the present specification, the description of the terms "one embodiment / way", "some embodiments / ways", "example", "specific example", or "some examples" and the like means that the specific features, structures, materials or characteristics described in conjunction with the embodiment / way or example are included in at least one embodiment / way or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment / way or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in any one or more embodiments / ways or examples. In addition, the skilled in the art can combine and combine the different embodiments / ways or examples described in the present specification and the features of the different embodiments / ways or examples without contradiction.

[0108] Furthermore, the terms "first", "second", etc. are used herein for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly pointing to the number of technical features indicated. Thus, features defined with "first", "second" etc. can explicitly or implicitly include at least one of such features. In the description of the application, the meaning of "plurality" is at least two, for example two, three, etc., unless explicitly and specifically defined otherwise.

[0109] Those skilled in the art will understand that the above-mentioned embodiments are merely intended to clearly illustrate the present application, and are not intended to limit the scope of the present application. Other changes or modifications can be made to the above-mentioned embodiments by those skilled in the art, and these changes or modifications are still within the scope of the present application.

Claims

1. A method of natural gas pipeline leak detection, the method comprising: The application relates to a natural gas pipeline leakage detection method. Collecting time sequence data sequences in a natural gas pipeline health running process to construct an observation state data matrix; Based on the observation state data matrix, an observation state data sub-matrix of the natural gas pipeline at t time is constructed through a sliding window; A one-dimensional convolutional neural network (CNN) and a long short-term memory network (LSTM) are selected as basic learning networks to construct a convolutional long short-term memory auto-encoder model; The network structure parameters of the convolutional long short-term memory auto-encoder are trained through the observation state data sub-matrix to obtain an optimal convolutional long short-term memory auto-encoder model; The optimal convolutional long short-term memory auto-encoder model is used to obtain final pipeline running features; The pipeline running features are clustered through a K-means clustering algorithm to obtain k feature clusters representing different pipeline running distribution characteristics; Based on one-class support vector machines (OCSVM), k OCSVM models are constructed for the k feature clusters; Real-time online monitoring data of the natural gas pipeline are acquired, and a real-time observation state data matrix is constructed; The real-time observation state data matrix is input into the k OCSVM models to obtain k decision function values of leakage anomaly detection, and the k decision function values are integrated in a probabilistic manner as a final detection result.

2. A method of natural gas pipeline leak detection according to claim 1, wherein, The time series data is collected by a SCADA system of a natural gas pipeline, the data includes flow, pressure, temperature, and an observation state matrix wherein, denotes an m row by T column matrix consisting of real numbers, m is the number of sensors, and T is the length of the entire time series. Observation state sub-matrix where l is the length of the sliding window and t is the current time.

3. The method of claim 1, wherein, The method for constructing the convolutional long short-term memory auto-encoder model comprises the following steps: Obtaining a sub-matrix of observed state data of a pipeline operation l is the length of the sliding window, m is the number of sensors, and t is the current time An encoder maps an input X t to a latent representation Z A decoder maps Z t to a reconstructed input X n is the dimension of the features extracted by the encoder, where E(·) is an encoder established by a cascade structure of CNN and LSTM network, and D(·) is a decoder established by a cascade structure of CNN and LSTM network. The encoder of the convolutional long short-term memory auto-encoding model is described as: wherein σ is a sigmoid activation function, * and ⊙ are convolution and dot product operations respectively, W conv and b conv are weight and bias matrices of the CNN layer respectively, j t-1 is information from the previous hidden state, W i , U i , W f , U f , W o , U o , W c and U c are weight matrices of the LSTM input gate, the forget gate, the output gate and the new cell state respectively, b f , b i , b c , b o and b c are corresponding biases respectively, i t , f t , o t, c t are corresponding outputs obtained by each unit, H t and Z t represent features extracted by the convolutional layer and the final feature representation obtained by the convolutional long short-term memory network respectively; The decoder of the convolutional long short-term memory auto-encoding model comprises a copy layer, an LSTM layer and a deconvolution layer, the copy layer is used for copying Z t The copy layer is used for copying Z t * The deconvolution layer is used for mapping the feature output of the LSTM layer back to the original high-dimensional input. determining an optimization objective function of the autoencoder, i.e. minimizing reconstruction error between the original input X t and the reconstructed input ​ Optimization objective function E t , the optimal encoder E(·) and decoder D(·) are trained to obtain the optimal convolutional long short-term memory auto-encoding model.

4. The method of claim 1, wherein, The method for obtaining the final pipeline running features through the optimal convolutional long short-term memory auto-encoder model comprises the following steps: The encoder in the optimal convolutional long short-term memory auto-encoder model is used to extract features from the observation state data sub-matrix, acquire long short-term time dependence representation in a low-dimensional feature space, map the long short-term time dependence representation back to original data through the decoder in the optimal convolutional long short-term memory auto-encoder model, acquire reconstruction data, calculate residual features between the original data and the reconstruction data, and splice the long short-term time dependence representation and the residual features according to time points to form the final pipeline running features.

5. The method of claim 1, wherein, The method for clustering the pipeline running features comprises the following steps: acquiring final pipeline operation features wherein, is a long and short time dependent representation of the original data obtained by using the optimal convolutional long short-term memory auto-encoding model, is a reconstruction error of the optimal convolutional long short-term memory auto-encoding model, N is the number of samples, n is defined as the dimension of the features extracted by the encoder, and l is the length of the sliding window. K-means clustering is performed on the pipeline operating features H, the clustering process is: where h i represents the i-th feature in the feature set H, μ j is the centroid of the j-th cluster, j = 1, 2,..., k, S j denotes the set of all features belonging to the cluster c i . Optimizing the clustering process until the centroids μ j No longer change, get representative of the pipeline different operating distribution characteristics k feature clusters, H j = {h i | c i = j}, j = 1, 2,..., k.

6. A method of natural gas pipeline leak detection according to claim 5, wherein, The method for constructing the k OCSVM models comprises the following steps: Constructing OCSVM model, where w is the hyperplane normal vector, p is the threshold of the decision function, and i is the slack variable to tolerate some normal data points falling on the wrong side of the hyperplane, v e (0, 1] is used to control the weight between the two objectives, and f is the feature mapping function. and a given feature dataset H j Data closer to the decision plane than normal data is set as a leakage anomaly data.

7. A method of natural gas pipeline leak detection according to claim 6, wherein, The method for obtaining the final detection result comprises the following steps: Obtaining the to-be-tested state observation data X in the real-time observation state data matrix test,t , obtaining the feature representation h of the to-be-tested state observation data X through the optimal convolution long short-term memory autoencoder test,t ; representing h test,t to k OCSVM models, obtaining a decision function value, f test,t , of each OCSVM model for the feature h i test,t ) = w · φ(h test,t )- p j , j = 1, 2,..., k;​ The sigmoid function is used to convert the decision function value of each OCSVM model into a probability value P. j =sigmoid(f j (h test,t ) / τ j ), j=1,2,...,k,where, P j For X test,t The leakage probability τ obtained on the j-th OCSVM model j This is the scaling factor; Based on the maximum probability value to determine whether the natural gas pipeline is normal, f(h test,t ) = argmax([0.5, P1, P2, …, P k ]), f(h test,t ) is the integrated leakage probability; If f(h test,t ) is greater than a set value, the detection result is determined to be normal; if f(h test,t ) is not greater than the set value, the detection result is determined to be abnormal.

8. A method of natural gas pipeline leak detection according to claim 7, wherein, The setting value of the detection result judgment is 0.

5.

9. A natural gas pipeline leak detection terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to realize the natural gas pipeline leakage detection method in any one of claims 1-8.

10. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instruction is executed by the processor to realize the natural gas pipeline leakage detection method in any one of claims 1-8.