Fuel gas leakage detection method and system based on intelligent fuel gas, medium and equipment

Through the smart gas Internet of Things system and multi-level processing detection model, the problem of existing gas leak detection methods not responding quickly enough is solved, and high-sensitivity and fast-responsive gas leak detection is achieved, which improves detection accuracy and safety.

CN119983156APending Publication Date: 2025-05-13CHENGDU QINCHUAN IOT TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510068941.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-16
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

The existing gas leak detection methods are not responding quickly enough, making it difficult to identify mild or slow-developing leaks in a timely and accurate manner.

Method used

The gas leakage detection method based on smart gas is adopted to obtain and pre-process the concentration data, temperature and humidity data of gas and interfering gases through the Internet of Things system, and the trained gas leakage detection model is used for multi-level processing to detect leakage.

Benefits of technology

High sensitivity detection and rapid response to gas leakage is achieved, which significantly improves detection accuracy, reduces false alarm rates, and ensures accurate identification of potential gas leakage risks in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119983156A_ABST
    Figure CN119983156A_ABST
Patent Text Reader

Abstract

The invention discloses a gas leakage detection method and system based on intelligent gas, a medium and equipment, and the method comprises the steps: obtaining the concentration data and temperature and humidity data of gas and interference gas in a current period of time, and enabling the interference gas to comprise carbon dioxide and oxygen; the concentration data and the temperature and humidity data of the fuel gas and the interference gas in the current period of time are preprocessed; the preprocessed concentration data and temperature and humidity data of the fuel gas and the interference gas are input into the trained fuel gas leakage detection model so as to detect whether current fuel gas leaks or not, and the fuel gas leakage detection model comprises a calibration module, a statistical optimization module and a prediction module. The accurate concentration value of the current fuel gas can be accurately obtained, and compared with the prior art, whether the fuel gas leaks or not can be rapidly judged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of gas detection technology, and specifically relates to a gas leak detection method, system, medium and equipment based on smart gas. Background Art

[0002] In modern society, gas is widely used in many fields such as households, industry and commerce, but the ensuing gas leakage accidents also pose a serious threat to people's lives and property safety. Existing gas leak detection methods often rely on gas alarms for detection, which need to accumulate a certain amount of data to make a judgment. Therefore, the response is not fast enough, and it is often difficult to identify minor or slowly developing leaks in a timely and accurate manner. Summary of the invention

[0003] The main purpose of this application is to provide a gas leak detection method, system, medium and equipment based on smart gas, aiming to solve the problem of insufficient sensitivity of gas leak detection in the prior art.

[0004] To achieve the above objectives, this application provides the following technical solutions:

[0005] A gas leak detection method based on smart gas, the method is applied to a gas leak detection Internet of Things system, the gas leak detection Internet of Things system includes a management platform, a sensor network platform and an object platform that are communicatively connected in sequence, the detection method includes: obtaining concentration data of gas and interfering gas as well as temperature and humidity data within a current period of time, wherein the interfering gases include carbon dioxide and oxygen; preprocessing the concentration data of gas and interfering gas as well as temperature and humidity data within the current period of time; inputting the preprocessed concentration data of gas and interfering gas as well as temperature and humidity data into a trained gas leak detection model to detect whether the current gas is leaking, wherein the gas leak detection model includes a calibration module, a statistical optimization module and a prediction module, the calibration module, the statistical optimization module and the prediction module are used to perform multi-level processing on the preprocessed concentration data of gas and interfering gas as well as temperature and humidity data to obtain an accurate gas concentration value.

[0006] Optionally, the concentration data of the fuel gas and interfering gas and the temperature and humidity data in the current period of time are preprocessed, including: cleaning the concentration data of the fuel gas and interfering gas and the temperature and humidity data in the current period of time; normalizing and combing the cleaned concentration data of the fuel gas and interfering gas and the temperature and humidity data; and performing feature engineering on the normalized concentration data of the fuel gas and interfering gas and the temperature and humidity data to generate new features.

[0007] Optionally, the calibration module is used to calibrate the concentration data of the gas and interfering gas within the current period of time after preprocessing, as well as the temperature and humidity data, to output a calibrated gas concentration value; the statistical optimization module is used to perform statistical optimization on the calibrated gas concentration value to output a statistically optimized gas concentration estimate; the prediction module is used to output the final gas concentration value and predict whether a gas leak occurs.

[0008] Optionally, the gas leak detection model is trained through the following steps: collecting historical gas and interfering gas concentration data as well as temperature and humidity data and preprocessing them; dividing the preprocessed historical data into a training set and a validation set in proportion; setting training parameters, and training the gas leak detection model through the training set. During the training process, the cross entropy loss function of the model is calculated, and the loss function is optimized using the Adam optimization algorithm until the loss function converges; the model is verified using the validation set. During the verification process, accuracy, recall rate and F1 score are used as evaluation indicators to evaluate the performance of the model. When all indicators reach the preset values, the model verification is passed; otherwise, the training parameters are adjusted or the training samples are expanded to re-train the model until the model verification is passed.

