A Dynamic Risk Assessment Method for Long-Distance Heating Pipelines Based on XGBoost and DBN

By combining XGBoost and DBN models, a dynamic risk assessment method was constructed, which solved the problems of subjectivity and staticity in the risk assessment of long-distance heating pipelines, realized dynamic prediction and accurate assessment of pipeline risks, and improved pipeline safety.

CN123069882APending Publication Date: 2026-11-10TAIYUAN UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611247355.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-17
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

Existing risk assessment methods for long-distance heating pipelines lack applicability and suffer from problems such as strong subjectivity in parameter determination, static assessment system, and delayed response to sudden accidents, making it impossible to objectively identify risk factors and make dynamic predictions over time.

Method used

A method combining XGBoost and DBN models is adopted. A standardized feature dataset is constructed through data preprocessing. The feature weights of failure factors are calculated using XGBoost and transformed into prior parameters of a dynamic Bayesian network to construct a dynamic risk assessment model. The maximum a posteriori probability algorithm and the Chepman-Kolmogorov equation are combined for cross-time slice propagation to achieve dynamic risk assessment.

Benefits of technology

It improves the accuracy and objectivity of risk assessment for long-distance heating pipelines, enables dynamic prediction of risk changes, and enhances the safety of the pipeline throughout its entire life cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123069882A_ABST
    Figure CN123069882A_ABST
Patent Text Reader

Abstract

This invention relates to a dynamic risk assessment method for long-distance heating pipelines based on XGBoost and DBN, belonging to the field of heating network safety engineering. It solves the problems of strong subjectivity in parameter determination, static assessment system, and delayed response to sudden accidents in existing Bayesian networks. The method includes the following steps: S1, acquiring data from the long-distance heating pipeline and performing data preprocessing; S2, using the XGBoost model to perform feature mining on the data and objectively calculate the weight distribution of each failure factor; S3, constructing a dynamic Bayesian network model and converting the objective weights from step S2 into prior parameters to establish a coupled assessment model; S4, inputting the latest pipeline detection data, combining the advantages of both models to output the real-time failure probability, and realizing reverse inference of accidents; S5, during the accident repair and recovery period, combining the two models to output the failure probability of the target pipeline. This invention improves the objectivity and accuracy of risk prediction for long-distance heating pipelines.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of heating pipeline safety management technology, specifically to a dynamic risk assessment method for long-distance heating pipelines based on XGBoost and DBN. Background Technology

[0002] Urban district heating is a significant component of energy consumption. Replacing inefficient, decentralized small-scale heating boilers within cities with large-scale, clean heat sources located far away is a crucial technological pathway to achieving low-carbon heating. However, these large-scale clean heat sources are often constrained by resource availability and environmental limitations, and are mostly located far from urban centers, requiring heat to be transported to the city via long-distance pipelines. Therefore, long-distance heating pipelines, as the core infrastructure connecting remote heat sources and urban district heating systems, have significant energy-saving value and public welfare implications in their construction and safe operation.

[0003] In recent years, the construction scale and number of long-distance heating projects have shown an increasing trend. The heating area of ​​long-distance heating networks has been continuously expanding, the transmission distance has been increasing, and the diameter of main pipelines has been continuously enlarging. The transmission distance of a single line has reached 120 kilometers, and the transmission length of projects such as the Danish Triangle Regional Heating Network and the Swiss Lower Aare River Regional Heating Network has also exceeded 100 kilometers. At the same time, the main pipeline network generally adopts a large-diameter design of DN1400 to DN1600, and the continuous improvement of engineering parameters has expanded the heating radius of traditional urban heating pipeline networks, giving long-distance pipelines a significant advantage in the optimized allocation of large-capacity heat energy across regions.

