Gas pipe network fault prediction method and device

By integrating the static, dynamic and deep timing characteristics of the gas pipeline network and using the LightGBM algorithm for iterative calculation and risk assessment, the shortcomings of the gas pipeline network risk assessment in the existing technology are solved, and accurate prediction of fault risks and improvement of pipeline network safety are achieved.

CN119539156APending Publication Date: 2025-02-28SHANDONG SYNTHESIS ELECTRONICS TECH
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411558717.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The existing gas pipeline risk assessment method relies on manual inspection and empirical judgment, making it difficult to discover potential risks in a timely and comprehensive manner. At the same time, the existing machine learning algorithms lack the fusion of time series characteristics and non-time series discrete characteristics of the gas network.

Method used

Feature extraction processing under multiple feature types is adopted, including static attribute features, dynamic attribute features and depth timing features, and feature fusion is performed through the cross attention mechanism. Then, the LightGBM algorithm model is used for iterative calculation and gradient histogram construction, the maximum gain split point is determined, feature prediction is performed, and the risk assessment is finally performed on the fusion feature prediction value.

Benefits of technology

It realizes accurate prediction of gas pipeline failure risks, improves the accuracy and efficiency of fault prediction, and can take timely maintenance and repair measures to reduce risks and improves the safety and reliability of gas pipelines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119539156A_ABST
    Figure CN119539156A_ABST
Patent Text Reader

Abstract

The invention discloses a gas pipe network fault prediction method and equipment, belongs to the technical field of machine learning and data analysis, and is used for solving the technical problem that potential risks are difficult to timely and comprehensively discover due to the fact that an existing gas pipe network risk assessment method mainly depends on manual inspection and experience judgment. The method comprises the following steps: performing feature extraction processing under multiple feature types on preprocessed original data of the gas pipe network to obtain a first feature set; performing fusion weight calculation on the first feature set under a related cross attention mechanism to obtain a fusion feature set; carrying out iterative calculation related to residual error negative gradient on the initialized model, and constructing a gradient histogram; performing gain calculation of splitting points on the sub-tree gradient, and determining a maximum gain splitting point; performing feature prediction on the feature elements in the fusion feature set after multiple rounds of iteration to obtain a fusion feature prediction value; and performing risk assessment on the fusion feature prediction value, and determining the fault risk level of the gas pipe network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of machine learning and data analysis, and in particular to a method and device for predicting gas pipeline network faults. Background Art

[0002] With the acceleration of urbanization, gas, as an important energy source, plays an indispensable role in daily life and industrial production. Therefore, it is of great significance to realize risk assessment of gas pipeline networks.

[0003] Traditional gas pipeline network risk assessment methods mainly rely on manual inspections and empirical judgments, which have many limitations: on the one hand, manual inspections are inefficient and it is difficult to detect potential risks in a timely and comprehensive manner; on the other hand, empirical judgments are highly subjective and the assessment results may be biased. Traditional risk assessment techniques are mostly based on qualitative or semi-qualitative methods, relying on expert judgments, and the factors considered are not detailed enough, lacking accuracy and objectivity. Therefore, accurate and quantitative risk assessment schemes and the construction of reasonable, efficient and strict risk assessment management systems are urgent issues to be addressed. With the emergence of many machine learning algorithms, intelligent risk assessment of gas pipeline networks based on mechanism models and data processing technologies has become a new trend.

[0004] At present, mainstream risk assessment machine learning algorithms such as support vector machines, decision trees, neural networks, random forests, etc. can all achieve modeling of single continuous time variables and multivariate discrete time variables of gas pipeline networks. As the structure of gas pipeline networks becomes more complex and related data becomes more diversified, existing machine learning algorithms lack the fusion processing of gas network time series characteristics and non-time series discrete characteristics, and some algorithms are no longer suitable for large-scale data scenarios. Summary of the invention

[0005] The embodiments of the present application provide a method and device for predicting gas pipeline network faults, which are used to solve the following technical problems: the existing gas pipeline network risk assessment method mainly relies on manual inspection and experience judgment, which makes it difficult to timely and comprehensively discover potential risks; at the same time, the existing machine learning algorithm lacks the fusion processing of gas network time series characteristics and non-time series discrete characteristics.

[0006] The present application embodiment adopts the following technical solutions:

[0007] On the one hand, an embodiment of the present application provides a gas pipeline fault prediction method, including: performing feature extraction processing on the pre-processed gas pipeline raw data under multiple feature types to obtain a first feature set; wherein the multiple feature types include: static attribute features, dynamic attribute features and deep time series features; performing fusion weight calculation on the static attribute features, the dynamic attribute features and the deep time series features in the first feature set under the cross-attention mechanism to obtain a fused feature set; based on the feature elements in the fused feature set and through a preset LightGBM algorithm model, performing iterative calculation on the residual negative gradient of the initialization model, and constructing a gradient histogram; according to the gradient histogram, performing gain calculation on the splitting point of the subtree gradient to determine the maximum gain splitting point; based on the leaf node corresponding to the maximum gain splitting point, performing feature prediction on the feature elements in the fused feature set after multiple rounds of iterations to obtain a fused feature prediction value; performing risk assessment on the fused feature prediction value to determine the fault risk level of the gas pipeline network.

[0008] The embodiment of the present application extracts and classifies relevant features through a large amount of data analysis and comparison, and first integrates static attribute features, dynamic analysis features and deep time series features based on the CA-LightGBM algorithm and then trains and predicts to achieve accurate prediction of the failure probability and risk level of the gas pipeline network, which is finally applied to the gas pipeline network safety risk assessment system.

[0009] In a feasible implementation manner, the pre-processed gas pipeline network raw data is subjected to feature extraction processing under multiple feature types to obtain a first feature set, specifically including: based on the fault features in the gas pipeline network fault sample set, the pipeline static features of the gas pipeline network raw data are extracted to obtain the static attribute features; wherein the static attribute features include: the diameter, age, material, depth, location, qualification of the pipeline design unit, pressure level and interface type of the gas pipeline; based on the fault features in the gas pipeline network fault sample set, the pipeline dynamic features of the gas pipeline network raw data are extracted to obtain the dynamic attribute features; wherein the dynamic attribute features include: the frequency of closed-loop inspections, pipeline dynamic pressure, maintenance record data, whether the pipeline is controlled by an online detection system, meteorological data, surrounding construction data, geological construction data and natural disaster data; through a preset long short-term memory network LSTM, the pipeline dynamic pressure, the maintenance record data and the meteorological data in the dynamic attribute features are subjected to LSTM feature output calculation to obtain the deep time series features.

[0010] In a feasible implementation manner, before performing feature extraction processing on the preprocessed gas pipeline network original data under multiple feature types, the method also includes: completing the gas pipeline network original data through a data interpolation algorithm, and normalizing the data content and data format of the gas pipeline network original data to obtain the preprocessed gas pipeline network original data.

[0011] In a feasible implementation, the static attribute features, the dynamic attribute features, and the deep temporal features in the first feature set are subjected to fusion weight calculation under the cross attention mechanism to obtain a fused feature set, specifically including: determining the deep temporal features as a query sequence; and determining both the static attribute features and the dynamic attribute features as a key-value pair sequence; according to CA=softmax((W q f a )*(W k f b ) T )W v f b , and obtain the fusion feature set CA; where f a is the deep temporal feature after LSTM, f b is an attribute feature including the static attribute feature and the dynamic attribute feature; k represents the static attribute feature and the dynamic attribute feature f b The key and v represent the static attribute characteristics and the dynamic attribute characteristics The value of q is the depth time series feature f a query sequence, softmax is the activation function of the cross attention mechanism, and W q , W k , W v Represent the three weight matrices corresponding to query, key, and value respectively.

[0012] In a feasible implementation, based on the feature elements in the fused feature set, and through the preset LightGBM algorithm model, the initialization model is iteratively calculated on the residual negative gradient, and a gradient histogram is constructed, specifically including: discretizing the feature elements in the fused feature set into multiple buckets to obtain discrete buckets; according to Get the initialization model η0(f) based on the LightGBM algorithm model; where argmin d It means finding the parameter d that minimizes the objective function; To measure the predicted value c and the actual label y i The loss function of the gap between ; i and n are both mathematical constants; according to Get the residual negative gradient g of the i-th characteristic elementi ; Among them, g i Represents the difference between the predicted value and the actual label in the current initialization model; is a mathematical operation symbol; c i is the i-th feature element in the fused feature set; p m-1 (c i ) is the predicted value of the i-th feature element by the initialization model in the m-1th iteration; is the loss function of the i-th feature element; according to Get the kth bin in the discrete bucket under the i-th feature element k The residual negative gradient g i The sum of G jk ;according to Get the kth bucket bin in the discrete bucket under the i-th feature element k The second-order residual negative gradient h i The sum H jk ; Wherein, the second-order residual negative gradient h i is the residual negative gradient g i The second-order gradient of the residual negative gradient g i The sum of G jk And the second-order residual negative gradient h i The sum H jk , construct the gradient histogram.

