Ultrasonic gas meter time sampling method aiming at pulsating flow influence

Through random time sampling and multi-level abnormality detection technology, the metering error problem of ultrasonic gas meter under pulsating flow is solved, achieving higher flow sampling accuracy and data processing robustness.

CN120293248APending Publication Date: 2025-07-11ZENNER METERING TECH (SHANGHAI) LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510484837.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-17
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

When traditional ultrasonic gas meters face pulsating flow, the metering accuracy is disturbed, and the prior art is difficult to effectively deal with complex flow modes, resulting in insufficient accumulation of metering errors and insufficient robustness in data processing.

Method used

Random time sampling method is used, and random number sequences and dynamic time step modulation are generated in combination with linear congruence method to avoid fixed periodic interference; the main frequency of the pulsating flow is extracted through Fourier transform and the sampling time is dynamically adjusted; multi-level anomaly detection and weighted correction technology are used to eliminate outliers and optimize data.

Benefits of technology

Significantly reduce the impact of periodic interference on the sampled data, improve the accuracy and stability of traffic sampling, and enhance the robustness of data processing and the reliability of measurement results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120293248A_ABST
    Figure CN120293248A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of gas metering, and discloses an ultrasonic gas meter time sampling method aiming at pulsating flow influence, comprising the following steps: S1, setting a basic acquisition period and random sampling related parameters; s2, sampling time is dynamically generated through a random algorithm, and interference matching of a fixed period is avoided; s3, collecting instantaneous flow at the generated random sampling time point; s4, abnormal value detection and elimination are carried out on the collected instantaneous flow data; s5, correcting the flow data after the abnormity is eliminated, and calculating the corrected instantaneous flow; and S6, outputting the corrected instantaneous flow, and adjusting random sampling parameters and exception handling rules based on historical data feedback. According to the method, through a dynamic adjustment method in combination with the flow fluctuation amplitude, the sampling time distribution is more flexible and uniform, different flow modes are adapted, the influence of periodic interference on the sampling data can be remarkably reduced, and the accuracy and the stability of instantaneous flow sampling are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of gas metering, and particularly to a time sampling method for an ultrasonic gas meter in response to the influence of pulsating flow. Background Art

[0002] As an important metering device in the gas transmission and distribution system, the metering accuracy of a gas meter directly affects the gas consumption cost of users and the revenue of gas enterprises. Ultrasonic gas meters have become an important choice in the current gas metering field due to their advantages of no mechanical moving parts, low pressure loss, and high accuracy. However, in practical applications, complex flow patterns, especially pulsating flow, pose a severe challenge to the metering accuracy of ultrasonic gas meters. Pulsating flow is a periodic flow fluctuation phenomenon, often caused by reasons such as the start and stop of gas equipment, pipe network structure, or pressure fluctuations. Traditional fixed-period sampling methods are prone to interference matching with the main frequency of pulsating flow, resulting in distorted sampling data and thus causing the accumulation of metering errors.

[0003] To solve the above problems, solutions for improving sampling algorithms and data processing methods have been proposed in the prior art. For example, some techniques use frequency analysis to preprocess pulsating flow, but they rely on complex computing devices and are difficult to be efficiently implemented in embedded gas meters; Other solutions attempt to avoid pulsating flow interference by fixedly adjusting the sampling period or increasing the sampling frequency, but this usually cannot adapt to complex flow scenarios and increases the energy consumption and hardware burden of the system. At the same time, for the problem of outliers in data processing, the prior art mostly uses simple elimination methods or fixed rules for processing, which are difficult to flexibly handle high-fluctuation and multi-variable flow patterns, and the robustness of the processing results is insufficient, which may further affect the reliability of metering results. Summary of the Invention

[0004] To make up for the above deficiencies, the present invention provides a time sampling method for an ultrasonic gas meter in response to the influence of pulsating flow, aiming to improve the problems that the traditional fixed sampling period method is prone to interference matching and cause the accumulation of metering errors in complex flow patterns such as pulsating flow, and the lack of robustness in abnormal data processing.

[0005] In a first aspect, the present invention provides the following technical solution. A time sampling method for an ultrasonic gas meter in response to the influence of pulsating flow includes the following steps: S1: Set the basic acquisition period and relevant parameters for random sampling; S2: Dynamically generate sampling times using a random algorithm to avoid interference matching of a fixed period; S3: Collect the instantaneous flow rate at the generated random sampling time points; S4: Detect and eliminate outliers from the collected instantaneous flow rate data; S5: Correct the flow data after removing anomalies and calculate the corrected instantaneous flow rate. S6: Output the corrected instantaneous flow rate, and at the same time, adjust the random sampling parameters and anomaly handling rules based on historical data feedback.