[0009] In addition, the present application also provides a gas leak detection system based on smart gas, the detection system includes a management platform, a sensor network platform and an object platform that are communicatively connected in sequence, the management platform includes: an acquisition module, used to obtain the concentration data of the gas and interfering gas in a current period of time, as well as the temperature and humidity data, wherein the interfering gases include carbon dioxide and oxygen; a preprocessing module, used to preprocess the concentration data of the gas and interfering gas in the current period of time as well as the temperature and humidity data; a detection module, used to input the preprocessed concentration data of the gas and interfering gas as well as the temperature and humidity data into a trained gas leak detection model to detect whether the current gas is leaking, wherein the gas leak detection model includes a calibration module, a statistical optimization module and a prediction module, the calibration module, the statistical optimization module and the prediction module are used to perform multi-level processing on the preprocessed concentration data of the gas and interfering gas as well as the temperature and humidity data to obtain an accurate gas concentration value.

[0010] Optionally, the preprocessing module includes: a cleaning submodule, used to clean the concentration data of the fuel gas and interfering gas and the temperature and humidity data within a current period of time; a normalization submodule, used to normalize and comb the cleaned concentration data of the fuel gas and interfering gas and the temperature and humidity data; a feature engineering submodule, used to perform feature engineering on the normalized concentration data of the fuel gas and interfering gas and the temperature and humidity data to generate new features.

[0011] In addition, the present application also provides a storage medium, which includes instructions, and when the instructions are executed on a computer, the computer executes the method as described in any of the preceding items.

[0012] In addition, the present application also provides an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in any of the preceding items when executing the program.

[0013] Compared with the existing technology, the present application brings the following beneficial effects: the present application can achieve high-sensitivity detection and rapid response to gas leaks, and uses technical means such as data preprocessing, calibration optimization, and deep learning models to significantly improve detection accuracy and reduce false alarm rate, ensuring that potential gas leakage risks can be accurately and reliably identified even in complex and changing environments, thereby providing users with a safer living and working environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 It is a flow chart of a gas leak detection method based on smart gas provided by an embodiment of the present application;

[0015] Figure 2 is a structural schematic diagram of a gas leak detection model provided by another embodiment of the present application;

[0016] Figure 3 is a structural schematic diagram of a gas leak detection system based on smart gas provided in another embodiment of the present application;

[0017] Figure 4 is a schematic diagram of a storage medium provided by another embodiment of the present application;

[0018] Figure 5 It is a structural schematic diagram of an electronic device provided in another embodiment of the present application. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0020] It should be noted that all directional indications in the embodiments of the present application (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0021] In this application, unless otherwise clearly specified and limited, the terms "connection", "fixation", etc. should be understood in a broad sense. For example, "fixation" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0022] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the meaning of "and / or" appearing in the full text includes three parallel schemes. Taking "A and / or B" as an example, it includes scheme A, or scheme B, or a scheme that satisfies both A and B. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the ability of ordinary technicians in the field to implement. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0023] Figure 1 FIG. 1 is a flow chart of a gas leak detection method based on smart gas according to an embodiment of the present application, such as Figure 1 As shown, the method is applied to a gas leak detection Internet of Things system, which includes a management platform, a sensor network platform and an object platform that are sequentially connected in communication. The detection method includes:

[0024] S100: Acquiring concentration data, temperature and humidity data of fuel gas and interfering gas within a current period of time, wherein the interfering gas includes carbon dioxide and oxygen;

[0025] S200: pre-processing the concentration data of the fuel gas and the interfering gas and the temperature and humidity data within the current period of time;

[0026] S300: Input the concentration data of the pre-processed gas and interfering gas as well as the temperature and humidity data into the trained gas leakage detection model to detect whether the current gas is leaking, wherein the gas leakage detection model includes a calibration module, a statistical optimization module and a prediction module, and the calibration module, the statistical optimization module and the prediction module are used to perform multi-level processing on the concentration data of the pre-processed gas and interfering gas as well as the temperature and humidity data to obtain an accurate gas concentration value.

[0027] The solution described in the present application can accurately obtain the current gas concentration value and can make a quick judgment on whether a gas leak occurs compared to the prior art, thereby promptly reminding relevant personnel to take measures to avoid the occurrence of dangerous situations.

[0028] In another exemplary embodiment, in step S200, the concentration data of the fuel gas and the interfering gas and the temperature and humidity data within the current period of time are preprocessed, including:

[0029] S201: Cleaning the concentration data of fuel gas and interfering gas as well as the temperature and humidity data within the current period;

[0030] In this step, the concentration data of the fuel gas and the interfering gas, as well as the temperature and humidity data within the current period of time are cleaned, specifically including removing invalid data and processing missing values, wherein removing invalid data includes checking and removing abnormal values ​​or invalid data in the sensor readings, such as negative values, values ​​beyond a reasonable range, etc. Processing missing values ​​includes filling the missing data points with interpolation methods (such as linear interpolation, spline interpolation) or using the previous valid value.