[0013] In a feasible implementation manner, according to the gradient histogram, the gain of the split point is calculated for the subtree gradient to determine the maximum gain split point, specifically including: according to Get the maximum gain split point gain; where G L is the sum of the residual negative gradient of the left subtree, H L is the sum of the second-order residual negative gradients of the left subtree, G R is the sum of the residual negative gradient of the right subtree, and H R The sum of the second-order residual negative gradients of the right subtree, G total is the sum of the total residual negative gradient of the left and right subtrees, H total is the sum of the total second-order residual gradients of the left and right subtrees; λ is the regularization parameter, and γ is the penalty term for splitting the leaf node.

[0014] In a feasible implementation, based on the leaf node corresponding to the maximum gain splitting point, feature prediction is performed on the feature elements in the fused feature set after multiple rounds of iterations to obtain a fused feature prediction value, specifically including: generating a sub-leaf node of a new tree based on the leaf node corresponding to the maximum gain splitting point; according to pm (c i )=p m-1 (c i )+ητ m (c i ), and the predicted value p of the initialization model for the i-th feature element after the m-th iteration is obtained m (c i ), where p m-1 (c i ) is the predicted value of the initialization model for the i-th feature element after the m-1th iteration, η is the learning rate that controls the contribution weight of the new tree to the final prediction, τ m (c i ) is the output value of the current tree for the i-th feature element, i.e., the leaf node value; c i is the i-th feature element in the fusion feature set; according to The fusion feature prediction value P(x) is obtained, wherein M is the total number of trees in the initialization model, and m and M are both mathematical constants.

[0015] In a feasible implementation, based on the feature elements in the fusion feature set and through the preset LightGBM algorithm model, the initialization model is iteratively calculated on the residual negative gradient, and before the gradient histogram is constructed, the method also includes: according to the proxy function in the preset Bayesian algorithm, the relationship between the hyperparameters in the initialization model and the model evaluation is fitted to determine the optimal hyperparameter combination; wherein the proxy function includes at least: a priori function and an acquisition function; the optimal hyperparameter combination is trained with Gaussian regression data samples based on the priori function, and the corresponding maximum value of the acquisition function is calculated to determine the optimal parameter value that meets the optimal threshold; based on the optimal parameter value, the performance of the initialization model is optimized to obtain the optimal initialization model based on the LightGBM algorithm model.

[0016] In a feasible implementation, a risk assessment is performed on the fused feature prediction value to determine the fault risk level of the gas pipeline network, specifically including: scoring the fault probability of the fused feature prediction value to obtain a fault rate occurrence value; and assessing the risk level of the fault rate occurrence value through a preset risk level assessment matrix to determine the fault risk level of the gas pipeline network.

[0017] On the other hand, an embodiment of the present application also provides a gas pipeline fault prediction device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor so that the at least one processor can execute a gas pipeline fault prediction method described in any of the above embodiments.

[0018] The present application provides a method and device for predicting gas pipeline network faults. Compared with the prior art, the embodiments of the present application have the following beneficial technical effects:

[0019] 1. By considering multiple feature types such as static attribute features, dynamic attribute features, and deep time series features, the state and behavior of the gas pipeline network can be described more comprehensively, and the accuracy of fault prediction can be improved.

[0020] 2. Using the cross-attention mechanism to calculate the fusion weights of different features can better capture the correlation and importance between features and further improve the quality of fused features.

[0021] 3. The LightGBM algorithm is an efficient gradient boosting decision tree algorithm. By iteratively calculating the residual negative gradient and constructing the gradient histogram, it can effectively process large-scale data and improve the training efficiency and prediction performance of the model.

[0022] 4. By calculating the split point gain of the subtree gradient and determining the maximum gain split point, the optimal feature segmentation point can be selected to improve the generalization ability and accuracy of the model.

[0023] 5. Conduct risk assessment on the fusion feature prediction value and determine the fault risk level of the gas pipeline network, which can provide valuable information for the maintenance and management of the pipeline network and help take appropriate measures to reduce risks.

[0024] 6. By accurately predicting the failure risk of the gas pipeline network, maintenance and repair measures can be taken in a timely manner to avoid the occurrence of failures, improve the safety and reliability of the gas pipeline network, and reduce potential safety hazards and economic losses.

[0025] 7. Based on the assessment results of the fault risk level, a more reasonable pipeline network operation and maintenance strategy can be formulated, resources can be allocated reasonably, and the operation efficiency and maintenance effect of the pipeline network can be improved.

[0026] 8. Analysis and prediction based on the pre-processed raw data of the gas pipeline network provides data-driven support for the management and decision-making of the gas pipeline network, which helps to improve the scientificity and accuracy of decision-making. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0028] Figure 1 A flow chart of a gas pipeline network fault prediction method provided in an embodiment of the present application;