[0006] Preferably, the step S2 includes the following steps: Generate a random number sequence using the linear congruence method. The random number generation formula is: ; where are random number generation parameters, which stabilize the long period and uniform distribution characteristics of the random sequence; Normalize the generated random numbers; Combine the random numbers with dynamic time step modulation to generate the sampling time. The time step calculation formula is: ; where, is the basic acquisition period, is the instantaneous flow rate fluctuation amplitude, is the historical flow rate mean value, is the modulation coefficient; Calculate the sampling time by combining the normalized random numbers and dynamic step modulation. The formula is:

[0007] where, is the number of time segments.

[0008] Preferably, the step S2 further includes the following steps: Perform Fourier transform on the sampled instantaneous flow rate data to extract the spectral characteristics of the historical flow rate; Calculate the main frequency of the pulsating flow , and the Fourier transform formula is: ; where is the instantaneous flow rate data; Dynamically adjust the random number generation parameters according to the main frequency of the pulsating flow , and optimize the random sampling time distribution to avoid the interference periods related to the main frequency.

[0009] Preferably, the step S4 includes the following steps: Perform local anomaly detection on the collected instantaneous flow rate data, and calculate the quartiles and the interquartile range , and the interquartile range calculation formula is: ; The outlier range is defined as: Outlier or outlier ; Combined with the sliding window method for global outlier detection, the local deviation calculation formula is: ; Where is the mean value of the flow data within the sliding window. When the local deviation , it is marked as an outlier, where is the preset detection threshold.

[0010] Preferably, the steps S4 and S5 include: Dynamically adjust the rejection value according to the detected outlier ratio. The rejection quantity calculation formula is: ; Where is the total number of samples, is the outlier ratio, is the maximum allowable rejection number; Perform weighted correction on the flow data after removing outliers. The correction formula is: ; Where the weight The calculation formula is: ; is a constant to avoid a zero denominator.

[0011] Preferably, the step S6 includes: Output the corrected instantaneous flow value: Based on historical flow fluctuations and outlier distributions, dynamically adjust the random sampling parameter and the detection threshold in the outlier detection rule and the rejection ratio Apply the updated parameters to the time sampling and data processing of the next cycle.

[0012] In a second aspect, the present invention provides the following technical solution. An ultrasonic gas meter time sampling system for pulsating flow influence, the system includes: A parameter initialization module for setting the system basic parameters and default thresholds; A random sampling module for generating random sampling time points and dynamically optimizing the sampling time distribution; A data acquisition module for collecting instantaneous flow data according to the random time points and storing them as a flow sequence; An outlier detection module for detecting and marking outliers in the flow sequence; The data correction module is used to eliminate outliers and perform weighted correction on the flow data; The data output and feedback optimization module is used to output the corrected flow data and dynamically adjust the system parameters.

[0013] In a third aspect, the present invention provides the following technical solution. A computer device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the above-mentioned ultrasonic gas meter time sampling method for pulsating flow influence.

[0014] In a fourth aspect, the present invention provides the following technical solution. A readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the above-mentioned ultrasonic gas meter time sampling method for pulsating flow influence.

[0015] The present invention has the following beneficial effects: 1. In the present invention, by combining the dynamic adjustment method of flow fluctuation amplitude, the sampling time distribution is made more flexible and uniform, adapting to different flow patterns, and can significantly reduce the influence of periodic interference on the sampling data, improving the accuracy and stability of instantaneous flow sampling.

[0016] 2. In the present invention, outliers are accurately identified through a multi-level anomaly detection method, and the weighted correction technology is combined to optimize the calculated data after elimination, making the finally generated flow value closer to the actual flow characteristics, improving the robustness of data processing and the reliability of measurement results. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a method flow chart of an ultrasonic gas meter time sampling method for pulsating flow influence proposed by the present invention; Figure 2 It is a system architecture diagram of an ultrasonic gas meter time sampling system for pulsating flow influence proposed by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0018] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Apparently, the described embodiments are only a part of the embodiments of the present invention, rather than all of them. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments of the present invention belong to the protection scope of the present invention.