[0004] However, the massive scale of the project and the complex operating conditions also pose severe challenges to the safe operation of long-distance heating pipelines. Long-distance heating pipelines often need to traverse complex and varied geographical environments, crossing plains, rivers, hills, and other natural landforms along the way. Some sections also need to pass through urban underground spaces. The long distance and large area of ​​laying make the boundary conditions of the pipeline network more complex.

[0005] For long-distance oil and gas pipelines, the transported media are mostly flammable and explosive fluids such as crude oil and natural gas. The overall pipeline network spans a large area, and the core focus of safety management is on fluid pressure control and leakage risk prevention. The risk assessment system for long-distance oil and gas pipelines has become relatively mature. Most existing pipeline risk assessment methods are derived from oil and gas pipelines, such as the national standard GB32167-2015 "Integrity Management Specification for Oil and Gas Transmission Pipelines." This standard clearly defines the technical requirements for the entire process, including data acquisition, high-consequence area identification, risk assessment, integrity testing, repair and maintenance, and management review, to guide operators in systematically managing risks and ensuring the long-term safe operation of pipelines.

[0006] For conventional urban heating pipe networks, they often exhibit a localized branching network structure, with relatively low operating pressure and temperature, small pipe diameters, and are primarily laid underground within urban building complexes. The focus of operation management and risk control lies in end-point hydraulic balance regulation and network flow distribution. GB / T44548-2024, "Safety Risk Assessment Method for Urban Heating Pipelines," specifies the basic process, risk identification and analysis methods, risk classification criteria, and control requirements for safety risk assessment of urban heating pipelines. The standard covers the assessment work throughout the entire pipeline operation cycle.

[0007] Compared to the two types of pipelines mentioned above, long-distance heating pipelines combine the characteristics of high pressure, high temperature, long-distance transmission, and complex laying environments. Because the transported medium is high-flow-rate, high-temperature, and high-pressure hot water, the pipelines not only face the risks of geological subsidence and hydraulic impact, but also must withstand long-term thermal stress and thermal fatigue. Simultaneously, the pipeline insulation layer further alters the stress and corrosion boundaries of the pipe body, making the failure mechanism of long-distance heating pipelines more complex. When the mechanical stress or corrosion of the pipeline exceeds the material's tolerance limit, it can easily lead to pipeline rupture accidents, causing significant economic losses and safety risks.

[0008] However, there is still a lack of risk assessment methods applicable to long-distance heating pipelines, and there are few related studies on quantitative risk assessment and dynamic failure prediction of long-distance heating pipelines throughout their entire life cycle.

[0009] Furthermore, from the perspective of risk assessment methods and risk characteristics of long-distance heating pipelines, relevant research on risk assessment of long-distance heating pipelines still faces the following problems:

[0010] (1) The parameter determination of existing Bayesian network models relies on subjective experience, and the assignment of prior probabilities lacks support from historical accident data;

[0011] (2) The existing risk assessment system is mainly based on static assessment and cannot examine the dynamic changes of risk over time during pipeline degradation.

[0012] (3) When faced with sudden incidents such as third-party sabotage, the existing dynamic probability model is slow to respond and lacks accuracy;

[0013] (4) Existing research methods cannot simultaneously achieve objective discovery of risk factors and dynamic prediction over time.

[0014] Therefore, there is an urgent need to propose an analytical method that can objectively quantify the risk weights of multiple factors, has dynamic prediction capabilities, and couples machine learning models and probabilistic reasoning models to improve the accuracy of risk assessment for long-distance heating pipelines. Summary of the Invention

[0015] The main objective of this invention is to overcome the shortcomings of existing technologies and address the problems of subjective parameter determination, static assessment systems, and delayed response to sudden accidents in current risk assessment methods for long-distance heating pipelines. This invention provides a dynamic risk assessment method for long-distance heating pipelines based on XGBoost and DBN.

[0016] The objective of this invention can be achieved through the following technical solutions:

[0017] The dynamic risk assessment method for long-distance heating pipelines based on XGBoost and DBN includes the following steps:

[0018] S1. Data Preprocessing: Obtain historical accident records and multi-source monitoring data of long-distance heating pipelines, preprocess the raw data, and construct a standardized feature dataset;

[0019] S2. Constructing the XGBoost model: Input the standardized feature dataset constructed in step S1 into the XGBoost model for training. Calculate the feature weights of each failure factor using the split gain mechanism built into the XGBoost model. The "failure factors" include corrosion, material and construction defects, operation and maintenance and management errors, third-party damage, unique risks of long-distance pipelines, and natural disasters.

[0020] S3. Construct a dynamic risk assessment model based on DBN network: Transform the feature weights determined in step S2 into prior parameters of dynamic Bayesian network nodes to construct a dynamic risk assessment model that couples machine learning and probabilistic reasoning.

[0021] S4. Obtain the latest inspection data of the target pipeline. The "inspection data" includes the pipeline's current service life, remaining wall thickness, corrosion rate, operating pressure, operating temperature of the heating medium, the interval since the last accident, and the cumulative number of historical failures. Input the data into the dynamic risk assessment model constructed in step S3. The dynamic risk assessment model integrates the XGBoost model's identification data of sudden accidents with the DBN network's dynamic prediction data of corrosion, pipe wall thickness reduction, and continuous damage from material aging to construct a comprehensive failure prediction probability output model. Furthermore, when a high-risk warning is issued by the long-distance heating pipeline system, the probability of occurrence of the basic event is inversely deduced through the maximum a posteriori probability algorithm to output the core cause of failure.

[0022] S5. During the emergency repair and recovery period, the conditional probability propagation mechanism of the DBN network across time slices is used to retain the historical memory of pipeline structural damage. Combined with the dual-model output of the failure probability of the target pipeline, a dynamic risk assessment of long-distance heating pipelines is completed.

[0023] Furthermore, during data preprocessing in step 1, to maximize the preservation of the nonlinear relationships between physical parameters and meet the discrete input requirements of the Bayesian network, step S1 includes the following steps:

[0024] S1-1. To address the issue of missing quantitative parameters in some accident samples in the original data, a K-Nearest Neighbor (KNN) imputation algorithm is introduced. The imputation value is calculated based on a distance-weighted average of the nearest non-missing samples in the feature space. The calculation formula is as follows:

[0025] ;

[0026] in, Let d(x, x) be the weight function. i () represents the Euclidean distance between samples, in meters;

[0027] S1-2. For continuous variables such as corrosion thickness, pipeline service life, operating pressure, remaining pipe wall thickness, and corrosion rate: The K-Means clustering algorithm is introduced to divide the continuous variables into K discrete state clusters. The optimization objective is to minimize the sum of squared errors from the samples within a cluster to the centroid, calculated using the following formula:

[0028] ;

[0029] Among them, S j For the j-th discrete state interval, µ j Let J be the centroid of the sample in the j-th discrete state interval, J be the total squared error loss from the sample to the corresponding centroid in the interval, and K be the total number of discrete state intervals.

[0030] Further, in step S2, the feature weights are calculated using a split gain mechanism based on a second-order Taylor expansion, including the following steps:

[0031] S2-1. Constructing an XGBoost model node splitting information gain evaluation model:

[0032] ;

[0033] In the formula, G L and H L G is the sum of the first and second gradients of the left subtree after the node splits; R and H R λ is the sum of the first and second gradients of the right subtree after node splitting; λ and γ are both regularization penalty coefficients that control the complexity of the tree.

[0034] S2-2. Introduce the second-order Taylor expansion of the loss function into the original objective function of the XGBoost model, and explicitly add L1 / L2 regularization penalty terms for the leaf node weights. The optimized objective function is:

[0035] ;

[0036] Among them, Obj (t) The overall objective loss when training the t-th decision tree; f t (x i ) represents the prediction output of the t-th tree for sample i; γT represents the structure regularization term of the number of leaf nodes T in the decision tree; g i with h i γ and λ are the first and second partial derivatives of the loss function, respectively, and the regularization coefficients are γ and λ.

