A pipe network leakage risk evaluation and identification method and system and a storage medium

By combining a weighted Naive Bayes model and a fast clustering algorithm, the problem of the inability to quantify the contribution of static and dynamic variables in pipeline leakage detection in existing technologies is solved. This enables accurate prediction and cause localization of pipeline leakage risks, improving the operation and maintenance efficiency and cost-effectiveness of water supply companies.

CN122310283APending Publication Date: 2026-06-30AOTU TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610695222.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-20
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing methods for detecting and assessing pipeline leakage have failed to effectively quantify the contribution of static pipeline attributes and dynamic operating variables, making it difficult to pinpoint the causes of leakage and failing to meet the refined operation and maintenance needs of water supply companies.

Method used

We employ a weighted Naive Bayes model combined with a fast clustering algorithm. By introducing the importance order of expert prior variables, we optimize the weights of static variables and utilize scoring card technology to construct a unified fusion framework. This enables the integration of static leakage probability and dynamic risk scoring to pinpoint the sources of leakage.

Benefits of technology

It enables accurate prediction and quantification of pipeline leakage risks, distinguishes risk levels, and clarifies the causes of leakage, thereby improving operation and maintenance efficiency and reducing costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122310283A_ABST
    Figure CN122310283A_ABST
Patent Text Reader

Abstract

This invention discloses a method, system, and storage medium for assessing and identifying pipeline leakage risks, belonging to the technical field of pipeline leakage detection. First, data acquisition and preprocessing are performed to obtain static and dynamic variables. Based on expert experience, the static variables are ranked from high to low importance. After preprocessing, discretized variables and standardized dynamic variables are obtained. A weighted Naive Bayes model and a fast clustering model are constructed to calculate the leakage probability of the static variables and the leakage risk score of the dynamic variables. Finally, integrated scoring card modeling is performed to calculate the basic leakage probability score and the score for each sub-box. Based on the contribution of each sub-box score, the source of leakage is located. This invention has the advantages of more accurate leakage prediction, quantifiable risk levels, and locable leakage causes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of pipeline leakage detection, specifically relating to a pipeline leakage risk assessment and identification method, system, and storage medium. Background Technology

[0002] Urban water supply networks are large-scale and operate under complex conditions, resulting in significant leakage problems. Existing methods for network leakage detection and health assessment do not uniformly consider static network attributes and dynamic operational variables, making risk quantification difficult and leakage causes ineffective in locating, thus failing to meet the refined and efficient operation and maintenance needs of water supply companies. Specifically, existing methods for network leakage detection and health assessment include:

[0003] (1) A pipeline leakage prediction method based on traditional Naive Bayes, specifically including the following steps:

[0004] 1) Collect static attribute data of the pipeline network, such as pipe age, pipe diameter, burial depth, and pipe material;

[0005] 2) Discretize the variables and directly calculate the prior probability and conditional probability;

[0006] 3) The leakage probability is calculated using the standard Naive Bayes formula;

[0007] 4) Determine the risk level of pipeline leakage based on the probability.

[0008] However, traditional Naive Bayes only uses uniform variable weights and does not consider the expert prior knowledge of the influence of variables such as pipe age, pipe diameter, and burial depth on leakage. In actual engineering, experts can clearly give the order of influence of each static variable on leakage identification (such as the influence of pipe age on leakage is greater than that of pipe diameter), but they cannot quantify the specific influence weight of each variable. This results in the model not fitting the physical mechanism of pipeline leakage, and thus the accuracy of static leakage probability prediction is low.

[0009] (2) Dynamic leakage anomaly identification method based on clustering algorithm: The implementation steps of this scheme are as follows:

[0010] 1) Collect dynamic operating data such as pipeline pressure and flow rate;

[0011] 2) Use traditional clustering algorithms such as K-means for outlier detection;

[0012] 3) Samples that deviate from the cluster center are identified as missing data or anomalies;