[0031] S202: normalizing and sorting the concentration data of the cleaned fuel gas and interfering gas as well as the temperature and humidity data;

[0032] In this step, the maximum and minimum method can be used to normalize the concentration data of the fuel gas and interfering gas in the current period after cleaning, as well as the temperature and humidity data, so as to scale the data to between [0, 1] to eliminate the dimensional differences between different features.

[0033] S203: Perform feature engineering on the normalized fuel gas and interfering gas concentration data and the temperature and humidity data to generate new features, such as gas concentration ratio, temperature change rate, humidity change rate, etc.

[0034] It should be noted that new features often have clearer physical meanings, which help to better understand the behavior of data and models. For example, the gas concentration ratio R = CO2 / O2 can provide information about the properties of the gas mixture. New features can help explain the prediction results of the gas leak detection model, making the gas leak detection model more transparent and easy to understand.

[0035] The nonlinear relationship between the original features is often not easy to be captured directly by the gas leak detection model. By generating new features, these relationships can be explicitly represented. For example, the temperature change rate ΔT can capture the temperature change trend over time. The interaction effect between certain features may have an important impact on the target variable. By generating cross terms or ratios, these interaction effects can be explicitly represented. For example, the concentration ratio of carbon dioxide and oxygen RCO 2 / O 2 Stronger correlation with gas leaks. The new features can provide additional information to help the gas leak detection model better fit the data, thereby improving prediction accuracy. For example, the temperature change rate ΔT can better reflect changes in the environment than a single temperature value.

[0036] In another exemplary embodiment, in step S300, Figure 2 As shown, the gas leak detection model includes: a calibration module, a statistical optimization module and a prediction module, wherein:

[0037] The calibration module is used to calibrate the concentration data of the fuel gas and the interfering gas within the current period of time after preprocessing, as well as the temperature and humidity data, to output the calibrated fuel gas concentration value C phys .

[0038] The calibration module includes an adaptive input layer, a multi-scale perception layer, an attention mechanism, a batch normalization and activation function combination layer, an autoregressive correction layer, an output layer and a continuous learning mechanism connected in sequence, wherein the adaptive input layer can automatically adjust the importance of different input features according to changes in environmental parameters (such as temperature and humidity) to ensure the accuracy of gas concentration measurements under different conditions. The multi-scale perception layer introduces multi-scale convolution kernels (for example, 3×3, 5×5, 7×7) to capture spatial features of different scales, which helps the model to better understand the distribution of gas concentration. The attention mechanism enables the model to focus on the most important features while suppressing the influence of irrelevant or noise information, thereby improving the model's attention to key features and improving the calibration effect. The batch normalization and activation function combination layer can not only speed up the training speed, but also avoid numerical instability problems caused by step-by-step operations by combining batch normalization and activation functions into the same layer.

[0039] The autoregressive correction layer further improves the calibration accuracy by constructing an autoregressive model based on time series analysis to correct the prediction results at the current moment, while taking into account the trend and periodicity of historical data. The continuous learning mechanism allows the calibration module to update its parameters online to adapt to new environmental conditions or drift problems caused by sensor aging.

[0040] The autoregressive model is expressed as:

[0041]

[0042] Among them, y t represents the target variable of the time series at time t, c represents the constant term, p represents the autoregressive order, that is, how many past moments of the self-historical value are considered for prediction, φ i represents the autoregressive coefficient, which indicates the weight of the gas concentration at a lag time point on the current moment, q represents the number of exogenous variables, that is, how many additional environmental factors are included in the model, and β j represents the coefficient of the exogenous variable, x j,t represents the observed value of the jth exogenous variable at time t, such as temperature, humidity, etc., Y t-1 represents the vector of all historical gas concentration values ​​up to time t-1, X t represents the vector of all exogenous variables at time t, f LSTM (·) represents the output function of the LSTM layer, which receives the historical gas concentration and the exogenous variables at the current moment as input and outputs a result reflecting the long-term dependency and nonlinear pattern, ε t represents the error term.

[0043] The output of the calibration module can be expressed as:

[0044] C phys =a 0 +a 1 V main +a 2 V co2 +a 3 V o2 +a 4 T+a 5 H+a 6 V 2 main +a 7 V 2 co2 +a 8 V 2 o2 +a 9 T 2 +a 10 H 2

[0045] +a 11 V main V co2 +a 12 V main V o2 +a 13 V main T+a 14 V main H+a 15 V co2 V o2 +a 16 V co2 T+a 17 V co2 H+a 18 V o2 T+a 19 V o2 H+a 20 TH