[0037] Furthermore, the equivalent uniform Dirichlet (BDeu) prior estimation method is introduced to transform the feature weights into prior parameters of the dynamic Bayesian network nodes. Step S3 includes the following steps:

[0038] S3-1. Define the prior hyperparameter α ijk for:

[0039] ;

[0040] Where N' is the set equivalent sample size; q i r is the baseline exposure amount corresponding to the i-th type of risk factor; i The characteristic weight coefficient of the i-th type of risk factor;

[0041] S3-2. Input the data of the long-distance heating pipeline into the dynamic risk assessment model. The updated posterior conditional probability estimation formula based on Bayes' theorem is as follows:

[0042] ;

[0043] In the formula, N ijk N represents the frequency of joint samples in the training dataset where the parent node combination is in state j and the child node is in state k; ij This represents the total frequency of samples where the parent node is in state j.

[0044] Furthermore, in step S4, to address the issue of insufficient accuracy of DBN when encountering unforeseen events such as third-party sabotage, a comprehensive failure prediction probability output model is constructed as follows:

[0045] ;

[0046] In the formula, P XGB (t) represents the probability of a sudden accident thanks to the XGBoost model's nonlinear fitting capability; P DBN (t) represents the stationary probability output by the DBN model based on historical time slice evolution; when encountering sudden disruption, PXGB (t) The sensitive leap dominates the output result, making up for the slow response of DBN; α is the weight balance coefficient.

[0047] Furthermore, in step S4, when reverse-engineering the probability of the occurrence of the basic event, the maximum a posteriori (MAP) algorithm is as follows:

[0048] ;

[0049] In the formula, E fail X is in a known high-risk warning state for the top event. cause The underlying trigger node that leads to failure.

[0050] Furthermore, in step S5, when preserving the historical memory of pipeline structural damage, to address the lack of mathematical correlation and difficulty in considering the changes in operating conditions over time in a single machine learning model, the Chepman-Kolmogorov equation is introduced for cross-time slice propagation, including the following steps: During the accident repair and recovery period or in future multi-step predictions, the state transition propagation mechanism is as follows:

[0051] ;

[0052] In the formula, P(X) k |E0) is the posterior probability of the state at time k, P(X) k |X k-1 ) is the state transition probability matrix.

[0053] The beneficial effects of this invention are as follows: Firstly, this invention objectively calculates the weights of risk factors using the XGBoost model; secondly, this invention constructs a dynamic Bayesian network to achieve dynamic prediction; and finally, it integrates machine learning feature mining and probabilistic causal reasoning to form a coupled evaluation model. This invention solves the problems of strong subjectivity in parameter determination, static evaluation system, and delayed response to sudden accidents in traditional long-distance heating pipeline risk assessment, improving the objectivity and accuracy of risk assessment results and contributing to the safe operation and maintenance of long-distance heating pipelines throughout their entire life cycle. Attached Figure Description

[0054] Figure 1 This is a flowchart of the present invention;

[0055] Figure 2 A schematic diagram of a Bayesian network model for the failure of a long-distance heating pipeline.

[0056] Figure 3 This is a graph showing the probability of occurrence of basic events in reverse engineering a Bayesian network.

[0057] Figure 4 This is a comparison chart of dynamic failure probability predictions for different models in the event of a sudden accident. Detailed Implementation

[0058] To better understand the above-described objects, features, and advantages of the present invention, embodiments of the present invention will be described below with reference to the accompanying drawings and preferred embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0059] like Figure 1 The dynamic risk assessment method for long-distance heating pipelines based on XGBoost and DBN, as shown, includes the following steps:

[0060] S1. Data Preprocessing: Obtain historical accident records and multi-source monitoring data of long-distance heating pipelines, preprocess the raw data, and construct a standardized feature dataset;