[0013] 4) Output the binary classification result of "normal / abnormal".

[0014] However, conventional clustering algorithms only output discrete classification labels. Since they do not quantify the degree of anomaly, they can only determine "whether it is abnormal" and cannot provide continuous risk scores, making it impossible for maintenance personnel to distinguish the level of leakage risk. Secondly, static assessment and dynamic identification lack a unified integration framework. Static pipeline attributes and dynamic operational data cannot be used in conjunction, resulting in one-sided leakage evaluation results with low overall accuracy, which cannot truly reflect the actual leakage status of the pipeline network.

[0015] In summary, existing methods lack the ability to break down the causes of leakage. Because they do not distinguish the contribution of static and dynamic variables, when leakage occurs, it is impossible to determine whether the leakage is caused by inherent defects in the pipeline network (such as aging pipes or inferior pipe materials) or by abnormal operating parameters (such as excessive pressure or flow fluctuations). This leads to low efficiency in cross-departmental investigation, delayed leakage handling, and increased operation and maintenance costs. Summary of the Invention

[0016] The purpose of this invention is to provide a method, system, and storage medium for assessing and identifying pipeline leakage risks, aiming to solve any of the above-mentioned problems.

[0017] This invention is mainly achieved through the following technical solutions:

[0018] A method for assessing and identifying pipeline leakage risks includes the following steps:

[0019] Step S1: Data acquisition and preprocessing;

[0020] Obtain static and dynamic variables, and construct a monitoring data matrix. With missing labels ;

[0021] Then, the static variables are sorted from highest to lowest importance to obtain the static variables. Discretize the data into equal-frequency bins to obtain discretized variables. For dynamic variables Standardization is performed to obtain standardized dynamic variables. ;

[0022] in: For time series indexing;

[0023] For variable index, ;

[0024] ;

[0025] ;

[0026] ;

[0027] ;

[0028] , 1 indicates that leakage occurs at time t. Indicates a normal state;

[0029] Step S2: Based on discretized variables Using Bayes' theorem, a weighted Naive Bayes model is constructed to output the leakage probability of static variables. Among them, the weights of static variables decrease sequentially according to their importance.

[0030] Step S3: Based on standardized dynamic variables Furthermore, a fast clustering algorithm based on density peaks is used to construct a fast clustering model to output a leakage risk score for dynamic variables. ;

[0031] ;

[0032] in: Cluster size;

[0033] For sample t to cluster center The cosine distance;

[0034] Step S4: Based on the leakage probability in step S2 and the leakage risk score in step S3 Perform integrated scoring card modeling and calculate the basic score for leakage probability. ,as well as and The score for each bin; then, based on and The contribution of each sub-box score is used to pinpoint the source of leakage.

[0035] To better implement the present invention, further, in step S1, the standardized dynamic variable... for:

[0036] ;

[0037] in: The first The mean and standard deviation of each dynamic variable.

[0038] To better implement this invention, further, in step S2, the weighted Naive Bayes model is:

[0039] (1)

[0040] (2)

[0041] in: For the first The weights of each static variable;

[0042] For the first The weights of each static variable;

[0043] P This represents the probability of a static variable appearing when leakage occurs.

[0044] P This represents the probability of a static variable occurring under normal conditions.

[0045] The prior probability of leakage occurring;

[0046] This represents the prior probability of the normal state.

[0047] To better realize the present invention, further, in step S2, the weighted Naive Bayes model is optimized by solving the weights:

[0048] A grid search algorithm is used to find the optimal weight combination that minimizes the loss function, based on the constraints of the loss function, by traversing the candidate weight combinations. As the optimal weight ; Optimal weight Substituting into the weighted Naive Bayes model, we obtain the results for all time steps. .

[0049] To better implement this invention, the weight optimization solution further includes the following steps:

[0050] Step A1: Determine the weight search range and step size;

[0051] Step A2: Filter candidate weight combinations based on the constraints of formula (2);

