Natural gas pipeline leakage probability calculation method and system based on genetic algorithm
Through a method based on genetic algorithm, coupled with the dynamic stress, material fatigue and corrosion damage model of pipeline structure, the problem of failure to fully consider the coupling effect of multiple factors in the existing technology is solved, and the accuracy and timeliness of the assessment of leakage risk in natural gas pipelines is improved.
Patent Information
- Application Number
- CN202510246830.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2045-03-04
AI Technical Summary
The existing natural gas pipeline leakage probability calculation method fails to fully consider the coupling effect between factors such as pipeline structural stress, material fatigue and environmental corrosion, resulting in a large deviation from the actual situation, and a lack of an adaptive optimization mechanism, which reduces the accuracy and timeliness of risk assessment.
Using a genetic algorithm-based method, a dynamic stress model of pipeline structure, a material fatigue model and corrosion damage model are established by collecting pipeline operation parameters, and coupled analysis is performed to obtain a risk assessment parameter matrix. Then, genetic algorithms are used to optimize risk assessment parameters, establish a pipeline leakage probability calculation model, and conduct real-time risk assessment.
It improves the accuracy and reliability of pipeline leakage risk assessment, and can more comprehensively consider various damage factors of pipelines during service, which enhances the objectivity and timeliness of assessment results.
Smart Images

