Gas pipeline leakage high-precision detection method based on gradient reinforcement learning

Through gradient reinforcement learning and improved genetic algorithms, combined with a Gaussian plume diffusion model and a multi-layer convolutional neural network, high-precision detection of gas pipeline leaks is achieved, solving the problems of inaccurate positioning and insufficient dynamic response capabilities in existing technologies, and improving detection efficiency and accuracy.

CN120671759APending Publication Date: 2025-09-19CHONGQING JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510765441.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-10
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Existing gas pipeline leak detection technology lacks adaptability in complex environments and is difficult to achieve high-precision positioning. In particular, positioning accuracy is limited in multi-target leakage scenarios, and dynamic response capabilities are insufficient. There are problems such as high missed detection rate, positioning delay and high operation and maintenance costs.

Method used

Using a gradient reinforcement learning method, utilizing drones equipped with GPS and gas concentration detection functions, combined with a Gaussian smoke plume diffusion model and a multi-layer convolutional neural network, an improved deep reinforcement learning model and genetic algorithm are constructed to dynamically plan the detection path and achieve high-precision positioning of the leak point.

Benefits of technology

It improves the positioning accuracy and precision of gas pipeline leakage points, enhances the stability and detection efficiency of drones in complex environments, reduces the missed detection rate, and provides real-time monitoring and visual display of leakage conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120671759A_ABST
    Figure CN120671759A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of gas pipeline leakage detection, and discloses a gas pipeline leakage high-precision detection method based on gradient reinforcement learning, and the method comprises the following steps: S1, deploying an unmanned plane carrying a GPS function and a gas concentration detection function to a target region, and obtaining gas leakage concentration actual measurement data of different spatial positions; s2, acquiring environmental factors of a target area, importing related factors such as wind power and temperature into a pre-trained Gaussian smoke plume diffusion model, and formulating a preliminary detection path to detect the target area; by means of a visualization technology, key information such as gas concentration distribution of a leakage area, an unmanned aerial vehicle detection path and a leakage point position is visually presented through a graphical interface. And calculating the coordinates of the leakage points by using an improved genetic algorithm, marking the coordinates in a visual interface, and synchronously displaying a gas concentration contour line, a contour surface and a concentration gradient, so that operation and maintenance personnel clearly know the diffusion situation of the leakage area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of gas pipeline leakage detection, and in particular to a high-precision gas pipeline leakage detection method based on gradient reinforcement learning. Background Art

[0002] As the core artery of urban energy transportation, the safe operation of gas pipelines is directly related to public safety and ecological stability. However, gas leak detection technology faces multiple technical bottlenecks in practical application. Traditional gas leak monitoring methods mainly include physical sensor networks, optical detection technology, and manual inspections. While fixed gas sensor networks based on electrochemical or semiconductors can achieve continuous monitoring, they are expensive to deploy and susceptible to environmental corrosion and cross-sensitivity interference, resulting in a high false alarm rate. Distributed fiber optic sensing technology, while advantageous for long-distance monitoring, has limited spatial resolution and inadequate sensitivity to small leaks. Among optical detection methods, infrared imaging technology is limited by detection range and gas concentration threshold, significantly increasing the probability of failure in low-concentration leaks or in rainy and foggy conditions. Tunable diode laser absorption spectroscopy (TDLAS) offers high accuracy, but the equipment is bulky and requires strict optical path calibration, making it difficult to adapt to complex terrain. Acoustic detection technology captures pipeline vibration signals caused by leaks, but its frequency domain characteristics are susceptible to background noise, resulting in a sharp drop in signal-to-noise ratio in noisy environments such as industrial areas. Manual inspection, as a supplementary means, has defects such as strong subjectivity and delayed response, and the risks of operating in hazardous environments are extremely high.

[0003] Existing leak detection technologies lack adaptability in complex environments. Factors such as the intertwined distribution of urban underground pipelines, the intermingling of multiple gas sources in industrial areas, and the heterogeneity of soil media make it difficult to model the diffusion paths of leaking gases, and small leak signals are easily drowned out by environmental noise. Furthermore, real-time response capabilities are insufficient in dynamic leak scenarios. Wind speed fluctuations and differences in temperature and humidity can significantly impact gas concentration distributions, making it difficult for traditional methods to dynamically decouple leak signatures and rapidly identify them. Furthermore, positioning accuracy is limited in multi-target leak scenarios. Existing technologies are poorly adaptable to complex leak scenarios such as multiple concurrent leaks and intermittent leaks, leading to cumulative positioning errors. Traditional detection path planning algorithms suffer from poor traversability and high rates of duplicate detection, making it difficult to optimally allocate detection resources in the event of sudden leaks. These technical shortcomings collectively lead to increased missed detection rates, increased positioning latency, and escalating operational and maintenance costs in complex scenarios. Existing detection methods are particularly prone to blind spots in remote or high-risk areas, making it difficult to achieve both high accuracy and full coverage.

[0004] In response to the above problems, the present invention aims to provide a high-precision gas pipeline leakage detection method based on gradient reinforcement learning to overcome the shortcomings of the existing technology. Summary of the Invention

[0005] In response to the shortcomings of the existing technology, the present invention provides a high-precision gas pipeline leakage detection method based on gradient reinforcement learning, which solves the problems raised in the above background technology.

