A method and system for locating gas pipeline leaks using a combination of XGBoost algorithm and negative pressure wave

By combining the XGBoost algorithm with the negative pressure wave localization method, and utilizing pre-trained models and SCADA system data, the problems of insufficient accuracy and large errors in natural gas pipeline leak detection were solved, achieving high-precision leak location and rapid repair.

CN119647273BActive Publication Date: 2025-12-19SOUTHWEST PETROLEUM UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411819533.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-12-19
Estimated Expiration
2044-12-11

AI Technical Summary

Technical Problem

Existing technologies for detecting leaks in natural gas pipelines suffer from insufficient accuracy and large errors. In particular, due to the limitations of SCADA systems, the compressibility of natural gas, and the interference of internal pipeline pressure fluctuations, it is difficult to achieve high-precision leak location.

Method used

The combined XGBoost algorithm and negative pressure wave localization method are used to predict the leak location and aperture through a pre-trained XGBoost model, and the calculation is optimized by combining SCADA system data to improve the localization accuracy.

Benefits of technology

It improves the accuracy and speed of locating natural gas pipeline leaks, reduces errors, ensures accurate identification of leak locations and diameters, and enhances pipeline operation safety and emergency repair efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0005182756960000021
    Figure BDA0005182756960000021
  • Figure BDA0005182756960000022
    Figure BDA0005182756960000022
  • Figure BDA0005182756960000023
    Figure BDA0005182756960000023
Patent Text Reader

Abstract

The application discloses a kind of methods and systems for locating gas pipeline leakage combined with XGBoost algorithm and negative pressure wave, belong to natural gas pipeline safety guarantee field.The method includes the following steps: 1) by SCADA system reads each valve chamber and station pressure, flow and other signals, and it is preprocessed;2) time series signal is input into pre-trained XGBoost model, and the leakage position and aperture are predicted;3) the flow and pressure of leakage point are calculated;4) determine the pressure drop along the way of upstream and downstream of leakage point;5) the pipeline is segmented and the gas flow rate and pressure wave propagation velocity are calculated segment by segment;6) the signal time difference of front and rear station is calculated, and the position of leakage point is further accurately positioned.The application also has a leakage positioning system, which can be used for real-time detection of pipeline leakage, and quickly locates the leakage point.Compared with the traditional method, the application has the advantages of accurate positioning, clear process and strong operability, and is suitable for application by the person skilled in the art.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of natural gas pipeline safety, and particularly relates to a method and system for locating a gas pipeline leak by combining an XGBoost algorithm with a negative pressure wave. BACKGROUND

[0002] During the long-term operation of a natural gas pipeline, the pipeline is subject to risks of failure caused by corrosion and erosion, welding defects, and third-party intervention. As the pipeline gradually enters the middle and later stages of service, leakage has become one of the most common types of faults in the operation of a natural gas pipeline network, and there is an urgent need to achieve efficient detection, accurate identification, and immediate positioning of the leakage.

[0003] At present, the negative pressure wave detection technology is the main means for pipeline leakage monitoring, and its effect is highly dependent on the accuracy of the leakage signal collection. The traditional method relies on the SCADA system or directly deployed sensors to capture the leakage signal, but the inherent precision limitation of the SCADA system affects its performance in leakage detection, resulting in insufficient accuracy of the directly read leakage signal. In addition, due to the high compressibility of the transmission medium in the natural gas pipeline, the pressure fluctuation inside the pipeline forms additional interference to the identification of the leakage signal, further increasing the error range of the negative pressure wave positioning relying solely on the time difference data of the SCADA system.

[0004] To overcome the problem of accurate positioning in natural gas pipeline leakage detection, an effective solution is needed to improve the detection accuracy while ensuring the signal collection of the SCADA system. At present, the traditional negative pressure wave detection method cannot meet the requirements of high-precision leakage positioning due to the precision limitation of the SCADA system. At the same time, due to the compressibility of the natural gas medium and the pressure fluctuation interference inside the pipeline, the negative pressure wave positioning technology relying solely on the time difference data of the SCADA system often has a large error. Therefore, an intelligent detection model that can comprehensively utilize the SCADA system signal and has strong anti-interference ability is needed to break through the precision bottleneck of the SCADA system, accurately analyze and predict the time series pressure drop rate signal, and ensure high-precision identification of the leakage location and aperture. SUMMARY