[0052] Step A3: Traverse the candidate weight combinations and substitute them into the weighted Naive Bayes model, and then calculate the loss value based on the loss function;

[0053] Step A4: Compare the loss values ​​of all candidate weight combinations and select the weight combination with the smallest loss value as the optimal weight. .

[0054] To better implement this invention, the loss function is further defined as the cross-entropy loss function L:

[0055] ;

[0056] Where T is the total length of the time series, i.e., the total number of samples.

[0057] To better realize the present invention, step S3 further includes the following steps:

[0058] Step S31: Using a grid search algorithm based on minimizing Gaussian kernel information entropy, determine the optimal cutoff distance. ;

[0059] Step S32: Calculate the decision value To determine cluster centers ;

[0060] ;

[0061] ;

[0062] in: Let be the local density of sample t;

[0063] This represents the degree of separation between sample t and higher density points; if sample t is... The point with the highest local density, then Pick The maximum distance in, otherwise:

[0064] ;

[0065] Let j be the set of samples with a higher density than sample t.

[0066] Let be the local density of sample j;

[0067] For indicator functions If I > 0, then I = 1; otherwise, I = 0.

[0068] Let be the cosine distance between sample t and sample j;

[0069] Step S33: Assign each non-center sample t to the cluster center with the smallest cosine distance. The cluster size is denoted as Then, calculate the leakage risk score. .

[0070] To better realize the present invention, step S4 further includes the following steps:

[0071] Step S41: Calculate the leakage probability in step S2. and the leakage risk score in step S3 Equal-frequency binning was performed separately, and based on leakage labels... Calculate separately and Weight of evidence in each sub-box and Then, respectively using and Complete the variable encoding, replace the original variable values, and the replaced dataset is... ;

[0072] in: Leakage probability The evidence weight of the k-th bin;

[0073] Score the risk of leakage The evidence weight of the k-th bin;

[0074] Step S42: Construct the scorecard;

[0075] (1) with The encoded variable is the input, and the missing label is the input. Using the target variable, construct a binary logistic regression model for leakage.

[0076] ;

[0077] in: For the intercept term;

[0078] These are the regression coefficients for static and dynamic variables, respectively.

[0079] This is a smoothing coefficient, and its value is extremely small; for example, it can be 0.0001.

[0080] For dataset The merged set;

[0081] The WOE encoding result of the weighted Naive Bayes model;

[0082] The WOE coding results for leakage risk scoring;

[0083] (2) Calculate the basic score for leakage probability Then, the score is scaled, and then calculated separately. and Score for each sub-box and ;

[0084] (3)

[0085] (4)

[0086] ;

[0087] ;

[0088] in: Leakage probability The score vector of the kth bin (since there are k bins, each bin has a score, so they can form a k-row, 1-column column vector).

[0089] Score the risk of leakage The score vector of the k-th bin;

[0090] Scaling the score based on the probability of leakage;

[0091] This represents the minimum value of the baseline score for leakage probability.

[0092] This represents the maximum value of the baseline score for leakage probability.

[0093] Step S43: Scaling the score based on the leakage probability When it rises, based on and The contribution of the data is used to attribute the source of leakage.

[0094] This invention is mainly achieved through the following technical solutions:

[0095] A pipeline leakage risk assessment and identification system, based on the above-mentioned pipeline leakage risk assessment and identification method, includes a data acquisition and preprocessing module, a leakage probability assessment module, a leakage risk scoring module, a scoring card integration module, and a leakage location module;

[0096] The data acquisition and preprocessing module is used to acquire static and dynamic variables, construct a monitoring data matrix and leakage labels, and obtain discretized variables and standardized dynamic variables after preprocessing.

[0097] The leakage probability assessment module is used to calculate the leakage probability of static variables based on a weighted Naive Bayes model. The leakage risk scoring module is used to calculate the leakage risk score of dynamic variables based on a fast clustering model. ;