[0046] Among them, a 1 V main Represents the linear effect of the gas sensor reading, a 2 V co2 represents the linear effect of the CO2 sensor reading, a 3 V o2 represents the linear effect of the oxygen sensor reading, a 4 T represents the linear effect of temperature, a 5 H represents the linear effect of humidity, a 6 V 2 main represents the secondary effect of the gas sensor reading, a 7 V 2 co2 Secondary effects of CO2 sensor readings, a 8 V 2 o2 represents the secondary effect of the oxygen sensor reading, a 9 T 2 represents the secondary effect of temperature, a 10 H 2 represents the secondary effect of humidity, a 11 V main V co2 represents the cross-effect of gas and CO2 sensor readings, a 12 V main V o2 The cross-effect of gas and oxygen sensor readings, a 13 V main T represents the cross-effect of gas sensor reading and temperature, a 14 V mainH represents the cross-effect of gas sensor reading and humidity, a 15 V co2 V o2 represents the cross-effect of CO2 and O2 sensor readings, a 16 V co2 T represents the cross-effect of CO2 sensor reading and temperature, a 17 V co2 H represents the cross-effect of CO2 sensor reading and humidity, a 18 V o2 T represents the cross-effect of oxygen sensor reading and temperature, a 19 V o2 H represents the cross-effect of oxygen sensor reading and humidity, a 20 TH represents the cross-effect of temperature and humidity, a 0 , a 1 , a 2 ,…,a 20 are the coefficients obtained by fitting the experimental data.

[0047] The statistical optimization module is used to calibrate the gas concentration value C phys Perform statistical optimization to output the gas concentration estimate C after statistical optimization stat, the statistical optimization module includes a preprocessing layer, a trend and cycle decomposition layer, a smoothing layer, an advanced statistical model layer and an integrated learning layer connected in sequence, wherein the preprocessing layer identifies and processes outliers through statistical methods (such as Z scores, IQR, etc.) to prevent negative impact on model training. The trend and cycle decomposition layer uses seasonal and trend time series decomposition (Seasonal and Trend decomposition using Loess, STL) to separate the trend, seasonality and residual components in the original time series, which helps to understand the dynamic characteristics behind the data more clearly and provide purer data input for subsequent steps. The smoothing layer uses moving average or exponentially weighted moving average (EWMA) to smooth the data to reduce the impact of short-term fluctuations on long-term trends, and for data with obvious seasonality, the Holt-Winters triple exponential smoothing algorithm is used for further optimization. The advanced statistical model layer constructs an autoregressive integrated moving average model (AutoRegressive Integrated MovingAverage, ARIMA) to capture autocorrelation and non-stationarity in time series. The ensemble learning layer uses ensemble learning methods, such as Random Forest, Gradient Boosting Machine (GBM), etc., to combine multiple weak learners to form a strong learner, thereby improving the generalization ability and stability of the overall model. The statistical optimization module with the above structure can not only provide stable and reliable output in a complex and changing environment, but also continuously improve its own performance, contributing higher accuracy and lower false alarm rate to the gas leak detection system.

[0048] The statistical optimization module matching the above structure can be specifically expressed as:

[0049] C stat =f ensemble (f ARIMA (f smooth (f STL (f preprocess (C phys )))))

[0050] Among them, C stat represents the estimated value of gas concentration after statistical optimization, f preprocess (·) represents the operation of the preprocessing layer, including denoising and outlier detection and processing. The input is the calibrated gas concentration value C phys , f STL (·) represents the STL decomposition function, output S t ,T t ,R tThree components, representing seasonal component, trend component and residual component, f smooth (·) represents the operation of the smoothing layer, and the input is the decomposed component S t ,T t ,R t , f ARIMA (·) represents the operation of the advanced statistical model layer. The input is the smoothed data sequence. ensemble (·) represents the operation of the ensemble learning layer, and the input is f ARIMA The output of (·).

[0051] In the statistical optimization module shown above, the C phys Throughout the entire process, starting from the initial raw observations, through preprocessing, decomposition, smoothing, modeling, until finally generating C through ensemble learning stat , which can ensure that the statistical optimization module can provide stable and reliable output in complex environments and can continuously improve performance to adapt to changing situations.

[0052] The prediction module is used to capture the gas concentration estimate C after statistical optimization. stat The complex pattern in the image is analyzed and the final gas concentration value and the binary classification result of whether a gas leak occurs are output.

[0053] The prediction module is expressed as:

[0054] C final ,Y=MLP(W 1 [C stat ,V interference ,T,H]+b 1 ,W 2 ,b,...,W n ,b n )

[0055] The prediction module specifically includes:

[0056] Includes the input layer, which receives all input features.

[0057] The first convolutional layer (32 kernels, kernel size 3, activation function ReLU, same padding) is used to capture local features in the input data. The local features include gas concentration gradients (such as a sharp rise or fall in concentration, which may be an early sign of a leak), temperature changes (such as a sudden increase or decrease in temperature may be related to a gas leak, especially when the leaking gas causes a change in ambient temperature), humidity changes (gas leaks may cause changes in the moisture content of the air), and local patterns in time series (such as periodic changes or sudden changes in gas concentration over a period of time).

[0058] The first batch normalization layer is used to batch normalize the output of the first convolutional layer, which helps to speed up the model training process and stabilize the gradient descent optimization algorithm.

