A machine learning based method and system for natural gas pipeline leak detection

CN118009253BActive Publication Date: 2026-10-30CHANGZHOU WEIGE ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410151813.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-02
Publication Date
2026-10-30
Estimated Expiration
2044-02-02

AI Technical Summary

Technical Problem

然而,现有检测方法通常是擅长于识别简单系统中的大规模破坏或泄漏,但在检测复杂而广泛的管道网络中的早期轻微(微小)泄漏方面存在不足

Benefits of technology

本发明提供一种比传统方法更准确、更及时、更经济的泄漏检测方法,提高检测微小泄漏的灵敏度,还可以快速行动,避免泄漏升级为更严重的危害,解决复杂天然气分销网络中早期泄漏检测的关键问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118009253B_ABST
    Figure CN118009253B_ABST
Patent Text Reader

Abstract

The application provides a kind of natural gas pipeline leak detection method based on machine learning, comprising: step S1, obtain the pulse time series data of gas parameter of intelligent gas meter in a first preset time period;Step S2, compare the pulse time series data with the reference line corresponding to the first preset time period varying with time, obtain the comparison result;Step S3, classify the abnormal situation in the comparison result, determine the leakage degree;Step S4, according to the leakage degree triggers the corresponding response action.The beneficial effect: the application provides a kind of more accurate, more timely, more economical micro-leakage detection method than traditional method, improve the sensitivity of detection micro-leakage, can also act quickly, avoid leakage to more serious harm, solve the key problem of early leakage detection in complex natural gas distribution network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of gas leak detection technology, and in particular to a method and system for detecting natural gas pipeline leaks based on machine learning. Background Technology

[0002] A smart gas meter is a gas metering device that integrates intelligent technology. It can monitor and record a user's gas consumption in real time and transmit the data to a relevant management system via wireless communication technology. These systems can not only measure gas flow but also record data over time to monitor usage patterns.

[0003] Leak detection in smart gas meters refers to the detection and alarming of gas leaks using the sensors and algorithms of smart gas meters. However, existing detection methods are generally good at identifying large-scale damage or leaks in simple systems, but are insufficient in detecting early, minor (micro) leaks in complex and extensive piping networks.

[0004] Existing detection methods, when applied to complex or large-scale gas distribution systems, often lack the sensitivity to identify minute leaks, which are frequently overlooked due to their subtle nature. While minute leaks may not pose an immediate danger, they can escalate over time, leading to safety hazards, resource waste, and environmental problems. Furthermore, existing detection methods struggle to distinguish between normal natural gas usage patterns and anomalies that may indicate leaks. Current systems may overreact to normal changes in gas usage, resulting in false alarms, or underdetect, missing subtle signs of leaks. Summary of the Invention

[0005] To address the above technical problems, this invention provides a natural gas pipeline leak detection method and system based on machine learning.

[0006] The technical problem solved by this invention can be achieved by the following technical solutions: A machine learning-based method for detecting leaks in natural gas pipelines, comprising: Step S1: Obtain pulse time series data of gas parameters of smart gas meter within a first preset time period; Step S2: Compare the pulse time series data with the time-varying baseline corresponding to the first preset time period to obtain the comparison result; Step S3: Classify the anomalies in the comparison results to determine the degree of leakage; Step S4: Trigger the corresponding response action according to the degree of leakage.

[0007] Preferably, step S2 includes: Step S21: Calculate the deviation between the pulse data at each timestamp in the pulse time series data and the baseline corresponding to each timestamp; Step S22: Calculate the pattern deviation metric value based on the deviation corresponding to all the timestamps within the first preset time period; Step S23: Compare the mode deviation metric with a preset detection threshold to obtain the comparison result.

[0008] Preferably, a weight function is preset, the weight function including weights that change over time; Step S22 further includes: Step S221: Assign corresponding weights to the deviations corresponding to each timestamp according to the weighting function; Step S222: Calculate the mode deviation metric value based on the deviation after assigning weights.

[0009] Preferably, step S23 includes: When the mode deviation metric exceeds the preset detection threshold and persists for a second preset time, the abnormal situation is determined to exist, and the abnormal situation is included in the comparison result.