[0098] The scoring card integration module is used to calculate a basic score based on the leakage probability of the scoring card. ,as well as and The score for each sub-box;

[0099] The leakage location module is used for... and The contribution of each bin's score to the source of leakage is attributed.

[0100] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method for assessing and identifying pipeline leakage risks.

[0101] The beneficial effects of this invention are as follows:

[0102] (1) This invention automatically quantifies and optimizes the variable weights of the weighted Naive Bayes model by introducing expert-provided prior constraints on the order of variable importance, thus solving the problem that experts can provide an order of influence but cannot quantify the weights. This invention uses a fast clustering method and transforms the results into a continuous risk score, achieving accurate quantification of dynamic anomalies and facilitating the differentiation of risk levels by maintenance personnel. This invention constructs a unified fusion framework through scoring card technology, integrating static and dynamic variables, and decomposes the causes of leakage through variable contribution analysis, clarifying the sources of leakage. In summary, this invention has the advantages of more accurate leakage prediction, quantifiable risk levels, and locatable causes of leakage.

[0103] (2) This invention uses a weighted Naive Bayes method with expert variable importance order constraints to calculate the static leakage probability of the pipeline network for static variables such as pipe age, pipe diameter, and burial depth. For dynamic variables such as pressure and flow rate, this invention identifies anomalies through rapid clustering and transforms the results into a continuous risk score, thereby quantifying the risk of dynamic operating status. This invention integrates the static leakage probability with the dynamic risk score using scorecard technology to construct a 100-point comprehensive pipeline network leakage score and decomposes the leakage sources based on the contribution of variables. Therefore, this invention can meet the needs of urban water supply network leakage risk assessment and solve the technical problems of traditional weighted Naive Bayes models not considering the differences in variable importance, clustering only outputting discrete labels that cannot quantify risk, static and dynamic variables not being considered uniformly, and the difficulty in distinguishing the causes of leakage. Potential application scenarios of this invention include:

[0104] 1) Daily health monitoring of urban water supply networks. For example, the static attributes (pipe age, pipe diameter, etc.) of all water supply networks in the jurisdiction can be evaluated in batches, and the static leakage probability of each pipe can be output to realize hierarchical management of network health, identify high-risk aging pipes in advance, and reduce the risk of leakage.

[0105] 2) Dynamic operation anomaly identification scenario of water supply network. For example, it can access dynamic monitoring data such as water plant pressure and flow in real time, and quickly cluster and quantify abnormal risks to promptly detect potential leakage phenomena such as sudden pressure drop and abnormal flow fluctuation in the network, so as to achieve rapid early warning of leakage.

[0106] 3) Water supply network leakage investigation and operation and maintenance decision-making scenarios. For example, by using the 100-point comprehensive score and leakage cause decomposition results output by the scorecard integrated model, it can be determined whether the leakage is caused by static network attributes (such as pipe aging, pipe material defects) or dynamic operating parameters (such as abnormal pressure, flow fluctuations). This provides the network maintenance department and water plant operation department with accurate investigation direction, improves the efficiency of leakage handling, and reduces operation and maintenance costs. Attached Figure Description

[0107] Figure 1 This is a flowchart of the pipeline leakage risk assessment and identification method of the present invention. Detailed Implementation

[0108] Example 1:

[0109] A method for assessing and identifying pipeline leakage risks, such as Figure 1 As shown, it includes the following steps:

[0110] Step S1: Data acquisition and preprocessing;

[0111] 1.1. Data Acquisition;

[0112] Obtain static and dynamic variables, and construct a monitoring data matrix. (in For time series indexing, (for variable indexes) and missing labels Among them, static variables are inherent attribute parameters of the pipeline network, while dynamic variables are real-time operating parameters of the pipeline network. Details are as follows:

[0113] 1) Static variables: pipe age, pipe diameter, burial depth, pipe material, etc., which change slowly over time;