[0059] The first maximum pooling layer (pooling window size is 2, stride is 2) is used to filter out key features from the local features extracted from the first convolutional layer.

[0060] The second convolutional layer (64 convolution kernels, kernel size 3, activation function ReLU, same padding) is used to combine the local features extracted by the first convolutional layer to obtain higher-level features of a larger scale. The higher-level features include time series patterns (for example, a trend of a slow increase or decrease in gas concentration over a long period of time or a periodic change in concentration peaks at the same time every day), transient changes (for example, a rapid change in combustible gas concentration in a short period of time, which may be an early signal of a leak, or a gradual change in gas concentration over a long period of time, which may be the result of a gradual accumulation of leaks).

[0061] The second batch normalization layer is used to batch normalize the output of the second convolutional layer;

[0062] The second maximum pooling layer (pooling window size is 2, stride is 2) is used to filter out key features from the high-level features extracted from the second convolutional layer.

[0063] The first LSTM layer (64 units, returns a sequence) is used to capture the gas concentration change pattern at each time point in the input sequence to identify potential leakage trends; in addition, since the first LSTM layer returns the results of all time steps, it can link the current time step with the information of the previous time step to provide a continuous historical context.

[0064] The second LSTM layer (64 units, no return sequence) is used to compress and summarize the input sequence to extract the most representative long-term features.

[0065] The first LSTM layer focuses on the changing patterns in a shorter period of time, which can help identify the initial signs of abnormal conditions. For example, if the gas concentration suddenly rises in a short period of time, this may be a precursor to a leak. The second LSTM layer focuses on the trend over a longer period of time, which helps identify potential risks that gradually accumulate. For example, even if the gas concentration does not fluctuate much in the short term, if it shows a slow but continuous increase over a long period of time, it may also indicate a leak.

[0066] By combining the first LSTM layer and the second LSTM layer, the gas leak detection model can fully understand the various factors in the input data, so that it can promptly detect early signs of leakage incidents and identify gradually accumulated risks, thereby making a more accurate judgment on whether a gas leak has occurred.

[0067] The hidden layer includes multiple fully connected layers. Each fully connected layer is connected to the activation function ReLU. The Dropout layer is further added after the activation function ReLU to prevent overfitting.

[0068] Among them, the output of the first fully connected layer is expressed as:

[0069] h 1 =ReLU(W 1 [C stat ,V inerference ,T,H]+b 1 )

[0070] Among them, W 1 represents the weight of the first fully connected layer, V inerference represents the sensor readings of all interfering gases, b 1 Represents the bias vector of the first fully connected layer.

[0071] The output of the second fully connected layer is expressed as:

[0072] h 2 =ReLU(W 2 h 1 +b 2 )

[0073] Among them, W 2 represents the weight of the second fully connected layer, b 2 Represents the bias vector of the second fully connected layer.

[0074] The output of the nth fully connected layer is expressed as:

[0075] h n =ReLU(W n h n-1 +b n )

[0076] Output layer: includes two output nodes, one for regression prediction of gas concentration C final , and the other is used for binary classification to predict whether Y exceeds the standard, which is specifically expressed as follows:

[0077] C final =W out1 h n +b out1

[0078] Y=σ(W out2 h n +b out2 )

[0079] Among them, σ represents the Sigmoid function, W out1 represents the weight vector of the first output node of the output layer (for regression task), b out1 Represents the bias scalar of the first output node of the output layer (for regression tasks), W out2 represents the weight vector of the second output node of the output layer (for classification tasks), b out2 A scalar representing the bias of the second output node of the output layer (for classification tasks).

[0080] In summary, the calibration module can provide a gas concentration calibration value, thereby reducing the influence of sensor errors and environmental factors. The statistical optimization module further processes the noise and uncertainty in the gas concentration calibration value through statistical methods, thereby further improving the accuracy of the calibration value. The prediction module uses a deep learning network to capture complex patterns in the data and ultimately determines whether the gas concentration is leaking. This multi-level gas data processing method allows the gas leak detection model to understand and interpret gas data from different angles and levels, and maintain stable performance even in the face of variable or extreme conditions (for example, in the case of large fluctuations in temperature and humidity or the presence of other interfering gases, the model can still make accurate judgments), which not only improves the detection accuracy of the gas leak detection model, but also enhances the robustness and real-time response capabilities of the gas leak detection model, effectively reducing the false alarm rate, and ensuring that the gas leak detection model can accurately and reliably identify gas leak events under a variety of environmental conditions.

[0081] In another exemplary embodiment, in step S300, the gas leak detection model is trained by the following steps:

[0082] S301: Collect historical fuel gas and interfering gas concentration data as well as temperature and humidity data and perform preprocessing;

[0083] S302: Divide the preprocessed historical data into a training set and a validation set in proportion, for example, the ratio is 7:3;