[0029] Figure 2 An overall flow chart of gas network fault prediction based on CA-LightGBM provided in the embodiment of the present application;

[0030] Figure 3 A deep time series feature processing flow chart provided in an embodiment of the present application;

[0031] Figure 4 A schematic diagram of the fusion features of a cross-attention mechanism provided in an embodiment of the present application;

[0032] Figure 5 A schematic diagram of the structure of a gas pipeline network fault prediction device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.

[0034] The present application embodiment provides a method for predicting gas pipeline network failures. Figure 1 As shown, the gas pipeline network fault prediction method specifically includes steps S101-S106:

[0035] S101, performing feature extraction processing under multiple feature types on the pre-processed raw data of the gas pipeline network to obtain a first feature set, wherein the multiple feature types include: static attribute features, dynamic attribute features, and deep time series features.

[0036] Specifically, Figure 2 A general flow chart of gas pipeline network fault prediction based on CA-LightGBM is provided in the embodiment of the present application, such as Figure 2As shown, it is necessary to first use a temporary interpolation algorithm to complete the original data of the gas pipeline network, and to normalize the data content and data format of the original data of the gas pipeline network to obtain the preprocessed original data of the gas pipeline network.

[0037] In one embodiment, Figure 2 As shown in Figure 1, the original data of the gas pipeline network includes basic pipeline attribute information, gas company maintenance and inspection record information, and third-party damage factor information. The original gas pipeline network data is supplemented using the interpolation method, and the data content and format are cleaned and standardized.

[0038] Furthermore, based on the fault features in the gas pipeline network fault sample set, the original data of the gas pipeline network is processed to extract the static features of the pipeline to obtain static attribute features. The static attribute features include: the diameter, age, material, depth, location, qualification of the pipeline design unit, pressure level and interface type of the gas pipeline.

[0039] Furthermore, based on the fault characteristics in the gas pipeline network fault sample set, the dynamic characteristics of the pipeline are extracted and processed from the original data of the gas pipeline network to obtain dynamic attribute characteristics. Among them, the dynamic attribute characteristics include: the frequency of closed-loop inspections, pipeline dynamic pressure, maintenance record data, whether the pipeline is controlled by the online detection system, meteorological data, surrounding construction data, geological construction data and natural disaster data.

[0040] Further, Figure 3 A deep time series feature processing flow chart provided in an embodiment of the present application is as follows: Figure 3 As shown, through the preset long short-term memory network LSTM, the pipeline dynamic pressure, maintenance record data and meteorological data in the dynamic attribute features are calculated by LSTM feature output to obtain deep time series features.

[0041] Table 1 Gas pipeline network original data attribute table

[0042]

[0043] In one embodiment, Table 1 is a gas network raw data attribute table. As shown in Table 1, features are extracted from the gas network raw data, and a feature set F{f1, f2, ..., f 18 ,f 19,L}, where L is a label, indicating whether the gas pipeline network has a fault. Data preprocessing and feature set construction are performed on the faults caused by all factors to obtain a fault sample set R caused by a certain type of factor. The elements f1,...,f8 in the feature set F are pipeline static attribute features, including the diameter, age, material, depth, location, design unit qualification, pressure level, and interface type of the gas pipeline; the elements f9,...,f 16 It is the pipeline dynamic analysis feature, covering the gas company's maintenance inspection record information and third-party damage factor information, including the frequency of a closed-loop inspection, pipeline dynamic pressure, maintenance record data, whether the pipeline is controlled by an online detection system, as well as meteorological data, surrounding construction data, geological construction data, and natural disaster data. 17 、f 18 、f 19 The pipeline pressure, meteorological data, and maintenance record data are used as the input of the long short-term memory network LSTM and extracted to obtain deep time series features.

[0044] S102, calculating the fusion weights of the static attribute features, dynamic attribute features, and deep temporal features in the first feature set under the cross-attention mechanism to obtain a fused feature set.

[0045] It should be noted that the cross-attention mechanism is used to fuse deep time series features with static attribute features and dynamic analysis features. By calculating the attention weight, the correlation between deep time series features and other features is learned to better capture the features in the static data, dynamic data and time series data of the gas pipeline network, and improve the model performance and generalization ability. The principle of the cross-attention mechanism is:

[0046] Specifically, it is necessary to first determine the deep temporal features as a query sequence, and determine both the static attribute features and the dynamic attribute features as a key-value pair sequence.