[0019] Embodiment 1 Refer to Figure 1, in the first embodiment of the present invention, the present invention provides an ultrasonic gas meter time sampling method for pulsating flow influence, including the following steps: S1: Set the basic acquisition period and random sampling related parameters; Specifically, the basic acquisition period is a key parameter for controlling the sampling interval, usually defaulting to 500 milliseconds, but can be adjusted according to the actual flow fluctuation characteristics in specific cases to adapt to different gas flow patterns.

[0020] Meanwhile, the setting of random sampling parameters provides input for the subsequent random sampling module. These parameters include the random number generation parameters in the linear congruence method , and appropriate values need to be selected to ensure that the generated random number sequence has a long periodicity and good distribution uniformity.

[0021] Preferably, the parameters and need to satisfy and is relatively prime to , ensuring that the random number sequence traverses all possible value ranges. In addition, to enhance the dynamics of random sampling time points, a time step modulation parameter needs to be set, including the step modulation coefficient , the instantaneous flow fluctuation amplitude and the historical flow mean . The formula for step modulation is , where is an empirical adjustment parameter, usually set in the range of 0.1 to 0.5 to ensure moderate modulation sensitivity without causing temperature fluctuations.

[0022] By adjusting the step size, the system can dynamically adapt to the change amplitude of the flow, making the sampling time point distribution more random and uniform, thereby reducing the probability of matching with the pulsating flow volume. In the initialization stage, thresholds also need to be preset for the anomaly detection module, including the box plot parameters (quartiles and the interquartile range ) for local detection and the deviation threshold for global detection with a sliding window. These parameters can be set through statistical analysis of historical flow data and dynamically adjusted during the system operation to improve the robustness and accuracy of anomaly detection. After completing the parameter initialization, the system will generate time points for the random sampling module.

[0023] The acquisition module triggers sampling, and the anomaly detection module marks the outliers to provide unified standards and rules, thus enabling the orderly cooperation of each module. The implementation of this step ensures the flexibility and reliability of the system operation in adapting to complex traffic patterns. Through reasonable parameter settings, the present invention can effectively reduce the interference of pulsatile flow and improve the accuracy and stability of flow measurement.

[0024] S2: Dynamically generate the sampling time using a random algorithm to avoid the interference matching of a fixed period; including the following steps: Use the linear congruence method to generate a random number sequence, and the random number generation formula is: ; where are random number generation parameters, which stabilize the long-period and uniform distribution characteristics of the random sequence; Normalize the generated random numbers; Combine the random numbers with dynamic time step modulation to generate the sampling time, and the time step calculation formula is: ; where, is the basic acquisition period, is the instantaneous flow rate fluctuation amplitude, is the historical flow rate mean value, is the modulation coefficient; Combine the normalized random numbers and dynamic step modulation to calculate the sampling time, and the formula is: ; where, is the number of time segments.

[0025] In addition, perform Fourier transform on the sampled instantaneous flow rate data to extract the spectral characteristics of the historical flow rate; Calculate the main frequency of the pulsatile flow , and the Fourier transform formula is: ; where is the instantaneous flow rate data; Dynamically adjust the random number generation parameters according to the main frequency of the pulsatile flow , and optimize the random sampling time distribution to avoid the interference period related to the main frequency.

[0026] Specifically, in the specific implementation, first use the linear congruence method to generate a random number sequence, and the random number generation formula is , where is the current random number, are random number generation parameters, and by selecting appropriate ensure that the random sequence has long-period and uniform distribution characteristics; Subsequently, the generated random numbers are normalized, and the normalization formula is , which normalizes the random numbers to the interval [0, 1], providing a unified reference scale for the calculation of subsequent sampling time points.

[0027] On this basis, the sampling time interval is adjusted by dynamic time step modulation. The time step calculation formula is , where is the basic acquisition period, is the instantaneous flow rate fluctuation amplitude, is the historical flow rate mean value, is the modulation coefficient, used to control the step modulation sensitivity. Combining the normalized random numbers and dynamic time step modulation, the calculation formula for the sampling time is , where is the number of time segments. By further refining the time step range, the randomness and uniformity of the sampling time are enhanced.

[0028] To further improve the ability to resist pulsating flow interference, the spectral characteristics of the instantaneous flow rate are extracted through Fourier transform. The Fourier transform formula is , where is the instantaneous flow rate data, and the main frequency of the pulsating flow is analyzed .