[0084] S303: Setting training parameters, for example, the training batch size is 32, the number of training rounds is 100, and the learning rate is 0.001, and the gas leak detection model is trained using the training set. During the training process, the cross entropy loss function of the model is calculated, and the loss function is optimized using the Adam optimization algorithm until the loss function converges;

[0085] S304: Use the validation set to validate the gas leak detection model, and use accuracy, recall and F1 score as evaluation indicators to evaluate the model performance. When each indicator reaches 0.9 or above, the model verification is passed; otherwise, adjust the training parameters (for example, adjust the number of training rounds to 200, adjust the learning rate to 0.05) or expand the training samples to retrain the model until the model verification is passed.

[0086] In another exemplary embodiment, the cross entropy loss function of the gas leak detection model is expressed as:

[0087] f=L weighted-CE +H[P]=-(aylog(p)+(1-y)log(1-p))+λ(-(plog(p)+(1-p)log(1-p)))

[0088] Among them, L weighted-CE represents the weighted cross entropy loss, which is used to measure the difference between the predicted probability distribution and the actual label, and a is used to adjust the imbalance between different categories; H[P] represents the entropy of the predicted probability distribution; y represents the true label. For the binary classification problem (whether the gas leaks), y takes 0 or 1. When y=1, it means there is a gas leak, and when y=0, it means there is no gas leak; p represents the probability that the model predicts a positive example (i.e., gas leak); a represents the weight coefficient of the positive example (i.e., gas leak). Since gas leak events are relatively rare, in order to balance the problem of class imbalance, a weight greater than 1 can be assigned to the minority class (gas leak), so that the model pays more attention to these rare but important situations. For example, if a=5 is set, it means that the false positive or false negative of gas leaks will be punished more than the non-leakage situation; λ represents the hyperparameter that controls the balance between uncertainty and classification error.

[0089] In the cross entropy loss function shown above, by introducing the weighted cross entropy loss L weighted-CE , and setting a>1 to increase the weight of positive examples (i.e., gas leaks) can effectively deal with the problem of relatively rare gas leak events in the training data, so as to ensure that the gas leak detection model will not be overly biased towards negative examples (no leaks) during the learning process, thereby improving the detection ability of rare but important gas leak events. In addition, the entropy H[P] of the predicted probability distribution is added to the loss function as part of the uncertainty estimate. The entropy term encourages the model to generate more deterministic prediction results. When the model is not sure about the classification of a sample (i.e., P is close to 0.5), the sample will contribute more to the total loss, prompting the gas leak detection model to adjust its parameters to reduce this uncertainty, which helps to build a more robust gas leak detection model, especially in the face of noise or outliers.

[0090] In summary, this application combines the design of weighted cross entropy and uncertainty penalty to enable the gas leak detection model to not only focus on accurately identifying gas leak events, but also pay attention to avoiding mistakenly marking non-leakage situations as leaks (i.e. reducing false positives). At the same time, by giving positive examples a higher weight, the gas leak detection model will be more inclined to correctly identify real leak events, thereby reducing the risk of missed reports.

[0091] Below, the present application describes the technical solution described in the present application by combining specific data:

[0092] This application sets the collection interval to once every 10 minutes, and the collected raw data is:

[0093] Time (hours:minutes): [00:00,00:10,00:20,00:30,00:40,00:50,01:00,01:10,01:20,01:30,01:40,01:50,02:00,02:10,02:20,02:30,02:40,02:50,03:00,03:10]

[0094] Gas concentration (ppm): [0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35]

[0095] Carbon dioxide concentration (ppm): [408,410,412,414,416,418,420,422,424,426,428,430,432,434,436,438,440,442,444,446]

[0096] Oxygen concentration (%): [20.85, 20.84, 20.83, 20.82, 20.81, 20.80, 20.79, 20.78, 20.77, 20.76, 20.75, 20.74, 20.73, 20.72, 20.71, 20.70, 20.69, 20.68, 20.67, 20.66]

[0097] Temperature (℃): [22.1, 22.0, 22.2, 22.3, 22.1, 22.2, 22.3, 22.4, 22.3, 22.4, 22.5, 22.6, 22.5, 22.6, 22.7, 22.8, 22.7, 22.8, 22.9, 23.0]

[0098] Humidity (%): [56,57,55,58,57,59,58,60,59,61,60,62,61,63,62,64,63,65,64,66]

[0099] The gas concentration obtained after calibration and statistical optimization is:

[0100] [0.16,0.17,0.18,0.19,0.20,0.21,0.22,0.23,0.24,0.25,0.26,0.27,0.28,0.29,0.30,0.31,0.32,0.33,0.34,0.35]

[0101] The safety threshold for whether a gas leak occurs is set to 0.3ppm. In the above example, before the time point 02:20, the gas concentration showed a gradual upward trend, but it had not yet exceeded the safety threshold. From the 15th time point (02:20), the gas concentration exceeded the safety threshold (0.3ppm), so the model will issue an alarm at 02:20 to indicate the possible risk of gas leakage.

[0102] It can be seen from the above examples that this method can not only accurately identify gas leakage events, but also issue an alarm in the early stages of leakage.