[0061] This step S1 specifically includes the following steps:

[0062] S1-1. To address the issue of missing quantitative parameters in some accident samples in the original data, a K-nearest neighbor imputation algorithm is introduced. The imputation value is calculated based on a distance-weighted average of the nearest non-missing sample in the feature space. The calculation formula is as follows:

[0063] ;

[0064] in, Let d(x, x) be the weight function. i () represents the Euclidean distance between samples, in meters;

[0065] S1-2. For continuous variables such as corrosion thickness, pipeline service life, operating pressure, remaining pipe wall thickness, and corrosion rate, the K-Means clustering algorithm is introduced to divide the continuous variables into K discrete state clusters. The optimization objective is to minimize the sum of squared errors from the samples within a cluster to the centroid, calculated as follows:

[0066] ;

[0067] Among them, S j For the j-th discrete state interval, µ j Let J be the centroid of the sample in the j-th discrete state interval, J be the total squared error loss from the sample to the corresponding centroid in the interval, and K be the total number of discrete state intervals.

[0068] S2. Constructing the XGBoost Model: Input the standardized feature dataset constructed in step S1 into the XGBoost model for training, and use the split gain mechanism built into the XGBoost model to calculate the feature weights of each failure factor; this step S2 uses a split gain mechanism based on second-order Taylor expansion to calculate the feature weights, specifically including the following steps:

[0069] S2-1. Constructing an XGBoost model node splitting information gain evaluation model:

[0070] ;

[0071] In the formula, G L and H L G is the sum of the first and second gradients of the left subtree after the node splits; R and H R λ is the sum of the first and second gradients of the right subtree after the node splits; λ and γ are both regularization penalty coefficients that control the complexity of the tree.

[0072] S2-2. Introduce the second-order Taylor expansion of the loss function into the original objective function of the XGBoost model, and explicitly add L1 / L2 regularization penalty terms for the leaf node weights. The optimized objective function is:

[0073] ;

[0074] Among them, Obj (t) The overall objective loss when training the t-th decision tree; f t (x i ) represents the prediction output of the t-th tree for sample i; γT represents the structure regularization term of the number of leaf nodes T in the decision tree; g i with h i γ and λ are the first and second partial derivatives of the loss function, respectively, and the regularization coefficients are γ and λ.

[0075] S3. Constructing a dynamic risk assessment model based on the DBN network: The feature weights determined in step S2 are transformed into prior parameters of the dynamic Bayesian network nodes to construct a dynamic risk assessment model that couples machine learning and probabilistic inference; this step S3 specifically includes the following steps:

[0076] S3-1. Define the prior hyperparameter α ijk for:

[0077] ;

[0078] Where N' is the set equivalent sample size; q i r is the baseline exposure amount corresponding to the i-th type of risk factor; i The characteristic weight coefficient of the i-th type of risk factor;

[0079] S3-2. Input the data of the long-distance heating pipeline into the dynamic risk assessment model. The updated posterior conditional probability estimation formula based on Bayes' theorem is as follows:

[0080] ;

[0081] In the formula, N ijk N represents the frequency of joint samples in the training dataset where the parent node combination is in state j and the child node is in state k; ij This represents the total frequency of samples where the parent node is in state j.

[0082] Furthermore, the posterior conditional probabilities calculated from this constitute the state transition matrix P(X) for subsequent cross-time slice deduction. k |X k-1 After quantifying the network parameters mentioned above, the system can start a multi-step prediction algorithm to deduce the temporal trend of the failure probability of the top event.

[0083] S4. Obtain the latest inspection data of the target pipeline. The inspection data includes the pipeline's current service life, remaining wall thickness, corrosion rate, operating pressure, heating medium operating temperature, interval since the last accident, and cumulative historical failure count. Input this data into the dynamic risk assessment model constructed in step S3. The dynamic risk assessment model integrates the XGBoost model's identification data for sudden accidents with the DBN network's dynamic prediction data for corrosion, pipe wall thickness reduction, and continuous damage from material aging to construct a comprehensive failure prediction probability output model:

[0084] ;

[0085] In the formula, P XGB (t) represents the probability of a sudden accident thanks to the XGBoost model's nonlinear fitting capability; P DBN (t) represents the stationary probability output by the DBN model based on historical time slice evolution; when encountering sudden disruption, P XGB (t) The sensitive leap dominates the output result, making up for the slow response of DBN; α is the weight balancing coefficient;

[0086] Furthermore, when a high-risk warning is issued by a long-distance heating pipeline system, the probability of the underlying event is inversely deduced using the maximum a posteriori probability algorithm to output the core cause of the failure; the maximum a posteriori probability algorithm is as follows:

[0087] ;

[0088] In the formula, E fail X is in a known high-risk warning state for the top event. cause The underlying trigger node that leads to failure.

[0089] S5. During the accident repair and recovery period, the conditional probability propagation mechanism across time slices of the DBN network is utilized to retain the historical memory of pipeline structural damage. Combined with the failure probability of the target pipeline output by the dual-model approach, a dynamic risk assessment of the long-distance heating pipeline is completed. To address the lack of mathematical correlation and difficulty in considering the changes in operating conditions over time in a single machine learning model, the Chepman-Kolmogorov equation is introduced for cross-time slice propagation. That is, the state transition propagation mechanism is as follows:

[0090] ;

[0091] In the formula, P(X) k |E0) is the posterior probability of the state at time k, P(X) k |X k-1 ) is the state transition probability matrix.

[0092] This embodiment uses an accident in a certain area of ​​a long-distance heating pipeline of a certain enterprise as an example to further explain the present invention in detail. The following are the main body data of the pipeline.

[0093] .

[0094] To verify the advantages of the risk assessment model for long-distance heating pipelines constructed in this invention, the proposed XGBoost-DBN coupled model is compared and analyzed with two types of single models, including static Bayesian networks and XGBoost models.

[0095] The study uses historical monitoring data of the target pipeline (2014_DN1600) as an example to evaluate the model's performance in terms of prediction accuracy when facing sudden accidents.

[0096] The first advantage of coupled models is that while machine learning algorithms have high predictive accuracy, they typically only output the final result, lacking mathematical correlation and failing to account for changes in operating conditions over time. Bayesian networks themselves have the ability to inversely deduce underlying events, but under traditional static evaluation, their prior parameters largely rely on subjective experience, resulting in conclusions derived from this inverse deduction often lacking credibility.

[0097] In the coupled model proposed in this invention, the prior probabilities of the Bayesian network are mined from historical accident data by XGBoost, providing data support for both forward prediction and backward deduction of the network.

[0098] Taking the target pipeline (2014_DN1600) as an example, dynamic predictions were made for the next three time steps using pipeline data. The calculation results are shown in Table 2. When a sudden accident occurs in the system at the second time step, the model performs inverse deduction using the maximum a posteriori probability algorithm, calculating that third-party construction damage is the most likely cause of failure, with a corresponding a posteriori probability of 38.67%. This result is consistent with pipeline accident records. Figure 3 As shown.

[0099] .

[0100] The second advantage of the coupled model lies in its ability to effectively handle sudden accidents. Taking the 2014_DN16000 pipeline as an example, in the first time step, the pipeline is under normal operating conditions, and the predicted failure probability output by the coupled model is 0.1957, which is within the safe range. After entering the second time step, the pipeline suffers damage from a third party, and the failure state switches to 1. Faced with this type of sudden accident, if only the dynamic Bayesian network is used, the calculated failure probability only rises to 0.3816 due to its over-reliance on the predictive ability of corrosion, pipe wall thinning, and continuous damage from material aging, which is insufficient in accuracy.