[0029] The random number generation parameters are dynamically adjusted according to the main frequency information , optimizing the sampling time distribution, so that the sampling time avoids the interference periods related to the main frequency, thereby further reducing the measurement error caused by periodic interference.

[0030] S3: Collect the instantaneous flow rate at the generated random sampling time points; Specifically, the acquisition module receives the sampling time point sequence generated by the random sampling module , and acquires the current instantaneous flow rate data at each sampling time point according to the preset hardware or software trigger mechanism .

[0031] The acquisition module needs to work in coordination with the signal processing unit of the ultrasonic flowmeter to ensure the transmission, reception, and time difference calculation of ultrasonic signals within the specified time points, generating the instantaneous flow rate values related to the flow rate . These instantaneous flow rate values are stored as a flow rate sequence in chronological order , for use by the subsequent anomaly detection module.

[0032] When designing the acquisition module, its trigger delay and sampling error need to be ensured to be within the specified range to avoid distortion of sampling data caused by hardware delay or timing deviation. In addition, to improve the reliability of data acquisition, the acquisition module should have the ability to handle signal interference and environmental noise. The sampling data can be preprocessed through filtering algorithms to eliminate obvious transient outliers or noise signals.

[0033] S4: Detect and eliminate outliers from the collected instantaneous flow data; S5: Correct the flow data after eliminating outliers and calculate the corrected instantaneous flow; Perform local outlier detection on the collected instantaneous flow data, and calculate the quartiles based on the box plot rule and the interquartile range , and the formula for calculating the interquartile range is: ; The outlier range is defined as: Outlier or outlier ; Combined with the sliding window method for global outlier detection, the formula for calculating the local deviation is: ; Where is the mean value of the flow data within the sliding window. When the local deviation , it is marked as an outlier, where is the preset detection threshold.

[0034] Dynamically adjust the elimination value according to the detected outlier ratio. The formula for calculating the elimination quantity is: ; Where is the total number of samples, is the outlier ratio, is the maximum allowable number of eliminations; Perform weighted correction on the flow data after eliminating outliers. The correction formula is: ; Where the weight is calculated by the formula: ; is a constant to avoid a zero denominator.

[0035] Specifically, first, in local outlier detection, calculate the quartiles and of the flow data based on the box plot rule, as well as the interquartile range , and the calculation formula is 。The range of outliers is defined as the outlier or the outlier 。

[0036] Through the box plot rule, the outliers in the data sequence can be effectively identified, providing a reference for subsequent global detection and elimination. In addition, combined with the sliding window method for global anomaly detection, the local flow deviation is calculated within the window , where is the mean value of the flow data within the sliding window. If the local deviation , then this data is marked as an outlier, where is the preset detection threshold, used to control the sensitivity of the detection.

[0037] For the detected abnormal data, the elimination quantity is dynamically adjusted according to the abnormal proportion. The calculation formula for the elimination quantity is , where is the total number of samples, is the abnormal proportion, is the maximum allowable number of eliminations to ensure the flexibility and adaptability of the elimination process.

[0038] After eliminating the outliers, the remaining data is corrected using the weighted correction method. The correction formula is , where the weight The calculation formula of is is a constant used to avoid a zero denominator. The weighted correction method fully considers the deviation degree of the remaining data and optimizes the calculation result by assigning different weights. The finally generated corrected flow value can reflect the change of the real flow.

[0039] S6: Output the corrected instantaneous flow, and at the same time, adjust the random sampling parameters and anomaly handling rules based on historical data feedback. Output the corrected instantaneous flow value: Based on the historical flow fluctuation and anomaly distribution, dynamically adjust the random sampling parameters and the detection threshold in the anomaly detection rule and the elimination ratio The updated parameters are applied to the time sampling and data processing of the next cycle.

[0040] Specifically, after the data processing is completed, output the corrected instantaneous flow value , which has passed the anomaly detection and weighted correction and can accurately reflect the actual flow situation at the current time point.

[0041] Meanwhile, the system analyzes the historical flow fluctuation and anomaly distribution, and according to the flow fluctuation amplitude 、historical average flow and abnormal proportion etc., dynamically adjust random sampling parameters such as time step and the number of time segments , to optimize the time distribution of sampling.

[0042] In addition, based on the characteristics of abnormal data distribution, the key thresholds in the anomaly detection rules are dynamically modified. and culling ratio ,Ensure that the detection sensitivity and rejection strategy can adapt to the needs of different traffic patterns.,All updated parameters are applied in real time to the time sampling and data processing of the next cycle, forming a closed-loop optimization mechanism, which enables the system to continuously self-adjust during operation, adapt to environmental changes and improve measurement stability.