[0005] In view of the lack of a fast and accurate leakage positioning method on existing long-distance gas pipelines, the present application provides a method and system for locating a gas pipeline leak by combining an XGBoost algorithm with a negative pressure wave, which predicts the leakage location and aperture by a pre-trained XGBoost model, uses the negative pressure wave method to calculate the initial value of the leakage positioning, and obtains the accurate leakage location.

[0006] According to a first aspect of the present application, a calculation method for locating a gas pipeline leak by combining an XGBoost algorithm with a negative pressure wave is provided, which comprises:

[0007] Step one, collect pressure, flow and other signals from the SCADA system, and temporarily save and preprocess the signals to form the time series signal of pressure drop rate;

[0008] Step two, input the time series signal into the pre-trained XGBoost model to respectively predict the leakage position and leakage aperture value of the upstream valve chamber and the downstream valve chamber, and take the arithmetic mean of the correlation values of the upstream and downstream valve chambers as the predicted leakage aperture and position;

[0009] Step three, according to the leakage position and leakage aperture predicted by the XGBoost model, calculate the leakage point flow and the leakage point pressure, wherein the specific calculation relationship of the leakage point leakage flow is:

[0010] Q v =0.00078PD 2 (1)

[0011] In the formula, Q v — gas leakage rate, m 3 / s; D— effective hole diameter, mm; P— pipeline operating pressure, MPa; According to the leakage point flow and the leakage point position, simultaneously read the front and rear station pressures and the pipe section flow from the SCADA system, respectively calculate the leakage point pressure from the upstream and downstream valve chambers as the starting point, and take the arithmetic mean of the upstream and downstream pressures as the calculation pressure of the leakage point, and the specific calculation relationship is:

[0012]

[0013]

[0014]

[0015] In the formula, p 0,1 — upstream calculation leakage point pressure, MPa; p 0,2 — downstream calculation leakage point pressure, MPa; p0— leakage point calculation pressure, MPa; — upstream station outstation pressure, MPa; — downstream station inlet pressure, MPa; L0— distance from leakage position to upstream station, km; L— pipe section length, km;

[0016] Step four, according to the leakage point leakage flow and the leakage point pressure, calculate the leakage point along the pressure distribution, wherein the calculation relationship of the along the pressure is:

[0017]

[0018]

[0019] wherein p x,1 — the pressure in the pipe section upstream of the leak point, MPa; p x,2 — the pressure in the pipe section downstream of the leak point, MPa; x — the position of each point along the line, km; — the inlet pressure of the downstream station, MPa;

[0020] Step five, the pipeline is divided into n sub-pipe sections according to the length of the pipe section and the related factors such as the relief height, and the pipeline is numbered as 1, 2, …, i, …, n from upstream to downstream; and the flow rate and the pressure wave propagation speed of the gas in the pipeline are calculated section by section, and the flow rate of the gas is calculated according to the flow rate and the pressure wave propagation speed along the line, wherein the calculation relationship of the flow rate of the gas is:

[0021]

[0022] wherein u(x) — the flow rate of the gas, m / s; Q *,i — the mass flow rate of the gas, kg / s; i — the pipe section number; R — the gas constant, J / (kg·K); T0 — the ground temperature of the pipeline, k; A — the cross-sectional area of the pipeline, m 2 ; — the starting pressure of the i-th sub-pipe section, Pa; — the ending pressure of the i-th sub-pipe section, Pa;

[0023] wherein the calculation relationship of the pressure wave propagation speed is:

[0024]

[0025] wherein v i (x) — the pressure wave propagation speed, m / s; k — the specific heat ratio; D — the inner diameter of the pipeline, m; E — the elastic modulus of the pipeline, Pa; e — the wall thickness, m.