[0047] Further, Figure 4 A schematic diagram of the fusion features of a cross-attention mechanism provided in an embodiment of the present application, such as Figure 4 As shown, two embedding sequences with different element features of the same dimension are combined asymmetrically, and one sequence is used as the query Q input, and the other sequence is used as the key K and value V input, that is, according to CA = softmax ((W q f a )*(W k f b ) T )W v f b , and obtain the fusion feature set CA. Among them, f ais the deep time series feature after LSTM, f b is an attribute feature that includes static attribute features and dynamic attribute features. k represents the static attribute features and dynamic attribute features f b The keys and v represent the static attribute characteristics and dynamic attribute characteristics f b The value of q is the deep temporal feature f a query sequence, softmax is the activation function of the cross attention mechanism, and W q , W k , W v Represent the three weight matrices corresponding to query, key, and value respectively. Finally, a feature set containing 48 feature elements is obtained through cross attention fusion.

[0048] {f 17,1 ,...f 17,16 ,...f 18,1 ,...,f 18,16 ,...f 19,1 ,...,f 19,16 ,L}, the dimension is reconstructed as the feature set CA{c1,c2,...,c 47 ,c 48 ,L}.

[0049] As a feasible implementation method, Figure 4 As shown in the figure, during the fusion process, the deep time series features after LSTM are used as the query sequence, and the static attribute features and dynamic attribute features extracted from the original data of the gas pipeline are used as the key-value pair sequence. By calculating the attention weight between the query sequence and the key-value pair sequence, the correlation degree between different features is systematically modeled.

[0050] S103. Based on the feature elements in the fusion feature set and through the preset LightGBM algorithm model, the initialization model is iteratively calculated on the residual negative gradient, and a gradient histogram is constructed.

[0051] It should be noted that LightGBM is a distributed gradient boosting framework based on an ensemble learning algorithm. The algorithm uses decision trees as weak learners, reduces errors faster by adopting a leaf-wise strategy, and supports a variety of parallel and distributed computing methods.

[0052] Specifically, the feature elements in the fusion feature set are discretized into multiple buckets to obtain discrete buckets. i (i=1,...,19) is discretized into multiple buckets (bins) for subsequent creation of histograms, denoted as bin1, bin2,...bin k .

[0053] Furthermore, the initialization model η0(f) is usually the mean of all sample labels: according to Get the initialization model η0(f) based on the LightGBM algorithm model. Among them, argmin d It means finding the parameter d that minimizes the objective function; To measure the predicted value c and the actual label y i The loss function of the gap between them; i and n are both mathematical constants.

[0054] Furthermore, an iterative training strategy is adopted to calculate the residual negative gradient of the model in the mth round: Get the residual negative gradient g of the i-th characteristic element i Among them, g i Represents the difference between the predicted value and the actual label in the current initialization model; is a mathematical operation symbol; c i is the i-th feature element in the fusion feature set; p m-1 (c i ) is the predicted value of the initialization model for the i-th feature element in the m-1th iteration; is the loss function of the i-th feature element.

[0055] Furthermore, it is necessary to accumulate the gradient and second-order gradient of each feature into the corresponding bucket, calculate the sum of the gradient of each bucket and the sum of the second-order gradient, and complete the construction of the histogram: Get the kth bucket bin in the discrete bucket under the i-th feature element k The residual negative gradient g i The sum of G jk .according to Get the kth bucket bin in the discrete bucket under the i-th feature element k The second-order residual negative gradient h i The sum H jk Among them, the second-order residual negative gradient h i is the residual negative gradient g i The second-order gradient of .

[0056] Furthermore, based on the residual negative gradient g i The sum of G jk And the second-order residual negative gradient h i The sum H jk , and construct a gradient histogram.

[0057] S104: Calculate the gain of the split point of the subtree gradient according to the gradient histogram to determine the maximum gain split point.

[0058] Specifically, the gain of each possible split point is calculated to obtain the split point with the maximum gain. The gain calculation formula is: Get the maximum gain split point gain. Among them, G L is the sum of the residual negative gradient of the left subtree, H L is the sum of the second-order residual negative gradient of the left subtree, G R is the sum of the residual negative gradient of the right subtree, and H R The sum of the second-order residual negative gradients of the right subtree, G total is the sum of the total residual negative gradient of the left and right subtrees, H total is the sum of the total second-order residual gradients of the left and right subtrees; λ is the regularization parameter, and γ is the penalty term for splitting the leaf node.

[0059] S105 . Based on the leaf node corresponding to the maximum gain splitting point, feature prediction is performed on the feature elements in the fused feature set after multiple rounds of iterations to obtain a fused feature prediction value.

[0060] Specifically, based on the leaf node corresponding to the maximum gain split point, the sub-leaf node of the new tree is generated.

