Intelligent agent construction method for gas pipe network gas loss detection

By conducting feature engineering and abnormal point identification on the historical data of the gas pipeline network, combined with the time-fusion Transformer model to predict gas losses, the problem of inaccurate and timely gas loss detection in the existing technology is solved, and efficient gas loss detection and real-time monitoring are achieved.

CN119598315APending Publication Date: 2025-03-11ZHONGKE HUIZHI (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411637467.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The existing gas pipeline gas loss detection technology cannot achieve accurate and timely detection, which makes it difficult to detect gas losses in a timely manner, which may lead to problems such as gas leakage or misappropriation.

Method used

By obtaining historical production data for feature engineering analysis, filtering out abnormal points and using the time-fusion Transformer model to predict gas sales. When the sales exceeds the threshold, it is identified as gas loss and an alarm is activated. The digital twin platform links to display the gas loss position in real time.

Benefits of technology

It improves the accuracy and timeliness of non-destructive testing, helps enterprises to timely detect and control gas losses, and reduces national energy losses and environmental pollution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119598315A_ABST
    Figure CN119598315A_ABST
Patent Text Reader

Abstract

The invention discloses a gas pipe network gas loss detection-oriented agent construction method, which comprises the following steps of S1, firstly, acquiring real historical production data, analyzing the data, and analyzing data features through feature engineering; s2, abnormal points are screened out, abnormal point data are analyzed in detail, the abnormal types of the abnormal point data are analyzed, and different abnormal points are marked; and S3, sending the analyzed and processed data into a time-fused Transform model, and predicting the fuel gas sales volume. The invention belongs to the technical field of gas detection, and achieves the effects that the model is greatly improved in gas loss detection accuracy and timeliness compared with previous technical means, an enterprise is helped to reduce and control gas loss in time, national energy loss and environmental pollution are reduced, and the economic benefit is increased. And when the model detects that the gas loss occurs, the digital twin platform is triggered to simulate and display the gas loss condition at the position where the gas loss occurs in real time. And multi-channel alarm prompts including short message, mail and picture display are provided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of gas detection, and in particular to an intelligent body construction method for gas loss detection in a gas pipeline network. Background Art

[0002] Currently, the gas pipeline transportation industry generally lacks a method that can accurately and timely detect gas loss, resulting in the failure to promptly discover gas loss and causing problems such as gas leakage or theft.

[0003] Some existing detection technologies can only detect specific gas damage types or ranges, and are inefficient for multi-point non-destructive testing in complex systems. In addition, the detection speed is slow and cannot meet the needs of rapid detection and real-time monitoring.

[0004] Some other gas loss detection technologies are unable to achieve remote monitoring and data transmission, resulting in the inability to timely grasp the gas loss situation and to conduct big data analysis to optimize energy management and equipment maintenance.

[0005] For the display of non-destructive testing, the display effect in a single gas loss monitoring device or system is not ideal. It cannot intuitively display the real physical distribution of the entire pipeline and the location and impact of gas loss. It lacks integration with other display technologies. At the current stage, it is necessary to achieve more intelligent non-destructive testing and more friendly and intuitive display methods. Summary of the invention

[0006] To this end, the present invention provides an intelligent agent construction method for gas loss detection in gas pipeline networks to solve the above-mentioned problems in the prior art.

[0007] In order to achieve the above object, the present invention provides the following technical solutions:

[0008] A method for constructing an intelligent agent for gas loss detection in a gas pipeline network comprises the following steps:

[0009] S1: First, you need to obtain real historical production data, analyze the data, and analyze the data characteristics through feature engineering;

[0010] S2: Screen out the outliers, analyze the outlier data in detail, analyze the outlier types of the outlier data, and mark different outliers;

[0011] S3: Send the analyzed and processed data to the time-fused Transformer model, adjust the parameters, and obtain the gas sales volume;

[0012] S4: After the sales volume is obtained, it is compared with the threshold value set based on experience. When the upper limit of the threshold is exceeded, the abnormal point recognition algorithm is used to identify gas loss and activate the gas loss alarm;

[0013] S5: Link with the digital twin platform to display the gas loss location in real time on the digital twin platform.

[0014] Furthermore, in S1, the gas usage behavior of the terminal users is analyzed, and the terminal gas users are classified according to the gas usage type using a clustering algorithm.

[0015] Furthermore, in S1, the data used is the historical business data of the gas pipeline network in the past two years. After analyzing the data, a valid data set is formed, and the data is time series data.

[0016] Furthermore, in S1, when acquiring historical data, a gated residual network GRN is used, and GRN is used to help capture historical data.

[0017] Furthermore, in S2, in the process of analyzing the historical production data, static covariates and time-dependent time-varying variables are used to construct a network, and relevant input variables are further selected at each time.

[0018] Furthermore, categorical variables such as the year and month set in the code use entity embedding as feature representation, and the input time is used as a continuous variable using linear transformation to further convert each input time data into an n-dimensional vector, which matches the dimensions in the subsequent layers.

[0019] Furthermore, in S3, quantile prediction is used. Quantile prediction provides prediction intervals for optimizing decision-making and risk management, and provides prediction intervals for determining the possible target value range of each prediction layer, and predictions of the best and worst case values ​​that the target may adopt. The prediction algorithm is as follows:

[0020]

[0021] The predicted value of each quantile, q quantile, t time point, Step number, f q Prediction model, S i Static covariates.

[0022] Furthermore, the loss function takes the sum of all quantile outputs and minimizes its quantile loss. The function expression is as follows:

[0023]

[0024] Among them, y is the true value, is the predicted value and q is the quantile.

[0025] The present invention has the following advantages: through the above steps, we have constructed a flow prediction model for non-destructive testing. For the true value of the prediction result evaluation and the prediction result value that is lower than 10%, it is generally believed that the prediction accuracy of the model is high. The model has greatly improved the accuracy and timeliness of non-destructive testing compared with previous technical means, helping enterprises reduce and timely control gas losses, and reduce national energy losses and environmental pollution.

[0026] When the model detects that gas loss has occurred, the digital twin platform is triggered to simulate and display the gas loss situation in real time at the location where the gas loss has occurred. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 This is a diagram showing the effect of an intelligent entity construction method for gas loss detection in a gas pipeline network provided by the present invention.

[0028] Figure 2 This is a structural diagram of the entire gated residual network GRN provided by the present invention.

[0029] Figure 3 This is the year parameter setting diagram provided by the present invention.

[0030] Figure 4 The static metadata provided for the present invention affects the processing diagram of the current time. DETAILED DESCRIPTION

[0031] The following is a description of the implementation of the present invention by specific embodiments. People familiar with the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0032] Example 1

