A method and system for optimizing performance testing of an ultrasonic gas meter
By constructing a probabilistic model of user gas consumption and hierarchical decision-making, the timeliness and accuracy of detecting minute leaks in ultrasonic gas meters are solved, enabling timely detection and differentiation of minute leaks, and improving the safety of gas detection and energy utilization efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG WEIXING INTELLIGENT METER STOCK
- Filing Date
- 2025-12-30
- Publication Date
- 2026-05-29
AI Technical Summary
Existing ultrasonic gas meters cannot detect minute leaks in a timely manner and are prone to false detections, especially in distinguishing between minute leaks and low-flow standby operation.
By collecting historical data from gas meters for dynamic zero-point calibration, a probabilistic model of user gas consumption is constructed. This model combines time domain, frequency domain, and correlation characteristics to make hierarchical decisions, determine whether there is a minor leak, and send a valve closing command when a leak is detected.
It enables timely detection and differentiation of minute leaks, improves the safety of gas detection, and avoids energy waste.
Smart Images

Figure CN122108313A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of gas equipment technology, and in particular to a method and system for performance testing and optimization of ultrasonic gas meters. Background Technology
[0002] Ultrasonic gas meters are measuring instruments that use ultrasonic principles to measure gas flow. Through fully electronic metering, they feature high accuracy, wide measurement range, and maintenance-free operation. They also integrate safety monitoring functions and, through IoT technology, transform from a simple metering tool into a smart sensing terminal within a gas safety network. Currently, ultrasonic gas meters can compensate for measurement data as needed, resulting in more accurate gas measurement results.
[0003] However, current technology cannot detect minute leaks that may exist in some gas meters in a timely manner. Even if a minute leak is detected, there is still a possibility of false detection between the minute leak and the device's low-flow standby mode. Summary of the Invention
[0004] To address the problems existing in the prior art, embodiments of the present invention provide a method and system for optimizing the performance testing of ultrasonic gas meters.
[0005] This invention provides a method for optimizing the performance of an ultrasonic gas meter, the method comprising:
[0006] Historical data of gas meters are collected and dynamic zero-point calibration is performed to obtain the time series of historical flow data after calibration. In this way, a probabilistic model of user gas consumption is constructed. The probabilistic model outputs the gas consumption period / non-gas consumption period judgment based on the time point.
[0007] When the output of the probabilistic model is a non-gas usage period, the current gas flow rate is obtained. If the gas flow rate is greater than the micro-leakage threshold, a micro-leakage is determined based on the stability of the gas flow rate.
[0008] When the output of the probabilistic model is the gas usage period, the current gas flow rate is obtained, and it is determined whether the gas flow rate is greater than the micro-leakage threshold. If so, the time domain characteristics, frequency domain characteristics, and correlation characteristics of the gas flow rate are obtained, and a hierarchical decision is made based on these to determine whether a micro-leakage has occurred.
[0009] When a minor leak is detected, a valve shut-off command is sent and connected to the relevant platform and the bound user via the Internet of Things.
[0010] In one embodiment, the method further includes:
[0011] When it is detected that the gas flow rate in the historical data is less than the idle threshold and the fluctuation is less than the fluctuation threshold in a continuous time period, the median is calculated by taking multiple sampling points.
[0012] The median is fused with the global zero offset in the historical data to determine the calibration offset, and the historical flow data in the time series is calibrated based on this.
[0013] In one embodiment, the method further includes:
[0014] The historical traffic data is discretized into time slots according to the time series, and the characteristics of the sampled values of each time slot are detected, including whether the sampled values are higher than the activity threshold, and the median, percentile and standard deviation of the sampled values of each time slot are calculated.
[0015] Based on the features of the sampled values, the feature vector of the time slot under each time period is determined, and time series clustering is performed. In this way, the time series of historical traffic data is clustered according to the time period, the date set under each cluster label is determined, and the label grouping is performed.
[0016] In one embodiment, the method further includes:
[0017] Calculate the standard deviation of the gas flow rate during the confirmation period, and detect whether the standard deviation approaches zero during the confirmation period, wherein the confirmation period is longer than the sampling time of the current gas flow rate.
[0018] In one embodiment, the method further includes:
[0019] Level 1: Detect whether the gas flow rate corresponds to a strong rule type among the time domain features, frequency domain features, and correlation features. If yes, trigger the rule result of the strong rule; otherwise, trigger Level 2.
[0020] Second, a pre-trained deep learning model is used to determine whether the gas flow rate has a corresponding classification category, and the confidence level of the corresponding classification category.
[0021] Level 3: When the gas flow rate does not have a corresponding determination type, or the confidence level of the determination type is lower than the preset confidence threshold, the gas flow rate is uploaded to the cloud.
[0022] This invention provides a performance testing and optimization system for ultrasonic gas meters, the system comprising:
[0023] The data acquisition module is used to collect historical data from the gas meter and perform dynamic zero-point calibration to obtain the time series of the calibrated historical flow data, thereby constructing a probabilistic model of the user's gas consumption. The probabilistic model outputs the gas consumption period / non-gas consumption period judgment based on the time point.
[0024] The determination module is used to obtain the current gas flow rate when the output of the probabilistic model is a non-gas usage period, and determine whether a minor leak has occurred based on whether the gas flow rate is greater than the micro-leakage threshold. If so, it determines whether a micro-leakage has occurred based on the stability of the gas flow rate.
[0025] The decision module is used to obtain the current gas flow rate when the output of the probabilistic model is the gas usage period, determine whether the gas flow rate is greater than the micro-leakage threshold, and if so, obtain the time domain characteristics, frequency domain characteristics and correlation characteristics of the gas flow rate, and make a hierarchical decision based on these to determine whether a micro-leakage has occurred.
[0026] The early warning module is used to send a valve shut-off command when a minor leak is detected, and then connect it to the relevant platform and the bound user via the Internet of Things.
[0027] In one embodiment, the system further includes:
[0028] The detection module is used to calculate the median of gas flow rate from multiple sampling points when the gas flow rate in the historical data is less than the idle threshold and the fluctuation is less than the fluctuation threshold in a continuous time period.
[0029] The calibration module is used to fuse the median with the global zero offset in the historical data to determine the calibration offset, and calibrate the historical flow data in the time series based on this.
[0030] In one embodiment, the system further includes:
[0031] The discrete module is used to discretize the historical traffic data into time slots according to the time series, detect the characteristics of the sampled values of each time slot, including whether the sampled values are higher than the activity threshold, and calculate the median, percentile and standard deviation of the sampled values of each time slot.
[0032] The clustering module is used to determine the feature vector of the time slot in each time period based on the features of the sampled values, and to perform time series clustering. This allows the time series of historical traffic data to be clustered according to time periods, and the date set under each cluster label to be determined and grouped by label.
[0033] This invention provides an electronic device, including a processor and a memory;
[0034] The processor is connected to the memory;
[0035] The memory is used to store executable program code;
[0036] The processor runs a program corresponding to the executable program code stored in the memory to perform the methods described in one or more embodiments.
[0037] This invention provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the above-described performance testing optimization method for ultrasonic gas meters.
[0038] In view of the above, in one or more embodiments of this specification, historical data of the gas meter is collected and dynamic zero-point calibration is performed to obtain the time series of the calibrated historical flow data. This data is used to construct a probabilistic model of the user's gas consumption. The probabilistic model outputs a gas consumption period / non-gas consumption period judgment based on a specific time point. When the probabilistic model outputs a non-gas consumption period, the current gas flow rate is obtained. Based on whether the gas flow rate exceeds a minor leakage threshold, if so, a minor leakage is determined based on the stability of the gas flow rate. When the probabilistic model outputs a gas consumption period, the current gas flow rate is obtained, and it is determined whether the gas flow rate exceeds a minor leakage threshold. If so, the time domain characteristics, frequency domain characteristics, and correlation characteristics of the gas flow rate are obtained, and a hierarchical decision is made based on these to determine whether a minor leakage has occurred. When a minor leakage is determined, a valve closing command is sent and linked to the relevant platform and bound user via the Internet of Things. This allows for targeted gas detection for different users at different times, distinguishing between minor leaks and low-flow standby conditions in the detection results, and enabling subsequent safety handling, thus improving usage safety and avoiding energy waste. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 This is a flowchart illustrating a performance testing and optimization method for an ultrasonic gas meter, provided in one embodiment of this specification.
[0041] Figure 2 This is a schematic diagram of the structure of a performance testing and optimization system for an ultrasonic gas meter provided in one embodiment of this specification.
[0042] Figure 3 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this specification. Detailed Implementation
[0043] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed merely to enable those skilled in the art to better understand and implement the subject matter described herein, and are not intended to limit the scope, applicability, or examples set forth in the claims. The function and arrangement of the elements discussed may be changed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the various examples. For example, the described methods may be performed in a different order than described, and steps may be added, omitted, or combined. Furthermore, features described in some examples may be combined in other examples.
[0044] As used herein, the term "comprising" and its variations are open terms meaning "including but not limited to". The term "based on" means "at least partially based on". The terms "one embodiment" and "an embodiment" mean "at least one embodiment". The term "another embodiment" means "at least one other embodiment". The terms "first", "second", etc., may refer to different or the same objects. Other definitions, whether explicit or implicit, may be included below. Unless explicitly indicated by the context, the definition of a term shall remain consistent throughout the specification.
[0045] like Figure 1 As shown, this embodiment of the invention provides a performance testing and optimization method for ultrasonic gas meters, including:
[0046] Step S102: Collect historical data of the gas meter and perform dynamic zero-point calibration to obtain the time series of the calibrated historical flow data, thereby constructing a probabilistic model of the user's gas consumption. The probabilistic model outputs the gas consumption period / non-gas consumption period judgment based on the time point.
[0047] Specifically, relevant data from the gas meter is collected, including the time series of gas volumetric flow rate (fixed sampling intervals), environmental parameters (temperature and pressure at corresponding times), and equipment status (valve on / off status). Based on this data, preprocessing is performed to dynamically calibrate the gas meter to ensure subsequent steps are based on actual gas flow and avoid sensor drift. The specific steps are as follows: The gas volumetric flow rate is detected decreasing from above an idle threshold (used as a zero-point calibration trigger condition to determine if the user is "not actively using gas"; its value is slightly higher than environmental noise but significantly lower than a minor leak threshold). If, for several consecutive time periods, the flow rate is below the idle threshold and the flow fluctuation is minimal (below the fluctuation threshold, tending towards a straight line), it indicates that the user is not actively using gas. Multiple sampling points (generally more than 10) are taken, and the median is calculated as the estimated zero-point offset for the current moment. To smooth out potential random noise in a single estimation and track the slow changes in drift, an exponentially weighted moving average algorithm is used to fuse the current estimated value with historically stored global zero-point offsets, thereby updating to a more robust, time-varying global zero-point offset. Ultimately, the calibrated flow rate at each moment is obtained by subtracting this dynamically updated global zero-point offset from the original flow rate reading at that moment. When the valve in the meter is closed, the system forces the calibrated flow rate to zero, as this represents a physically absolute airflow-free state.
[0048] Furthermore, after calibrating historical flow data, a probabilistic model is constructed to quantitatively describe users' gas usage habits, and "high-confidence non-gas usage periods" are rigorously derived from it. This includes: discretizing historical flow data, dividing the period, such as a day, into N time slots. The choice of N is a comprehensive consideration of accuracy and computational load: for example, N=96 (15 minutes per slot) can balance capturing events (such as a shower, about 2-4 slots) and maintaining data stability. The model calculates whether any sampled value in each time slot exceeds the activity threshold (the activity threshold is higher than the micro-leakage threshold, used to clearly determine whether there is active gas usage), and calculates the median and (95th) percentile of each time slot (reflecting the peak flow level of that period, used to identify the maximum gas usage intensity), and calculates the standard deviation of all sampled values in each time slot to quantify the volatility or stability of gas usage.
[0049] Then, using time series clustering algorithms in unsupervised machine learning, the user's long-term gas usage patterns are summarized. Data for each time period, typically daily, is transformed into a binary 'gas usage status' sequence. Within each time slot, any sample value higher than the activity threshold is recorded as 1, otherwise as 0. Using this N-dimensional binary vector as features, and representing d as an N-dimensional feature vector, K-Shape clustering is performed. Using the cross-correlation coefficient as a similarity measure, sliding comparisons can find the similarity of two sequences after optimal alignment on the time axis, thus determining the number of clusters. This allows determining the inflection point of the sum of squared errors within clusters under different K values, thereby distinguishing between "weekdays," "weekends," and "special occasions." This determines the cluster sequences under each cluster label, and labels are used for grouping. Within each group, such as a specific pattern k (e.g., "weekday pattern"), all days within that pattern set are examined. For each time slot i, it must simultaneously meet the following conditions: single-mode stability (specifically including quantitative conditions such as: 1) flow level condition: the peak flow (e.g., Q95) of this time slot in all historical days is lower than the 'minor leakage threshold'; 2) volatility condition: the historical average (standard deviation) of the flow fluctuation of this time slot is lower than the corresponding stability threshold (a very small value used to exclude the possibility of any regular equipment start-up and shutdown during this period); 3) frequency condition: the percentage of historical days in this time slot where active gas consumption (i.e., 'gas consumption status' is 1) occurs is lower than a certain probability threshold (e.g., 5%), cross-mode comprehensive stability (for a time slot i to be finally identified as a "globally high-confidence non-gas consumption period", the above single-mode judgment conditions must be met in all K lifestyle modes of the user), and continuous stability (isolated non-gas consumption slots (e.g., 30 minutes) have low practical value and are easily affected by accidental events. Therefore, it is usually required that at least L consecutive slots (e.g., = 8, corresponding to 2 hours) are simultaneously determined to be non-gas consumption before they are merged into an effective "non-gas consumption window"). Therefore, based on the above scheme, it is possible to determine more accurately whether the corresponding user's gas usage period is within the corresponding time slot.
[0050] Step S104: When the output of the probabilistic model is a non-gas usage period, obtain the current gas flow rate. If the gas flow rate is greater than the micro-leakage threshold, determine whether a micro-leakage has occurred based on the stability of the gas flow rate.
[0051] Specifically, the current time point is obtained. If the current time falls within a non-gas-use period in the user profile, the current gas flow rate is obtained, and it is determined whether the gas flow rate exceeds the micro-leakage threshold. In practical use, the micro-leakage threshold can be set, for example, to 0.02 cubic meters per hour. Furthermore, if the flow rate exceeds the micro-leakage threshold in every sampling period within M sampling cycles (e.g., M=10, within 10 minutes), a confirmation period can be established, such as extending it to 30 minutes or 1 hour, to calculate the stability of the flow rate. The standard deviation (σ) of the flow rate during the confirmation period is calculated. A true micro-leakage in a pipeline physically manifests as continuous and stable dissipation, with its flow rate curve approximating a straight line (and consistently and stably exceeding the micro-leakage threshold). Therefore, the standard deviation σ should approach zero. If the standard deviation is large, it may indicate the presence of some intermittent interference. Therefore, after the confirmation period is determined, a safety response is immediately initiated. This includes, but is not limited to, shutting off the valve, reporting to the user's bound terminal via the Internet of Things, and the gas company's cloud platform.
[0052] If a leak alarm is ruled out during the confirmation period due to excessive flow fluctuations (σ exceeding the limit) or the average flow not meeting the conditions, this event will be recorded as a 'false trigger'. The relevant data snippet will be saved. After subsequent periodic review by maintenance personnel or confirmation through other channels that there was indeed no leak during this period, this data can be marked as a 'negative sample' for optimizing the parameters of the leak detection algorithm itself (such as fine-tuning the duration M), or, after accumulating multiple similar events, to assess whether it is necessary to fine-tune the user's 'non-gas usage window' profile for updating the user profile data.
[0053] Step S106: When the output of the probabilistic model is the gas usage period, obtain the current gas flow rate, determine whether the gas flow rate is greater than the micro-leakage threshold, and if so, obtain the time domain characteristics, frequency domain characteristics, and correlation characteristics of the gas flow rate, and make a hierarchical decision based on these to determine whether a micro-leakage has occurred.
[0054] Specifically, the current time point is obtained. If the current time falls within the gas usage period specified in the user profile, the current gas flow rate is obtained, and it is determined whether the gas flow rate exceeds the minor leak threshold. Furthermore, if the gas flow rate exceeds the minor leak threshold in every sampling period within M sampling periods (e.g., M=10, within 10 minutes), it is necessary to further determine whether the current gas volumetric flow rate indicates a minor pipeline leak or low-flow standby or operation of the equipment. Three types of features are obtained within the sampling period, forming a corresponding feature vector, including:
[0055] Time-domain characteristics include: stability (σ), the expected σ for minor pipeline leaks is low and non-periodic, while the expected σ for equipment in low-flow standby or operation is high, and even the low σ exhibits periodicity; persistence pattern, the persistence pattern of minor pipeline leaks shows a sudden step change at the beginning, while the persistence pattern of equipment in low-flow standby or operation is usually accompanied by a gentler ramp-up / ramp during equipment start-up / stop; trend, the slope of the linear fit is calculated, the slope of minor pipeline leaks is close to zero; some equipment may have a slow preheating trend before stable operation.
[0056] Frequency domain characteristics are used to perform a Fast Fourier Transform or calculate the autocorrelation function of the flow sequence to find periodic signals hidden in minute fluctuations. For example, a water heater circulation pump or fan may produce regular fluctuations with a period of tens of seconds to several minutes, while a minute leak in a pipe is non-periodic.
[0057] Correlation features can be obtained through IoT gateways to acquire data from relevant devices, such as water meter data. If there is a sudden increase in cold water flow before or during the period of low gas flow, it indicates that the device is operating at a low flow rate. Another example is device energy consumption data, which, if it increases, can also indicate that the device is operating at a low flow rate. Other examples include indoor temperature data, etc.
[0058] The above three characteristics can be used to make a comprehensive decision on whether it is a minor pipeline leak or equipment operating at low flow rates (standby or running). A specific tiered decision-making process can be implemented, for example, using a three-tiered rule-based approach.
[0059] Level 1 determines whether it belongs to a preset strong rule type. For example, if a clear periodic fluctuation (frequency domain characteristic) is detected and the fluctuation pattern matches the operating characteristics of a certain device, it is determined that the device is operating; or if there is a clear water usage event during the same period (correlation characteristic), it is determined that the device is operating; or if the flow rate is absolutely stable (σ is below the limit value) and there are no related events, it is highly determined to be a minor leak (time domain characteristic), and a Level 3 alarm can be triggered directly or in combination with a high confidence level.
[0060] Level 2, Real-time Classifier (Subject Judgment). When strong rule types cannot filter the current situation, inference can be made through a pre-trained machine deep learning model, such as a small neural network. The model can be pre-trained on flow data of "minor leaks" and "equipment standby or operation", and then deployed to the edge computing module or IoT module of the gas meter. The model receives feature vectors and outputs a discrimination category ("minor leak" or "equipment operation") and its corresponding confidence score.
[0061] Level 3, Cloud-based Collaborative Analysis (Complex Situations). When the model's classification confidence is low or questionable, raw data fragments can be uploaded to the cloud. Leveraging the cloud's powerful computing capabilities and comprehensive user history database, more complex analyses can be performed, such as deep sequence pattern matching, regional cross-validation, and expert agreement. Furthermore, upon encountering a Level 3 situation, the results are saved in conjunction with the original data to form a sample library. This sample library is used to periodically retrain and optimize the decision rules and models for Levels 1 and 2. Additionally, when the system confirms that a low-flow pattern represents normal operation of a specific device, the characteristics and timing of this pattern can be fed back as normal behavior to the user profile model in Step 1. This allows for more accurate differentiation between 'gas usage periods' and 'non-gas usage periods' in the future, thereby optimizing the baseline judgment of the entire system.
[0062] Step S108: When a minor leak is detected, a valve closing command is sent and connected to the relevant platform and the bound user via the Internet of Things.
[0063] Specifically, in the preceding steps, regardless of whether it's a gas-consuming or non-consuming period, if a minor leak is detected, an automatic safety response is initiated, closing the valve. This involves the gas meter's built-in microprocessor sending a closing command to the motor-driven valve. Furthermore, during the valve-closing action, a report is uploaded to the gas company's cloud platform via the Internet of Things (IoT), including the user's ID, the time of the leak, a detailed flow curve segment before the leak was detected, the confidence level of the leak, the valve action result, and the meter's geographical location. The user is also notified, either locally via the gas meter alarm or remotely via a linked terminal.
[0064] This invention provides a performance testing optimization method for ultrasonic gas meters. It collects historical gas meter data and performs dynamic zero-point calibration to obtain a time series of calibrated historical flow data. This data is used to construct a probabilistic model of user gas usage. The probabilistic model outputs a gas usage period / non-gas usage period judgment based on time points. When the probabilistic model outputs a non-gas usage period, the current gas flow rate is obtained. If the gas flow rate exceeds a minor leakage threshold, a minor leakage is determined based on the stability of the gas flow rate. When the probabilistic model outputs a gas usage period, the current gas flow rate is obtained, and it is determined whether the gas flow rate exceeds the minor leakage threshold. If so, the time domain characteristics, frequency domain characteristics, and correlation characteristics of the gas flow rate are obtained, and a hierarchical decision is made based on these to determine whether a minor leakage has occurred. When a minor leakage is determined, a valve closing command is sent and linked to the relevant platform and bound user via the Internet of Things (IoT). This allows for targeted gas detection for different users at different times, distinguishing between minor leaks and low-flow standby conditions in the detection results, and enabling subsequent safety handling, thus improving usage safety and avoiding energy waste.
[0065] Please seeFigure 2 , Figure 2 This is a schematic diagram of the structure of a performance testing and optimization system for an ultrasonic gas meter provided in an embodiment of this application. Figure 2 As shown, the system includes:
[0066] The acquisition module S202 is used to acquire historical data of the gas meter and perform dynamic zero-point calibration, obtain the time series of the calibrated historical flow data, and construct a probabilistic model of the user's gas consumption. The probabilistic model outputs the gas consumption period / non-gas consumption period judgment based on the time point.
[0067] The determination module S204 is used to obtain the current gas flow rate when the output of the probabilistic model is a non-gas usage period, and determine whether a minor leak has occurred based on whether the gas flow rate is greater than the minor leak threshold. If so, it determines whether a minor leak has occurred based on the stability of the gas flow rate.
[0068] The decision module S206 is used to obtain the current gas flow rate when the output of the probabilistic model is the gas usage period, determine whether the gas flow rate is greater than the micro-leakage threshold, and if so, obtain the time domain characteristics, frequency domain characteristics and correlation characteristics of the gas flow rate, and make a hierarchical decision based on these to determine whether a micro-leakage has occurred.
[0069] The early warning module S208 is used to send a valve closing command when a minor leak is detected, and to connect to the relevant platform and the bound user via the Internet of Things.
[0070] In another embodiment, a performance testing and optimization system for an ultrasonic gas meter further includes:
[0071] The detection module is used to calculate the median of gas flow rate from multiple sampling points when the gas flow rate in the historical data is less than the idle threshold and the fluctuation is less than the fluctuation threshold in a continuous time period.
[0072] The calibration module is used to fuse the median with the global zero offset in the historical data to determine the calibration offset, and calibrate the historical flow data in the time series based on this.
[0073] In another embodiment, a performance testing and optimization system for an ultrasonic gas meter further includes:
[0074] The discrete module is used to discretize the historical traffic data into time slots according to the time series, detect the characteristics of the sampled values of each time slot, including whether the sampled values are higher than the activity threshold, and calculate the median, percentile and standard deviation of the sampled values of each time slot.
[0075] The clustering module is used to determine the feature vector of the time slot in each time period based on the features of the sampled values, and to perform time series clustering. This allows the time series of historical traffic data to be clustered according to time periods, and the date set under each cluster label to be determined and grouped by label.
[0076] Those skilled in the art will clearly understand that the technical solutions of the embodiments of this application can be implemented by means of software and / or hardware. In this specification, "unit" and "module" refer to software and / or hardware that can independently complete or cooperate with other components to complete a specific function, wherein the hardware may be, for example, a field-programmable gate array (FPGA), an integrated circuit (IC), etc.
[0077] Each processing unit and / or module in the embodiments of this application can be implemented by an analog circuit that implements the functions described in the embodiments of this application, or by software that executes the functions described in the embodiments of this application.
[0078] See Figure 3 It shows a schematic diagram of the structure of an electronic device according to an embodiment of this application, which can be used to implement... Figure 1 The method in the illustrated embodiment. (As shown) Figure 3 As shown, the electronic device 300 may include: at least one processor 301, at least one network interface 304, user interface 303, memory 305, and at least one communication bus 302.
[0079] The communication bus 302 is used to enable communication between these components.
[0080] The user interface 303 may include a display screen and a camera. Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.
[0081] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).
[0082] The processor 301 may include one or more processing cores. The processor 301 connects to various parts within the electronic device 300 using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 305, and by calling data stored in the memory 305. Optionally, the processor 301 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 301 may integrate one or a combination of several of the following: a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), and a modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display on the screen; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 301 and may be implemented as a separate chip.
[0083] The memory 305 may include random access memory (RAM) or read-only memory. Optionally, the memory 305 may include a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 305 may also be at least one storage device located remotely from the aforementioned processor 301. Figure 3 As shown, the memory 305, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and program instructions.
[0084] exist Figure 3In the electronic device 300 shown, the user interface 303 is mainly used to provide an input interface for the user and acquire user input data; while the processor 301 can be used to call the image-based interactive application stored in the memory 305 and specifically perform the following operations: collect historical data of the gas meter and perform dynamic zero-point calibration, obtain the time series of the calibrated historical flow data, and construct a probabilistic model of the user's gas consumption. The probabilistic model outputs a gas consumption period / non-gas consumption period judgment based on the time point; when the probabilistic model outputs a non-gas consumption period, it acquires the current gas flow rate and determines whether a minor leak has occurred based on whether the gas flow rate is greater than the micro-leakage threshold. When the probabilistic model outputs a gas consumption period, it acquires the current gas flow rate and determines whether the gas flow rate is greater than the micro-leakage threshold. If so, it acquires the time domain characteristics, frequency domain characteristics, and correlation characteristics of the gas flow rate, and makes a hierarchical decision based on these to determine whether a micro-leakage has occurred; when a micro-leakage is determined to have occurred, it sends a valve closing command and associates it with the relevant platform and bound user through the Internet of Things.
[0085] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method. The computer-readable storage medium may include, but is not limited to, any type of disk, including floppy disks, optical disks, DVDs, CD-ROMs, microdrives, as well as magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic cards or optical cards, nanosystems (including molecular memory ICs), or any type of medium or device suitable for storing instructions and / or data.
[0086] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0087] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0088] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some service interface; the indirect coupling or communication connection between devices or units may be electrical or other forms.
[0089] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0090] 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 unit can be implemented in hardware or as a software functional unit.
[0091] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0092] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0093] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
Claims
1. A method for performance testing and optimization of an ultrasonic gas meter, the method comprising: Historical data of gas meters are collected and dynamic zero-point calibration is performed to obtain the time series of historical flow data after calibration. In this way, a probabilistic model of user gas consumption is constructed. The probabilistic model outputs the gas consumption period / non-gas consumption period judgment based on the time point. When the output of the probabilistic model is a non-gas usage period, the current gas flow rate is obtained. If the gas flow rate is greater than the micro-leakage threshold, a micro-leakage is determined based on the stability of the gas flow rate. When the output of the probabilistic model is the gas usage period, the current gas flow rate is obtained, and it is determined whether the gas flow rate is greater than the micro-leakage threshold. If so, the time domain characteristics, frequency domain characteristics, and correlation characteristics of the gas flow rate are obtained, and a hierarchical decision is made based on these to determine whether a micro-leakage has occurred. When a minor leak is detected, a valve shut-off command is sent and connected to the relevant platform and the bound user via the Internet of Things.
2. The method according to claim 1, characterized in that, The dynamic zero-point calibration process includes: When it is detected that the gas flow rate in the historical data is less than the idle threshold and the fluctuation is less than the fluctuation threshold in a continuous time period, the median is calculated by taking multiple sampling points. The median is fused with the global zero offset in the historical data to determine the calibration offset, and the historical flow data in the time series is calibrated based on this.
3. The method according to claim 2, characterized in that, The construction of the probabilistic model for user gas consumption includes: The historical traffic data is discretized into time slots according to the time series, and the characteristics of the sampled values of each time slot are detected, including whether the sampled values are higher than the activity threshold, and the median, percentile and standard deviation of the sampled values of each time slot are calculated. Based on the features of the sampled values, the feature vector of the time slot under each time period is determined, and time series clustering is performed. In this way, the time series of historical traffic data is clustered according to the time period, the date set under each cluster label is determined, and the label grouping is performed.
4. The method according to claim 1, characterized in that, The stability determination based on gas flow rate to determine whether a minor leak has occurred includes: Calculate the standard deviation of the gas flow rate during the confirmation period, and detect whether the standard deviation approaches zero during the confirmation period, wherein the confirmation period is longer than the sampling time of the current gas flow rate.
5. The method according to claim 1, characterized in that, The acquisition of time-domain, frequency-domain, and correlation characteristics of gas flow rate, and the subsequent hierarchical decision-making based on these characteristics to determine whether a minor leak has occurred, includes: Level 1: Detect whether the gas flow rate corresponds to a strong rule type among the time domain features, frequency domain features, and correlation features. If yes, trigger the rule result of the strong rule; otherwise, trigger Level 2. Second, a pre-trained deep learning model is used to determine whether the gas flow rate has a corresponding classification category, and the confidence level of the corresponding classification category. Level 3: When the gas flow rate does not have a corresponding determination type, or the confidence level of the determination type is lower than the preset confidence threshold, the gas flow rate is uploaded to the cloud.
6. A performance testing and optimization system for an ultrasonic gas meter, characterized in that, The system includes; The data acquisition module is used to collect historical data from the gas meter and perform dynamic zero-point calibration to obtain the time series of the calibrated historical flow data, thereby constructing a probabilistic model of the user's gas consumption. The probabilistic model outputs the gas consumption period / non-gas consumption period judgment based on the time point. The determination module is used to obtain the current gas flow rate when the output of the probabilistic model is a non-gas usage period, and determine whether a minor leak has occurred based on whether the gas flow rate is greater than the micro-leakage threshold. If so, it determines whether a micro-leakage has occurred based on the stability of the gas flow rate. The decision module is used to obtain the current gas flow rate when the output of the probabilistic model is the gas usage period, determine whether the gas flow rate is greater than the micro-leakage threshold, and if so, obtain the time domain characteristics, frequency domain characteristics and correlation characteristics of the gas flow rate, and make a hierarchical decision based on these to determine whether a micro-leakage has occurred. The early warning module is used to send a valve shut-off command when a minor leak is detected, and then connect it to the relevant platform and the bound user via the Internet of Things.
7. The system according to claim 6, characterized in that, The system also includes: The detection module is used to calculate the median of gas flow rate from multiple sampling points when the gas flow rate in the historical data is less than the idle threshold and the fluctuation is less than the fluctuation threshold in a continuous time period. The calibration module is used to fuse the median with the global zero offset in the historical data to determine the calibration offset, and calibrate the historical flow data in the time series based on this.
8. The system according to claim 6, characterized in that, The system also includes: The discrete module is used to discretize the historical traffic data into time slots according to the time series, detect the characteristics of the sampled values of each time slot, including whether the sampled values are higher than the activity threshold, and calculate the median, percentile and standard deviation of the sampled values of each time slot. The clustering module is used to determine the feature vector of the time slot in each time period based on the features of the sampled values, and to perform time series clustering. This allows the time series of historical traffic data to be clustered according to time periods, and the date set under each cluster label to be determined and grouped by label.
9. An electronic device, comprising a processor and a memory; The processor is connected to the memory; The memory is used to store executable program code; The processor runs a program corresponding to the executable program code stored in the memory to perform the method as described in any one of claims 1-5.
10. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any one of claims 1-5.