[0010] Preferably, a baseline model is established in advance, the baseline model including a baseline of the gas parameters of the smart gas meter changing over time; In step S2, the baseline corresponding to the first preset time period is obtained from the baseline model.

[0011] Preferably, step S3 includes: Step S31: Extract the pulse time series corresponding to each of the abnormal situations from the pulse time series data according to the abnormal situations in the comparison results; Step S32: Extract the non-zero subsequence from the pulse time sequence corresponding to each of the above-mentioned abnormal situations; Step S33: Divide the first preset time period into multiple sub-time periods, and calculate the sum of the non-zero sub-sequences in each sub-time period; Step S34: Compare the sum of the non-zero subsequences in each of the sub-time periods with a preset leakage degree threshold to determine the leakage degree.

[0012] Preferably, there are two preset leakage level thresholds, including a first leakage level threshold and a second leakage level threshold, wherein the first leakage level threshold is smaller than the second leakage level threshold; Step S34 includes: When the sum of the non-zero subsequences in all the sub-time periods is less than or equal to the first leakage level threshold, the leakage level is determined to be micro-leakage; When the sum of the non-zero subsequences in all the sub-time periods is greater than the first leakage level threshold and less than or equal to the second leakage level threshold, the leakage level is determined to be moderate leakage. When the sum of the non-zero subsequences in all the sub-time periods is greater than the second leakage level threshold, the leakage level is determined to be a severe leakage.

[0013] Preferably, after step S4, the method further includes: Step S5: Visualize the pulse time series data and the corresponding leakage level.

[0014] The present invention also provides a machine learning-based natural gas pipeline leak detection system for implementing the machine learning-based natural gas pipeline leak detection method described above, comprising: The acquisition unit is used to acquire pulse time series data of gas parameters of a smart gas meter within a first preset time period; A comparison unit, connected to the acquisition unit, is used to compare the pulse time series data with a time-varying baseline corresponding to the first preset time period to obtain a comparison result; An anomaly classification unit, connected to the comparison unit, is used to classify anomalies in the comparison results and determine the degree of leakage. The response triggering unit is connected to the anomaly classification unit and is used to trigger a corresponding response action based on the degree of leakage.

[0015] The advantages or beneficial effects of the technical solution of this invention are as follows: This invention provides a leak detection method that is more accurate, timely, and economical than traditional methods. It improves the sensitivity of detecting minute leaks and allows for rapid action to prevent leaks from escalating into more serious hazards, thus solving the key problem of early leak detection in complex natural gas distribution networks. Attached Figure Description

[0016] Figure 1 This is a flowchart illustrating a preferred embodiment of the natural gas pipeline leak detection method based on machine learning. Figure 2 This is a flowchart illustrating step S2 in a preferred embodiment of the present invention. Figure 3 This is a flowchart illustrating step S22 in a preferred embodiment of the present invention. Figure 4 In a preferred embodiment of the present invention, a frequency domain distribution histogram of pulse time series data is shown. Figure 5 This is a flowchart illustrating step S3 in a preferred embodiment of the present invention. Figure 6 This is a flowchart illustrating a preferred embodiment of the natural gas pipeline leak detection method based on machine learning. Figure 7 In a preferred embodiment of the present invention, a line graph of pulse time series data is provided. Figure 8 In a preferred embodiment of the present invention, an hourly average pulse bar chart of pulse time series data; Figure 9 In a preferred embodiment of the present invention, a heatmap of 24-hour pulses from pulse time series data; Figure 10 This is a structural block diagram of a machine learning-based natural gas pipeline leak detection system, which is a preferred embodiment of the present invention. Detailed Implementation

[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] The main objective of this invention is to address the critical issue of early leak detection in complex natural gas distribution networks. Addressing this gap in current technology, this application aims to provide a gas leak detection method that is more accurate, timely, and economical than traditional methods. This method not only improves the sensitivity of detecting small leaks but also allows for rapid action to prevent leaks from escalating into more serious hazards. It should be noted that, unless otherwise specified, the embodiments and features described in this invention can be combined with each other.

[0019] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, but this is not intended to limit the scope of the invention.

