Gas leakage tracing method and device based on side end meteorological environment modeling
By combining edge meteorological environment modeling and physical constraint graph neural network (PC-GNN) with graph structure, the dynamic wind field modeling problem of gas leak tracing in complex urban environments was solved, and high-precision gas leak source positioning and real-time response were achieved.
Patent Information
- Application Number
- CN202510947532.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-10
- Publication Date
- 2025-10-10
AI Technical Summary
Existing gas leak tracing technology has difficulty achieving high-precision dynamic wind field modeling in complex urban environments, resulting in inaccurate leakage source positioning. Traditional methods also have high computational costs or lack real-time response capabilities.
A method based on edge meteorological environment modeling is adopted. Data is collected through fixed anemometers and vehicle-mounted sensors, and a physical constraint graph neural network (PC-GNN) is constructed. The wind speed field is predicted by combining graph structure and physical constraints. The wind speed field is then jointly modeled with gas concentration observations to invert the location of the leakage source.
It achieves high-precision gas leak tracing in dynamic urban scenarios, improves the accuracy and robustness of leak source positioning, reduces computing costs, and has real-time response capabilities.
Smart Images

Figure CN120764385A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of gas leak detection and tracing, and specifically relates to a gas leak tracing method and device based on edge meteorological environment modeling. Background Art
[0002] With the increasing density of urban gas pipelines and the increasing complexity of urban environments, gas leaks have become a major threat to urban safety and public life and property. In recent years, gas leak monitoring and source tracing technologies have evolved from traditional manual inspections to intelligent systems that integrate static sensor networks with vehicle-mounted mobile detection.
[0003] Currently, the technologies commonly used for leak tracing include:
[0004] (1) Static sensor network method: By deploying gas concentration sensors in key areas, the location of the leak source is inverted using the concentration distribution. Although this method is suitable for monitoring local key areas, it has problems such as sparse deployment, poor spatial coverage, and high deployment and maintenance costs.
[0005] (2) Mobile platform concentration tracking method: By deploying gas concentration sensors on patrol vehicles and combining them with wind speed and direction information, the location of the leak source is estimated using empirical rules or inversion algorithms. Among them, the more common source tracing method is based on the Gaussian plume diffusion model. It assumes that the gas concentration presents a resolvable Gaussian distribution and reversely reconstructs the diffusion path to estimate the source point. However, this method is highly dependent on wind speed accuracy. In practice, vehicle-mounted wind speed measurements are easily interfered with by factors such as vehicle speed and air disturbances, resulting in wind field modeling distortion, which in turn affects the accuracy of leak source inference.
[0006] To achieve higher-precision source tracing, wind field modeling becomes the core link. The current main methods include:
[0007] Computational Fluid Dynamics (CFD)-based wind modeling uses the Navier-Stokes equations to numerically calculate the wind speed field based on known boundary conditions and an initial field. Existing technologies combine CFD models with terrain correction mechanisms to improve wind speed prediction accuracy in large-scale, complex terrain. However, this method is computationally expensive, requires extensive meshing and initial parameter settings, and is difficult to adapt to dynamically changing scenarios.
[0008] Interpolation-based wind field modeling methods, such as Kriging and Inverse Distance Weighted (IDW), use wind speed data from multiple observation points to estimate field values. Existing technologies use linear interpolation combined with a discrete grid wind speed field to build wind field models. While these methods perform well for static observation points, they are unable to model the flow effects of complex terrain or spatial mutations.
[0009] Machine Learning-Based Wind Field Modeling: Existing technologies combine filtering and machine learning techniques to predict wind speeds. First, an extended Kalman filter is used to estimate wind speeds based on a three-dimensional wind field model and a nonlinear rotor model. Prediction is then achieved through extrapolation and machine learning. However, this method lacks real-time responsiveness, making it difficult to use in scenarios where mobile platforms require rapid perception updates. Furthermore, it ignores the physical constraints underlying the wind field, potentially leading the network to learn results that do not conform to the laws of actual fluid dynamics.
[0010] In summary, existing leak source tracing solutions have difficulty in accurately modeling vehicle-borne wind speed disturbances and fail to integrate the spatial physics laws of wind fields, making it difficult to meet the needs of high-precision gas leak source positioning in complex urban environments.
[0011] Disadvantages of existing technology:
[0012] (1) Wind speed data accuracy: The readings of the vehicle-mounted anemometer are affected by the vehicle's speed and are difficult to truly reflect the local environmental wind field;
[0013] (2) Lack of high-precision dynamic wind field modeling capabilities: Traditional models do not have the ability to model the spatial dependency between fixed nodes and mobile observation nodes;
[0014] (3) Weak physical consistency: Most wind field prediction models based on machine learning or interpolation do not consider fluid mechanics principles such as continuity and conservation, resulting in large traceability errors;
[0015] (4) The leakage source inversion results are unstable: Due to the inaccurate wind speed field, the concentration diffusion model construction has large deviations, which in turn affects the accuracy and robustness of the leakage source inversion. Summary of the Invention
[0016] In view of this, the present invention proposes a gas leak tracing method and device based on edge meteorological environment modeling, which can achieve high-precision modeling and spatiotemporal compensation of the local wind speed field in dynamic urban scenes, thereby ensuring high-precision tracing of gas leaks.
[0017] The technical solutions for implementing the present invention are as follows:
[0018] In a first aspect, the present invention provides a gas leak tracing method based on edge meteorological environment modeling, the specific process of the method is as follows:
[0019] Data collection and preprocessing: Use fixed sensors and vehicle-mounted sensors to collect wind speed and gas concentration information, and preprocess the collected information to obtain structured data for each observation node;
[0020] Graph structure construction: All observation points within the time window are considered as a node. Based on the physical factors and weighting mechanism between nodes, edge weight modeling is performed to obtain a graph structure. The graph structure and the corresponding wind speed field are used as sample data.
[0021] Physical constraint graph neural network modeling and training: constructing a physical constraint graph neural network model, with the model input being a graph structure and the output being a wind speed field, and using the sample data for training;
[0022] Gas leak source inversion: Use the trained model to predict the three-dimensional wind velocity field, combine the prediction results with gas concentration observations to build a joint model, and invert the three-dimensional position of the leak source.
[0023] Optionally, the edge weight modeling described in the present invention is based on physical factors and a weighting mechanism between nodes, specifically: weighted modeling is performed based on wind speed difference terms, wind direction consistency, and spatial distance terms between nodes.
[0024] Optionally, the wind speed difference term of the present invention is: ▽·v ij =‖v j -v i ‖, v i and v j represents the wind speed information detected by sensor nodes i and j; the wind direction consistency is: r ij =p j -p i Indicates whether the information is transmitted along the wind, p j and p i Represents the positions of nodes i and j; the spatial distance term is: d ij =‖p i -p j ‖;
[0025] Weighted modeling: φ(e ij )=MLP([‖Δv ij ‖,cos(θ ij ),‖p i -p j ‖]),,e ij represents the edge, φ(e ij ) represents edge weight, and MLP represents multi-layer perceptron.
[0026] Optionally, the present invention introduces a dynamic graph structure update mechanism when constructing the graph structure. Whenever the position of a vehicle-mounted mobile sensor node changes as the vehicle travels, it automatically determines whether to add it to the graph structure or remove it, and sets an upper limit on the number of nodes in the window.
[0027] Optionally, when the physical constraint graph neural network is modeled, the node features of each layer are updated as follows:
[0028]
[0029] Among them, the initialization feature W (l) It represents the weight matrix of the lth layer, x i =[P i v i δ i ] is represented as a feature vector consisting of the position, wind speed and self-state (fixed / moving, 0 for fixed and 1 for moving) of node i, which serves as the initial input of the graph neural network.
[0030] Optionally, when modeling the physical constraint graph neural network, the present invention constructs a fixed and mobile dual-channel structure, uses different input embedding layers for fixed nodes and mobile nodes, and sets independent weight matrices W for each. fixed and W mobile , used to model different sensor stability and noise modes.
[0031] Optionally, the loss function of the present invention is:
[0032]
[0033] Among them, λ reg ,λ cont ,λ smooth ,λ NS Weight factors for adjusting the contribution of each loss item;
[0034] Supervised wind speed regression loss term:
[0035]
[0036] in, is the wind speed vector predicted by the model; is the actual observed wind speed value; N is the total number of wind speed nodes participating in the supervision;
[0037] Continuity constraints:
[0038]
[0039] Where: (i, j) is the node pair connected in the graph; φ(e ij ) is the edge weight; is the wind speed vector of the adjacent node i; is the wind speed vector of the adjacent node j;
[0040] Smoothness constraint:
[0041]
[0042] in: is the set of adjacent nodes of node i; is the number of adjacent nodes;
[0043] Fluid conservation constraints:
[0044]
[0045] Where: ρ is the density of the fluid; p i is the pressure at node i; μ is the dynamic viscosity of the fluid; ▽ represents the spatial differential operator, which is used to calculate the gradient of the physical quantity.
[0046] Optionally, the preprocessing of the present invention includes correction of vehicle-mounted speed disturbance term, specifically: real-time reading of vehicle-mounted platform speed vector u car , and project it to the wind speed direction to construct the disturbance correction model, v corrected =v measured -α·u car , where α is the learnable coefficient or experience weight, v corrected Corrected wind speed.
[0047] Optionally, the preprocessing described in the present invention includes time series unification, sliding window, asynchronous observation interpolation and node normalization processing, specifically: based on the Beidou BDS timing capability, the collected data is calibrated with a unified timestamp; a time sliding window is constructed, and a 30%-50% overlap is set between windows to form an overlapping sliding window sequence to ensure that the generated data has temporal continuity and consistency; the preprocessing also includes anomaly detection and observation quality enhancement: detecting outliers, and filling in the abnormal items using nearest neighbor interpolation and time-weighted averaging.
[0048] In a second aspect, the present invention provides a gas leak tracing device based on edge meteorological environment modeling, comprising:
[0049] Data acquisition and preprocessing module: uses fixed anemometers and vehicle-mounted anemometers to collect wind speed information and gas concentration information, and preprocesses the collected information to obtain structured data for each observation node;
[0050] Graph structure construction module: All observation points within the time window are considered as a node, and edge weight modeling is performed based on the physical factors and weighting mechanism between nodes to obtain the graph structure;
[0051] Physical constraint graph neural network module: using the obtained graph structure to predict the wind speed field;
[0052] Gas source tracing inference module: combining the predicted wind speed field with the gas concentration observation to inversely obtain the three-dimensional position of the leakage source.
[0053] Beneficial effects:
[0054] Firstly, the present application regards the vehicle-mounted observation points as dynamic nodes and the fixed anemometers as static nodes, constructs the graph structure connection relationship based on the spatial distance and wind direction between the nodes, and realizes high-precision modeling and space-time compensation of the local wind speed field in the dynamic urban scene by using the graph neural network (GNN) for joint modeling.
[0055] Secondly, the present application constructs a graph neural network structure (PC-GNN) fusing a physical constraint mechanism, simultaneously in the node propagation and training stage, designs a multi-loss fusion mechanism for the wind speed prediction accuracy and the physical interpretability, including: wind speed observation regression loss, divergence constraint regularization term, boundary flow smoothing term, and momentum conservation error term, to realize the physical guidance and global constraint of network training. BRIEF DESCRIPTION OF DRAWINGS
[0056] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0057] Figure 1 Flow chart for graph structure construction;
[0058] Figure 2 Flow chart of the method of the present application. DETAILED DESCRIPTION
[0059] The embodiments of the present application will be described in detail below with reference to the drawings.
[0060] It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict; and based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present disclosure.
[0061] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on this disclosure, it should be understood by those skilled in the art that an aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects described herein can be used to implement an apparatus and / or practice a method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this apparatus and / or practice this method.
[0062] like Figure 1 As shown, the embodiment of the present application is a gas leak tracing method based on edge meteorological environment modeling. By constructing a dynamic local wind field graph model that integrates fixed anemometers and vehicle-mounted mobile observation points, and combining it with a graph neural network structure embedded with physical constraints, high-precision wind speed field estimation and gas tracing positioning error compensation are achieved. The specific process of this method is as follows:
[0063] Data collection and preprocessing: Use fixed anemometers and vehicle-mounted anemometers to collect wind speed information and gas concentration information, and preprocess the collected information to obtain structured data for each observation node;
[0064] Graph structure construction: All observation points within the time window are considered as a node. Based on the physical factors and weighting mechanism between nodes, edge weight modeling is performed to obtain a graph structure. The graph structure and the corresponding wind speed field are used as sample data.
[0065] Physical constraint graph neural network modeling and training: constructing a physical constraint graph neural network model, with the model input being a graph structure and the output being a wind speed field, and using the sample data for training;
[0066] Gas leak source inversion: Use the trained model to predict the three-dimensional wind velocity field, combine the prediction results with gas concentration observations to build a joint model, and invert the three-dimensional position of the leak source.
[0067] During the specific implementation of the embodiment of the present application, data collection is as follows: obtaining the fixed wind speed observation data at the edge and the wind speed, gas concentration, position information and the vehicle speed on the vehicle platform to form an input data set that integrates dynamic and static observations. Preprocessing is as follows: time series unification and sliding window processing, uniform timestamp calibration of the collected data, and construction of a time sliding window to ensure that the model input has temporal continuity and consistency. The graph structure is constructed as follows: all observation points in the time window are regarded as one node, and based on the wind speed propagation distance and direction between nodes, a heterogeneous graph structure containing fixed nodes and mobile nodes is constructed, and information such as edge weights and adjacency relationships is defined. Physical constraint graph neural network modeling and training are as follows: PC-GNN wind field modeling is performed, and joint training is performed based on the graph neural network and wind field physical constraints (such as continuity and fluidity), and the local wind speed field estimation results are output. Gas leakage source inversion: The wind speed estimation results are combined with the measured gas concentration data to generate a gas concentration distribution map as the source tracing inversion input. Based on the inverse Gaussian plume model and grid matching strategy, the difference between the predicted concentration and the measured concentration is minimized, and the most likely leakage point location is inferred.
[0068] Furthermore, the data collection and preprocessing of the embodiment of the present application includes the following process:
[0069] (1) Fixed anemometers are deployed around the pipe network or in key areas to collect environmental wind speed / direction information in real time at a sampling frequency of 1 Hz. The collected data is uploaded to the preprocessing module through the edge computing node or the Internet of Things interface.
[0070] (2) An anemometer / wind vane is installed on the gas inspection vehicle, and the current recording time and inspection vehicle location information and speed information are obtained through Beidou spatiotemporal information + 5G high-precision positioning. The wind speed value measured by the mobile inspection vehicle is recorded in real time through the anemometer / wind vane and uploaded to the preprocessing module.
[0071] (3) It is realized by installing a gas concentration sensor on a vehicle or on the roadside to collect the methane gas concentration C(x i ,y i ), provides actual observation data for leak tracing, combines high-precision positioning information, and uploads concentration-coordinate-time data. This module can be integrated with the wind speed observation node.
[0072] (4) Time alignment, structural regularization, and anomaly correction of multi-source observation data (vehicle-mounted gas concentration data, fixed / mobile wind speed observations, and BeiDou + 5G high-precision positioning information) in modeling and traceability analysis tasks are achieved, thereby ensuring the quality and consistency of input data for the graph neural network and Gaussian plume inversion model. The specific process is as follows:
[0073] ① Unified timestamp system: To solve the asynchronous problems in sampling frequency and transmission delay between fixed anemometers and vehicle-mounted mobile platforms, the system is based on the Beidou BDS timing capability (error <10ns), uniformly maps all terminal local times to the UTC time reference, and assigns standardized timestamps to all sensor data, which are used as the primary key index for sliding window slices.
[0074] ② Sliding window cropping mechanism: The observation data on the continuous time axis are cached and cropped, and organized into time slices with a fixed window length of 10s. To ensure temporal continuity and context information transmission, a 30%–50% overlap is set between windows to form an overlapping sliding window sequence for unified reading by the subsequent GNN modeling module and Gaussian plume inversion module.
[0075] ③ Asynchronous observation interpolation and node normalization processing: In order to address the problem that the sampling times of vehicle-mounted nodes and fixed nodes may not completely overlap, the following strategies are adopted to interpolate and fill in the missing values: linear interpolation is used for missing data in small time intervals (<2s); cubic spline interpolation is used for large time intervals to enhance the smoothness of the curve; the node spatial coordinates are uniformly converted to the ENU coordinate system, and the wind speed and inspection vehicle speed are uniformly converted to m / s to ensure that all observation data are consistent in dimension and spatial reference system, providing regular input for the graph neural network.
[0076] ④ Vehicle speed disturbance correction mechanism: Considering that the wind speed observation of the mobile platform is easily disturbed by the vehicle speed, this module introduces a disturbance correction mechanism to read the vehicle platform speed vector u in real time car , and project it to the wind speed direction to construct the disturbance correction model, v corrected =v measured -α·u car , where α∈[0,1] is a learnable coefficient or empirical weight, which is set to an empirical value of 0.8, which can adapt to most actual scenarios. The corrected wind speed v corrected Replace the original wind speed observations into the graph modeling and Gaussian inversion process to improve physical consistency.
[0077] ⑤ Anomaly Detection and Observation Quality Enhancement: Statistical methods such as the sliding standard deviation and interquartile range (IQR) are used to detect outliers, including transition points, abnormal deviations, and signal loss. Outliers are filled using nearest neighbor interpolation and time-weighted averaging to ensure the quality of observation data before input.
[0078] Output form: Final output structured node data:
[0079]
[0080] Where t is the UTC timestamp; P t v is the node space coordinate unified to the ENU coordinate system;t is the wind speed vector of the current time node; u car,t is the speed of the mobile node at the current time, and the value of the fixed node is 0; c t is the gas concentration observation value of the node at the current time. It is organized as a time sequence chart input graph neural network according to a sliding window. It supports online learning and batch playback, and has good traceability and experimental reproducibility.
[0081] Further, the specific process of constructing the graph structure in the embodiment of the application is:
[0082] Based on the multi-source observation data processed by the sliding window, the fixed wind speed observation point and the vehicle-mounted observation point are integrated to construct a heterogeneous observation graph, which provides a graph topology basis for modeling the physical constraint graph neural network PC-GNN, as shown in Figure 2 .
[0083] ①Node construction: all observation points (fixed + mobile) in the time window are regarded as a node in the graph, and the node features include: wind speed vector (3D, unit m / s, fixed point direct observation, mobile point removes vehicle speed disturbance), spatial position (3D, adopts WGS84 to ENU three-dimensional coordinate system), node type (1D, fixed / moving, 0 for fixed node, 1 for mobile node); The system introduces a dynamic graph update mechanism, and whenever the vehicle-mounted mobile node changes its position with the vehicle driving, the system automatically determines whether to add it to the graph structure or remove it; keep the graph structure and the scene time and space synchronization. At the same time, the number of nodes in the window is limited to a certain upper limit (200), so as to ensure that the calculation cost of the sliding window graph construction process is controllable and the modeling speed meets the real-time requirements.
[0084] ②Edge construction strategy: after all nodes i in the sliding window are constructed, reasonable edge connection relationship and physical weighting mechanism need to be constructed for the graph structure to express the propagation, disturbance and structural correlation between nodes in the wind field. The edge connection method adopts the nearest neighbor search (K nearest neighbor), and for each node i, find its K nearest neighbor nodes {j, j ∈ [1, K]} in the spatial coordinate system, and establish a directed edge or undirected edge e ij for each pair (i, j). Set K = 8-16, K can be adjusted according to the sampling density, and for high sampling density or uniform distribution data, a smaller K value can be set, and for sparse sampling or irregular areas, a larger K value can be set. In actual implementation, both physical constraints and computational efficiency are considered. Too small K value may lead to insufficient information propagation, and too large K value may introduce redundant connections and noise disturbance, which need to be adjusted through experience setting or cross validation. The final edge weight e ij is composed of the following multiple physical factors:
[0085] Wind speed difference term (wind field disturbance intensity): measure the inconsistency of wind speed between nodes, ▽·vij =‖v j -v i ‖ represents the degree of wind speed disturbance between two points. The greater the difference in wind speed, the more likely the edge is to cross the boundary of the airflow structure, which has significant physical significance.
[0086] Wind direction consistency term (transmission direction constraint): measures the consistency between wind speed direction and information propagation path, where r ij =p j -p i , indicating whether the information is propagating along the wind. The smaller the angle, the more reasonable the propagation direction. j and p i Indicates the location of the node.
[0087] Spatial distance term: measures the spatial distance between two nodes, used to weaken the transmission weight of distant nodes, suppress cross-structure connections, and constrain the effective propagation range of wind speed disturbances. ij =‖p i -p j ‖, the closer the distance, the more likely it is that there is a physically connected path or the influence of the same source wind field.
[0088] Combination function modeling: Edge weight fusion expression, the final edge weight modeling is in the form of a combination function, a small multi-layer perceptron (MLP) is used to learn the physical consistency edge weight in high-dimensional space. The present invention selects a multi-layer perceptron to implement the edge encoding function:
[0089] φ(e ij )=MLP([‖Δv ij ‖,cos(θ ij ),‖p i -p j ‖])
[0090] Furthermore, the specific process of modeling and training the physical constraint graph neural network (PC-GNN) in the embodiment of the present application is as follows: in order to achieve high-precision estimation of the wind speed field in the unknown area, based on the aforementioned sliding window graph structure, a physical constraint graph neural network model PC-GNN (Physics-Constrained Graph Neural Network) is constructed to fit, interpolate and structure-preserving model the wind field.
[0091] Network modeling objectives and input and output definitions:
[0092] Input: Dynamic heterogeneous wind speed graph structure constructed within the sliding window Each node contains the wind speed vector v i (The wind speed input by all mobile nodes is the real wind speed vector after removing the vehicle speed disturbance), spatial position P i, node type (fixed / mobile) and other multi-dimensional features.
[0093] Output: The three-dimensional wind speed vector estimation results of all nodes in the target area, especially the wind direction and wind speed of unmeasured points or predicted areas, that is, the complete wind speed field.
[0094] The physically constrained graph neural network has made two key structural innovations and improvements based on the traditional graph convolution framework (such as GCN / GAT), ensuring that the model has strong wind field physical modeling capabilities and system independence.
[0095] 1) Edge-weight-guided physical graph convolution mechanism: To enhance the physical consistency and generalization ability of graph neural networks in wind speed disturbance propagation modeling, based on the physical consistency edge weights constructed in the previous section, this embodiment of the application proposes an edge-weight-guided physical graph convolution mechanism. This method introduces wind speed disturbance intensity terms, wind direction consistency terms, and spatial distance terms to form an edge feature set, and uses an MLP module to implement the edge encoding function. During graph convolution propagation, the node features of each layer are updated as follows:
[0096]
[0097] Among them, the initialization feature W (l) It represents the weight matrix of the lth layer, which is used to perform linear transformation on the features of neighbor nodes. The activation function selects the ReLU function to introduce nonlinearity.
[0098] 2) Node type difference modeling: fixed / mobile dual-channel structure, using different input embedding layers for fixed points and mobile points, and setting independent weight matrices W for each fixed and W mobile , which is used to model different sensor stabilities and noise patterns and improve the robustness of wind speed estimation.
[0099] Furthermore, during training, a loss function combination mechanism driven by physical rules is utilized. This introduces multiple wind field-related physical constraints, such as continuity, smoothness, and conservation of fluid momentum, so that the network training process not only pursues data accuracy but also retains the physical consistency and interpretability of the wind speed field. The loss function is as follows.
[0100] Physical Constraint Combination Loss Function Design: The network's total loss function is designed as a weighted combination of multiple physical losses to ensure that the output wind speed field takes into account both data accuracy and physical interpretability:
[0101]
[0102] Each λ is a weight factor that adjusts the contribution of each loss term. It can be set based on prior experience. Regression is the main supervisory objective with a weight of 1, wind speed continuity with a weight of 0.1, boundary smoothness with a weight of 0.05, and physical constraint with a weight of 0.01. The loss gradient amplitude during training is then used to observe whether each item is too large or too small. If a loss ratio is consistently large, it indicates that it is too dominant in training and its weight should be lowered. If a loss ratio is consistently close to 0, it indicates that it does not contribute enough to optimization and its weight should be appropriately increased. The loss terms are shown below:
[0103] Supervised wind speed regression loss term (primary supervisory objective): used to fit the true wind speed value of the labeled observation point:
[0104]
[0105] in, is the wind speed vector predicted by the model; is the actual observed wind speed value; N is the total number of wind speed nodes participating in the supervision. This loss function quantifies the model's prediction error by calculating the sum of the squares of the differences between the predicted wind speed and the actual wind speed at all nodes and then taking the average.
[0106] Continuity constraint (minimizing adjacent differences): requires that the wind speeds of adjacent nodes change continuously to avoid sudden changes:
[0107]
[0108] Where: (i, j) is the node pair connected in the graph; w ij is the edge weight, which is usually inversely proportional to the distance between nodes. This loss function ensures the continuity of the vector field by minimizing the difference between all adjacent node vectors.
[0109] Smoothness constraint (local smoothing): Make the wind speed field transition smoothly near the boundary / obstacle area:
[0110]
[0111] in: is the set of adjacent nodes of node i; is the number of adjacent nodes; is the wind speed vector of the adjacent node j. This loss function achieves a smooth transition of the wind speed field by minimizing the difference between the wind speed vector of each node and the average of the wind speed vectors of its adjacent nodes.
[0112] Fluid conservation constraint: Under the quasi-steady-state approximation, guide the model output to satisfy the momentum conservation constraint:
[0113]
[0114] Where: ρ is the density of the fluid; p i is the pressure at node i; μ is the dynamic viscosity of the fluid. The density and dynamic viscosity of the fluid can be set as constants using a lookup table. If a sensor is available for node pressure, the actual pressure data for each observation node can be obtained. If no direct observations are available, this term is ignored, and only the wind speed derivative constraint is retained. This loss function measures the deviation of the model output from the law of conservation of momentum by calculating the sum of squares of the residuals of the Navier-Stoke equations.
[0115] Furthermore, the specific process of gas leakage source inversion in the embodiment of the present application is as follows:
[0116] The three-dimensional wind velocity field output by PC-GNN is jointly modeled with gas concentration observations, and the concentration of unobserved points is interpolated to construct a high-resolution gas concentration distribution map. The three-dimensional position of the leakage source is then inverted using a three-dimensional Gaussian plume diffusion model. The location of the leakage point is estimated by matching the minimum error, that is, outputting (x*, y*, z*). The specific steps are as follows:
[0117] ① Gaussian plume diffusion model:
[0118]
[0119] Where C(x,y,z) is the gas concentration at point (x,y,z); Q is the leakage intensity; u is the main direction of wind speed (from PC-GNN output); (x0,y0,z0) is the coordinate of the hypothetical leakage source; σ x ,σ y ,σ z are the lateral and longitudinal diffusion coefficients, which are set based on wind field and temperature experience.
[0120] ② Leakage source inversion: Construct a grid area Ω and traverse all candidate source points (x0, y0, z0) in it; for each candidate point, calculate its diffusion field C according to the wind direction and speed of the point sim (x i ,y i ,z i );Use the sensor concentration value C observed at the current moment obs (x i ,y i ,z i ) to calculate the matching error; minimize the matching error and obtain the estimated location of the leakage source:
[0121]
[0122] The embodiment of the present application provides a gas leak tracing device based on edge meteorological environment modeling, including:
[0123] Data acquisition and preprocessing module: fixed anemometer and vehicle-mounted anemometer are used to collect wind speed information and gas concentration information, and the collected information is preprocessed to obtain the structured data of each observation node;
[0124] Graph structure construction module: all observation nodes in a time window are regarded as a node, and edge weight modeling is performed based on the physical factors and weighting mechanism between nodes to obtain the graph structure;
[0125] The physical constraint graph neural network module is trained based on the above method: the obtained graph structure is used for wind speed field prediction;
[0126] Gas source tracing reasoning module: the predicted wind speed field and the gas concentration observation are jointly modeled to obtain the three-dimensional position of the leakage source.
[0127] Further, the data acquisition and preprocessing module in the embodiment includes: a fixed wind speed observation module, a vehicle-mounted wind speed acquisition module, a gas concentration observation module, and a time synchronization and sliding window preprocessing module for multi-source observation data; data acquisition is performed for the wind speed field to be measured, wherein,
[0128] The fixed wind speed observation module is implemented by arranging fixed anemometers around the pipe network or in key areas, which is used to collect environmental wind speed / direction information in real time at a sampling frequency of 1Hz, and the collected data is uploaded to the preprocessing module through an edge computing node or an Internet of Things interface.
[0129] The vehicle-mounted wind speed acquisition module includes an anemometer / wind vane installed on a gas inspection vehicle, which obtains the current recording time and the position information and speed information of the inspection vehicle through Beidou space-time information + 5G high-precision positioning, and records the wind speed value measured by the moving inspection vehicle in real time through the anemometer / wind vane, and uploads it to the preprocessing module.
[0130] The gas concentration observation module is implemented by installing a gas concentration sensor on a vehicle or a roadside, which is used to collect the methane gas concentration C(x i ,y i ) at a specific time and at a specific position, to provide actual observation data for leakage source tracing, and upload the concentration-coordinate-time data in combination with high-precision positioning information, and this module can be installed in combination with the wind speed observation node.
[0131] The time synchronization and sliding window preprocessing module for multi-source observation data: this module aims to realize the time alignment, structure regularization and abnormal correction of multi-source observation data (vehicle-mounted gas concentration data, fixed / moving wind speed observation values, Beidou + 5G high-precision positioning information) in modeling and source tracing analysis tasks, so as to guarantee the quality and consistency of the input data of the graph neural network and the Gaussian plume inversion model.
[0132] The innovation points of the present application include the following aspects:
[0133] 1. Edge-to-Edge Heterogeneous Node Wind Field Modeling Framework: This innovatively proposes a heterogeneous graph modeling scheme that integrates fixed edge anemometers with vehicle-mounted mobile observation points. The vehicle-mounted observation points are considered dynamic nodes, while the fixed anemometers are considered static nodes. A graph structure is constructed based on the spatial distance and wind direction between nodes. Joint modeling is performed using a graph neural network (GNN), achieving high-precision modeling and spatiotemporal compensation of local wind speed fields in dynamic urban scenarios.
[0134] 2. Physically Constrained Graph Neural Network (PC-GNN) Architecture: A graph neural network (PC-GNN) architecture incorporating physical constraints was constructed. Key physical laws such as wind speed continuity, boundary smoothness, and momentum conservation (based on the Navier-Stokes equations) were incorporated during the node propagation and training phases to ensure the physical consistency of the wind field distribution output by the network. Furthermore, to achieve the dual goals of wind speed prediction accuracy and physical interpretability, a multi-loss fusion mechanism was designed, including a wind speed observation regression loss, a divergence constraint regularization term, a boundary flow smoothing term, and a momentum conservation error term, to provide physical guidance and global constraints for network training.
[0135] 3. Wind-speed-compensated leak source tracing inversion method: Based on the high-resolution wind velocity field obtained by modeling, this method integrates vehicle-borne concentration data to construct an inverse Gaussian plume diffusion model. Using a wind speed-concentration coupled inversion algorithm, this method achieves high-precision spatial localization of gas leak sources within urban pipe networks. This method overcomes the inversion instability caused by wind velocity distortion in traditional methods.
[0136] 4. Module-level system implementation solution: A deployable intelligent leak tracing system consisting of a "fixed anemometer acquisition module - vehicle-mounted gas and wind speed observation module - heterogeneous graph modeling module - PC-GNN wind speed prediction module - Gaussian plume inversion module" was constructed. It supports the rapid location and response to pipeline leakage incidents in complex urban environments and has good engineering adaptability and scalability.
[0137] This application has the following advantages:
[0138] First, graph neural network modeling that integrates physical mechanisms solves the problems of wind speed disturbance and restoration of spatiotemporal distribution: Among existing wind field modeling methods, although traditional CFD simulations are highly accurate, they are computationally time-consuming and difficult to adapt to dynamic environments; pure machine learning models tend to ignore the physical consistency of the wind field, which may produce unreasonable prediction results. This patent proposes a graph neural network (PC-GNN) modeling method based on physical constraints, which constructs a graph structure with wind speed observation points and embeds physical rules such as Navier-Stokes control equations, continuity constraints, and flow smoothness into the neural network loss function. Through the fusion of data-driven + physical modeling, this method not only significantly improves the prediction speed, but also maintains the ability to depict physical phenomena such as wind field flow trends and vortex changes, achieving approximate restoration and disturbance correction of the real wind field, and effectively responding to the challenges of wind field estimation under the complex and changeable urban buildings and vehicle movement interference.
[0139] Second, the fixed edge and the vehicle-mounted mobile observation points collaborate to construct the wind speed map structure, enhancing the spatial coverage and dynamic response capabilities of wind field modeling: traditional static sensors are sparsely deployed and have limited spatial coverage; and a single mobile platform cannot quickly restore the complete wind speed field. The present invention designs an edge anemometer + vehicle-mounted disturbance observation collaborative mapping strategy, introduces a heterogeneous node structure into the graph neural network, uses the edge to provide a stable reference field, and uses the vehicle-mounted sensors to capture disturbance information, and expresses the spatial coupling relationship through the edge connection weights in the graph structure to form a dynamically updateable urban local wind field map. Experimental verification shows that the wind speed map constructed by this method can still complete high-precision reconstruction when there are fewer observation points, effectively compensating for the blind spot problems caused by vehicle speed interference and low-density observations.
[0140] Third, the wind field modeling and the Gaussian plume model are linked and integrated to build a highly reliable leakage source tracing inversion mechanism: Compared with traditional trajectory inversion or empirical methods, the present invention adopts a standard Gaussian plume diffusion model, takes the wind field prediction output (wind speed and direction) as the Gaussian source term input, and combines it with the actual vehicle-borne concentration observation value to construct a concentration inverse diffusion formula in a continuous space, thereby solving the most likely leakage source coordinates. This method effectively improves the robustness and interpretability of leakage location through the joint modeling of the physical wind field and diffusion model. Compared with the inversion method based on the static concentration field, this scheme significantly improves the accuracy of source location in a dynamic wind environment.
[0141] In summary, the above are only preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A gas leak tracing method based on edge meteorological environment modeling, characterized in that: The specific process is: Data collection and preprocessing: Use fixed sensors and vehicle-mounted sensors to collect wind speed and gas concentration information, and preprocess the collected information to obtain structured data for each observation node; Graph structure construction: All observation points within the time window are considered as a node. Based on the physical factors and weighting mechanism between nodes, edge weight modeling is performed to obtain a graph structure. The graph structure and the corresponding wind speed field are used as sample data. Physical constraint graph neural network modeling and training: constructing a physical constraint graph neural network model, with the model input being a graph structure and the output being a wind speed field, and using the sample data for training; Gas leak source inversion: Use the trained model to predict the three-dimensional wind velocity field, combine the prediction results with gas concentration observations to build a joint model, and invert the three-dimensional position of the leak source.
2. The gas leak tracing method based on edge meteorological environment modeling according to claim 1 is characterized in that: The edge weight modeling is performed based on the physical factors and weighting mechanism between nodes, specifically: weighted modeling is performed based on the wind speed difference term, wind direction consistency and spatial distance term between nodes.
3. The gas leak tracing method based on edge meteorological environment modeling according to claim 2 is characterized in that: The wind speed difference term is: ▽·v ij =‖v j -v i ‖, v i and v j represents the wind speed information detected by sensor nodes i and j; the wind direction consistency is: r ij =p j -p i Indicates whether the information is transmitted along the wind, p j and p i Represents the positions of nodes i and j; the spatial distance term is: d ij =‖p i -p j ‖; Weighted modeling: φ(e ij )=MLP([‖Δv ij ‖,cos(θ ij ),‖p i -p j ‖]), e ij represents the edge, φ(e ij ) represents edge weight, and MLP represents multi-layer perceptron.
4. The gas leak tracing method based on edge meteorological environment modeling according to claim 2 is characterized in that: When constructing the graph structure, a dynamic graph structure update mechanism is introduced. Whenever the position of a vehicle-mounted mobile sensor node changes as the vehicle travels, it is automatically determined whether to add it to the graph structure or remove it, and an upper limit on the number of nodes in the window is set.
5. The gas leak tracing method based on edge meteorological environment modeling according to claim 4 is characterized in that: When modeling the physical constraint graph neural network, the node features of each layer are updated as follows: Among them, the initialization feature W (l) It represents the weight matrix of the lth layer, x i =[P i v i δ i ] is represented as a feature vector consisting of the position, wind speed and self-state (fixed / moving, 0 for fixed and 1 for moving) of node i, which serves as the initial input of the graph neural network.
6. The gas leak tracing method based on edge meteorological environment modeling according to claim 5 is characterized in that: When modeling the physical constraint graph neural network, a fixed and mobile dual-channel structure is constructed, different input embedding layers are used for fixed nodes and mobile nodes, and independent weight matrices W are set for each. fixed and W mobile , used to model different sensor stability and noise modes.
7. The gas leak tracing method based on edge meteorological environment modeling according to claim 5 is characterized in that: The loss function is: Among them, λ reg ,λ cont ,λ smooth ,λ NS Weight factors for adjusting the contribution of each loss item; Supervised wind speed regression loss term: in, is the wind speed vector predicted by the model; is the actual observed wind speed value; N is the total number of wind speed nodes participating in the supervision; Continuity constraints: Where: (i, j) is the node pair connected in the graph; φ(e ij ) is the edge weight; is the wind speed vector of the adjacent node i; is the wind speed vector of the adjacent node j; Smoothness constraint: in: is the set of adjacent nodes of node i; is the number of adjacent nodes; Fluid conservation constraints: Where: ρ is the density of the fluid; p i is the pressure at node i; μ is the dynamic viscosity of the fluid; ▽ represents the spatial differential operator, which is used to calculate the gradient of the physical quantity.
8. The gas leak tracing method based on edge meteorological environment modeling according to claim 1 is characterized in that: The preprocessing includes the correction of the vehicle speed disturbance term, specifically: real-time reading of the vehicle platform speed vector u car , and project it to the wind speed direction to construct the disturbance correction model, v corrected =v measured -α·u car , where α is the learnable coefficient or experience weight, v corrected Corrected wind speed.
9. The gas leak tracing method based on edge meteorological environment modeling according to claim 8 is characterized in that: The preprocessing includes time series unification, sliding window, asynchronous observation interpolation and node normalization processing, specifically: based on the Beidou BDS timing capability, unified timestamp calibration is performed on the collected data; time sliding windows are constructed, and a 30%-50% overlap is set between windows to form an overlapping sliding window sequence to ensure that the generated data has temporal continuity and consistency; the preprocessing also includes anomaly detection and observation quality enhancement: outliers are detected and abnormal items are filled using nearest neighbor interpolation and time-weighted averaging.
10. A gas leak tracing device based on edge meteorological environment modeling, characterized in that: include: Data acquisition and preprocessing module: uses fixed anemometers and vehicle-mounted anemometers to collect wind speed information and gas concentration information, and preprocesses the collected information to obtain structured data for each observation node; Graph structure construction module: All observation points within the time window are considered as a node, and edge weight modeling is performed based on the physical factors and weighting mechanism between nodes to obtain the graph structure; Physical constraint graph neural network module: uses the obtained graph structure to predict wind speed field; Gas source tracing reasoning module: The predicted wind speed field and gas concentration observation are jointly modeled to invert the three-dimensional position of the leakage source.