[0061] Further, the leaf node value of the new tree is used to update the predicted value of each sample: according to p m (c i )=p m-1 (c i )+ητ m (c i ), and the predicted value p of the initialization model for the i-th feature element after the m-th iteration is obtained m (c i ). Among them, p m-1 (c i ) is the predicted value of the model for the i-th feature element after the initialization model after the m-1th iteration, η is the learning rate that controls the contribution weight of the new tree to the final prediction, τ m (c i ) is the output value of the current tree for the i-th feature element, i.e., the leaf node value; c i is the i-th feature element in the fusion feature set.

[0062] Further, according to The fused feature prediction value P(x) is obtained, where M is the total number of trees in the initialization model, and m and M are both mathematical constants. That is, the cumulative prediction value of all trees is finally calculated by the fused feature prediction value P(x) to achieve efficient prediction of the fused features by the LightGBM algorithm model.

[0063] As a feasible implementation method, Figure 2As shown in the figure, according to the proxy function in the preset Bayesian algorithm, the relationship between the hyperparameters in the initialization model and the model evaluation is fitted to determine the best hyperparameter combination. Among them, the proxy function at least includes: a priori function and an acquisition function; the best hyperparameter combination is trained with Gaussian regression data samples based on the priori function, and the maximum value of the corresponding acquisition function is calculated to determine the optimal parameter value that meets the optimal threshold. Based on the optimal parameter value, the performance of the initialization model is optimized to obtain the optimal initialization model based on the LightGBM algorithm model.

[0064] In one embodiment, Figure 2 As shown, in order to obtain the best initialization model performance, this embodiment uses Bayesian optimization to perform parameter tuning on the LightGBM model. Various proxy functions are used to fit the relationship between hyperparameters and model evaluation, and the most promising hyperparameter combination is selected for iteration, and finally the best hyperparameter combination is obtained. Bayesian optimization consists of a prior function (PF) and an acquisition function (AC). The PF process uses Gaussian process regression to train data and learn the posterior distribution of the objective function. AC is mainly responsible for balancing the exploration and utilization process. The specific process is as follows:

[0065] 1) Initialize the LightGBM model and randomly generate initial training sample points;

[0066] 2) Using Gaussian process regression to train data based on prior functions;

[0067] 3) Calculate the maximum value of the acquisition function AC;

[0068] 4) Perform threshold judgment on the maximum value. If the condition is met, output the optimal parameter value. Otherwise, return to step 2 for further iterative optimization.

[0069] S106. Perform risk assessment on the fused feature prediction value to determine the fault risk level of the gas pipeline network.

[0070] Specifically, the fusion feature prediction value is scored for the probability of failure to obtain a failure rate value. The failure rate value is evaluated for risk level through a preset risk level assessment matrix to determine the failure risk level of the gas pipeline network.

[0071] In one embodiment, Figure 2As shown in the figure, the main parameters of the LightGBM algorithm model, max_depth, num_leaves, learning_rate, n_estimators and early_stopping_rounds, are set. P is the final output value of the fault prediction model, that is, the fusion feature prediction value. Then, according to the output fusion feature prediction value, the risk level is assessed using the risk level assessment matrix. Finally, after the algorithm module outputs the calculation result, the result output module processes the result and outputs it to obtain the fault risk level of the gas pipeline network.

[0072] In addition, the present application also provides a gas network fault prediction device, such as Figure 5 As shown, the gas pipeline network fault prediction device 500 specifically includes:

[0073] At least one processor 501. And a memory 502 in communication with the at least one processor 501. The memory 502 stores instructions that can be executed by the at least one processor 501, so that the at least one processor 501 can execute:

[0074] Performing feature extraction processing under multiple feature types on the preprocessed gas pipeline network raw data to obtain a first feature set; wherein the multiple feature types include: static attribute features, dynamic attribute features and deep time series features;

[0075] The static attribute features, dynamic attribute features and deep temporal features in the first feature set are subjected to fusion weight calculation under the cross-attention mechanism to obtain a fused feature set;

[0076] Based on the feature elements in the fusion feature set and through the preset LightGBM algorithm model, the initialization model is iteratively calculated for the residual negative gradient and a gradient histogram is constructed;

[0077] According to the gradient histogram, the gain of the split point of the subtree gradient is calculated to determine the maximum gain split point;

[0078] Based on the leaf nodes corresponding to the maximum gain splitting point, feature prediction is performed on the feature elements in the fused feature set after multiple rounds of iterations to obtain the fused feature prediction value;

[0079] Conduct risk assessment on the fused feature prediction values ​​to determine the fault risk level of the gas pipeline network.