[0114] 2) Dynamic variables: pressure, flow rate, flow velocity, etc., which change in real time;

[0115] 3) Missing labels 1 indicates that leakage occurs at time t. This is the normal state.

[0116] For example, the above data can come from the water plant's GIS system, SCADA system, and historical leakage maintenance records.

[0117] 1.2. Data Preprocessing:

[0118] 1) Perform the following steps on static variables in sequence:

[0119] ①Removal of missing and outlier values, where outliers can be identified using the 3σ criterion;

[0120] ② Expert Prior Information Acquisition: Introducing the experience of water experts, the importance order of static variables on leakage is determined, resulting in... :

[0121] ;

[0122] ;

[0123] .

[0124] This order serves as a constraint on the variable weights in the subsequent weighted Naive Bayes model (it should be noted that in real-world scenarios, experts can hardly provide precise numerical values ​​for the weights, but can only provide knowledge of the order of importance of the variables).

[0125] ③ Discretize the variables into equal-frequency bins to obtain discretized variables. It is used for Naive Bayes modeling.

[0126] 2) For dynamic variables Perform standardized processing:

[0127] ;

[0128] in: ;

[0129] The first The mean and standard deviation of each variable.

[0130] Step S2: Based on discretized variables Construct a weighted Naive Bayes model;

[0131] 2.1. Weighted Naive Bayes Model Specification: Based on Discretized Static Variables With Bayes' theorem, leakage probability It can be represented as: (1)

[0132] in: For the first The weights of each static variable;

[0133] P This represents the probability of a static variable appearing when leakage occurs.

[0134] P This represents the probability of a static variable occurring under normal conditions.

[0135] The prior probability of leakage occurring;

[0136] This represents the prior probability of the normal state.

[0137] 2.2. Weight Optimization Solution:

[0138] 1) Definition of loss function (cross-entropy loss):

[0139] ;

[0140] (2)

[0141] Where: T is the total length of the time series, i.e., the total number of samples;

[0142] For the first The weights of each static variable;

[0143] Cross-entropy loss The smaller the value, the better the weight combination. better; better

[0144] Formula (2) is a weighted monotonic constraint generated based on the experience of water experts.

[0145] 2) Solving for the optimal weights using grid search: Under the constraints of formula (2), the grid search algorithm is used to traverse the candidate weight combinations to find the combination that minimizes the cross-entropy loss. Minimum optimal weight combination The specific steps are as follows:

[0146] ① Determine the weight search range and step size: Set the weight search interval as follows: The search step size is set to 0.05;

[0147] ② Generate weight combinations that meet the constraints: Based on formula (2), filter out all candidate weight combinations that meet the conditions. For example, when At that time, only retain Eliminate combinations Invalid combinations;

[0148] ③ Calculate the loss value by iterating through the weight combinations: Substitute each set of candidate weights into the weighted Naive Bayes model to calculate the loss value at all time points. Then, substitute the values ​​into the cross-entropy loss function to calculate the loss value corresponding to this weight combination. ;

[0149] ④ Selecting the optimal weights: Compare the loss values ​​of all candidate weight combinations and select the weight combination with the smallest loss value as the optimal weights. .

[0150] 2.3. Output of static variable leakage probability: Substituting into formula (1), we can calculate the values ​​at all times. , The higher the value, the greater the risk of basic leakage caused by the inherent properties of the pipeline network, which will be used as a static dimension input for the scoring card.

[0151] Step S3: Based on standardized dynamic variables And a fast clustering algorithm based on density peaks is used to construct a fast clustering model to achieve dynamic anomaly identification and continuous conversion of risk scores;

[0152] 3.1. Fast Clustering Model Specification: Based on Standardized Dynamic Variables Construct a fast clustering model using the density peak-based fast clustering algorithm (CFSFDP):

[0153] 1) Calculate the cosine distance matrix. The cosine distance between any sample t and sample j can be expressed as: :