[0043] Embodiment 2: Reference Figure 2 In a second embodiment of the present invention, the present invention provides an ultrasonic gas meter time sampling system for pulsating flow, the system comprising: The parameter initialization module is used to set the basic system parameters and default thresholds; The random sampling module is used to generate random sampling time points and dynamically optimize the sampling time distribution; The data collection module is used to collect instantaneous flow data at random time points and store them as flow sequences; The anomaly detection module is used to detect and mark anomalies in the traffic sequence; The data correction module is used to remove outliers and perform weighted correction on traffic data; The data output and feedback optimization module is used to output corrected flow data and dynamically adjust system parameters.

[0044] Specifically, when the system starts, the parameter initialization module first sets the basic parameters of the system, including the acquisition cycle, the random number generation parameters required for random sampling, and the key thresholds in the anomaly detection rules. These parameters are distributed to the random sampling module and the anomaly detection module through the shared interface between modules to ensure the coordination of the initial operation of the system. The initialization module also provides a dynamic parameter update interface for other modules to support real-time parameter adjustment during system operation.

[0045] After receiving the random number generation parameters and acquisition cycle provided by the parameter initialization module, the random sampling module uses the random number generation algorithm to generate a sequence of random sampling time points. These time points are not only highly random, but also optimize the distribution uniformity through dynamic step modulation to ensure that the sampling time is staggered with the interference cycle of the pulsating flow. The generated time points are passed to the data acquisition module to trigger subsequent flow sampling operations.

[0046] The data acquisition module accurately triggers the sampling operation at the time points provided by the random sampling module, and collects the instantaneous flow rate data through the signal processing unit of the ultrasonic gas meter. The collected data is stored as a flow rate sequence in chronological order and serves as the input for the anomaly detection module. The data acquisition module needs to ensure the accuracy of the sampling time and the integrity of data storage to provide high-quality flow rate data.

[0047] After receiving the flow rate sequence, the anomaly detection module performs anomaly detection on the data using local rules and global analysis. Local detection identifies the outliers that deviate from the statistical law in the flow rate sequence, and global analysis marks the anomaly points according to the data change trend. After marking is completed, the anomaly detection module transfers the outliers and the cleaned data sequence to the data correction module.

[0048] The data correction module removes the outliers marked by the anomaly detection module and performs weighted correction on the remaining data, and outputs the corrected instantaneous flow rate value. The corrected data not only removes the interference of the outliers, but also further optimizes the accuracy and robustness of the data through the weighted algorithm. The corrected flow rate value is transferred to the data output and feedback optimization module for final output.

[0049] The data output and feedback optimization module receives the corrected instantaneous flow rate value, outputs it to the gas metering system, and dynamically adjusts the parameters of the random sampling module and the anomaly detection module according to the historical flow rate data. For example, when it is detected that the flow rate fluctuates greatly, the system will adjust the sampling time distribution and the anomaly detection threshold to adapt to the new flow rate characteristics. The optimized parameters are applied to the operation of the next cycle through the feedback mechanism, forming a dynamic closed-loop adaptive system.

[0050] Embodiment III In the third embodiment of the present invention, based on the same inventive concept, a computer-readable storage medium is proposed by the present invention. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a method for time sampling of an ultrasonic gas meter for pulsating flow influence in the above embodiment are implemented.

[0051] Embodiment IV In the fourth embodiment of the present invention, based on the same inventive concept, a computer device is proposed by the present invention. The computer device includes: a processor and a memory; the processor and the memory communicate with each other; the memory is used to store instructions; the processor is used to execute the instructions in the memory to execute a method for time sampling of an ultrasonic gas meter for pulsating flow influence in the above embodiment.

[0052] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one of the following techniques well known in the art or a combination thereof can be used: discrete logic circuits having logic gate circuits for implementing logic functions on data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), and the like.

[0053] Finally, it should be noted that the above are only preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. An ultrasonic gas meter time sampling method for the influence of pulsating flow, characterized in that, It includes the following steps: S1: Set the basic acquisition period and relevant parameters for random sampling; S2: Dynamically generate sampling times using a random algorithm to avoid interference matching in a fixed period; S3: Collect instantaneous flow rates at the generated random sampling time points; S4: Detect and remove outliers from the collected instantaneous flow rate data; S5: Correct the flow rate data after removing outliers and calculate the corrected instantaneous flow rate; S6: Output the corrected instantaneous flow rate, and at the same time, adjust the random sampling parameters and outlier handling rules based on historical data feedback.