[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions: a high-precision gas pipeline leakage detection method based on gradient reinforcement learning, comprising the following steps:

[0007] S1: Deploy drones equipped with GPS and gas concentration detection functions to the target area to obtain measured data on gas leakage concentrations at different spatial locations;

[0008] S2: Obtain the environmental factors of the target area, import relevant factors such as wind speed and temperature into the pre-trained Gaussian smoke plume diffusion model, and formulate a preliminary detection path to detect the target area;

[0009] S3: Utilize concentration distribution data and concentration gradient data to construct an information matrix, then use a multi-layer convolutional neural network to extract spatial distribution features and develop a detection method for key leakage areas;

[0010] S4: Build an improved deep reinforcement learning model, formulate the model's learning strategy and improve path planning based on the information from the initial detection;

[0011] S5: Construct an improved genetic algorithm to locate the coordinates of the target leakage point, wherein the calculation formula for the gas diffusion concentration at each point in the output layer of the Gaussian plume diffusion model is:

[0012]

[0013] Where Q is the proposed diffusion intensity of the leakage point, u is the wind speed, σy and σz are the horizontal and vertical diffusion coefficients around the target point, respectively, and x, y, and z are the coordinates of the gas leakage point in the north-south, east-west, and vertical directions, respectively.

[0014] Preferably, the steps for constructing the Gaussian plume diffusion model in step S2 are as follows:

[0015] S2.1: Define the three-dimensional coordinate matrix of the gas leak point in the direction, where is the three-dimensional coordinate quantity, which is the coordinate value of the gas leak point in the north-south, east-west, and vertical directions respectively;

[0016] S2.2: Define the diffusion coefficients in all directions around the gas leak point, where is the surface factor, which are the horizontal diffusion coefficient, longitudinal diffusion coefficient, and vertical diffusion coefficient around the target point;

[0017] S2.3: Define the system parameter matrix of the model, where is the proposed diffusion intensity of the leak point, is the height of the leak point, and is the wind speed;

[0018] S2.4: In the input layer of the Gaussian plume diffusion model, the coordinate matrix of the known points, the diffusion coefficient, and the system parameters are input into the simulation environment as an independent feature channel to construct the concentration diffusion matrix;

[0019] S2.5: Determine the nodes on the initial path based on the size of the target area, where the length, width, and height of the target area are represented respectively. Each node is half of the length, width, and height of the target area. Construct the initial path. The expression of the node is:

[0020]

[0021] Among them, L, W, and H represent the length, width, and height of the target area, respectively, and are parameters for determining the position of the node at the boundary.

[0022] Preferably, in step S3, the information matrix is ​​constructed using the concentration distribution data and the concentration gradient data, and the spatial distribution features are extracted using a multi-layer convolutional neural network to construct a detection method for key leakage areas as follows:

[0023] S3.1: Construct a formula to calculate the concentration gradient between two leakage points. The gradient value of this formula is G, which is expressed as:

[0024]

[0025] Among them, x, y, and z are the coordinates of the gas leakage point in the north-south, east-west, and vertical directions respectively, and C is the concentration value of the point;

[0026] S3.2: Identify key detection areas based on the numerical changes in concentration values ​​and concentration gradient values ​​along the preliminary detection path;

[0027] S3.3: Construct a value calculation formula for selected points to evaluate and compare the efficiency of the paths. The calculation formula is:

[0028]

[0029] Where C is the concentration value of the point, and d is the Euclidean distance between the point and the point with the highest concentration;

[0030] S3.4: Integrate the concentration data and concentration gradient data of the observation points into an information matrix, which is expressed as:

[0031]

[0032] S3.5: Based on the size of the leakage scene, select a convolution kernel of size 7×7 to extract the local concentration change feature. The expression is:

[0033]

[0034] Among them, n and m are the height and width of the convolution kernel respectively;

[0035] S3.6: Convolve the information matrix to generate a feature map, which is expressed as:

[0036] F=K*M.

[0037] Preferably, the steps of constructing the improved deep reinforcement learning model in step S4 are as follows:

[0038] S4.1: The gas concentration level is divided into three levels: high, medium and low. The drone will be rewarded after detecting the corresponding level. The expression is as follows:

[0039]

[0040] S4.2: Set the step penalty to improve the detection efficiency of the drone. The expression is as follows:

[0041] R2=-α·t

[0042] Among them, α is the step penalty coefficient, and t is the number of steps the drone has taken so far;

[0043] S4.3: Provide corresponding rewards based on the change in gradient value to encourage the drone to move towards and explore areas with higher concentrations. The expression is as follows:

[0044]

[0045] Among them, β is the gradient reward coefficient;

[0046] S4.4: Encourage UAVs to explore unknown areas and avoid falling into local optimal solutions. The expression is:

[0047]

[0048] Among them, γ is the detection weight, N s The number of visits to the current state;

[0049] S4.5: Set boundary penalties to prevent the drone from moving along the boundary or local optimal value. The expression is:

[0050] R5=-δ·1 B (s)

[0051] Among them, δ is the boundary penalty coefficient, B is the boundary range set, and s is the current state of the drone;

[0052] S4.6: Set the target proximity. When the drone approaches the key area, it will be rewarded. The expression is:

[0053]

[0054] Among them, ∈ is the weight close to the key area, d target (s) is the distance from the UAV to the nearest target in the current state;

[0055] S4.7: Set the current detection target. When the drone completes the first leak detection, adjust the reward after detection and encourage continued detection. The expression is:

[0056]

[0057] Among them, ζ is the weight after the target is replaced, D is the number of leakage points currently detected by the UAV, and D total The number of leakage points that the drone will detect next;

[0058] S4.8: Set the number of remaining steps to encourage the drone to complete the task with fewer detection steps and time. The expression is:

[0059]

[0060] Where η is the weight of detection efficiency, T max is the maximum number of detection steps allowed, and t is the number of steps the drone has taken in the current state;

[0061] S4.9: Set a repeated detection penalty to prevent the drone from repeatedly detecting a point or falling into a local optimal solution. The expression is:

[0062] R9=-θ·N r

[0063] Among them, θ is the weight of the penalty, N_r is the number of visits to the state;

[0064] S4.10: Summarize the above rewards and penalties to obtain the final experience value EXP of the drone training, which is expressed as:

[0065] EXP=R1+R2+R3+R4+R5+R6+R7+R8+R9

[0066] S4.11: Input the observation point location information matrix and construct the spatiotemporal characteristic matrix from the collected concentration data. The expression is:

[0067]

[0068] Among them, C i is the concentration value of the i-th observation point, (x i ,y i ,z i ) is the three-dimensional coordinate of the i-th observation point;

[0069] S4.12: Update the long-short-term memory model at each moment and take the hidden state at the last moment as the memory feature of the entire historical concentration sequence, where:

[0070] The forget gate expression is:

[0071] f t =ρ(W f ·[h t-1 ,Q t ]+d f )

[0072] Among them, is the forget information, is the activation function, is the weight matrix of the forget gate, represents the hidden state of the previous moment, represents the input of the current moment, and is the bias term of the forget gate;

[0073] Determine what new information needs to be stored in the memory cell. The input gate expression is:

[0074] i t =ρ(W i ·[h t-1 ,Q t ]+d i )

[0075] Among them, W i is the weight matrix of the input gate, d i is the bias term of the input gate;

[0076] The candidate memory cell state is expressed as:

[0077]

[0078] Among them, W u is the weight matrix of the candidate state, d u is the bias term, and tanh is the activation function;

[0079] Update the memory unit state, U t The expression is:

[0080]

[0081] Among them, U t-1 Indicates the state of the memory unit at the previous moment;

[0082] Determine the hidden state of the output, the output gate expression is:

[0083] O t =ε*W O ·[h t-1 ,Q i ]+d O

[0084] Among them, ε represents the activation function of the output gate, W O is the weight matrix of the output gate, d O is the bias term of the output gate;

[0085] h t =O t tanh+U t

[0086] Among them, h t Represents the hidden state output at the current moment.

[0087] Preferably, the steps of constructing an improved genetic algorithm in step S5 to locate the coordinates of the target leakage point are as follows:

[0088] S5.1: Dynamically adjust the gene pool in the genetic algorithm, selecting individuals not only from the retained subpopulation but also from individuals eliminated during the selection phase;

[0089] S5.2: Dynamically control the crossover rate during the iteration process. Introduce random numbers and crossover rates to influence the crossover operation. The expression is:

[0090]

[0091] Among them, P c is the crossover rate in the current state, P max is the maximum crossover rate, P min is the minimum crossover rate, F avg is the average fitness of the population, F max is the maximum fitness of the population;

[0092] S5.3: Set up a memory mechanism, introduce short-term and long-term memory mechanisms to store historical optimal solutions and potential search areas, and regularly use this information to guide the search during the evolution process;

[0093] S5.4: Set the stagnation generation. The improved genetic algorithm introduces the concept of stagnation generation, which indicates that the evolution has entered a stagnation stage. At this time, the fitness of the optimal individual no longer changes in several generations. By setting the maximum stagnation generation, if the generation number is less than this value, the algorithm will continue to perform crossover and mutation operations. Otherwise, the algorithm will switch to a new operation, such as introducing new individuals or adopting a new search strategy:

[0094]

[0095] Among them, F c is the fitness in the current state, For the adaptation of the previous state, is the minimum increase threshold;

[0096] S5.5: The concept of maternal inheritance is introduced. When the number of stagnant generations is less than the maximum value, the improved genetic algorithm will choose to eliminate individuals from the gene pool and hybridize them with the main individuals. The maternal inheritance rate is introduced in the hybridization process. The expression is:

[0097] Ο=τ·V m +(1-τ)·V f

[0098] Among them, V m is the maternal individual, V f is the paternal individual, τ is the maternal heritability, and O is the offspring individual

[0099] S5.6: Use random numbers to control whether to follow the optimal individual. When this strategy is triggered, the current individual will follow the current optimal individual and introduce interference items that follow the normal distribution.

[0100]

[0101] Among them, g is the current location of the individual, g * is the best individual in the current population, is the interference vector, α is the guidance strength coefficient;

[0102] S5.7: Add an active search mechanism. If the strategy of following the best individual is not triggered, the improved genetic algorithm will perform an active search and the current individual will be repositioned according to the best individual and maternal heritability.

[0103]

[0104] Among them, g is the current location of the individual, g * is the best individual in the current population, is the interference vector, α is the guidance strength coefficient, V m For the maternal individual;

[0105] S5.8: Introduce an adaptive update and iteration mechanism to continuously generate new individuals during the iteration process and dynamically select different operation paths based on the current evolutionary state. The expression is as follows:

[0106]

[0107] Among them, g is the current individual, g * is the current optimal individual, V m is the maternal individual, Ψ f is the degree of improvement of the optimal fitness of several generations, ρ, α and Control parameters for each strategy;

[0108] S5.9: Finally, the best individual is selected from the continuously generated new individuals as the solution of the leakage point coordinates. The expression is:

[0109]

[0110] Among them, G * is the individual with the best fitness value in the whole iteration process, that is, the estimated leakage point coordinates; The position vector of the i-th individual in the t-th generation represents the coordinates of the candidate leakage point, is the fitness function.

[0111] 6. Preferably, when the drone performs a detection mission, its flight altitude and speed are dynamically adjusted according to the environmental factors and leakage concentration data of the target area to ensure the accuracy and efficiency of detection. The flight altitude adjustment formula is:

[0112] h new =h base +k·C avg

[0113] Among them, h new is the adjusted flight altitude, h base is the reference flight altitude, k is the adjustment coefficient, C avg is the average leakage concentration in the current area.

[0114] Preferably, the parameters of the Gaussian plume diffusion model can be dynamically updated according to the environmental data obtained in real time to improve the simulation accuracy of the model for the diffusion of leaked gas. The parameter update formula is:

[0115]

[0116] Among them, σ new is the updated diffusion coefficient, σ old is the diffusion coefficient before updating, α is the temperature sensitivity coefficient, ΔT is the change in ambient temperature, T ref is the reference temperature.

[0117] Preferably, the structure and parameters of the multi-layer convolutional neural network are optimized to maximize the extraction of the spatial distribution characteristics and concentration gradient characteristics of the leakage area. The optimized convolution kernel parameter update formula is:

[0118]

[0119] Among them, K new is the updated convolution kernel parameter, K old is the convolution kernel parameter before updating, η is the learning rate, is the gradient of the loss function with respect to the convolution kernel parameters.

[0120] Preferably, the parameters of the improved deep reinforcement learning model and the improved genetic algorithm are trained and verified with a large amount of experimental data to ensure their stability and generalization ability under different leakage scenarios. The parameter training update formula is:

[0121]

[0122] Among them, θ new is the updated model parameter, θ old is the model parameter before updating, α is the step size coefficient, is the gradient of the objective function with respect to the model parameters.

[0123] Preferably, the method further includes visual display of the detection results, and intuitively presents information such as the location of the leakage point, concentration distribution, and detection path through a graphical interface, so that the user can quickly understand the leakage situation and take corresponding measures. The coordinate transformation formula for the visual display is:

[0124]

[0125] Among them, x disp 、y disp To display coordinates, x leak 、y leak is the actual coordinate of the leakage point, scale x 、scale y is the coordinate scaling factor, x offset 、y offset is the coordinate offset.

[0126] The present invention provides a high-precision gas pipeline leak detection method based on gradient reinforcement learning. It has the following beneficial effects:

[0127] 1. The present invention achieves high-precision positioning of gas pipeline leakage points through deep fusion of gradient reinforcement learning and improved genetic algorithm. The drone equipped with GPS and gas concentration detection function plans the path according to the Gaussian smoke plume diffusion model and obtains multi-dimensional data of the leakage area in real time. The convolutional neural network is used to extract spatial features, the reinforcement learning model dynamically plans the path, and the genetic algorithm is used to globally optimize the coordinate solution of the leakage point. After verification by multi-scenario experiments, this method has high positioning accuracy and excellent positioning precision, which is significantly improved compared with traditional methods. Its advantages are: first, multi-source data fusion enhances information reliability; second, reinforcement learning dynamic path planning improves detection efficiency; third, the improved genetic algorithm effectively solves the local optimal dilemma and achieves global optimal solution. Even in complex and changeable leakage scenarios, it can quickly and accurately lock the source of the leakage, thus gaining valuable time for subsequent repair work.

[0128] 2. This invention endows drones with superior autonomous detection capabilities, significantly enhancing their stability and versatility in complex environments. The Gaussian plume diffusion model, combined with real-time environmental parameters, generates a highly adaptable initial detection path for the drone. The reinforcement learning model adjusts its strategy based on real-time feedback, enabling the drone to flexibly respond to environmental changes. Whether in complex urban pipe networks or in remote mountainous areas, the drone can stably perform detection missions. To address the issue of small leak signals being susceptible to interference, this method leverages reinforcement learning to optimize the reward mechanism, incentivizing drones to explore high-concentration areas, improving the recognition rate of small leaks and effectively reducing the missed detection rate.

[0129] 3. This invention leverages visualization technology to intuitively present key information, such as the gas concentration distribution in the leak area, the drone's detection path, and the leak point location, through a graphical interface. Leak point coordinates are calculated using an improved genetic algorithm and marked on the visualization interface. Gas concentration contour lines, isosurfaces, and concentration gradients are simultaneously displayed, providing maintenance personnel with a clear understanding of the leak's diffusion pattern. Combined with real-time drone data transmission, the visualization interface dynamically updates, enabling real-time monitoring and early warning of leak incidents. BRIEF DESCRIPTION OF THE DRAWINGS

[0130] Figure 1 It is the overall flow chart of the present invention;

[0131] Figure 2 Schematic diagram of the path segmentation experimental area under multiple leakage points of the present invention. DETAILED DESCRIPTION

[0132] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the present specification. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0133] Example:

[0134] Please see the attached Figure 1 -Attached Figure 2 The embodiment of the present invention provides a high-precision gas pipeline leakage detection method based on gradient reinforcement learning, comprising the following steps:

[0135] S1: Deploy drones equipped with GPS and gas concentration detection functions to the target area to obtain measured data on gas leakage concentrations at different spatial locations;

[0136] S2: Obtain the environmental factors of the target area, import relevant factors such as wind speed and temperature into the pre-trained Gaussian smoke plume diffusion model, and formulate a preliminary detection path to detect the target area. The steps for constructing the Gaussian smoke plume diffusion model in step S2 are as follows:

[0137] S2.1: Define the three-dimensional coordinate matrix of the gas leakage point in the direction, where is the three-dimensional coordinate quantity, which is the coordinate value of the gas leakage point in the north-south, east-west, and vertical directions respectively.

[0138] S2.2: Define the diffusion coefficients in all directions around the gas leak point, where is the surface factor, which are the horizontal diffusion coefficient, longitudinal diffusion coefficient, and vertical diffusion coefficient around the target point;

[0139] S2.3: Define the system parameter matrix of the model, where is the proposed diffusion intensity of the leak point, is the height of the leak point, and is the wind speed;

[0140] S2.4: In the input layer of the Gaussian plume diffusion model, the coordinate matrix of the known points, the diffusion coefficient, and the system parameters are input into the simulation environment as an independent feature channel to construct the concentration diffusion matrix;