[0026] Step six, the time difference between the negative pressure wave propagating to the stations before and after the leak point and the accurate leak position are calculated according to the flow rate and the pressure wave propagation speed along the line, and the calculation relationship of the time difference between the negative pressure wave propagating to the stations before and after the leak point is:

[0027]

[0028] wherein Δt is the time difference, s;

[0029] Based on the time difference and the flow rate and the pressure wave propagation speed, the accurate position of the leak point can be calculated, and the calculation formula is as follows:

[0030]

[0031] wherein L0' is the optimized new leak location; v s ,v x are the average pressure propagation velocities upstream and downstream, respectively, m / s, and the calculation relationship is:

[0032]

[0033]

[0034] wherein i is the number of pipe sections divided upstream of the pipeline; n is the number of pipe sections divided downstream of the pipeline; and the accurate gas pipeline negative pressure wave leak location can be obtained based on the above formula calculation.

[0035] According to a second aspect of the present application, a system for locating a gas pipeline leak by combining an XGBoost algorithm with a negative pressure wave is provided, and the system comprises a processor and a memory, wherein the memory stores computer program instructions and temporarily stores SCADA system imported data, and the computer program instructions are executed by the processor to implement the steps of the method for locating a gas pipeline leak by combining an XGBoost algorithm with a negative pressure wave according to the first aspect of the present application, and specifically comprises the following modules:

[0036] 1) a SCADA system data acquisition and temporary storage module, configured to acquire pressure, temperature, flow and other data signals from a SCADA system and save the data;

[0037] 2) a data cleaning and preprocessing module, configured to eliminate abnormal values and missing values contained in the signals, supplement the missing values by using an interpolation method, and calculate pressure drop rate time series data;

[0038] 3) an XGBoost model calling module, configured to import the pressure drop rate time series signal into a pre-trained XGBoost model to predict a leak location and a leak hole diameter initial value;

[0039] 4) a leak location calculation module based on a negative pressure wave, configured to calculate an optimized leak location according to the method provided in the first aspect of the present application in combination with pipeline basic parameters and data acquired by a SCADA system.

[0040] According to the above-mentioned aspect and any possible implementation manner, a further implementation manner is provided, and the pre-training of the XGBoost model comprises:

[0041] dividing training data into a training set and a test set, and transmitting the pressure drop rate time series data to an input layer of the XGBoost model;

[0042] Data preprocessing is performed according to an input layer of the XGBoost model, time sequence samples are formed, and feature information of the sequence samples at different time scales is extracted;

[0043] According to the feature information of the pressure drop rate samples of the time sequence at different time scales, the pre-constructed XGBoost model is trained to obtain a linear or nonlinear relationship between the time sequence of different pressure drop rate data and the leakage aperture and the leakage position.

[0044] Aspects and any possible implementation manners described above, the present application can achieve the following beneficial effects due to the above technical solutions:

[0045] 1) The present application introduces a pre-trained XGBoost model to read SCADA system time sequence to predict the leakage position and the leakage aperture, solving the problem that the leakage signal is difficult to capture and judge when the gas pipeline leaks due to the compressibility of the transported medium;

[0046] 2) The present application predicts the leakage position and the leakage aperture based on the XGBoost model, and performs an optimization calculation based on the negative pressure wave method on the predicted leakage position, improving the leakage accuracy of the positioning method;

[0047] 3) The present application provides a gas pipeline leakage positioning method based on XGBoost model combined with negative pressure wave calculation, which can perform online leakage positioning after obtaining data from the SCADA system, and the calculation process is clear and operable, which is convenient for personnel in the technical field to use. It should be understood that the content described in the summary part is not intended to limit the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. BRIEF DESCRIPTION OF DRAWINGS

[0048] Figure 1 A flow chart of a calculation method for positioning gas pipeline leakage combined with XGBoost algorithm and negative pressure wave is provided for the present application.

[0049] Figure 2 A schematic diagram of the gas trunk line valve chamber arrangement and the leakage position of the embodiments provided for the present application.

[0050] Figure 3 A schematic diagram of the time sequence of two pressure drop rates of the embodiments provided for the present application.

