A method and apparatus for detecting pipeline leaks
By using a virtual sensor array and adaptive simulation of operating conditions, combined with spatiotemporal pattern determination, and utilizing an operating condition coding neural network and a transient flow simulation model, the problems of false alarms and low sensitivity in pipeline leak detection have been solved, achieving high sensitivity and accurate positioning.
Patent Information
- Application Number
- CN202611243757.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-17
- Publication Date
- 2026-11-10
AI Technical Summary
Existing pipeline leak detection methods based on Atmos SIM are prone to generating false alarms under normal transient operating conditions and have low sensitivity to detecting slow and minute leaks.
A virtual sensor array and adaptive simulation of operating conditions are adopted, combined with spatiotemporal pattern determination. The current operating condition feature vector is obtained through the operating condition coding neural network to drive the pipeline transient flow simulation model. The leakage location is determined by using the consistency index sequence and deviation pattern feature vector.
It achieves highly sensitive detection and accurate location of pipeline leaks, while effectively reducing false alarms caused by changes in normal operating conditions.
Smart Images

Figure CN123064938A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of pipeline leakage detection methods, and more specifically, to a pipeline leakage detection method and apparatus. Background Technology
[0002] Long-distance oil and gas pipelines may leak during operation due to corrosion, third-party sabotage, and other reasons. Leaks not only cause resource losses but may also trigger serious accidents such as fires, explosions, and environmental pollution. With increasingly complex pipeline networks, higher demands are placed on the timeliness, accuracy, and precise location of leak detection. Leak detection methods based on transient simulation have attracted widespread attention because they can simulate the dynamic hydraulic behavior of pipelines.
[0003] Existing Atmos SIM-based pipeline leak detection methods typically employ real-time residual analysis strategies. The specific implementation process is as follows: First, Atmos SIM is used to establish the geometric model, physical properties, and boundary conditions of the pipeline under test. Real-time pressure, flow rate, and temperature data from both ends of the pipeline are collected as input boundaries to perform transient hydraulic simulation, calculating the theoretical pressure and flow rate values at each node along the pipeline. Then, the theoretical calculation values are compared point-by-point with the actual sensor measurements to calculate the residual sequence. When the residual exceeds a preset fixed threshold and persists for a certain time window, the system determines it as a leak and issues an alarm. Some improved methods also employ statistical process control techniques to smooth the residual sequence, reducing false alarms caused by random noise.
[0004] However, the aforementioned existing technologies are prone to false alarms under normal transient operating conditions of pipelines in practical engineering applications, and have low sensitivity to detecting slow and minute leaks. Summary of the Invention
[0005] The purpose of this application is to provide a pipeline leak detection method and apparatus, which achieves highly sensitive detection and accurate location of pipeline leaks by using a virtual sensor array and adaptive simulation of operating conditions, combined with spatiotemporal pattern determination, while effectively reducing false alarms caused by changes in normal operating conditions.
[0006] Firstly, a pipeline leakage detection method is provided, which may include: Based on the pipeline operation data sequence collected during the pipeline operation process within the current time window, the current operating condition feature vector corresponding to the time window is obtained by using a trained operating condition coding neural network. The current operating condition feature vector is used as the boundary condition to drive the pipeline transient flow simulation model, and the simulated pressure time series values of each virtual pressure measuring point within the current time window are obtained. Based on the simulated pressure time series values of each virtual pressure measuring point and the measured pressure time series values of adjacent real pressure sensors, a consistency index sequence distributed along the pipeline is determined. Based on the comparison results of the current deviation mode feature vector and the normal baseline deviation mode feature vector of the consistency index sequence, combined with the spatiotemporal mode determination conditions, the leakage location range is determined.
[0007] In one possible implementation, the training process of the working condition coding neural network includes: Using a pipeline transient flow simulation model, a normal operation dynamic dataset and a leakage operation dynamic dataset are generated; each data sample in the normal operation dynamic dataset and the leakage operation dynamic dataset is labeled with the corresponding operating condition parameter label; A multi-task operating condition coding neural network is constructed. This operating condition coding neural network consists of a shared convolutional long short-term memory coding layer and multiple parallel operating condition classification branches. The actual measurable boundary parameter sequence of the pipeline is used as input, and the operating condition parameter labels are used as supervision signals for joint pre-training to obtain a trained operating condition coding neural network. The fixed-length vector output by the pre-trained shared convolutional long short-term memory coding layer is used as the operating condition feature vector.
[0008] In one possible implementation, the simulated pressure time series values of each virtual pressure measurement point within the current time window are obtained, including: The current operating condition feature vector is input into a pre-trained boundary condition mapping network, which outputs the boundary change curve of the pipeline. Using the no-leakage assumption as the leakage boundary condition, the pipeline transient flow simulation model with the boundary change curve as the dynamic boundary driven configuration is solved. The model adopts a mesh adaptive densification strategy, setting virtual pressure measuring points with a density that is a preset multiple of the density of the real sensors in the section between adjacent real pressure sensors. The simulated pressure time series value is output on each encrypted grid node, and the simulated pressure time series value is aligned by time and used as the simulated pressure time series value of the virtual pressure measurement point to obtain the simulated pressure time series value within the current time window.
[0009] In one possible implementation, the length of the time window is dynamically determined based on the pipe length and the pressure wave propagation speed, including: The base window length is obtained by dividing the pipe length by the pressure wave propagation speed by twice the time, and then adding a random jitter factor to obtain the final time window length.
[0010] In one possible implementation, the sequence of consistency metrics distributed along the pipeline is determined, including: For each virtual pressure measurement point, the simulated pressure time series value is subtracted from the measured pressure time series values of the two adjacent real pressure sensors at each time step to obtain two difference series and the corresponding weighted average difference series. The weighted average difference sequence is filtered by moving average within the current time window to obtain a scalar value as the consistency index at the virtual pressure measurement point, and a sequence of consistency indices arranged sequentially along the pipeline.
[0011] In one possible implementation, the method further includes: Before comparing the current deviation pattern feature vector of the consistency index sequence with the normal baseline deviation pattern feature vector, a one-dimensional dilated convolutional neural network with three parallel dilated convolutional branches is used to extract multi-scale features from the consistency index sequence. The output features of the three branches are concatenated and then passed through global average pooling and a fully connected layer to output a fixed-dimensional current deviation pattern feature vector. The dilation rate of each branch is different. The normal benchmark deviation pattern features are configured as follows: during the historical operation period when the pipeline is leak-free and the operating conditions are stable, a series of consistency indicators for multiple historical time windows are obtained; the consistency indicator sequences of each historical time window are sequentially processed by a one-dimensional dilated convolutional neural network for feature extraction, and the average value and standard deviation of all vectors are calculated for multiple output vectors according to the same dimension position to obtain the normal benchmark deviation pattern feature vector.
[0012] In one possible implementation, based on the comparison result of the current deviation mode feature vector and the normal baseline deviation mode feature vector of the consistency index sequence, combined with the spatiotemporal pattern determination conditions, the leakage location interval is determined, including: The current deviation mode feature vector is subtracted element by element from the normal baseline deviation mode feature vector to obtain the difference feature vector, and the difference feature vector is expanded into a sequence of difference values along the pipeline mileage direction; A sliding window of length L is used to scan point by point along the difference value sequence, calculate the local cumulative sum of the difference values in each window, and determine whether the difference values in the window continuously exceed a preset difference threshold, where L is a positive integer; When the local cumulative sum within any window is greater than the first threshold, and the length of the pipe segment corresponding to the window is greater than the preset minimum leakage segment length, the start and end positions of the window are marked as candidate leakage segments. The local cumulative sum of the same candidate leakage section is tracked within multiple consecutive time windows. If the cumulative sum shows a monotonically increasing trend over time and the increase rate of adjacent time windows exceeds the second threshold, then the candidate leakage section is confirmed as a real leakage section. Within the confirmed leak section, the mileage corresponding to the peak of the difference value is taken as the estimated location of the leak point, and the starting and ending mileages of the section are taken as the leak location interval.
[0013] Secondly, a pipeline leak detection device is provided, which may include: The acquisition unit is used to obtain the current operating condition feature vector corresponding to the current time window based on the pipeline operation data sequence collected during pipeline operation and using a trained operating condition coding neural network. The driving unit is used to drive the pipeline transient flow simulation model with the current operating condition feature vector as the boundary condition, and obtain the simulated pressure time series value of each virtual pressure measuring point in the current time window. The determination unit is used to determine the consistency index sequence distributed along the pipeline based on the simulated pressure time series values of each virtual pressure measuring point and the measured pressure time series values of adjacent real pressure sensors. Furthermore, based on the comparison results between the current deviation mode feature vector and the normal baseline deviation mode feature vector of the consistency index sequence, and combined with the spatiotemporal mode determination conditions, the leakage location range is determined.
[0014] Thirdly, an electronic device is provided, which includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; When a processor executes a program stored in memory, it implements any of the steps described in the first aspect above.
[0015] Fourthly, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when executed by a processor, the computer program implements the steps of any of the methods described in the first aspect above.
[0016] This application provides a pipeline leakage detection method and apparatus. The method is based on pipeline operation data sequences collected during pipeline operation within a current time window. Using a trained operating condition coding neural network, it obtains the current operating condition feature vector corresponding to that time window. The current operating condition feature vector is used as boundary conditions to drive a transient flow simulation model of the pipeline, obtaining simulated pressure time-series values for each virtual pressure measuring point within the current time window. Based on the simulated pressure time-series values of each virtual pressure measuring point and the measured pressure time-series values of adjacent real pressure sensors, a consistency index sequence distributed along the pipeline is determined. Based on the comparison result of the current deviation mode feature vector and the normal baseline deviation mode feature vector of the consistency index sequence, combined with spatiotemporal mode judgment conditions, the leakage location interval is determined. This method, through virtual sensor arrays and adaptive operating condition simulation, combined with spatiotemporal mode judgment, achieves highly sensitive detection and accurate location of pipeline leaks, while effectively reducing false alarms caused by changes in normal operating conditions. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 A schematic flowchart illustrating a pipeline leak detection method provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a pipeline leak detection device provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application. Unless otherwise defined, the technical or scientific terms used in this application should have the ordinary meaning understood by those skilled in the art. The terms "first," "second," and similar terms used in this application do not indicate any order, quantity, or importance, but are only used to distinguish different components. The terms "comprising" or "including," etc., mean that the element or object preceding the word covers the element or object listed after the word and its equivalents, but does not exclude other elements or objects. The terms "connection," "coupled," or "linked," etc., are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.
[0020] The physical system upon which the pipeline leakage detection method provided in this application relies includes: multiple real pressure sensors arranged along the buried pipeline, which are installed at key nodes of the pipeline at certain intervals (e.g., every 500 meters to 2000 meters) to collect real-time pressure time-series data inside the pipeline; flow meters and thermometers are respectively installed at the beginning and end of the pipeline to collect flow rate and temperature data; all sensors and instruments are connected to a central processing unit (such as an industrial control computer or cloud server) through a data acquisition unit. The central processing unit embeds a pipeline transient flow simulation model, a working condition coding neural network, a one-dimensional hollow convolutional neural network, a one-dimensional convolutional neural network, and an adaptive model calibration module. The data acquisition unit transmits the collected boundary parameter sequences such as the beginning pressure, end pressure, flow rate, and temperature to the central processing unit in real time. The central processing unit performs frame processing on the data according to a preset time window length (e.g., 30 seconds, 60 seconds, or a dynamically determined value) and executes the detection method described below.
[0021] The method of this application sets up multiple virtual pressure measuring points in the pipeline section between adjacent real pressure sensors, forming a high-density virtual sensor array. Then, a trained operating condition encoding neural network is used to extract operating condition feature vectors from the measured data of the current time window, thereby configuring the boundary conditions of the pipeline transient flow simulation model and simulating the pressure time series values of each virtual pressure measuring point under the assumption of no leakage. Next, the simulated pressure time series values are compared with the measured pressure time series values of adjacent real pressure sensors to calculate the consistency index sequence distributed along the pipeline. Then, a one-dimensional dilated convolutional neural network is used to extract the current deviation mode feature vector of the consistency index sequence, compare it with the pre-configured normal baseline deviation mode feature vector, and combine it with the spatiotemporal mode judgment conditions to finally determine the leakage location interval.
[0022] The preferred embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit this application. Furthermore, the embodiments and features in the embodiments of this application can be combined with each other without conflict.
[0023] Figure 1 This is a schematic flowchart illustrating a pipeline leak detection method provided in an embodiment of this application. Figure 1 As shown, the method may include: Step S110: Based on the pipeline operation data sequence collected during the pipeline operation process within the current time window, the current operating condition feature vector corresponding to the time window is obtained using the trained operating condition coding neural network.
[0024] Before executing step S110, multiple virtual pressure measuring points are set within the pipe sections between adjacent real pressure sensors. Furthermore, to balance computational efficiency and detection accuracy, a non-uniform spacing strategy is adopted: the density of virtual measuring points is automatically adjusted between adjacent real sensors based on the terrain undulations along the pipeline, the number of bends, and historical leakage event distribution data. Specifically, the central processing unit first loads the digital elevation model and design drawings of the pipeline and calculates the rate of curvature change for each small pipe segment. When the rate of curvature change exceeds a preset curvature threshold (e.g., 0.05 rad / m), the segment is identified as a high-risk bend, and the virtual pressure measuring points are densified in such segments, reducing their spacing to 1 / 10 to 1 / 20 of the spacing between real sensors. Simultaneously, segments with a high frequency of leakage events (e.g., areas that have experienced more than two leaks in the past three years) are read from the historical leakage database and densified accordingly. In straight, low-risk segments that have never experienced leaks, virtual pressure measuring points are sparsely set, with the spacing relaxed to 1 / 2 to 1 / 3 of the spacing between real sensors. The mileage locations of all virtual pressure measurement points are stored in the configuration file in ascending order for subsequent simulation calculations.
[0025] In the specific implementation of step S110, during actual pipeline operation, the central processing unit collects the pipeline operation data sequence within the current time window at a fixed sampling frequency (e.g., 10Hz). This sequence may include the pipeline's inlet pressure, outlet pressure, flow rate, and temperature. The length of the time window is denoted as... Let the start time of the current time window be... The collected head pressure sequence is: The terminal pressure sequence is The input sequence is The temperature sequence is ,in Then, the trained working condition encoding neural network is used to extract the working condition feature vector corresponding to the time window.
[0026] The training process of this working condition coding neural network is as follows: First, using a pipeline transient flow simulation model, dynamic datasets for normal operation and leakage operation are generated, covering multiple combinations of different flow rates, ambient temperatures, and pipeline roughness. Each data sample in both datasets is labeled with corresponding operating condition parameters. These parameters include flow rate range labels, temperature range labels, and roughness range labels. The flow rate can be set to 10 equally spaced increments (e.g., 30%, 40%, ..., 120% of rated flow rate), the ambient temperature can be set to four typical values: -20℃, 0℃, 20℃, and 40℃, and the pipeline roughness can be set to four levels: 0.01mm, 0.05mm, 0.1mm, and 0.5mm, generating a total of 160 operating condition combinations. Each data sample is labeled with corresponding operating condition parameters, including flow rate range labels (e.g., low, medium, high), temperature range labels (low temperature, normal temperature, high temperature), and roughness range labels (smooth, medium, rough).
[0027] Then, a multi-task operating condition coding neural network is constructed. This network consists of a shared convolutional long short-term memory coding layer and multiple parallel operating condition classification branches. The actual measurable boundary parameter sequence of the pipeline is used as input, and the operating condition parameter labels are used as supervision signals for joint pre-training to obtain a trained operating condition coding neural network. Each classification branch adopts a focal loss function to balance the number of samples in different operating condition intervals. The boundary parameter sequence includes the pressure at the beginning of the pipeline, the pressure at the end of the pipeline, the flow rate, and the temperature. The fixed-length vector output by the shared convolutional long short-term memory coding layer after pre-training is used as the operating condition feature vector.
[0028] Specifically, the input to the shared coding layer in this operating condition coding neural network is a sequence of measurable boundary parameters of the pipeline (head pressure, tail pressure, flow rate, and temperature, with a length of...). The matrix is passed sequentially through a one-dimensional convolutional layer (kernel size 5, stride 2, output channels 32), a ReLU activation layer, a max pooling layer (pooling window size 2), and then fed into two layers of long short-term memory network (each layer has 64 hidden units). Finally, a fixed-length 128-dimensional vector is output as the working condition feature vector. The three parallel classification branches are all fully connected layers with softmax outputs, predicting the input range, temperature range, and roughness range, respectively. Each classification branch uses a focal loss function to balance the number of samples across different operating ranges. The focal loss function is defined as: ; in, This represents the model's predicted probability for the correct category. As a class balance factor, To focus on parameters (e.g., 2). During joint training, the total loss is the sum of the losses from the three branches. After training, the 128-dimensional vector output from the pre-trained shared convolutional-long short-term memory encoding layer is used as the working condition feature vector. .
[0029] During actual testing, the central processing unit inputs the boundary parameter sequence within the current time window into the trained operating condition encoding neural network, and the current operating condition feature vector is obtained through forward propagation. .
[0030] Step S120: Use the current operating condition feature vector as the boundary condition to drive the pipeline transient flow simulation model and obtain the simulated pressure time series values of each virtual pressure measuring point within the current time window.
[0031] Obtain the feature vector of the current working condition Subsequently, the transient flow simulation model of the pipeline needs to be driven by the leak-free assumption as the boundary condition to obtain the simulated pressure time series values of each virtual pressure measuring point within the current time window. To set the dynamic boundary more accurately, a pre-trained boundary condition mapping network is used.
[0032] The boundary condition mapping network is a three-layer fully connected neural network, with the input being the working condition feature vector. (128-dimensional), the output is the boundary variation curve parameters of the pipeline. Specifically, the output layer contains four branches, each branch outputting a set of basis function coefficients used to reconstruct the pressure boundary variation curve at the inlet. End pressure boundary variation curve , Output change curve and temperature change curve The reconstruction method employs radial basis function interpolation: assuming uniform distribution within the time window. Each time point (e.g.) The boundary condition mapping network outputs the function value at each node, and then the continuous-time curve is obtained through cubic spline interpolation. The training data of this network comes from the boundary condition sequences under different working conditions generated by the simulation model. It is trained in a supervised learning manner, and the loss function is the mean squared error.
[0033] Subsequently, using the no-leakage assumption as the leakage boundary condition (i.e., assuming the pipeline has no perforations or cracks), the reconstructed boundary change curves are used as dynamic boundaries to drive the transient flow simulation model of the pipeline for solution. To improve computational accuracy and reduce computational load, the model employs a tunable adaptive mesh refinement strategy: within sections between adjacent real pressure sensors, the density is set to the actual sensor density. of times (e.g.) The simulation model uses virtual pressure measurement points. It is based on the one-dimensional transient flow control equations (continuity equation, momentum equation, and energy equation) and is solved numerically using the method of characteristics. Simulated pressure time-series values are output at each node of the refined grid. ,in For the first Mileage of virtual pressure measurement points Iterate through the discrete time points within the current time window (consistent with the sampling frequency of the measured data). After aligning the simulated time series values by time, the simulated pressure time series values of each virtual pressure measuring point within the current time window are obtained.
[0034] In some embodiments, the time window length The method for determining this is as follows: First, based on the pipe length... and the propagation speed of pressure waves (For the conveying medium, It can be calculated from the bulk modulus of elasticity and density, for example, in refined oil pipelines. ), calculate the base window length: .
[0035] Then, a random jitter factor is added. The final time window length is: ,in, It follows a truncated normal distribution with a mean of 0 and a standard deviation of 0.1, and its value range is [range missing]. .
[0036] Step S130: Based on the simulated pressure time series values of each virtual pressure measuring point and the measured pressure time series values of adjacent real pressure sensors, determine the consistency index sequence distributed along the pipeline.
[0037] In practice, for each virtual pressure measuring point, the simulated pressure time series value is subtracted from the measured pressure time series values of the two adjacent real pressure sensors at each time step to obtain two difference sequences. The two difference sequences are then weighted and averaged to obtain a weighted average difference sequence. The weights of the two difference sequences are inversely proportional to the distance from the virtual pressure measuring point to the corresponding real pressure sensor. Then, the weighted average difference sequence is filtered by moving average within the current time window to obtain a scalar value as the consistency index at the virtual pressure measuring point. All virtual pressure measuring points are arranged sequentially along the pipeline to form the consistency index sequence.
[0038] Specifically: This involves obtaining the simulated pressure time-series values at each virtual pressure measurement point. Then, the measured pressure time series values at each actual pressure sensor location within the same time window are read simultaneously. ,That For the first Mileage of a real sensor.
[0039] For each virtual pressure measurement point First, locate the two adjacent real pressure sensors, located upstream and downstream respectively, and record the mileage as . and The corresponding measured pressure time series value is denoted as and Then, the simulated pressure time series values will be... (Characterizing virtual measuring points) At any moment The simulated pressure and the two measured pressure time series values are subtracted time-by-time to obtain two difference sequences:
[0040]
[0041] in, For upstream real sensors at any time The actual measured pressure.
[0042] The two difference sequences are weighted and averaged, with the weights inversely proportional to the distance from the virtual pressure measurement point to the corresponding real pressure sensor. Let the virtual pressure measurement point... The distance to the upstream sensor is The distance to the downstream sensor is Then the weighted average difference sequence is:
[0043] To avoid the influence of instantaneous noise, the weighted average difference sequence is filtered by a moving average within the current time window. The moving window length is set to... ,in The sampling frequency is the number of sampling points within half a second. After filtering, a scalar value is obtained as the consistency index for that virtual pressure measurement point. :
[0044] in, This represents the number of sampling points within the time window, or the final value obtained by using a moving average (or the root mean square of the differences within the window; in this embodiment, the arithmetic mean is used). All virtual pressure measurement points are arranged in ascending order of mileage, thus forming a consistency index sequence. ,in This represents the total number of virtual pressure measurement points.
[0045] This consistency index quantifies the deviation between simulated and measured pressures: under ideal conditions of no leakage and accurate model. It should be close to zero; when a leak exists, the simulated value near the leak point (based on the assumption of no leak) will be higher than the measured value, leading to... A positive deviation has occurred.
[0046] Step S140: Based on the comparison results of the current deviation mode feature vector and the normal baseline deviation mode feature vector of the consistency index sequence, and combined with the spatiotemporal mode determination conditions, determine the leakage location range.
[0047] Before comparing the current deviation pattern feature vector of the consistency index sequence with the normal baseline deviation pattern feature vector, a one-dimensional dilated convolutional neural network with three parallel dilated convolutional branches is used to extract multi-scale features from the consistency index sequence. The output features of the three branches are concatenated, and then passed through global average pooling and a fully connected layer to output a fixed-dimensional current deviation pattern feature vector. The dilation rate of each branch is different. Specifically: To extract leakage-sensitive features from the consistency index sequence, this application employs a one-dimensional dilated convolutional neural network to obtain the current deviation pattern feature vector. The network structure is as follows: it contains three parallel dilated convolutional branches, each employing a different dilation rate. Each branch consists of two convolutional layers (each with a kernel size of 3, and output channels of 32 and 64 respectively). The output feature maps of the three branches are concatenated along the channel dimensions and then passed sequentially through a global average pooling layer (output dimension 192) and a fully connected layer (output dimension 128), finally outputting a vector of fixed dimensions. That is, the feature vector of the current deviation mode.
[0048] The normal benchmark deviation pattern features are configured as follows: During a historical operating period with no leakage and stable conditions, a series of consistency indicators for multiple historical time windows are obtained; the consistency indicator sequences for each historical time window are sequentially processed through a one-dimensional dilated convolutional neural network for feature extraction; and the mean and standard deviation of all output vectors are calculated at the same dimensional position to obtain the normal benchmark deviation pattern feature vector. Specifically: Normal reference deviation mode eigenvector The configuration method is as follows: During the initial leak-free and stable historical operation period after the pipeline is put into operation (e.g., 72 consecutive hours without any alarms and confirmed by manual verification of no leaks), the central processing unit acquires a sequence of consistency indicators for multiple historical time windows. For each window, a feature vector is calculated according to the steps described above. Let the total number of collected... windows (e.g.) ), to obtain the set of feature vectors For each dimension of the feature vector ( ), calculate the average of all samples in this dimension. and standard deviation :
[0049] in, For the first The first window feature vector Dimensionless element; For the first The mean of the dimension.
[0050] Then, the characteristic vector of the normal benchmark deviation mode is composed of the mean vector. and standard deviation vector Common description, that is, assuming that the features under normal operating conditions follow independent Gaussian distributions in each dimension. In actual storage, and Stored in the benchmark database and linked with the operating condition feature vector The cluster centers are bound to the cluster centers so that the corresponding benchmark can be retrieved based on the feature vector of the current working condition in subsequent detection.
[0051] As an alternative implementation, a simpler one-dimensional convolutional neural network can be used to extract the current deviation pattern features: this network sequentially connects a first convolutional layer (kernel length 3, output channels 32), a first pooling layer (max pooling, window size 2), a second convolutional layer (kernel length 5, output channels 64), a second pooling layer (max pooling, window size 2), a global average pooling layer, and a fully connected layer (output 128 dimensions). Both networks can achieve the functionality; this embodiment preferentially uses a dilated convolutional network to obtain multi-scale receptive fields.
[0052] During real-time detection, the central processing unit first determines the current operating condition feature vector. Retrieve the corresponding normal benchmark deviation pattern feature vector from the benchmark database. Then, the current deviation pattern feature vector is... Compare with the benchmark and calculate the standardized difference vector:
[0053] in, The th feature vector of the current feature vector dimension; These are the baseline mean and standard deviation, respectively. This is a standardized difference vector. Each element represents the standard deviation factor by which the current feature deviates from the normal mean.
[0054] Further, the determination of the leak location range includes: Based on difference vector And the spatiotemporal pattern determination conditions, to determine the leakage location range. Since the consistency index sequence corresponds one-to-one with the mileage location of the virtual pressure measurement points, the difference vector... Essentially, it describes the degree of deviation at various mileage points along the pipeline. The specific operation is as follows: First, the difference feature vector is expanded into a difference value sequence along the pipeline mileage direction. ,in Obtain the mileage coordinates of each virtual pressure measurement point. Note: Because the feature extraction network compresses spatial information, the difference vector is not directly equivalent to the difference of the original consistency index sequence. Therefore, this embodiment adopts an inverse mapping method: using the trained decoder (a transposed convolutional network symmetrical to the feature extraction network) to... The sequence is mapped back to a spatial distribution of the same length as the original consistency index sequence. This decoder is jointly trained with the feature extraction network during the training phase, using the reconstruction error as one of the loss functions. The final result is a sequence of discrepancies along the pipeline mileage distribution. ,in .
[0055] Then, using a length of Sliding window, positive integers ( Corresponding to the actual physical length, such as the number of virtual measuring points corresponding to 200 meters) along Scan point by point and calculate the local cumulative sum of differences within each window:
[0056] in,; This represents the difference in the distribution along the pipeline mileage (usually a multiple of the standard deviation). This is a local cumulative sum for the window.
[0057] And determine whether the difference values within the window continuously exceed a preset difference threshold. (like This indicates a deviation from the normal range of 2 standard deviations. When the local cumulative sum within the window... Greater than the first threshold (For example ), and the length of the pipe section corresponding to the window. Greater than the preset minimum leakage section length (like When the distance is (meters), the starting position of the window will be determined. and end position Marked as a candidate leak section.
[0058] To avoid false candidates caused by random noise, this embodiment introduces time-dimensional tracking: tracking the local cumulative sum of the same candidate leakage segment within multiple consecutive time windows (e.g., three consecutive windows). ,in For the first The end time of each time window. If the cumulative sum increases monotonically with time and the increase rate of adjacent time windows exceeds the second threshold. (like If the candidate leakage section is indeed the actual leakage section, then it is confirmed. The determination of a monotonically increasing trend can be achieved using linear regression fitting, requiring a slope greater than 0 and a goodness of fit. .
[0059] Finally, within the confirmed leak area, the difference values were identified. Mileage location corresponding to the peak point The estimated location of the leak is used as the starting and ending mileage of the section, and the leak location interval is output as follows: "Leak located at..." At a distance of meters, the estimated leak point is... rice".
[0060] In some embodiments, to maintain the long-term accuracy of the pipeline transient flow simulation model, this application also includes an adaptive model calibration step performed after a leak is detected. When the system confirms a leak in a continuous section, the central processing unit marks the simulated pressure time-series values of all virtual pressure measuring points within the leaking section as unreliable, because the no-leak assumption no longer holds in that section. Then, using only the measured data from real pressure sensors outside that section and the simulated values from virtual pressure measuring points outside that section (these areas can still be considered leak-free or have negligible leakage effects), the friction coefficient of the pipeline transient flow simulation model is refitted. With heat transfer coefficient The specific fitting method is as follows: using the mean square error between the measured pressure and the simulated pressure as the objective function, a Bayesian optimization algorithm is used to search for the optimal value within a reasonable range. and This minimizes simulation errors in non-leakage areas. The updated model parameters are saved and used for simulations in subsequent time windows, thus enabling adaptive tracking of slow changes such as pipe aging and scaling.
[0061] Corresponding to the above method, embodiments of this application also provide a pipeline leak detection device, such as... Figure 2 As shown, the device includes: The acquisition unit 210 is used to obtain the current operating condition feature vector corresponding to the current time window based on the pipeline operation data sequence collected during pipeline operation and using a trained operating condition coding neural network. The driving unit 220 is used to drive the pipeline transient flow simulation model with the current working condition feature vector as the boundary condition to obtain the simulated pressure time series value of each virtual pressure measuring point in the current time window; The determination unit 230 is used to determine the consistency index sequence distributed along the pipeline based on the simulated pressure time series values of each virtual pressure measuring point and the measured pressure time series values of adjacent real pressure sensors. Furthermore, based on the comparison results between the current deviation mode feature vector and the normal baseline deviation mode feature vector of the consistency index sequence, and combined with the spatiotemporal mode determination conditions, the leakage location range is determined.
[0062] The functions of each functional unit of the pipeline leak detection device provided in the above embodiments of this application can be realized through the above methods and steps. Therefore, the specific working process and beneficial effects of each unit in the pipeline leak detection device provided in the embodiments of this application will not be repeated here.
[0063] This application also provides an electronic device, such as... Figure 3 As shown, it includes a processor 310, a communication interface 320, a memory 330, and a communication bus 340, wherein the processor 310, the communication interface 320, and the memory 330 communicate with each other through the communication bus 340.
[0064] Memory 330 is used to store computer programs; When the processor 310 executes the program stored in the memory 330, it performs the following steps: Based on the pipeline operation data sequence collected during pipeline operation within the current time window, a trained operating condition coding neural network is used to obtain the current operating condition feature vector corresponding to the time window. The current operating condition feature vector is used as the boundary condition to drive the pipeline transient flow simulation model, obtaining the simulated pressure time series values of each virtual pressure measuring point within the current time window. Based on the simulated pressure time series values of each virtual pressure measuring point and the measured pressure time series values of adjacent real pressure sensors, a consistency index sequence distributed along the pipeline is determined. Based on the comparison results of the current deviation mode feature vector and the normal benchmark deviation mode feature vector of the consistency index sequence, combined with the spatiotemporal mode judgment conditions, the leakage location interval is determined.
[0065] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0066] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0067] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0068] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0069] The implementation methods and beneficial effects of the various components of the electronic device in the above embodiments for solving the problem can be found in [reference needed]. Figure 1 The steps in the illustrated embodiments are used to implement the electronic device. Therefore, the specific working process and beneficial effects of the electronic device provided in this application will not be repeated here.
[0070] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores instructions that, when executed on a computer, cause the computer to perform any of the pipeline leak detection methods described in the above embodiments.
[0071] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the pipeline leak detection methods described in the above embodiments.
[0072] Those skilled in the art will understand that the embodiments in this application can be provided as methods, systems, or computer program products. Therefore, the embodiments in this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the embodiments in this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0073] This application describes embodiments of methods, apparatus (systems), and computer program products according to embodiments of this application with reference to flowchart illustrations and / or block diagrams. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0074] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0075] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0076] Although preferred embodiments have been described in this application, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of this application.
[0077] Obviously, those skilled in the art can make various modifications and variations to the embodiments of this application without departing from the spirit and scope of the embodiments of this application. Therefore, if these modifications and variations to the embodiments of this application fall within the scope of the claims in this application and their equivalents, then this application also intends to include these modifications and variations.
Claims
1. A method for detecting pipeline leaks, characterized in that, The method involves setting multiple virtual pressure measurement points in the pipeline section between adjacent real pressure sensors, and includes: Based on the pipeline operation data sequence collected during the pipeline operation process within the current time window, the current operating condition feature vector corresponding to the time window is obtained by using a trained operating condition coding neural network. The current operating condition feature vector is used as the boundary condition to drive the pipeline transient flow simulation model, and the simulated pressure time series values of each virtual pressure measuring point within the current time window are obtained. Based on the simulated pressure time series values of each virtual pressure measuring point and the measured pressure time series values of adjacent real pressure sensors, a consistency index sequence distributed along the pipeline is determined. Based on the comparison results of the current deviation mode feature vector and the normal baseline deviation mode feature vector of the consistency index sequence, combined with the spatiotemporal mode determination conditions, the leakage location range is determined.
2. The method as described in claim 1, characterized in that, The training process of the working condition coding neural network includes: Using a pipeline transient flow simulation model, a normal operation dynamic dataset and a leakage operation dynamic dataset are generated; each data sample in the normal operation dynamic dataset and the leakage operation dynamic dataset is labeled with the corresponding operating condition parameter label; A multi-task operating condition coding neural network is constructed, which consists of a shared convolutional-long short-term memory coding layer and multiple parallel operating condition classification branches. The actual measurable boundary parameter sequence of the pipeline is used as input, and the operating condition parameter labels are used as supervision signals for joint pre-training to obtain a trained operating condition coding neural network. The fixed-length vector output by the shared convolutional-long short-term memory coding layer after pre-training is used as the operating condition feature vector.
3. The method as described in claim 1, characterized in that, Obtain the simulated pressure time series values of each virtual pressure measurement point within the current time window, including: The current operating condition feature vector is input into a pre-trained boundary condition mapping network, which outputs the boundary change curve of the pipeline. Using the no-leakage assumption as the leakage boundary condition, the pipeline transient flow simulation model with the boundary change curve as the dynamic boundary driven configuration is solved. The model adopts a mesh adaptive densification strategy, setting virtual pressure measurement points with a density of a preset multiple of the density of the real sensor in the section between adjacent real pressure sensors. The simulated pressure time series value is output on each encrypted grid node, and the simulated pressure time series value is aligned by time and used as the simulated pressure time series value of the virtual pressure measurement point to obtain the simulated pressure time series value within the current time window.
4. The method as described in claim 3, characterized in that, The length of the time window is dynamically determined based on the pipe length and the pressure wave propagation speed, including: The base window length is obtained by dividing the pipe length by the pressure wave propagation speed by twice the time, and then adding a random jitter factor to obtain the final time window length.
5. The method as described in claim 1, characterized in that, Determine the sequence of consistency indicators distributed along the pipeline, including: For each virtual pressure measurement point, the simulated pressure time series value is subtracted from the measured pressure time series values of the two adjacent real pressure sensors at each time step to obtain two difference series and the corresponding weighted average difference series. The weighted average difference sequence is filtered by moving average within the current time window to obtain a scalar value as the consistency index at the virtual pressure measurement point, and a sequence of consistency indices arranged sequentially along the pipeline.
6. The method as described in claim 1, characterized in that, The method further includes: Before comparing the current deviation pattern feature vector of the consistency index sequence with the normal baseline deviation pattern feature vector, a one-dimensional dilated convolutional neural network with three parallel dilated convolutional branches is used to extract multi-scale features from the consistency index sequence. The output features of the three branches are concatenated and then passed through global average pooling and a fully connected layer to output a fixed-dimensional current deviation pattern feature vector. The dilation rate of each branch is different. The normal benchmark deviation pattern features are configured as follows: during the historical operation period when the pipeline is leak-free and the operating conditions are stable, a series of consistency indicators for multiple historical time windows are obtained; the consistency indicator sequences of each historical time window are sequentially processed by a one-dimensional dilated convolutional neural network for feature extraction, and the average value and standard deviation of all vectors are calculated for multiple output vectors according to the same dimension position to obtain the normal benchmark deviation pattern feature vector.
7. The method as described in claim 1, characterized in that, Based on the comparison results between the current deviation mode feature vector and the normal baseline deviation mode feature vector of the consistency index sequence, and combined with the spatiotemporal pattern determination conditions, the leakage location range is determined, including: The current deviation mode feature vector is subtracted element by element from the normal baseline deviation mode feature vector to obtain the difference feature vector, and the difference feature vector is expanded into a sequence of difference values along the pipeline mileage direction; A sliding window of length L is used to scan point by point along the difference value sequence, calculate the local cumulative sum of the difference values in each window, and determine whether the difference values in the window continuously exceed a preset difference threshold, where L is a positive integer; When the local cumulative sum within any window is greater than the first threshold, and the length of the pipe segment corresponding to the window is greater than the preset minimum leakage segment length, the start and end positions of the window are marked as candidate leakage segments. The local cumulative sum of the same candidate leakage section is tracked within multiple consecutive time windows. If the cumulative sum shows a monotonically increasing trend over time and the increase rate of adjacent time windows exceeds the second threshold, then the candidate leakage section is confirmed as a real leakage section. Within the confirmed leak section, the mileage corresponding to the peak of the difference value is taken as the estimated location of the leak point, and the starting and ending mileages of the section are taken as the leak location interval.
8. A pipeline leak detection device, characterized in that, The device includes: setting multiple virtual pressure measurement points in the pipeline section between adjacent real pressure sensors; The acquisition unit is used to obtain the current operating condition feature vector corresponding to the current time window based on the pipeline operation data sequence collected during pipeline operation and using a trained operating condition coding neural network. The driving unit is used to drive the pipeline transient flow simulation model with the current operating condition feature vector as the boundary condition, and obtain the simulated pressure time series value of each virtual pressure measuring point in the current time window. The determination unit is used to determine the consistency index sequence distributed along the pipeline based on the simulated pressure time series values of each virtual pressure measuring point and the measured pressure time series values of adjacent real pressure sensors. Furthermore, based on the comparison results between the current deviation mode feature vector and the normal baseline deviation mode feature vector of the consistency index sequence, and combined with the spatiotemporal mode determination conditions, the leakage location range is determined.
9. An electronic device, characterized in that, The electronic device includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method of any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-7.