Figure CN120125035A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to probability calculation technology, and particularly to a method and system for calculating the leakage probability of natural gas pipelines based on genetic algorithms. Background Art
[0002] At present, the scale of natural gas pipeline networks is constantly expanding, the operating environment is becoming increasingly complex, and pipeline leakage accidents occur from time to time. Pipeline leakage risk assessment is an important means to ensure the safe operation of pipelines, and its core is to accurately calculate the pipeline leakage probability. Traditional methods for calculating pipeline leakage probability are mainly based on historical data statistics and expert experience judgment, and a simple mathematical model is established to predict pipeline leakage risk.
[0003] The existing methods for calculating the leakage probability of natural gas pipelines have the following deficiencies: First, the existing methods often analyze factors such as pipeline structural stress, material fatigue, and environmental corrosion separately, without fully considering the coupling effect between various factors, resulting in a large deviation between the calculation results and the actual situation. Second, traditional methods rely too much on expert experience when establishing a risk assessment model, with strong subjectivity, and it is difficult to accurately reflect the risk change law under the actual operating state of the pipeline. Third, the existing calculation methods lack an adaptive optimization mechanism and cannot dynamically adjust model parameters according to real-time monitoring data, reducing the accuracy and timeliness of risk assessment.
[0004] In order to overcome the above technical problems, it is necessary to develop a new method for calculating pipeline leakage probability, which should be able to comprehensively consider the coupling effect of various influencing factors, establish an objective risk assessment model, and have an adaptive optimization ability, so as to improve the accuracy and reliability of pipeline leakage risk assessment. Summary of the Invention
[0005] The embodiments of the present invention provide a method and system for calculating the leakage probability of natural gas pipelines based on genetic algorithms, which can solve the problems in the prior art.
[0006] In the first aspect of the embodiments of the present invention, A method for calculating the leakage probability of natural gas pipelines based on genetic algorithms is provided, including: Collecting the operating parameters of the natural gas pipeline, where the operating parameters include the pressure difference inside and outside the pipeline, the pipeline wall temperature gradient, the real-time change value of the pipeline wall thickness, the stress-strain curve of the pipeline material, the pipeline service fatigue period, the soil corrosion activity, and the environmental medium permeability; establishing a pipeline structural dynamic stress model according to the pressure difference inside and outside the pipeline, the pipeline wall temperature gradient, and the real-time change value of the pipeline wall thickness; establishing a material fatigue model according to the stress-strain curve of the pipeline material and the pipeline service fatigue period; constructing a corrosion damage model according to the soil corrosion activity and the environmental medium permeability; Couple the dynamic stress model of the pipeline structure, the material fatigue model, and the corrosion damage model for analysis to obtain a first risk assessment parameter matrix, where the first risk assessment parameter matrix includes stress distribution parameters, fatigue damage parameters, and corrosion rate parameters; establish an initial model for pipeline leakage risk assessment based on the first risk assessment parameter matrix; use the initial model for pipeline leakage risk assessment as a fitness function; encode the stress distribution parameters, the corrosion rate parameters, and the material deterioration parameters in the first risk assessment parameter matrix as chromosomes, and perform operations on the chromosomes to obtain an offspring population; Calculate the fitness values of each chromosome in the offspring population based on the fitness function, select the chromosome with the highest fitness value, and decode the chromosome with the highest fitness value to obtain a second risk assessment parameter matrix; establish a pipeline leakage probability calculation model based on the second risk assessment parameter matrix; collect the operating parameters of the target pipeline section; input the operating parameters of the target pipeline section into the pipeline leakage probability calculation model to obtain a third risk assessment parameter matrix for the target pipeline section; calculate the predicted leakage probability value of the target pipeline section based on the third risk assessment parameter matrix; divide the risk level of the target pipeline section according to the predicted leakage probability value, and generate a pipeline leakage risk distribution map.
[0007] The coupling analysis of the dynamic stress model of the pipeline structure, the material fatigue model, and the corrosion damage model to obtain a first risk assessment parameter matrix includes: Divide the pipeline into multiple grid units along the axial direction, and set stress acquisition points, corrosion monitoring points, and fatigue detection points in each grid unit; obtain the soil corrosion activity and environmental medium permeability of each grid unit, and establish an electrochemical corrosion equation; calculate the corrosion depth increment of each grid unit according to the electrochemical corrosion equation; non-linearly superimpose the corrosion depth increment with the real-time change value of the pipeline wall thickness to obtain the pipeline wall thickness correction value of each grid unit; use the pipeline wall thickness correction value as the input parameter of the dynamic stress model of the pipeline structure; Substitute the pipeline wall thickness correction value, the pipeline internal and external pressure difference, and the pipeline wall temperature gradient into the pipeline structure dynamic stress model to obtain the stress distribution parameters of the stress acquisition points in each grid cell. The stress distribution parameters include axial stress, circumferential stress, and radial stress. Substitute the stress distribution parameters, the pipeline material stress-strain curve, and the pipeline service fatigue cycle into the material fatigue model to obtain the fatigue damage parameters of the fatigue detection points in each grid cell. The fatigue damage parameters include fatigue crack initiation rate and fatigue damage accumulation value. Substitute the fatigue damage parameters, the soil corrosion activity, and the environmental medium permeability into the corrosion damage model to obtain the corrosion rate parameters of the corrosion monitoring points in each grid cell. The corrosion rate parameters include corrosion current density and corrosion depth change rate. Establish a coupled response equation set for the pipeline structure dynamic stress model, the material fatigue model, and the corrosion damage model. Substitute the stress distribution parameters, the fatigue damage parameters, and the corrosion rate parameters in each grid cell into the coupled response equation set for iterative calculation until the parameter change amount between two adjacent iterative calculations is less than the preset threshold. Arrange the finally iteratively converged stress distribution parameters, fatigue damage parameters, and corrosion rate parameters in the order of grid cell numbers to obtain the first risk assessment parameter matrix.
[0008] Establishing an initial pipeline leakage risk assessment model based on the first risk assessment parameter matrix includes: Perform adaptive zoning processing on the first risk assessment parameter matrix. Based on spatial autocorrelation analysis, divide the pipeline into multiple risk assessment units, and calculate the spatial correlation degree of the internal parameters of each risk assessment unit. Construct an evaluation index system for parameter importance. The evaluation index system for parameter importance includes parameter fluctuation range, parameter change trend, and parameter spatial correlation degree. Use the fuzzy analytic hierarchy process to rank the importance of the parameters in each risk assessment unit to determine the parameter weight coefficient matrix. Based on the parameter weight coefficient matrix, screen the key influencing parameters from the historical leakage accident database, and extract the pipeline failure evolution characteristic sequences corresponding to the key influencing parameters. The pipeline failure evolution characteristic sequences include the stress distribution time series data, fatigue damage time series data, and corrosion rate time series data before leakage occurs. Construct a deep learning network model. The number of input layer nodes of the deep learning network model is equal to the number of key influencing parameters. Input the pipeline failure evolution characteristic sequences into the deep learning network model and train to obtain a risk feature extraction model. Combine the parameter weight coefficient matrix of each risk assessment unit with the risk feature extraction model to construct a dynamic risk assessment function; calculate the risk warning index of each risk assessment unit based on the dynamic risk assessment function; establish the mapping relationship among the risk warning index, the parameter weight coefficient matrix, and the risk feature extraction model, and construct a risk state transition probability matrix; design a risk warning threshold according to the risk state transition probability matrix, and divide the risk warning threshold into multiple warning level intervals; integrate the risk state transition probability matrix, the risk warning threshold, the warning level intervals, and the corresponding evaluation parameters and calculation methods into an initial pipeline leakage risk assessment model.
[0009] Encoding the stress distribution parameter, the corrosion rate parameter, and the material deterioration parameter in the first risk assessment parameter matrix into chromosomes, and operating on the chromosomes to obtain an offspring population includes: Perform data preprocessing on the stress distribution parameter, the corrosion rate parameter, and the material deterioration parameter in the first risk assessment parameter matrix. Use the standard deviation normalization method to eliminate the influence of dimensions, use wavelet transform to remove parameter noise, and use kernel density estimation method to correct outliers to obtain a standardized parameter matrix; establish parameter statistical features based on the standardized parameter matrix; construct a parameter distribution model using the parameter statistical features; construct a parameter correlation network based on the standardized parameter matrix and the parameter distribution model, and calculate the Pearson correlation coefficient between parameters; calculate the Spearman rank correlation coefficient based on the parameter statistical features; calculate the mutual information coefficient based on the parameter distribution model; Perform weighted combination on the Pearson correlation coefficient, the Spearman rank correlation coefficient, and the mutual information coefficient to generate a comprehensive parameter correlation degree evaluation index; construct a parameter correlation degree matrix according to the comprehensive parameter correlation degree evaluation index, and use the spectral clustering algorithm to perform block processing on the parameter correlation degree matrix to identify highly correlated parameter groups; construct a parameter optimization objective function based on the parameter correlation degree matrix, take the redundancy of the highly correlated parameter group as the first optimization objective, take the dispersion degree of the parameter statistical features as the second optimization objective, and take the fitting error of the parameter distribution model as the third optimization objective; perform normalization processing on the parameter optimization objective function, and calculate the weight coefficient of the objective function based on the comprehensive parameter correlation degree evaluation index; use the weighted Chebyshev method to transform the multi-objective optimization problem into a single-objective optimization problem; An adaptive weight adjustment model is constructed based on the objective function weight coefficient, and the adaptive weight adjustment model dynamically updates the weight coefficient according to the parameter correlation matrix; the parameter values in the standardized parameter matrix are converted into binary codes according to the adaptive weight coefficients, and a Gray code coding scheme is used to improve coding efficiency; a chromosome structure is constructed according to the binary code, and an initial chromosome population that meets the constraint conditions is randomly generated based on the chromosome structure; and the initial chromosome population is operated to obtain a progeny population.
[0010] The step of operating the initial chromosome population to obtain a progeny population includes: Performing a Pareto non-dominated sort on the initial chromosome population, calculating the crowding distance of each chromosome individual, constructing a selection operator based on the crowding distance, wherein the selection probability of the selection operator is proportional to the individual crowding distance; performing a selection operation on the initial chromosome population using the selection operator to obtain a first offspring population; Dynamically determine the crossover position of the chromosome individuals in the first offspring population, set a crossover probability adaptive adjustment factor according to the coupling degree between the parameters, and dynamically update the crossover probability adaptive adjustment factor with the population evolution generation; perform a multi-point crossover operation on the first offspring population based on the crossover probability adaptive adjustment factor to obtain a second offspring population; calculate the parameter sensitivity of the chromosome individuals in the second offspring population, and construct a parameter variation probability model, wherein the parameter variation probability model assigns a preset variation probability to a gene position with high parameter sensitivity; According to the parameter mutation probability model, a non-uniform mutation operation is performed on the second child population, and the variation asynchronism of the non-uniform mutation operation decays exponentially with the number of evolution generations, so as to obtain a third child population; the third child population is decoded into optimized stress distribution parameters, corrosion rate parameters, and material degradation parameters, and the optimization effect is evaluated based on the parameter optimization objective function; when the non-dominated solution sets of multiple consecutive generations of populations converge and are evenly distributed, the Pareto optimal solution set is output to obtain the optimal parameter combination.
[0011] Calculating the fitness value of each chromosome in the offspring population based on the fitness function, selecting the chromosome with the highest fitness value, decoding the chromosome with the highest fitness value to obtain a second risk assessment parameter matrix; and establishing a pipeline leakage probability calculation model according to the second risk assessment parameter matrix, including: Based on the fitness function, a hierarchical fitness calculation framework is constructed using a multi-objective evaluation method. The hierarchical fitness calculation framework includes a basic evaluation layer, a cross-validation layer, and a comprehensive evaluation layer. Each chromosome in the offspring population is input into the hierarchical fitness calculation framework. The basic evaluation layer is used to construct a chromosome feature vector, and calculations such as parameter matching degree calculation, prediction accuracy calculation, and calculation efficiency calculation are performed on the chromosome to obtain calculation results. The chromosome feature vector and the calculation results are input into the cross-validation layer, and iterative verification operations are performed using the verification model to obtain verification results. Combining with the weight coefficient dynamic optimization matrix, non-linear weighted calculation is performed on the verification results, a chromosome feature mapping network is constructed, and a chromosome fitness value sequence and a feature correlation matrix are output. A chromosome optimization mechanism is constructed using a tournament selection strategy. Population parameters are calculated based on the feature correlation matrix, and an adaptive competition radius is set. The chromosome fitness value sequence is input into the competition mechanism, and the fitness value, iteration times, and parameter stability index of the competing chromosomes are calculated to form a comprehensive evaluation vector. A multi-objective optimization function is constructed, and multi-objective sorting operations are performed on the chromosomes according to the Pareto dominance relationship to establish a non-dominated solution set. Chromosome fitness evaluation is performed based on the feature mapping network in the non-dominated solution set, and the chromosome with the highest fitness value is selected. Feature decoupling units, precision adjustment units, and parameter reconstruction units of a multi-level decoding conversion network are set. The chromosome with the highest fitness value and the feature correlation matrix are input into the feature decoupling unit, and variational inference method is used for feature separation. A decoding precision calculation model is constructed using the chromosome feature vector, and the decoding precision is calculated through the precision adjustment unit. The decoding precision is input into the parameter reconstruction unit, and parameter mapping is performed using a deep neural network, and the parameters are corrected in combination with the weight coefficient dynamic optimization matrix to generate a third risk assessment parameter matrix.
[0012] The step of inputting the operating parameters of the target pipeline section into the pipeline leakage probability calculation model to obtain a third risk assessment parameter matrix of the target pipeline section includes: The operating parameters of the target pipeline section are input into the pipeline leakage probability calculation model. The pipeline leakage probability calculation model includes an adaptive dynamic sampling network, a generative adversarial network, and a probability characterization learning network. The adaptive dynamic sampling network includes a spatio-temporal attention module and a parameter reconstruction module. The spatio-temporal attention module uses a multi-head cross-attention mechanism to calculate a parameter weight matrix, constructs a parameter dependence graph through an asynchronous updated hierarchical attention network based on the parameter weight matrix, and constructs a parameter dimensionality reduction matrix using a recursive tensor decomposition method based on the parameter dependence graph. The parameter reconstruction module inputs the parameter dimensionality reduction matrix into a generative adversarial network, which includes a generator and a discriminator. The generator generates reconstructed parameters based on the parameter weight matrix. The discriminator calculates the distribution distance between the reconstructed parameters and the original parameters, and optimizes the reconstructed parameters in combination with a cyclic consistency constraint function to generate a spatio-temporal feature sequence and a parameter reconstruction matrix. The spatio-temporal feature sequence and the parameter reconstruction matrix are input into a probability representation learning network. The probability representation learning network adopts a variational inference framework, constructs a stochastic flow transformation model based on the parameter reconstruction matrix, maps the parameter distribution to a standard normal distribution space, and obtains a standardized feature matrix. A hierarchical probability encoder is constructed according to the standardized feature matrix. The hierarchical probability encoder includes multiple layers of latent variable models. Each layer of latent variable model establishes a probabilistic graphical representation of the parameter distribution based on the spatio-temporal feature sequence, and constructs a parameter conditional probability matrix using an energy model. An mutual information loss function is constructed based on the standardized feature matrix and the parameter conditional probability matrix. The mutual information loss function includes a log-likelihood estimation term and a divergence constraint term. The conditional probability distribution is calculated according to the parameter conditional probability matrix, and the network parameters of the hierarchical probability encoder are iteratively optimized using a stochastic gradient variational inference algorithm to generate a third risk assessment parameter matrix.
[0013] In the second aspect of the embodiments of the present invention, a natural gas pipeline leakage probability calculation system based on a genetic algorithm is provided, including: A first unit for collecting the operating parameters of the natural gas pipeline. The operating parameters include the pressure difference inside and outside the pipeline, the pipeline wall temperature gradient, the real-time change value of the pipeline wall thickness, the stress-strain curve of the pipeline material, the pipeline service fatigue period, the soil corrosion activity, and the environmental medium permeability. A pipeline structure dynamic stress model is established according to the pressure difference inside and outside the pipeline, the pipeline wall temperature gradient, and the real-time change value of the pipeline wall thickness. A material fatigue model is established according to the stress-strain curve of the pipeline material and the pipeline service fatigue period. A corrosion damage model is constructed according to the soil corrosion activity and the environmental medium permeability. A second unit for coupling and analyzing the pipeline structure dynamic stress model, the material fatigue model, and the corrosion damage model to obtain a first risk assessment parameter matrix. The first risk assessment parameter matrix includes stress distribution parameters, fatigue damage parameters, and corrosion rate parameters. An initial pipeline leakage risk assessment model is established according to the first risk assessment parameter matrix. The initial pipeline leakage risk assessment model is used as a fitness function. The stress distribution parameters, the corrosion rate parameters, and the material deterioration parameters in the first risk assessment parameter matrix are encoded as chromosomes, and the chromosomes are operated on to obtain an offspring population. A third unit is configured to calculate the fitness values of each chromosome in the offspring population based on the fitness function, select the chromosome with the highest fitness value, decode the chromosome with the highest fitness value to obtain a second risk assessment parameter matrix; establish a pipeline leakage probability calculation model according to the second risk assessment parameter matrix; collect the operating parameters of the target pipeline section; input the operating parameters of the target pipeline section into the pipeline leakage probability calculation model to obtain a third risk assessment parameter matrix of the target pipeline section; calculate a leakage probability prediction value of the target pipeline section according to the third risk assessment parameter matrix; classify the risk level of the target pipeline section according to the leakage probability prediction value, and generate a pipeline leakage risk distribution map.
[0014] In a third aspect of the embodiments of the present invention A kind of electronic device is provided, including: A processor; A memory for storing instructions executable by the processor; Wherein, the processor is configured to call the instructions stored in the memory to execute the method described above.
[0015] In a fourth aspect of the embodiments of the present invention, A computer-readable storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method described above is implemented.
[0016] The beneficial effects of this application are as follows: By establishing a pipeline structure dynamic stress model, a material fatigue model and a corrosion damage model, and coupling and analyzing these models, the present invention can comprehensively consider the influence of various damage factors suffered by the pipeline during service, and improve the accuracy and reliability of pipeline leakage risk assessment.
[0017] The present invention uses a genetic algorithm to optimize risk assessment parameters. Through chromosome coding, genetic operations and fitness calculation, it can find the optimal combination of risk assessment parameters, so that the established pipeline leakage probability calculation model has strong adaptability and generalization ability, and can better meet the needs of pipeline leakage risk assessment under different working conditions.
[0018] The present invention classifies the risk level of the target pipeline section according to the calculated leakage probability prediction value, and generates a pipeline leakage risk distribution map, providing an intuitive risk assessment result for pipeline operation and maintenance personnel, helping to timely discover potential leakage risks, formulate targeted preventive measures, and improve the safety of pipeline operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a schematic flowchart of a method for calculating the leakage probability of a natural gas pipeline based on a genetic algorithm according to an embodiment of the present invention; Figure 2 This is a schematic structural diagram of the natural gas pipeline leakage probability calculation system based on the genetic algorithm in the embodiments of the present invention. Specific embodiments
[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0021] The technical solutions of the present invention will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0022] Figure 1 This is a schematic flowchart of the natural gas pipeline leakage probability calculation method based on the genetic algorithm in the embodiments of the present invention. As Figure 1 shown, the method includes: S101. Collect the operating parameters of the natural gas pipeline, where the operating parameters include the pressure difference inside and outside the pipeline, the pipeline wall temperature gradient, the real-time change value of the pipeline wall thickness, the stress-strain curve of the pipeline material, the pipeline service fatigue period, the soil corrosion activity, and the environmental medium permeability; establish a pipeline structure dynamic stress model based on the pressure difference inside and outside the pipeline, the pipeline wall temperature gradient, and the real-time change value of the pipeline wall thickness; establish a material fatigue model based on the stress-strain curve of the pipeline material and the pipeline service fatigue period; construct a corrosion damage model based on the soil corrosion activity and the environmental medium permeability; S102. Perform a coupling analysis on the pipeline structure dynamic stress model, the material fatigue model, and the corrosion damage model to obtain a first risk assessment parameter matrix, where the first risk assessment parameter matrix includes stress distribution parameters, fatigue damage parameters, and corrosion rate parameters; establish an initial pipeline leakage risk assessment model based on the first risk assessment parameter matrix; use the initial pipeline leakage risk assessment model as a fitness function; encode the stress distribution parameters, the corrosion rate parameters, and the material degradation parameters in the first risk assessment parameter matrix into chromosomes, and operate on the chromosomes to obtain an offspring population; S103. Calculate the fitness values of each chromosome in the offspring population based on the fitness function, select the chromosome with the highest fitness value, decode the chromosome with the highest fitness value to obtain a second risk assessment parameter matrix; establish a pipeline leakage probability calculation model according to the second risk assessment parameter matrix; collect the operating parameters of the target pipeline section; input the operating parameters of the target pipeline section into the pipeline leakage probability calculation model to obtain a third risk assessment parameter matrix of the target pipeline section; calculate the leakage probability prediction value of the target pipeline section according to the third risk assessment parameter matrix; divide the risk level of the target pipeline section according to the leakage probability prediction value, and generate a pipeline leakage risk distribution map.
[0023] In an alternative embodiment, the coupling analysis of the pipeline structure dynamic stress model, the material fatigue model and the corrosion damage model to obtain a first risk assessment parameter matrix includes: Divide the pipeline into multiple grid units along the axial direction, and set stress acquisition points, corrosion monitoring points and fatigue detection points in each grid unit; obtain the soil corrosion activity and environmental medium permeability of each grid unit, and establish an electrochemical corrosion equation; calculate the corrosion depth increment of each grid unit according to the electrochemical corrosion equation; perform non-linear superposition of the corrosion depth increment and the real-time change value of the pipeline wall thickness to obtain the pipeline wall thickness correction value of each grid unit; use the pipeline wall thickness correction value as the input parameter of the pipeline structure dynamic stress model; Substitute the pipeline wall thickness correction value, the pipeline internal and external pressure difference, and the pipeline wall temperature gradient into the pipeline structure dynamic stress model to obtain the stress distribution parameters of the stress acquisition points in each grid unit, where the stress distribution parameters include axial stress, circumferential stress, and radial stress; substitute the stress distribution parameters, the pipeline material stress-strain curve, and the pipeline service fatigue period into the material fatigue model to obtain the fatigue damage parameters of the fatigue detection points in each grid unit, where the fatigue damage parameters include fatigue crack initiation rate and fatigue damage accumulation value; substitute the fatigue damage parameters, the soil corrosion activity, and the environmental medium permeability into the corrosion damage model to obtain the corrosion rate parameters of the corrosion monitoring points in each grid unit, where the corrosion rate parameters include corrosion current density and corrosion depth change rate; Establish a coupled response equation set for the dynamic stress model of the pipeline structure, the material fatigue model, and the corrosion damage model; substitute the stress distribution parameters, the fatigue damage parameters, and the corrosion rate parameters in each grid cell into the coupled response equation set for iterative calculation until the parameter change amount between two adjacent iterative calculations is less than the preset threshold; arrange the finally converged stress distribution parameters, fatigue damage parameters, and corrosion rate parameters in the order of grid cell numbers to obtain the first risk assessment parameter matrix.
[0024] First, divide the pipeline into grids, set a grid cell every 50 cm along the axial direction of the pipeline, and arrange 3 stress acquisition points, 2 corrosion monitoring points, and 2 fatigue detection points in each grid cell. The stress acquisition points are located on the inner wall, neutral layer, and outer wall of the pipeline respectively; the corrosion monitoring points are set at the contact surface between the outer wall of the pipeline and the soil; the fatigue detection points are arranged in the stress concentration area.
[0025] Measure the soil corrosion activity at each grid cell with a soil resistivity tester, and the value range is from 0 to 1. The larger the value, the stronger the corrosivity. Use a permeability tester to measure the permeability of the environmental medium, and the unit is mm / year. Take a certain pipe section as an example, the measured soil corrosion activity is 0.75, and the permeability of the environmental medium is 2.3 mm / year. Based on the electrochemical principle, establish a corrosion equation, and calculate that the annual corrosion depth increment of this grid cell is 0.8 mm.
[0026] Dynamically update the corrosion depth increment and the measured wall thickness of the pipe wall. The original wall thickness of a certain measuring point is 12 mm, and the corrected wall thickness considering corrosion damage is 11.2 mm. Input the corrected wall thickness data into the dynamic stress model of the pipeline structure, and at the same time import the operating parameters: the internal pressure of the pipeline is 4.5 MPa, the external pressure is 0.1 MPa, the internal wall temperature is 65 °C, and the external wall temperature is 25 °C.
[0027] Based on the finite element analysis method, calculate the stress distribution at the stress acquisition points: the axial stress is 185 MPa, the circumferential stress is 210 MPa, and the radial stress is 35 MPa. Combine the stress-strain curve of pipeline X70 steel and the fatigue cycle of actual operation for 15 years to calculate the fatigue damage parameters: the fatigue crack initiation rate is 0.15 mm per year, and the cumulative fatigue damage value is 0.45.
[0028] Substitute the above parameters into the corrosion damage model to obtain the corrosion rate index at the corrosion monitoring point: the corrosion current density is 0.08 mA / cm², and the corrosion depth change rate is 0.9 mm / year. Realize the interaction of the stress, fatigue, and corrosion models by establishing a coupled response equation set, and set the iterative convergence threshold to 0.1%. After about 15 iterative calculations, the parameter change amount is lower than the threshold, and finally the risk assessment parameters of this grid cell are obtained.
[0029] Sort all the measured point data in the order of grid cell numbers to form a risk assessment parameter matrix, where the matrix dimension is the number of grid cells multiplied by the number of parameters. For a pipe segment with a length of 1 km, a total of 2000 grid cells are divided, and each cell contains 7 key parameters, finally obtaining a risk assessment parameter matrix with 2000 rows and 7 columns.
[0030] Beneficial effects: Through grid-based dynamic monitoring and multi-model coupling analysis, accurate assessment of stress distribution, fatigue damage, and corrosion rate under the service state of the pipeline is achieved, providing reliable data support for pipeline integrity management.
[0031] The non-linear superposition method is used to process the increment of corrosion depth and the change of wall thickness, and the corrected value is fed back to the stress model in real time, improving the accuracy and timeliness of risk assessment and making the assessment results more in line with the actual service state of the pipeline.
[0032] The coupling response relationship among stress, fatigue, and corrosion is established. Through iterative calculation, the convergence and stability of assessment parameters are ensured, forming a complete risk assessment parameter matrix, providing comprehensive technical support for the safe operation of the pipeline.
[0033] In an alternative embodiment, establishing an initial model for pipeline leakage risk assessment based on the first risk assessment parameter matrix includes: Perform adaptive partitioning on the first risk assessment parameter matrix, divide the pipeline into multiple risk assessment units based on spatial autocorrelation analysis, and calculate the spatial correlation degree of internal parameters of each risk assessment unit; construct an evaluation index system for parameter importance, where the evaluation index system for parameter importance includes parameter fluctuation range, parameter change trend, and parameter spatial correlation degree; use the fuzzy analytic hierarchy process to rank the importance of parameters in each risk assessment unit to determine the parameter weight coefficient matrix; Based on the parameter weight coefficient matrix, screen key influencing parameters from the historical leakage accident database, extract the pipeline failure evolution characteristic sequence corresponding to the key influencing parameters, where the pipeline failure evolution characteristic sequence includes stress distribution time series data, fatigue damage time series data, and corrosion rate time series data before leakage; construct a deep learning network model, where the number of input layer nodes of the deep learning network model is equal to the number of key influencing parameters; input the pipeline failure evolution characteristic sequence into the deep learning network model to train and obtain a risk feature extraction model; Combine the parameter weight coefficient matrix of each risk assessment unit with the risk feature extraction model to construct a dynamic risk assessment function; calculate the risk warning index of each risk assessment unit based on the dynamic risk assessment function; establish the mapping relationship among the risk warning index, the parameter weight coefficient matrix, and the risk feature extraction model, and construct a risk state transition probability matrix; design a risk warning threshold according to the risk state transition probability matrix, and divide the risk warning threshold into multiple warning level intervals; integrate the risk state transition probability matrix, the risk warning threshold, the warning level intervals, and the corresponding evaluation parameters and calculation methods into an initial pipeline leakage risk assessment model.
[0034] For the establishment of the initial pipeline leakage risk assessment model, first perform the adaptive partitioning process of the first risk assessment parameter matrix. By using the spatial autocorrelation analysis method, the entire pipeline is divided into several risk assessment units, and the length of each unit is 500 meters. For each risk assessment unit, calculate the spatial correlation degree of the internal parameters. Taking an oil pipeline with a length of 10 kilometers as an example, it can be divided into 20 risk assessment units. Within each unit, key parameters such as pipeline wall thickness, operating pressure, and corrosion rate are selected for calculating the spatial correlation degree.
[0035] Subsequently, construct an importance evaluation index system for parameters, which includes three dimensions: parameter fluctuation range, parameter change trend, and parameter spatial correlation degree. The parameter fluctuation range reflects the change range of parameter values, the parameter change trend reflects the change law of parameters over time, and the parameter spatial correlation degree characterizes the degree of mutual influence of parameters in spatial distribution. Use the fuzzy analytic hierarchy process to rank the importance of each parameter to obtain the parameter weight coefficient matrix.
[0036] Based on the obtained parameter weight coefficient matrix, screen the key influencing parameters from the historical leakage accident database. This database contains 500 cases of pipeline leakage accidents that occurred in the past 5 years. Extract the pipeline failure evolution characteristic sequences corresponding to these key influencing parameters, including stress distribution data 24 hours before leakage, fatigue damage data in the past 30 days, and corrosion rate data in the past 90 days. Construct a deep learning network model, and the number of input layer nodes is equal to the number of key influencing parameters screened out. Input the pipeline failure evolution characteristic sequences into the deep learning network for training to obtain the risk feature extraction model.
[0037] Combine the parameter weight coefficient matrix of each risk assessment unit with the risk feature extraction model to construct a dynamic risk assessment function. This function can calculate the risk warning index of each risk assessment unit in real time. Establish the mapping relationship among the risk warning index, the parameter weight coefficient matrix, and the risk feature extraction model to form a risk state transition probability matrix. Design the risk warning threshold according to this matrix and divide it into four warning level intervals: low-risk interval, medium-risk interval, high-risk interval, and extremely high-risk interval. Finally, integrate all the above elements into the initial model for pipeline leakage risk assessment.
[0038] Beneficial effects: The first part: Through adaptive zoning and spatial autocorrelation analysis, the scientific division of pipeline risk assessment units is realized, improving the accuracy and pertinence of risk assessment. The establishment of the parameter importance evaluation index system makes the weight allocation of each parameter more reasonable, and the risk assessment results are more objectively credible.
[0039] The second part: Using the deep learning network model to analyze the historical leakage accident data can effectively extract the pipeline failure evolution characteristics and realize the intelligence and automation of risk warning. The construction of the dynamic risk assessment function makes the risk assessment process have real-time and dynamic characteristics.
[0040] The third part: The establishment of the risk state transition probability matrix provides a reliable theoretical basis for risk warning. The division of multi-level warning level intervals makes the risk warning more refined, which helps to detect potential risks in time and take corresponding preventive measures. The entire assessment model has strong practicability and generalizability.
[0041] In an alternative embodiment, encoding the stress distribution parameter, the corrosion rate parameter, and the material deterioration parameter in the first risk assessment parameter matrix into chromosomes and operating on the chromosomes to obtain an offspring population includes: Perform data preprocessing on the stress distribution parameter, the corrosion rate parameter, and the material deterioration parameter in the first risk assessment parameter matrix. Use the standard deviation normalization method to eliminate the influence of dimension, use wavelet transform to remove parameter noise, and use kernel density estimation method to correct outliers to obtain a standardized parameter matrix; establish parameter statistical characteristics based on the standardized parameter matrix; construct a parameter distribution model using the parameter statistical characteristics; construct a parameter correlation network based on the standardized parameter matrix and the parameter distribution model, and calculate the Pearson correlation coefficient between parameters; calculate the Spearman rank correlation coefficient based on the parameter statistical characteristics; calculate the mutual information coefficient based on the parameter distribution model; The Pearson correlation coefficient, the Spearman rank correlation coefficient and the mutual information coefficient are weighted and combined to generate a comprehensive parameter correlation evaluation index; a parameter correlation matrix is constructed according to the comprehensive parameter correlation evaluation index, and the parameter correlation matrix is divided into blocks using a spectral clustering algorithm to identify highly correlated parameter groups; a parameter optimization objective function is constructed based on the parameter correlation matrix, and the redundancy of the highly correlated parameter group is used as the first optimization objective, the discrete degree of the parameter statistical characteristics is used as the second optimization objective, and the fitting error of the parameter distribution model is used as the third optimization objective; the parameter optimization objective function is normalized, and the objective function weight coefficient is calculated based on the comprehensive parameter correlation evaluation index; a multi-objective optimization problem is converted into a single-objective optimization problem using a weighted Chebyshev method; An adaptive weight adjustment model is constructed based on the objective function weight coefficient, and the adaptive weight adjustment model dynamically updates the weight coefficient according to the parameter correlation matrix; the parameter values in the standardized parameter matrix are converted into binary codes according to the adaptive weight coefficients, and a Gray code coding scheme is used to improve coding efficiency; a chromosome structure is constructed according to the binary code, and an initial chromosome population that meets the constraint conditions is randomly generated based on the chromosome structure; and the initial chromosome population is operated to obtain a progeny population.
[0042] First, the stress distribution parameters, corrosion rate parameters, and material degradation parameters in the first risk assessment parameter matrix are preprocessed. The dimension effect is eliminated by the standard deviation standardization method, specifically, the original data is subtracted from the mean and divided by the standard deviation. For example, for the stress distribution parameters, the original data are 320MPa, 280MPa, and 350MPa. After standardization, standardized values such as 0.52, -0.86, and 1.24 are obtained.
[0043] Wavelet transform is used to remove parameter noise, db4 wavelet basis function is selected, the standardized data is decomposed into 4 layers, low-frequency coefficients are extracted and reconstructed to obtain the denoised signal. Taking the corrosion rate parameter as an example, there is high-frequency noise in the original data curve, and a smooth trend curve is obtained after wavelet denoising.
[0044] The kernel density estimation method is used to correct outliers. The Gaussian kernel function is selected, the bandwidth is 0.5, and the probability density of the data is estimated. The data points that deviate from 3 times the standard deviation are corrected to the normal range. For example, the outlier value 98 in the material degradation parameter is corrected to 85.
[0045] Statistical characteristics are calculated based on the processed standardized parameter matrix, including mean, variance, skewness, kurtosis, etc. When constructing the parameter distribution model, the optimal distribution type is determined by distribution fitting. For example, the stress distribution parameters conform to the lognormal distribution, and the corrosion rate parameters conform to the Weibull distribution.
[0046] When constructing the parameter correlation network, the Pearson correlation coefficient, Spearman rank correlation coefficient, and mutual information coefficient between parameters are calculated. For the stress and corrosion rate parameters, the Pearson correlation coefficient is 0.82, the Spearman correlation coefficient is 0.79, and the mutual information coefficient is 0.65, indicating a strong correlation between the two.
[0047] The three correlation coefficients are weighted and combined with weights of 0.4, 0.3, and 0.3 respectively to generate a comprehensive correlation degree evaluation index. The spectral clustering algorithm is used to block the correlation matrix, and the number of clusters is set to 3 to identify highly correlated parameter groups.
[0048] The parameter optimization objective function is constructed, and the redundancy, statistical feature dispersion, and distribution fitting error of the relevant parameter groups are used as optimization objectives. An adaptive weight adjustment model is used to dynamically update the weight coefficients, with initial weights of 0.4, 0.3, and 0.3, which are updated every 50 iterations according to the parameter correlation matrix.
[0049] The parameter values are binary encoded, with each parameter represented by a 16-bit binary number, and Gray code is used to improve the encoding efficiency. 100 chromosomes are randomly generated as the initial population, and the chromosome length is the product of the number of parameters and the number of encoding bits. The offspring population is generated through crossover and mutation operations.
[0050] Beneficial effects: Through the combined use of standard deviation normalization, wavelet denoising, and kernel density estimation, efficient preprocessing of the original parameter data is achieved, significantly improving the data quality and reliability.
[0051] By using multiple correlation measurement indicators and an adaptive weight mechanism, an accurate parameter correlation network is constructed, effectively identifying the complex relationships between parameters and providing a reliable basis for subsequent optimization.
[0052] Based on the parameter statistical characteristics and distribution characteristics, a multi-objective optimization framework is designed, combined with an improved coding scheme, to achieve efficient optimization of the parameter groups, improving the accuracy and reliability of risk assessment.
[0053] In an optional implementation manner, the operation on the initial chromosome population to obtain the offspring population includes: Performing Pareto non-dominated sorting on the initial chromosome population, calculating the crowding distance of each chromosome individual, constructing a selection operator based on the crowding distance, and the selection probability of the selection operator is proportional to the individual crowding distance; using the selection operator to perform a selection operation on the initial chromosome population to obtain the first offspring population; Determine the dynamic crossover positions of the chromosome individuals in the first offspring population, set the crossover probability adaptive adjustment factor according to the coupling degree between parameters, and the crossover probability adaptive adjustment factor is dynamically updated with the population evolution generation; perform multi-point crossover operation on the first offspring population based on the crossover probability adaptive adjustment factor to obtain the second offspring population; calculate the parameter sensitivity of the chromosome individuals in the second offspring population, and construct a parameter mutation probability model, which assigns a preset mutation probability to the gene positions with high parameter sensitivity; Perform non-uniform mutation operation on the second offspring population according to the parameter mutation probability model, and the mutation step size of the non-uniform mutation operation decays exponentially with the evolution generation to obtain the third offspring population; decode the third offspring population into optimized stress distribution parameters, corrosion rate parameters, and material deterioration parameters, and evaluate the optimization effect based on the parameter optimization objective function; when the non-dominated solution sets of consecutive generations of populations converge and are evenly distributed, output the Pareto optimal solution set to obtain the optimal parameter combination.
[0054] First, perform Pareto non-dominated sorting on the initial chromosome population. By comparing the objective function values of each individual in the population, the population is divided into non-dominated solution sets of different levels. For the individuals in the first-level non-dominated solution set, there are no other individuals that are superior to it in all objectives. When calculating the crowding distance of each chromosome individual, for each objective function, sort the individuals within the same level according to the objective value, and calculate the normalized distance between adjacent individuals. The crowding distance of the boundary individuals is set to infinity to ensure their selection. The selection probability of the selection operator is proportional to the individual crowding distance, and the individual with a larger crowding distance has a higher probability of being selected. Through the binary tournament selection method, select high-quality individuals from the initial population to form the first offspring population.
[0055] Determine the dynamic crossover positions of the chromosome individuals in the first offspring population. First, calculate the coupling degree between parameters, and the coupling degree is measured by the correlation coefficient between parameters. For the gene positions corresponding to strongly correlated parameters, set them as crossover positions. The crossover probability adaptive adjustment factor is updated with the evolution generation, with an initial value of 0.9, decreasing by 0.1 every 50 generations, and the minimum value is 0.6. Perform multi-point crossover operation at the determined crossover positions to generate the second offspring population.
[0056] Calculate the parameter sensitivity of the chromosome individuals in the second offspring population. Through the perturbation analysis method, apply small perturbations to each parameter and observe the change of the objective function. If the objective function is more sensitive to the change of a certain parameter, the gene position corresponding to this parameter is assigned a higher mutation probability, such as 0.1; otherwise, a lower mutation probability, such as 0.01, is assigned.
[0057] Perform non-uniform mutation operation on the second offspring population according to the parameter mutation probability model. The mutation step size decays exponentially with the number of generations of evolution. The initial step size is 20% of the parameter range and decays to half of the original every 100 generations. Decode the mutated third offspring population into specific stress distribution parameters, corrosion rate parameters, and material degradation parameters. Evaluate the optimization effect using the parameter optimization objective function, which includes multiple objectives such as maximizing the structural reliability index and minimizing the life prediction error.
[0058] When the non-dominated solution set of the population converges and is evenly distributed for 20 consecutive generations, that is, when the change in the number and distribution index of the solution set does not exceed 1%, output the Pareto optimal solution set. Select a set of compromise optimal parameter combinations from it as the final optimization result.
[0059] Beneficial effects: In the first aspect, the selection operator based on crowding distance and the dynamic crossover position determination strategy are adopted, which improves the population diversity, avoids falling into local optimal solutions, and enhances the global search ability of the algorithm.
[0060] In the second aspect, the parameter sensitivity analysis and the adaptive mutation probability model are introduced, which makes the optimization of important parameters more accurate and improves the local search ability and convergence speed of the algorithm.
[0061] In the third aspect, the non-uniform mutation and multi-objective optimization strategies are adopted to obtain a series of balanced Pareto optimal solutions, providing greater flexibility for parameter selection in engineering practice.
[0062] In an optional implementation manner, calculate the fitness value of each chromosome in the offspring population based on the fitness function, select the chromosome with the highest fitness value, and decode the chromosome with the highest fitness value to obtain the second risk assessment parameter matrix; establish a pipeline leakage probability calculation model according to the second risk assessment parameter matrix, including: Based on the fitness function, adopt a multi-objective evaluation method to construct a hierarchical fitness calculation framework, which includes a basic evaluation layer, a cross-validation layer, and a comprehensive evaluation layer; input each chromosome in the offspring population into the hierarchical fitness calculation framework, use the basic evaluation layer to construct a chromosome feature vector, calculate the parameter matching degree, prediction accuracy, and calculation efficiency of the chromosome to obtain calculation results; input the chromosome feature vector and the calculation results into the cross-validation layer, and perform iterative verification operations using the verification model to obtain verification results; combine the weight coefficient dynamic optimization matrix, perform non-linear weighted calculation on the verification results, construct a chromosome feature mapping network, and output the chromosome fitness value sequence and the feature correlation matrix; Adopt the tournament selection strategy to construct a chromosome optimization mechanism, calculate population parameters based on the feature correlation matrix, and set an adaptive competition radius; input the chromosome fitness value sequence into the competition mechanism, calculate the fitness value, iteration times, and parameter stability index of the competing chromosomes to form a comprehensive evaluation vector; construct a multi-objective optimization function, perform multi-objective sorting operations on chromosomes according to the Pareto dominance relationship, and establish a non-dominated solution set; based on the feature mapping network in the non-dominated solution set, evaluate the chromosome fitness, and select the chromosome with the highest fitness value. Set the feature decoupling unit, precision adjustment unit, and parameter reconstruction unit of the multi-level decoding conversion network; input the chromosome with the highest fitness value and the feature correlation matrix into the feature decoupling unit, and use the variational inference method for feature separation; use the chromosome feature vector to construct a decoding precision calculation model, and calculate the decoding precision through the precision adjustment unit; input the decoding precision into the parameter reconstruction unit, use a deep neural network for parameter mapping, and correct the parameters in combination with the weight coefficient dynamic optimization matrix to generate a second risk assessment parameter matrix.
[0063] A pipeline leakage risk assessment method based on genetic algorithm realizes accurate risk assessment through multi-level fitness calculation and parameter optimization.
[0064] First, construct a hierarchical fitness calculation framework, which contains three levels. In the basic evaluation layer, extract features from chromosomes, use the similarity calculation method when calculating the parameter matching degree, and quantify it by comparing the difference between the chromosome encoding and the target parameters; use the cross-validation method for calculating the prediction accuracy, divide the sample data into a training set and a test set, and calculate the error between the prediction result and the actual value; evaluate the calculation efficiency by recording the algorithm running time and resource consumption. Specifically, the sample data can be divided in a ratio of 8:2 and a 5-fold cross-validation method can be adopted.
[0065] In the cross-validation layer, the verification model adopts an ensemble learning strategy, combining the prediction results of multiple basic models. The dynamic optimization of the weight coefficient adopts an adaptive method, and the weight value is dynamically adjusted according to the performance of each model. For example, when a certain model performs well in the recent verification, its weight coefficient is increased accordingly. The feature mapping network adopts a multi-layer perceptron structure, and the number of hidden layer nodes can be set to 2 times the number of input layer nodes.
[0066] In the tournament selection strategy, the competition radius is dynamically adjusted according to the population diversity, and the initial value can be set to 20% of the population size. When constructing the comprehensive evaluation vector, the weight ratio of the fitness value, iteration times, and parameter stability of the three indicators is set to 4:3:3. The multi-objective sorting adopts the fast non-dominated sorting algorithm, and determines the rank of the chromosome by calculating the domination number and the dominated set.
[0067] In the multi-level decoding and conversion network, the feature decoupling unit adopts a variational autoencoder structure to map the chromosome encoding into the latent variable space. The precision adjustment unit improves the decoding precision through the residual connection mechanism and sets the adaptive learning rate to dynamically adjust between 0.001 and 0.0001. The parameter reconstruction unit adopts a deep neural network, including 4 hidden layers, with the number of nodes in each layer being 256, 128, 64, and 32 in sequence, and uses the ReLU activation function.
[0068] Data case: Suppose a set of pipeline parameter data is input, including features such as pipe diameter, pressure, and temperature, with a sample size of 1000. After optimization by the genetic algorithm, the prediction accuracy can reach over 95%, and the calculation time is controlled within 30 seconds. The finally generated risk assessment parameter matrix includes key indicators such as leakage probability, influence range, and loss degree.
[0069] Beneficial effects: The first part: Through the hierarchical fitness calculation framework, the organic combination of multi-dimensional evaluation indicators is realized, improving the accuracy and reliability of parameter optimization, and making the risk assessment results more objective and comprehensive.
[0070] The second part: Adopting the tournament selection strategy and multi-objective optimization method effectively avoids local optimal solutions, enhances the global search ability of the algorithm, and ensures the optimality of risk assessment parameters.
[0071] The third part: The design of the multi-level decoding and conversion network solves the problem of precision loss in the parameter reconstruction process, improves the stability and applicability of the risk assessment model, and makes the assessment results more accurate and reliable.
[0072] In an alternative implementation manner, inputting the operating parameters of the target pipeline segment into the pipeline leakage probability calculation model to obtain the third risk assessment parameter matrix of the target pipeline segment includes: Input the operating parameters of the target pipeline segment into the pipeline leakage probability calculation model, where the pipeline leakage probability calculation model includes an adaptive dynamic sampling network, a generative adversarial network, and a probability representation learning network. The adaptive dynamic sampling network includes a spatio-temporal attention module and a parameter reconstruction module; the spatio-temporal attention module uses a multi-head cross-attention mechanism to calculate the parameter weight matrix, constructs a parameter dependence graph through an asynchronous update hierarchical attention network based on the parameter weight matrix, and constructs a parameter dimensionality reduction matrix using a recursive tensor decomposition method according to the parameter dependence graph; The parameter reconstruction module inputs the parameter dimensionality reduction matrix into the adversarial generation network, which includes a generator and a discriminator. The generator generates reconstructed parameters based on the parameter weight matrix, and the discriminator calculates the distribution distance between the reconstructed parameters and the original parameters, and optimizes the reconstructed parameters in combination with the cyclic consistency constraint function to generate a spatio-temporal feature sequence and a parameter reconstruction matrix; the spatio-temporal feature sequence and the parameter reconstruction matrix are input into the probability representation learning network. The probability representation learning network adopts a variational inference framework, constructs a stochastic flow transformation model based on the parameter reconstruction matrix, maps the parameter distribution to the standard normal distribution space, and obtains a standardized feature matrix; A hierarchical probability encoder is constructed according to the standardized feature matrix. The hierarchical probability encoder includes multiple layers of latent variable models. Each layer of latent variable model establishes a probability graph representation of the parameter distribution based on the spatio-temporal feature sequence, and constructs a parameter conditional probability matrix by using an energy model; an mutual information loss function is constructed based on the standardized feature matrix and the parameter conditional probability matrix. The mutual information loss function includes a log-likelihood estimation term and a divergence constraint term. The conditional probability distribution is calculated according to the parameter conditional probability matrix, and the network parameters of the hierarchical probability encoder are iteratively optimized by using the stochastic gradient variational inference algorithm to generate a third risk assessment parameter matrix.
[0073] First, the operating parameters of the target pipeline section are collected and preprocessed. The operating parameters include key data such as pipeline pressure, temperature, flow rate, and medium composition. These parameters are collected in real time through a sensor network and the data is standardized.
[0074] In the adaptive dynamic sampling network, the spatio-temporal attention module first constructs a multi-head cross-attention mechanism. For each parameter, 8 attention heads are set, and each attention head independently calculates the association weights between parameters. For example, the association weight between the pressure parameter and the temperature parameter is 0.75, and the association weight with the flow rate parameter is 0.62. A parameter dependence graph is constructed based on these weight values to reflect the mutual influence relationship between parameters. Then, a recursive tensor decomposition method is used to reduce the high-dimensional parameter space to an appropriate dimension, such as reducing the original 100-dimensional parameter to a 20-dimensional representation.
[0075] The adversarial generation network in the parameter reconstruction module includes two core components: a generator and a discriminator. The generator receives the dimensionality-reduced parameter matrix and generates reconstructed parameters through a multi-layer neural network. The discriminator calculates the distribution distance between the reconstructed parameters and the original parameters. When the distance is greater than the preset threshold of 0.1, parameter optimization is triggered. The cyclic consistency constraint is introduced in the optimization process to ensure that the reconstructed parameters and the original parameters have similar spatio-temporal distribution characteristics.
[0076] The probability representation learning network uses a variational inference framework to process the reconstructed parameters. The parameter distribution is mapped to the standard normal distribution space through a stochastic flow transformation model to generate a standardized feature matrix. For example, the pressure parameter is mapped from the original distribution to a normal distribution with a mean of 0 and a variance of 1.
[0077] The hierarchical probability encoder adopts a three-layer latent variable model structure. Each layer of the model constructs a probabilistic graph representation based on the spatio-temporal feature sequence to characterize the conditional dependence relationship between parameters. The parameter conditional probability matrix is calculated through an energy model. For example, when the given temperature is 50 °C, the conditional probability that the pressure parameter takes a value of 5 MPa is 0.8.
[0078] Finally, the network parameters are optimized based on the mutual information loss function. The loss function includes a log-likelihood estimation term and a divergence constraint term. The network parameters are iteratively optimized through the stochastic gradient variational inference algorithm, and finally a third risk assessment parameter matrix is generated. This matrix includes risk indicators such as the pipeline leakage probability and the degree of hazard.
[0079] Advantageous effects: The intelligent dimensionality reduction and feature extraction of pipeline operation parameters are realized through the adaptive dynamic sampling network, effectively reducing data redundancy, improving computational efficiency, and making the risk assessment process more efficient and accurate.
[0080] By combining the adversarial generative network and the probability representation learning network, the accurate modeling of the parameter distribution and probability representation are realized, overcoming the problem of insufficient modeling ability of traditional methods for complex non-linear relationships, and improving the accuracy of risk assessment.
[0081] The multi-layer latent variable model based on the hierarchical probability encoder can effectively capture the deep dependence relationship between parameters, realize the dynamic adaptability of the risk assessment process, and improve the reliability and robustness of the assessment results.
[0082] Figure 2 This is a schematic structural diagram of the natural gas pipeline leakage probability calculation system based on the genetic algorithm in the embodiment of the present invention. As Figure 2 shown, the system includes: The first unit is used to collect the operation parameters of the natural gas pipeline. The operation parameters include the pressure difference inside and outside the pipeline, the pipeline wall temperature gradient, the real-time change value of the pipeline wall thickness, the stress-strain curve of the pipeline material, the pipeline service fatigue period, the soil corrosion activity, and the environmental medium permeability; a pipeline structure dynamic stress model is established according to the pressure difference inside and outside the pipeline, the pipeline wall temperature gradient, and the real-time change value of the pipeline wall thickness; a material fatigue model is established according to the stress-strain curve of the pipeline material and the pipeline service fatigue period; a corrosion damage model is constructed according to the soil corrosion activity and the environmental medium permeability; A second unit is used to perform a coupled analysis on the dynamic stress model of the pipeline structure, the material fatigue model, and the corrosion damage model to obtain a first risk assessment parameter matrix, where the first risk assessment parameter matrix includes stress distribution parameters, fatigue damage parameters, and corrosion rate parameters; establish an initial model for pipeline leakage risk assessment according to the first risk assessment parameter matrix; use the initial model for pipeline leakage risk assessment as a fitness function; encode the stress distribution parameters, the corrosion rate parameters, and the material degradation parameters in the first risk assessment parameter matrix into chromosomes, and operate on the chromosomes to obtain an offspring population; A third unit is used to calculate the fitness values of each chromosome in the offspring population based on the fitness function, select the chromosome with the highest fitness value, and decode the chromosome with the highest fitness value to obtain a second risk assessment parameter matrix; establish a pipeline leakage probability calculation model according to the second risk assessment parameter matrix; collect the operating parameters of the target pipeline section; input the operating parameters of the target pipeline section into the pipeline leakage probability calculation model to obtain a third risk assessment parameter matrix of the target pipeline section; calculate a leakage probability prediction value of the target pipeline section according to the third risk assessment parameter matrix; perform a risk level division on the target pipeline section according to the leakage probability prediction value, and generate a pipeline leakage risk distribution map.
[0083] In the third aspect of the embodiments of the present invention, a kind of electronic device is provided, including: a processor; a memory for storing instructions executable by the processor; wherein, the processor is configured to call the instructions stored in the memory to execute the method described above.
[0084] In the fourth aspect of the embodiments of the present invention, a computer-readable storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method described above is implemented.
[0085] The present invention can be a method, a device, a system, and / or a computer program product. The computer program product can include a computer-readable storage medium, on which computer-readable program instructions for executing various aspects of the present invention are uploaded.
[0086] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for calculating the probability of leakage of a natural gas pipeline based on a genetic algorithm, characterized in that: include: Collecting the operating parameters of the natural gas pipeline, the operating parameters include the pressure difference between the inside and outside of the pipeline, the temperature gradient of the pipeline wall, the real-time change value of the pipeline wall thickness, the stress-strain curve of the pipeline material, the pipeline service fatigue cycle, the soil corrosion activity, and the environmental medium permeability; establishing a pipeline structure dynamic stress model based on the pressure difference between the inside and outside of the pipeline, the temperature gradient of the pipeline wall, and the real-time change value of the pipeline wall thickness; establishing a material fatigue model based on the stress-strain curve of the pipeline material and the pipeline service fatigue cycle; and constructing a corrosion damage model based on the soil corrosion activity and the environmental medium permeability; The pipeline structure dynamic stress model, the material fatigue model and the corrosion damage model are coupled and analyzed to obtain a first risk assessment parameter matrix, wherein the first risk assessment parameter matrix includes stress distribution parameters, fatigue damage parameters and corrosion rate parameters; Establishing an initial pipeline leakage risk assessment model according to the first risk assessment parameter matrix; using the initial pipeline leakage risk assessment model as a fitness function; encoding the stress distribution parameter, the corrosion rate parameter, and the material degradation parameter in the first risk assessment parameter matrix into chromosomes, and operating the chromosomes to obtain a progeny population; Calculating the fitness value of each chromosome in the offspring population based on the fitness function, selecting the chromosome with the highest fitness value, and decoding the chromosome with the highest fitness value to obtain a second risk assessment parameter matrix; A pipeline leakage probability calculation model is established according to the second risk assessment parameter matrix; the operating parameters of the target pipeline segment are collected; the operating parameters of the target pipeline segment are input into the pipeline leakage probability calculation model to obtain a third risk assessment parameter matrix of the target pipeline segment; a leakage probability prediction value of the target pipeline segment is calculated according to the third risk assessment parameter matrix; risk levels of the target pipeline segment are classified according to the leakage probability prediction value to generate a pipeline leakage risk distribution map.
2. The method according to claim 1, characterized in that The coupling analysis of the pipeline structure dynamic stress model, the material fatigue model and the corrosion damage model to obtain a first risk assessment parameter matrix includes: The pipeline is divided into a plurality of grid units along the axial direction, and a stress collection point, a corrosion monitoring point, and a fatigue detection point are set in each of the grid units; the soil corrosion activity and the environmental medium permeability of each of the grid units are obtained, and an electrochemical corrosion equation is established; the corrosion depth increment of each of the grid units is calculated according to the electrochemical corrosion equation; the corrosion depth increment is nonlinearly superimposed with the real-time change value of the pipeline wall thickness to obtain a pipeline wall thickness correction value of each of the grid units; and the pipeline wall thickness correction value is used as an input parameter of the pipeline structure dynamic stress model; Substitute the pipeline wall thickness correction value, the pressure difference between the inside and outside of the pipeline, and the pipeline wall temperature gradient into the pipeline structure dynamic stress model to obtain the stress distribution parameters of the stress collection point in each grid unit, and the stress distribution parameters include axial stress, hoop stress, and radial stress; substitute the stress distribution parameters, the pipeline material stress-strain curve, and the pipeline service fatigue cycle into the material fatigue model to obtain the fatigue damage parameters of the fatigue detection point in each grid unit, and the fatigue damage parameters include fatigue crack initiation rate and fatigue damage accumulation value; substitute the fatigue damage parameters, the soil corrosion activity, and the environmental medium permeability into the corrosion damage model to obtain the corrosion rate parameters of the corrosion monitoring point in each grid unit, and the corrosion rate parameters include corrosion current density and corrosion depth change rate; A coupled response equation group of the pipeline structure dynamic stress model, the material fatigue model, and the corrosion damage model is established; the stress distribution parameter, the fatigue damage parameter, and the corrosion rate parameter in each grid unit are substituted into the coupled response equation group for iterative calculation until the parameter change amount of two adjacent iterative calculations is less than a preset threshold; the stress distribution parameter, the fatigue damage parameter, and the corrosion rate parameter that have finally converged in the iteration are arranged in the order of the grid unit numbers to obtain a first risk assessment parameter matrix.
3. The method according to claim 1, characterized in that The step of establishing an initial model for pipeline leakage risk assessment according to the first risk assessment parameter matrix includes: Adaptively partition the first risk assessment parameter matrix, divide the pipeline into multiple risk assessment units based on spatial autocorrelation analysis, and calculate the spatial correlation of internal parameters of each risk assessment unit; construct a parameter importance evaluation index system, which includes parameter fluctuation amplitude, parameter change trend, and parameter spatial correlation; use fuzzy hierarchical analysis method to rank the importance of parameters of each risk assessment unit and determine the parameter weight coefficient matrix; Based on the parameter weight coefficient matrix, key influencing parameters are screened from a historical leakage accident database, and pipeline failure evolution feature sequences corresponding to the key influencing parameters are extracted, wherein the pipeline failure evolution feature sequences include stress distribution time series data, fatigue damage time series data, and corrosion rate time series data before the leakage occurs; a deep learning network model is constructed, wherein the number of input layer nodes of the deep learning network model is equal to the number of the key influencing parameters; the pipeline failure evolution feature sequence is input into the deep learning network model, and a risk feature extraction model is obtained by training; The parameter weight coefficient matrix of each risk assessment unit is combined with the risk feature extraction model to construct a dynamic risk assessment function; the risk warning index of each risk assessment unit is calculated based on the dynamic risk assessment function; a mapping relationship between the risk warning index, the parameter weight coefficient matrix, and the risk feature extraction model is established to construct a risk state transfer probability matrix; a risk warning threshold is designed according to the risk state transfer probability matrix, and the risk warning threshold is divided into multiple warning level intervals; the risk state transfer probability matrix, the risk warning threshold, the warning level interval, and the corresponding assessment parameters and calculation methods are integrated into an initial model for pipeline leakage risk assessment.
4. The method according to claim 1, characterized in that: The step of encoding the stress distribution parameter, the corrosion rate parameter, and the material degradation parameter in the first risk assessment parameter matrix into chromosomes and operating the chromosomes to obtain a progeny population includes: Performing data preprocessing on the stress distribution parameters, the corrosion rate parameters, and the material degradation parameters in the first risk assessment parameter matrix, using the standard deviation standardization method to eliminate the dimensional effect, using wavelet transform to remove parameter noise, and using the kernel density estimation method to correct outliers to obtain a standardized parameter matrix; establishing parameter statistical characteristics based on the standardized parameter matrix; constructing a parameter distribution model using the parameter statistical characteristics; constructing a parameter correlation network based on the standardized parameter matrix and the parameter distribution model, and calculating the Pearson correlation coefficient between parameters; calculating the Spearman rank correlation coefficient based on the parameter statistical characteristics; and calculating the mutual information coefficient based on the parameter distribution model; The Pearson correlation coefficient, the Spearman rank correlation coefficient and the mutual information coefficient are weighted and combined to generate a comprehensive parameter correlation evaluation index; a parameter correlation matrix is constructed according to the comprehensive parameter correlation evaluation index, and the parameter correlation matrix is divided into blocks using a spectral clustering algorithm to identify highly correlated parameter groups; a parameter optimization objective function is constructed based on the parameter correlation matrix, and the redundancy of the highly correlated parameter group is used as the first optimization objective, the discrete degree of the parameter statistical characteristics is used as the second optimization objective, and the fitting error of the parameter distribution model is used as the third optimization objective; the parameter optimization objective function is normalized, and the objective function weight coefficient is calculated based on the comprehensive parameter correlation evaluation index; a multi-objective optimization problem is converted into a single-objective optimization problem using a weighted Chebyshev method; An adaptive weight adjustment model is constructed based on the objective function weight coefficient, and the adaptive weight adjustment model dynamically updates the weight coefficient according to the parameter correlation matrix; the parameter values in the standardized parameter matrix are converted into binary codes according to the adaptive weight coefficients, and a Gray code coding scheme is used to improve coding efficiency; a chromosome structure is constructed according to the binary code, and an initial chromosome population that meets the constraint conditions is randomly generated based on the chromosome structure; and the initial chromosome population is operated to obtain a progeny population.
5. The method according to claim 4, characterized in that The step of operating the initial chromosome population to obtain a progeny population includes: Performing a Pareto non-dominated sort on the initial chromosome population, calculating the crowding distance of each chromosome individual, constructing a selection operator based on the crowding distance, wherein the selection probability of the selection operator is proportional to the individual crowding distance; performing a selection operation on the initial chromosome population using the selection operator to obtain a first offspring population; Dynamically determine the crossover position of the chromosome individuals in the first offspring population, set a crossover probability adaptive adjustment factor according to the coupling degree between the parameters, and dynamically update the crossover probability adaptive adjustment factor with the population evolution generation; perform a multi-point crossover operation on the first offspring population based on the crossover probability adaptive adjustment factor to obtain a second offspring population; calculate the parameter sensitivity of the chromosome individuals in the second offspring population, and construct a parameter variation probability model, wherein the parameter variation probability model assigns a preset variation probability to a gene position with high parameter sensitivity; According to the parameter mutation probability model, a non-uniform mutation operation is performed on the second child population, and the variation asynchronism of the non-uniform mutation operation decays exponentially with the number of evolution generations, so as to obtain a third child population; the third child population is decoded into optimized stress distribution parameters, corrosion rate parameters, and material degradation parameters, and the optimization effect is evaluated based on the parameter optimization objective function; when the non-dominated solution sets of multiple consecutive generations of populations converge and are evenly distributed, the Pareto optimal solution set is output to obtain the optimal parameter combination.
6. The method according to claim 1, characterized in that Calculating the fitness value of each chromosome in the offspring population based on the fitness function, selecting the chromosome with the highest fitness value, and decoding the chromosome with the highest fitness value to obtain a second risk assessment parameter matrix; Establishing a pipeline leakage probability calculation model according to the second risk assessment parameter matrix includes: Based on the fitness function, a hierarchical fitness calculation framework is constructed by adopting a multi-objective evaluation method, and the hierarchical fitness calculation framework includes a basic evaluation layer, a cross-validation layer, and a comprehensive evaluation layer; each chromosome in the offspring population is input into the hierarchical fitness calculation framework, and a chromosome feature vector is constructed by using the basic evaluation layer, and the chromosome is subjected to parameter matching calculation, prediction accuracy calculation, and calculation efficiency calculation to obtain a calculation result; the chromosome feature vector and the calculation result are input into the cross-validation layer, and the verification model is used to perform iterative verification operation to obtain a verification result; in combination with a weight coefficient dynamic optimization matrix, a nonlinear weighted calculation is performed on the verification result, a chromosome feature mapping network is constructed, and a chromosome fitness value sequence and a feature association matrix are output; A chromosome optimization mechanism is constructed by adopting a tournament selection strategy, and the population parameters are calculated based on the characteristic association matrix, and an adaptive competition radius is set; the chromosome fitness value sequence is input into the competition mechanism, and the fitness value, number of iterations, and parameter stability index of the chromosomes participating in the competition are calculated to form a comprehensive evaluation vector; a multi-objective optimization function is constructed, and a multi-objective sorting operation is performed on the chromosomes according to the Pareto dominance relationship to establish a non-dominated solution set; in the non-dominated solution set, the chromosome fitness is evaluated based on the characteristic mapping network, and the chromosome with the highest fitness value is selected; A feature decoupling unit, a precision adjustment unit, and a parameter reconstruction unit are set up in a multi-level decoding conversion network; the chromosome with the highest fitness value and the feature association matrix are input into the feature decoupling unit, and feature separation is performed using a variational inference method; a decoding precision calculation model is constructed using the chromosome feature vector, and the decoding precision is calculated through the precision adjustment unit; the decoding precision is input into a parameter reconstruction unit, and a deep neural network is used for parameter mapping, and the parameters are corrected in combination with the weight coefficient dynamic optimization matrix to generate a second risk assessment parameter matrix.
7. The method according to claim 1, characterized in that The step of inputting the operating parameters of the target pipeline segment into the pipeline leakage probability calculation model to obtain a third risk assessment parameter matrix of the target pipeline segment includes: The operating parameters of the target pipeline section are input into a pipeline leakage probability calculation model, wherein the pipeline leakage probability calculation model includes an adaptive dynamic sampling network, a generative adversarial network and a probabilistic representation learning network, and the adaptive dynamic sampling network includes a spatiotemporal attention module and a parameter reconstruction module; the spatiotemporal attention module uses a multi-head cross-attention mechanism to calculate a parameter weight matrix, and a parameter dependency graph is constructed based on the parameter weight matrix through an asynchronously updated hierarchical attention network, and a parameter dimension reduction matrix is constructed based on the parameter dependency graph using a recursive tensor decomposition method; The parameter reconstruction module inputs the parameter dimension reduction matrix into a generative adversarial network, which includes a generator and a discriminator. The generator generates reconstruction parameters based on the parameter weight matrix, and the discriminator calculates the distribution distance between the reconstruction parameters and the original parameters, and optimizes the reconstruction parameters in combination with the cycle consistency constraint function to generate a spatiotemporal feature sequence and a parameter reconstruction matrix; the spatiotemporal feature sequence and the parameter reconstruction matrix are input into a probabilistic representation learning network, which adopts a variational inference framework, constructs a random stream transformation model based on the parameter reconstruction matrix, maps the parameter distribution to the standard normal distribution space, and obtains a standardized feature matrix; A hierarchical probability encoder is constructed according to the standardized feature matrix, and the hierarchical probability encoder includes multiple layers of latent variable models. Each layer of latent variable models establishes a probability graph representation of parameter distribution based on the spatiotemporal feature sequence, and an energy model is used to construct a parameter conditional probability matrix. A mutual information loss function is constructed based on the standardized feature matrix and the parameter conditional probability matrix, and the mutual information loss function includes a log-likelihood estimation term and a divergence constraint term. The conditional probability distribution is calculated according to the parameter conditional probability matrix, and the network parameters of the hierarchical probability encoder are iteratively optimized using a stochastic gradient variational inference algorithm to generate a third risk assessment parameter matrix.
8. A natural gas pipeline leakage probability calculation system based on genetic algorithm, used to implement the method according to any one of claims 1 to 7, characterized in that: include: The first unit is used to collect the operating parameters of the natural gas pipeline, the operating parameters include the pressure difference between the inside and outside of the pipeline, the temperature gradient of the pipeline wall, the real-time change value of the pipeline wall thickness, the stress-strain curve of the pipeline material, the pipeline service fatigue cycle, the soil corrosion activity, and the environmental medium permeability; a pipeline structure dynamic stress model is established according to the pressure difference between the inside and outside of the pipeline, the temperature gradient of the pipeline wall, and the real-time change value of the pipeline wall thickness; a material fatigue model is established according to the stress-strain curve of the pipeline material and the pipeline service fatigue cycle; a corrosion damage model is constructed according to the soil corrosion activity and the environmental medium permeability; The second unit is used to couple the pipeline structure dynamic stress model, the material fatigue model and the corrosion damage model to obtain a first risk assessment parameter matrix, wherein the first risk assessment parameter matrix includes stress distribution parameters, fatigue damage parameters and corrosion rate parameters; Establishing an initial model for pipeline leakage risk assessment according to the first risk assessment parameter matrix; Using the initial model for pipeline leakage risk assessment as a fitness function; Encoding the stress distribution parameter, the corrosion rate parameter, and the material degradation parameter in the first risk assessment parameter matrix into chromosomes, and operating the chromosomes to obtain a progeny population; The third unit is used to calculate the fitness value of each chromosome in the offspring population based on the fitness function, select the chromosome with the highest fitness value, and decode the chromosome with the highest fitness value to obtain a second risk assessment parameter matrix; A pipeline leakage probability calculation model is established according to the second risk assessment parameter matrix; the operating parameters of the target pipeline segment are collected; the operating parameters of the target pipeline segment are input into the pipeline leakage probability calculation model to obtain a third risk assessment parameter matrix of the target pipeline segment; a leakage probability prediction value of the target pipeline segment is calculated according to the third risk assessment parameter matrix; risk levels of the target pipeline segment are classified according to the leakage probability prediction value to generate a pipeline leakage risk distribution map.
9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method described in any one of claims 1 to 7.
10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Composite flexible pipeline monitoring method and system based on digital twinning
CN118821521A
Method and apparatus for characterizing composite materials using an artificial neural network
US20150170022A1
Cited By
Flue gas waste heat recovery system optimization design method considering external parameter change
CN120337798A
Method and system for monitoring corrosion state of long-distance pipeline
CN120351463A
Method and system for predicting dynamic leakage of old oil and gas pipeline
CN120508894A
Quantitative risk calculation method for oil and gas pipeline
CN120562894A
Oil and gas pipeline quantitative risk calculation method
CN120562894B