[0154] ;

[0155] 2) Determine the optimal cutoff distance using grid search combined with minimizing Gaussian kernel information entropy. :

[0156] ①In Within the value interval [0,2], construct a candidate distance grid set. (For example: dividing [0,2] into 100 equally spaced parts results in 101 grid points);

[0157] ② For each cutoff distance The local density of sample t is calculated using the Gaussian kernel function. With information entropy :

[0158] ;

[0159] Normalizing the density yields the probability distribution. And calculate information entropy :

[0160] ;

[0161] ;

[0162] Each cutoff distance Each will correspond to one , A smaller value indicates a clearer sample distribution structure and better clustering performance. Minimum usage The optimal cutoff distance is denoted as . ;

[0163] 3) Calculate the local density of sample t. and relative distance :

[0164] ;

[0165] in: For indicator functions, i.e. When I > 0, I = 1; otherwise, I = 0. It reflects the density of sample t;

[0166] This indicates the degree of separation between sample t and higher density points, for the sample set. The point t with the highest local density in the middle, its Pick The maximum distance in; otherwise:

[0167] ;

[0168] in: Let j be the set of samples with a higher local density than sample t.

[0169] Let be the local density of sample j.

[0170] 4) Calculate cluster centers With leakage risk score Based on decision value Select Larger points are used as cluster centers (e.g., two points, corresponding to normal and missed samples respectively); then, for each non-center sample t, it is assigned to the cluster center with the smallest cosine distance. The cluster size (i.e., the number of samples within a cluster) is denoted as: Among them, leakage risk score The cluster center can be determined by the reciprocal of the cluster size and the number of samples t. The product of cosine distances is expressed as:

[0171]

[0172] The higher the value, the higher the degree of abnormality of parameters such as flow rate and pressure, and the greater the risk of dynamic leakage. It will then be used as a dynamic dimension input for the scorecard.

[0173] Step S4: Based on the leakage probability in step S2 and the leakage risk score in step S3 We will conduct integrated scoring card modeling to analyze leakage risk scores and pinpoint leakage sources.

[0174] 4.1 Variable binning and WOE calculation: for leakage probability With leakage risk score Perform equal-frequency binning (e.g., dividing into k bins) based on leakage tags. Calculate separately and Weight of evidence for each sub-box The general calculation formula is as follows:

[0175] ;

[0176] Where: variable f is a variable or variable ,f∈{ };

[0177] Describes the k-th bin of variable f The number of samples 1 (i.e., the number of missed samples);

[0178] Describes the k-th bin of variable f The number of samples with a value of 0 (i.e., normal samples);

[0179] Indicates that variable f is in The number of samples 1 (i.e., the number of missed samples);

[0180] Indicates that variable f is in The number of samples with a value of 0 (i.e., normal samples);

[0181] By binning of variables After completing the variable encoding and replacing the original variable values, the resulting dataset can be denoted as: Where t still represents the time index, f is the variable index, and f∈{ }

[0182] 4.2 Scorecard Construction;

[0183] 1) Logistic regression fitting: Is there any omission when the encoded variable is the input? Using leakage as the target variable, construct a binary logistic regression model for leakage classification:

[0184]

[0185] in: For the intercept term, These are the regression coefficients for static and dynamic variables, respectively. This can be solved using maximum likelihood estimation. (Leakage probability basic score) It can be represented as:

[0186] (3)

[0187] 2) Rating scaling: Scales the base rating. Linear mapping to 0-100 points yields the mapped score. :

[0188] (4)

[0189] Based on formulas (3) and (4), the score for each variable in each bin can be obtained:

[0190]

[0191]

[0192] in:

[0193] express The rating vectors of k bins;

[0194] express The rating vectors of k bins;

[0195] express Evidence weights for k bins of a variable;

[0196] express Evidence weights for k bins of a variable;