[0051] Figure 4 A schematic diagram of the calculated along-the-line pressure of the embodiments provided for the present application.

[0052] Figure 5 A composition diagram of a calculation system for positioning gas pipeline leakage combined with XGBoost algorithm and negative pressure wave of the embodiments provided for the present application. Detailed Implementation

[0053] To make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described below with reference to the accompanying drawings, but the present invention is not limited to the following embodiments.

[0054] A calculation method for locating gas pipeline leaks using a combination of XGBoost algorithm and negative pressure wave analysis is presented. First, data is acquired from a SCADA system and preprocessed. Second, the data is input into a pre-trained XGBoost model to obtain the predicted leak location and orifice diameter. Finally, the accurate leak location and orifice diameter are calculated using the negative pressure wave method. This method improves pipeline operation safety and the timeliness of emergency repairs. The specific location method includes:

[0055] 1) Read pressure and flow data from the SCADA system and preprocess the data:

[0056] This section mainly includes acquiring SCADA system data, calculating the pressure drop rate data, and processing outliers and missing values ​​in the SCADA system so that the data can be recognized by the pre-trained XGBoost model.

[0057] 2) Input the time-series pressure drop rate signal into the pre-trained XGBoost model to obtain the predicted leak location and leak aperture:

[0058] Specifically, XGBoost (Extreme Gradient Boosting) is a machine learning model based on gradient boosting trees. It improves prediction accuracy by progressively building a set of decision trees. Its advantages include computational efficiency, control over overfitting, and excellent prediction performance for both scattered and continuous data.

[0059] The XGBoost model was pre-trained using existing controlled leakage simulation data, demonstrating good performance in predicting leak orifice diameter and leak location based on pipeline pressure drop rate.

[0060] 3) Based on the leak location and orifice size predicted by the XGBoost model and the flow rate data obtained from the SCADA system, calculate the flow rate, pressure, and other data at the pipeline leak point:

[0061] Specifically, the flow rate and pressure at the leak point are calculated based on the predicted leak location and leak orifice diameter. The calculation formula is as follows:

[0062] Q v =0.00078PD 2 (13)

[0063]

[0064]

[0065]

[0066] wherein Q v — gas leakage rate, m 3 / s; D — effective hole diameter, mm; P — pipeline operating pressure, MPa;

[0067] p 0,1 — upstream calculated leakage point pressure, MPa; p 0,2 — downstream calculated leakage point pressure, MPa; p0 — leakage point calculated pressure, MPa; — upstream station outlet pressure, MPa; — downstream station inlet pressure, MPa; L0 — distance from leakage position to upstream station, km; L — pipe segment length, km;

[0068] 4) Based on the leakage point flow rate and pressure, and the pressure, flow rate and other data of the pipeline head and tail, the pressure distribution along the pipeline is calculated:

[0069] Specifically, the upstream and downstream pipeline pressure distribution along the pipeline is calculated according to the leakage point flow rate and pressure, and the calculation formula is:

[0070]

[0071]

[0072] wherein p x,1 — leakage point upstream pipe segment pressure along the line, MPa; p x,2 — leakage point downstream pipe segment pressure along the line, MPa; x — position of each point along the line, km; — downstream station inlet pressure, MPa;

[0073] 5) The pipeline is divided into n sub-pipe segments, and the flow rate and pressure wave propagation speed of each sub-pipe segment are calculated, specifically, the calculation relationship of the flow rate and pressure propagation speed of each sub-pipe segment is as follows:

[0074]

[0075]

[0076] wherein u(x) — gas flow rate, m / s; Q *,i — gas mass flow rate, kg / s; i — pipe segment number; R — gas constant, J / (kg·K); T0 — ground temperature of pipeline, k; A — pipeline cross-sectional area, m2 ; — the start pressure of the i-th sub-pipe section, Pa; — the end pressure of the i-th sub-pipe section, Pa;

[0077] 6) According to the above method, the time difference of obtaining the leakage signal of the two-end valve chamber or station yard is calculated, and the accurate position of the leakage is further calculated, and the specific calculation relationship is as follows:

[0078]

[0079]

