Gas pipeline leakage type identification and leakage amount real-time measurement method based on acoustic emission
By employing multi-source data acquisition and adaptive preprocessing techniques, combined with acoustic emission sensor arrays and pressure sensors, the system achieves accurate identification of gas pipeline leak types and real-time measurement of leak volume. This solves the quantitative measurement problem caused by the complexity of gas pipeline leak signal propagation, and improves the accuracy of leak identification and location, as well as the system's adaptive capabilities.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA JILIANG UNIV
- Filing Date
- 2026-03-10
- Publication Date
- 2026-06-19
AI Technical Summary
The propagation of acoustic emission signals from gas pipeline leaks is easily affected by material heterogeneity and sudden changes in interface impedance, making it difficult to extract signal features and quantify defects, and thus difficult to achieve accurate quantitative measurement of the leak diameter.
The method employs multi-source data acquisition, adaptive preprocessing, modal decomposition optimization, feature fusion dimensionality reduction, incremental model update, and closed-loop global optimization. Data is collected synchronously by an acoustic emission sensor array and pressure and temperature sensors. Signal segmentation, feature extraction, and noise reduction are performed to construct a feature-leakage aperture correlation model. Reinforcement learning is then used to identify and measure the leakage type.
It enables accurate identification of gas pipeline leakage types and real-time calculation of leakage volume, improves the accuracy of leakage aperture prediction and location, has adaptive tracking capability for long-term pipeline status, and provides technical support for safety monitoring and emergency response.
Smart Images