[0141] S2.5: Determine the nodes on the initial path based on the size of the target area, where the length, width, and height of the target area are represented respectively. Each node is half of the length, width, and height of the target area. Construct the initial path. The expression of the node is:

[0142]

[0143] Among them, L, W, and H represent the length, width, and height of the target area, respectively, and are parameters for determining the position of the node at the boundary.

[0144] S3: Utilize concentration distribution data and concentration gradient data to construct an information matrix, then use a multi-layer convolutional neural network to extract spatial distribution features and develop a detection method for key leakage areas;

[0145] In step S3, the information matrix is ​​constructed using the concentration distribution data and the concentration gradient data, and then the spatial distribution features are extracted using a multi-layer convolutional neural network. The steps for constructing a detection method for key leakage areas are as follows:

[0146] S3.1: Construct a formula to calculate the concentration gradient between two leakage points. The gradient value of this formula is G, which is expressed as:

[0147]

[0148] Among them, x, y, and z are the coordinates of the gas leakage point in the north-south, east-west, and vertical directions respectively, and C is the concentration value of the point;

[0149] S3.2: Based on the numerical changes of concentration values ​​and concentration gradient values ​​along the preliminary detection path, distinguish the key detection areas; the path is divided into key areas such as Figure 2 shown.

[0150] S3.3: Construct a value calculation formula for selected points to evaluate and compare the efficiency of the paths. The calculation formula is:

[0151]

[0152] Where C is the concentration value of the point, and d is the Euclidean distance between the point and the point with the highest concentration;

[0153] S3.4: Integrate the concentration data and concentration gradient data of the observation points into an information matrix, which is expressed as:

[0154]

[0155] S3.5: Based on the size of the leakage scene, select a convolution kernel of size 7×7 to extract the local concentration change feature. The expression is:

[0156]

[0157] Among them, n and m are the height and width of the convolution kernel respectively;

[0158] S3.6: Convolve the information matrix to generate a feature map, which is expressed as:

[0159] F=K*M.

[0160] S4: Build an improved deep reinforcement learning model, formulate the model's learning strategy and improve path planning based on the information from the initial detection;

[0161] The steps for constructing the improved deep reinforcement learning model in step S4 are as follows:

[0162] S4.1: The gas concentration level is divided into three levels: high, medium and low. The drone will be rewarded after detecting the corresponding level. The expression is as follows:

[0163]

[0164] S4.2: Set the step penalty to improve the detection efficiency of the drone. The expression is as follows:

[0165] R2=-α2t

[0166] Among them, α is the step penalty coefficient, and t is the number of steps the drone has taken so far;

[0167] S4.3: Provide corresponding rewards based on the change in gradient value to encourage the drone to move towards and explore areas with higher concentrations. The expression is as follows:

[0168]

[0169] Among them, β is the gradient reward coefficient;

[0170] S4.4: Encourage UAVs to explore unknown areas and avoid falling into local optimal solutions. The expression is:

[0171]

[0172] Among them, γ is the detection weight, N s The number of visits to the current state;

[0173] S4.5: Set boundary penalties to prevent the drone from moving along the boundary or local optimal value. The expression is:

[0174] R5=-δ·1 B (s)

[0175] Among them, δ is the boundary penalty coefficient, B is the boundary range set, and s is the current state of the drone;

[0176] S4.6: Set the target proximity. When the drone approaches the key area, it will be rewarded. The expression is:

[0177]

[0178] Among them, ∈ is the weight close to the key area, d target (s) is the distance from the UAV to the nearest target in the current state;

[0179] S4.7: Set the current detection target. When the drone completes the first leak detection, adjust the reward after detection and encourage continued detection. The expression is:

[0180]

[0181] Among them, ζ is the weight after the target is replaced, D is the number of leakage points currently detected by the UAV, and D total The number of leakage points that the drone will detect next;

[0182] S4.8: Set the number of remaining steps to encourage the drone to complete the task with fewer detection steps and time. The expression is:

[0183]

[0184] Where η is the weight of detection efficiency, T maxis the maximum number of detection steps allowed, and t is the number of steps the drone has taken in the current state;

[0185] S4.9: Set a repeated detection penalty to prevent the drone from repeatedly detecting a point or falling into a local optimal solution. The expression is:

[0186] R9=-θ·N r

[0187] Among them, θ is the weight of the penalty, N_r is the number of visits to the state;

[0188] S4.10: Summarize the above rewards and penalties to obtain the final experience value EXP of the drone training, which is expressed as:

[0189] EXP=R1+R2+R3+R4+R5+R6+R7+R8+R9

[0190] S4.11: Input the observation point location information matrix and construct the spatiotemporal characteristic matrix from the collected concentration data. The expression is:

[0191]

[0192] Among them, C i is the concentration value of the i-th observation point, (x i ,y i ,z i ) is the three-dimensional coordinate of the i-th observation point;

[0193] S4.12: Update the long-short-term memory model at each moment and take the hidden state at the last moment as the memory feature of the entire historical concentration sequence, where:

[0194] The forget gate expression is:

[0195] f t =ρ(W f ·[h t-1 ,Q t ]+d f )

[0196] Among them, is the forget information, is the activation function, is the weight matrix of the forget gate, represents the hidden state of the previous moment, represents the input of the current moment, and is the bias term of the forget gate;

[0197] Determine what new information needs to be stored in the memory cell. The input gate expression is:

[0198] i t =ρ(W i ·[h t-1 ,Q t ]+d i )

[0199] Among them, W i is the weight matrix of the input gate, d i is the bias term of the input gate;

[0200] The candidate memory cell state is expressed as:

[0201]

[0202] Among them, W u is the weight matrix of the candidate state, d u is the bias term, and tanh is the activation function;

[0203] Update the memory unit state, U t The expression is:

[0204]

[0205] Among them, U t-1 Indicates the state of the memory unit at the previous moment;

[0206] Determine the hidden state of the output, the output gate expression is:

[0207] O t =ε*W O ·[h t-1 ,Q i ]+d O

[0208] Among them, ε represents the activation function of the output gate, W O is the weight matrix of the output gate, d O is the bias term of the output gate;

[0209] h t =O t tanh+U t

[0210] Among them, h t Represents the hidden state output at the current moment.

[0211] S5: Construct an improved genetic algorithm to locate the coordinates of the target leakage point. The calculation formula for the gas diffusion concentration at each point in the output layer of the Gaussian plume diffusion model is:

[0212]

[0213] Where Q is the proposed diffusion intensity of the leakage point, u is the wind speed, σy and σz are the horizontal and vertical diffusion coefficients around the target point, respectively, and x, y, and z are the coordinates of the gas leakage point in the north-south, east-west, and vertical directions, respectively.

[0214] In step S5, the steps of constructing an improved genetic algorithm to locate the coordinate point of the target leakage point are as follows:

[0215] S5.1: Dynamically adjust the gene pool in the genetic algorithm, selecting individuals not only from the retained subpopulation but also from individuals eliminated during the selection phase;

[0216] S5.2: Dynamically control the crossover rate during the iteration process. Introduce random numbers and crossover rates to influence the crossover operation. The expression is:

[0217]

[0218] Among them, P c is the crossover rate in the current state, P max is the maximum crossover rate, P min is the minimum crossover rate, F avg is the average fitness of the population, F max is the maximum fitness of the population;

[0219] S5.3: Set up a memory mechanism, introduce short-term and long-term memory mechanisms to store historical optimal solutions and potential search areas, and regularly use this information to guide the search during the evolution process;