[0033] like Figure 1-Figure 4 As shown, a method for constructing an intelligent agent for gas loss detection in a gas pipeline network in an embodiment of the first aspect of the present invention includes the following steps:

[0034] S1: First, you need to obtain real historical production data, analyze the data, and analyze the data characteristics through feature engineering;

[0035] S2: Screen out the outliers, analyze the outlier data in detail, analyze the outlier types of the outlier data, and mark different outliers;

[0036] S3: Send the analyzed and processed data to the time-fused Transformer model, adjust the parameters, and obtain the gas sales volume;

[0037] S4: After the sales volume is obtained, it is compared with the threshold value set based on experience. When the upper limit of the threshold is exceeded, the abnormal point recognition algorithm is used to identify gas loss and activate the gas loss alarm;

[0038] S5: Link with the digital twin platform to display the gas loss location in real time on the digital twin platform;

[0039] In the above embodiment, it should be noted that through the above steps we have constructed a flow prediction model for non-destructive testing. For the true value of the prediction result evaluation and the prediction result value that is lower than 10%, it is generally believed that the prediction accuracy of the model is high. The model has greatly improved the accuracy and timeliness of non-destructive testing compared with previous technical means, helping enterprises to reduce and timely control gas losses, reduce national energy losses and environmental pollution.