[0020] See Figure 1 In a preferred embodiment of the present invention, based on the above-mentioned problems existing in the prior art, a machine learning-based method for detecting natural gas pipeline leaks is provided, comprising: Step S1: Obtain pulse time series data of gas parameters of smart gas meter within a first preset time period; Step S2: Compare the pulse time series data with the baseline that changes over time corresponding to the first preset time period to obtain the comparison result; Step S3: Classify the abnormal situations in the comparison results and determine the degree of leakage; Step S4: Trigger the corresponding response action based on the degree of leakage.

[0021] Specifically, in this embodiment, firstly, pulse time series data of the gas parameters of the smart gas meter are acquired. P ( t This information can be obtained from the gas flow meter in a smart gas meter. (Pulse time series data) P ( t This function represents a series of pulse counts recorded at equal time intervals. When a specified time... t When, function P ( t )return t Pulse count at any given moment.

[0022] Then, the obtained pulse time series data is compared with a baseline to obtain the comparison result. This baseline is pre-set, and its reference values ​​change over time, rather than remaining fixed. During the comparison, the pulse counts of the pulse time series data are compared with the time-varying reference values ​​to detect any abnormalities during gas usage. Then, anomalies in the comparison results are categorized to determine the degree of leakage. Based on the detected leak type and severity, corresponding response actions are triggered, including but not limited to alarms, automatic system shutdowns, or other pre-defined operations. This allows for timely notification of users or relevant departments to handle the situation, enabling prompt action such as repairing leaks or replacing gas equipment. This effectively reduces energy waste and economic losses caused by leaks and improves overall gas usage efficiency.

[0023] In step S1 of this embodiment, the acquired pulse time series data can also be preprocessed. Data preprocessing steps include, but are not limited to, data cleaning, filtering, and anomaly detection, such as checking for missing values, outliers, or noise in the data. Preferably, interpolation methods can be used to fill in missing values, remove outliers, or use filters to remove noise to ensure the data format is usable.

[0024] In a preferred embodiment, such as Figure 2 As shown, step S2 includes: Step S21: Calculate the deviation between the pulse data at each time stamp in the pulse time series data and the baseline corresponding to each time stamp; Step S22: Calculate the mode deviation metric value based on the deviation corresponding to all timestamps within the first preset time period. Step S23: Compare the mode deviation metric with a preset detection threshold to obtain the comparison result.

[0025] Specifically, the difference between the pulse data (i.e., pulse count) at each timestamp (moment) in the pulse time series data and the baseline value that changes over time in the baseline is calculated. Then, the sum of the deviations of all pulse counts within the first preset time period is used to calculate the mode deviation metric.

[0026] In another preferred embodiment, a weighting function is pre-set, which includes weights that change over time; like Figure 3 As shown, step S22 further includes: Step S221: Assign corresponding weights to the deviations corresponding to each timestamp according to the weighting function; Step S222: Calculate the mode deviation metric based on the bias after assigning weights.

[0027] Specifically, in this embodiment, different weights can be assigned to the deviations in pulse counts at different times, and then the mode deviation metric is calculated by summing the weighted deviations. This mode deviation metric is denoted as... D , D The calculation formula is as follows:

[0028] in, w ( t ) represents the weight function; P( t B represents pulse time series data; t ) represents the baseline model described below; t represents time.

[0029] It is important to note the specific weighting function. w ( t The weight value can be set according to the application requirements and scenarios, so that higher weights are given during periods of stable gas consumption or low activity. This invention does not limit its specific value.

[0030] In a preferred embodiment, step S23 includes: If the mode deviation metric exceeds the preset detection threshold and persists for a second preset time, it is determined that there is an abnormal situation, and the abnormal situation is included in the comparison result.

[0031] Specifically, in existing technologies, some data may not significantly exceed the baseline, but consistently deviate from the normal usage pattern in an atypical manner, often more subtly than a higher pulse count. In this embodiment, if the mode deviation metric D exceeds a preset detection threshold θ and persists for a preset period of time, an anomaly is detected and included in the comparison results. This sequence anomaly detection method using the aforementioned mode deviation metric can identify these pulse sequences that deviate from the normal usage pattern in an atypical manner.

[0032] The preset detection threshold θ represents the threshold used to identify anomalies such as minor leaks. It is worth noting that the preset detection threshold θ and the second preset time can be calibrated based on typical gas usage patterns and the nature of the expected leak, or they can be customized according to actual needs; this invention does not limit their specific values.

[0033] In a preferred embodiment, a baseline model is established in advance, which includes a baseline of the gas parameters of the smart gas meter changing over time. In step S2, the baseline corresponding to the first preset time period is obtained from the baseline model.

[0034] Specifically, historical pulse time series data is collected from gas flow meters and preprocessed, including but not limited to data cleaning, filtering, and anomaly detection. Then, existing big data analytics techniques are used to analyze the patterns in the data to establish a baseline model for the aforementioned normal gas usage pattern. B ( t The baseline model B ( t ) represents a pulse counting pattern or sequence under normal gas usage mode.

[0035] The data preprocessing steps described above may also include time series data integrity verification. Time series data integrity is used to represent the sampling coverage of time series data within a given time window. When the data integrity is below a certain set threshold, the algorithm will directly return an error code.

[0036] In baseline model B ( t During the establishment process, pulse time series data feature analysis can also be performed, including frequency domain feature analysis. For example... Figure 4 As shown, histograms are used to visualize the frequency domain distribution of pulse time series data. Figure 4In the figure, Distribution of Pulse Sum represents the pulse count and distribution, Pulse Sum represents the pulse count and sum of the pulse time series data, and the vertical axis Frequency represents the frequency domain characteristics. Among them, the most common values ​​are located within a specific range, while some outliers have significantly higher values.

[0037] The embodiments of the present invention do not merely compare a single pulse count to a baseline, but rather utilize this baseline model. B ( t It can analyze micro-patterns in time series, including identifying pulse sequences that deviate from expected normal gas usage patterns in subtle but atypical ways.

[0038] In a preferred embodiment, such as Figure 5 As shown, step S3 includes: Step S31: Extract the pulse time series corresponding to each abnormality from the pulse time series data based on the abnormalities in the comparison results; Step S32: Extract the non-zero subsequence from the pulse time series corresponding to each abnormal situation; Step S33: Divide the first preset time period into multiple sub-time periods and calculate the sum of non-zero subsequences in each sub-time period; Step S34: Compare the sum of non-zero subsequences in each sub-time period with a preset leakage threshold to determine the leakage level.

[0039] Specifically, firstly, extract the pulse time series that are detected as abnormal from the pulse time series data, and denote them as follows: P This pulse time sequence P It consists of a series of integers, each integer P i Corresponding to the i The pulse count is measured in minutes. The zero subsequence is represented as... Z The non-zero subsequence is represented as N .

[0040] Then, the first preset time period is divided into multiple sub-time periods, each containing a certain time range; for each sub-time period, the sum of the non-zero subsequences within that time period is calculated. The sum of the non-zero subsequences within all sub-time periods within the first preset time period is denoted as... X i , where i = 0, 1, 2, ... m, and m equals the ratio of the first preset time period to the sub-time period minus one.

[0041] As an example, suppose the first preset time period is from 1:00 AM to 5:00 AM, and the sub-time period is one hour, for the pulse time series from 1:00 AM to 5:00 AMP Statistical analysis of each hour N The sum is denoted as X i (i=0,1,2,3), where, X 0 This represents the sum of non-zero subsequences from 1:00 AM to 2:00 AM; X 0 This represents the sum of non-zero subsequences from 1:00 AM to 2:00 AM; X 1 This represents the sum of non-zero subsequences from 2:00 AM to 3:00 AM; X 2 This represents the sum of non-zero subsequences from 4:00 AM to 5:00 AM; X 3 This represents the sum of non-zero subsequences from 4:00 AM to 5:00 AM.

[0042] It is worth noting that the first preset time period can be a day, a week, a month or a longer period; the sub-time period can be half an hour, an hour, a day, a week, a month or other shorter periods; the specific first preset time period and sub-time period can be set according to specific needs, and the present invention does not limit their specific values.

[0043] Finally, the sum of non-zero subsequences within each sub-time period is compared with a preset leakage threshold, and the leakage level is determined based on the comparison result. The leakage threshold can be preset with one, two, or more thresholds. This embodiment of the invention uses two leakage thresholds to define the leakage level as an example. In a preferred embodiment, two leakage thresholds are preset, including a first leakage threshold θ1 and a second leakage threshold θ2, where the first leakage threshold θ1 is smaller than the second leakage threshold θ2. Step S34 includes: When the sum of the non-zero subsequences in all sub-time periods is less than or equal to the first leakage level threshold θ1, the leakage level is determined to be micro-leakage; When the sum of non-zero subsequences in all sub-time periods is greater than the first leakage threshold θ1 and less than or equal to the second leakage threshold θ2, the leakage level is determined to be moderate leakage. When the sum of non-zero subsequences in all sub-time periods is greater than the second leakage threshold θ2, the leakage level is determined to be severe leakage.

[0044] Specifically, the sum of non-zero subsequences within all sub-time periods within the first preset time period. X i Let i = 0, 1, 2, ..., m; if any i satisfies: If Xi>θ2, it indicates that the leakage level is severe leakage, timed heating, or continuous heating. θ1<Xi≤θ2, which indicates that the leakage degree is moderate leakage or timed heating; Xi≤θ1, which indicates that the leakage degree is micro leakage or timed heating (determined according to the lengths of Z and N) Otherwise, it indicates delayed flameout or to be determined.

[0045] Herein, the above terms are explained as follows: Timed heating refers to periodically repeating a long inactive sequence (zero subsequence Z Z ) and an active sequence (non-zero subsequence N ).

[0046] Micro leakage refers to sporadic and minimal activity pulses during a long period of inactivity.

[0047] Delayed flameout refers to a pattern similar to the micro leakage pattern, but indicates that the equipment is unintentionally left running. It includes scenarios where the equipment operates unintentionally (for example, forgetting to shut down, and the wall-mounted boiler stops with a delay), which is not part of the normal operation mode.

[0048] Moderate leakage refers to frequent but short active pulses.

[0049] Severe leakage refers to continuous activity without inactivity.

[0050] Continuous heating refers to continuous activity, which may reflect a stable heating mode.

[0051] To be determined refers to a scenario that does not fall into the above categories.

[0052] Herein, delayed stop, timed heating and continuous heating belong to unattended operations. They represent scenarios where the heating system operates without manual intervention, whether periodically (timed heating) or continuously (continuous heating).

[0053] Optionally, the above anomaly classification process using leakage degree thresholds may be implemented using a machine learning-based classification algorithm, which distinguishes the detected anomalies into categories such as micro leakage, moderate leakage, severe leakage, and normal natural gas usage fluctuations.

[0054] Preferably, data from smart gas meters is collected and preprocessed, including data cleaning, handling missing values, and data normalization to make it suitable for machine learning algorithms. Then, relevant features are identified and extracted from the data, which may include gas flow rate, time intervals, and usage patterns. Next, an appropriate machine learning algorithm is selected based on the nature of the data and the classification objective, such as decision trees, support vector machines, or more complex neural networks, including convolutional neural networks (CNNs) and recurrent neural networks (RNNs). The selected algorithm model is then trained using a dataset encompassing various scenarios, such as normal use, different types of leaks, and other anomalies. The trained model is then tested and validated using a separate dataset to ensure its accuracy and effectiveness. After validation, the trained model can be applied to real-time classification of new data from smart gas meters.

[0055] Preferably, during the application of the model, new data is continuously used to update and improve the model, thereby increasing the model's accuracy and adaptability over time.

[0056] In a preferred embodiment, such as Figure 6 As shown, after step S4, the following steps are also included: Step S5: Visualize the pulse time series data and the corresponding leakage level.

[0057] Specifically, embodiments of the present invention can provide a visual representation of data and detected leaks. For example, visualizing pulse time series data by hour.

[0058] Furthermore, embodiments of the present invention can also support querying pulse time series data, combining date and hourly pulse time series data to visualize the trend of pulses over time. For example... Figure 7 As shown, Pulse Sum Over Time represents the pulse time series data within the first preset time period; Pulse Sum represents the pulse count sum of the pulse time series data; and Datetime represents the timestamp. From Figure 7 The pulse count and its changing trend over a given date and time period can be observed. Figure 7 The peaks and troughs in the data indicate the peaks and troughs in users' gas consumption activities.

[0059] Furthermore, bar charts can be used to visualize hourly gas consumption pulses throughout the day. For example... Figure 8 As shown, Figure 8In the "Average Pulse Sum by Hour" method, the pulse count and average are represented per hour. "Hour of the Day" represents the sequence of pulses per hour within a day. The "Average Pulse Sum" indicates that the average pulse count and average are higher at certain times compared to other times, suggesting periods of increased natural gas usage activity. Preferably, heatmaps can also be created to visualize pulse records over a period, such as... Figure 9 The heatmap shown clearly identifies activity patterns, such as sustained high or low pulse sums on specific dates or times. Furthermore, feedback and optimization mechanisms can be supported, collecting feedback from system performance and using the feedback data to optimize the algorithm model, continuously improving the accuracy and reliability of the algorithm model through the feedback mechanism. Feedback data can be collected from various sources, including but not limited to user manual input, automatic system alarms, or maintenance reports. The feedback data can contain information about the accuracy of leak detection and the effectiveness of the response mechanism. By analyzing the collected feedback data, patterns or inconsistencies can be identified, such as comparing reported leak events with the system's detection logs to assess accuracy. Then, based on the analysis results, the algorithm model of the present invention can be adjusted to improve detection accuracy, for example, by retraining the machine learning model with new data, adjusting parameters, or even redesigning the model algorithm.

[0060] Optionally, in addition to adjusting the algorithm model, the response mechanism can also be updated, such as the criteria for triggering alarms, adjusting the system's sensitivity, or improving the communication protocol for reporting potential leaks.

[0061] During the implementation of the adjusted algorithm model and response mechanism, the performance of the updated algorithm and response mechanism is continuously monitored, and further feedback is collected and analyzed, leading to continuous iteration and refinement.

[0062] See Figure 10 The present invention also provides a machine learning-based natural gas pipeline leak detection system for implementing the machine learning-based natural gas pipeline leak detection method described above, comprising: Acquisition unit 1 is used to acquire pulse time series data of gas parameters of a smart gas meter within a first preset time period; Comparison unit 2, connected to acquisition unit 1, is used to compare pulse time series data with a time-varying baseline corresponding to a first preset time period to obtain a comparison result; Anomaly classification unit 3, connected to comparison unit 2, is used to classify anomalies in the comparison results and determine the degree of leakage; The response triggering unit 4 is connected to the anomaly classification unit 3 and is used to trigger corresponding response actions according to the degree of leakage.

[0063] This invention provides advanced data analysis for early leak detection, utilizing sophisticated data analytics to detect minor leaks in complex natural gas distribution networks. Unlike traditional detection methods based on simple thresholds or major deviations, this invention analyzes minute fluctuations in pulse time-series data from gas flow meters. Changes in gas usage patterns captured by the pulse time-series data can indicate different types of leak severity or abnormal gas usage, effectively detecting minute leaks that might be missed by conventional methods. It offers high detection sensitivity and can detect leaks well before they become apparent or escalate into greater hazards.

[0064] This invention, through micro-pattern analysis and sequence anomaly detection, enables the identification of complex patterns, distinguishing between normal natural gas usage patterns and anomalies indicating potential leaks. The weighting function in the pattern deviation metric... w ( t It allows setting sensitivity to time periods where even small deviations are significant, a key aspect of early leak detection. This capability is particularly effective in environments where usage patterns fluctuate (such as commercial complexes or community gas systems), reducing false alarms and ensuring more accurate leak detection.

[0065] Furthermore, compared to traditional detection methods which are limited in scope and applicability, the detection method of this invention can be seamlessly integrated with existing gas metering infrastructure (smart gas meters), further improving its practicality. It has inherent scalability and versatility, making it suitable for various environments, from small residential environments to large industrial infrastructures.

[0066] The above are merely preferred embodiments of the present invention and are not intended to limit the implementation methods and protection scope of the present invention. Those skilled in the art should recognize that any equivalent substitutions and obvious changes made using the content of this specification and illustrations should be included within the protection scope of the present invention.

Claims

1. A method for detecting natural gas leaks based on a smart gas meter, characterized in that, include: Step S1: Obtain pulse time series data of gas parameters of smart gas meter within a first preset time period; Step S2 involves comparing the pulse time series data with a time-varying baseline corresponding to the first preset time period to obtain a comparison result; wherein, step S2 includes: Step S21: Calculate the deviation between the pulse data at each timestamp in the pulse time series data and the baseline corresponding to each timestamp; Step S22: Calculate the pattern deviation metric value based on the deviation corresponding to all the timestamps within the first preset time period; Step S23: Compare the mode deviation metric with a preset detection threshold. If the mode deviation metric exceeds the preset detection threshold and continues for a second preset time, it is determined that there is an abnormal situation, and the abnormal situation is included in the comparison result. Step S3 involves classifying the anomalies in the comparison results and determining the category to which the anomalies belong; wherein, step S3 includes: Step S31: Extract the pulse time series corresponding to each of the abnormal situations from the pulse time series data according to the abnormal situations in the comparison results; Step S32: Extract the zero subsequence and non-zero subsequence from the pulse time sequence corresponding to each abnormal situation. The zero subsequence is a continuous subsequence with a pulse count of zero, and the non-zero subsequence is a continuous subsequence with a pulse count of non-zero. Step S33: Divide the first preset time period into multiple sub-time periods, and calculate the sum of the non-zero sub-sequences in each sub-time period; Step S34: The sum of the non-zero subsequences within each of the sub-time periods is compared with a preset first leakage threshold and a second leakage threshold. If the first leakage threshold is less than the second leakage threshold, the category to which the abnormal situation belongs is determined, wherein: When the sum of the non-zero subsequences in all the sub-time periods is less than or equal to the first leakage threshold, the category is determined based on the length of the zero subsequence and the length of the non-zero subsequence: when the non-zero subsequence is characterized by sporadic and minimal active pulses in the long zero subsequence, the abnormal situation is classified as micro-leakage; when the zero subsequence and the non-zero subsequence are characterized by periodically repeating long inactive and active sequences, the abnormal situation is classified as timed heating. When the sum of the non-zero subsequences in all the sub-time periods is greater than the first leakage level threshold and less than or equal to the second leakage level threshold, the abnormal situation is determined to belong to the category of moderate leakage. When the sum of the non-zero subsequences in all the sub-time periods is greater than the second leakage level threshold, the category to which the abnormal situation belongs is determined to be a severe leakage. Step S4: Trigger the corresponding response action according to the category to which the abnormal situation belongs. When the category is micro-leakage, moderate leakage or severe leakage, the corresponding leakage response action is triggered. When the category is timed heating, no leakage response action is triggered.

2. The natural gas leak detection method based on a smart gas meter according to claim 1, characterized in that, A weight function is pre-defined, which includes weights that change over time; Step S22 further includes: Step S221: Assign corresponding weights to the deviations corresponding to each timestamp according to the weighting function; Step S222: Calculate the mode deviation metric value based on the deviation after assigning weights.

3. The natural gas leak detection method based on a smart gas meter according to claim 1, characterized in that, A baseline model is established in advance, which includes a baseline of the gas parameters of the smart gas meter changing over time; In step S2, the baseline corresponding to the first preset time period is obtained from the baseline model.

4. The natural gas leak detection method based on a smart gas meter according to claim 1, characterized in that, The process following step S4 also includes: Step S5: Visualize the pulse time series data and the corresponding category of the abnormal situation.

5. A natural gas leak detection system based on a smart gas meter, characterized in that, A method for implementing a natural gas leak detection method based on a smart gas meter as described in any one of claims 1-4, comprising: The acquisition unit is used to acquire pulse time series data of gas parameters of a smart gas meter within a first preset time period; The comparison unit, connected to the acquisition unit, is used to compare the pulse time series data with the baseline that changes over time corresponding to the first preset time period. When the mode deviation metric exceeds the preset detection threshold and lasts for a second preset time, it is determined that there is an abnormal situation, and the comparison result is output. An anomaly classification unit, connected to the comparison unit, is used to classify anomalies in the comparison results and determine the category to which the anomaly belongs; The response triggering unit is connected to the anomaly classification unit and is used to trigger a corresponding response action according to the category to which the anomaly belongs.

Citation Information

Patent Citations

  • Intelligent gas meter, system and method capable of monitoring household gas leakage state

    CN111238589A

  • Gas pipeline leakage detection method, device and equipment and storage medium

    CN113944888A