[0101] The XGBoost algorithm, with its nonlinear fitting capabilities, responds rapidly to sudden incidents, with the failure probability of the single model instantly rising to 0.9647. Combining the advantages of both algorithms, the coupled model ultimately outputs a failure probability of 0.6731, effectively capturing this sudden incident. Figure 4 As shown.

[0102] The third advantage lies in the limitation of single machine learning models, which can only perform static assessments at a specific point in time and are unable to calculate the risk changes over time. In the third prediction step, the pipeline enters the emergency repair and recovery phase, external disturbances are eliminated, and the failure state reverts to 0. The XGBoost model, constrained by its reliance on static data at the current time point, calculates a failure probability of 0.0138. However, from an engineering perspective, pipelines that have just experienced external damage often have altered local structural stresses, and a high risk of failure remains in the short term. At this point, the dynamic Bayesian network of the coupled model, through its conditional probability propagation mechanism across time slices, outputs a risk probability of 0.3669, resulting in a final system output failure probability of 0.1903. Figure 4 As shown.

[0103] In summary, this invention addresses the problems of existing risk assessment methods for long-distance heating pipelines, such as strong subjectivity in parameter determination, static assessment systems, and delayed response to sudden accidents. It proposes a dynamic risk assessment method for long-distance heating pipelines based on the XGBoost model and DBN networks. The core of this invention lies in constructing a dynamic risk assessment model that couples machine learning and probabilistic reasoning using extreme gradient boosting trees and dynamic Bayesian networks. First, data from the long-distance heating pipeline is acquired and preprocessed. Next, a failure factor weight calculation method based on the XGBoost split gain mechanism is established, transforming feature weights into objective prior parameters of the dynamic Bayesian network nodes, thus constructing a coupled model. Finally, the latest detection data of the target pipeline is input, and the failure prediction probability, combining the advantages of both algorithms, is output. Furthermore, the probability of occurrence of basic events is inversely deduced using the maximum a posteriori probability algorithm, outputting the core causes of failure and achieving dynamic prediction throughout the entire lifecycle of the long-distance heating pipeline. This invention improves the accuracy of risk assessment for long-distance heating pipelines and contributes to their safe operation.

[0104] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A dynamic risk assessment method for long-distance heating pipelines based on XGBoost and DBN, characterized in that, Includes the following steps: S1. Data Preprocessing: Obtain historical accident records and multi-source monitoring data of long-distance heating pipelines, preprocess the raw data, and construct a standardized feature dataset; S2. Construct the XGBoost model: Input the standardized feature dataset constructed in step S1 into the XGBoost model for training, and use the split gain mechanism built into the XGBoost model to calculate the feature weights of each failure factor. S3. Construct a dynamic risk assessment model based on DBN network: Transform the feature weights determined in step S2 into prior parameters of dynamic Bayesian network nodes to construct a dynamic risk assessment model that couples machine learning and probabilistic reasoning. S4. Obtain the latest inspection data of the target pipeline and input it into the dynamic risk assessment model constructed in step S3. The dynamic risk assessment model integrates the identification data of sudden accidents by the XGBoost model and the dynamic prediction data of corrosion, pipe wall thickness reduction and material performance aging and continuous damage by the DBN network to construct a comprehensive failure prediction probability output model. Furthermore, when a high-risk warning is issued by the long-distance heating pipeline system, the probability of occurrence of the basic event is inversely deduced through the maximum a posteriori probability algorithm to output the core cause of failure. S5. During the emergency repair and recovery period, the conditional probability propagation mechanism of the DBN network across time slices is used to retain the historical memory of pipeline structural damage. Combined with the dual-model output of the failure probability of the target pipeline, a dynamic risk assessment of long-distance heating pipelines is completed.