[0080] The embodiment of the present application can more comprehensively describe the state and behavior of the gas pipeline network and improve the accuracy of fault prediction by considering multiple feature types such as static attribute features, dynamic attribute features and deep time series features. By iteratively calculating the residual negative gradient and constructing the gradient histogram, large-scale data can be effectively processed and the training efficiency and prediction performance of the model can be improved. Risk assessment of the fused feature prediction value and determination of the fault risk level of the gas pipeline network can provide valuable information for the maintenance and management of the pipeline network and help take corresponding measures to reduce the risk. By accurately predicting the fault risk of the gas pipeline network, maintenance and repair measures can be taken in time to avoid the occurrence of faults, improve the safety and reliability of the gas pipeline network, and reduce potential safety hazards and economic losses. According to the evaluation results of the fault risk level, a more reasonable pipeline operation and maintenance strategy can be formulated, resources can be reasonably allocated, and the operation efficiency and maintenance effect of the pipeline network can be improved.

[0081] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0082] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0083] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the embodiments of the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present application should be included in the scope of the claims of the present application.

Claims

1. A method for predicting gas pipeline network faults, characterized in that: The method comprises: Performing feature extraction processing under multiple feature types on the preprocessed gas pipeline network raw data to obtain a first feature set; wherein the multiple feature types include: static attribute features, dynamic attribute features and deep time series features; Calculate the fusion weights of the static attribute features, the dynamic attribute features, and the deep temporal features in the first feature set under the cross-attention mechanism to obtain a fused feature set; Based on the feature elements in the fusion feature set, and through the preset LightGBM algorithm model, the initialization model is iteratively calculated on the residual negative gradient, and a gradient histogram is constructed; According to the gradient histogram, the gain of the splitting point is calculated for the subtree gradient to determine the maximum gain splitting point; Based on the leaf node corresponding to the maximum gain splitting point, feature prediction is performed on the feature elements in the fused feature set after multiple rounds of iterations to obtain a fused feature prediction value; A risk assessment is performed on the fusion feature prediction value to determine the fault risk level of the gas pipeline network.

2. A method for predicting gas pipeline network failure according to claim 1, characterized in that: The pre-processed raw data of the gas pipeline network is subjected to feature extraction processing under multiple feature types to obtain a first feature set, which specifically includes: Based on the fault features in the gas pipeline network fault sample set, the static features of the pipeline are extracted and processed from the original data of the gas pipeline network to obtain the static attribute features; wherein the static attribute features include: the diameter, age, material, depth, location, qualification of the pipeline design unit, pressure level and interface type of the gas pipeline; Based on the fault features in the gas pipeline network fault sample set, the pipeline dynamic features are extracted and processed from the original data of the gas pipeline network to obtain the dynamic attribute features; wherein the dynamic attribute features include: the frequency of closed-loop inspection, pipeline dynamic pressure, maintenance record data, whether the pipeline is controlled by an online detection system, meteorological data, surrounding construction data, geological construction data and natural disaster data; Through the preset long short-term memory network LSTM, the pipeline dynamic pressure, the maintenance record data and the meteorological data in the dynamic attribute features are subjected to LSTM feature output calculation to obtain the deep time series features.

3. A method for predicting gas pipeline network failure according to claim 2, characterized in that: Before performing feature extraction processing under multiple feature types on the preprocessed gas pipeline network raw data, the method further includes: The raw data of the gas pipeline network are completed by using a temporary interpolation algorithm for data, and the raw data of the gas pipeline network are normalized in terms of data content and data format to obtain the preprocessed raw data of the gas pipeline network.

4. A method for predicting gas pipeline network failure according to claim 1, characterized in that: The static attribute features, the dynamic attribute features, and the deep temporal features in the first feature set are subjected to fusion weight calculation under the cross-attention mechanism to obtain a fused feature set, specifically including: Determine the deep temporal features as a query sequence; and determine both the static attribute features and the dynamic attribute features as a key-value pair sequence; According to CA = softmax((W q f a )*(W k f b ) T )W v f b , and obtain the fusion feature set CA; where f a is the deep temporal feature after LSTM, f b is an attribute feature including the static attribute feature and the dynamic attribute feature; k represents the static attribute feature and the dynamic attribute feature f b The key and v represent the static attribute characteristics and the dynamic attribute characteristics The value of q is the depth temporal feature f a query sequence, softmax is the activation function of the cross attention mechanism, and W q , W k , W v Represent the three weight matrices corresponding to query, key, and value respectively.