[0040] When the model detects that gas loss has occurred, the digital twin platform will be triggered to simulate and display the gas loss situation in real time at the location where the gas loss occurred. It will also provide multi-channel alarm prompts including SMS, email, and screen display;

[0041] Categorical variables such as the year and month set in the code use entity embedding as feature representation, and the input time is used as a continuous variable using linear transformation to convert the data of each input time step such as (2022-01-02, 1,618.44) into an n-dimensional vector that matches the dimensions in the subsequent layers to achieve jump connections. The variable selection networks for static covariate inputs, past time inputs, and future time step inputs are independent of each other, that is, they do not share parameters. As can be seen in the figure above, a gated residual network is used in the variable selection network. The gated residual network is used to linearly transform and select the processed input vector ξt(j). The formula is as follows:

[0042]

[0043] The n-dimensional vector of each time step is processed together with the time variable selection Cs generated by the static covariate encoding through the gated residual network, and then the feature selection weight vχt is generated by the Softmax activation function. The formula is as follows:

[0044]

[0045] The Softmax activation function formula is as follows:

[0046]

[0047] In the entire variable selection network, the weight vector generated at each step is added to the vector processed by the gated residual network at each step to form the output of the variable selection network. The formula is as follows:

[0048]

[0049] The time variable selection Cs used in the previous step of input processing is generated by the static covariate encoder. The static covariate encoder is actually a gated residual network that processes the input after variable selection and generates 4 different context vectors, including: Cs time variable selection, Cc, Ch local processing of time features, and Ce enriching time features with static information. Through this module, the periodic change information of gas sales that needs special attention in the project is integrated into other calculation modules as a separately encoded feature, and human intervention is added to the algorithm to further improve the accuracy of the algorithm. As shown in the figure below, the time variable selection Cs is integrated into the variable selection network, the local processing of time features Cc and Ch are integrated into the LSTM encoding module, and the time variable selection Cs is integrated into the static enrichment layer. Through this series of measures, the generated static features are integrated into the network, and the time dynamics are adjusted through context vector encoding.

[0050] Example 2

[0051] like Figure 1 As shown, a method for constructing an intelligent agent for gas loss detection in a gas pipeline network includes all the contents of Example 1. In addition, in S1, the gas usage behavior analysis of the terminal users is used, and the terminal gas users are classified by gas usage type using a clustering algorithm;

[0052] In the above embodiment, it should be noted that in order to better detect gas loss, we need to understand the gas usage characteristics of users and describe the gas usage characteristics and number of users of each type separately.

[0053] Example 3

[0054] like Figure 1 As shown, a method for constructing an intelligent agent for gas loss detection in a gas pipeline network includes all the contents of Example 2. In addition, in S1, the data used is the historical business data of the gas pipeline network in the past two years. After analyzing the data, a valid data set is formed, and the data is time series data;

[0055] In the above embodiment, it should be noted that the data time is 2022.1.1-2024.7.24. During the process, we split the data set into a data set and a verification data set. The code is as follows:

[0056] TRAIN="20240401"#train / test split.

[0057] Example 4

[0058] like Figure 1As shown, a method for constructing an intelligent agent for gas loss detection in a gas pipeline network includes all the contents of Example 1. In addition, in S1, when acquiring historical data, a gated residual network GRN is used to help capture historical data;

[0059] In the above embodiment, it should be noted that the gating mechanism uses ELU and GLU. The advantage of using ELU for linear unit activation function processing is that it can also generate constant output when a negative number is input. GLU is used to suppress unnecessary parts of the architecture.

[0060] Example 5

