A wireless positioning-based distributed gas leak source detection method and system
By establishing a three-dimensional spatial coordinate system for the sensor network and a cloud-based multi-physics collaborative reconstruction network, combined with virtual particle tracing, the issues of flexibility, cost, and accuracy in gas leak monitoring are resolved, achieving efficient gas leak source location and tracing.
Patent Information
- Application Number
- CN202610630373.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-09
- Publication Date
- 2026-07-24
AI Technical Summary
Existing gas leak monitoring technologies suffer from poor deployment flexibility, high cost, low accuracy, and slow response, especially in complex dynamic airflow environments where it is difficult to accurately trace the source and reconstruct the gas concentration field.
A distributed gas leak source detection method based on wireless positioning is adopted. By establishing a three-dimensional spatial coordinate system of a sensor network, a high-resolution three-dimensional concentration field and gas velocity field are reconstructed on a cloud server using a multi-physics collaborative reconstruction network. Then, based on virtual particles, reverse Monte Carlo backtracking is performed to realize the probability density localization of the gas leak source.
It enables automated, networked, and intelligent monitoring of gas leak sources, ensuring the physical consistency and high accuracy of gas tracing results under complex operating conditions, reducing sensor deployment costs, and improving response speed.
Smart Images

Figure CN122452345A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial safety monitoring technology, and in particular to a distributed gas leak source detection method and system based on wireless positioning. Background Technology
[0002] In industrial production and other applications involving hazardous gases, gas leak monitoring is crucial for ensuring safe production. Currently, common gas monitoring methods mainly rely on periodic manual inspections or fixed-point deployment of gas sensors. However, both methods have significant shortcomings: periodic inspections pose personnel safety risks, have limited monitoring range, and are slow to respond; while fixed-point sensor deployment suffers from poor network deployment flexibility, only provides threshold alarm functions, struggles to obtain high-resolution three-dimensional spatiotemporal distributions of gas concentrations, and cannot accurately trace the leak source in complex dynamic airflow environments.
[0003] To address the aforementioned issue of poor deployment flexibility, several wireless indoor positioning solutions have been proposed in the prior art to assist in the construction of sensor networks. However, these solutions each have their limitations: for example, positioning methods based on WiFi signal fingerprint databases require cumbersome environmental signal collection before deployment; positioning technologies based on ultra-wideband signals are too costly and difficult to apply on a large scale; and ranging methods based on single-channel Bluetooth signals suffer from low accuracy due to the susceptibility of signals to indoor multipath propagation and fading.
[0004] More importantly, in terms of intelligent leakage backtracking and concentration field reconstruction, existing technologies face the dual contradictions of "physical dependence" and "data scarcity":
[0005] (1) Limitations of physical-driven models (such as CFD and Gaussian plume models): Although these methods are theoretically rigorous, they are extremely dependent on precise boundary conditions and additional information such as real-time gas velocity data. In practical applications, to obtain accurate gas velocity information, it is usually necessary to deploy expensive wind speed sensor arrays, which greatly increases the deployment cost of sensor networks, and the accuracy of this data will drop drastically when the gas diffusion speed is slow. If wind speed data is lacking, the calculation error of the physical model will be amplified exponentially, making it difficult to meet the monitoring needs of low cost and few devices in industrial sites. At the same time, physical-driven methods have problems such as long processing time, making it difficult to meet the real-time requirements of gas monitoring.
[0006] (2) Limitations of data-driven methods (such as deep learning and other artificial intelligence algorithms): Although pure data-driven algorithms are fast, they are essentially "black box" mappings, lacking the constraints of physical mechanisms. When sensors are sparsely deployed, such algorithms are prone to overfitting, and the generated concentration fields often violate the conservation laws of fluid dynamics (such as mass conservation and momentum conservation). More seriously, current artificial intelligence algorithms that integrate physical information cannot calculate the physical loss that satisfies the gas dynamics equations based solely on concentration changes when gas velocity monitoring data is missing, resulting in extremely poor source tracing reliability in unsteady airflow environments.
[0007] In conclusion, designing a gas monitoring system that is highly flexible in deployment, highly intelligent, highly accurate, and has a fast response speed is a technical problem that urgently needs to be solved. Summary of the Invention
[0008] Objective: This invention aims to provide a distributed gas leak source detection method and system based on wireless positioning. The method involves establishing a three-dimensional spatial coordinate system for a sensor network within the monitoring area. Each sensor unit uploads processed data, its own coordinates, and timestamp data to a cloud server. The cloud server constructs multi-frame spatiotemporal input tensors, which are input to a multi-physics collaborative reconstruction network based on a window attention mechanism. Under the constraints of the Navier-Stokes equations and the convection-diffusion equations, a high-resolution three-dimensional concentration field and gas velocity field are synchronously inverted and reconstructed from sparse concentration data. Based on the inverted velocity field, virtual particles are driven to perform reverse Monte Carlo backtracking to locate the probability density of the leak source. This detection method and system, based on the Internet of Things, integrates multi-sensor arrays, and utilizes wireless positioning technology. It aims to solve the problems of high sensor deployment costs and the inability to trace the source using only threshold alarms in existing technologies. It achieves automation, networking, and intelligence in gas leak source monitoring, ensuring physical consistency and high accuracy of gas source tracing results even under complex operating conditions.
[0009] Technical solution: To achieve the above objectives, the present invention provides a distributed gas leak source detection method based on wireless positioning, comprising the following steps:
[0010] 1) Establish a sensor network coordinate system within the monitoring area and calculate the three-dimensional spatial coordinates of each sensor unit in the sensor network coordinate system; the process is as follows:
[0011] Within a sliding window, the variance of the Received Signal Strength Indication (RSSI) of each broadcast channel is obtained; a normalized weight is assigned to each channel based on the variance; the variance is inversely proportional to the normalized weight; based on the logarithmic distance path loss model and the normalized weight, the fusion distance of the sensor unit to be located relative to the known base point is calculated; a weighted least squares objective function is constructed, and the solution vector of the least squares objective function is minimized through iterative solution to obtain the three-dimensional spatial coordinates.
[0012] 2) The gas response data and ambient temperature and humidity data collected by the sensor unit are preprocessed and then uploaded to the cloud server.
[0013] 3) The cloud server parses the gas concentration value at a single point and constructs a multi-frame spatiotemporal input tensor based on the three-dimensional spatial coordinates and timestamps; the process is as follows: select the current time... and the past The single-point gas concentration data at each time point are used to construct a dimension (B,T,1) based on the sensor's spatial coordinates. The input tensor; where B is the input batch size and T is the number of input frames. The number of network cells in each of the X, Y, and Z dimensions.
[0014] 4) The multi-frame spatiotemporal input tensor is input into the trained multiphysics collaborative reconstruction network based on window attention mechanism; the reconstruction network uses a three-dimensional deep neural network based on window attention mechanism to extract spatiotemporal features, and outputs the three-dimensional gas concentration field and the three-dimensional gas velocity field simultaneously through a dual-channel decoder; wherein, the process of extracting spatiotemporal features is as follows:
[0015] The input tensor is segmented into 3D tiles; feature encoding is performed using alternating window-based multi-head self-attention (W-MSA) and shift-window-based multi-head self-attention (SW-MSA) modules; W-MSA captures local spatiotemporal features within an independent window, while SW-MSA performs spatiotemporal modeling across windows through cyclic shifting.
[0016] 1) Based on the three-dimensional gas velocity field output in step 4), a Monte Carlo simulation and reverse Monte Carlo backtracking are performed on the virtual particle model to generate a posterior probability density map of the leak source, and the region with the highest probability density is identified as the location of the gas leak source; the reverse Monte Carlo backtracking process is as follows: virtual particles are initialized in regions where the concentration is higher than a preset threshold; based on the inverse stochastic differential equation... Update particle positions; where For the change of particle position, This is a deterministic drift term based on the gas velocity field. Let D be the diffusion tensor, representing the random diffusion term that represents the measurement uncertainty. This is the increment for the Wiener process. Then, the spatial density distribution of a large number of virtual particles at the backtracking endpoint is statistically analyzed to generate a posterior probability density map.
[0017] In step 4), the reconstruction network introduces a physical constraint loss function during the training phase. By minimizing the residuals of the network output field under the Navier-Stokes equations and the convection-diffusion equations, the reconstruction network is able to invert the gas velocity field from sparse concentration data.
[0018] Variance in step 1) ,in For the first in the sliding window Each sample value The normalized weights are the average of the sampled values. The fusion distance between the sensor to be located and the known base point is calculated based on the logarithmic distance path loss model and normalized weights. ,in For reference distance, This is the path loss index. Let be the reference signal strength of the i-th channel measured at the reference distance. Let be the signal strength of the i-th channel received by the sensor unit to be located.
[0019] After obtaining the distances between the sensor unit to be located and at least three base points, a weighted least squares objective function is constructed. ;in, For the k-th known coordinate, The number of coordinate nodes has been determined; the Gauss-Newton iteration method is used to solve the least squares objective function; when the objective function... When the solution converges to the global minimum, the corresponding solution is the three-dimensional spatial coordinates of the sensor unit.
[0020] In step 5), the process of performing Monte Carlo simulation on the virtual particle trajectory is as follows:
[0021] 5.1) Initialization: At the current moment In all High concentration areas, initialization virtual particles ;in The gas concentration at each point;
[0022] 5.2) Iterative backtracking: Perform The time step iteration, with a time step size of [number] times. At each time step In the middle, calculate each particle At the position of the previous moment; this process involves integrating back along the opposite direction of the diffusion vector field, tracing the trajectories of all particles, and simultaneously superimposing the random diffusion term.
[0023] 5.3) Endpoint Record: When backtracking to a preset initial time (e.g., t=0) or during iteration... After that, record all The final destination of each particle's backtracking .
[0024] In step 1), calculating the three-dimensional spatial coordinates of each sensor unit also includes:
[0025] 1.1) Confidence assessment: The root mean square of the coordinate calculation residuals of the sensor unit to be located is used as the confidence index.
[0026] 1.2) Secondary base point upgrade: When the confidence index is less than the preset threshold, the sensor unit to be located is marked as a high confidence node and dynamically upgraded to a secondary base point, and added to the base point set for auxiliary positioning.
[0027] 1.3) Iterative expansion: A new round of distance measurement and coordinate calculation is performed on the unlocalized sensor units in the network using a set of base points containing the initial base point and secondary base points until all nodes are localized.
[0028] 1.4) Global optimization: Construct a global pose graph, take the weighted sum of squared errors of all ranging edges as the objective function, adopt a global graph optimization algorithm and adjust the coordinates of secondary base points and ordinary nodes to eliminate iterative cumulative errors.
[0029] In step 2), the data preprocessing process is as follows:
[0030] 2.1) Signal noise reduction: Monitor the rate of change of sensor response data; when the rate of change is lower than a preset threshold, use a small process noise covariance to suppress noise; when the rate of change is higher than the preset threshold, increase the process noise covariance.
[0031] 2.2) Dynamic temperature and humidity compensation: Using a calibrated second-order polynomial model, the theoretical baseline drift is calculated based on the real-time collected temperature and humidity data, and the original response value of the sensor is corrected.
[0032] In step 3), the cloud server performs principal component analysis on the multi-dimensional response feature vector of each sensor unit to calculate the single-point concentration value of each node; then, it selects the current and uploaded datasets and constructs a multi-frame spatiotemporal input tensor by mapping the sensor coordinate values to a preset spatial resolution grid through three-dimensional kriging interpolation.
[0033] In step 4), a physical constraint loss function is introduced during training, and the three-dimensional gas concentration field output by the network is calculated using differentiation. With three-dimensional gas velocity field Spatiotemporal partial derivatives; constructing convection-diffusion equation residuals Constructing the Navier-Stokes equation residuals Calculate the sum of the mean square errors of the above residuals as the physical constraint loss term, where For gas density, For pressure field, The kinematic viscosity coefficient, External forces acting on a fluid, such as gravity or buoyancy, For gas concentration, denoted as the diffusion coefficient of the gas.
[0034] The distributed gas leak source detection method based on wireless positioning of this invention employs a detection system comprising a sensor network consisting of a cloud server and sensor units. The sensor network performs coordinate self-calibration via Bluetooth signal interaction and collects preprocessed environmental data. The cloud server communicates with the sensor network. The cloud server has a built-in collaborative reconstruction module based on a window attention mechanism and a particle source tracing module. The collaborative reconstruction module based on the window attention mechanism synchronously inverts the three-dimensional gas concentration field and the three-dimensional gas velocity field from the uploaded data under the constraints of physical equations. The particle source tracing module calculates the probability distribution of the gas leak source through the inverted velocity field.
[0035] Working principle: To replace the traditional methods of manually setting coordinates with poor flexibility or satellite positioning with poor indoor positioning sensitivity, this invention utilizes the physical characteristics of signal propagation on different frequency channels to accurately calculate the three-dimensional spatial coordinates of each sensor unit in the network.
[0036] Step 1.1), Base point deployment and initialization.
[0037] In step 1), at least three sensor units are manually selected and deployed as coordinate base points within the monitoring area, and known, unique relative three-dimensional coordinates are assigned to these base points. The serial numbers of these base points and their corresponding coordinates are pre-entered into a cloud server, forming the reference benchmark for the entire automated positioning network.
[0038] Step 1.2), multi-channel Bluetooth fusion ranging and positioning.
[0039] To establish the relationship between signal strength and distance, this invention employs a log-normal path loss model. First, the measurement noise variance for each broadcast channel is calculated through statistical analysis. This value reflects the stability of the channel signal; the smaller the variance, the higher the quality. Subsequently, the normalized weight for each channel is calculated based on the signal quality. ,in This is the summation index in the algorithm, used to traverse channels 37, 38, and 39. The denominator represents the sum of the signal quality of all three broadcast channels.
[0040] Subsequently, based on the logarithmic path loss model and combined with the normalized weights of each channel obtained from the aforementioned calculations, The fusion distance of the sensor unit to be located relative to the known base point is derived. The calculation formula is as follows: .
[0041] in, Let be the reference signal strength of the i-th channel measured at the reference distance. The signal strength of the i-th channel received by the sensor unit to be located;
[0042] Step 1.3) Construct a system of coordinate equations.
[0043] When a sensor unit to be located is calculated using a ranging algorithm (let its unknown three-dimensional coordinates be...), )and indivual Base point with known coordinates (in Distance between ) Subsequently, the position of the sensor unit to be positioned is theoretically subject to... Constraints on the following geometric equations:
[0044]
[0045] The present invention further linearizes the above nonlinear equations and uses the robust least squares method to solve for the coordinates, thereby solving for the optimal coordinates that are closest to the true position from the redundant data with errors.
[0046] Step 1.4) Perform secondary node iteration and location coordinate optimization.
[0047] This invention performs coordinate calculation based on iterative expansion and global optimization. During the establishment of the sensor network, a "base point set" is maintained, which initially contains only all the aforementioned "coordinate base points".
[0048] First, according to the formula Calculate the confidence level of the coordinates obtained by locating a node using N base points. .in, It is the distance measurement value obtained between the undetermined coordinate node and the base point through a Bluetooth positioning algorithm, and The set distance is obtained based on the calculated coordinates. Confidence level. The smaller the value, the better the consistency between the measured value and the solution result, and the higher the confidence level of the positioning result.
[0049] The coordinates of all unknown nodes in the sensor network are then iterated using the following steps:
[0050] (1) Initial positioning: All visible unknown nodes in the network are located using only the coordinate base. This positioning process involves performing the distance measurement described in step 1.2) and the coordinate calculation described in step 1.3).
[0051] (2) Node Upgrade: After completing one round of localization, traverse all newly localized nodes. If the confidence score E of a node's coordinates is less than a preset confidence threshold... This node is then identified as a high-confidence node, and its calculated coordinates... Along with its unique device identifier (such as the chip manufacturing serial number of the sensor unit), it is dynamically added to the base point set and upgraded to a "secondary base point".
[0052] (3) Network Expansion: Repeat steps (1) and (2). In subsequent iterations, nodes that were previously unable to observe enough coordinate base points use these newly generated secondary base points as additional references to perform a new round of distance measurement and coordinate calculation. Here, distance measurement refers to the distance measurement and coordinate calculation between the node to be located and all visible base points (including coordinate base points and secondary base points) in the "base point set" according to the methods described in steps (1.2) and (1.3).
[0053] (4) This process is repeated until all nodes in the network are successfully located, or the location result reaches the set confidence level.
[0054] After the positioning iteration is completed, in order to eliminate the accumulation of errors during the iteration and to make the coordinates of the entire gas sensor network internally consistent and globally optimal, the positioning coordinates are adjusted according to the formula... Perform a global coordinate optimization.
[0055] This optimization process is a nonlinear least squares problem. During the solution process, the coordinates of all base points are kept constant as a constraint, and only the coordinates of all secondary base points and ordinary nodes are adjusted until... The solution converges to its minimum value, at which point the coordinates of each node are obtained, representing the optimal solution. In this formula... The set of all valid distance measurement edges, The confidence level is proportional to the signal stability. It is a node and The measured distance between them and For nodes and The coordinates.
[0056] Step 2) Gas information acquisition and local data preprocessing.
[0057] After the network coordinates are established, each sensor unit collects multi-dimensional gas sensor response data and environmental temperature and humidity data within the monitoring area, and performs data preprocessing locally.
[0058] Local data preprocessing includes: signal noise reduction: real-time monitoring of the rate of change of sensor response data; when the rate of change is lower than a preset threshold, a small process noise covariance is used to suppress noise; when the rate of change is higher than the preset threshold, the process noise covariance is dynamically increased to improve the tracking speed of step signals; dynamic temperature and humidity compensation: using a pre-calibrated second-order polynomial model, the theoretical baseline drift is calculated based on the real-time collected temperature and humidity, and the original sensor response value is corrected; the second-order polynomial model includes the cross term of temperature and humidity.
[0059] On the microprocessor (MCU) of the sensor unit, a series of local computational processes are performed on the acquired raw data. These processes aim to minimize noise interference and environmental factors before the data is uploaded to the cloud, ensuring the accuracy and reliability of the data. This step includes signal noise reduction and dynamic baseline correction.
[0060] Temperature and humidity compensation: To address the susceptibility of metal oxide gas sensors to environmental influences on the baseline, a multivariate polynomial fitting model is pre-established through offline calibration. During actual testing, the microprocessor inputs real-time temperature and humidity data into this model to calculate the theoretical baseline drift and dynamically correct the sensor output, thereby obtaining an accurate concentration response value after environmental compensation.
[0061] Steps 3 to 5: Reconstruction and source tracing of the three-dimensional gas distribution in the cloud.
[0062] To address the challenge of existing technologies simultaneously providing source tracing and concentration reconstruction for complex industrial production, this invention executes a multi-physics collaborative reconstruction algorithm on a cloud server. This algorithm innovatively constructs a shared-weight, window-attention-based 3D deep neural network spatiotemporal encoder, mapping sparse multi-frame spatiotemporal data into unified high-dimensional features. Subsequently, through a dual-channel decoding architecture, high-resolution 3D concentration and gas velocity fields are simultaneously inverted and reconstructed using physical equation constraints, without the need for wind speed sensors. Finally, the inverted velocity field drives a virtual particle model for reverse spatiotemporal backtracking, achieving probability density localization of the leak source. This architecture leverages the nonlinear representation capabilities of deep learning and, through embedding Navier-Stokes equations (PDEs) constraints, ensures that the reconstruction and source tracing results at sparse monitoring points strictly adhere to fluid dynamics laws.
[0063] Step 3.1) Data collection and preliminary analysis on cloud servers
[0064] The cloud server receives data packets from multiple sensor units via the Internet of Things (IoT) protocol. The server parses the data and uses pre-calibrated algorithms, such as principal component analysis, to calculate the single-point gas concentration value of each node at the current moment. To capture the dynamic diffusion characteristics of the gas, this invention constructs a multi-frame spatiotemporal input tensor, selecting concentration data from the current moment and several past moments. Combined with the spatial coordinates of the sensor nodes, spatial interpolation methods such as Kriging interpolation or Gaussian kernel extrapolation are used to map the sparse discrete data monitoring points onto a regular three-dimensional grid of the monitoring area, forming a grid with dimensions (B, T, 1). The input tensor. Where B is the input batch size and T is the number of input frames. Let X be the number of grid cells in each of the X, Y, and Z dimensions. This tensor fully records the evolution of the gas concentration field in time and space.
[0065] 4) Cooperative reconstruction of concentration-flow field based on physical information constraints:
[0066] To address the issues of existing technologies where purely data-driven algorithms lack physical constraints and physically constrained equation-driven methods have long computation times, this invention employs a multi-physics collaborative reconstruction architecture based on a window attention mechanism. In the deep learning algorithm, gas concentration is treated as a dynamic system driven by the flow field. Based on the input containing spatiotemporal information in step 3.1), the concentration field and velocity field are simultaneously inverted. This not only eliminates the need for wind speed measurement hardware on the sensor unit, reducing size and cost, but also integrates physical constraint equations, making the deep learning algorithm output more consistent with gas dynamics. Specific steps include:
[0067] Step 4.1) Spatiotemporal feature encoding of gas distribution based on window attention mechanism of three-dimensional deep neural network.
[0068] To achieve the mapping from sparse discrete observation points to a high-resolution continuous concentration field, this invention employs an improved 3D deep neural network structure based on a window attention mechanism. This network structure includes a downsampling path (encoder) and an upsampling path (decoder), which fuse features through skip connections. The encoder receives the input tensor constructed in step 3.1) and uses a 3D deep neural network module based on a window attention mechanism as the backbone network for feature extraction. The encoding steps are as follows:
[0069] 3D Patch Segmentation and Linear Embedding: First, the network segments the input tensor into non-overlapping 3D cubes (3D Patches) in the spatial and temporal dimensions, and then maps each patch into a high-dimensional feature vector through a linear projection layer.
[0070] Windowed Attention Mechanism (W-MSA): In the feature extraction stage, to reduce computational complexity, the 3D deep neural network module based on the window attention mechanism divides the feature map into multiple non-overlapping 3D windows. Self-attention computation is confined to each independent 3D window, which facilitates the capture of microscopic changes in gas concentration within the spatial neighborhood and short time series within the window.
[0071] Shifted Window Interaction Mechanism (SW-MSA): To address the issue of information incompatibility between different windows, the network introduces a Shifted Window operation immediately following the W-MSA layer. This operation redefines window boundaries by cyclically shifting windows in the time, height, width, and depth directions, allowing new windows to cross the boundaries of older windows in the previous layer. By alternately executing W-MSA and SW-MSA, the model can progressively establish long-range dependencies across windows and covering the entire spatiotemporal domain during hierarchical propagation.
[0072] Encoding Process: As the network depth increases, after multiple sampling operations on the feature map, the spatial resolution of the feature tensor decreases layer by layer, while the number of channels increases layer by layer. Finally, the encoder outputs a deep latent feature map containing highly abstract semantic information (such as diffusion trends and wind field implicit features).
[0073] Step 4.2) Feature decoding and high-resolution multiphysics reconstruction.
[0074] This invention employs a decoder to progressively reconstruct the output encoded data, which characterizes the temporal and spatial features of gas distribution, into a three-dimensional concentration distribution map and gas velocity field corresponding to the physical dimensions of the monitoring area. The decoding algorithm steps are as follows:
[0075] Upsampling recovery: The decoder uses a series of upsampling modules (such as 3D deconvolution or trilinear interpolation combined with 1x1 convolution) to progressively enlarge the spatial and temporal dimensions of the feature map. With each upsampling stage, the resolution of the feature map doubles and the number of channels is halved, thereby restoring the spatial geometric details of the gas distribution.
[0076] Skip-link feature fusion: Because deep networks particularly lose high-frequency details such as gas plume edge contours and subtle turbulence, this invention constructs skip links between the encoder and decoder at the same resolution level. This link directly stitches the shallow feature map from the encoder, which retains high-frequency information about spatial gas diffusion, onto the corresponding deep feature map from the decoder. Through this "shallow-deep fusion" mechanism, the network can maintain the accuracy of the macroscopic diffusion trend and clearly depict the boundary contours of the gas plume when reconstructing the three-dimensional gas concentration distribution map.
[0077] After final projection by the decoder, the network outputs a dimension (B, , The high-resolution output tensor represents a high-resolution three-dimensional gas concentration distribution map and gas velocity field. Here, B is the number of samples processed in parallel by the model. The output feature channels specifically include one scalar channel characterizing gas concentration and one three-dimensional vector channel characterizing gas flow rate. Representing high-resolution gas distribution maps in Dimensional resolution.
[0078] Step 4.3) Construction of loss function based on gas dynamics equation.
[0079] The loss function of the deep learning algorithm used in this invention further incorporates the convection-diffusion equation, which characterizes the gas diffusion process, as a constraint. The loss function of this algorithm is: , which includes a data loss function representing the difference between the network output concentration field and the actual sensor observation data. And the physical loss function representing whether it conforms to the characteristics of gas dynamics. .
[0080] The physical loss function is the sum of the mean square errors of the various gas dynamic equations involved in the gas diffusion process, i.e. = .
[0081] Among them, the continuity equation residual The residuals of the Navier-Stokes equations are The convection-diffusion equation residuals are .in, For the velocity vector field, it is represented in a three-dimensional coordinate system as: express Velocity vectors in three directions For gas density, For pressure field, The kinematic viscosity coefficient, External forces acting on a fluid, such as gravity or buoyancy, For gas concentration, denoted as the diffusion coefficient of the gas.
[0082] Step 5) Reverse tracing of the leakage source based on implicit flow field inference.
[0083] After obtaining a high-resolution, physically consistent multiphysics output tensor, this invention abandons the complex process of solving underdetermined equations by introducing artificial smoothing constraints, as required by traditional gas dynamics equations. Instead, it directly utilizes the gas velocity field output by the algorithm for Bayesian particle source tracing, enabling robust source tracing in real-world environments with measurement noise and model uncertainties. The process is as follows:
[0084] Multiple particles are initialized within a concentration above a preset threshold, each following a predetermined motion law. The trajectory of each particle is determined by the equation... Description, in which For the change of particle position, For the deterministic drift term based on the vector field, Let represent the random diffusion term representing the measurement uncertainty, where D is the diffusion tensor. For Wiener process increments.
[0085] The endpoints of all particle trajectories will form a posterior probability distribution map of the leakage source location in space. The posterior probability density map is generated by dividing the entire monitoring area into a fine three-dimensional voxel grid, then statistically analyzing and normalizing the values falling on each voxel. End point of the trajectory within The spatial probability density histogram is generated based on the number of leaks. The region with the highest density on this probability density map represents the location of the leak source under the maximum a posteriori probability estimate.
[0086] Beneficial effects: Compared with the prior art, the present invention has the following advantages:
[0087] (1) This invention combines a highly flexible wireless self-positioning sensor network with a cloud-based intelligent tracing algorithm to construct a closed-loop detection method from data acquisition and three-dimensional concentration field reconstruction to reverse tracing of the leak source. This method solves the problems of high deployment cost and threshold alarm capability of traditional fixed-point sensor networks, thus realizing the automation, networking and intelligence of gas leak monitoring.
[0088] (2) Compared with existing sensor network establishment technologies, the detection method of the present invention does not require tedious and time-consuming large-scale manual coordinate calibration or wireless signal acquisition in the early stage. At the same time, by fusing multi-channel information, it significantly improves the positioning accuracy and stability, and realizes the rapid, low-cost and high-precision automated deployment of sensor networks.
[0089] (3) Compared with complex computational fluid dynamics models or pure data-driven artificial intelligence algorithms that are prone to violating physical laws, the multi-physics collaborative reconstruction architecture of the three-dimensional deep neural network based on window attention mechanism adopted in this invention autonomously inverses and infers the missing gas velocity field information from sparse concentration change sequences based on deep learning network algorithms under physical constraints such as the Navier-Stokes equations. Thus, without deploying wind speed sensor arrays, it can still achieve rapid reconstruction and source tracing of gas concentration fields that conform to fluid dynamics. Attached Figure Description
[0090] Figure 1 This is a schematic diagram of the sensor unit used in this invention;
[0091] Figure 2 This is a schematic diagram of the distributed gas leak source detection method based on wireless positioning according to the present invention. Detailed Implementation
[0092] The present invention is a distributed gas leak source detection system based on wireless positioning, which consists of a cloud server and multiple sensor units.
[0093] like Figure 1 As shown, the sensor unit in this embodiment of the invention functions to achieve distributed, networked monitoring, employing a modular, vertically stacked integrated design. The sensor unit includes:
[0094] Sensing Layer: As the front end for data acquisition, the core of this sensor is a gas sensor array. This array consists of multiple semiconductor metal oxide gas sensors based on micro-nano fabrication, each sensor exhibiting differentiated selectivity and sensitivity for the same type of target gas. Furthermore, this sensing layer also integrates high-precision temperature and humidity sensors for real-time monitoring of environmental parameters.
[0095] Data processing layer: This layer processes the weak analog signals acquired by the sensors. It employs a high-precision analog-to-digital converter to digitize the signals from each sensor channel. Simultaneously, a digital-to-analog converter and operational amplifier module enable dynamic and precise control of the sensor's heating voltage, forming a closed-loop feedback temperature control circuit to ensure the sensor operates stably at the set temperature.
[0096] Control Layer: As the core of sensor unit operations and communication, it includes a microprocessor responsible for data acquisition, local preprocessing, and communication. Wireless signal transmission and reception are achieved through an onboard inverted-F antenna, ensuring efficient signal transmission and reception.
[0097] Power supply layer: Provides a stable voltage for the entire unit. In this embodiment, a button battery is used as the main power source, and an inductor-based energy storage switching topology boost circuit is used to power the sensor heating, and a low-dropout linear regulator is used to power precision digital chips such as microprocessors, depending on the voltage requirements of different circuits.
[0098] The layers are stacked through inter-board connectors, which ensures signal integrity and improves integration and maintainability.
[0099] like Figure 2 As shown, the distributed gas leak source detection method based on wireless positioning of the present invention is as follows:
[0100] Step 1) Establish a sensor network coordinate system within the monitoring area.
[0101] Within the monitoring area, at least three sensor units with known precise coordinates are first manually deployed as coordinate base points. Subsequently, each sensor unit, with Bluetooth Low Energy enabled and in scanning mode, continuously receives signals from multiple base points on three independent broadcast channels (37, 38, and 39) and measures the Received Signal Strength Indication (RSSI).
[0102] In this embodiment, the broadcast interval of the base point is preferably set to 100ms, and the scanning window of the unit to be located is set to 50ms to ensure that data can be effectively captured in each broadcast cycle. To ensure signal quality, the microprocessor calculates the signal-to-noise variance of each channel within a sliding window containing 20 consecutive RSSI samples. ,in For the first in the sliding window Each sample value The average of the sampled values is used as the basis for assigning weights to each channel. Finally, the fusion distance between the sensor unit to be located and the known base point is calculated based on the logarithmic distance path loss model. ,in For reference distance, This is the path loss index.
[0103] After obtaining the precise distances to at least three base points, construct a weighted least squares objective function. .in For the k-th known coordinate, Given the number of coordinate nodes, the cloud server uses the Gauss-Newton iterative method to solve the least squares objective function. When the objective function... When the solution converges to the global minimum, the corresponding solution is the final three-dimensional spatial coordinates of the sensor unit in the network coordinate system.
[0104] In step 1), to expand network coverage, when the root mean square of the coordinate calculation residual of a new positioning node is less than a preset threshold, such as 0.1 meters, the node is identified as a high-confidence node and dynamically upgraded to a secondary base point for auxiliary positioning. After all positioning is completed, a graph-based global optimization algorithm is executed, treating the entire network as a pose graph for adjustment to eliminate accumulated errors during the iteration process and ensure the global optimum and internal self-consistency of the entire network coordinate system.
[0105] Step 2): After preprocessing the gas response data and ambient temperature and humidity data collected by the sensor unit, upload them to the cloud server.
[0106] After the network coordinate system is established, the microprocessors of each sensor unit initiate a data acquisition and local preprocessing process at a preset period through internal timer interrupts to obtain accurate sensor response data. Signal denoising employs an adaptive Kalman filter algorithm to process the raw sensor response data to estimate the true signal state after noise removal. During signal stability, a small process noise covariance and a moderate observation noise covariance are used to achieve optimal noise suppression. When the values of multiple consecutive sampling points exceed a preset threshold, it is determined that a real and drastic step change in gas concentration has occurred. At this point, the process noise covariance value is increased, thereby making the filter more confident in the current measurement value and accelerating the sensor response. Temperature and humidity compensation is based on the dataset and model established during the offline calibration phase, fitting a model as shown in the figure. The polynomial, where This is the fitting coefficient, which was experimentally measured during the sensor calibration phase. For temperature, For humidity. In actual monitoring, the microprocessor calculates the current theoretical baseline drift based on the real-time collected temperature T and humidity H using this polynomial, and removes it from the sensor's original response value to obtain a precise signal after temperature and humidity compensation.
[0107] Step 3) The cloud server parses the single-point gas concentration value and constructs a multi-frame spatiotemporal input tensor.
[0108] Each sensor unit uploads a JSON-formatted data packet containing its own coordinates, timestamp, and preprocessed data to the cloud server via the Message Queuing Telemetry Transmission (MQTT) protocol. The cloud server first performs principal component analysis on the multi-dimensional response feature vector of each sensor to calculate the single-point concentration value for each node. Then, the cloud server selects the current dataset and the two previous uploaded datasets, combining them with the sensor coordinate values mapped to a preset spatial resolution grid using 3D Kriging interpolation to construct a multi-frame spatiotemporal input tensor.
[0109] Step 4), a multi-physics collaborative reconstruction network based on the window attention mechanism.
[0110] First, the deep learning algorithm is pre-trained. In this embodiment, in addition to collecting a large dataset from field experiments, the pre-training process is carried out by pre-constructing a prior dataset containing rich and fluid feature information. Specifically, using computational fluid dynamics simulation software, a digital twin model of the geometry of the area to be monitored is established. Various operating condition combinations are set in the simulation environment, such as changing the inlet wind speed, wind direction, leak source location, and leak rate, to construct a large dataset for training. Through the pre-training step, the deep learning algorithm learns the nonlinear mapping weights from "sparse concentration distribution" to "global flow field structure".
[0111] The multi-frame spatiotemporal input tensor constructed in step 3) is input into a pre-trained multiphysics reconstruction algorithm based on window attention mechanism. The reconstruction algorithm adopts an encoder-decoder architecture and aims to output high-resolution gas concentration field and flow velocity field simultaneously.
[0112] The encoder employs a windowed 3D Transformer (Swin3D) based on a window attention mechanism in a 3D deep neural network as its main network. First, the input tensor is segmented into multiple non-overlapping 3D patches (3DPatches). Then, feature extraction is performed using alternating stacked window-based multi-head self-attention modules (W-MSA) and shifted-window-based multi-head self-attention modules (SW-MSA). W-MSA restricts self-attention computation to independent 3D windows, reducing computational complexity and capturing local microscopic diffusion features of gas concentration. SW-MSA, on the other hand, performs cyclic shifting operations on the window segmentation to achieve information interaction between adjacent windows, thereby establishing long-distance spatiotemporal dependencies across windows and extracting implicit high-dimensional semantic features related to wind field driving and concentration evolution.
[0113] Subsequently, the decoder fuses the shallow high-resolution features and deep semantic features of the encoder through skip links and outputs a dimension of (B, , The output tensor is decomposed into a gas concentration field. and gas flow field .
[0114] During training, the reconstruction algorithm introduces physical information constraints. ,in = The physical residual term is calculated by substituting the partial derivatives of the concentration and velocity fields output by the automatic differential calculation network into the Navier-Stokes equations. This is achieved by minimizing... This allows the network to autonomously infer the velocity field that conforms to the laws of fluid dynamics based on the spatiotemporal evolution of the concentration field, without the supervision of wind speed sensor data, thus ensuring the physical consistency of the output results.
[0115] Furthermore, during the calculation of network inference and physical constraints, the boundary conditions of the monitoring area are explicitly defined to eliminate the uncertainty of the inversion results. In this embodiment, the boundary conditions are injected into the network using a mask matrix. First, a solid wall boundary is set, and the flow velocity on the wall within the monitoring area is set to 0. For open boundaries, such as ventilation windows or doors, the boundary values are set according to actual monitoring or preset parameters to ensure flux conservation at the boundary.
[0116] Step 5) Perform Monte Carlo simulation and reverse Monte Carlo backtracking based on the virtual particle model driven by the three-dimensional gas velocity field.
[0117] To obtain high-resolution three-dimensional concentration distribution maps of continuous time series If the concentration at a single point exceeds a set threshold, the server performs a backtracking analysis of the leakage source based on a Bayesian inference framework. Multiple virtual particles are initialized within the region where the concentration exceeds the set threshold, and then... The diffusion process involves uncertainty. By performing Monte Carlo simulations on the random trajectories of a large number of virtual particles, the endpoints of all trajectories form a posterior probability density map of the leakage source location in space. The region with the highest density on this probability density map is identified as the most likely leakage source location under the maximum a posteriori probability estimate, thus achieving robust and accurate localization.
Claims
1. A distributed gas leak source detection method based on wireless positioning, characterized in that: Includes the following steps: 1) Establish a sensor network coordinate system within the monitoring area and calculate the three-dimensional spatial coordinates of each sensor unit in the sensor network coordinate system; the process is as follows: Within a sliding window, the variance of the received signal strength indication of each channel is obtained; normalized weights are assigned to each channel based on the variance; based on the logarithmic distance path loss model and the normalized weights, the fusion distance of the sensor unit to be located relative to the known base point is calculated; a weighted least squares objective function is constructed, and the solution vector of the least squares objective function is minimized through iterative solution to obtain the three-dimensional spatial coordinates; 2) The gas response data and ambient temperature and humidity data collected by the sensor unit are preprocessed and then uploaded to the cloud server; 3) The cloud server parses the gas concentration value at a single point and constructs a multi-frame spatiotemporal input tensor based on the three-dimensional spatial coordinates and timestamps; the process is as follows: select the current time... and the past The single-point gas concentration data at each time point are used to construct a dimension (B,T,1) based on the sensor's spatial coordinates. The input tensor; where B is the input batch size and T is the number of input frames. The number of network cells in each of the X, Y, and Z dimensions; 4) The multi-frame spatiotemporal input tensor is input into the trained multiphysics collaborative reconstruction network based on window attention mechanism; the reconstruction network uses a three-dimensional deep neural network based on window attention mechanism to extract spatiotemporal features, and outputs the three-dimensional gas concentration field and the three-dimensional gas velocity field simultaneously through a dual-channel decoder; wherein, the process of extracting spatiotemporal features is as follows: The input tensor is segmented into 3D tiles; feature encoding is performed using alternating window-based multi-head self-attention (W-MSA) and shift-window-based multi-head self-attention (SW-MSA) modules; W-MSA captures local spatiotemporal features within an independent window, while SW-MSA performs spatiotemporal modeling across windows through cyclic shifting. 5) Based on the three-dimensional gas velocity field-driven virtual particle model, Monte Carlo simulation and reverse Monte Carlo backtracking are performed to generate a posterior probability density map of the leakage source, and the region with the highest probability density is identified as the location of the gas leakage source; the reverse Monte Carlo backtracking process is as follows: virtual particles are initialized in regions where the concentration is higher than a preset threshold; based on the inverse stochastic differential equation... Update particle positions; where For the change of particle position, This is a deterministic drift term based on the gas velocity field. Let D be the diffusion tensor, representing the random diffusion term that represents the measurement uncertainty. For Wiener process increments.
2. The distributed gas leak source detection method based on wireless positioning according to claim 1, characterized in that: Variance in step 1) ,in For the first in the sliding window Each sample value The normalized weights are the average of the sampled values. The fusion distance between the sensor to be located and the known base point is calculated based on the logarithmic distance path loss model and normalized weights. ,in For reference distance, This is the path loss index. Let be the reference signal strength of the i-th channel measured at the reference distance. The signal strength of the i-th channel received by the sensor unit to be located; After obtaining the distances between the sensor unit to be located and at least three base points, a weighted least squares objective function is constructed. ;in, For the k-th known coordinate, The number of coordinate nodes has been determined; the Gauss-Newton iteration method is used to solve the least squares objective function; when the objective function... When the solution converges to the global minimum, the corresponding solution is the three-dimensional spatial coordinates of the sensor unit.
3. The distributed gas leak source detection method based on wireless positioning according to claim 1, characterized in that: In step 5), the Monte Carlo simulation process is as follows: 5.1) Initialization: At the current moment In all High concentration areas, initialization virtual particles ;in The gas concentration at each point; 5.2) Iterative backtracking: Perform The time step iteration, with a time step size of [number] times. At each time step In the middle, calculate each particle The position at the previous moment; 5.3) Endpoint Record: When backtracking to the preset initial time or iteration After that, record all The final destination of each particle's backtracking .
4. The distributed gas leak source detection method based on wireless positioning according to claim 1, characterized in that: In step 1), calculating the three-dimensional spatial coordinates of each sensor unit also includes: 1.1) Confidence assessment: The root mean square of the coordinate calculation residuals of the sensor unit to be located is used as the confidence index; 1.2) Secondary base point upgrade: When the confidence index is less than a preset threshold, the sensor unit to be located is marked as a high confidence node and upgraded to a secondary base point, and added to the set of base points used for auxiliary positioning; 1.3) Iterative expansion: Distance measurement and coordinate calculation are performed on the unlocalized sensor units using a set containing initial and secondary base points until all nodes are localized; 1.4) Global optimization: Construct a global pose graph, take the weighted sum of squared errors of all ranging edges as the objective function, adopt a global graph optimization algorithm and adjust the coordinates of secondary base points and ordinary nodes to eliminate iterative cumulative errors.
5. The distributed gas leak source detection method based on wireless positioning according to claim 1, characterized in that: In step 2), the data preprocessing process is as follows: 2.1) Signal noise reduction: Monitor the rate of change of sensor response data; when the rate of change is lower than a preset threshold, use a small process noise covariance to suppress noise; when the rate of change is higher than the preset threshold, increase the process noise covariance. 2.2) Dynamic temperature and humidity compensation: Using a calibrated second-order polynomial model, the theoretical baseline drift is calculated based on the real-time collected temperature and humidity data, and the original response value of the sensor is corrected.
6. The distributed gas leak source detection method based on wireless positioning according to claim 5, characterized in that: The second-order polynomial model includes a cross term for temperature and humidity.
7. The distributed gas leak source detection method based on wireless positioning according to claim 1, characterized in that: In step 5), the posterior probability density map divides the entire monitoring area into a three-dimensional voxel grid, and then statistically normalizes the values falling on each voxel. End point of the trajectory within The quantity.
8. The distributed gas leak source detection method based on wireless positioning according to claim 1, characterized in that: In step 3), the cloud server performs principal component analysis on the multi-dimensional response feature vector of each sensor unit to calculate the single-point concentration value of each node; then, it selects the current and uploaded datasets and constructs a multi-frame spatiotemporal input tensor by mapping the sensor coordinate values to a preset spatial resolution grid through three-dimensional kriging interpolation.
9. The distributed gas leak source detection method based on wireless positioning according to claim 1, characterized in that: In step 4), a physical constraint loss function is introduced during training, and the three-dimensional gas concentration field output by the network is calculated using differentiation. With three-dimensional gas velocity field Spatiotemporal partial derivatives; constructing convection-diffusion equation residuals Constructing the Navier-Stokes equation residuals Calculate the sum of the mean square errors of the above residuals as the physical constraint loss term, where For gas density, For pressure field, The kinematic viscosity coefficient, External forces acting on a fluid, such as gravity or buoyancy, For gas concentration, denoted as the diffusion coefficient of the gas.
10. A detection system used in the distributed gas leak source detection method based on wireless positioning as described in claim 1, characterized in that: The system includes a sensor network consisting of a cloud server and sensor units; the sensor network performs coordinate self-calibration via Bluetooth signal interaction and collects preprocessed environmental data; the cloud server communicates with the sensor network; the cloud server has a built-in collaborative reconstruction module based on a window attention mechanism and a particle source tracing module; the collaborative reconstruction module based on the window attention mechanism synchronously inverts the three-dimensional gas concentration field and the three-dimensional gas velocity field from the uploaded data under the constraints of physical equations; the particle source tracing module calculates the probability distribution of the gas leakage source through the inverted velocity field.