[0220] S5.4: Set the stagnation generation. The improved genetic algorithm introduces the concept of stagnation generation, which indicates that the evolution has entered a stagnation stage. At this time, the fitness of the optimal individual no longer changes in several generations. By setting the maximum stagnation generation, if the generation number is less than this value, the algorithm will continue to perform crossover and mutation operations. Otherwise, the algorithm will switch to a new operation, such as introducing new individuals or adopting a new search strategy:

[0221]

[0222] Among them, F c is the fitness in the current state, For the adaptation of the previous state, is the minimum increase threshold;

[0223] S5.5: The concept of maternal inheritance is introduced. When the number of stagnant generations is less than the maximum value, the improved genetic algorithm will choose to eliminate individuals from the gene pool and hybridize them with the main individuals. The maternal inheritance rate is introduced in the hybridization process. The expression is:

[0224] Ο=τ·V m +(1-τ)·V f

[0225] Among them, V m is the maternal individual, V f is the paternal individual, τ is the maternal heritability, and O is the offspring individual

[0226] S5.6: Use random numbers to control whether to follow the optimal individual. When this strategy is triggered, the current individual will follow the current optimal individual and introduce interference items that follow the normal distribution.

[0227]

[0228] Among them, g is the current location of the individual, g * is the best individual in the current population, is the interference vector, α is the guidance strength coefficient;

[0229] S5.7: Add an active search mechanism. If the strategy of following the best individual is not triggered, the improved genetic algorithm will perform an active search and the current individual will be repositioned according to the best individual and maternal heritability.

[0230]

[0231] Among them, g is the current location of the individual, g * is the best individual in the current population, is the interference vector, α is the guidance strength coefficient, V m For the maternal individual;

[0232] S5.8: Introduce an adaptive update and iteration mechanism to continuously generate new individuals during the iteration process and dynamically select different operation paths based on the current evolutionary state. The expression is as follows:

[0233]

[0234] Among them, g is the current individual, g * is the current optimal individual, V m is the maternal individual, Ψ f is the degree of improvement of the optimal fitness of several generations, ρ, α and Control parameters for each strategy;

[0235] S5.9: Finally, the best individual is selected from the continuously generated new individuals as the solution of the leakage point coordinates. The expression is:

[0236]

[0237] Among them, G * is the individual with the best fitness value in the whole iteration process, that is, the estimated leakage point coordinates; The position vector of the i-th individual in the t-th generation represents the coordinates of the candidate leakage point, is the fitness function.

[0238] When the drone performs a detection mission, its flight altitude and speed are dynamically adjusted according to the environmental factors and leakage concentration data of the target area to ensure the accuracy and efficiency of detection. The flight altitude adjustment formula is:

[0239] h new =h base +k·C avg

[0240] Among them, h new is the adjusted flight altitude, h base is the reference flight altitude, k is the adjustment coefficient, C avg is the average leakage concentration in the current area.

[0241] The parameters of the Gaussian plume diffusion model can be dynamically updated based on the real-time environmental data to improve the model's simulation accuracy of leaked gas diffusion. The parameter update formula is:

[0242]

[0243] Among them, σ new is the updated diffusion coefficient, σ old is the diffusion coefficient before updating, α is the temperature sensitivity coefficient, ΔT is the change in ambient temperature, T ref The structure and parameters of the multi-layer convolutional neural network are optimized to maximize the extraction of the spatial distribution characteristics and concentration gradient characteristics of the leakage area. The optimized convolution kernel parameter update formula is:

[0244]

[0245] Among them, K new is the updated convolution kernel parameter, K old is the convolution kernel parameter before updating, η is the learning rate, is the gradient of the loss function with respect to the convolution kernel parameters.

[0246] The parameters of the improved deep reinforcement learning model and improved genetic algorithm have been trained and verified with a large amount of experimental data to ensure their stability and generalization ability in different leakage scenarios. The parameter training and update formula is:

[0247]

[0248] Among them, θ new is the updated model parameter, θ old is the model parameter before updating, α is the step size coefficient, is the gradient of the objective function with respect to the model parameters.

[0249] The method also includes a visual display of the detection results. The graphical interface intuitively presents information such as the location of the leakage point, concentration distribution, and detection path, so that users can quickly understand the leakage situation and take corresponding measures. The coordinate transformation formula for the visual display is:

[0250]

[0251] Among them, x disp 、y disp To display coordinates, x leak 、y leak is the actual coordinate of the leakage point, scale x 、scale y is the coordinate scaling factor, x offset 、y offset is the coordinate offset.

[0252] In summary: The present invention achieves high-precision positioning of gas pipeline leakage points through deep fusion of gradient reinforcement learning and improved genetic algorithm. The drone equipped with GPS and gas concentration detection function plans the path according to the Gaussian smoke plume diffusion model and obtains multi-dimensional data of the leakage area in real time. The convolutional neural network is used to extract spatial features, the reinforcement learning model dynamically plans the path, and the genetic algorithm is used to globally optimize the coordinate solution of the leakage point. Verified by multi-scenario experiments, this method has high positioning accuracy and excellent positioning precision, which is significantly improved compared with traditional methods. Its advantages are: first, multi-source data fusion enhances information reliability; second, reinforcement learning dynamic path planning improves detection efficiency; third, the improved genetic algorithm effectively solves the local optimal dilemma and achieves global optimal solution. Even in complex and changeable leakage scenarios, it can quickly and accurately lock the source of the leakage, thus gaining valuable time for subsequent repair work.

[0253] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.

Claims

1. A high-precision gas pipeline leakage detection method based on gradient reinforcement learning, characterized in that: The following steps are involved: S1: Deploy drones equipped with GPS and gas concentration detection functions to the target area to obtain measured data on gas leakage concentrations at different spatial locations; S2: Obtain the environmental factors of the target area, import relevant factors such as wind speed and temperature into the pre-trained Gaussian smoke plume diffusion model, and formulate a preliminary detection path to detect the target area; S3: Utilize concentration distribution data and concentration gradient data to construct an information matrix, then use a multi-layer convolutional neural network to extract spatial distribution features and develop a detection method for key leakage areas; S4: Build an improved deep reinforcement learning model, formulate the model's learning strategy and improve path planning based on the information from the initial detection; S5: Construct an improved genetic algorithm to locate the coordinates of the target leakage point, wherein the calculation formula for the gas diffusion concentration at each point in the output layer of the Gaussian plume diffusion model is: Where Q is the proposed diffusion intensity of the leakage point, u is the wind speed, σy and σz are the horizontal and vertical diffusion coefficients around the target point, respectively, and x, y, and z are the coordinates of the gas leakage point in the north-south, east-west, and vertical directions, respectively.