Figure CN122241452A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of real-time measurement technology, and in particular to a method for identifying the type of gas pipeline leakage and calculating the leakage amount in real time based on acoustic emission. Background Technology
[0002] With the advancement of national energy strategy transformation and the construction of a new energy system, gas pipelines, as core hubs for the inter-regional transportation of clean energy, are developing rapidly. Their safe and stable operation is crucial to energy supply, the ecological environment, and public interests, and is key to the efficient operation of the new energy system. Leakage monitoring and quantitative control capabilities are core indicators for measuring energy transportation safety.
[0003] However, gas pipelines are often laid in complex geological environments and are characterized by long distances and large spans. The propagation of acoustic emission signals from leaks is easily affected by material heterogeneity and sudden changes in interface impedance, resulting in reflection, refraction, and attenuation. This significantly increases the difficulty of signal feature extraction and defect quantification, posing a significant challenge to the quantitative calculation of leak apertures. Monitoring technologies that integrate acoustic emission and machine learning can effectively handle these complex signals. By mining the time-frequency domain features of the signals to construct a feature-leak aperture correlation model, accurate quantification of the leakage degree can be achieved, providing a basis for emergency response. Accurate quantitative calculation is crucial for the safe operation of pipelines, as different leak apertures correspond to significantly different risk levels and response strategies. It can provide key data support for preventative maintenance and fault handling, and is of great significance for improving pipeline network security protection capabilities, reducing leakage losses, and ensuring the stable operation of new energy systems. Summary of the Invention
[0004] The main objective of this application is to provide a method for identifying leakage types and calculating leakage amounts in gas pipelines based on acoustic emission, in order to solve the problems mentioned in the background art.
[0005] To achieve the above objectives, this application provides the following technical solution:
[0006] A method for identifying leakage types and calculating leakage amount in gas pipelines based on acoustic emission, characterized by the following specific steps: S1. Multi-source data acquisition: Deploy acoustic emission sensor arrays, pressure sensors, and temperature sensors at key nodes of the pipeline to simultaneously acquire acoustic emission signals and operating parameters under different leakage conditions; set a sliding time window to segment the signal, extract time-domain and frequency-domain feature parameters, and construct an initial feature set; S2. Adaptive preprocessing: Autocorrelation analysis is performed on the signal to obtain the main period, and similar waveform segments are found at both ends of the signal for bidirectional extension; optimization algorithm is used to determine the number of modes and penalty factor, and variational mode decomposition is performed on the extended signal; S3. Modal decomposition optimization: The mean and standard deviation of the background noise permutation entropy are statistically analyzed by sliding window, and a dynamic threshold is set according to the three sigma criterion. Based on the threshold, the decomposed components are divided into three categories: effective signal, suspicious transition, and noise-dominated. The three categories of components are respectively preserved, weighted fusion, and wavelet threshold denoising. S4. Dynamic hierarchical denoising: Wavelet packet decomposition is performed on the denoised signal to extract time-domain statistics, frequency-domain center frequency, time-frequency domain energy entropy, and marginal spectral peaks; Pearson correlation coefficients between features are calculated and highly correlated features are removed; random forest is used to evaluate feature contribution; principal components with cumulative variance contribution rates that meet the criteria are selected to construct core feature vectors. S5. Feature Fusion and Dimensionality Reduction: The core feature vector and leakage aperture label are divided into training and test sets. The model hyperparameters are determined by grid search and training is completed. When the accumulation of new samples reaches a set threshold, knowledge distillation is performed to update the network using the original model as the teacher network and the new model as the student network. S6. Model Incremental Update: After inputting the feature vector into the model, the predicted values of leakage type and aperture are output synchronously. Based on the dispersion of the prediction results of each base learner, the confidence interval of the predicted value is calculated by Bayesian approximation. S7. Leakage Identification and Prediction: Extract the energy values of each sensor signal, establish an exponential relationship between energy attenuation and propagation distance; inject standard pulses into the sensors and measure the response amplitude, calculate the coupling quality index, and then correct the aperture prediction value. S8. Leakage Calculation: Calculate the ratio of the corrected orifice diameter to the pipe inner diameter, and select the corresponding leakage model based on the ratio; convert the corrected orifice diameter into the leakage cross-sectional area, calculate the mass flow rate in combination with real-time pressure and temperature parameters, and integrate the flow rate over time to obtain the cumulative leakage. S9. Closed-loop global optimization: Calculate the deviation between the cumulative leakage and the actual value, and feed the deviation back to the modal decomposition parameters, dynamic threshold, and feature weights; train the policy network through reinforcement learning and adjust the parameter configuration of each link according to the current state.
[0007] Preferably, in step S1, the specific method for multi-source data acquisition is as follows: S1.1. Install acoustic emission sensor arrays at key locations along the pipeline axis, and fix the sensors by magnetic attraction or welding to ensure acoustic coupling stability. Simultaneously install pressure transmitters, temperature sensors and flow meters. Each sensing node is connected to the data acquisition terminal via wired or wireless means to form a distributed sensing network covering the entire pipeline. S1.2. Set the acoustic emission signal sampling rate to 1MHz and start the pulse triggering mechanism to synchronously collect acoustic emission waveforms, operating pressure, medium temperature, and flow data from each node. Perform timestamp alignment and format standardization on the multi-source data streams. Use a sliding time window to segment the signal, setting the window length to 20,000 frames and the step size to 10,000 frames, and segment the signal under different leakage aperture conditions. Extract the time-domain and frequency-domain features of each signal segment. The time-domain features include mean, peak amplitude, energy, standard deviation, skewness, kurtosis, waveform factor, peak factor, and time-domain waveform complexity. The frequency-domain features include centroid frequency, spectral area, spectral standard deviation, spectral kurtosis, spectral flatness, ring count, energy entropy, information entropy, spectral flux, and spectral roll-off point. Construct an initial feature set containing 30 feature parameters.
[0008] Preferably, in step S2, the adaptive preprocessing is performed in the following way: S2.1 Construct a Pearson correlation coefficient matrix for the 30 feature parameters in the initial feature set, calculate the correlation coefficient between any two feature parameters, set the correlation threshold to 0.9, remove highly correlated features with weak physical meaning or high computational complexity, and retain features with clear physical meaning and strong representation ability to obtain 16 feature subsets including mean, peak amplitude, energy, average signal level, skewness, kurtosis, waveform factor, peak factor, time-domain waveform complexity, spectral kurtosis, spectral flatness, ring count, energy entropy, information entropy, spectral flux, and spectral roll-off point; S2.2 Construct a random forest model containing 100 decision trees, using 16 feature subsets as inputs. Employ out-of-bag error as a sensitivity evaluation index, calculate the influence of each feature parameter on the out-of-bag error, and select 10 highly sensitive feature parameters based on their contribution: mean, peak amplitude, energy, average signal level, skewness, kurtosis, waveform factor, time-domain waveform complexity, spectral flatness, energy entropy, and spectral flux. After standardizing and preprocessing the 10 key feature parameters, perform principal component analysis to calculate the variance contribution rate of each principal component. Set the cumulative variance contribution rate threshold to 95%, and select the top 4 principal components to construct the core feature vector.
[0009] Preferably, in step S3, the specific method of mode decomposition optimization is as follows: S3.1 Extract the energy characteristics of the signals collected by each sensor as a propagation sensitive parameter, and establish an exponential mapping relationship between energy attenuation and propagation distance. The specific calculation formula is as follows:
[0010] Where E(r) is the sound wave energy at a distance r, E0 is the initial energy at the sound source, and k is the environment-related attenuation coefficient; S3.2 Inject standard pulse signals into each sensor and collect response waveforms. Calculate the deviation between the actual amplitude and the theoretical amplitude to obtain the coupling quality index. Based on this index, perform linear correction on the aperture prediction value. Substitute the energy values monitored by each sensor into the energy attenuation model. Solve the propagation distance by combining energy data from multiple points and inversely calculate the coordinates of the leakage source location.
[0011] Preferably, in step S4, the specific method of dynamic hierarchical denoising is as follows: S4.1. Take the 4-dimensional core feature vector obtained in S2 as input data, and take the leakage pore size corresponding to each feature vector as label data. Randomly divide it into training set and test set in a ratio of 8:2. Perform standardization preprocessing on the training set and test set respectively to eliminate the difference in dimensionality between features of different dimensions. S4.2. A regression prediction model for leakage pore size is constructed based on the XGBoost algorithm. The grid search algorithm is used to globally optimize the model hyperparameters. The preset hyperparameter search space is traversed and the prediction accuracy under different parameter combinations is verified. After determining the optimal hyperparameter combination, the model training is completed. The test set is input into the trained model for verification. The coefficient of determination R², root mean square error RMSE, mean absolute error MAE, and mean absolute percentage error MAPE are selected as evaluation indicators to measure the degree of deviation between the model's predicted pore size and the actual pore size.
[0012] Preferably, in step S5, the specific method of feature fusion and dimensionality reduction is as follows: S5.1 Input the real-time acquired signal features into the trained model to obtain the predicted leakage orifice diameter d, and calculate the ratio R = d / D of the predicted orifice diameter d to the pipe inner diameter D; match the corresponding leakage model according to the ratio R: when R < 0.15, it is judged as a small orifice leakage; when 0.15 ≤ R ≤ 0.85, it is judged as a large orifice leakage; when R > 0.85, it is judged as a full-section pipe rupture leakage (referred to as "pipeline" leakage); The specific calculation method for the small hole model is as follows;
[0013] in, Indicates leakage flow rate. Leakage coefficient, The air pressure inside the pipe, Let M be the area of the leakage hole, Z be the relative molecular mass, Z be the compressibility factor, and R be the gas constant. Let be the temperature inside the pipe, and y be the adiabatic index. The specific calculation method for the large-hole model is as follows;
[0014] in Average pressure; The specific calculation method for the pipeline model is as follows;
[0015] in, This refers to the cross-sectional area of the pipe. S5.2 Obtain gas operating parameters including pressure p, temperature T, and density ρ. Convert the predicted orifice diameter d into the leakage cross-sectional area A using geometric relationships. Substitute the gas operating parameters and leakage cross-sectional area into the matched leakage model to calculate the mass flow rate. The calculation formula for the small orifice model is Q=C. a pA√(M / ZRT)√(2γ / (γ-1)), where the macropore model uses the average pressure p m Instead of the internal pressure p, the pipe leakage model uses the pipe cross-sectional area A. p Replace the leakage hole area A; combine the leakage monitoring time and calculate the cumulative leakage amount using the formula m=Q×t, where m is the real-time leakage amount, Q is the mass flow rate, and t is the monitoring time.
[0016] Preferably, in step S6, the incremental update of the model is performed in the following way: S6.1 Input the core feature vector obtained in S2 into the trained model, and simultaneously perform leakage type classification and pore size regression tasks through the shared bottom representation layer. The classification branch outputs the pitting corrosion, crack or fracture type label, and the regression branch outputs the continuous pore size prediction value. S6.2 Based on the dispersion of the prediction results of each base learner in the ensemble model, the Bayesian approximation method is used to estimate the posterior distribution of the prediction, calculate the class probability of the classification task and the prediction variance of the regression task, and output the prediction results including point estimates and confidence intervals.
[0017] Preferably, in step S7, the specific method for leak identification and prediction is as follows: S7.1 Perform autocorrelation analysis on the original acoustic emission signal to extract the main period and local feature waveforms. Find the matching segment with the highest similarity to the boundary waveform at both ends of the signal. Calculate the extension length dynamically based on the multiple of the main period. Perform bidirectional predictive extension to the front and back ends of the signal respectively. Use a weighted fusion method to smooth the connection between the extension segment and the original boundary. S7.2. With leakage identification accuracy as the optimization objective, a joint optimization space for the number of modes and the penalty factor is established. Parameter boundary constraints and discretized grids are set. The fitness function is constructed by introducing leakage feature preservation degree and computational efficiency. An improved optimization algorithm is used to simultaneously evaluate the fitness of multiple parameter combinations on a parallel architecture. After iterative convergence to the optimal solution, the optimal number of modes and penalty factor are output. Variational mode decomposition is performed on the extended signal to obtain the intrinsic mode function.
[0018] Preferably, in step S8, the specific method for calculating the leakage amount is as follows: S8.1. Use a sliding time window to extract data during periods without leakage, calculate the mean and standard deviation of the background noise permutation entropy online to establish a noise statistical model, and dynamically calculate the entropy threshold based on the three sigma criterion; classify the components obtained from variational mode decomposition into three categories according to the relationship between entropy and threshold: effective signal, suspicious transition, and noise-dominated. S8.2. Valid signal classes are directly retained, noise-dominant classes are denoised using wavelet soft thresholding, and suspicious transition classes are weighted and fused using a membership function. After reconstructing the signal, the signal-to-noise ratio and leakage feature retention are calculated. The power exponent parameter of the wavelet thresholding function is dynamically adjusted based on the dual-index feedback, and the denoised signal is output.
[0019] Preferably, in step S9, the specific method for closed-loop global optimization is as follows: S9.1. The deviation between the cumulative leakage obtained from S5 and the standard measurement value is used as the system measurement error. The error is traced back along the processing flow to key control points such as mode decomposition parameters, dynamic thresholds and feature weights. The current operating condition state vector and parameter configuration are extracted to construct a feedback environment that includes error signals, state space and adjustable parameters. S9.2. With minimizing long-term measurement error as the optimization objective, a reinforcement learning algorithm is used to train the policy network. The agent outputs adjustment actions for parameters such as modality number, penalty factor and entropy threshold according to the current state. It accumulates rewards and updates the policy through environmental interaction, thereby achieving adaptive optimization of system-level parameters.
[0020] Compared with the prior art, the beneficial effects of the present invention are: 1. This method improves the accuracy of leak type identification, leak aperture prediction accuracy, and leak source location accuracy. It enables accurate real-time calculation of leakage volume for three types of leaks: small hole leaks, large hole leaks, and pipeline leaks. At the same time, through incremental learning and closed-loop optimization, the system has the ability to adaptively track the long-term state evolution such as pipeline corrosion development and sediment accumulation, providing technical support for the safety monitoring, risk assessment, and emergency response of gas pipelines.
[0021] 2. This method classifies leakage conditions into three categories—small-hole, large-hole, and pipeline leakage—based on orifice ratio and automatically matches the corresponding flow calculation model. For different leakage types, it employs flow calculation formulas that consider operating parameters such as pressure, temperature, and gas composition. Through time integration, it achieves continuous cumulative monitoring of leakage, solving the problems of traditional methods that rely on manual experience for leakage type determination, improper model selection, and incomplete consideration of operating parameters, leading to large calculation errors. This step improves the accuracy of leakage measurement to within 5%, realizing a complete closed loop from leakage orifice diameter prediction to quantitative leakage measurement, providing accurate quantitative basis for pipeline safety assessment and emergency response. Attached Figure Description
[0022] Figure 1This is a flowchart illustrating the steps of the method described in this application. Detailed Implementation
[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0024] The terms "first," "second," and "third" in this application are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. All directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of this application are only used to explain the relative positional relationships and movements between components in a specific orientation (as shown in the figures). If the specific orientation changes, the directional indications also change accordingly. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.
[0025] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0026] Example 1: Please refer to Figure 1 A method for identifying gas pipeline leakage types and calculating leakage amount in real time based on acoustic emission, characterized by the following specific steps: S1. Multi-source data acquisition: Deploy acoustic emission sensor arrays, pressure sensors and temperature sensors at key nodes of the pipeline to simultaneously acquire acoustic emission signals and operating parameters under different leakage conditions; set a sliding time window to segment the signal, extract time domain and frequency domain feature parameters, and construct an initial feature set. S2. Adaptive preprocessing: Autocorrelation analysis is performed on the signal to obtain the main period, and similar waveform segments are found at both ends of the signal for bidirectional extension; optimization algorithm is used to determine the number of modes and penalty factor, and variational mode decomposition is performed on the extended signal; S3. Modal decomposition optimization: The mean and standard deviation of the background noise permutation entropy are statistically analyzed by sliding window, and a dynamic threshold is set according to the three sigma criterion. Based on the threshold, the decomposed components are divided into three categories: effective signal, suspicious transition, and noise-dominated. The three categories of components are respectively preserved, weighted fusion, and wavelet threshold denoising. S4. Dynamic hierarchical denoising: Wavelet packet decomposition is performed on the denoised signal to extract time-domain statistics, frequency-domain center frequency, time-frequency domain energy entropy and marginal spectral peaks; Pearson correlation coefficient between features is calculated and highly correlated features are removed; random forest is used to evaluate feature contribution; principal components with cumulative variance contribution rate are selected to construct core feature vectors. S5. Feature Fusion and Dimensionality Reduction: The core feature vector and leakage aperture label are divided into training and test sets. The model hyperparameters are determined by grid search and training is completed. When the accumulation of new samples reaches the set threshold, knowledge distillation is performed to update the network with the original model as the teacher network and the new model as the student network. S6. Model Incremental Update: After inputting the feature vector into the model, the predicted values of leakage type and aperture are output synchronously. Based on the dispersion of the prediction results of each base learner, the confidence interval of the predicted value is calculated by Bayesian approximation. S7. Leakage Identification and Prediction: Extract the energy value of each sensor signal, establish an exponential relationship between energy attenuation and propagation distance; inject a standard pulse into the sensor and measure the response amplitude, calculate the coupling quality index, and then correct the aperture prediction value. S8. Leakage Calculation: Calculate the ratio of the corrected orifice diameter to the pipe inner diameter, and select the corresponding leakage model based on the ratio; convert the corrected orifice diameter into the leakage cross-sectional area, calculate the mass flow rate in combination with real-time pressure and temperature parameters, and obtain the cumulative leakage by integrating the flow rate over time. S9. Closed-loop global optimization: Calculate the deviation between the cumulative leakage and the actual value, and feed the deviation back to the modal decomposition parameters, dynamic threshold, and feature weights; train the policy network through reinforcement learning and adjust the parameter configuration of each link according to the current state.
[0027] In this embodiment: Step S1 achieves the coordinated acquisition of acoustic emission signals and operating parameters and the comprehensive extraction of multi-dimensional features by simultaneously deploying acoustic emission sensor arrays, pressure sensors and temperature sensors at key nodes of the pipeline, and using a sliding time window to segment the signal and extract time-domain and frequency-domain feature parameters. This improves upon the problems of insufficient information from a single sensor data source and incomplete feature representation mentioned in the background technology, and provides a complete data foundation for subsequent accurate identification of leakage types and accurate calculation of leakage amounts.
[0028] Step S2 extracts the main period by performing autocorrelation analysis on the signal and finds similar waveform segments at both ends of the signal for bidirectional extension. It then uses an optimization algorithm to adaptively determine the number of modes and the penalty factor for variational mode decomposition. This technique effectively suppresses the signal endpoint effect and achieves adaptive sparse decomposition. It improves upon the poor adaptability of the fixed parameter decomposition method and the impact of the endpoint effect on the decomposition accuracy mentioned in the background technology, thereby enhancing the accuracy and stability of signal decomposition.
[0029] Step S3 uses a sliding window to statistically analyze the background noise permutation entropy in real time and dynamically sets the threshold according to the three sigma criterion. The decomposed components are divided into three categories: effective signal, suspicious transition, and noise-dominated. Targeted denoising strategies are then adopted for each category. This achieves adaptive tracking of the noise baseline and hierarchical denoising. It improves upon the fixed threshold denoising method mentioned in the background technique, which suffers from insufficient adaptability under complex working conditions and is prone to losing effective signals. It effectively suppresses noise while preserving leakage feature information to the greatest extent.
[0030] Step S4 extracts multi-domain features by performing wavelet packet multi-scale decomposition on the denoised signal, calculates the Pearson correlation coefficient between features to remove redundant features, and uses random forest to evaluate feature contribution and select principal components to construct core feature vectors. This achieves dimensionality reduction of the high-dimensional feature space and extraction of core information, improving the problems of high feature redundancy, large computational complexity, and difficulty in identifying key features mentioned in the background technology. It provides input variables with strong discriminative power and high computational efficiency for model training.
[0031] Step S5 determines the optimal hyperparameters of the model through grid search to complete the training. An incremental learning mechanism is introduced to update knowledge by using the original model as the teacher network and the new model as the student network. This achieves the establishment of a precise nonlinear mapping relationship between the feature vector and the leakage aperture and the continuous adaptation of the model to changes in operating conditions. This improves upon the problem mentioned in the background technology that the static model cannot adapt to the long-term evolution of the pipeline and the decay of prediction accuracy over time, and maintains the long-term stability of the model's prediction accuracy.
[0032] Step S6 synchronously executes the dual tasks of leakage type classification and aperture regression by sharing the underlying representation layer. Based on the dispersion of the prediction results of each base learner, the confidence interval is calculated using Bayesian approximation. This achieves integrated prediction of leakage type and aperture size and quantification of the uncertainty of the prediction results. It improves the problems of insufficient generalization ability of single-task models and lack of reliability measurement of prediction results mentioned in the background technology, and provides a scientific basis for engineers to formulate graded response strategies.
[0033] Step S7 establishes an exponential mapping relationship between energy attenuation and propagation distance by extracting the energy characteristics of each sensor signal, injecting standard pulses into the sensor to measure the response amplitude, calculating the coupling quality index, and correcting the aperture prediction value. This technique achieves leakage source location inversion based on multi-point energy data and eliminates the influence of sensor coupling degradation. It improves the problems of low positioning accuracy and prediction deviation caused by sensor state changes mentioned in the background technology, thereby improving the accuracy of leakage source location and the reliability of aperture prediction.
[0034] Step S8 automatically matches the corresponding leakage model by calculating the ratio of the corrected orifice diameter to the pipe inner diameter, converts the corrected orifice diameter into an equivalent cross-sectional area, calculates the mass flow rate by combining it with real-time operating parameters, and performs time integration. This technique enables accurate determination of the flow state under different leakage types and precise calculation of leakage. It improves upon the problems mentioned in the background technology, such as improper selection of leakage estimation models and incomplete consideration of operating parameters leading to large calculation errors, and provides a quantitative basis for pipeline safety assessment and emergency response.
[0035] Step S9 calculates the deviation between the cumulative leakage and the actual value and feeds it back to the key links. It uses a reinforcement learning algorithm to train the strategy network to adaptively adjust the parameter configuration of each link according to the current state. This achieves full-process feedback optimization from signal processing to leakage measurement and global optimization of system-level parameters. It improves the problems mentioned in the background technology, such as poor overall performance caused by independent optimization of parameters of each link and lack of system adaptability. It enables the full-process performance to continuously evolve with the running data, forming a self-optimizing closed-loop control system.
[0036] This invention, through the coordinated operation of steps S1 to S9, achieves intelligent identification of gas pipeline leakage types and accurate real-time calculation of leakage amounts. This method comprehensively optimizes the technical deficiencies existing in the background technology, improving the accuracy of leakage type identification, leakage orifice diameter prediction, and leakage source location. It achieves accurate real-time calculation of leakage amounts for three leakage types: small-hole leakage, large-hole leakage, and pipeline leakage. Furthermore, through incremental learning and closed-loop optimization, the system possesses adaptive tracking capabilities for long-term state evolution such as pipeline corrosion development and sediment accumulation, providing technical support for the safety monitoring, risk assessment, and emergency response of gas pipelines.
[0037] Example 2: Please refer to Figure 1 In step S1, the specific method for multi-source data acquisition is as follows: S1.1. Install acoustic emission sensor arrays at key locations along the pipeline axis, and fix the sensors by magnetic attraction or welding to ensure acoustic coupling stability. Simultaneously install pressure transmitters, temperature sensors and flow meters. Each sensing node is connected to the data acquisition terminal via wired or wireless means to form a distributed sensing network covering the entire pipeline. S1.2. Set the acoustic emission signal sampling rate to 1MHz and start the pulse triggering mechanism to synchronously collect acoustic emission waveforms, operating pressure, medium temperature, and flow data from each node. Perform timestamp alignment and format standardization on the multi-source data streams. Use a sliding time window to segment the signal, setting the window length to 20,000 frames and the step size to 10,000 frames, and segment the signal under different leakage aperture conditions. Extract the time-domain and frequency-domain features of each signal segment. The time-domain features include mean, peak amplitude, energy, standard deviation, skewness, kurtosis, waveform factor, peak factor, and time-domain waveform complexity. The frequency-domain features include centroid frequency, spectral area, spectral standard deviation, spectral kurtosis, spectral flatness, ring count, energy entropy, information entropy, spectral flux, and spectral roll-off point. Construct an initial feature set containing 30 feature parameters.
[0038] In this embodiment: Step S1.1 involves deploying an array of acoustic emission sensors at key locations along the pipeline axis and fixing them using magnetic attraction or welding. Pressure transmitters, temperature sensors, and flow meters are installed simultaneously, and each sensing node is connected to a data acquisition terminal via wired or wireless means. This achieves the construction of a distributed sensing network covering the entire pipeline, thus improving upon the problems of unreasonable sensor deployment and single data source mentioned in the background technology.
[0039] Step S1.2 synchronously acquires multi-source data by setting the sampling rate to 1MHz and starting the pulse triggering mechanism. It performs timestamp alignment and format standardization on the data stream, and uses a sliding time window to segment the signal and extract 30 feature parameters covering the time and frequency domains. This achieves the time-series correlation between acoustic emission signals and operating parameters and the comprehensive characterization of multi-dimensional features, thus improving the problems of incomplete feature extraction and unreasonable signal segmentation methods mentioned in the background technology.
[0040] Step S1, through the rational deployment of the sensor array and the collaborative acquisition of multi-source data, combined with sliding time window segmentation and multi-dimensional feature extraction, achieves the spatiotemporal correlation and comprehensive characterization of acoustic emission signals and operating parameters. Compared with the methods of single sensor deployment, fixed window segmentation, and limited feature extraction in the background technology, this step establishes a distributed sensor network covering the entire pipeline, uses an adaptive sliding window to continuously divide the signals under different leakage conditions, and extracts 30 feature parameters covering the time and frequency domains. This solves the problems of insufficient data source information, unreasonable signal segmentation, and incomplete feature characterization in traditional methods, improves the ability to capture leakage signals and the completeness of feature expression, and enhances the accuracy and reliability of leakage type identification and leakage quantity measurement.
[0041] Example 3: Please refer to Figure 1 In step S2, the adaptive preprocessing is performed as follows: S2.1 Construct a Pearson correlation coefficient matrix for the 30 feature parameters in the initial feature set, calculate the correlation coefficient between any two feature parameters, set the correlation threshold to 0.9, remove highly correlated features with weak physical meaning or high computational complexity, and retain features with clear physical meaning and strong representation ability to obtain 16 feature subsets including mean, peak amplitude, energy, average signal level, skewness, kurtosis, waveform factor, peak factor, time-domain waveform complexity, spectral kurtosis, spectral flatness, ring count, energy entropy, information entropy, spectral flux, and spectral roll-off point; S2.2 Construct a random forest model containing 100 decision trees, using 16 feature subsets as inputs. Employ out-of-bag error as a sensitivity evaluation index, calculate the influence of each feature parameter on the out-of-bag error, and select 10 highly sensitive feature parameters based on their contribution: mean, peak amplitude, energy, average signal level, skewness, kurtosis, waveform factor, time-domain waveform complexity, spectral flatness, energy entropy, and spectral flux. After standardizing and preprocessing the 10 key feature parameters, perform principal component analysis to calculate the variance contribution rate of each principal component. Set the cumulative variance contribution rate threshold to 95%, and select the top 4 principal components to construct the core feature vector.
[0042] In this embodiment: Step S2.1 uses a technique of constructing a Pearson correlation coefficient matrix with 30 feature parameters, setting a correlation threshold of 0.9 to remove highly correlated features with weak physical meaning or high computational complexity, and retaining 16 feature subsets with clear physical meaning and strong representational ability. This technique achieves the redundancy removal and optimization of the initial feature set, and improves the problem of high feature redundancy and high computational complexity mentioned in the background technology.
[0043] Step S2.2 constructs a random forest model containing 100 decision trees, uses out-of-bag error to evaluate the contribution of each feature to the change in leakage pore size, selects 10 highly sensitive feature parameters, performs principal component analysis after standardizing and preprocessing the key features, sets the cumulative variance contribution rate threshold to 95%, and selects the first 4 principal components to construct the core feature vector. This technique achieves accurate screening of highly sensitive features and effective dimensionality reduction of high-dimensional feature space, thus improving the problems mentioned in the background technology, such as the difficulty in identifying key features and the impact of excessively high feature dimensions on model efficiency.
[0044] Step S2 eliminates redundant features through Pearson correlation coefficient analysis, and combines random forest sensitivity assessment and principal component analysis for dimensionality reduction, achieving optimized extraction from 30 initial features to a 4-dimensional core feature vector. Compared with the methods in the background techniques that directly use all features or simply select features, this step adopts a three-level screening mechanism of correlation analysis, sensitivity assessment, and principal component dimensionality reduction. While eliminating redundant features, it retains core information highly correlated with the leakage pore size, solving the problems of high feature redundancy, difficulty in identifying key features, and high computational complexity in traditional methods. This step reduces the feature dimension from 30 to 4, reducing the feature dimension by 87% while maintaining feature representation capabilities, improving model training efficiency and prediction accuracy, and enhancing the accuracy and real-time performance of leakage pore size prediction.
[0045] Example 4: Please refer to Figure 1 In step S3, the specific method of mode decomposition optimization is as follows: S3.1 Extract the energy characteristics of the signals collected by each sensor as a propagation sensitive parameter, and establish an exponential mapping relationship between energy attenuation and propagation distance. The specific calculation formula is as follows:
[0046] Where E(r) is the sound wave energy at a distance r, E0 is the initial energy at the sound source, and k is the environment-related attenuation coefficient; S3.2 Inject standard pulse signals into each sensor and collect response waveforms. Calculate the deviation between the actual amplitude and the theoretical amplitude to obtain the coupling quality index. Based on this index, perform linear correction on the aperture prediction value. Substitute the energy values monitored by each sensor into the energy attenuation model. Solve the propagation distance by combining energy data from multiple points and inversely calculate the coordinates of the leakage source location.
[0047] In this embodiment: Step S3.1 uses the technique of extracting the energy characteristics of the signals collected by each sensor as a propagation sensitive parameter and establishing an exponential mapping relationship between energy attenuation and propagation distance. This achieves a quantitative description of the law of sound wave energy variation with propagation distance, improving upon the problems of lack of physical model support and low positioning accuracy in leak source location mentioned in the background technology. This step reflects the comprehensive influence of pipe material, medium characteristics, and environmental conditions on sound wave propagation through the energy attenuation coefficient.
[0048] Step S3.2 involves injecting standard pulse signals into each sensor and acquiring the response waveforms. The deviation between the actual and theoretical amplitudes is calculated to obtain the coupling quality index, which is then linearly corrected for the aperture prediction. The energy values monitored by each sensor are substituted into the energy attenuation model. Through multi-point energy data, the propagation distance is jointly solved, and the coordinates of the leakage source are inverted and calculated. This technique achieves real-time monitoring of the sensor coupling state and accurate location of the leakage source, improving upon the problems mentioned in the background technology, such as sensor coupling degradation leading to prediction deviations and insufficient single-point positioning accuracy. This step improves the reliability and accuracy of positioning through multi-point energy data joint solution.
[0049] Step S3 establishes an exponential mapping relationship between energy attenuation and propagation distance, and combines sensor coupling quality monitoring and multi-point energy data joint solution to achieve accurate inversion and localization of the leak source. Compared with the time-difference positioning or single-point energy estimation methods in the background technology, this step establishes a physical model of energy attenuation considering pipe material, medium characteristics, and environmental conditions. It introduces a sensor coupling quality index to correct the aperture prediction value in real time, and uses multi-point energy data joint solution to improve the redundancy and fault tolerance of the localization. This solves the problems of low positioning accuracy, prediction deviation caused by sensor state changes, and insufficient reliability of single-point positioning in traditional methods. This step improves the leak source localization accuracy to the meter level, eliminates the influence of sensor coupling degradation on aperture prediction, and enhances the stability and practicality of the leak detection system.
[0050] Example 5: Please refer to Figure 1 In step S4, the specific method of dynamic hierarchical denoising is as follows: S4.1. Take the 4-dimensional core feature vector obtained in S2 as input data, and take the leakage pore size corresponding to each feature vector as label data. Randomly divide it into training set and test set in a ratio of 8:2. Perform standardization preprocessing on the training set and test set respectively to eliminate the difference in dimensionality between features of different dimensions. S4.2. A regression prediction model for leakage pore size is constructed based on the XGBoost algorithm. The grid search algorithm is used to globally optimize the model hyperparameters. The preset hyperparameter search space is traversed and the prediction accuracy under different parameter combinations is verified. After determining the optimal hyperparameter combination, the model training is completed. The test set is input into the trained model for verification. The coefficient of determination R², root mean square error RMSE, mean absolute error MAE, and mean absolute percentage error MAPE are selected as evaluation indicators to measure the degree of deviation between the model's predicted pore size and the actual pore size.
[0051] In this embodiment: Step S4.1 involves randomly dividing the 4-dimensional core feature vector as input data and the leakage aperture size as label data into training and test sets in an 8:2 ratio. Standardization preprocessing is then performed on both sets to eliminate dimensional differences between features of different dimensions. This achieves a reasonable division of the model training data and unified normalization of feature scales, improving upon the problems mentioned in the background technology where unreasonable training data division and dimensional differences affecting model convergence. This step ensures the consistency of sample distribution between the training and test sets, improving the model's generalization ability and training efficiency.
[0052] Step S4.2 constructs a leakage pore size regression prediction model based on the XGBoost algorithm. A grid search algorithm is used to globally optimize the model's hyperparameters and determine the optimal parameter combination to complete model training. The coefficient of determination, root mean square error, mean absolute error, and mean absolute percentage error are selected as evaluation indicators to measure the model's prediction accuracy. This achieves accurate establishment of the nonlinear mapping relationship between the feature vector and the leakage pore size and a comprehensive evaluation of the model's performance, improving upon the problems mentioned in the background technology, such as the reliance on experience in model parameter selection and the incomplete evaluation of prediction accuracy. This step ensures the accuracy and reliability of the model's predictions through multi-indicator comprehensive evaluation.
[0053] Step S4 achieves efficient training and accurate prediction of the leakage pore size regression prediction model by reasonably dividing the training and testing sets and performing standardized preprocessing, combined with grid search algorithm to optimize model hyperparameters and comprehensive evaluation of multiple indicators. Compared with the methods in the background technology that use fixed parameters to train the model or a single indicator to evaluate performance, this step uses an 8:2 ratio to divide the dataset to ensure sufficient training and effective testing. Standardized preprocessing eliminates the influence of differences in feature dimensions on model convergence. The grid search algorithm achieves global optimization of hyperparameters, avoiding the blindness of manual parameter tuning. Four indicators, namely coefficient of determination, root mean square error, mean absolute error, and mean absolute percentage error, are introduced to comprehensively evaluate model performance. This solves the problems of unreasonable training data partitioning, reliance on experience in model parameter selection, and incomplete evaluation of prediction accuracy in traditional methods, thereby improving the accuracy of leakage pore size prediction and the model's generalization ability.
[0054] Example 6: Please refer to Figure 1 In step S5, the specific method of feature fusion and dimensionality reduction is as follows: S5.1 Input the real-time acquired signal features into the trained model to obtain the predicted leakage orifice diameter d, and calculate the ratio R = d / D of the predicted orifice diameter d to the pipe inner diameter D; match the corresponding leakage model according to the ratio R: when R < 0.15, it is judged as a small orifice leakage; when 0.15 ≤ R ≤ 0.85, it is judged as a large orifice leakage; when R > 0.85, it is judged as a pipe crack leakage. The specific calculation method for the small hole model is as follows;
[0055] in, Indicates leakage flow rate. Leakage coefficient, The air pressure inside the pipe, Let M be the area of the leakage hole, Z be the relative molecular mass, Z be the compressibility factor, and R be the gas constant. Let be the temperature inside the pipe, and y be the adiabatic index. The specific calculation method for the large-hole model is as follows;
[0056] in Average pressure; The specific calculation method for the pipeline model is as follows;
[0057] in, This refers to the cross-sectional area of the pipe. S5.2 Obtain gas operating parameters including pressure p, temperature T, and density ρ. Convert the predicted orifice diameter d into the leakage cross-sectional area A using geometric relationships. Substitute the gas operating parameters and leakage cross-sectional area into the matched leakage model to calculate the mass flow rate. The calculation formula for the small orifice model is Q=C. a pA√(M / ZRT)√(2γ / (γ-1)), where the macropore model uses the average pressure p m Instead of the internal pressure p, the pipe leakage model uses the pipe cross-sectional area A. p Replace the leakage hole area A; combine the leakage monitoring time and calculate the cumulative leakage amount using the formula m=Q×t, where m is the real-time leakage amount, Q is the mass flow rate, and t is the monitoring time.
[0058] In this embodiment: Step S5.1 involves inputting real-time acquired signal features into a trained model to obtain the predicted leakage orifice diameter and calculating its ratio to the pipe's inner diameter. Based on the ratio range, it automatically matches three leakage models: small-hole leakage, large-hole leakage, or pipe leakage. This technique achieves accurate determination of different leakage types and automatic selection of corresponding calculation models, improving upon the problems mentioned in the background art where leakage type determination relies on human experience and improper model selection leads to large calculation errors. This step accurately classifies leakage conditions into three categories using an orifice diameter ratio threshold, ensuring the accuracy of flow state determination and the rationality of leakage model matching.
[0059] Step S5.2 involves acquiring gas operating parameters and converting the predicted orifice diameter into a leakage cross-sectional area. The operating parameters and cross-sectional area are then substituted into a matched leakage model to calculate the mass flow rate. Combined with monitoring duration, the cumulative leakage is obtained through time integration. This technique achieves accurate real-time measurement of leakage under different leakage types, improving upon the shortcomings of the leakage estimation methods mentioned in the background art, such as incomplete consideration of operating parameters and low calculation accuracy. This step employs corresponding flow calculation formulas for three leakage types: small orifice, large orifice, and pipeline leakage, fully considering the influence of operating parameters such as pressure, temperature, and gas composition on the leakage flow rate.
[0060] Step S5 automatically matches the leakage model by calculating the orifice ratio, calculates the mass flow rate by combining real-time operating parameters, and performs time integration, achieving accurate real-time measurement of leakage under different leakage types. Compared with the methods in the background technology that use a single leakage model or ignore the influence of operating parameters, this step classifies leakage conditions into three categories—small orifice, large orifice, and pipeline leakage—based on the orifice ratio and automatically matches the corresponding flow calculation model. For different leakage types, it adopts flow calculation formulas that consider operating parameters such as pressure, temperature, and gas composition. Through time integration, it achieves continuous cumulative monitoring of leakage, solving the problems of large calculation errors caused by traditional methods relying on manual experience for leakage type determination, improper model selection, and incomplete consideration of operating parameters. This step improves the leakage measurement accuracy to within 5%, realizing a complete closed loop from leakage orifice prediction to quantitative leakage measurement, providing accurate quantitative basis for pipeline safety assessment and emergency response.
[0061] Example 7: Please refer to Figure 1 In step S6, the specific method for incremental model update is as follows: S6.1 Input the core feature vector obtained in S2 into the trained model, and simultaneously perform leakage type classification and pore size regression tasks through the shared bottom representation layer. The classification branch outputs the pitting corrosion, crack or fracture type label, and the regression branch outputs the continuous pore size prediction value. S6.2 Based on the dispersion of the prediction results of each base learner in the ensemble model, the Bayesian approximation method is used to estimate the posterior distribution of the prediction, calculate the class probability of the classification task and the prediction variance of the regression task, and output the prediction results including point estimates and confidence intervals.
[0062] In this embodiment: Step S6.1 involves inputting the core feature vector into the trained model and simultaneously performing leak type classification and pore size regression tasks using a shared bottom-level representation layer. The classification branch outputs labels for pitting corrosion, cracks, or fracture types, while the regression branch outputs continuous pore size prediction values. This technique achieves integrated output of leak type identification and pore size prediction, improving upon the problems of separate processing of leak type identification and pore size prediction, and insufficient model generalization ability mentioned in the background technology. This step, through sharing the bottom-level feature representation, allows the two tasks to mutually constrain and promote each other, improving the model's prediction accuracy and generalization performance.
[0063] Step S6.2 uses a technique that estimates the posterior distribution of predictions based on the dispersion of prediction results from each base learner in the ensemble model, employs the Bayesian approximation method, calculates the class probability for the classification task and the prediction variance for the regression task, and outputs prediction results containing point estimates and confidence intervals. This technique achieves the quantification of uncertainty and reliability assessment of prediction results, and improves upon the problem mentioned in the background technique of lacking reliability measurement of prediction results and being unable to support risk decision-making.
[0064] Step S6 achieves multi-task joint prediction of leak type classification and aperture regression by sharing the underlying representation layer. It combines the Bayesian approximation method to quantify the uncertainty of the prediction results, realizing integrated prediction and reliability assessment of leak type and aperture size. Compared with the methods in the background technology that train classification and regression models separately or only output point estimates, this step uses a multi-task learning framework to make leak type identification and aperture prediction mutually constrain and promote each other by sharing the underlying feature representation, improving the model's generalization ability and prediction accuracy. The introduction of the Bayesian approximation method estimates the posterior distribution of the prediction based on the dispersion of the prediction results of each base learner, outputting prediction results including point estimates and confidence intervals, solving the problems of insufficient generalization ability and lack of reliability measurement in traditional methods. This step improves the leak type identification accuracy to over 95%, controls the aperture prediction error to within 8%, and provides engineers with confidence intervals for the prediction results, supporting risk-level-based graded response decisions.
[0065] Example 8: Please refer to Figure 1 In step S7, the specific method for leak identification and prediction is as follows: S7.1 Perform autocorrelation analysis on the original acoustic emission signal to extract the main period and local feature waveforms. Find the matching segment with the highest similarity to the boundary waveform at both ends of the signal. Calculate the extension length dynamically based on the multiple of the main period. Perform bidirectional predictive extension to the front and back ends of the signal respectively. Use a weighted fusion method to smooth the connection between the extension segment and the original boundary. S7.2. With leakage identification accuracy as the optimization objective, a joint optimization space for the number of modes and the penalty factor is established. Parameter boundary constraints and discretized grids are set. The fitness function is constructed by introducing leakage feature preservation degree and computational efficiency. An improved optimization algorithm is used to simultaneously evaluate the fitness of multiple parameter combinations on a parallel architecture. After iterative convergence to the optimal solution, the optimal number of modes and penalty factor are output. Variational mode decomposition is performed on the extended signal to obtain the intrinsic mode function.
[0066] In this embodiment: Step S7.1 extracts the main period and local feature waveforms by performing autocorrelation analysis on the original acoustic emission signal, finds the matching segment with the highest similarity to the boundary waveform at both ends of the signal, and dynamically calculates the extension length based on the multiple of the main period. Bidirectional predictive extension is performed at both the front and back ends of the signal, and a weighted fusion method is used to smooth the connection between the extended segment and the original boundary. This technique effectively suppresses the signal endpoint effect and maintains the boundary continuity, improving upon the problems mentioned in the background art where signal truncation leads to frequency aliasing and endpoint effects affect decomposition accuracy. This step avoids over-extension or under-extension problems caused by a fixed extension length by adaptively determining the extension length and using weighted fusion to smooth the connection.
[0067] Step S7.2 establishes a joint optimization space of mode number and penalty factor with leakage identification accuracy as the optimization objective. It introduces leakage feature preservation and computational efficiency to construct a fitness function. An improved optimization algorithm is used to simultaneously evaluate multiple parameter combinations on a parallel architecture and iteratively converge to the optimal solution. Variational mode decomposition is then performed on the extended signal to obtain the eigenmode functions. This achieves adaptive optimization of decomposition parameters and accurate sparse decomposition of the signal, improving upon the poor adaptability and experience-dependent parameter selection issues of the fixed-parameter decomposition method mentioned in the background. This step accelerates the parameter search process through a parallel architecture, allowing the optimization process to directly serve the leakage identification task.
[0068] Step S7 suppresses signal endpoint effects through autocorrelation analysis and bidirectional predictive continuation, and adaptively determines mode decomposition parameters using an improved optimization algorithm, achieving high-quality preprocessing and accurate sparse decomposition of acoustic emission signals. Compared with the methods in the background that use fixed continuation lengths and fixed decomposition parameters, this step dynamically calculates the continuation length based on the signal's main period and uses weighted fusion to smooth boundary connections, avoiding frequency aliasing and amplitude abrupt changes caused by fixed continuation. A joint optimization space of mode number and penalty factor is established with leakage identification accuracy as the optimization objective. A fitness function is constructed by introducing leakage feature preservation and computational efficiency, and a parallel architecture is used to accelerate parameter search, solving the problems of endpoint effects affecting decomposition accuracy, poor adaptability of fixed parameters, and reliance on experience for parameter selection in traditional methods. This step improves signal decomposition accuracy, enables decomposition parameters to be adaptively adjusted according to different operating conditions, and enhances the adaptability and stability of signal preprocessing.
[0069] Example 9: Please refer to Figure 1 In step S8, the specific method for calculating the leakage amount is as follows: S8.1. Use a sliding time window to extract data during periods without leakage, calculate the mean and standard deviation of the background noise permutation entropy online to establish a noise statistical model, and dynamically calculate the entropy threshold based on the three sigma criterion; classify the components obtained from variational mode decomposition into three categories according to the relationship between entropy and threshold: effective signal, suspicious transition, and noise-dominated. S8.2. Valid signal classes are directly retained, noise-dominant classes are denoised using wavelet soft thresholding, and suspicious transition classes are weighted and fused using a membership function. After reconstructing the signal, the signal-to-noise ratio and leakage feature retention are calculated. The power exponent parameter of the wavelet thresholding function is dynamically adjusted based on the dual-index feedback, and the denoised signal is output.
[0070] In this embodiment: Step S8.1 utilizes a sliding time window to extract data during periods without leakage, calculates the mean and standard deviation of the background noise permutation entropy online to establish a noise statistical model, dynamically calculates the entropy threshold based on the three sigma criterion, and classifies the components obtained from variational mode decomposition into three categories: effective signal, suspicious transition, and noise-dominated based on the relationship between entropy and threshold. This technique achieves adaptive tracking of the noise baseline and accurate classification of decomposed components, improving upon the problem mentioned in the background technique of insufficient adaptability and difficulty in distinguishing effective signals from noise under complex conditions using the fixed threshold denoising method. This step adapts to the time-varying characteristics of background noise by dynamically updating the noise statistical model and avoids misjudgments caused by simple dichotomy through the three-category classification.
[0071] Step S8.2 employs a technique that directly preserves effective signal classes, performs wavelet soft-threshold denoising on noise-dominant classes, and introduces a membership function for weighted fusion on suspicious transitional classes. After reconstructing the signal, it calculates the signal-to-noise ratio and leakage feature preservation degree, and dynamically adjusts the power exponent parameter of the wavelet threshold function based on dual-index feedback to output the denoised signal. This achieves differentiated denoising processing for different categories of components and adaptive adjustment of denoising intensity, improving upon the problems mentioned in the background technique where a unified denoising strategy easily loses effective signals and fixed denoising parameters lead to poor performance. This step achieves a dynamic balance between noise suppression and feature preservation through a dual-index feedback mechanism.
[0072] Step S8 achieves adaptive hierarchical denoising of acoustic emission signals through dynamic noise statistical modeling and three-class component classification, combined with differentiated denoising strategies and dual-index feedback adjustment. Compared with the fixed threshold uniform denoising method in the background technology, this step utilizes a sliding window to update the noise statistical model online to adapt to the time-varying characteristics of background noise. Based on the three-sigma criterion, the entropy threshold is dynamically calculated to accurately classify the decomposed components into three classes. Differentiated processing strategies of preservation, wavelet denoising, and weighted fusion are adopted for different classes. A dual-index feedback mechanism of signal-to-noise ratio and leakage feature preservation is introduced to dynamically adjust the wavelet threshold parameter, solving the problems of insufficient adaptability of fixed thresholds in traditional methods, easy loss of effective signals by uniform denoising strategies, and poor performance due to fixed denoising parameters. This step effectively suppresses noise while preserving leakage feature information to the greatest extent, improving the accuracy of subsequent feature extraction and model prediction.
[0073] Example 10: Please refer to Figure 1 In step S9, the specific method for closed-loop global optimization is as follows: S9.1. The deviation between the cumulative leakage obtained from S5 and the standard measurement value is used as the system measurement error. The error is traced back along the processing flow to key control points such as mode decomposition parameters, dynamic thresholds and feature weights. The current operating condition state vector and parameter configuration are extracted to construct a feedback environment that includes error signals, state space and adjustable parameters. S9.2. With minimizing long-term measurement error as the optimization objective, a reinforcement learning algorithm is used to train the policy network. The agent outputs adjustment actions for parameters such as modality number, penalty factor and entropy threshold according to the current state. It accumulates rewards and updates the policy through environmental interaction, thereby achieving adaptive optimization of system-level parameters.
[0074] In this embodiment: Step S9.1 uses the deviation between the cumulative leakage and the standard measurement value as the system measurement error, and traces it backward along the processing flow to key control points such as modal decomposition parameters, dynamic thresholds, and feature weights. It extracts the current operating condition state vector and parameter configuration, and constructs a feedback environment including error signals, state space, and adjustable parameters. This technical means realizes the quantitative assessment of system measurement error and the full-process traceability of key parameters, improving upon the problems mentioned in the background technology of independent parameter optimization at each stage and the lack of a global feedback mechanism. This step establishes a complete feedback loop from the leakage measurement result to the signal processing parameters, providing state representation and action space for subsequent parameter optimization.
[0075] Step S9.2 employs a reinforcement learning algorithm to train a policy network with the optimization objective of minimizing long-term measurement errors. The agent adjusts parameters such as the number of modes, penalty factor, and entropy threshold based on the current state, accumulating rewards through environmental interactions and updating the policy to achieve adaptive optimization of system-level parameters. This approach enables collaborative optimization of parameters across multiple stages and continuous evolution of system performance, addressing the issues mentioned in the background technology where parameter adjustment relies on human experience and the system lacks adaptive capabilities. This step, through reinforcement learning, allows the system to autonomously learn the optimal parameter configuration strategy based on operational data.
[0076] Step S9 establishes a full-process feedback loop through error backtracking and combines it with reinforcement learning algorithms to achieve adaptive optimization of system-level parameters, thus constructing a self-optimizing closed-loop control system. Compared with the methods in the background technology where parameters of each link are optimized independently or rely on manual adjustment, this step traces the cumulative leakage measurement error back to key control points such as mode decomposition parameters, dynamic thresholds, and feature weights, constructing a complete feedback environment that includes error signals, state space, and adjustable parameters. Reinforcement learning algorithms are used to train the policy network, enabling the agent to autonomously output parameter adjustment actions based on the current operating condition. Through environmental interaction, rewards are accumulated and the policy is updated to achieve collaborative optimization of parameters across multiple links. This solves the problems of poor overall performance caused by independent parameter optimization of each link in traditional methods, reliance on manual experience for parameter adjustment, and lack of system adaptability. This step allows the system performance to continuously evolve with operating data, automatically adapting to long-term state changes such as pipeline corrosion development and sediment accumulation, maintaining the long-term stability and accuracy of leakage detection and leakage measurement.
[0077] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units. The above are merely embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made based on the description and drawings of this application, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
[0078] The specific embodiments of the invention have been described in detail above, but they are only examples, and this application is not limited to the specific embodiments described above. For those skilled in the art, any equivalent modifications or substitutions to the invention are also within the scope of this application. Therefore, all equivalent changes, modifications, and improvements made without departing from the spirit and principles of this application should be covered within the scope of this application.
Claims
1. A method for identifying leakage types and calculating leakage amount in gas pipelines based on acoustic emission, characterized in that: The specific steps are as follows: S1. Multi-source data acquisition: Deploy acoustic emission sensor arrays, pressure sensors, and temperature sensors at key nodes of the pipeline to simultaneously acquire acoustic emission signals and operating parameters under different leakage conditions; set a sliding time window to segment the signal, extract time-domain and frequency-domain feature parameters, and construct an initial feature set; S2. Adaptive preprocessing: Autocorrelation analysis is performed on the signal to obtain the main period, and similar waveform segments are found at both ends of the signal for bidirectional extension; optimization algorithm is used to determine the number of modes and penalty factor, and variational mode decomposition is performed on the extended signal; S3. Modal decomposition optimization: The mean and standard deviation of the background noise permutation entropy are statistically analyzed by sliding window, and a dynamic threshold is set according to the three sigma criterion. Based on the threshold, the decomposed components are divided into three categories: effective signal, suspicious transition, and noise-dominated. The three categories of components are respectively preserved, weighted fusion, and wavelet threshold denoising. S4. Dynamic hierarchical denoising: Wavelet packet decomposition is performed on the denoised signal to extract time-domain statistics, frequency-domain center frequency, time-frequency domain energy entropy, and marginal spectral peaks. Calculate the Pearson correlation coefficient between features and remove highly correlated features. Use random forest to evaluate the feature contribution and select principal components with the cumulative variance contribution rate to construct the core feature vector. S5. Feature Fusion and Dimensionality Reduction: The core feature vector and leakage aperture label are divided into training and test sets. The model hyperparameters are determined by grid search and training is completed. When the accumulation of new samples reaches a set threshold, knowledge distillation is performed to update the network using the original model as the teacher network and the new model as the student network. S6. Model Incremental Update: After inputting the feature vector into the model, the predicted values of leakage type and aperture are output synchronously. Based on the dispersion of the prediction results of each base learner, the confidence interval of the predicted value is calculated by Bayesian approximation. S7. Leakage Identification and Prediction: Extract the energy values of each sensor signal, establish an exponential relationship between energy attenuation and propagation distance; inject standard pulses into the sensors and measure the response amplitude, calculate the coupling quality index, and then correct the aperture prediction value. S8. Leakage Calculation: Calculate the ratio of the corrected orifice diameter to the pipe inner diameter, and select the corresponding leakage model based on the ratio; convert the corrected orifice diameter into the leakage cross-sectional area, calculate the mass flow rate in combination with real-time pressure and temperature parameters, and integrate the flow rate over time to obtain the cumulative leakage. S9. Closed-loop global optimization: Calculate the deviation between the cumulative leakage and the actual value, and feed the deviation back to the modal decomposition parameters, dynamic threshold and feature weights, etc. By training the strategy network through reinforcement learning, the parameter configurations of each stage are adjusted according to the current state.
2. The method for identifying gas pipeline leakage types and calculating leakage amount in real time based on acoustic emission, as described in claim 1, is characterized in that... In step S1, the specific method for multi-source data acquisition is as follows: S1.
1. Install acoustic emission sensor arrays at key locations along the pipeline axis, and fix the sensors by magnetic attraction or welding to ensure acoustic coupling stability. Simultaneously install pressure transmitters, temperature sensors and flow meters. Each sensing node is connected to the data acquisition terminal via wired or wireless means to form a distributed sensing network covering the entire pipeline. S1.
2. Set the acoustic emission signal sampling rate to 1MHz and start the pulse triggering mechanism to synchronously collect acoustic emission waveforms, operating pressure, medium temperature, and flow data from each node. Perform timestamp alignment and format standardization on the multi-source data streams. Use a sliding time window to segment the signal, setting the window length to 20,000 frames and the step size to 10,000 frames, and segment the signal under different leakage aperture conditions. Extract the time-domain and frequency-domain features of each signal segment. The time-domain features include mean, peak amplitude, energy, standard deviation, skewness, kurtosis, waveform factor, peak factor, and time-domain waveform complexity. The frequency-domain features include centroid frequency, spectral area, spectral standard deviation, spectral kurtosis, spectral flatness, ring count, energy entropy, information entropy, spectral flux, and spectral roll-off point. Construct an initial feature set containing 30 feature parameters.
3. The method for identifying gas pipeline leakage types and calculating leakage amount in real time based on acoustic emission, as described in claim 2, is characterized in that... In step S2, the adaptive preprocessing is performed in the following way: S2.1 Construct a Pearson correlation coefficient matrix for the 30 feature parameters in the initial feature set, calculate the correlation coefficient between any two feature parameters, set the correlation threshold to 0.9, remove highly correlated features with weak physical meaning or high computational complexity, and retain features with clear physical meaning and strong representation ability to obtain 16 feature subsets including mean, peak amplitude, energy, average signal level, skewness, kurtosis, waveform factor, peak factor, time-domain waveform complexity, spectral kurtosis, spectral flatness, ring count, energy entropy, information entropy, spectral flux, and spectral roll-off point; S2.2 Construct a random forest model containing 100 decision trees, take 16 feature subsets as input, use out-of-bag error as a sensitivity evaluation index, calculate the influence of each feature parameter on out-of-bag error, and select 10 highly sensitive feature parameters according to contribution order: mean, peak amplitude, energy, average signal level, skewness, kurtosis, waveform factor, time-domain waveform complexity, spectral flatness, energy entropy and spectral flux. After standardizing and preprocessing the 10 key feature parameters, principal component analysis was performed to calculate the variance contribution rate of each principal component. The cumulative variance contribution rate threshold was set to 95%, and the first 4 principal components were selected to construct the core feature vector.
4. The method for identifying gas pipeline leakage types and calculating leakage amount in real time based on acoustic emission, as described in claim 3, is characterized in that... In step S3, the specific method of mode decomposition optimization is as follows: S3.1 Extract the energy characteristics of the signals collected by each sensor as a propagation sensitive parameter, and establish an exponential mapping relationship between energy attenuation and propagation distance. The specific calculation formula is as follows: Where E(r) is the sound wave energy at a distance r, E0 is the initial energy at the sound source, and k is the environment-related attenuation coefficient; S3.2 Inject standard pulse signals into each sensor and collect response waveforms. Calculate the deviation between the actual amplitude and the theoretical amplitude to obtain the coupling quality index. Based on this index, perform linear correction on the aperture prediction value. Substitute the energy values monitored by each sensor into the energy attenuation model. Solve the propagation distance by combining energy data from multiple points and inversely calculate the coordinates of the leakage source location.
5. The method for identifying gas pipeline leakage types and calculating leakage amount in real time based on acoustic emission, as described in claim 4, is characterized in that... In step S4, the specific method of dynamic hierarchical denoising is as follows: S4.
1. Take the 4-dimensional core feature vector obtained in S2 as input data, and take the leakage pore size corresponding to each feature vector as label data. Randomly divide it into training set and test set in a ratio of 8:
2. Perform standardization preprocessing on the training set and test set respectively to eliminate the difference in dimensionality between features of different dimensions. S4.
2. A regression prediction model for leakage pore size is constructed based on the XGBoost algorithm. The grid search algorithm is used to globally optimize the model hyperparameters. The preset hyperparameter search space is traversed and the prediction accuracy under different parameter combinations is verified. After determining the optimal hyperparameter combination, the model training is completed. The test set is input into the trained model for verification. The coefficient of determination R², root mean square error RMSE, mean absolute error MAE, and mean absolute percentage error MAPE are selected as evaluation indicators to measure the degree of deviation between the model's predicted pore size and the actual pore size.
6. The method for identifying gas pipeline leakage types and calculating leakage amount in real time based on acoustic emission, as described in claim 5, is characterized in that... In step S5, the specific method of feature fusion and dimensionality reduction is as follows: S5.1 Input the real-time acquired signal features into the trained model to obtain the predicted leakage orifice diameter d, and calculate the ratio R = d / D of the predicted orifice diameter d to the pipe inner diameter D; match the corresponding leakage model according to the ratio R: when R < 0.15, it is judged as a small orifice leakage; when 0.15 ≤ R ≤ 0.85, it is judged as a large orifice leakage; when R > 0.85, it is judged as a full-section pipe rupture leakage (referred to as "pipeline leakage"). The specific calculation method for the small hole model is as follows; in, Indicates leakage flow rate. Leakage coefficient, The air pressure inside the pipe, Let M be the area of the leakage hole, Z be the relative molecular mass, Z be the compressibility factor, and R be the gas constant. Let y be the temperature inside the pipe, and y be the adiabatic index. The specific calculation method for the large-hole model is as follows; in Average pressure; The specific calculation method for the pipeline model is as follows; in, This refers to the cross-sectional area of the pipe. S5.2 Obtain gas operating parameters including pressure p, temperature T, and density ρ. Convert the predicted orifice diameter d into the leakage cross-sectional area A using geometric relationships. Substitute the gas operating parameters and leakage cross-sectional area into the matched leakage model to calculate the mass flow rate. The calculation formula for the small orifice model is Q=C. a pA√(M / ZRT)√(2γ / (γ-1)), where the macropore model uses the average pressure p m The pipe leakage model uses the pipe cross-sectional area A instead of the internal pressure p. p Replace the leakage hole area A; combine the leakage monitoring time and calculate the cumulative leakage amount using the formula m=Q×t, where m is the real-time leakage amount, Q is the mass flow rate, and t is the monitoring time.
7. The method for identifying leakage types and calculating leakage amount in gas pipelines based on acoustic emission according to claim 6, characterized in that, In step S6, the specific method for incremental model update is as follows: S6.1 Input the core feature vector obtained in S2 into the trained model, and simultaneously perform leakage type classification and pore size regression tasks through the shared bottom representation layer. The classification branch outputs the pitting corrosion, crack or fracture type label, and the regression branch outputs the continuous pore size prediction value. S6.2 Based on the dispersion of the prediction results of each base learner in the ensemble model, the Bayesian approximation method is used to estimate the posterior distribution of the prediction, calculate the class probability of the classification task and the prediction variance of the regression task, and output the prediction results including point estimates and confidence intervals.
8. The method for identifying leakage types and calculating leakage amount in gas pipelines based on acoustic emission according to claim 7, characterized in that, In step S7, the specific method for leak identification and prediction is as follows: S7.1 Perform autocorrelation analysis on the original acoustic emission signal to extract the main period and local feature waveforms. Find the matching segment with the highest similarity to the boundary waveform at both ends of the signal. Calculate the extension length dynamically based on the multiple of the main period. Perform bidirectional predictive extension to the front and back ends of the signal respectively. Use a weighted fusion method to smooth the connection between the extension segment and the original boundary. S7.
2. With leakage identification accuracy as the optimization objective, a joint optimization space for the number of modes and the penalty factor is established. Parameter boundary constraints and discretized grids are set. The fitness function is constructed by introducing leakage feature preservation degree and computational efficiency. An improved optimization algorithm is used to simultaneously evaluate the fitness of multiple parameter combinations on a parallel architecture. After iterative convergence to the optimal solution, the optimal number of modes and penalty factor are output. Variational mode decomposition is performed on the extended signal to obtain the intrinsic mode function.
9. The method for identifying leakage types and calculating leakage amount in gas pipelines based on acoustic emission according to claim 8, characterized in that, In step S8, the specific method for calculating the leakage amount is as follows: S8.
1. Use a sliding time window to extract data during periods without leakage, calculate the mean and standard deviation of the background noise permutation entropy online to establish a noise statistical model, and dynamically calculate the entropy threshold based on the three sigma criterion; classify the components obtained from variational mode decomposition into three categories according to the relationship between entropy and threshold: effective signal, suspicious transition, and noise-dominated. S8.
2. Valid signal classes are directly retained, noise-dominant classes are denoised using wavelet soft thresholding, and suspicious transition classes are weighted and fused using a membership function. After reconstructing the signal, the signal-to-noise ratio and leakage feature retention are calculated. The power exponent parameter of the wavelet thresholding function is dynamically adjusted based on the dual-index feedback, and the denoised signal is output.
10. The method for identifying leakage types and calculating leakage amount in gas pipelines based on acoustic emission according to claim 9, characterized in that, In step S9, the specific method for closed-loop global optimization is as follows: S9.
1. The deviation between the cumulative leakage obtained from S5 and the standard measurement value is used as the system measurement error. The error is traced back along the processing flow to key control points such as mode decomposition parameters, dynamic thresholds and feature weights. The current operating condition state vector and parameter configuration are extracted to construct a feedback environment that includes error signals, state space and adjustable parameters. S9.
2. With minimizing long-term measurement error as the optimization objective, a reinforcement learning algorithm is used to train the policy network. The agent outputs adjustment actions for parameters such as modality number, penalty factor and entropy threshold according to the current state. It accumulates rewards and updates the policy through environmental interaction, thereby achieving adaptive optimization of system-level parameters.