[0103] In another exemplary embodiment, Figure 3 As shown, the present application also provides a gas leak detection system based on smart gas, the detection system includes a management platform, a sensor network platform and an object platform that are communicatively connected in sequence, the management platform includes: an acquisition module 100, used to obtain the concentration data of the gas and the interfering gas in a current period of time, as well as the temperature and humidity data, wherein the interfering gases include carbon dioxide and oxygen; a preprocessing module 200, used to preprocess the concentration data of the gas and the interfering gas in the current period of time as well as the temperature and humidity data; a detection module 300, used to input the preprocessed concentration data of the gas and the interfering gas as well as the temperature and humidity data into a trained gas leak detection model to detect whether the current gas is leaking, wherein the gas leak detection model includes a calibration module, a statistical optimization module and a prediction module, the calibration module, the statistical optimization module and the prediction module are used to perform multi-level processing on the preprocessed concentration data of the gas and the interfering gas as well as the temperature and humidity data to obtain an accurate gas concentration value.

[0104] Optionally, the preprocessing module 100 includes: a cleaning submodule, used to clean the concentration data and temperature and humidity data of the fuel gas and interfering gas within a current period of time; a normalization submodule, used to normalize and comb the cleaned concentration data and temperature and humidity data of the fuel gas and interfering gas; a feature engineering submodule, used to perform feature engineering on the normalized concentration data and temperature and humidity data of the fuel gas and interfering gas to generate new features.

[0105] Based on the above embodiments, Figure 4 , for an explanation of the computer-readable storage medium of the exemplary embodiment of the present application, please refer to Figure 4 , the computer-readable storage medium shown is a CD 40, on which a computer program (i.e., a program product) is stored. When the computer program is executed by the processor, each step recorded in the above method implementation is implemented, for example, obtaining the concentration data, temperature and humidity data of the gas and the interfering gas in the current period of time, wherein the interfering gas includes carbon dioxide and oxygen; preprocessing the concentration data, temperature and humidity data of the gas and the interfering gas in the current period of time; inputting the preprocessed concentration data, temperature and humidity data of the gas and the interfering gas into the trained gas leakage detection model to detect whether the current gas is leaking, wherein the gas leakage detection model includes a calibration module, a statistical optimization module and a prediction module, and the calibration module, the statistical optimization module and the prediction module are used to perform multi-level processing on the preprocessed concentration data, temperature and humidity data of the gas and the interfering gas to obtain an accurate gas concentration value. The specific implementation method of each step is not repeated here.

[0106] It should be noted that the computer-readable storage medium includes but is not limited to phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical or magnetic storage media, which are not listed here one by one.

[0107] Based on the above embodiments, the present application also provides an electronic device, as shown below: Figure 5 An electronic device for downloading a file according to an exemplary embodiment of the present application is described.

[0108] Figure 5 A block diagram of an exemplary electronic device 50 suitable for implementing the embodiments of the present application is shown, and the electronic device 50 may be a computer system or a cloud server. Figure 5 The electronic device 50 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0109] like Figure 5 As shown, the electronic device 50 includes but is not limited to: one or more processors or processing units 501, a system memory 502, and a bus 503 connecting different system components (including the system memory 502 and the processing unit 501).

[0110] The electronic device 50 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 50, including volatile and non-volatile media, removable and non-removable media.

[0111] The system memory 502 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 5021 and / or cache memory 5022. The electronic device 50 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the ROM 5023 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 is not shown in the Figure 5 As shown in FIG. 5 , a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) can be provided. In these cases, each drive can be connected to bus 503 via one or more data medium interfaces. System memory 502 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of each embodiment of the present application.

[0112] A program / utility 5025 having a set (at least one) of program modules 5024 may be stored, for example, in system memory 502, and such program modules 5024 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 5024 generally perform the functions and / or methods of the embodiments described herein.

[0113] The electronic device 50 may also communicate with one or more external devices 504 (e.g., a keyboard, a pointing device, a display, etc.). Such communication may be performed via an input / output (I / O) interface 505. Furthermore, the electronic device 50 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 506. Figure 5As shown, the network adapter 506 communicates with other modules (such as the processing unit 501, etc.) of the electronic device 50 via the bus 503. It should be understood that although Figure 5 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 50 .

[0114] The processing unit 501 executes various functional applications and data processing by running the program stored in the system memory 502, for example, obtaining the concentration data and temperature and humidity data of the gas and interfering gas in the current period of time, wherein the interfering gases include carbon dioxide and oxygen; preprocessing the concentration data and temperature and humidity data of the gas and interfering gas in the current period of time; inputting the preprocessed concentration data and temperature and humidity data of the gas and interfering gas into the trained gas leakage detection model to detect whether the current gas is leaking, wherein the gas leakage detection model includes a calibration module, a statistical optimization module and a prediction module, and the calibration module, the statistical optimization module and the prediction module are used to perform multi-level processing on the preprocessed concentration data and temperature and humidity data of the gas and interfering gas to obtain an accurate gas concentration value.