2. A high-precision gas pipeline leakage detection method based on gradient reinforcement learning according to claim 1, characterized in that: The steps for constructing the Gaussian plume diffusion model in step S2 are as follows: S2.1: Define the three-dimensional coordinate matrix of the gas leak point in the direction, where is the three-dimensional coordinate quantity, which is the coordinate value of the gas leak point in the north-south, east-west, and vertical directions respectively; S2.2: Define the diffusion coefficients in all directions around the gas leak point, where is the surface factor, which are the horizontal diffusion coefficient, longitudinal diffusion coefficient, and vertical diffusion coefficient around the target point; S2.3: Define the system parameter matrix of the model, where is the proposed diffusion intensity of the leak point, is the height of the leak point, and is the wind speed; S2.4: In the input layer of the Gaussian plume diffusion model, the coordinate matrix of the known points, the diffusion coefficient, and the system parameters are input into the simulation environment as an independent feature channel to construct the concentration diffusion matrix; S2.5: Determine the nodes on the initial path based on the size of the target area, where the length, width, and height of the target area are represented respectively. Each node is half of the length, width, and height of the target area. Construct the initial path. The expression of the node is: Among them, L, W, and H represent the length, width, and height of the target area, respectively, and are parameters for determining the position of the node at the boundary.

3. The high-precision gas pipeline leakage detection method based on gradient reinforcement learning according to claim 1 is characterized in that: In step S3, the information matrix is ​​constructed using the concentration distribution data and the concentration gradient data, and the spatial distribution features are extracted using a multi-layer convolutional neural network to construct a detection method for key leakage areas. The steps are as follows: S3.1: Construct a formula to calculate the concentration gradient between two leakage points. The gradient value of this formula is G, which is expressed as: in, x, y, and z are the coordinates of the gas leakage point in the north-south, east-west, and vertical directions, respectively, and C is the concentration value at that point; S3.2: Identify key detection areas based on the numerical changes in concentration values ​​and concentration gradient values ​​along the preliminary detection path; S3.3: Construct a value calculation formula for selected points to evaluate and compare the efficiency of the paths. The calculation formula is: Where C is the concentration value at that point, d is the Euclidean distance between the point and the point with the highest concentration; S3.4: Integrate the concentration data and concentration gradient data of the observation points into an information matrix, which is expressed as: S3.5: Based on the size of the leakage scene, select a convolution kernel of size 7×7 to extract the local concentration change feature. The expression is: Among them, n and m are the height and width of the convolution kernel respectively; S3.6: Convolve the information matrix to generate a feature map, which is expressed as: F=K*M.

4. The high-precision gas pipeline leakage detection method based on gradient reinforcement learning according to claim 1 is characterized in that: The steps of constructing the improved deep reinforcement learning model in step S4 are as follows: S4.1: The gas concentration level is divided into three levels: high, medium and low. The drone will be rewarded after detecting the corresponding level. The expression is as follows: S4.2: Set the step penalty to improve the detection efficiency of the drone. The expression is as follows: R2=-α·t Among them, α is the step penalty coefficient, and t is the number of steps the drone has taken so far; S4.3: Provide corresponding rewards based on the change in gradient value to encourage the drone to move towards and explore areas with higher concentrations. The expression is as follows: Among them, β is the gradient reward coefficient; S4.4: Encourage UAVs to explore unknown areas and avoid falling into local optimal solutions. The expression is: Among them, γ is the detection weight, N s The number of visits to the current state; S4.5: Set boundary penalties to prevent the drone from moving along the boundary or local optimal value. The expression is: R5=-δ·1 B (s) Among them, δ is the boundary penalty coefficient, B is the boundary range set, and s is the current state of the drone; S4.6: Set the target proximity. When the drone approaches the key area, it will be rewarded. The expression is: Among them, ∈ is the weight close to the key area, d target (s) is the distance from the UAV to the nearest target in the current state; S4.7: Set the current detection target. When the drone completes the first leak detection, adjust the reward after detection and encourage continued detection. The expression is: Among them, ζ is the weight after the target is replaced, D is the number of leakage points currently detected by the UAV, and D total The number of leakage points that the drone will detect next; S4.8: Set the number of remaining steps to encourage the drone to complete the task with fewer detection steps and time. The expression is: Where η is the weight of detection efficiency, T max is the maximum number of detection steps allowed, and t is the number of steps the drone has taken in the current state; S4.9: Set a repeated detection penalty to prevent the drone from repeatedly detecting a point or falling into a local optimal solution. The expression is: R9=-θN r Among them, θ is the weight of the penalty, N_r is the number of visits to the state; S4.10: Summarize the above rewards and penalties to obtain the final experience value EXP of the drone training, which is expressed as: EXP=R1+R2+R3+R4+R5+R6+R7+R8+R9 S4.11: Input the observation point location information matrix and construct the spatiotemporal characteristic matrix from the collected concentration data. The expression is: Among them, C i is the concentration value of the i-th observation point, (x i ,y i ,z i ) is the three-dimensional coordinate of the i-th observation point; S4.12: Update the long-short-term memory model at each moment and take the hidden state at the last moment as the memory feature of the entire historical concentration sequence, where: The forget gate expression is: f t =ρ(W f ·[h t-1 ,Q t ]+d f ) Among them, is the forget information, is the activation function, is the weight matrix of the forget gate, represents the hidden state of the previous moment, represents the input of the current moment, and is the bias term of the forget gate; Determine what new information needs to be stored in the memory cell. The input gate expression is: i t =ρ(W i ·[h t-1 ,Q t ]+d i ) Among them, W i is the weight matrix of the input gate, d i is the bias term of the input gate; The candidate memory cell state is expressed as: Among them, W u is the weight matrix of the candidate state, d u is the bias term, and tanh is the activation function; Update the memory unit state, U t The expression is: Among them, U t-1 Indicates the state of the memory unit at the previous moment; Determine the hidden state of the output, the output gate expression is: O t =ε*W O ·[h t-1 ,Q i ]+d O Among them, ε represents the activation function of the output gate, W O is the weight matrix of the output gate, d O is the bias term of the output gate; h t =O t ·tanh+U t Among them, h t Represents the hidden state output at the current moment.