5. A method for predicting gas pipeline network failure according to claim 1, characterized in that: Based on the feature elements in the fusion feature set, and through the preset LightGBM algorithm model, the initialization model is iteratively calculated for the residual negative gradient, and a gradient histogram is constructed, specifically including: Discretize the feature elements in the fused feature set into multiple buckets to obtain discrete buckets; according to Get the initialization model η0(f) based on the LightGBM algorithm model; where argmin d It means finding the parameter d that minimizes the objective function; To measure the predicted value c and the actual label y i The loss function of the gap between them; i and n both represent mathematical constants; according to Get the residual negative gradient g of the i-th characteristic element i ; Among them, g i Represents the difference between the predicted value and the actual label in the current initialization model; is a mathematical operation symbol; c i is the i-th feature element in the fused feature set; p m-1 (c i ) is the predicted value of the i-th feature element by the initialization model in the m-1th iteration; is the loss function of the i-th feature element; according to Get the kth bin in the discrete bucket under the i-th feature element k The residual negative gradient g i The sum of G jk ;according to Get the kth bin in the discrete bucket under the i-th feature element k The second-order residual negative gradient h i The sum H jk ; Wherein, the second-order residual negative gradient h i is the residual negative gradient g i The second-order gradient of Based on the residual negative gradient g i The sum of G jk And the second-order residual negative gradient h i The sum H jk , construct the gradient histogram.

6. A method for predicting gas pipeline network faults according to claim 1, characterized in that: According to the gradient histogram, the gain of the split point is calculated for the subtree gradient to determine the maximum gain split point, which specifically includes: according to Get the maximum gain split point gain; where G L is the sum of the residual negative gradient of the left subtree, H L is the sum of the second-order residual negative gradients of the left subtree, G R is the sum of the residual negative gradient of the right subtree, and H R The sum of the second-order residual negative gradients of the right subtree, G total is the sum of the total residual negative gradient of the left and right subtrees, H total is the sum of the total second-order residual gradients of the left and right subtrees; λ is the regularization parameter, and γ is the penalty term for splitting the leaf node.

7. A method for predicting gas pipeline network failure according to claim 1, characterized in that: Based on the leaf node corresponding to the maximum gain splitting point, feature prediction is performed on the feature elements in the fused feature set after multiple rounds of iterations to obtain a fused feature prediction value, specifically including: Generate the sub-leaf nodes of the new tree based on the leaf nodes corresponding to the maximum gain split point; According to p m (c i )=p m-1 (c i )+ητ m (c i ), and the predicted value p of the initialization model for the i-th feature element after the m-th iteration is obtained m (c i ), where p m-1 (c i ) is the predicted value of the initialization model for the i-th feature element after the m-1th iteration, η is the learning rate that controls the contribution weight of the new tree to the final prediction, τ m (c i ) is the output value of the current tree for the i-th feature element, i.e., the leaf node value; c i is the i-th feature element in the fused feature set; according to The fusion feature prediction value P(x) is obtained, wherein M is the total number of trees in the initialization model, and m and M are both mathematical constants.

8. A method for predicting gas pipeline network faults according to claim 1, characterized in that: Based on the feature elements in the fusion feature set and through the preset LightGBM algorithm model, the initialization model is iteratively calculated about the residual negative gradient, and before the gradient histogram is constructed, the method also includes: According to the proxy function in the preset Bayesian algorithm, the relationship between the hyperparameters in the initialization model and the model evaluation is fitted to determine the best hyperparameter combination; wherein the proxy function at least includes: a priori function and acquisition function; Performing Gaussian regression data sample training based on the prior function on the optimal hyperparameter combination, and calculating the maximum value of the corresponding acquisition function to determine the optimal parameter value that meets the optimal threshold; Based on the optimal parameter values, the performance of the initialization model is optimized to obtain the optimal initialization model based on the LightGBM algorithm model.

9. A method for predicting gas pipeline network failure according to claim 1, characterized in that: Perform risk assessment on the fusion feature prediction value to determine the fault risk level of the gas pipeline network, specifically including: Performing a scoring process on the fusion feature prediction value for the probability of failure to obtain a failure rate occurrence value; The risk level of the failure rate occurrence value is assessed through a preset risk level assessment matrix to determine the failure risk level of the gas pipeline network.

10. A gas pipeline network fault prediction device, characterized in that: The device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, so that the at least one processor can execute a gas pipeline network fault prediction method according to any one of claims 1-9.

Citation Information

Cited By

  • Pipeline safety assessment method, equipment and medium

    CN120626982A

  • Urban gas pipeline risk prediction method and device, electronic equipment and medium

    CN120974457A

  • Pipe gallery gas pipeline defect identification method and system and inspection robot

    CN121388942A