[0197] based on and The score vector, also known as the scorecard, represents the overall score; the higher the total score (i.e., the higher the score), the better. The higher the score, the greater the risk of leakage; when the score increases, you can see why the score increased. or This improves the attribution of leakage sources. In actual production, the 5% percentile score of historical leakage samples can be used as a threshold (e.g., 87 points). If a test sample exceeds this threshold, it is considered an outlier.

[0198] Model performance evaluation:

[0199] Based on the actual operation data of the K water plant, and using the operation data of the original method (K-means) of the water plant from June to December 2025 as a benchmark, the operation effect after adopting the present invention from December 2025 to the present is compared and analyzed. Among them, 87 points on the scorecard is the threshold.

[0200] 1. Evaluate the variable definitions;

[0201] Leakage Precision: The percentage of samples that are actually leaking among those identified as leaking abnormalities, reflecting the false detection rate;

[0202] Leakage recall rate: The percentage of real leak samples that are correctly identified as leaking abnormalities, reflecting the false negative rate;

[0203] F1 score: The harmonic mean of precision and recall, which comprehensively measures classification accuracy;

[0204] Missing data attribution accuracy: The proportion of missing data samples that are correctly attributed to the total number of missing data samples.

[0205] 2. Model performance comparison; As shown in Table 1, compared with the pure K-Means method originally used by K Water Plant, the present invention has a significant improvement in the accuracy of leakage anomaly identification and attribution ability.

[0206] Table 1 Comparison of Model Performance

[0207]

[0208] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Any simple modifications or equivalent changes made to the above embodiments based on the technical essence of the present invention shall fall within the protection scope of the present invention.

Claims

1. A method for assessing and identifying pipeline leakage risk, characterized in that, Includes the following steps: Step S1: Data acquisition and preprocessing; Obtain static and dynamic variables, and construct a monitoring data matrix. With missing labels ; Then, the static variables are sorted from highest to lowest importance to obtain the static variables. Discretize the data into equal-frequency bins to obtain discretized variables. For dynamic variables Standardization is performed to obtain standardized dynamic variables. ; in: For time series indexing; For variable index, ; ; ; ; ; , 1 indicates that leakage occurs at time t. Indicates a normal state; Step S2: Based on discretized variables Using Bayes' theorem, a weighted Naive Bayes model is constructed to output the leakage probability of static variables. Among them, the weights of static variables decrease sequentially according to their importance. Step S3: Based on standardized dynamic variables Furthermore, a fast clustering algorithm based on density peaks is used to construct a fast clustering model to output a leakage risk score for dynamic variables. ; ; in: Cluster size; For sample t to cluster center The cosine distance; Step S4: Based on the leakage probability in step S2 and the leakage risk score in step S3 Perform integrated scoring card modeling and calculate the basic score for leakage probability. ,as well as and The score for each bin; then, based on and The contribution of each sub-bin's score is used to pinpoint the source of leakage.

2. The method for assessing and identifying pipeline leakage risk according to claim 1, characterized in that, In step S1, the standardized dynamic variables for: ; in: The first The mean and standard deviation of each dynamic variable.

3. The method for assessing and identifying pipeline leakage risk according to claim 1, characterized in that, In step S2, the weighted Naive Bayes model is: (1) (2) in: For the first The weights of each static variable; For the first The weights of each static variable; P This represents the probability of a static variable appearing when leakage occurs. P This represents the probability of a static variable occurring under normal conditions. The prior probability of leakage occurring; This represents the prior probability of the normal state.

4. The method for assessing and identifying pipeline leakage risk according to claim 3, characterized in that, In step S2, the weighted Naive Bayes model is optimized by solving the weights: A grid search algorithm is used to find the optimal weight combination that minimizes the loss function, based on the constraints of the loss function, by traversing the candidate weight combinations. As the optimal weight ; Optimal weight Substituting into the weighted Naive Bayes model, we obtain the results for all time steps. .