2. The dynamic risk assessment method for long-distance heating pipelines based on XGBoost and DBN according to claim 1, characterized in that, Step S1 includes the following steps: S1-1. To address the issue of missing quantitative parameters in some accident samples in the original data, a K-nearest neighbor imputation algorithm is introduced. The imputation value is calculated based on a distance-weighted average of the nearest non-missing sample in the feature space. The calculation formula is as follows: ; in, Let d(x, x) be the weight function. i () represents the Euclidean distance between samples, in meters; S1-2. For continuous variables such as corrosion thickness, pipeline service life, operating pressure, remaining pipe wall thickness, and corrosion rate: The K-Means clustering algorithm is introduced to divide the continuous variables into K discrete state clusters. The optimization objective is to minimize the sum of squared errors from the samples within a cluster to the centroid, calculated using the following formula: ; Among them, S j For the j-th discrete state interval, µ j Let J be the centroid of the sample in the j-th discrete state interval, J be the total squared error loss from the sample to the corresponding centroid in the interval, and K be the total number of discrete state intervals.

3. The dynamic risk assessment method for long-distance heating pipelines based on XGBoost and DBN according to claim 1, characterized in that, In step S2, the feature weights are calculated using a split gain mechanism based on a second-order Taylor expansion, including the following steps: S2-1. Constructing an XGBoost model node splitting information gain evaluation model: ; In the formula, G L and H L G is the sum of the first and second gradients of the left subtree after the node splits; R and H R λ is the sum of the first and second gradients of the right subtree after the node splits; λ and γ are both regularization penalty coefficients that control the complexity of the tree. S2-2. Introduce the second-order Taylor expansion of the loss function into the original objective function of the XGBoost model, and explicitly add L1 / L2 regularization penalty terms for the leaf node weights. The optimized objective function is: ; Among them, Obj (t) The overall objective loss when training the t-th decision tree; f t (x i ) represents the prediction output of the t-th tree for sample i; γT represents the structure regularization term of the number of leaf nodes T in the decision tree; g i with h i γ and λ are the first and second partial derivatives of the loss function, respectively, and the regularization coefficients are γ and λ.

4. The dynamic risk assessment method for long-distance heating pipelines based on XGBoost and DBN according to claim 1, characterized in that, Step S3 includes the following steps: S3-1. Define the prior hyperparameter α ijk for: ; Where N' is the set equivalent sample size; q i r is the baseline exposure amount corresponding to the i-th type of risk factor; i The characteristic weight coefficient of the i-th type of risk factor; S3-2. Input the data of the long-distance heating pipeline into the dynamic risk assessment model. The updated posterior conditional probability estimation formula based on Bayes' theorem is as follows: ; In the formula, N ijk N represents the frequency of joint samples in the training dataset where the parent node combination is in state j and the child node is in state k; ij This represents the total frequency of samples where the parent node is in state j.

5. The dynamic risk assessment method for long-distance heating pipelines based on XGBoost and DBN according to claim 1, characterized in that, In step S4, the comprehensive failure prediction probability output model is constructed as follows: ; In the formula, P XGB (t) represents the probability of a sudden accident thanks to the XGBoost model's nonlinear fitting capability; P DBN (t) represents the stationary probability output by the DBN model based on historical time slice evolution; when encountering sudden disruption, P XGB (t) The sensitive leap dominates the output result, making up for the slow response of DBN; α is the weight balance coefficient.

6. The dynamic risk assessment method for long-distance heating pipelines based on XGBoost and DBN according to claim 1, characterized in that, In step S4, the maximum a posteriori probability algorithm is as follows: ; In the formula, E fail X is in a known high-risk warning state for the top event. cause The underlying trigger node that leads to failure.

7. The dynamic risk assessment method for long-distance heating pipelines based on XGBoost and DBN according to claim 1, characterized in that, Step S5 includes the following steps: During the accident repair and recovery period or in future multi-step predictions, the state transition transmission mechanism is as follows: ; In the formula, P(X) k |E0) is the posterior probability of the state at time k, P(X) k |X k-1 ) is the state transition probability matrix.