Gas network leak detection method, device and system
By acquiring pressure and flow data from gas pipelines, constructing feature vectors, and using a random forest model to identify leak types, the problem of false alarms and difficulty in distinguishing leak types in existing technologies is solved, achieving accurate leak detection and type identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GOLDCARD HIGH TECH
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-21
AI Technical Summary
Existing gas pipeline leak detection technologies are susceptible to fluctuations in normal operating conditions, leading to frequent false alarms, an inability to effectively distinguish leak types, and a waste of maintenance resources or delays in emergency repairs.
By acquiring pressure and flow data during the operation of the gas pipeline network, feature vectors are constructed. A leak detection model based on a random forest model is used, combined with a majority voting mechanism using multiple decision trees, to accurately identify the type of leak.
It improves the accuracy of gas leak detection, outputs reliable leak types, provides a reliable basis for emergency repair work, and reduces misjudgments and delays.
Smart Images

Figure CN121408640B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, device and system for detecting gas pipeline leaks. Background Technology
[0002] Gas pipeline networks face a complex operating environment. For example, underground pipelines are affected by soil corrosion, ground construction damage, and abnormal gas usage at the user end, which leads to the long-term existence of leakage risks.
[0003] Existing gas pipeline leak detection technologies primarily rely on setting fixed pressure thresholds to identify leaks, triggering alarms when the pipeline pressure falls below or exceeds the preset value. However, simply depending on the absolute pressure value is susceptible to fluctuations in normal operating conditions, leading to frequent false alarms. Furthermore, while some detection technologies compare pressure differences between adjacent time points, they do not incorporate comprehensive analysis using multiple parameters such as flow rate, making it impossible to distinguish the causes of pressure fluctuations and the type of leak.
[0004] Therefore, existing technologies suffer from high misjudgment rates and an inability to promptly distinguish leakage types, leading to wasted maintenance resources or delays in emergency repairs. Summary of the Invention
[0005] This application provides a gas pipeline network leak detection method, device, and system to achieve the technical effect of accurate detection of gas pipeline network leaks and accurate identification of leak types.
[0006] In a first aspect, embodiments of this application provide a method for detecting leaks in a gas pipeline network, including:
[0007] Acquire pressure and flow data during the operation of the gas pipeline network;
[0008] Based on pressure and flow data, a feature vector is obtained at the current moment. This feature vector includes the pressure change rate, flow change rate, pressure-flow deviation, pressure recovery characteristics, and leakage duration.
[0009] Based on feature vectors, a leak detection model is used to determine the first leak detection result of the gas pipeline network. This first leak detection result is used to indicate the leak type of the gas pipeline network. The leak detection model is obtained by training a random forest model based on a sample dataset. The sample dataset includes sample data that are historical feature vectors corresponding to historical gas pipeline network leak events.
[0010] Output the first leak detection result.
[0011] In one possible implementation, the feature vector for the current moment is obtained based on pressure data and flow data, specifically including:
[0012] Based on the pressure value at the first moment and the pressure value at the current moment, determine the pressure change rate of the gas pipeline network at the current moment; the first moment mentioned above refers to the moment before the current moment.
[0013] Based on the flow rate value at the first moment and the flow rate value at the current moment, determine the rate of change of the gas pipeline flow rate at the current moment;
[0014] Based on the current pressure value, the current pressure reference value, the current flow rate, and the current flow rate reference value, determine the pressure-flow deviation of the gas pipeline network at the current moment;
[0015] Based on the pressure value before the gas pipeline leak, the lowest pressure value of the gas pipeline between the first moment and the current moment, and the pressure value of the gas pipeline after the valve is closed, the pressure recovery characteristics of the gas pipeline at the current moment are determined.
[0016] The leakage duration corresponding to the current moment is determined based on the difference between the current moment and the moment when the pressure-flow deviation of the gas pipeline network first exceeds a preset threshold.
[0017] Based on the current pressure change rate, flow rate change rate, pressure-flow deviation, pressure recovery characteristics, and leakage duration, a feature vector is constructed for the current moment.
[0018] In one possible implementation, acquiring pressure and flow data during the operation of the gas pipeline network includes:
[0019] When the pressure in the gas pipeline network drops, acquire pressure and flow data during the operation of the gas pipeline network.
[0020] In one possible implementation, based on feature vectors and utilizing a leak detection model, the first leak detection result of the gas pipeline network is determined, including:
[0021] The feature vector is input into a leak detection model containing multiple decision trees, so that the leak detection model determines the first leak detection result from the initial first leak detection result of each decision tree through a majority voting mechanism;
[0022] After determining the initial leak detection result of the gas pipeline network, the method further includes:
[0023] The confidence level of the first leak detection result is determined based on the number of votes corresponding to the leak detection result and the total number of decision trees.
[0024] If the confidence level is greater than or equal to the preset confidence threshold, an alarm message for gas pipeline leakage is output; this alarm message is used to indicate the first leakage detection result.
[0025] In one possible implementation, the method further includes:
[0026] Based on the feature vector at the current moment and the leakage detection rules corresponding to each leakage type, the second leakage detection result of the gas pipeline network is determined;
[0027] Based on the second leak detection result, the first leak detection result is corrected.
[0028] In one possible implementation, based on feature vectors and utilizing a leak detection model, the first leak detection result of the gas pipeline network is determined, including:
[0029] Based on feature vectors, the first leak detection result is obtained by using the target leak detection model corresponding to the target area to which the gas pipeline network belongs. The sample data in the sample dataset of the target leak detection model includes the historical feature vectors corresponding to historical gas pipeline leak events in the target area, and / or the historical feature vectors corresponding to historical gas pipeline leak events in other areas similar to the target area.
[0030] Secondly, embodiments of this application provide a gas pipeline leak detection device, comprising:
[0031] The acquisition module is used to acquire pressure and flow data during the operation of the gas pipeline network;
[0032] The acquisition module is also used to acquire the feature vector at the current moment based on pressure data and flow data. The feature vector includes the pressure change rate, flow change rate, pressure-flow deviation, pressure recovery characteristics, and leakage duration.
[0033] The determination module is used to determine the first leak detection result of the gas pipeline network based on the feature vector and using the leak detection model. The first leak detection result is used to indicate the leak type of the gas pipeline network. The leak detection model is obtained by training a random forest model based on a sample dataset. The sample dataset includes sample data that are historical feature vectors corresponding to historical gas pipeline network leak events.
[0034] The output module is used to output the first leak detection result.
[0035] In one possible implementation, the above-described apparatus further includes: a construction module;
[0036] The determination module is also used to determine the pressure change rate of the gas pipeline network at the current moment based on the pressure value at a first moment and the pressure value at the current moment; the first moment mentioned above refers to the moment before the current moment.
[0037] The determination module is also used to determine the rate of change of gas pipeline flow at the current moment based on the flow value at the first moment and the flow value at the current moment;
[0038] The determination module is also used to determine the pressure-flow deviation of the gas pipeline network at the current moment based on the pressure value at the current moment, the pressure reference value at the current moment, the flow rate value at the current moment, and the flow rate reference value at the current moment.
[0039] The determination module is also used to determine the pressure recovery characteristics of the gas pipeline network at the current moment based on the pressure value before the gas pipeline network leak, the lowest pressure value of the gas pipeline network between the first moment and the current moment, and the pressure value of the gas pipeline network after the valve is closed.
[0040] The determination module is also used to determine the leakage duration corresponding to the current moment based on the difference between the current moment and the moment when the pressure-flow deviation of the gas pipeline network first exceeds a preset threshold.
[0041] The module is used to construct a feature vector for the current moment based on the pressure change rate, flow change rate, pressure-flow deviation, pressure recovery characteristics, and leakage duration.
[0042] In one possible implementation, the acquisition module is also used to acquire pressure data and flow data during the operation of the gas pipeline network when the pressure of the gas pipeline network drops.
[0043] In one possible implementation, the above-described apparatus further includes: an input module;
[0044] The input module is used to input the feature vector into the leak detection model containing multiple decision trees, so that the leak detection model determines the first leak detection result from the initial first leak detection result of each decision tree through a majority voting mechanism;
[0045] The determination module is also used to determine the confidence level of the first leak detection result based on the number of votes corresponding to the leak detection result and the total number of decision trees;
[0046] The output module is also used to output alarm information for gas pipeline leakage when the confidence level is greater than or equal to a preset confidence threshold; the alarm information is used to indicate the first leakage detection result.
[0047] In one possible implementation, the above-described apparatus further includes: a correction module;
[0048] The determination module is also used to determine the second leakage detection result of the gas pipeline network based on the feature vector at the current moment and the leakage detection rules corresponding to each leakage type;
[0049] The correction module is used to correct the first leakage detection result based on the second leakage detection result.
[0050] In one possible implementation, the acquisition module is further configured to acquire a first leak detection result based on the feature vector and using a target leak detection model corresponding to the target area to which the gas pipeline network belongs; the sample data in the sample dataset of the target leak detection model includes historical feature vectors corresponding to historical gas pipeline leak events in the target area, and / or historical feature vectors corresponding to historical gas pipeline leak events in other areas similar to the target area.
[0051] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;
[0052] The memory stores instructions that the computer executes;
[0053] The processor executes computer execution instructions stored in memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0054] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0055] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0056] Sixthly, embodiments of this application provide a gas pipeline leak detection system, which includes: a detection device, a pressure acquisition sensor, and a flow acquisition sensor;
[0057] Among them, the pressure acquisition sensor is used to collect pressure data during the operation of the gas pipeline network;
[0058] Flow acquisition sensors are used to collect flow data during the operation of gas pipeline networks;
[0059] A detection device for performing the first aspect and / or various possible implementations of the first aspect as described above.
[0060] The gas pipeline leak detection method, apparatus, and system provided in this application acquire pressure and flow data during the operation of the gas pipeline network. Based on this data, a feature vector is obtained at the current moment. Then, based on the feature vector, a leak detection model is used to determine the first leak detection result of the gas pipeline network, and the first leak detection result is output. This method determines multi-dimensional feature parameters through pressure and flow data, and constructs a feature vector characterizing the leakage intensity, process, and duration of the gas pipeline network based on these multi-dimensional feature parameters. Based on this feature vector, the type of gas leak is accurately determined, providing a reliable basis for emergency repair work. Attached Figure Description
[0061] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0062] Figure 1 This is a schematic diagram of the architecture of the gas pipeline network detection system provided in this application;
[0063] Figure 2 Flowchart of the gas pipeline network leak detection method provided in this application Figure 1 ;
[0064] Figure 3 Flowchart of the gas pipeline network leak detection method provided in this application Figure 2 ;
[0065] Figure 4 A schematic diagram of the gas pipeline leak detection device provided in this application;
[0066] Figure 5 A schematic diagram of the gas pipeline leak detection device provided in this application;
[0067] Figure 6 A schematic diagram of the structure of the electronic device provided in this application.
[0068] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0069] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0070] As a core component of urban energy infrastructure, the safe operation of gas pipeline networks is directly related to residents' lives, industrial production, and public safety. Gas pipeline networks typically consist of multi-level branch pipelines, pressure regulating stations, and user-end equipment, operating in a complex environment with various leakage risks.
[0071] Existing gas pipeline leak detection technologies primarily rely on setting fixed pressure thresholds to identify leaks, triggering alarms when the pipeline pressure falls below or exceeds the preset value. However, simply depending on the absolute pressure value is susceptible to fluctuations in normal operating conditions (such as peak gas consumption and temperature changes), leading to frequent false alarms. Some detection technologies incorporate pressure difference comparisons between adjacent time points, but without combining this with comprehensive analysis of multiple parameters such as flow rate, they cannot effectively distinguish the causes of pressure fluctuations and the type of leak.
[0072] Therefore, existing technologies suffer from high misjudgment rates and an inability to promptly distinguish leakage types, leading to wasted maintenance resources or delays in emergency repairs.
[0073] The gas pipeline leak detection method provided in this application can be applied, for example, to a gas pipeline detection system. Figure 1 This is a schematic diagram of the architecture of the gas pipeline network detection system provided in this application. Figure 1 As shown, the data access layer 101 supports multiple communication protocols for establishing stable connections with distributed pressure acquisition devices, flow sensors, and other related monitoring equipment, enabling efficient transmission of real-time data. Furthermore, the data access layer 101 has an automatic reconnection mechanism; when the communication link is interrupted, it can automatically attempt to reconnect to the device within a short period, ensuring the continuity of data transmission.
[0074] After receiving raw data uploaded by data acquisition devices such as pressure sensors and flow sensors, the data access layer 101 parses the data according to preset parsing rules, converting data of different formats into a standard format that the system can recognize. For example, for custom data formats transmitted by the TCP (Transmission Control Protocol) protocol, the data is converted according to preset parsing rules to facilitate subsequent data processing operations such as data verification.
[0075] The data verification service provided by the data access layer 101 includes verifying the integrity and accuracy of the parsed data. For example, it uses CRC (Cyclic Redundancy Check) to check whether errors have occurred during data transmission, and promptly marks and sends error message to the data processing layer 102 when data errors or anomalies are detected, so that the data processing layer 102 can perform appropriate processing.
[0076] The data processing layer 102 provides data cleaning, data storage, and data management services. The data cleaning service uses a moving average filtering method (with a window size of, for example, 5 minutes) to denoise and filter the received data, removing abnormal fluctuations caused by sensor noise, electromagnetic interference, and other factors. Furthermore, it identifies and removes outliers that significantly deviate from the normal range. For missing data, linear interpolation is used to complete the data based on data from adjacent time points, ensuring data integrity and quality.
[0077] The data storage service in data processing layer 102 employs a combination of relational and time-series databases. The relational database stores structured data such as basic pipeline network information (e.g., pipe specifications, equipment parameters, user information), system configuration information, and detailed records of historical leakage events. The time-series database stores real-time collected time-series data such as pressure and flow rates to meet the needs of efficient storage and rapid querying. Furthermore, the data storage service has data backup and recovery functions to periodically back up data and prevent data loss.
[0078] The data processing layer 102 is also used to manage the stored data. Data management services include, but are not limited to, data index optimization, data archiving, and cleanup. For example, it can build an index structure based on the frequency and importance of data usage to improve data query efficiency; archive historical data that has exceeded the preset storage period to free up storage space; and regularly clean up invalid or redundant data to ensure the performance and stability of the database.
[0079] The algorithm analysis layer 103 is used to receive data such as pressure data and traffic data uploaded by the data processing layer, and then perform leak detection based on the received data to obtain the detection results. The detection results are then displayed to the operation and maintenance personnel through the application display layer 104.
[0080] The gas pipeline leak detection method provided in this application calculates multidimensional feature parameters characterizing the leak intensity, process, and duration of the gas pipeline network using pressure and flow data during operation. Based on these multidimensional feature parameters, a feature vector is constructed, which is then input into a leak detection model to accurately identify the gas leak type and output the first leak detection result for the gas pipeline network. This method improves the accuracy of gas leak detection and outputs the gas leak type, providing a reliable basis for emergency repair work.
[0081] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0082] Figure 2 Flowchart of the gas pipeline network leak detection method provided in this application Figure 1 .like Figure 2 As shown, the method includes:
[0083] S201. Obtain pressure and flow data during the operation of the gas pipeline network.
[0084] Key nodes in the gas pipeline network are equipped with data acquisition devices such as pressure sensors and flow sensors. These devices collect data on pressure and flow rates during the operation of the gas pipeline network and then transmit the collected data to the gas pipeline network monitoring system via a predefined communication protocol. For example, the collected pressure and flow rate data might show that the pressure on a city's main gas pipeline is 0.3 MPa and the flow rate is 120 m³ / h during peak gas consumption periods.
[0085] Optionally, such as Figure 1 As shown, the data processing layer 102 preprocesses the data uploaded by the acquisition device and stores the preprocessed data in the time-series database. Therefore, the required pressure and flow data can be obtained from this time-series database.
[0086] S202. Based on pressure data and flow data, obtain the feature vector at the current moment.
[0087] The feature vector includes pressure change rate, flow rate change rate, pressure-flow deviation, pressure recovery characteristics, and leakage duration.
[0088] The system monitors whether pressure and flow data meet the leak detection trigger conditions. If the pressure and / or flow data meet the trigger conditions, it calculates multidimensional feature parameters for the current moment based on pressure and flow data from multiple sampling times within a preset time period, and combines these parameters into a feature vector. The current moment is defined as the moment when the pressure and / or flow data meet the leak detection trigger conditions, and the current moment is the end time of the preset time period.
[0089] Understandably, the aforementioned multidimensional characteristic parameters characterize the changing trends and abnormal patterns of the gas pipeline network's operating status. Among them, the pressure change rate indicates the rate of pressure change per unit time, the flow change rate indicates the rate of flow change per unit time, the pressure-flow deviation indicates the degree of abnormality in the pressure-flow relationship, the pressure recovery characteristic distinguishes the severity of leakage by assessing the pressure recovery after valve closure, and the leakage duration provides a basis for leak detection in the gas pipeline network from a time perspective.
[0090] The purpose of this step is to construct a feature vector using the aforementioned multidimensional feature parameters, thereby accurately and comprehensively characterizing the leakage intensity, process, and duration of the gas pipeline network, providing a comprehensive and accurate basis for subsequent leak detection.
[0091] Optionally, the aforementioned leak detection triggering conditions include, but are not limited to, pressure data below a first pressure threshold and flow data above a first flow threshold. The first pressure threshold and the first flow threshold are set using a time-differentiated strategy, meaning the specific thresholds are determined based on gas usage at different times. This application does not impose any restrictions on this. For example, the first flow threshold and the first pressure threshold are increased during peak gas usage periods compared to off-peak periods.
[0092] S203. Based on feature vectors, use a leak detection model to determine the first leak detection result of the gas pipeline network.
[0093] The first leak detection result is used to indicate the type of leak in the gas pipeline network. The leak detection model is obtained by training a random forest model based on a sample dataset. The sample dataset includes historical feature vectors corresponding to historical gas pipeline leak events.
[0094] The feature vector is input into the leak detection model, and multiple decision trees in the model make judgments on the feature vector, resulting in multiple decision results. These multiple decision results are then voted on, and the first leak detection result with the most votes is output. The leak types in this first leak detection result include, but are not limited to, slow leaks in small holes, sudden leaks in medium holes, abnormal gas consumption at the user end, and major leaks due to pipeline rupture.
[0095] S204, Output the first leak detection result.
[0096] The first leak detection result is output to the user terminal so that maintenance personnel can take corresponding emergency repair measures based on the leak type in the first leak detection result.
[0097] For example, through Figure 1 The application display layer 104 shown presents the first leak detection results to the operation and maintenance personnel.
[0098] The gas pipeline leak detection method provided in this application acquires pressure and flow data during the operation of the gas pipeline network. Based on this data, it obtains a feature vector at the current moment. Then, based on this feature vector, it uses a leak detection model to determine the first leak detection result of the gas pipeline network and outputs the first leak detection result. This method determines multi-dimensional feature parameters through pressure and flow data, and constructs a feature vector characterizing the leakage intensity, process, and duration of the gas pipeline network based on these multi-dimensional feature parameters. Based on this feature vector, it accurately determines the type of gas leak, providing a reliable basis for emergency repair work.
[0099] Figure 3 Flowchart of the gas pipeline network leak detection method provided in this application Figure 2 ,like Figure 3 As shown, in this embodiment... Figure 2 Based on the embodiments, a possible method for detecting gas pipeline leaks is described in detail, the method including:
[0100] S301. When the pressure of the gas pipeline network drops, acquire pressure and flow data during the operation of the gas pipeline network.
[0101] The system monitors the pressure value of the gas pipeline network and, when the pressure value drops to a pressure threshold, acquires pressure and flow data for a preset time period. The pressure threshold is determined based on historical pressure values for different historical time periods and the corresponding operating status of the gas pipeline network. The pressure threshold varies for different time periods and serves as the trigger threshold for leak detection in the gas pipeline network for that specific time period.
[0102] Optionally, a method for determining a pressure threshold is provided herein. This method includes: dividing the gas pipeline network into operating periods; statistically analyzing the historical pressure values and corresponding operating states within each operating period to obtain the pressure threshold corresponding to each operating period. The operating periods include, but are not limited to, peak gas consumption periods, off-peak gas consumption periods, and low-peak gas consumption periods. Furthermore, the aforementioned preset time period is set based on the pipeline network scale and leak detection requirements, and the cutoff time of this preset time period is the current time. For example, the preset time period for the main pipeline network is set to 30 minutes, and the preset time period for the branch pipeline network is set to 10 minutes.
[0103] Optionally, the flow data of the gas pipeline network can also be used as a trigger condition for leak detection. For example, the flow value can be monitored to see if it exceeds a flow threshold, and if the flow value exceeds the flow threshold, leak detection of the gas pipeline network can be triggered. The logic for determining the flow threshold is the same as that for the pressure threshold mentioned above, and will not be repeated here.
[0104] Understandably, the presence of gas leaks can also be predicted by monitoring the pressure change rate of the gas pipeline network within a preset time period. For example, if the pressure change rate of the gas pipeline network within a preset time period is less than a pressure change rate threshold, pressure and flow data during the operation of the gas pipeline network can be obtained.
[0105] The preset duration is an empirical value, such as 10 minutes. This application does not limit the specific value of the preset duration.
[0106] Furthermore, the pressure change rate threshold is automatically adjusted based on the mean and standard deviation of historical data, avoiding the failure of fixed thresholds under changes in pipeline topology or seasonal fluctuations. This process achieves adaptive optimization of the threshold through statistical analysis. The historical data includes historical change rates under normal operating conditions and historical change rates corresponding to historical leakage events.
[0107] In this step, different pressure thresholds correspond to different operating periods of the gas pipeline network, adapting to monitoring scenarios of different scales and different gas pipeline networks, thus improving the adaptability and flexibility of pipeline network monitoring.
[0108] It should be noted that when a drop in pressure is detected in the gas pipeline network, leak detection is performed according to a preset detection cycle. The detection cycle is adjusted based on leak detection requirements, and this application does not impose any restrictions on it. For example, the detection cycle could be 10 minutes. That is, every 10 minutes, flow and pressure data from a preset time period prior to the current moment are acquired to perform leak detection on the gas pipeline network and determine if any new leaks have occurred.
[0109] S302. Based on the pressure value at the first moment and the pressure value at the current moment, determine the pressure change rate of the gas pipeline network at the current moment.
[0110] Here, the first moment refers to the moment before the current moment. The rate of change of pressure refers to the rate at which the pressure value changes per unit time, reflecting the severity of pressure fluctuations.
[0111] Alternatively, the rate of pressure change can be determined based on the following formula:
[0112]
[0113] in, This represents the current pressure value. The pressure value at the first moment. This is a time window. The length of this time window is the same as the length of the preset time period mentioned in the explanation of step S301 above. The first moment is the start time of this preset time period.
[0114] For example, if the current pressure is 0.3 MPa, the time window is 5 minutes, and the pressure at the first moment is 0.28 MPa, then the pressure change rate is 0.004 MPa / min.
[0115] S303. Based on the flow rate value at the first moment and the flow rate value at the current moment, determine the flow rate change rate of the gas pipeline network at the current moment.
[0116] Among them, the flow rate of change refers to the rate of change of the flow value per unit time, reflecting the severity of flow fluctuations.
[0117] Alternatively, the rate of change of flow can be determined based on the following formula:
[0118]
[0119] in, The current flow rate value. The flow rate at the first moment. For a time window. Compared with step S302 above same.
[0120] For example, if the current flow rate is 120 m³ / h, the flow rate at the first moment is 115 m³ / h, and the time window is 5 minutes, then the flow rate change rate is 1 m³ / h / min.
[0121] S304. Based on the current pressure value, the current pressure reference value, the current flow rate value, and the current flow rate reference value, determine the pressure-flow deviation of the gas pipeline network at the current moment.
[0122] The pressure reference value is the historical average pressure of the gas pipeline network during normal operation within the current time period. For example, to determine the first time period to which the current time period belongs, obtain multiple historical pressure values of the gas pipeline network during normal operation within the first time period, calculate the average of the multiple historical pressure values, and use this average as the pressure reference value for the first time period.
[0123] Understandably, the logic for determining the flow rate reference value is similar to that for determining the pressure reference value, and will not be repeated here.
[0124] Alternatively, the pressure-flow deviation can be determined based on the following formula:
[0125]
[0126] in, , The current pressure value. for The pressure reference value for the time period to which the time is located. , The current flow rate. for The pressure reference value for the time period to which the time is located. This represents the ideal model coefficient for the ratio of pressure change rate to flow change rate under normal operating conditions of the gas pipeline network. The Pearson correlation coefficient between pressure and flow rate represents the correlation between flow rate and pressure data within a preset time window. This is the weighting coefficient for the degree of divergence in the correlation coefficient.
[0127] Understandably, The coefficients of the above ideal model represent the degree of deviation of the relative rate of change. For example, the coefficient can be 2. This ideal model coefficient is obtained based on regression analysis of historical normal data, or calculated by a pipeline hydraulic model. The above weighting coefficients... For example, it can be 0.5, and this weighting coefficient is obtained through iterative optimization during model training. Furthermore, the Pearson correlation coefficient between pressure and flow is obtained by analyzing pressure and flow data sequences within a preset time window. For example, extracting... The pressure and flow data are collected, and pressure and flow data sequences are generated according to the collection time corresponding to each data point. Then, the Pearson correlation coefficient between pressure and flow is determined based on the following formula:
[0128]
[0129] in, The total number of data points in the data sequence. for The first One pressure value, for The first Each traffic value, for The average of multiple internal pressure values, for The average of multiple flow values. The value range is [-1, 1].
[0130] It should be noted that different pressure and flow reference values correspond to different time periods at the current moment. The time period division is as explained in the running segment section of step S201 above, and will not be repeated here.
[0131] The relative rate of change deviation quantifies whether there is an abnormal deviation in the proportional relationship between pressure and flow rate changes, and the degree of deviation. When a gas pipeline leaks, the pressure drops. When the value is negative, the flow rate increases. A positive value results in an increase in the deviation of the first related rate of change in the above formula.
[0132] The correlation coefficient divergence measures the degree to which the synchronicity between pressure and flow rate over time is disrupted. Under normal operation of a gas pipeline network, flow rate and pressure have a strong negative correlation; however, when a leak occurs, this correlation is disrupted, leading to… The decrease leads to an increase in the deviation of the correlation coefficient.
[0133] Therefore, when a gas pipeline leaks, the pressure-flow deviation increases.
[0134] S305. Based on the pressure value of the gas pipeline network before the leak, the lowest pressure value of the gas pipeline network between the first moment and the current moment, and the pressure value of the gas pipeline network after the valve is closed, determine the pressure recovery characteristics of the gas pipeline network at the current moment.
[0135] The pressure recovery characteristic refers to the magnitude and speed of pressure recovery during the leakage process, used to distinguish the severity of the leakage. For example, after the valve is closed, the pressure recovers from 0.2 MPa to 0.28 MPa, with a recovery magnitude of 0.08 MPa.
[0136] After detecting a slow pressure drop, the valve data of the gas pipeline network is continuously monitored. Upon receiving a valve-closing signal, the pressure value after valve closure is acquired after a first time interval following the valve closure. Based on this pressure value and the lowest pressure value of the gas pipeline network between the first time interval and the current time interval, the pressure recovery characteristics are determined. The first time interval can be, for example, 5 minutes, to allow the pressure in the pipeline network to stabilize after valve closure before acquiring the pressure value.
[0137] Optionally, the pressure recovery characteristics are determined based on the following formula:
[0138]
[0139] in, This is the pressure value before the gas pipeline leaked. The lowest pressure value between the first moment and the current moment. This is the pressure value after the valve is closed.
[0140] Understandably, The pressure increment that represents the recovery of the gas pipeline pressure from the lowest leak point after the valve is closed reflects the effectiveness of the leak-stopping measures in restoring pressure. The pressure loss, representing the decrease in pressure of the gas pipeline network from the normal pressure value before the leak to the lowest value, reflects the degree of impact of the leak time on the network pressure. The pressure value before the gas pipeline network leak is the historical average pressure under normal operating conditions for the period from the first moment to the valve closing time.
[0141] like = ,Right now, This indicates that the pipeline pressure has returned to the normal level before the leak, the leak point has been completely repaired, and there is no other damage to the pipeline. This indicates that the pipeline pressure has partially recovered, but there are still unrepaired leaks. The smaller the size, the more serious the leakage problem. If ,at this time, This indicates that the pressure has not been restored, the leak-stopping measures are ineffective, or a large-scale leak has not been repaired.
[0142] S306. Based on the difference between the current moment and the moment when the pressure-flow deviation of the gas pipeline network first exceeds a preset threshold, determine the leakage duration corresponding to the current moment.
[0143] This refers to the duration of the leakage event, used to distinguish between slow leaks and sudden leaks. For example, a leakage event might last 120 minutes. Furthermore, the preset threshold is derived from historical data statistical analysis. This includes acquiring normal operating data for different time periods and pipeline networks, as well as leakage operating data corresponding to historical leakage events. Both normal and leakage operating data include pressure-flow deviation. Based on statistical analysis of historical data from multiple time periods, the minimum pressure-flow deviation in the leakage operating conditions within that time period is determined as the preset threshold for that period.
[0144] Specifically, the preset time period from the first moment to the current moment includes multiple data collection moments, which are the moments when the data collection device collects flow and pressure data. Based on the above step S304, the pressure-flow deviation corresponding to each data collection moment is calculated to obtain a pressure-flow deviation sequence. The moment when the pressure-flow deviation first exceeds a preset threshold is determined from this pressure-flow deviation sequence. Furthermore, based on this moment and the current moment, the leakage duration is determined.
[0145] Optionally, the leakage duration can be determined based on the following formula:
[0146]
[0147] in, The moment when the pressure-flow deviation first exceeds a preset threshold. This refers to the current moment.
[0148] Optionally, the unit for the above time can be, for example, hours. Take 0.1.
[0149] Understandably, if no valve-closing signal is received within the first preset time period, then in step S307 below, a feature vector is constructed based on the pressure change rate, flow change rate, pressure-flow deviation, and pressure recovery characteristics. The first preset time period is set based on gas pipeline network operation and maintenance experience, and this application does not limit it.
[0150] Optionally, a method for adjusting multiple parameter thresholds is provided here, the method comprising: acquiring a historical dataset of a gas pipeline network according to a preset period; dividing the historical dataset into multiple time periods, and updating the parameter thresholds for the corresponding time periods based on a subset of historical data for each time period.
[0151] Among them are pressure reference value, flow reference value, and preset threshold corresponding to pressure-flow deviation.
[0152] Specifically, statistical analysis is performed on the historical dataset to dynamically calculate and update the thresholds for each parameter. The historical dataset includes historical pressure data, historical flow data, and historical pressure-flow deviation data corresponding to normal operating conditions and historical leakage events, respectively.
[0153] This method dynamically adjusts parameter thresholds to adapt them to the network's operational status and characteristics across different time periods. For example, the flow fluctuation patterns of newly built networks differ from those of older networks, and the dynamic thresholds can automatically adapt, improving detection accuracy. This method enhances the long-term stability and generalization ability of leak detection models.
[0154] S307. Based on the pressure change rate, flow change rate, pressure-flow deviation, pressure recovery characteristics, and leakage duration at the current moment, construct the feature vector for the current moment.
[0155] This step constructs the feature vector at the current moment based on the multi-dimensional feature parameters calculated in steps S302 to S306 above, which serves as the input for the subsequent leak detection model.
[0156] This step constructs a feature vector using multi-dimensional feature parameters, comprehensively characterizing the intensity, process, and duration of the leakage event from a physical perspective. For example, pressure-flow deviation is used to distinguish between normal fluctuations and actual leaks, and pressure recovery features are used to determine the severity of the leak. This method enhances the physical meaning of the model input, which is beneficial for improving the reliability and interpretability of leak detection results.
[0157] S308. Input the feature vector into the leak detection model containing multiple decision trees, so that the leak detection model determines the first leak detection result from the initial first leak detection result of each decision tree through a majority voting mechanism.
[0158] The leakage detection model comprises multiple decision trees. Each decision tree recursively splits nodes based on Gini impurity, outputting classification results, and then determines the final leakage type through a majority voting mechanism. Gini impurity refers to the degree of disorder in the sample distribution within a node and is used for selecting split nodes in the decision tree. For example, if a node contains 80% normal samples and 20% leaked samples, then the Gini impurity is 1 - (0.8) / 2. 2 +0.2 2 =0.32. Furthermore, the majority voting mechanism refers to the classification results of multiple decision trees in a random forest model being determined by voting. For example, if 7 out of 10 decision trees classify it as "pinhole leakage," then the final output is "pinhole leakage."
[0159] This step classifies the feature vectors using a random forest model. Each decision tree selects the optimal split node based on Gini impurity, recursively constructing decision paths. For example, a decision tree might split based on a pressure-flow divergence threshold (e.g., 0.5). The classification results from all decision trees are aggregated using a majority voting mechanism to output the final leakage type. This process reduces the risk of overfitting and improves classification robustness through an ensemble learning mechanism using multiple decision trees.
[0160] For example, a method for training a leak detection model is provided herein, which includes: collecting historical leak event data, extracting features for each leak type, and constructing a training dataset. ,in, The total number of samples. Feature vector. Define 4 types of leakage labels .
[0161] From the training dataset Random selection with replacement For each decision tree, a sample is randomly selected. One feature, among which That is, from the eigenvectors Two feature parameters are randomly selected. The difference between the Gini impurity of each feature parameter and the Gini impurity of the root node is calculated, as well as the information gain of each feature parameter. The feature parameter with the maximum information gain is then selected as the node to be split, until the cutoff condition is met, thus obtaining the decision tree. The cutoff condition includes, but is not limited to, a sample size of 1 and all samples in a node belonging to the same leakage type.
[0162] Understandably, when calculating split nodes, if the information gain corresponding to each feature parameter is the same, then a feature parameter is randomly selected as the split node; alternatively, based on the weights corresponding to the feature parameters, the feature parameter with the highest weight is selected as the split node. The weights corresponding to each feature parameter represent its contribution to leakage type identification, and these weights are iteratively updated during model training and optimization.
[0163] For example, recursively splitting nodes based on Gini impurity: .in, For the first The proportion of samples of the leakage type.
[0164] Optionally, the model parameters can be updated periodically, and the number of decision trees and the weights of each feature parameter can be adjusted using 5-fold cross-validation. 5-fold cross-validation involves dividing the data into five parts, using them alternately as the validation and training sets to evaluate model performance.
[0165] For example, the weights of each feature parameter can be updated based on the following formula:
[0166]
[0167] in, For the first Importance scores of each feature parameter , The total number of decision trees in the random forest. For the first In the decision tree, using the first The reduction in Gini impurity when performing node splitting using the aforementioned characteristic parameters. For example, it could be 100.
[0168] For example, the feature vector constructed in step S307 above is The feature vector is input into the trained leak detection model, and each decision tree outputs a classification result. The type of leak is determined by majority vote: .in, Used for statistics Whether to vote for the leak type in the decision tree , For statistics Leakage types in decision trees Total number of votes The function is used to filter the leak types with the most votes.
[0169] Optionally, based on the feature vectors, a first leak detection result is obtained using a target leak detection model corresponding to the target area to which the gas pipeline network belongs. The sample dataset of the target leak detection model includes sample data that are historical feature vectors corresponding to historical gas pipeline leak events in the target area, and / or historical feature vectors corresponding to historical gas pipeline leak events in other areas similar to the target area.
[0170] Specifically, based on pipeline topology and historical data clustering analysis, the pipeline network is divided into multiple logical regions, and a leak detection model is trained independently for each region. When performing leak detection, the target leak detection model corresponding to the gas pipeline network is called from among the multiple leak detection models, and the feature vector is input into the target leak detection model to obtain the first leak detection result.
[0171] For example, similar data can be grouped using statistical methods to divide the pipeline network into two regions: the urban core area and the suburbs. The leak detection model for the urban core area focuses on adaptability to peak gas consumption fluctuations, while the leak detection model for the suburbs focuses on sensitivity to detecting minor leaks. This process improves the accuracy of leak detection through regionalized modeling.
[0172] Optionally, after obtaining the first leak detection result, based on the feature vector at the current moment and the leak detection rules corresponding to each leak type, the second leak detection result of the gas pipeline network is determined, and the first leak detection result is corrected based on the second leak detection result.
[0173] Specifically, after receiving the pressure and flow data uploaded by the acquisition device, the system preprocesses the data and calculates multi-dimensional feature parameters based on the preprocessed data according to steps S302 to S306 above. These multi-dimensional feature parameters are stored in the database. After obtaining the first leak detection result, the system retrieves multiple sets of feature parameters from the first moment to the current moment from the database and matches these multiple sets of feature parameters with multiple leak detection rules. The leak type corresponding to the leak detection rule that matches the changes in the multiple sets of feature parameters is determined as the second leak detection result, and this second leak detection result overwrites the first leak detection result.
[0174] The leakage detection rules include the changes in multiple characteristic parameters. For example, the leakage detection rules for slow leakage through a small orifice include: {Pressure change rate: exhibits slight negative fluctuations, fluctuation amplitude ≤ 0.0003 MPa / min, amplitude range: -0.02 to -0.005 MPa / min}, {Flow rate change rate: exhibits a slow increasing trend, upstream value range: +5 to +30 m 3 / h, downstream variation ≤±3m 3The leakage detection rules are based on qualitative analysis of multiple characteristic parameters corresponding to various leakage types and historical characteristic parameter analysis. Table 1 shows a qualitative analysis of multiple leakage types provided in this application embodiment. This qualitative analysis, combined with historical characteristic parameters corresponding to historical leakage times, determines the leakage detection rules.
[0175] Table 1
[0176]
[0177] S309. Based on the number of votes corresponding to the leak detection results and the total number of decision trees, determine the confidence level of the first leak detection result.
[0178] In step S308, the leak detection model outputs the leak type corresponding to the maximum number of votes as the first leak detection result. Based on this maximum number of votes and the total number of decision trees, the confidence level of the first leak detection result is determined.
[0179] Optionally, the confidence level of the first leak detection result is determined based on the following formula:
[0180]
[0181] in, The maximum number of votes corresponding to the first leak detection result. The total number of decision trees.
[0182] S310. When the confidence level is greater than or equal to the preset confidence threshold, output alarm information for gas pipeline leakage.
[0183] The alarm information is used to indicate the results of the first leak detection.
[0184] Based on the preset range of confidence levels, corresponding alarm levels are determined. Each alarm level corresponds to a different alarm channel. Alarm information is generated based on the alarm level and sent to relevant personnel through the corresponding alarm channel. For example, the first preset range corresponds to a level 1 alarm, and the alarm channels include system pop-ups, audible and visual alarms, and alarm information push notifications. The recipients of the alarm information push notifications include, but are not limited to, the operations and maintenance manager. The second preset range corresponds to a level 2 alarm, and the alarm channels include system pop-ups and alarm information push notifications.
[0185] Optionally, if the confidence level is less than a preset confidence threshold, a prompt message is generated based on the multidimensional feature parameters and the first leakage detection result, and the prompt message is displayed on the interactive interface of the operation and maintenance terminal.
[0186] The gas pipeline leak detection method provided in this application acquires pressure and flow data during the operation of the gas pipeline when the pressure of the gas pipeline drops. Based on the pressure value at a first moment and the pressure value at the current moment, it determines the pressure change rate of the gas pipeline at the current moment; based on the flow value at the first moment and the flow value at the current moment, it determines the flow change rate of the gas pipeline at the current moment; based on the pressure value at the current moment, the pressure reference value at the current moment, the flow value at the current moment, and the flow reference value at the current moment, it determines the pressure-flow deviation of the gas pipeline at the current moment; based on the pressure value before the gas pipeline leak, the lowest pressure value of the gas pipeline between the first moment and the current moment, and the pressure value of the gas pipeline after the valve is closed, it determines the pressure recovery characteristics of the gas pipeline at the current moment; based on the difference between the current moment and the moment when the pressure-flow deviation of the gas pipeline first exceeds a preset threshold, it determines the leakage duration corresponding to the current moment; and further, based on the pressure change rate, flow change rate, pressure-flow deviation, pressure recovery characteristics, and leakage duration at the current moment, it constructs a feature vector for the current moment.
[0187] This method constructs feature vectors using multidimensional feature parameters, comprehensively characterizing the intensity, process, and duration of leakage events from a physical perspective. This enhances the physical meaning of the model input and improves the reliability of the detection results. Furthermore, by combining historical pressure and flow data to calculate multidimensional feature parameters, this method further improves the accuracy of leak detection.
[0188] Furthermore, the feature vector is input into a leak detection model containing multiple decision trees. This allows the model to determine the first leak detection result from the initial first leak detection results of each decision tree through a majority voting mechanism. Based on the number of votes corresponding to the leak detection result and the total number of decision trees, the confidence level of the first leak detection result is determined. Then, if the confidence level is greater than or equal to a preset confidence threshold, an alarm message for a gas pipeline leak is output. This method effectively filters noise interference through the majority voting results of multiple decision trees, improves the stability of the detection results, enhances the model's generalization ability in complex environments, and ensures accurate identification of different leak types. In addition, this method outputs alarm information only when the confidence level is greater than or equal to a preset confidence threshold, ensuring the effectiveness of the alarm information and avoiding waste of operational resources.
[0189] Figure 4 This is a schematic diagram of the gas pipeline leak detection system provided in this application. The gas pipeline leak detection system 40 includes: a detection device 401, a pressure acquisition sensor 402, and a flow acquisition sensor 403.
[0190] The pressure acquisition sensor 402 is used to acquire pressure data during the operation of the gas pipeline network, the flow acquisition sensor 403 is used to acquire flow data during the operation of the gas pipeline network, and the detection device 401 is used to acquire the data acquired by the pressure acquisition sensor 402 and the flow acquisition sensor 403, and to perform leak detection of the gas pipeline network based on the acquired data, and output the leak detection results.
[0191] The pressure acquisition sensor 402 can be deployed at key nodes such as the main pipeline and branch interfaces of the gas pipeline network. The specific deployment location is determined according to the monitoring needs of the gas pipeline network, and this application does not impose any restrictions on it.
[0192] The pressure acquisition sensor 402 continuously monitors the gas pressure in the pipeline network according to its acquisition cycle and uploads the pressure value with a timestamp to the detection device. This pressure acquisition sensor 402 can be, for example, a diffused silicon pressure sensor or a ceramic capacitive pressure sensor, or other sensors adapted to the industrial-grade, explosion-proof, and high-precision requirements of gas pipeline networks.
[0193] The flow acquisition sensor 403 and the pressure acquisition sensor 402 are deployed at the same monitoring point to synchronously acquire the flow value in the gas pipeline network and output continuous flow time-series data. The flow acquisition sensor 403 can be, for example, an ultrasonic flow meter, a turbine flow meter, or other flow meter adapted to the explosion-proof and accurate metering requirements of the gas pipeline network.
[0194] It should be noted that the pressure sensor 402 and the flow sensor 403 have a pre-defined communication protocol with the detection device 401. The two sensors transmit the collected pressure data and flow data to the detection device 401 based on this communication protocol. This communication protocol can be, for example, the TCP protocol.
[0195] After receiving the pressure data and flow data transmitted by the pressure acquisition sensor 402 and the flow acquisition sensor 403, the detection device 401 executes the gas pipeline network leakage detection method in the above embodiment and outputs the leakage detection result.
[0196] Understandably, the detection device 401 may be, for example, an edge computing gateway, a computer, or a PLC (Programmable Logic Controller).
[0197] The gas pipeline leak detection system provided in this application includes a detection device, a pressure acquisition sensor, and a flow acquisition sensor. The detection device, by executing the aforementioned gas pipeline leak detection method, uses the pressure and flow data synchronously acquired by the pressure and flow acquisition sensors to determine multi-dimensional characteristic data, enabling rapid identification of leak events and accurate identification of leak types, providing a reliable basis for subsequent operation and maintenance work.
[0198] Figure 5 This is a schematic diagram of the gas pipeline leak detection device provided in this application, as shown below. Figure 5 As shown, the gas pipeline leak detection device 50 provided in this embodiment includes:
[0199] The acquisition module 501 is used to acquire pressure and flow data during the operation of the gas pipeline network;
[0200] The acquisition module 501 is also used to acquire the feature vector at the current moment based on pressure data and flow data. The feature vector includes the pressure change rate, flow change rate, pressure-flow deviation, pressure recovery characteristics, and leakage duration.
[0201] The determination module 502 is used to determine the first leak detection result of the gas pipeline network based on the feature vector and using the leak detection model; the first leak detection result is used to indicate the leak type of the gas pipeline network; the leak detection model is obtained by training a random forest model based on a sample dataset, and the sample data included in the sample dataset are historical feature vectors corresponding to historical gas pipeline network leak events;
[0202] Output module 503 is used to output the first leak detection result.
[0203] In one possible implementation, the above-described apparatus further includes: a construction module 504;
[0204] The determining module 502 is also used to determine the pressure change rate of the gas pipeline network at the current moment based on the pressure value at the first moment and the pressure value at the current moment; the first moment mentioned above refers to the moment before the current moment.
[0205] The determination module 502 is also used to determine the rate of change of the gas pipeline flow at the current moment based on the flow value at the first moment and the flow value at the current moment;
[0206] The determination module 502 is also used to determine the pressure-flow deviation of the gas pipeline network at the current moment based on the pressure value at the current moment, the pressure reference value at the current moment, the flow value at the current moment, and the flow reference value at the current moment.
[0207] The determination module 502 is also used to determine the pressure recovery characteristics of the gas pipeline network at the current moment based on the pressure value before the gas pipeline network leak, the lowest pressure value of the gas pipeline network between the first moment and the current moment, and the pressure value of the gas pipeline network after the valve is closed.
[0208] The determination module 502 is also used to determine the leakage duration corresponding to the current moment based on the difference between the current moment and the moment when the pressure-flow deviation of the gas pipeline network first exceeds a preset threshold.
[0209] Module 504 is used to construct a feature vector for the current moment based on the pressure change rate, flow change rate, pressure-flow deviation, pressure recovery characteristics, and leakage duration.
[0210] In one possible implementation, the acquisition module 501 is further configured to acquire pressure data and flow data during the operation of the gas pipeline network when the pressure of the gas pipeline network drops.
[0211] In one possible implementation, the above-described device further includes: an input module 505;
[0212] The input module 505 is used to input the feature vector into a leak detection model containing multiple decision trees, so that the leak detection model determines the first leak detection result from the initial first leak detection result of each decision tree through a majority voting mechanism.
[0213] The determination module 502 is also used to determine the confidence level of the first leak detection result based on the number of votes corresponding to the leak detection result and the total number of decision trees;
[0214] The output module 503 is also used to output an alarm message for gas pipeline leakage when the confidence level is greater than or equal to a preset confidence threshold; the alarm message is used to indicate the first leakage detection result.
[0215] In one possible implementation, the above-described apparatus further includes: a correction module 506;
[0216] The determination module 502 is also used to determine the second leakage detection result of the gas pipeline network based on the feature vector at the current moment and the leakage detection rules corresponding to each leakage type;
[0217] The correction module 506 is used to correct the first leakage detection result based on the second leakage detection result.
[0218] In one possible implementation, the acquisition module 501 is further configured to acquire a first leak detection result based on the feature vector and using the target leak detection model corresponding to the target area to which the gas pipeline network belongs; the sample data included in the sample dataset of the target leak detection model are the historical feature vectors corresponding to historical gas pipeline leak events in the target area, and / or the historical feature vectors corresponding to historical gas pipeline leak events in other areas similar to the target area.
[0219] The gas pipeline leak detection device provided in this embodiment can perform the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0220] Figure 6A schematic diagram of the structure of the electronic device provided in this application. Figure 6 As shown, the electronic device 60 provided in this embodiment includes at least one processor 601 and a memory 602. Optionally, the device 60 further includes a communication component 603. The processor 601, memory 602, and communication component 603 are connected via a bus 604.
[0221] In a specific implementation, at least one processor 601 executes computer execution instructions stored in memory 602, causing at least one processor 601 to perform the above-described method.
[0222] The specific implementation process of processor 601 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0223] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0224] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0225] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0226] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0227] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0228] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0229] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0230] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0231] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0232] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0233] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0234] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0235] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A method for detecting leaks in a gas pipeline network, characterized in that, include: Acquire pressure and flow data during the operation of the gas pipeline network; Based on the pressure and flow data, a feature vector is obtained at the current moment. The feature vector includes the pressure change rate, flow change rate, pressure-flow deviation, pressure recovery characteristics, and leakage duration. Based on the feature vector, a leak detection model is used to determine the first leak detection result of the gas pipeline network; the first leak detection result is used to indicate the leak type of the gas pipeline network; the leak detection model is obtained by training a random forest model based on a sample dataset, and the sample data included in the sample dataset are historical feature vectors corresponding to historical gas pipeline network leak events; Output the first leak detection result; The step of obtaining the feature vector at the current moment based on the pressure data and flow data specifically includes: Based on the pressure value at a first moment and the pressure value at the current moment, the pressure change rate of the gas pipeline network at the current moment is determined; the first moment is the moment before the current moment. Based on the flow rate value at the first moment and the flow rate value at the current moment, determine the flow rate change rate of the gas pipeline network at the current moment; Based on the pressure value at the current moment, the pressure reference value at the current moment, the flow rate value at the current moment, and the flow rate reference value at the current moment, the pressure-flow deviation of the gas pipeline network at the current moment is determined; Based on the pressure value of the gas pipeline network before the leak, the lowest pressure value of the gas pipeline network between the first moment and the current moment, and the pressure value of the gas pipeline network after the valve is closed, the pressure recovery characteristics of the gas pipeline network at the current moment are determined. The leakage duration corresponding to the current moment is determined based on the difference between the current moment and the moment when the pressure-flow deviation of the gas pipeline network first exceeds a preset threshold. Based on the pressure change rate, flow rate change rate, pressure-flow deviation, pressure recovery characteristics, and leakage duration at the current moment, a feature vector is constructed for the current moment.
2. The method according to claim 1, characterized in that, The acquisition of pressure and flow data during the operation of the gas pipeline network includes: When the pressure of the gas pipeline network drops, pressure and flow data during the operation of the gas pipeline network are acquired.
3. The method according to claim 1 or 2, characterized in that, The determination of the first leak detection result of the gas pipeline network based on the feature vector and using the leak detection model includes: The feature vector is input into a leak detection model containing multiple decision trees, so that the leak detection model determines the first leak detection result from the initial first leak detection result of each decision tree through a majority voting mechanism; After determining the first leak detection result of the gas pipeline network, the method further includes: The confidence level of the first leak detection result is determined based on the number of votes corresponding to the leak detection result and the total number of the decision trees. If the confidence level is greater than or equal to a preset confidence threshold, an alarm message for the gas pipeline leak is output; the alarm message is used to indicate the first leak detection result.
4. The method according to claim 1 or 2, characterized in that, The method further includes: Based on the feature vector at the current moment and the leakage detection rules corresponding to each leakage type, the second leakage detection result of the gas pipeline network is determined; Based on the second leak detection result, the first leak detection result is corrected.
5. The method according to claim 1 or 2, characterized in that, The determination of the first leak detection result of the gas pipeline network based on the feature vector and using the leak detection model includes: Based on the feature vector, the first leak detection result is obtained by using the target leak detection model corresponding to the target area to which the gas pipeline network belongs; the sample data included in the sample dataset of the target leak detection model are the historical feature vectors corresponding to historical gas pipeline leak events in the target area, and / or the historical feature vectors corresponding to historical gas pipeline leak events in other areas similar to the target area.
6. The method according to claim 1, characterized in that, The method further includes: According to a preset cycle, the historical dataset of the gas pipeline network is obtained; The historical dataset is divided into multiple time periods, and the parameter thresholds for each time period are updated based on the historical data subset of each time period. The parameter thresholds include, but are not limited to, pressure reference values, flow reference values, and preset thresholds corresponding to pressure-flow deviation. The threshold range is updated using the historical dataset to adapt to the operating characteristics of different pipeline networks.
7. The method according to claim 2, characterized in that, When the pressure in the gas pipeline network drops, acquiring pressure and flow data during the operation of the gas pipeline network includes: When the pressure change rate of the gas pipeline network is less than the pressure change rate threshold within a preset time period, pressure data and flow data of the gas pipeline network during operation are acquired.
8. A gas pipeline network leak detection device, used to implement the gas pipeline network leak detection method as described in claim 1, characterized in that, include: The acquisition module is used to acquire pressure and flow data during the operation of the gas pipeline network; The acquisition module is further configured to acquire a feature vector at the current moment based on the pressure data and flow data. The feature vector includes pressure change rate, flow change rate, pressure-flow deviation, pressure recovery characteristics, and leakage duration. The determination module is used to determine a first leak detection result of the gas pipeline network based on the feature vector and using a leak detection model; the first leak detection result is used to indicate the leak type of the gas pipeline network; the leak detection model is obtained by training a random forest model based on a sample dataset, and the sample data included in the sample dataset are historical feature vectors corresponding to historical gas pipeline network leak events; The output module is used to output the first leakage detection result.
9. A gas pipeline leak detection system, characterized in that, The gas pipeline leak detection system includes: a detection device, a pressure acquisition sensor, and a flow acquisition sensor; The pressure acquisition sensor is used to acquire pressure data during the operation of the gas pipeline network. The flow acquisition sensor is used to collect flow data during the operation of the gas pipeline network; The detection device is used to perform the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Gas leakage monitoring system and method based on Internet of Things intelligent gas meter
CN113075899A
Gas leakage sensing, identifying and alarming method based on multi-sensor fusion
CN119251991A
Underground pipe network leakage detection method integrating big data analysis and machine learning
CN120008828A
Informatization management system and management method for gas pipe network
CN120338539A