5. The method for assessing and identifying pipeline leakage risk according to claim 4, characterized in that, The weight optimization solution includes the following steps: Step A1: Determine the weight search range and step size; Step A2: Filter candidate weight combinations based on the constraints of formula (2); Step A3: Traverse the candidate weight combinations and substitute them into the weighted Naive Bayes model, then calculate the loss value based on the loss function; Step A4: Compare the loss values ​​of all candidate weight combinations and select the weight combination with the smallest loss value as the optimal weight. .

6. A method for assessing and identifying pipeline leakage risk according to claim 4 or 5, characterized in that, The loss function is the cross-entropy loss function L: ; Where T is the total length of the time series, i.e., the total number of samples.

7. The method for assessing and identifying pipeline leakage risk according to claim 1, characterized in that, Step S3 includes the following steps: Step S31: Using a grid search algorithm based on minimizing Gaussian kernel information entropy, determine the optimal cutoff distance. ; Step S32: Calculate the decision value In order to determine cluster centers ; ; ; in: Let be the local density of sample t; This represents the degree of separation between sample t and higher density points; if sample t is... The point with the highest local density, then Pick The maximum distance in, otherwise: ; Let j be the set of samples with a higher local density than sample t. Let be the local density of sample j; For indicator functions, when If I > 0, then I = 1; otherwise, I = 0. Let be the cosine distance between sample t and sample j; Step S33: Assign each non-center sample t to the cluster center with the smallest cosine distance. The cluster size is denoted as Then, calculate the leakage risk score. .

8. The method for assessing and identifying pipeline leakage risk according to claim 1, characterized in that, Step S4 includes the following steps: Step S41: Calculate the leakage probability in step S2. and the leakage risk score in step S3 Equal-frequency binning was performed separately, and based on leakage labels... Calculate separately and Weight of evidence in each sub-box and Then, respectively using and Complete the variable encoding, replace the original variable values, and the replaced dataset is... ; in: Leakage probability The evidence weight of the k-th bin; Score the risk of leakage The evidence weight of the k-th bin; Step S42: Construct the scorecard; (1) with The encoded variable is the input, and the missing label is the input. Using the target variable, construct a binary logistic regression model for leakage. ; in: For the intercept term; These are the regression coefficients for static and dynamic variables, respectively. For smoothing coefficients; For dataset The merged set; The WOE encoding result of the weighted Naive Bayes model; The WOE coding results for leakage risk scoring; (2) Calculate the basic score for leakage probability Then, the score is scaled, and then calculated separately. and Score for each sub-box and ; (3) (4) ; ; in: Leakage probability The score vector of the k-th bin; Score the risk of leakage The score vector of the k-th bin; Scaling the score based on the probability of leakage; This represents the minimum value of the baseline score for leakage probability. This represents the maximum value of the baseline score for leakage probability. Step S43: Scaling the score based on the leakage probability When it rises, based on and The contribution of the data is used to attribute the source of leakage.

9. A pipeline leakage risk assessment and identification system, implemented based on the pipeline leakage risk assessment and identification method according to any one of claims 1 to 8, characterized in that, It includes a data acquisition and preprocessing module, a leakage probability assessment module, a leakage risk scoring module, a scoring card integration module, and a leakage location module; The data acquisition and preprocessing module is used to acquire static and dynamic variables, construct a monitoring data matrix and leakage labels, and obtain discretized variables and standardized dynamic variables after preprocessing. The leakage probability assessment module is used to calculate the leakage probability of static variables based on a weighted Naive Bayes model. ; The leakage risk scoring module is used to calculate the leakage risk score of dynamic variables based on a fast clustering model. ; The scoring card integration module is used to calculate a basic score based on the leakage probability of the scoring card. ,as well as and The score for each sub-box; The leakage location module is used for... and The contribution of each bin's score to the source of leakage is attributed.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the pipeline leakage risk assessment and identification method according to any one of claims 1-8.