[0061] like Figure 1 As shown, a method for constructing an intelligent agent for gas loss detection in a gas pipeline network includes all the contents of Example 1. In addition, in S2, a static covariate and a time-dependent time-varying variable are used to construct a network in the process of analyzing historical production data, and relevant input variables are further selected at each time;

[0062] In the above embodiments, it is noted that the most important variables can be predicted, allowing the algorithm to remove any unnecessary noise inputs that negatively impact performance.

[0063] Example 6

[0064] like Figure 1 As shown, a method for constructing an intelligent agent for gas loss detection in a gas pipeline network includes all the contents of Example 5. In addition, categorical variables such as the year and month set in the code use entity embedding as feature representation, and the input time is used as a continuous variable using linear transformation to further convert each input time data into an n-dimensional vector, and the vector matches the dimension in the subsequent layer;

[0065] In the above embodiment, it should be noted that in order to realize skip connection, the variable selection networks for the input of static covariates, the input of past time and the further input of future time are independent of each other, that is, they do not share parameters;

[0066] Since the data used in gas damage detection is time series data, the self-attention mechanism has its inherent advantages in long-term memory and data processing of time series data. The self-attention mechanism can learn long-term relationships of different time steps. The gas damage detection in this project uses the interpretable multi-head attention mechanism modified by the Transformer-based multi-head attention mechanism to enhance the interpretability of the model. The calculation formula of the interpretable multi-head attention mechanism is as follows:

[0067]

[0068]

[0069] Q, K, V are vectors calculated based on the input, W is the parameter matrix, and H represents the self-attention head.

[0070] In this project, after multiple rounds of training and combined with experience, the final model trained with 4 attention heads was selected. The hyperparameter setting code is as follows:

[0071] ATTHEADS = 4 # 4 attention heads

[0072] EPOCHS=500 #500 epoch training rounds

[0073] In order to learn the temporal relationship in the gas flow data of the gas pipeline network, this project uses a time fusion decoder. The time fusion decoder uses a series of layers to learn the temporal relationship in the gas flow dataset, including: sequence-to-sequence local enhancement layer, static enrichment layer, temporal self-attention layer, and position feedforward layer.

[0074] In the sequence-to-sequence local enhancement layer, LSTM is used as Encoder and Decoder instead of the standard positional encoding, and appropriate inductive bias is provided for the temporal order of the input. The Cc and Ch context vectors with temporal features from the static covariate encoder are used to initialize the cell state and hidden state of the first LSTM, respectively, to allow static metadata to affect the processing of the current time step.

[0075] Example 7

[0076] like Figure 1 As shown, a method for constructing an intelligent agent for gas loss detection in a gas pipeline network includes all the contents of Example 6. In addition, in S3, quantile prediction is used. Quantile prediction provides a prediction interval for optimizing decision-making and risk management, provides a prediction interval for determining the possible target value range of each prediction layer, and predicts the best and worst case values ​​that the target may adopt. The prediction algorithm is as follows:

[0077]

[0078] The predicted value of each quantile, q quantile, t time point, Step number, f q Prediction model, S i static covariates;

[0079] The loss function takes the sum of all quantile outputs and minimizes its quantile loss. The function expression is as follows:

[0080]

[0081] Among them, y is the true value, is the predicted value, q is the quantile

[0082] In the above embodiments, it should be noted that the construction of the digital twin platform real scene simulation visualization operation environment, the gas pipeline network gas loss detection operation data is integrated into the digital twin platform, the real-time operation of the gas pipeline network is truly displayed on the digital twin platform, and the real-time real scene simulation display of the gas pipeline network gas loss detection is achieved. When gas loss occurs, the gas loss location and leakage situation are displayed in real time on the digital twin platform;

[0083] For the needs of multi-horizon prediction of target values, this project uses quantile prediction. The prediction interval provided by quantile prediction is very useful for optimizing decision-making and risk management. It can provide prediction intervals that determine the possible target value range for each prediction layer, and the prediction of the best and worst case values ​​that the target may take.

