A gas cylinder storage leakage point positioning detection method and system
Patent Information
- Application Number
- CN202411293646.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2044-09-14
AI Technical Summary
在气瓶存储厂区中往往存在着遮挡物会使得气体扩散方向改变,而气体模型的建立是没有考虑由于遮挡物而导致的扩散方向改变
[0074]1、本发明放弃传统的传感器网络节点的方法,引入六边形布局的传感器阵列,可以用很少的节点就能实现泄漏检测和定位的效果,这种方法布线简单,成本低,更适合布置在实际的工作环境中。
Smart Images

Figure CN119226786B_ABST
Abstract
Description
Technical Field
[0001] This invention mainly relates to the field of gas source detection and location, specifically to a method and system for locating and detecting leaks in gas cylinder storage. Background Technology
[0002] Gas cylinders are widely used in industry, medicine, and daily life, including those containing liquefied petroleum gas, oxygen, and nitrogen. However, gas cylinder leaks can lead to gas leakage accidents, threatening people's lives and property. Therefore, it is necessary to research leak point location systems. Developing a gas cylinder leak point location system can improve the safety and reliability of gas cylinders. By monitoring gas cylinder leaks in real time and accurately locating the leak point, emergency measures can be taken quickly to prevent accidents or reduce losses. Remote monitoring and automatic alarm functions can promptly detect abnormal gas cylinder conditions and provide early warnings, which is beneficial for strengthening the management and maintenance of gas cylinders and improving work efficiency and resource utilization. Therefore, research on gas cylinder storage leak point location systems not only protects people's lives and property but also improves the safety, reliability, and management efficiency of gas cylinders, which has significant social and economic implications.
[0003] Traditionally, hazardous gas leak location and online monitoring systems typically use cables to transmit data between monitoring nodes. These nodes are strategically positioned within the monitoring area, and data is transmitted via cables to a PC for processing. However, due to restrictions on wiring in petrochemical sites, a novel data transmission network is needed for application in gas cylinder storage warehouses. With the development of wireless sensors, technologies such as Bluetooth, Wi-Fi, 4G, 5G, Zigbee, NB-IoT, and LoRa have emerged. Considering that LoRa technology enables long-distance data transmission, it is highly advantageous for factories or facilities with extensive coverage.
[0004] LoRa technology boasts strong anti-interference capabilities, enabling stable data transmission in complex electromagnetic environments, which is crucial for monitoring systems in industrial settings. Compared to other communication technologies, LoRa modules are relatively inexpensive, making them more suitable for large-scale deployment and application in cost-sensitive projects. LoRa technology can build simple star or mesh topologies without requiring complex infrastructure, reducing the cost and complexity of network construction.
[0005] Traditional handheld gas detectors, while highly flexible and usable in various locations, rely heavily on operator accuracy and attention, potentially leading to false alarms or missed detections. Furthermore, they cannot monitor large areas in real time, requiring personnel to move to potential leak points for inspection. Deploying a network of gas detection instruments, while enabling real-time monitoring of large areas, requires a large number of sensors, resulting in high costs. In contrast, deploying sensor arrays allows for real-time gas monitoring and location, and is simple to set up. In gas cylinder storage areas, obstructions often alter the direction of gas diffusion, and gas models often fail to account for these changes in diffusion direction caused by obstructions.
[0006] Therefore, there is an urgent need to design an online monitoring system for locating hazardous gas leaks in the petrochemical industry, which can improve the system's detection accuracy while ensuring safety. Summary of the Invention
[0007] Purpose of the invention: In view of the problems pointed out in the background art, the present invention provides a method for locating and detecting gas cylinder storage leaks. It introduces a hexagonal sensor array to realize leak detection and location, and introduces a window function for relevant time points into Kalman filtering to effectively improve the detection accuracy.
[0008] Technical solution: This invention discloses a method for locating and detecting leaks in gas cylinder storage, comprising the following steps:
[0009] Step 1: Construct gas cylinder leakage models under windless and windy conditions, use a gas turbulence diffusion model to simulate the leakage process, determine the layout of gas sensor nodes, and introduce a sensor array to detect gas leak points.
[0010] Step 2: Introduce the adaptive filtering algorithm AF to remove noise from the data detected by the sensor array;
[0011] Step 3: Use the Continuous Wavelet Transform (CWT) and Maximum Modulus method to extract the time difference information hidden in the gas sensor signal, determine the optimal leak point location, and obtain the location information at a certain time point;
[0012] Step 4: Based on the Kalman filter algorithm, a window function is introduced. The improved Kalman filter algorithm is used to process multiple sets of positioning information at different time points, filter out invalid measurement signal interference that is not within the range of the window function, and estimate the optimal positioning point.
[0013] 2. The method for locating and detecting gas cylinder storage leaks according to claim 1, characterized in that the gas cylinder leakage models in step 1 under windless and windy conditions are as follows:
[0014] S11: Without considering the influence of wind speed and direction on the model, the gas turbulence diffusion model under no-wind conditions is based on Fick's diffusion theorem and expresses the diffusion equation. Then, an error compensation function is introduced, and the influence of the distance between the gas source point and the monitoring point on the concentration is considered. When the equilibrium state is reached, the diffusion equation under no-wind conditions is obtained.
[0015] S12: Considering the influence of wind speed and direction on gas leakage, we assume a gas source point used to simulate continuous diffusion along the wind speed direction. The model under windy conditions is also based on Fick's diffusion theorem, but the influence of wind is considered. The gas diffusion direction is adjusted to be opposite to the wind direction. The concentration at the leakage point is used as the gas source strength, and the diffusion equation under windy conditions is derived. When the equilibrium state is reached, the diffusion equation under windy conditions is obtained.
[0016] Furthermore, the specific details of the windless gas cylinder leakage model in S11 are as follows:
[0017] According to Fick's diffusion theorem, the gas flux of a diffusing gas through a single cross-section perpendicular to the diffusion direction per unit time is proportional to the concentration gradient at that cross-section. Furthermore, the direction of gas diffusion is opposite to the direction of the concentration gradient. Therefore, the expression can be derived as follows:
[0018]
[0019] Where C is the concentration of the sensor node at point (x,y,z) at time t; k represents the gas diffusion coefficient; Indicates gas flux;
[0020] Diffusion equation under windless conditions:
[0021]
[0022] Let the coordinates of the gas source be (x0, y0, z0), and let it propagate outwards at a certain mass diffusion rate, i.e., gas source strength Q, starting from time t0. Then:
[0023]
[0024] in, This represents the error compensation function; d is the Euclidean distance from (x,y,z) to the source point (x0,y0,z0). As t→+∞, it reaches equilibrium, and the formula is transformed into:
[0025] Furthermore, the gas cylinder leakage model with wind in S12 is as follows:
[0026] The gas diffusion equation under windy conditions can be transformed into:
[0027]
[0028] Where u is the wind speed;
[0029] The concentration is highest at the leak point, which is considered the gas source strength, and its diffusion equation is derived:
[0030]
[0031] in, x = (x - x0)cosθ + (y - y0)sinθ, where θ is the wind direction angle;
[0032] As t→+∞, an equilibrium state is reached, at which point the formula becomes:
[0033]
[0034] To incorporate the effect of noise on concentration values in a real-world environment, the model formula is revised as follows:
[0035]
[0036] The relationship between distance and concentration when u = 0: N i This represents the impact of noise.
[0037] Furthermore, the specific layout of the gas sensor nodes in step 1 is as follows:
[0038] Each sensor array network node is designed using an MCU, a gas sensor array, wind speed and direction sensors, and LoRa wireless sensors. The gas sensor array is arranged in a hexagonal honeycomb layout.
[0039] Furthermore, in step 2, an adaptive filtering algorithm (AF) is introduced to remove noise from the data detected by the sensor array. The process is as follows:
[0040] 1) Initialize the filter coefficient vector w(0) as a zero vector, with step size parameter μ and delay parameter D;
[0041] 2) Obtain gas concentration data from the sensor array via the MCU's internal ADC;
[0042] 3) Input the acquired sensor array data into the filter and calculate the filter output: y(k) = w T (k)x(kD), where k is the current discrete time point and x(kD) is the delayed version of the noisy signal;
[0043] 4) Calculate the estimation error e(k) = x(k) - y(k), where x(k) is the current noisy signal;
[0044] 5) Update the filter coefficients w(k+1) = w(k) + μe(k)x(kD);
[0045] 6) Adjust the step size parameter μ according to the size of the acquired ADC data. Increase the value of μ when the ADC data is large to improve the response speed.
[0046] 7) Repeat steps 2)-6).
[0047] Furthermore, step 3 uses continuous wavelet transform (CWT) and maximum modulus method to extract the time difference information hidden in the gas sensor signal. The specific process is as follows:
[0048] 1) Input the signal after adaptive filtering in step 2 into a time difference information extractor that is mainly based on wavelet transform. The signal is time series data of gas concentration changing with time.
[0049] 2) Select the Daubechies wavelet as the wavelet basis function;
[0050] 3) Perform convolution operation on the signal after adaptive filtering;
[0051] 4) Remove low-frequency components and retain high-frequency components to extract the spectral characteristics of the signal at different scales and locations;
[0052] 5) For each wavelet coefficient at each scale and location, calculate its modulus, i.e., amplitude. The modulus represents the energy or intensity of the signal at the corresponding scale and location.
[0053] 6) Find the maximum modulus: For each scale, find and save the maximum modulus. The maximum modulus corresponds to the main energy concentration point of the signal at different scales.
[0054] 7) Time difference information extraction: For each gas sensor in the sensor array, extract the maximum modulus value at different scales, observe its position on the time axis, and estimate the time difference information of different sensors when passing through a modulus by comparing or interpolating the time position of the maximum modulus value.
[0055] Furthermore, the specific process for determining the optimal leak point location in step 3 is as follows:
[0056] After extracting the time difference information of the same modulus between two gas sensors, it is known that under windless conditions, the gas concentration is inversely proportional to the distance between the monitoring node and the leak point. The direction of the gas leak is determined by detecting the concentration change through the sensor array. The distance ratio between each sensor in the sensor array is:
[0057]
[0058] Where d1 is the distance from the first node of the sensor array to the leak point, and d2 is the distance from the second node of the sensor array to the leak point. A set of location estimation equations is constructed using the concentration from each sensor:
[0059]
[0060] Among them, d1, d2, ... d n d2 is the distance from the nth node in the sensor array to the leak point. The time difference information of t1-t2, t3-t4, and t5-t6 is known. Because the sensor array adopts an equidistant distribution, as long as the coordinates of one sensor are known, the coordinates of all sensors in the array are known. d2 is represented by d1+x1, and similarly d4 is represented by d3+x3, and d6 is represented by d5+x5. By solving the system of equations, the optimal leak estimation point at a certain moment can be obtained.
[0061] In windy conditions, the distance ratio between each sensor in the sensor array is calculated by taking the same concentration ratio:
[0062]
[0063] By solving the system of equations:
[0064]
[0065] Where k represents the gas diffusion coefficient, Δx1, Δx2…Δx n The x-axis component represents the distance of the nth node of the sensor array from the leak point. The time difference information of t1-t2, t3-t4, and t5-t6 in the equation system is known. Solving the equation system will yield the optimal leak estimation point at a certain moment.
[0066] Furthermore, the specific process of step 4 is as follows:
[0067] 1) Initialize the state estimation vector x0 is the initial estimated data point, and the covariance matrix is 1;
[0068] 2) The optimal solution obtained from the time difference information is used as the measurement value at the current time, and the Kalman filter model formula is applied. Represents the prior estimate, F k Represents the state transition matrix, B k Represents the control matrix, It is the optimal estimate of the previous time step, u k It is the actual measured estimate at the current moment; the state estimate at the current moment is predicted to obtain the state estimate at the next moment, where the control input gain B is taken. k =0;
[0069] 3) Update the optimal Kalman gain P k|k-1 That is, the state error covariance matrix, H k It is a mapping matrix, S k It is the observation error covariance matrix, covariance matrix P k|k =(IK k *H k )*P k|k-1 and optimal estimate Among them, measurement residuals This is the current measurement value, H. k In the one-dimensional case, it is 1;
[0070] 4) Calculate the window function for the optimal estimate after Kalman filtering. The window function formula is as follows: Where n is the discrete time point, and N is the width of the fixed time window function. It is the adjustable window function width parameter. The value needs to be adjusted according to the actual site environment and size;
[0071] 5) Repeat the above steps continuously to perform prediction and measurement update steps in order to estimate the state of the optimal solution of the system in real time.
[0072] The present invention also discloses a system for locating and detecting leaks in gas cylinder storage, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the computer program implements the above-mentioned method for locating and detecting leaks in gas cylinder storage when loaded onto the processor.
[0073] Beneficial effects:
[0074] 1. This invention abandons the traditional sensor network node method and introduces a hexagonal sensor array, which can achieve the effect of leak detection and location with very few nodes. This method has simple wiring, low cost, and is more suitable for deployment in actual working environments.
[0075] 2. This invention introduces a window function for relevant time points into Kalman filtering. Considering that obstacles such as walls and pillars may reflect gas in the actual working environment, causing deviations in the constructed gas model, the positioning information measured at the time point during gas diffusion but before encountering obstacles has high reliability. The window function can effectively preserve the information at this time point and filter out the less reliable information in the rest, thereby effectively improving the positioning accuracy.
[0076] 3. This invention implements an online monitoring system for locating hazardous gas leaks using a wireless sensor array based on a LoRa module. The designed system is no longer a single-form monitoring system, but rather includes two online monitoring systems configured with both embedded mobile terminals and PC terminals. This system fully considers system integrity and applicability, greatly facilitating the work of petrochemical maintenance and management personnel. The AF (Adaptive Filtering Algorithm)-CWT (Wavelet Transform Algorithm)-KF (Kalman Filtering Algorithm) algorithm plays a crucial role in this invention. The AF algorithm is used for noise filtering of the signal at each sensor node, the CWT algorithm is used for extracting time difference information at a single time point of the sensor array and estimating a single leak point, and the KF algorithm is used for processing leak point signals at continuous time points, thereby improving the system's detection accuracy. Attached Figure Description
[0077] Figure 1 This is a layout diagram of the sensor network;
[0078] Figure 2 This is a diagram of the sensor network topology.
[0079] Figure 3 This is a flowchart of the adaptive filtering algorithm of the present invention;
[0080] Figure 4 This is a flowchart illustrating the extraction of time difference information from sensor signals according to the present invention.
[0081] Figure 5 This is a flowchart of the improved Kalman filter of the present invention;
[0082] Figure 6 This is a flowchart of the signal processing structure of the present invention;
[0083] Figure 7 Diagram of an embedded system for locating gas cylinder leaks. Detailed Implementation
[0084] To make the technical solution of the present invention clearer, the present invention will be further described below with reference to the accompanying drawings. The present invention is implemented in specific steps:
[0085] This invention discloses a gas leak detection method based on a wireless sensor network, comprising the following steps:
[0086] Step 1: Construct a gas cylinder leakage model and sensor node layout.
[0087] S11: First, construct a gas turbulent diffusion model under windless conditions, assuming that in an open environment, the gas source diffuses outward with a certain diffusion coefficient. According to Fick's diffusion theorem, the gas flux passing through a single cross-section perpendicular to the diffusion direction per unit time is proportional to the concentration gradient at that cross-section. Simultaneously, the direction of gas diffusion is opposite to the direction of the concentration gradient. Therefore, the expression can be obtained:
[0088]
[0089] Where C is the concentration of the sensor node at point (x,y,z) at time t; k represents the gas diffusion coefficient; This represents the gas flux. Therefore, the diffusion equation under windless conditions can be derived:
[0090]
[0091] Assuming the gas source coordinates are (x0, y0, z0), and that it propagates outwards at a certain mass diffusion rate (i.e., gas source strength) Q (mg / s) starting from time t0, we can obtain:
[0092]
[0093] in, This represents the error compensation function; d is the Euclidean distance from (x,y,z) to the source point (x0,y0,z0). As t→+∞, it reaches equilibrium, and the formula is transformed into:
[0094] S12: Next, construct a gas turbulent diffusion model under wind conditions. The gas diffusion equation under wind conditions can be transformed into:
[0095]
[0096] Where u is the wind speed. The concentration is highest at the leak point, which can be considered as the gas source strength, and its diffusion equation can be derived:
[0097] As t→+∞, an equilibrium state is reached, at which point the formula can be transformed into:
[0098]
[0099] Ideally, the measured concentration value should match the result from the gas cylinder estimation model. However, in real-world environments, the influence of noise on the concentration value needs to be factored in. Therefore, the model formula is modified as follows:
[0100]
[0101] From the above formula, we can obtain the relationship between distance and concentration when u = 0: Ni This represents the impact of noise.
[0102] S13: This invention introduces a sensor array to detect gas leaks. Compared to sensor networks, this method requires fewer nodes, is simpler to deploy, and has lower costs, making it more suitable for practical applications. Each sensor array network node is designed using an MCU + gas sensor array + LoRa wireless sensor. The sensor nodes are arranged in a hexagonal honeycomb layout. This layout saves on sensor materials compared to a square layout, reducing costs, and also provides higher positioning accuracy for the positioning method used in this invention. The larger the hexagonal layout area, the higher the positioning accuracy. The specific layout distribution is as follows: Figure 1 As shown.
[0103] To achieve gas concentration detection, four sensor array nodes are deployed, and wireless communication between the nodes is required. This necessitates the design of a wireless sensor network, thus requiring a suitable networking scheme. Compared to multi-sensor node detection methods, this invention requires far fewer nodes; therefore, a tree network structure is well-suited for this design. The tree network structure is as follows: Figure 2 As shown.
[0104] Step 2: Introduce an adaptive filtering algorithm (AF algorithm) to remove noise. Noise causes signal non-stationarity; therefore, processing the raw data can significantly improve the accuracy of leak point estimation at each time point. The output of the gas sensor may be affected by nonlinear factors, such as temperature and humidity changes. Adaptive filters can typically handle this nonlinear relationship and provide more accurate estimation and correction of the sensor output. Adaptive filters can dynamically adjust their parameters to adapt to different environmental conditions and noise characteristics. This means they can automatically adapt to different types and intensities of gas sensor noise without manual adjustment of filter parameters. Adaptive filtering algorithms have self-learning capabilities, continuously improving their performance based on historical data and feedback information. This means the filter can be continuously optimized over time to adapt to changes and drift in the sensor output.
[0105] Adaptive filtering steps (structure as follows) Figure 3 As shown):
[0106] 1. Initialization: Initialize the filter parameters, including the filter type, initial parameter values, etc.
[0107] 2. Acquire sensor data: Obtain raw data from sensors or other data sources, which typically include signals and noise.
[0108] 3. Model estimation: Based on the acquired raw data, estimate the dynamic model of the system or the characteristics of the signal. This step may include modeling the system, for example, by observing the statistical properties of the data or utilizing prior knowledge.
[0109] 4. Filtering: Utilizing the estimated model and system characteristics, the raw data is filtered. This includes applying appropriate filtering algorithms to reduce noise and extract the signal components of interest. Filter parameters may be adjusted based on real-time data.
[0110] 5. Output Results: The filtered data is used as the system output for subsequent analysis, control, or other applications. The output results are further used to update the filter parameters to continuously optimize the filter's performance.
[0111] 6. Evaluation and Adjustment: Regularly evaluate the filter's performance and adjust it as needed. This involves analyzing metrics such as the accuracy, stability, and real-time performance of the filtered data, and adjusting the filter parameters or selecting different filtering algorithms based on feedback information.
[0112] The specific filtering process is as follows:
[0113] 2.1) Initialize the filter coefficient vector w(0) as a zero vector, the step size parameter μ, and the delay parameter D.
[0114] 2.2) Obtain gas concentration data from the sensor array through the MCU's internal ADC.
[0115] 2.3) Input the acquired sensor array data into the filter and calculate the filter output: y(k) = w T (k)x(kD), where x(kD) is the delayed version of the noisy signal.
[0116] 2.4) Calculate the estimation error e(k) = x(k) - y(k), where x(k) is the current noisy signal.
[0117] 2.5) Update the filter coefficients w(k+1)=w(k)+μe(k)x(kD).
[0118] 2.6) Adjust the step size parameter μ according to the size of the acquired ADC data. Increase the value of μ when the ADC data is large to improve the response speed.
[0119] 2.7) Repeat the operations in 2.2)-2.6).
[0120] Traditional methods of deploying sensor network nodes require too many nodes, and the power cables needed to set up so many nodes on-site are very difficult to manage. Therefore, this invention proposes a method using sensor arrays, which can achieve better leakage monitoring and location by deploying only four sensor array nodes in a room.
[0121] Step 3: Extract the time difference information from the sensor signals to determine the optimal leak location.
[0122] To discover time difference information hidden in gas sensor signals using continuous wavelet transform (CWT) and modulus maxima methods, the following steps can be taken (structure as follows). Figure 4 As shown):
[0123] 3.1) Acquiring Gas Sensor Signals: First, raw signal data from the gas sensor is collected. This data may be time-series data of gas concentration changes over time. The signal, after adaptive filtering in step 2, is input into a time-difference information extractor that uses wavelet transform as its main component. The signal is time-series data of gas concentration changes over time.
[0124] 3.2) Continuous Wavelet Transform (CWT): A continuous wavelet transform is performed on the gas sensor signal to extract its spectral features at different scales and locations. The Daubechies wavelet is chosen as the wavelet basis function. CWT helps identify local frequency components in the signal and captures its features at different time scales. A convolution operation is then performed on the adaptively filtered signal to remove low-frequency components and retain high-frequency components, thus extracting the spectral features of the signal at different scales and locations.
[0125] 3.3) Calculate the modulus: For the wavelet coefficients at each scale and location, calculate their modulus (amplitude). The modulus represents the energy or intensity of the signal at the corresponding scale and location.
[0126] 3.4) Finding the maximum modulus: For each scale, find the maximum modulus. These maximum modulus values correspond to the main energy concentration points of the signal at different scales.
[0127] 3.5) Time Difference Information Extraction: For the maximum modulus value at different scales, observe its position on the time axis. Due to the multi-scale resolution characteristic of wavelet transform, the position of the maximum modulus value on the time axis can provide time difference information about the signal at different scales. By comparing or interpolating the time positions of the maximum modulus values, the time difference information of the signal at different scales can be estimated.
[0128] It is known that under windless conditions, gas concentration is inversely proportional to the distance between the monitoring node and the leak point. The direction of the gas leak is determined by detecting changes in concentration using a sensor array. The distance ratio between each sensor in the sensor array is:
[0129]
[0130] Where d1 is the distance from the first node of the sensor array to the leak point, and d2 is the distance from the second node of the sensor array to the leak point, a set of location estimation equations is constructed using the concentration of each sensor:
[0131]
[0132] Where d1, d2, ... d n d2 is the distance from the nth node in the sensor array to the leak point. The time difference information of t1-t2, t3-t4, and t5-t6 is known. Because the sensor array adopts an equidistant distribution, as long as the coordinates of one sensor are known, the coordinates of all sensors in the array are known. d2 is represented by d1+x1, and similarly d4 is represented by d3+x3, and d6 is represented by d5+x5. By solving the system of equations, the optimal leak estimation point at a certain moment can be obtained.
[0133] In windy conditions, the distance ratio between each sensor in the sensor array is calculated by taking the same concentration ratio:
[0134]
[0135] By solving the system of equations:
[0136]
[0137] In the above formula, k represents the gas diffusion coefficient, Δx1, Δx2…Δx n The x-axis component represents the distance of the nth node of the sensor array from the leak point. The time difference information of t1-t2, t3-t4, and t5-t6 in the equation system is known. Solving the equation system will yield the optimal leak estimation point at a certain moment.
[0138] Step 4: Introduce an improved Kalman filter algorithm (KF algorithm) to improve the accuracy of leak point prediction.
[0139] Since gas cylinders are stored in sheltered areas such as warehouses, the calculation cannot be performed entirely using methods for open environments. Therefore, this invention introduces the concept of confidence level. The confidence level of the leak point obtained at different times is different. At the beginning of the leak, it can be assumed that the gas does not encounter any obstructions during the leak process. At this time, it can be approximated as diffusion in an open environment, and the confidence level of the leak point estimate is relatively high. However, after the gas encounters an obstruction and bounces back, changing the direction of diffusion, the confidence level of the leak point estimate is relatively low.
[0140] To address the above issues, this invention introduces a window function into the Kalman filtering algorithm, which can effectively filter out invalid signal interference that is not within the range of the window function, thereby improving accuracy.
[0141] Improved Kalman filtering steps (structure as follows) Figure 5 As shown):
[0142] 1) Initialize the state estimation vector x0 is the initial estimated data point, and the covariance matrix is 1.
[0143] 2) The optimal solution obtained from the time difference information is used as the measurement value at the current time, and the Kalman filter model formula is applied. Represents the prior estimate, F k Represents the state transition matrix, B k Represents the control matrix, It is the optimal estimate of the previous time step, u k It is the actual measured estimate at the current moment; the state estimate at the current moment is predicted to obtain the state estimate at the next moment, where the control input gain B is taken. k =0.
[0144] 3) Update the optimal Kalman gain P k|k-1 That is, the state error covariance matrix, H k It is a mapping matrix, S k It is the observation error covariance matrix, covariance matrix P k|k =(IK k *H k )*P k|k-1 and optimal estimate Among them, measurement residuals z k This is the current measurement value, H. k In the one-dimensional case, it is 1.
[0145] 4) Calculate the window function for the optimal estimate after Kalman filtering. The window function formula is as follows: Where n is the discrete time point, and N is the width of the fixed time window function. It is the adjustable window function width parameter. The value needs to be adjusted according to the actual site environment and size.
[0146] 5) Repeat the above steps continuously to perform prediction and measurement update steps in order to estimate the state of the optimal solution of the system in real time.
[0147] Step 5: Building the Embedded System
[0148] The basic embedded system technical solution is shown in the figure. Each sensor node adopts an MCU + LoRa wireless communication + gas sensor array scheme. Each node can automatically join the sensor network, and the sensor network adopts a tree network topology. After all the information collected by the nodes is transmitted to the MPU chip through the wireless network, the information is processed and calculated in real time to calculate the estimated coordinates of the leak point. The specific signal processing process is as follows: Figure 6 As shown. Considering the need for staff to easily monitor node information, a display screen needs to be connected to the MPU chip, and a user interface needs to be designed for intuitive viewing. The specific structure is as follows. Figure 7 As shown, Figure 7 Four of the MPU chips are connected to four sensor arrays for collecting gas information and achieving location tracking. The actual location tracking is handled by four MCU chips. The middle MCU chip is connected to wind direction and speed sensors; this separation is simply for ease of practical application, as wind direction and speed sensors are relatively large. To ensure timely leak alarms for staff, leak point information is sent to a cloud server. This allows for early warnings via a mobile app, enabling staff to accurately locate the leak and take swift and appropriate safety measures to prevent irreparable accidents.
[0149] The above embodiments are only for illustrating the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be construed as limiting the scope of protection of the present invention. All equivalent transformations or modifications made in accordance with the spirit and essence of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A method for locating and detecting leaks in gas cylinder storage, characterized in that, The steps include the following: Step 1: Construct gas cylinder leakage models under windless and windy conditions, use a gas turbulence diffusion model to simulate the leakage process, determine the layout of gas sensor nodes, and introduce a sensor array to detect gas leak points. Step 2: Introduce the adaptive filtering algorithm AF to remove noise from the data detected by the sensor array; Step 3: Use the Continuous Wavelet Transform (CWT) and Maximum Modulus method to extract the time difference information hidden in the gas sensor signal, determine the optimal leak point location, and obtain the location information at a certain time point; Step 4: Based on the Kalman filter algorithm, a window function is introduced. The improved Kalman filter algorithm is used to process multiple sets of positioning information at different time points, filter out invalid measurement signal interference that is not within the range of the window function, and estimate the optimal positioning point. 1) Initialize the state estimation vector , These are the initial estimated data points, with a covariance matrix of 1; 2) The optimal solution obtained from the time difference information is used as the measurement value at the current time, and the Kalman filter model formula is applied. , Represents prior estimates, Represents the state transition matrix, Represents the control matrix, It is the optimal estimate from the previous moment. It is the actual measured estimate at the current moment; the state estimate at the current moment is predicted to obtain the state estimate at the next moment, where the control input gain is taken. =0; 3) Update the optimal Kalman gain , That is, the state error covariance matrix. It is a mapping matrix. It is the observation error covariance matrix, covariance matrix and optimal estimate Among them, measurement residuals , This is the current measurement value. In the one-dimensional case, it is 1; 4) Calculate the window function for the optimal estimate after Kalman filtering. The window function formula is as follows: Where n is the discrete time point, and N is the width of the fixed time window function. It is the adjustable window function width parameter. The value needs to be adjusted according to the actual site environment and size; 5) Repeat the above steps continuously to perform prediction and measurement update steps in order to estimate the state of the optimal solution of the system in real time.
2. The method for locating and detecting leaks in gas cylinder storage according to claim 1, characterized in that, The specific gas cylinder leakage models under windless and windy conditions in step 1 are as follows: S11: Without considering the influence of wind speed and direction on the model, the gas turbulence diffusion model under no-wind conditions is based on Fick's diffusion theorem and expresses the diffusion equation. Then, an error compensation function is introduced, and the influence of the distance between the gas source point and the monitoring point on the concentration is considered. When the equilibrium state is reached, the diffusion equation under no-wind conditions is obtained. S12: Considering the influence of wind speed and direction on gas leakage, we assume a gas source point used to simulate continuous diffusion along the wind speed direction. The model under windy conditions is also based on Fick's diffusion theorem, but the influence of wind is considered. The gas diffusion direction is adjusted to be opposite to the wind direction. The concentration at the leakage point is used as the gas source strength, and the diffusion equation under windy conditions is derived. When the equilibrium state is reached, the diffusion equation under windy conditions is obtained.
3. The method for locating and detecting leaks in gas cylinder storage according to claim 2, characterized in that, The specific model of gas cylinder leakage without wind in S11 is as follows: According to Fick's diffusion theorem, the gas flux of a diffusing gas through a single cross-section perpendicular to the diffusion direction per unit time is proportional to the concentration gradient at that cross-section. Furthermore, the direction of gas diffusion is opposite to the direction of the concentration gradient. Therefore, the expression can be derived as follows: ; Where C is the concentration of the sensor node at point (x,y,z) at time t; k represents the gas diffusion coefficient; Indicates gas flux; Diffusion equation under windless conditions: ; Let the coordinates of the gas source be (x0, y0, z0), and let it propagate outwards at a certain mass diffusion rate, i.e., gas source strength Q, starting from time t0. Then: ; in, This represents the error compensation function; d is... To the source Euclidean distance, when t + When equilibrium is reached, the formula becomes: .
4. The method for locating and detecting leaks in gas cylinder storage according to claim 3, characterized in that, The specific gas cylinder leakage model with wind in S12 is as follows: The gas diffusion equation under windy conditions can be transformed into: ; Where u is the wind speed; The concentration is highest at the leak point, which is considered the gas source strength, and its diffusion equation is derived: ; in, , , It is the wind direction angle; When t + When equilibrium is reached, the formula becomes: ; To incorporate the effect of noise on concentration values in a real-world environment, the model formula is revised as follows: ; The relationship between distance and concentration when u=0: , This represents the impact of noise.
5. The method for locating and detecting leaks in gas cylinder storage according to claim 1, characterized in that, The specific layout of the gas sensor nodes in step 1 is as follows: Each sensor array network node is designed using an MCU, a gas sensor array, wind speed and direction sensors, and LoRa wireless sensors. The gas sensor array is arranged in a hexagonal honeycomb layout.
6. The method for locating and detecting leaks in gas cylinder storage according to claim 1, characterized in that, In step 2, an adaptive filtering algorithm (AF) is introduced to remove noise from the data detected by the sensor array. The process is as follows: 1) Initialize the filter coefficient vector w(0) as a zero vector, and set the step size parameter. Delay parameter D; 2) Obtain gas concentration data from the sensor array via the MCU's internal ADC; 3) Input the acquired sensor array data into the filter and calculate the filter output: Where k is the current discrete time point, It is a delayed version of the noisy signal; 4) Calculate the estimation error ,in It is the current noisy signal; 5) Update filter coefficients ; 6) Adjust the step size parameter based on the acquired ADC data size. Larger ADC data means larger values The value is used to improve response speed; 7) Repeat steps 2)-6).
7. The method for locating and detecting leaks in gas cylinder storage according to claim 1, characterized in that, Step 3 uses Continuous Wavelet Transform (CWT) and the maximum modulus method to extract the time difference information hidden in the gas sensor signal. The specific process is as follows: 1) Input the signal after adaptive filtering in step 2 into a time difference information extractor that is mainly based on wavelet transform. The signal is time series data of gas concentration changing with time. 2) Select the Daubechies wavelet as the wavelet basis function; 3) Perform convolution operation on the signal after adaptive filtering; 4) Remove low-frequency components and retain high-frequency components to extract the spectral characteristics of the signal at different scales and locations; 5) For each wavelet coefficient at each scale and location, calculate its modulus, i.e., amplitude. The modulus represents the energy or intensity of the signal at the corresponding scale and location. 6) Find the maximum modulus: For each scale, find and save the maximum modulus. The maximum modulus corresponds to the main energy concentration point of the signal at different scales. 7) Time difference information extraction: Extract the maximum modulus value at different scales for each gas sensor in the sensor array, observe its position on the time axis, and estimate the time difference information of different sensors when passing through a modulus by comparing or interpolating the time position of the maximum modulus value.
8. The method for locating and detecting leaks in gas cylinder storage according to claim 7, characterized in that, The specific process for determining the optimal leak point location in step 3 is as follows: After extracting the time difference information of the same modulus between two gas sensors, it is known that under windless conditions, the gas concentration is inversely proportional to the distance between the monitoring node and the leak point. The direction of the gas leak is determined by detecting the concentration change through the sensor array. The distance ratio between each sensor in the sensor array is: ; in, It is the distance from the first node of the sensor array to the leak point. This is the distance from the second node of the sensor array to the leak point. A set of location estimation equations is constructed using the concentration from each sensor: ; in, , … It is the distance of the nth node in the sensor array from the leak point. - , - , - The time difference information is known because the sensor array is equidistantly distributed; if the coordinates of one sensor are known, then the coordinates of all sensors in the array are known. use + Similarly, use + express, use + This means that by solving the system of equations, the optimal leakage estimation point at a certain moment can be obtained; In windy conditions, the distance ratio between each sensor in the sensor array is calculated by taking the same concentration ratio: ; By solving the system of equations: ; Where u is the wind speed and k represents the gas diffusion coefficient. , … The x-component of the distance from the nth node of the sensor array to the leak point is represented in the system of equations. - , - , - If the time difference information is known, solving the system of equations will yield the optimal leakage estimation point at a certain moment.
9. A system based on the gas cylinder storage leak location and detection method according to any one of claims 1 to 8, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is loaded into the processor, it implements the gas cylinder storage leak location detection method according to any one of claims 1 to 8.