2. The ultrasonic gas meter time sampling method for the influence of pulsating flow according to claim 1, wherein, The step S2 includes the following steps: Use the linear congruence method to generate a random number sequence, and the random number generation formula is: R n+1 = (a·R n + c) mod m where a, c, and m are random number generation parameters, with the long-period and uniform distribution characteristics of a stable random sequence; Normalize the generated random numbers; Generate sampling times by combining the random numbers with dynamic time step modulation, and the time step calculation formula is: Among them, T base is the basic acquisition period, ΔV is the instantaneous flow fluctuation amplitude, is the historical flow mean value, and α is the modulation coefficient; Calculate the sampling time by combining the normalized random numbers and dynamic step modulation, and the formula is: where k is the number of time segments.

3. A time sampling method for an ultrasonic gas meter against the influence of pulsating flow according to claim 1, characterized in that The step S2 further includes the following steps: Perform Fourier transform on the sampled instantaneous flow rate data to extract the spectral characteristics of historical flow rates; Calculate the main frequency f of the pulsating flow pulse , and the Fourier transform formula is as follows: where V(t) is the instantaneous flow rate data; Dynamically adjust the random number generation parameters a, c, and m according to the main frequency of the pulsating flow to optimize the random sampling time distribution, so that the sampling time avoids the interference periods related to the main frequency.

4. A time sampling method for an ultrasonic gas meter against the influence of pulsating flow according to claim 1, characterized in that The step S4 includes the following steps: Perform local outlier detection on the collected instantaneous flow rate data, calculate the quartiles Q1, Q3, and the interquartile range IQR based on the box plot rule, and the calculation formula for the interquartile range is: IQR = Q3 - Q1 The outlier range is defined as: Outlier < Q1 - 1.5·IQR or outlier > Q3 + 1.5·IQR; Perform global outlier detection by combining the sliding window method, and the local deviation calculation formula is: Among them is the mean value of the traffic data within the sliding window. When the local deviation ΔV i > θ, it is marked as an outlier, where θ is the preset detection threshold.

5. A time sampling method for an ultrasonic gas meter against the influence of pulsating flow according to claim 1, characterized in that The steps S4 and S5 include: Dynamically adjust the rejection value according to the detected outlier ratio, and the calculation formula for the rejection quantity is: n = min(N total ·p, N max ) where N total is the total number of samples, p is the abnormal ratio, and N max is the maximum allowable number of rejections; Perform weighted correction on the flow rate data after removing outliers, and the correction formula is: Among them, the weight w i The calculation formula is as follows: ∈ is a constant to avoid a zero denominator.

6. A time sampling method for an ultrasonic gas meter against the influence of pulsating flow according to claim 1, characterized in that The step S6 includes: Output the corrected instantaneous flow rate value: Dynamically adjust the random sampling parameter T based on historical traffic fluctuations and abnormal distributions step , k, the detection threshold θ and the rejection ratio p in the anomaly detection rule; Apply the updated parameters to the time sampling and data processing of the next cycle.

7. An ultrasonic gas meter time sampling system for the influence of pulsating flow, characterized in that For applying the ultrasonic gas meter time sampling method for pulsating flow influence described in any one of claims 1 - 6, the system includes: A parameter initialization module for setting the system basic parameters and default thresholds; A random sampling module for generating random sampling time points and dynamically optimizing the sampling time distribution; A data acquisition module for collecting instantaneous flow rate data at random time points and storing it as a flow rate sequence; An outlier detection module for detecting and marking outliers in the flow rate sequence; A data correction module for removing outliers and performing weighted correction on the flow rate data; A data output and feedback optimization module for outputting the corrected flow rate data and dynamically adjusting the system parameters.

8. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the ultrasonic gas meter time sampling method for pulsating flow influence described in any one of claims 1 to 6.

9. A readable storage medium, characterized in that, A computer program is stored on the readable storage medium, and when the computer program is executed by a processor, it implements an ultrasonic gas meter time sampling method for pulsating flow influence according to any one of claims 1 to 6.

Citation Information

Cited By

  • Ultrasonic water meter metering method, equipment and medium

    CN120846436A