[0115] The specific implementation of each step will not be repeated here. It should be noted that although several units / modules or sub-units / sub-modules of the file concurrent downloading device are mentioned in the above detailed description, this division is only exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units / modules described above can be concretized in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules for concretization.

[0116] In the description of the present application, it should be noted that the terms "first", "second" and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.

[0117] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0118] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0119] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0120] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0121] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that can be executed by a processor. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a cloud server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0122] The above embodiments are only for illustrating the technical concept and features of the present application, and their purpose is to enable people familiar with the technology to understand the content of the present application and implement it accordingly, and they cannot be used to limit the protection scope of the present application. Any equivalent changes or modifications made according to the spirit of the present application should be included in the protection scope of the present application.

Claims

1. A gas leak detection method based on smart gas, characterized in that: The method is applied to a gas leak detection Internet of Things system, which includes a management platform, a sensor network platform and an object platform that are sequentially connected in communication. The detection method includes: Acquire the concentration data, temperature and humidity data of the fuel gas and the interfering gas in the current period of time, wherein the interfering gas includes carbon dioxide and oxygen; Preprocessing the concentration data of the fuel gas and the interfering gas as well as the temperature and humidity data within the current period of time; The concentration data of the pre-processed gas and interfering gas as well as the temperature and humidity data are input into the trained gas leak detection model to detect whether the current gas is leaking. The gas leak detection model includes a calibration module, a statistical optimization module and a prediction module. The calibration module, the statistical optimization module and the prediction module are used to perform multi-level processing on the concentration data of the pre-processed gas and interfering gas as well as the temperature and humidity data to obtain an accurate gas concentration value.

2. The detection method according to claim 1, characterized in that: Preprocessing the concentration data of the fuel gas and the interfering gas as well as the temperature and humidity data within the current period of time includes: Clean the concentration data of fuel gas and interfering gas as well as the temperature and humidity data within the current period; Normalize and sort out the concentration data of the cleaned fuel gas and interfering gas as well as the temperature and humidity data; Feature engineering is performed on the normalized fuel gas and interfering gas concentration data as well as the temperature and humidity data to generate new features.

3. The detection method according to claim 1, characterized in that: The calibration module is used to calibrate the concentration data of the fuel gas and the interfering gas within a current period of time after preprocessing, as well as the temperature and humidity data, so as to output a calibrated fuel gas concentration value; The statistical optimization module is used to perform statistical optimization on the calibrated gas concentration value to output a statistically optimized gas concentration estimation value; The prediction module is used to output the final gas concentration value and predict whether a gas leak occurs.

4. The detection method according to claim 1, characterized in that: The gas leak detection model is trained by the following steps: Collect historical fuel gas and interfering gas concentration data as well as temperature and humidity data and perform pre-processing; Divide the preprocessed historical data into training set and validation set in proportion; Set training parameters and train the gas leak detection model using the training set. During the training process, calculate the cross entropy loss function of the model and use the Adam optimization algorithm to optimize the loss function until the loss function converges. The model is verified using the validation set. During the verification process, accuracy, recall and F1 score are used as evaluation indicators to evaluate the model performance. When all indicators reach the preset values, the model is verified. Otherwise, the training parameters are adjusted or the training samples are expanded to retrain the model until the model is verified.

5. A gas leak detection system based on smart gas, characterized in that: The detection system includes a management platform, a sensor network platform and an object platform which are sequentially connected in communication, and the management platform includes: An acquisition module is used to acquire the concentration data, temperature and humidity data of the fuel gas and the interfering gas within a current period of time, wherein the interfering gas includes carbon dioxide and oxygen; A preprocessing module, used for preprocessing the concentration data of the fuel gas and the interfering gas as well as the temperature and humidity data within the current period of time; The detection module is used to input the concentration data of the pre-processed gas and interfering gas as well as the temperature and humidity data into the trained gas leakage detection model to detect whether the current gas is leaking, wherein the gas leakage detection model includes a calibration module, a statistical optimization module and a prediction module, and the calibration module, the statistical optimization module and the prediction module are used to perform multi-level processing on the concentration data of the pre-processed gas and interfering gas as well as the temperature and humidity data to obtain an accurate gas concentration value.

6. The detection system according to claim 5, characterized in that: The preprocessing module comprises: The cleaning submodule is used to clean the concentration data of fuel gas and interfering gas as well as the temperature and humidity data within the current period; The normalization submodule is used to normalize and sort out the concentration data of the cleaned fuel gas and interfering gas as well as the temperature and humidity data; The feature engineering submodule is used to perform feature engineering on the normalized fuel gas and interfering gas concentration data as well as the temperature and humidity data to generate new features.

7. A storage medium, characterized in that: The method comprises instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 4.

8. An electronic device, characterized in that: The electronic device comprises: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Cited By

  • Gas pipeline leakage detection method based on deep learning

    CN120823564A