[0080] In the formula, Δt is the time difference, s; L0' is the new leakage position obtained after optimization; v s ,v x are the average pressure propagation speeds of the upstream and downstream respectively, m / s, and the calculation formula is as follows:

[0081]

[0082]

[0083] In the formula, i is the number of pipe sections divided on the upstream of the pipeline; n is the number of pipe sections divided on the downstream of the pipeline.

[0084] Example 1 Since the real-time pressure change data of pipeline leakage is difficult to obtain directly and lacks measured data for verification, this example uses simulation data not involved in the XGBoost model training and increases white noise as an example to demonstrate the calculation method. As shown in Figure 2 , a 200mm aperture leakage occurs at a position 12.65km away from the upstream valve chamber on the pipe section between valve chamber 2 and valve chamber 3 of a certain pipeline model. The calculated simulated pressure drop rate time sequence signals of the upstream valve chamber 2 and the downstream valve chamber 3 are as shown in Figure 3 , the time sequence signals of the pressure drop rate are input into the XGBoost model for prediction to obtain the predicted leakage position and leakage aperture, and the prediction results are shown in the following table 1:

[0085] Table 1 Prediction of leakage position and leakage aperture and calculation of average value

[0086]

[0087] According to the average prediction result, the flow at the leakage position and the pressure at the leakage point are calculated, according to formula (13), combined with the pressure equivalent obtained by the SCADA system, the flow at the leakage point is calculated to be 0.7943m 3 / s, and the flow at the leakage point is introduced into formula (14)~formula (16) to calculate the pressure at the leakage point to be 8.07MPa.

[0088] According to the calculated flow and pressure of the leakage point, the pressure distribution upstream and downstream of the leakage point is calculated according to formula (17) and formula (18), and the pressure distribution along the pipe section after the leakage is as shown in Figure 4 .

[0089] According to the calculation results of the pressure distribution along the pipe section and the temperature and other data obtained from the SCADA system, the pipe section is divided into fifty sub-pipe sections upstream and downstream, and the pipe flow rate and pressure wave propagation speed of each sub-pipe section are calculated according to formula (19) and formula (20), respectively. The calculated gas flow rate of each sub-pipe section is in the range of 1.73-1.84 m / s, and the pressure wave propagation speed of each sub-pipe section is in the range of 464.98-465 m / s.

[0090] According to the flow rate and pressure wave propagation speed of each pipe section, the time difference between the two end valve chambers receiving the leakage signal is calculated according to formula (21), and the calculated time difference of the leakage signal is 0.2644 s.

[0091] According to formula (23) to formula (24), the pressure propagation speed upstream and downstream of the leakage point is calculated, which is 463.21 m / s upstream and 466.78 m / s downstream, respectively, and the time difference of the leakage signal is introduced. According to formula (22), the accurate position of the leakage point can be calculated as 12.63 km.

[0092] By using the above method to calculate the leakage position of the natural gas pipeline, compared with the leakage positioning by the XGBoost model alone, the leakage positioning accuracy is improved from 99.13% to 99.84% by using the calculation method, so that the speed of repairing the natural gas pipeline can be further improved, and the operation and safety of the pipeline can be ensured.

[0093] The above is an introduction to the method embodiment. The following describes the scheme described in the application through a device embodiment. Figure 5 A composition diagram of a calculation system for locating a gas pipeline leakage by combining an XGBoost algorithm and a negative pressure wave according to an embodiment of the application is shown in Figure 5 , which includes a processor and a memory, the memory stores computer program instructions and can temporarily store SCADA system imported data, and the computer program instructions are executed by the processor to implement the steps of the calculation method for locating a gas pipeline leakage by combining an XGBoost algorithm and a negative pressure wave provided in the first aspect of the application, specifically including the following modules:

[0094] The SCADA system data acquisition and temporary storage module is used to obtain pressure, temperature, flow and other data signals from the SCADA system and temporarily save the data;

[0095] A data cleaning and preprocessing module is configured to eliminate abnormal values and missing values contained in the signal, supplement the missing values by using an interpolation method, and calculate a pressure drop rate time series data;