[0084]

[0085] The predicted value of each quantile, q quantile, t time point, Number of steps, fq prediction model, Si static covariate.

[0086] Since the project adopts a multi-view prediction strategy, the loss function also sums all quantile outputs to minimize its quantile loss.

[0087]

[0088] Among them, y is the true value, is the predicted value and q is the quantile.

[0089] Through the above steps, we have trained a flow prediction model for gas loss detection. The following figure shows the prediction results of the model on the validation set: the first column is the predicted time, the first two rows are the flow predictions for the near future, and the last two rows are the flow predictions for the long term. The second column Actual is the real data, and the third column Q50 is the predicted median quantile value. It can be seen that the prediction accuracy is relatively high. For the evaluation of the prediction results, if the result value of MAPE (actual value, predicted value) is lower than 10%, it is generally considered that the model has a high prediction accuracy. The prediction result of this model is MAPE: 9.29%.

[0090]

[0091] This model has greatly improved the accuracy and timeliness of gas loss detection compared with previous technical means, helping enterprises reduce and promptly control gas loss, and reduce national energy losses and environmental pollution.

Claims

1. A method for constructing an intelligent agent for gas loss detection in a gas pipeline network, characterized in that: The steps include: S1: Obtain real historical production data and analyze data characteristics through feature engineering; S2: Screen out abnormal points in the historical production data, analyze the abnormal types of the abnormal point data, and mark different abnormal points; S3: Send the analyzed and processed data to the time-fused Transformer model, adjust the parameters, and obtain the gas sales volume; S4: After the sales volume is obtained, it is compared with the threshold value set based on experience. When the upper limit of the threshold is exceeded, the abnormal point recognition algorithm is used to identify gas loss and activate the gas loss alarm; S5: Link with the digital twin platform to display the gas loss location in real time on the digital twin platform.

2. According to claim 1, a method for constructing an intelligent agent for gas loss detection in a gas pipeline network is characterized in that: In S1, the gas usage behavior of the terminal users is analyzed, and the terminal gas users are classified according to the gas usage type using a clustering algorithm.

3. The method for constructing an intelligent agent for gas loss detection in a gas pipeline network according to claim 2, characterized in that: In S1, the data used are historical business data of the gas pipeline network in the past two years. After analyzing the data, a valid data set is formed, and the data is time series data.

4. The method for constructing an intelligent agent for gas loss detection in a gas pipeline network according to claim 1, characterized in that: In S1, when acquiring historical data, a gated residual network GRN is used, and GRN is used to help capture historical data.

5. The method for constructing an intelligent agent for gas loss detection in a gas pipeline network according to claim 1, characterized in that: In S2, static covariates and time-dependent time-varying variables are used to construct a network in the process of analyzing historical production data, and relevant input variables are further selected at each time.

6. The method for constructing an intelligent agent for gas loss detection in a gas pipeline network according to claim 5, characterized in that: Categorical variables such as the year and month set in the code use entity embedding as feature representation, and the input time is used as a continuous variable using linear transformation to further convert each input time data into an n-dimensional vector that matches the dimensions in the subsequent layers.

7. The method for constructing an intelligent agent for gas loss detection in a gas pipeline network according to claim 6, characterized in that: In S3, quantile prediction is used. Quantile prediction provides prediction intervals for optimizing decision-making and risk management, and provides prediction intervals for determining the possible target value range of each prediction layer, and predictions of the best and worst case values ​​that the target may adopt. The prediction algorithm is as follows: Predicted values ​​of each quantile, q quantile, t time point, τ number of steps, f q Prediction model, S i Static covariates.

8. The method for constructing an intelligent agent for gas loss detection in a gas pipeline network according to claim 6, characterized in that: The loss function takes the sum of all quantile outputs and minimizes its quantile loss. The function expression is as follows: Among them, y is the true value, is the predicted value and q is the quantile.