5. The high-precision gas pipeline leakage detection method based on gradient reinforcement learning according to claim 1 is characterized in that: The steps of constructing the improved genetic algorithm in step S5 to realize the coordinate point positioning of the target leakage point are as follows: S5.1: Dynamically adjust the gene pool in the genetic algorithm, selecting individuals not only from the retained subpopulation but also from individuals eliminated during the selection phase; S5.2: Dynamically control the crossover rate during the iteration process. Introduce random numbers and crossover rates to influence the crossover operation. The expression is: Among them, P c is the crossover rate in the current state, P max is the maximum crossover rate, P min is the minimum crossover rate, F avg is the average fitness of the population, F max is the maximum fitness of the population; S5.3: Set up a memory mechanism, introduce short-term and long-term memory mechanisms to store historical optimal solutions and potential search areas, and regularly use this information to guide the search during the evolution process; S5.4: Set the stagnation generation. The improved genetic algorithm introduces the concept of stagnation generation, which indicates that the evolution has entered a stagnation stage. At this time, the fitness of the optimal individual no longer changes in several generations. By setting the maximum stagnation generation, if the generation number is less than this value, the algorithm will continue to perform crossover and mutation operations. Otherwise, the algorithm will switch to a new operation, such as introducing new individuals or adopting a new search strategy: Among them, F c is the fitness in the current state, For the adaptation of the previous state, is the minimum increase threshold; S5.5: The concept of maternal inheritance is introduced. When the number of stagnant generations is less than the maximum value, the improved genetic algorithm will choose to eliminate individuals from the gene pool and hybridize them with the main individuals. The maternal inheritance rate is introduced in the hybridization process. The expression is: O=τ·V m +(1-τ)·V f Among them, V m is the maternal individual, V f is the paternal individual, τ is the maternal heritability, and O is the offspring individual S5.6: Use random numbers to control whether to follow the optimal individual. When this strategy is triggered, the current individual will follow the current optimal individual and introduce interference items that follow the normal distribution. Among them, g is the current location of the individual, g * is the best individual in the current population, is the interference vector, α is the guidance strength coefficient; S5.7: Add an active search mechanism. If the strategy of following the best individual is not triggered, the improved genetic algorithm will perform an active search and the current individual will be repositioned according to the best individual and maternal heritability. Among them, g is the current location of the individual, g * is the best individual in the current population, is the interference vector, α is the guidance strength coefficient, V m is the maternal individual; S5.8: Introduce an adaptive update and iteration mechanism to continuously generate new individuals during the iteration process and dynamically select different operation paths based on the current evolutionary state. The expression is as follows: Among them, g is the current individual, g * is the current optimal individual, V m is the maternal individual, Ψ f is the degree of improvement of the optimal fitness of several generations, ρ, α and Control parameters for each strategy; S5.9: Finally, the best individual is selected from the continuously generated new individuals as the solution of the leakage point coordinates. The expression is: Among them, G * is the individual with the best fitness value in the whole iteration process, that is, the estimated leakage point coordinates; The position vector of the i-th individual in the t-th generation represents the coordinates of the candidate leakage point, is the fitness function.

6. The high-precision gas pipeline leakage detection method based on gradient reinforcement learning according to claim 1 is characterized in that: When the UAV performs a detection mission, its flight altitude and speed are dynamically adjusted according to the environmental factors and leakage concentration data of the target area to ensure the accuracy and efficiency of detection. The flight altitude adjustment formula is: h new =h base +k·C avg Among them, h new is the adjusted flight altitude, h base is the reference flight altitude, k is the adjustment coefficient, C avg is the average leakage concentration in the current area.

7. The high-precision gas pipeline leakage detection method based on gradient reinforcement learning according to claim 1 is characterized in that: The parameters of the Gaussian plume diffusion model can be dynamically updated based on the environmental data acquired in real time to improve the model's simulation accuracy for leaked gas diffusion. The parameter update formula is: Among them, σ new is the updated diffusion coefficient, σ old is the diffusion coefficient before updating, α is the temperature sensitivity coefficient, ΔT is the change in ambient temperature, T ref is the reference temperature.

8. The high-precision gas pipeline leakage detection method based on gradient reinforcement learning according to claim 1 is characterized in that: The structure and parameters of the multi-layer convolutional neural network are optimized to maximize the extraction of the spatial distribution characteristics and concentration gradient characteristics of the leakage area. The optimized convolution kernel parameter update formula is: Among them, K new is the updated convolution kernel parameter, K old is the convolution kernel parameter before updating, η is the learning rate, is the gradient of the loss function with respect to the convolution kernel parameters.

9. The high-precision gas pipeline leakage detection method based on gradient reinforcement learning according to claim 1 is characterized in that: The parameters of the improved deep reinforcement learning model and improved genetic algorithm have been trained and verified with a large amount of experimental data to ensure their stability and generalization ability under different leakage scenarios. The parameter training and update formula is: Among them, θ new is the updated model parameter, θ old is the model parameter before updating, α is the step size coefficient, is the gradient of the objective function with respect to the model parameters.

10. The high-precision gas pipeline leakage detection method based on gradient reinforcement learning according to claim 1 is characterized in that: The method also includes a visual display of the detection results, which intuitively presents information such as the location of the leakage point, concentration distribution, and detection path through a graphical interface, so that users can quickly understand the leakage situation and take corresponding measures. The coordinate transformation formula for the visual display is: Among them, x disp 、y disp To display coordinates, x leak 、y leak is the actual coordinate of the leakage point, scale x 、scale y is the coordinate scaling factor, x offset 、y offset is the coordinate offset.