[0096] An XGBoost model calling module is configured to import the pressure drop rate time series signal into a pre-trained XGBoost model to predict a leakage position and a leakage aperture initial value.

[0097] A leakage position calculation module based on a negative pressure wave is configured to calculate an optimized leakage position according to the calculation method provided in the first aspect of the present application, in combination with pipeline basic parameters and data obtained by a SCADA system.

[0098] The above merely describes the preferred embodiments of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method of locating a gas pipeline leak using a combination of an XGBoost algorithm and a negative pressure wave, characterized in that, The method comprises the following steps: 1) Collecting pressure, flow and temperature signals from the SCADA system, temporarily storing and preprocessing the signals, and forming a time series signal of pressure drop rate; 2) Inputting the time series signal into a pre-trained XGBoost model to respectively predict the leakage position and leakage aperture value of the upstream valve chamber and the downstream valve chamber, and taking the average of the predicted leakage aperture and position of the upstream valve chamber and the downstream valve chamber; 3) Calculating the flow rate of the leakage point according to the leakage position and leakage aperture predicted by the XGBoost model, and the specific relationship is: Q v = 0.00078 PD 2 (1) where Q v — gas leak rate, m 3 / s; D — effective hole diameter, mm; P — pipeline operating pressure, MPa; p 0,1 — upstream pressure at the leak point, MPa; p 0,2 — downstream pressure at the leak point, MPa; p0 — leak point calculation pressure, MPa; — upstream station outstation pressure, MPa; — downstream station instation pressure, MPa; L0 — distance from the leak location to the upstream station, km; L — pipeline segment length, km; 4) Calculating the along-path pressure distribution according to the leakage point flow rate and the leakage point pressure, and the specific relationship is: where p x,1 — pipe section upstream of the leak point, MPa; p x,2 — pipe section downstream of the leak point, MPa; x— position of the point along the line, km; — inlet pressure at the downstream station, MPa; 5) Dividing the pipeline into n sub-pipeline sections according to the length and relief height information, and calculating the flow rate and pressure wave propagation speed of the gas in the pipeline section by section, where u(x) - gas flow rate, m / s; Q *,i - gas mass flow rate, kg / s; i - pipe section number; R - gas constant, J / (kg-K); To - ground temperature of the pipeline, k; A - pipeline cross-sectional area, m 2 ; - start pressure of the i-th sub-pipe section, Pa; - end pressure of the i-th sub-pipe section, Pa; v i (x) - pressure wave propagation speed, m / s; k - specific heat ratio; D - pipeline inner diameter, m; E - elastic modulus of the pipeline, Pa; e - pipe wall thickness, m; 6) Calculating the time difference between the front and rear stations according to the along-path flow rate and pressure wave propagation speed, and obtaining the accurate leakage position, and the specific relationship is: where Δt is the time difference, s; L0' is the new leakage location after optimization, km; v s , v x are the average pressure propagation velocities upstream and downstream, respectively, m / s, and the calculation relationship is as follows: Where i is the number of pipeline sections divided upstream of the pipeline; n is the number of pipeline sections divided downstream of the pipeline.

2. The method of claim 1, wherein the XGBoost algorithm is combined with the negative pressure wave method to locate the gas pipeline leak. Based on the pre-trained XGBoost model for prediction, including: Calling the pre-trained XGBoost model, taking the pressure drop rate time series signal obtained from the SCADA system as the input value of the XGBoost model, obtaining the predicted leakage position and the predicted leakage aperture as the output value, and outputting.

3. A system for locating a gas pipeline leak using a combination of an XGBoost algorithm and a negative pressure wave, the system comprising: A processor and a memory, the memory stores computer program instructions and can temporarily store SCADA system import data, and the computer program instructions are executed by the processor to realize the steps of the method for jointly using XGBoost algorithm and negative pressure wave positioning gas pipeline leakage according to any one of claims 1 or 2.

Citation Information

Patent Citations

  • Method for measuring and locating leakage of gas pipelines

    CN101625071A

  • Leakage rate estimation system and method for product oil pipelines based on zero dimension

    CN105042339A