Ultrasonic water meter metering abnormity self-checking method based on sound velocity dynamic correction

By alternating the use of ultrasonic waves of different frequencies to measure flow velocity and sound velocity in ultrasonic water meters, and combining this with a flow velocity trend curve compensation strategy, the problem of measurement error caused by scaling is solved, and the self-testing and measurement accuracy of ultrasonic water meters under complex working conditions are improved.

CN121762001APending Publication Date: 2026-03-31NANJING ZIFENG WATER EQUIPMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-13
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

During long-term operation, ultrasonic water meters may experience scale or deposits on the inner wall of the pipe section and the surface of the transducer due to differences in water quality in the water supply network. This can lead to changes in the length of the sound channel and the pipe diameter, making it difficult for the metering system to identify abnormalities and affecting the accuracy of the metering.

Method used

Within a metering cycle, the ultrasonic transducer alternately emits and receives ultrasonic waves of different frequencies, calculates the difference between flow velocity and sound velocity, identifies anomalies by using preset thresholds, and constructs a flow velocity trend curve using historical data for compensation. It also incorporates user-set frequency ratio adjustments to improve self-testing capabilities and metering accuracy.

Benefits of technology

It effectively identifies metering anomalies, ensures the continuity and accuracy of flow data, reduces false alarm rate, adapts to different operating conditions, achieves a balance between self-testing function and power consumption, and improves the reliability and intelligence level of ultrasonic water meters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121762001A_ABST
    Figure CN121762001A_ABST
Patent Text Reader

Abstract

An ultrasonic water meter metering abnormity self-checking method based on sound velocity dynamic correction relates to the technical field of data identification, and comprises the following steps: in a metering period, controlling an ultrasonic transducer to alternately transmit and receive first frequency ultrasonic waves and second frequency ultrasonic waves; according to the flight time data, calculating a first flow velocity, a first sound velocity, a second flow velocity and a second sound velocity; calculating a flow velocity difference value between the first flow velocity and the second flow velocity, and calculating a sound velocity difference value between the first sound velocity and the second sound velocity; when the flow velocity difference value exceeds a preset flow velocity difference value threshold value or the sound velocity difference value exceeds a preset sound velocity difference value threshold value, abnormal state information of abnormal metering in the current metering period is generated; and determining a compensation flow velocity as an effective flow velocity of the current metering period according to a preset compensation strategy. By implementing the application, the metering accuracy of the ultrasonic water meter in a long-term operation state can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of measurement technology, and in particular to a self-testing method for metering anomalies in ultrasonic water meters based on dynamic correction of sound velocity. Background Technology

[0002] Ultrasonic water meters, as a type of fully electronic water meter, utilize the time difference principle of ultrasonic waves propagating in fluids to measure flow rate. Due to their advantages such as low starting flow rate, wide rangeability, no moving mechanical parts, and low pressure loss, they are widely used in smart water management and water supply metering. Their working principle relies on an ultrasonic transducer emitting and receiving pulse signals within a fluid-filled pipe. By measuring the time it takes for the ultrasonic signal to propagate downstream and upstream, the average flow velocity of the fluid is calculated, and thus the cumulative flow rate is derived.

[0003] In related technologies, the microprocessor of ultrasonic water meter metering methods typically uses the time-of-flight method as the main calculation logic. That is, the system drives the transducer at a fixed frequency, collects the downstream flight time and upstream flight time, and directly substitutes the pre-calibrated channel length (i.e., the geometric distance between the two transducers) and channel angle into the flow calculation formula to obtain the instantaneous flow rate.

[0004] However, during long-term operation of water meters, scale or deposits can form on the inner walls of pipes and transducer surfaces due to differences in water quality within the water supply network. This causes slight changes in the actual channel length and pipe diameter, making it difficult for the metering system to identify the source of the anomaly. The accumulation of errors under these complex operating conditions makes it difficult to guarantee the accuracy of the metering results. Summary of the Invention

[0005] This application provides a self-testing method for ultrasonic water meter metering anomalies based on dynamic correction of sound velocity, which is used to improve the metering accuracy of ultrasonic water meters under long-term operation.

[0006] In a first aspect, this application provides a self-checking method for ultrasonic water meter metering anomalies based on dynamic correction of sound velocity, applied to a metering system. The method includes: controlling an ultrasonic transducer to alternately transmit and receive ultrasonic waves of a first frequency and ultrasonic waves of a second frequency within a metering cycle; the first frequency ultrasonic waves and the second frequency ultrasonic waves have different frequencies; calculating a first flow velocity and a first sound velocity based on the flight time data of the first frequency ultrasonic waves; calculating a second flow velocity and a second sound velocity based on the flight time data of the second frequency ultrasonic waves; calculating the flow velocity difference between the first flow velocity and the second flow velocity, and calculating the sound velocity difference between the first sound velocity and the second sound velocity; generating an anomaly status information indicating a metering anomaly has occurred in the current metering cycle when the flow velocity difference exceeds a preset flow velocity difference threshold or the sound velocity difference exceeds a preset sound velocity difference threshold; and determining a compensation flow velocity according to a preset compensation strategy as the effective flow velocity for the current metering cycle.

[0007] In the above embodiments, the metering system obtains two sets of independent flow velocity and sound velocity data by using two different frequencies of ultrasound within the same metering cycle. Physically, the actual flow velocity and sound velocity of a fluid in a short period of time are unique and are not affected by the measurement frequency. Therefore, the two sets of data should theoretically be highly consistent. When the pipeline condition (such as scaling) or sensor performance changes, the ultrasound of different frequencies are affected to different degrees, resulting in deviations in the calculated flow velocity and sound velocity. This method uses this deviation as a judgment basis, which can effectively identify metering anomalies caused by physical changes, and ensure the continuity and reliability of data through compensation strategies, thereby improving the self-testing capability and long-term metering accuracy of the water meter under complex operating conditions.

[0008] In conjunction with some embodiments of the first aspect, in some embodiments, the step of determining the compensation flow rate as the effective flow rate of the current metering cycle according to a preset compensation strategy specifically includes: acquiring effective flow rate data for a preset number of historical metering cycles; determining a flow rate trend curve based on the effective flow rate data for the preset number of historical metering cycles; predicting the predicted flow rate of the current metering cycle based on the flow rate trend curve, and using the predicted flow rate as the compensation flow rate.

[0009] In the above embodiments, when the metering system detects a metering anomaly, it does not directly discard the data of the current period or use a simple substitute value. Instead, it uses historical effective flow rate data to construct a flow rate trend curve. This curve reflects the user's water usage pattern over a period of time. By using this curve to predict the current period, the resulting compensated flow rate is more in line with the actual water usage situation. This avoids a step error in the cumulative flow due to single-point abnormal data, ensuring that the output flow rate data remains smooth and highly reasonable when an anomaly occurs, thus maintaining the continuity and accuracy of metering.

[0010] In conjunction with some embodiments of the first aspect, in some embodiments, the step of controlling the ultrasonic transducer to alternately transmit and receive first frequency ultrasonic waves and second frequency ultrasonic waves within a metering cycle specifically includes: determining the metering ratio of the first frequency ultrasonic waves and the second frequency ultrasonic waves according to user settings; determining a first metering sub-cycle and a second metering sub-cycle of the first frequency ultrasonic waves and the second frequency ultrasonic waves within a metering cycle according to the metering ratio; and controlling the ultrasonic transducer to alternately transmit and receive the first frequency ultrasonic waves and the second frequency ultrasonic waves according to the first metering sub-cycle and the second metering sub-cycle.

[0011] In the above embodiments, the metering system introduces the concepts of metering ratio and metering sub-cycle, allowing for flexible allocation of measurement resources of the two frequencies according to actual application scenarios. For example, in a stable water quality environment, the ratio of the conventional frequency can be increased to reduce power consumption; in a scaling environment, the ratio of the auxiliary diagnostic frequency can be increased to improve self-test sensitivity, making the dual-frequency measurement mechanism configurable. It not only realizes the core function of abnormal self-test, but also takes into account the balance between power consumption, measurement accuracy and diagnostic frequency.

[0012] In conjunction with some embodiments of the first aspect, in some embodiments, the step of generating abnormal state information indicating a measurement anomaly in the current metering cycle when the flow velocity difference exceeds a preset flow velocity difference threshold or the sound velocity difference exceeds a preset sound velocity difference threshold specifically includes: continuously acquiring multiple flow velocity differences and multiple sound velocity differences from multiple first metering sub-cycles and the previous second metering sub-cycle; generating abnormal state information indicating a measurement anomaly in the current metering cycle when a preset number of differences among the multiple flow velocity differences exceed a preset flow velocity difference threshold or a preset number of differences among the multiple flow velocity differences exceed a preset sound velocity difference threshold.

[0013] In the above embodiments, the metering system uses the difference data of multiple consecutive cycles for judgment, rather than the instantaneous difference of a single measurement. This can effectively filter out false anomalies caused by accidental factors such as instantaneous pulsation of the flow field or electrical noise, and enhance the robustness of anomaly judgment. Only when the deviation of flow velocity or sound velocity continues to occur and accumulates to the preset number of triggers is it confirmed as a metering anomaly, thus reducing the false alarm rate.

[0014] In conjunction with some embodiments of the first aspect, in some embodiments, after calculating the second flow velocity and the second sound velocity based on the flight time data of the second frequency ultrasonic wave, the method further includes: determining a first simulated temperature and a second simulated temperature based on a reference table of the first sound velocity, the second sound velocity, and the temperature sound velocity; calculating the temperature difference between the first simulated temperature and the second simulated temperature; sending a water temperature change confirmation request to the water supply server when the temperature difference is higher than a preset temperature difference threshold; and generating data anomaly information after receiving a denial message returned by the water supply server.

[0015] In the above embodiments, the metering system utilizes the strong correlation between sound velocity and water temperature to convert the calculated sound velocity data into simulated temperature. By comparing the simulated temperatures calculated from the two frequencies and cross-validating them with the regional water temperature information from the water supply server, it can effectively distinguish between real water temperature changes and data anomalies caused by sensor or circuit failures. This increases the dimension of data verification and improves the monitoring capability of the measurement system's own operating status without increasing additional hardware costs, thereby enhancing the accuracy of data anomaly identification.

[0016] In conjunction with some embodiments of the first aspect, in some embodiments, after the step of sending a water temperature change confirmation request to the water supply server when the temperature difference is higher than a preset temperature difference threshold, the method further includes: after receiving confirmation information returned by the water supply server, determining the water temperature change time and water temperature change range; and adjusting the preset sound velocity difference threshold according to the water temperature change time and water temperature change range.

[0017] In the above embodiments, when the metering system confirms the existence of a real large-scale water temperature change by interacting with the server, the metering system will appropriately relax the sound velocity difference threshold within a specific time period based on the confirmed water temperature change information. This avoids the erroneous judgment of metering anomalies due to drastic water temperature changes caused by normal seasonality or water supply scheduling. This enables the self-testing method to adapt to changes in environmental parameters, reduce the false alarm rate, and improve the accuracy of judgment in dynamic environments.

[0018] In conjunction with some embodiments of the first aspect, in some embodiments, before determining the compensation flow rate as the effective flow rate of the current metering cycle according to a preset compensation strategy, the method further includes: determining the abnormality type corresponding to the abnormality information; and determining the corresponding preset compensation strategy according to the abnormality type.

[0019] In the above embodiments, after generating abnormal status information, the metering system first classifies the abnormality. For example, it distinguishes between an abnormality dominated by flow velocity deviation (which may indicate uneven scaling) and an abnormality dominated by sound velocity deviation (which may indicate changes in the medium or sensor aging). For different types of abnormalities, the system calls the optimal compensation strategy that matches them, and can select the most appropriate correction method according to the root cause of the problem, thereby improving the pertinence and effectiveness of the compensation.

[0020] In a second aspect, embodiments of this application provide a metering system comprising: one or more processors and a memory; the memory is coupled to the one or more processors and is used to store computer program code, the computer program code including computer instructions, wherein the one or more processors invoke the computer instructions to cause the metering system to perform the method described in the first aspect and any possible implementation thereof.

[0021] Thirdly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a metering system, cause the metering system to perform the method described in the first aspect and any possible implementation thereof.

[0022] Fourthly, embodiments of this application provide a computer program product containing instructions that, when the computer program product is run on a metering system, cause the metering system to execute the method described in the first aspect and any possible implementation thereof.

[0023] Understandably, the metering system provided in the second aspect, the computer storage medium provided in the third aspect, and the computer program product provided in the fourth aspect are all used to execute the methods provided in the embodiments of this application. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods, and will not be repeated here.

[0024] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:

[0025] 1. By employing a technique that alternately transmits and receives ultrasonic waves of the first and second frequencies within a single metering cycle, it is possible to acquire flow velocity and sound velocity data pairs based on two different frequencies. Based on the principle of physical consistency—that is, the flow velocity and sound velocity of the same medium at the same moment are unique—by calculating the difference between the two sets of data and comparing it with a preset threshold, metering deviations caused by physical changes such as pipe scaling or sensor performance degradation can be identified. This effectively solves the problem in related technologies where single-frequency measurement cannot effectively monitor changes in the internal state of the water meter and is difficult to detect progressive metering errors. This enables a self-checking function for metering anomalies and allows for long-term accuracy of metering data through subsequent compensation strategies, thus improving the reliability and intelligence level of the ultrasonic water meter.

[0026] 2. By employing a strategy of acquiring historical valid flow velocity data after an anomaly is detected, determining a flow velocity trend curve based on this data, and then predicting the current cycle flow velocity as a compensation flow velocity based on this curve, this method can utilize users' historical water usage patterns to correct abnormal data points. When the metering system determines that the current measurement data is unreliable, this method does not simply replace it with a zero value or the previous cycle value, but instead generates a more logical and realistic compensation value through mathematical modeling (such as linear regression, polynomial fitting, etc.). This strategy effectively solves the problem that the abnormal data processing methods in related technologies are too crude, which may lead to sudden changes in cumulative flow or serious deviations from the actual situation. Therefore, while ensuring data integrity, it makes the compensated flow data smoother and more reasonable, improving the overall continuity and reliability of metering.

[0027] 3. By employing a control method that determines the metering ratio of the two frequencies based on user settings and divides the metering sub-cycle accordingly, the dual-frequency measurement mechanism becomes flexible and configurable. The metering system can adjust the distribution of the number of measurements for the two ultrasonic frequencies according to different installation environments, water quality conditions, power consumption requirements, or diagnostic sensitivity needs. For example, in clean water environments, the proportion of the second frequency used for diagnosis can be reduced to save energy; in environments prone to scaling, its proportion can be increased to perform more frequent health checks. This effectively solves the problem of fixed measurement modes and inability to adapt to changing operating conditions in related technologies, thereby achieving an optimized balance between self-testing functions and operating costs (such as power consumption), and enhancing the method's adaptability to various scenarios. Attached Figure Description

[0028] Figure 1 This is a flowchart illustrating an ultrasonic water meter metering anomaly self-testing method based on dynamic correction of sound velocity in an embodiment of this application.

[0029] Figure 2 This is another flowchart illustrating the ultrasonic water meter metering anomaly self-testing method based on dynamic correction of sound velocity in the embodiments of this application.

[0030] Figure 3 This is a schematic diagram of the physical device structure of a metering system in an embodiment of this application. Detailed Implementation

[0031] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification of this application, the singular expressions “a,” “an,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to any or all possible combinations including one or more of the listed items.

[0032] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0033] In the implementation scenario of this application, the metering system is a microprocessor and its peripheral circuits embedded in the ultrasonic water meter. An ultrasonic transducer refers to a pair of piezoelectric elements installed on the water meter pipe section, used to transmit and receive ultrasonic signals. Time-of-flight data refers to the time required for the ultrasonic signal to travel from the transmitting transducer to the receiving transducer, including downstream flight time (t_down) and upstream flight time (t_up).

[0034] The flow velocity is the average flow velocity of water in the pipe calculated based on the time-of-flight difference, while the speed of sound is the propagation speed of ultrasound waves in water calculated based on the time of flight and channel geometry parameters. This value is closely related to the water's temperature and purity. The first frequency and the second frequency refer to two different center frequencies driving the transducer, such as 1MHz and 1.2MHz. Sound waves of different frequencies exhibit different attenuation and scattering characteristics when encountering obstacles such as scale buildup on the pipe wall. This difference forms the basis for the self-testing function implemented in this application. The preset compensation strategy is a set of predefined rules or algorithms used to generate an alternative, more reliable, and valid flow velocity value when abnormal metering data is detected. The entire processing logic aims to utilize the redundant information generated by dual-frequency measurements to identify and correct potential metering errors caused by changes in the physical state of the water meter.

[0035] The following describes the process of the method provided in this implementation. Please refer to [link / reference]. Figure 1 This is a flowchart illustrating a self-checking method for ultrasonic water meter metering anomalies based on dynamic correction of sound velocity in an embodiment of this application.

[0036] S101. Within one metering cycle, control the ultrasonic transducer to alternately transmit and receive ultrasonic waves of the first frequency and ultrasonic waves of the second frequency.

[0037] A metering cycle refers to the time interval, for example, 1 second, during which the water meter completes a full flow calculation and updates the accumulated flow. First-frequency and second-frequency ultrasonic waves refer to excitation signals driving the transducer having two different center frequencies; the difference between these two frequencies should be sufficient to produce a measurable change in the signal propagation characteristics. Ultrasonic transducers are typically used in pairs, one as the transmitter and the other as the receiver, alternating roles to measure downstream and upstream flight times.

[0038] Specifically, at the start of a preset measurement cycle, the metering system first drives the ultrasonic transducer to operate at a first frequency (e.g., 1 MHz), emitting a series of ultrasonic pulses and measuring their downstream and upstream flight times. After completing the measurement at the first frequency, the metering system immediately switches the drive signal frequency to a second frequency (e.g., 1.2 MHz), again driving the transducer to emit and receive ultrasonic pulses, and measuring the corresponding downstream and upstream flight times. This alternating process is completed within the same metering cycle to ensure that the two measurements are performed under the same fluid conditions.

[0039] In some embodiments, frequency switching and control in this step can be implemented in several ways: Optionally, a microcontroller (MCU) within the metering system controls a frequency synthesizer (such as a PLL phase-locked loop) to accurately output drive signals for a first and second frequency by changing the frequency division coefficient; this signal is amplified by the drive circuit and applied to the transducer; after measurement, the MCU switches the frequency division coefficient to generate another frequency. Optionally, the metering system can preset two independent crystal oscillators, corresponding to the first and second frequencies respectively; the MCU selects the output of one of the oscillators to drive the transducer through an electronic switch (such as an analog multiplexer), thereby achieving rapid frequency switching.

[0040] In some embodiments, there may be situations where the ultrasonic signal energy or receiving sensitivity differs between two frequencies. To address this, the metrology system performs gain calibration beforehand. That is, during factory calibration or periodic self-calibration, the metrology system measures and adjusts the gain of the programmable gain amplifier (PGA) at both frequencies to ensure that the received signal amplitudes at both frequencies are at similar levels, thereby ensuring the accuracy and consistency of the subsequent time-of-flight detection algorithm.

[0041] S102. Based on the flight time data of the first frequency ultrasonic wave, calculate the first flow velocity and the first sound velocity.

[0042] The time-of-flight data refers to the downstream propagation time t_down1 and upstream propagation time t_up1 of the ultrasonic waves measured at the first frequency. The first flow velocity (V1) and the first sound velocity (C1) are physical quantities calculated based on this set of time-of-flight data. The calculation process relies on known channel parameters, such as the channel length L (the straight-line distance between the two transducers) and the angle θ between the channel and the direction of water flow.

[0043] Specifically, after the metering system obtains t_down1 and t_up1 at the first frequency, it applies the standard time-difference method formulas for calculating flow velocity and sound velocity. The formula for calculating the first flow velocity V1 is: V1=L / (2*cos(θ))*(1 / t_down1-1 / t_up1). The formula for calculating the first sound velocity C1 is: C1=L / 2*(1 / t_down1+1 / t_up1). These calculations are performed by the processor within the metering system.

[0044] In some embodiments, the calculation process of this step can be implemented in several ways: Optionally, the metering system uses a floating-point arithmetic unit for high-precision calculation, directly substituting the values ​​into the formula to solve V1 and C1, and storing the results in floating-point form; to improve computational efficiency, the constant parts L / (2*cos(θ)) and L / 2 can be pre-calculated and stored. Optionally, to adapt to resource-constrained microcontrollers, the metering system can use fixed-point arithmetic or lookup table (LUT) methods for approximate calculation; for example, the possible correspondences between flight time differences and flow velocity, flight time and sound speed can be pre-calculated and stored in non-volatile memory, and the results can be obtained by looking up the table during actual measurement, sacrificing some accuracy for faster processing speed and lower computational resource consumption.

[0045] In some embodiments, the collected single-flight time data may exhibit abrupt changes due to noise interference. To address this, the metering system performs data filtering before calculation. For example, multiple measurements are performed consecutively within a metering sub-cycle to obtain a set of t_down1 and t_up1 samples. Then, median filtering or an average filtering algorithm that removes the maximum and minimum values ​​is used to obtain a more stable flight time value. This value is then used for flow velocity and sound velocity calculations to enhance the anti-interference capability of the calculation results.

[0046] S103. Based on the flight time data of the second frequency ultrasonic wave, the second flow velocity and the second sound velocity are calculated.

[0047] The second flow velocity (V2) and the second sound velocity (C2) are calculated based on the downstream flight time t_down2 and the upstream flight time t_up2 measured at the second frequency. The calculation process is exactly the same as that in step S102 in terms of principle and formula, only the source of input data is different.

[0048] Specifically, the metering system uses the same formula as in step S102, but uses the flight time data (t_down2, t_up2) collected at the second frequency as input. The formula for calculating the second velocity V2 is: V2=L / (2*cos(θ))*(1 / t_down2-1 / t_up2). The formula for calculating the second sound velocity C2 is: C2=L / 2*(1 / t_down2+1 / t_up2).

[0049] In some embodiments, scaling can cause changes in the actual channel length L, leading to systematic errors in the calculation of V2 and C2. To address this, in advanced diagnostic mode, the metering system can compare C2 with the theoretical velocity of sound corresponding to the actual temperature from the water temperature sensor. If a persistent deviation exists, the metering system can recalculate the actual equivalent channel length L' and use L' to correct subsequent V2 and C2 calculations, achieving adaptive compensation for channel changes.

[0050] S104. Calculate the velocity difference between the first flow velocity and the second flow velocity, and calculate the sound velocity difference between the first sound velocity and the second sound velocity.

[0051] The velocity difference (ΔV) refers to the absolute difference between the first flow velocity V1 and the second flow velocity V2, i.e., |V1-V2|. The sound velocity difference (ΔC) refers to the absolute difference between the first sound velocity C1 and the second sound velocity C2, i.e., |C1-C2|. These two differences are key indicators for determining whether the measurement is abnormal.

[0052] Specifically, after obtaining the four calculation results V1, C1, V2, and C2, the measurement system performs subtraction and absolute value operations. This process is completed by the arithmetic logic unit (ALU) within the measurement system. For example, it calculates ΔV = abs(V1 - V2) and ΔC = abs(C1 - C2). These two differences will be used for subsequent threshold comparisons.

[0053] In some embodiments, the difference calculation in this step can be implemented in several ways: Optionally, the absolute difference can be calculated. Optionally, the relative difference can be calculated, such as ΔV_rel=|V1-V2| / ((V1+V2) / 2) and ΔC_rel=|C1-C2| / ((C1+C2) / 2). Using the relative difference can better adapt to different flow rates and sound speed ranges, avoiding the problem of inappropriate threshold setting at high flow rates or high temperatures.

[0054] In some embodiments, when the flow rate is zero or near zero, the velocity difference may be amplified due to measurement noise. To address this, the metering system introduces a judgment logic. Before calculating the velocity difference, the metering system first determines whether the average flow rate (e.g., (V1+V2) / 2) is lower than a preset small velocity threshold (e.g., the flow rate corresponding to the starting flow). If it is lower than this threshold, the metering system will not perform an anomaly judgment on the velocity difference, or will use a more lenient dedicated threshold to avoid false alarms in still water conditions.

[0055] S105. When the flow velocity difference exceeds the preset flow velocity difference threshold, or the sound velocity difference exceeds the preset sound velocity difference threshold, generate abnormal status information indicating that a measurement abnormality has occurred in the current measurement cycle.

[0056] The preset flow rate difference threshold (Th_V) and preset sound velocity difference threshold (Th_C) are reference values ​​pre-stored in the metering system's non-volatile memory, used to define the normal measurement fluctuation range. Abnormal status information is a data flag or code used to record potential problems with the data in the current metering cycle.

[0057] Specifically, the metering system compares the calculated ΔV and ΔC from the previous step with Th_V and Th_C, respectively. If the logical condition (ΔV>Th_V)OR(ΔC>Th_C) is true, the metering system sets a flag in memory or generates a specific error code, indicating that the measurement data for the current period is unreliable, triggering a metering anomaly event.

[0058] In some embodiments, the threshold determination in this step can be implemented in several ways: Optionally, a fixed threshold can be used. For example, Th_V is set to 0.01 m / s and Th_C is set to 1 m / s. Optionally, a dynamic threshold can be used. For example, the threshold is associated with the current measurement value, Th_V = k1V_avg + V_offset, Th_C = k2C_avg + C_offset, where k1 and k2 are proportionality coefficients, V_offset and C_offset are fixed offsets, and V_avg and C_avg are the average flow velocity and sound velocity, respectively. This method makes the determination criteria more adaptable to different operating conditions.

[0059] In some embodiments, the flow velocity difference and sound velocity difference may exceed limits simultaneously or separately, potentially indicating different causes of the anomaly. In response, the metering system generates more detailed anomaly status information. For example, if only ΔV exceeds the limit, a flow velocity deviation anomaly code is generated; if only ΔC exceeds the limit, a sound velocity deviation anomaly code is generated; if both exceed the limits, a combined deviation anomaly code is generated. This classification helps subsequent steps select more targeted compensation strategies.

[0060] S106. Determine the compensation flow rate according to the preset compensation strategy, and use it as the effective flow rate for the current metering cycle.

[0061] The preset compensation strategy is a set of algorithms or rules pre-programmed into the metering system to provide an alternative, reasonable flow rate value when an anomaly is detected. The compensated flow rate is the output of this strategy. The effective flow rate is the flow rate value ultimately used for cumulative flow calculation in this metering cycle.

[0062] Specifically, after abnormal status information is generated in step S105, the metering system suspends the use of the flow rate directly calculated for the current period (such as V1, V2, or their average value). Instead, the metering system invokes a preset compensation algorithm. For example, a simple strategy is to use the effective flow rate of the previous metering period as the compensation flow rate for the current period. This compensation flow rate will be marked as the effective flow rate and used to update the cumulative flow reading of the water meter, thereby avoiding the pollution of the total flow rate by abnormal data.

[0063] In some embodiments, the compensation strategy for this step can be implemented in several ways: Optionally, a maintenance strategy can be adopted, that is, directly using the effective flow rate of the previous metering period as the current compensation flow rate. This method is simple to implement and suitable for scenarios where flow rate changes are gradual. Optionally, a historical averaging strategy can be adopted, that is, taking the average flow rate of the past N effective metering periods as the compensation flow rate. This method can smooth out short-term fluctuations, but the response to sudden changes in flow rate is slower. More complex strategies will be described in the following embodiments.

[0064] In some embodiments, anomalies may be triggered for multiple consecutive metering cycles. To address this, the metering system's compensation strategy may include a timeout or counter mechanism. If the abnormal state persists for more than a preset number of cycles (e.g., 100 cycles), the metering system, in addition to continuing compensation, will generate a higher-level persistent fault alarm and may report it to the management center via the communication module, prompting manual intervention to check the water meter status and prevent the prolonged use of inaccurate compensation data.

[0065] Steps S101 to S106 constitute a basic anomaly self-check and handling loop. However, this basic process still has room for improvement in terms of the accuracy of its judgment and the rationality of its compensation when faced with complex flow field fluctuations and environmental changes. For example, how to distinguish between accidental measurement fluctuations and continuous systematic deviations, and how to generate a compensation flow rate that more closely reflects actual water usage conditions, are problems that need to be solved.

[0066] The following is a more detailed description of the process provided in this implementation. Please refer to [link / reference]. Figure 2 This is another flowchart illustrating the ultrasonic water meter metering anomaly self-checking method based on dynamic correction of sound velocity in this application embodiment.

[0067] S201. Determine the measurement ratio of the first frequency ultrasound and the second frequency ultrasound according to the user settings.

[0068] User settings can be parameters preset by the manufacturer according to product specifications when the water meter leaves the factory, or configurations written by on-site installation and commissioning personnel using specialized tools. Metering ratio refers to the proportion of time or frequency used for measurements at the first frequency to the time or frequency used for measurements at the second frequency within a metering cycle. For example, a metering ratio of 8:2 indicates that 80% of measurement resources are used for the regular first frequency, and 20% for the diagnostic second frequency.

[0069] Specifically, when the metering system initializes or receives a new configuration command, it reads the metering ratio parameter from non-volatile memory. For example, if a metering cycle contains 10 measurements with a ratio of 8:2, it means that 8 measurements at the first frequency and 2 measurements at the second frequency will be performed.

[0070] In some embodiments, the percentage determination for this step can be achieved in several ways: Optionally, static configuration. A fixed percentage value is used throughout the water meter's lifespan. Optionally, dynamic adjustment. The metering system can adaptively adjust the percentage based on the frequency of historical anomalies. If anomalies occur frequently, the metering system can increase the percentage of the second frequency for more intensive health monitoring; if long-term operation is stable, the percentage of the second frequency can be reduced to save power consumption.

[0071] In some embodiments, the user-set percentage may be unreasonable, resulting in too few measurements at any frequency and affecting data stability. To address this, the metrology system internally sets a minimum number of measurements. After parsing the user-set percentage, the system checks if the converted number of measurements is below this minimum. If it is, the system will force the use of the internally set minimum number of measurements and proportionally adjust the number of measurements at the other frequency to ensure the basic statistical validity of the measurements at both frequencies.

[0072] S202. Based on the measurement ratio, determine the first measurement sub-cycle and the second measurement sub-cycle of the first frequency ultrasonic wave and the second frequency ultrasonic wave within a measurement cycle, respectively.

[0073] In this context, a metrology sub-cycle refers to a time period or measurement sequence within the entire metrology cycle specifically designated for performing ultrasonic measurements at a particular frequency. The first metrology sub-cycle corresponds to the first frequency, and the second metrology sub-cycle corresponds to the second frequency. The determination process involves allocating the measurement tasks for the entire metrology cycle based on the proportions established in the previous step.

[0074] Specifically, the metering system subdivides a complete metering cycle (e.g., 1 second) into several measurement time slots. Based on the metering ratio determined in step S201, the metering system allocates a corresponding number of time slots to the first frequency and the second frequency. For example, if the ratio is 8:2, with a total of 10 time slots, then 8 time slots constitute the first metering sub-cycle, and 2 time slots constitute the second metering sub-cycle. Measurement activities within these sub-cycles will use the corresponding frequencies.

[0075] In some embodiments, the sub-cycle determination of this step can be achieved in several ways: Optionally, concentrated measurements. All measurements at the first frequency are performed together, followed by all measurements at the second frequency. For example, eight consecutive measurements at the first frequency are performed, followed by two consecutive measurements at the second frequency. Optionally, staggered measurements. The measurements of the two frequencies are staggered throughout the measurement cycle. For example, in the sequence F1-F1-F1-F1-F2-F1-F1-F1-F1-F2. Staggered measurements help to make the flow field conditions of the two measurements more similar when the flow velocity changes rapidly.

[0076] In some embodiments, there are application scenarios with particularly stringent power consumption constraints. To address this, the metering system incorporates low-power strategies when determining metering sub-cycles. For example, measurement activities (whether at a first or second frequency) are concentrated at the beginning of the metering cycle, and after completion, the processor and analog front-end enter deep sleep mode until the start of the next metering cycle, thereby minimizing average power consumption.

[0077] S203. Based on the first metering sub-cycle and the second metering sub-cycle, control the ultrasonic transducer to alternately transmit and receive ultrasonic waves of the first frequency and ultrasonic waves of the second frequency.

[0078] Referring to step S101, this step is a concrete implementation of S101. The metering system precisely controls the drive circuit and the receiving circuit according to the sequence and frequency planned in step S202, and completes the ultrasonic transceiver and time-of-flight acquisition at the specified frequency within the corresponding time slice.

[0079] S204. Based on the flight time data of the first frequency ultrasonic wave, the first flow velocity and the first sound velocity are calculated.

[0080] Refer to step S102, which will not be repeated here.

[0081] S205. Based on the flight time data of the second frequency ultrasonic wave, the second flow velocity and the second sound velocity are calculated.

[0082] Refer to step S103, which will not be repeated here.

[0083] S206. Calculate the velocity difference between the first flow velocity and the second flow velocity, and calculate the sound velocity difference between the first sound velocity and the second sound velocity.

[0084] Refer to step S104, which will not be repeated here.

[0085] In some embodiments, to add an independent verification dimension to distinguish between water temperature changes and measurement system malfunctions, the metering system uses the relationship between sound velocity and temperature for cross-validation. That is, the metering system determines the first simulated temperature and the second simulated temperature according to a first sound velocity, a second sound velocity, and a temperature sound velocity lookup table; calculates the temperature difference between the first simulated temperature and the second simulated temperature; when the temperature difference is higher than a preset temperature difference threshold, it sends a water temperature change confirmation request to the water supply server; and after receiving a denial message from the water supply server, it generates data anomaly information.

[0086] The temperature-velocity-of-sound lookup table contains data pre-stored in the water meter's memory, describing the velocity of sound in pure water at different temperatures. The simulated temperature is the equivalent temperature calculated from the velocity of sound using a lookup table or a fitted function. The water supply server is the water company's central server, storing information such as the water temperature of the regional water supply network.

[0087] Specifically, the metering system uses C1 and C2 to calculate the first simulated temperature T_sim1 and the second simulated temperature T_sim2 by consulting a lookup table or substituting into the sound velocity-temperature fitting formula. Then, it calculates the difference between the two, |T_sim1-T_sim2|. If this difference is greater than a threshold (e.g., 0.5 degrees Celsius), it indicates a high degree of inconsistency between the calculated sound velocities of the two frequencies, potentially indicating a serious measurement problem. At this point, the water meter sends a confirmation request containing its own ID and the current simulated temperature to the water supply server via its wireless communication module. If the server returns a negative message (indicating that the water temperature in the area is stable and without drastic changes), the metering system can determine with high probability that the problem lies with the water meter itself and generate a data anomaly message indicating a possible sensor or circuit malfunction.

[0088] In some embodiments, cross-validation of this step can be implemented in several ways: Optionally, comparison with onboard temperature sensors. If the water meter is equipped with an independent temperature sensor, T_sim1 and T_sim2 can be compared with the actual temperature T_real measured by the sensor. If the difference is too large, it can also indicate an anomaly. Optionally, comparison with data from neighboring water meters. In an IoT architecture, the water meter can request temperature data from neighboring water meters for horizontal comparison to determine whether the temperature change is a localized phenomenon or a regional one.

[0089] In some embodiments, communication failures with the water supply server may occur. To address this, the metering system has a built-in timeout retransmission mechanism. If no response is received from the server within a specified time after sending a request, the system will attempt to retransmit several times. If communication ultimately fails, the system will be unable to complete cross-validation. In this case, the system will generate a special exception code indicating suspected data anomaly, but which cannot be confirmed, and may employ a more conservative compensation strategy while recording the communication failure event.

[0090] In some embodiments, in order to enable the self-testing system to adapt to environmental changes, the metering system will dynamically adjust internal parameters based on external information. That is, after receiving the confirmation information returned by the water supply server, the metering system will determine the water temperature change time and water temperature change range; and adjust the preset sound velocity difference threshold according to the water temperature change time and water temperature change range.

[0091] The confirmation message indicates that the water supply server has acknowledged a change in water temperature. The time and range of this temperature change are specific data returned by the server, such as the water temperature rising from 15°C to 20°C within the next two hours. Adjusting the threshold refers to temporarily and specifically modifying the Th_C value used in step S105. Specifically, when the server returns confirmation, it indicates that the subsequent change in sound velocity caused by the drastic water temperature change is normal. To avoid misjudging this normal change as abnormal, the metering system temporarily relaxes the sound velocity difference threshold Th_C based on the information provided by the server. For example, during the expected water temperature change period, the Th_C value is increased to 1.5 times its original value. After this period ends, the threshold automatically reverts to its original value. This adaptive adjustment mechanism allows this method to effectively distinguish between equipment malfunctions and normal environmental fluctuations.

[0092] In some embodiments, the threshold adjustment in this step can be implemented in several ways: Optionally, a fixed-ratio adjustment. During the confirmed water temperature change, the threshold is multiplied by a fixed coefficient. Optionally, a rate-of-change adjustment. Based on the rate of water temperature change returned by the server, a function is used to calculate the amount of threshold adjustment; the more drastic the change, the more the threshold is relaxed.

[0093] In some embodiments, the information provided by the water supply server may be inaccurate or delayed. To address this, the metering system performs a double check, combining local sound velocity variation trends with threshold adjustments. Threshold adjustment is only performed when the server confirms a water temperature change, and the locally measured sound velocity (such as the average of C1 and C2) also shows a trend consistent with the server's information. If the two do not match, the system will not adjust the threshold and may report a data inconsistency event, increasing the reliability of the decision.

[0094] S207. When the flow velocity difference exceeds the preset flow velocity difference threshold, or the sound velocity difference exceeds the preset sound velocity difference threshold, generate abnormal status information indicating that a measurement abnormality has occurred in the current measurement cycle.

[0095] Refer to step S105, which will not be repeated here.

[0096] In some embodiments, in order to improve the reliability of anomaly detection and avoid misjudgment caused by instantaneous disturbances, the metering system will perform time-accumulated judgment on the difference data. That is, the metering system will continuously acquire multiple flow velocity differences and multiple sound velocity differences from multiple first metering sub-cycles and the previous second metering sub-cycle. When a preset number of differences among the multiple flow velocity differences exceed a preset flow velocity difference threshold, or when a preset number of differences among the multiple flow velocity differences exceed a preset sound velocity difference threshold, an anomaly status information indicating that a metering anomaly has occurred in the current metering cycle is generated.

[0097] The preset number M is an integer greater than 1, which defines the number of consecutive overruns required to trigger an anomaly. It forms the judgment window and requires the anomaly to be persistent, thereby filtering out accidental, single-point measurement glitches.

[0098] Specifically, the metering system maintains an anomaly counter. After calculating the flow velocity difference ΔV and sound velocity difference ΔC in each metering cycle, the system performs a judgment: (ΔV>Th_V)OR(ΔC>Th_C). If the condition is true, the anomaly counter is incremented; if false, the counter is reset. Only when the value of the anomaly counter reaches a preset number M does the metering system officially generate an anomaly status information and trigger the subsequent compensation process. This mechanism is equivalent to a sliding window filter, improving the robustness of anomaly detection.

[0099] In some embodiments, the continuity determination of this step can be implemented in several ways: Optionally, strict continuous counting. Triggering only occurs if the limit is exceeded for M consecutive cycles. Optionally, M / N judgment. Within a window containing N cycles, an anomaly is triggered as long as M (not necessarily consecutive) cycles exceed the limit. The latter is more sensitive to intermittent anomaly signals.

[0100] In some embodiments, there is a question of how the system returns to normal metering mode after the abnormal state is resolved. To address this, the metering system introduces a recovery mechanism. When the system is in an abnormal state and using a compensated flow rate, it continues to perform dual-frequency measurements and difference calculations. When the differences ΔV and ΔC for K consecutive metering cycles return to within the threshold, the abnormal counter is also reset to zero, the system resolves the abnormal state, and from the next cycle onwards, it resumes using the directly measured flow rate as the effective flow rate.

[0101] S208. Obtain a preset number of valid flow rate data for historical metering cycles.

[0102] The preset quantity is a positive integer N, for example, N=100, representing the number of historical data points that need to be traced back. The historical metering period refers to the period preceding the current metering period. Valid flow rate data refers to the final flow rate value that the system has determined to be normal or has undergone compensation processing in these past periods, and which can be used for flow accumulation. Specifically, after generating abnormal status information in step S207, the metering system initiates the first step of the compensation process, which is to access the buffer or queue in memory that records historical flow rate data. This buffer is typically a first-in, first-out (FIFO) queue, storing the valid flow rate values ​​for the most recent N metering periods. The metering system reads these N data points into memory, preparing them for subsequent trend analysis.

[0103] In some embodiments, data acquisition for this step can be achieved in several ways: Optionally, it can be acquired from a circular buffer in RAM. This method is fast, but the data is lost after power failure. Optionally, it can be acquired from non-volatile memory such as flash memory. This method ensures that the data is not lost after power failure, but the read / write speed is slower and there is a limited erase / write lifespan. A combination of both methods is typically used, i.e., maintaining a buffer in RAM and periodically backing up the data to flash memory.

[0104] In some embodiments, historical data may contain a large number of zero flow rates (i.e., periods of water outage). These zero values ​​can severely interfere with subsequent trend curve fitting. To address this, the metering system preprocesses the data after acquisition. The system removes zero values ​​or values ​​below a small flow threshold from the data sequence, retaining only data points from the effective water use period for trend analysis. If the number of data points after removal is too small, other simpler compensation strategies (such as a retention strategy) are employed.

[0105] S209. Based on a preset number of historical metering cycles of effective flow velocity data, determine the flow velocity trend curve.

[0106] The flow velocity trend curve is a mathematical fit to the historical flow velocity data sequence obtained in step S208, used to express the basic law of flow velocity change over time. This curve can be represented by a mathematical function, such as the linear function y=ax+b or the polynomial function y=ax^2+bx+c.

[0107] Specifically, the metering system uses N historical valid flow velocity data points as discrete points (t_i, v_i), where t_i is the time (or period number) and v_i is the corresponding flow velocity. The metering system employs a pre-defined regression algorithm, such as the least squares method, to fit these data points, thereby determining the parameters of the trend curve. For example, for linear fitting, this involves finding the slope a and intercept b that minimize the sum of squared residuals.

[0108] In some embodiments, curve determination in this step can be achieved in several ways: Optionally, linear regression fitting. This is suitable for scenarios where the flow velocity change trend is relatively stable, requires little computation, and is easy to implement in embedded systems. Optionally, multinomial regression fitting. This can fit more complex flow velocity change patterns (such as parabolic curves), but requires more computation and may result in overfitting. Optionally, moving average method. This method forms a trend line by calculating the moving average of historical data, and it has a good smoothing effect on short-term noise.

[0109] In some embodiments, historical data may exhibit clear periodicity (such as daily morning and evening water usage peaks) rather than simple linear or polynomial trends. To address this, metering systems can employ more advanced time series analysis models, such as seasonal decomposition (e.g., STL decomposition), to break down historical data into trend, seasonal, and residual terms. When determining the trend curve, only the trend term is fitted, thus more accurately capturing long-term patterns of change and remaining unaffected by short-term periodic fluctuations.

[0110] S210. The predicted flow rate for the current metering cycle is obtained based on the flow rate trend curve, and the predicted flow rate is used as the compensation flow rate.

[0111] The predicted flow velocity is calculated by substituting the flow velocity trend curve function determined in step S209 into the time point t_current of the current metering cycle. This predicted flow velocity is the final compensated flow velocity and is designated as the effective flow velocity for the current cycle.

[0112] Specifically, after determining the functional expression of the trend curve (e.g., obtaining the slope 'a' and intercept 'b' of the linear regression), the metering system substitutes the independent variable value representing the current period (e.g., the current period number N+1) into the function to calculate the predicted flow rate V_predict. That is, V_predict = a*(N+1) + b. Then, the metering system uses this V_predict as the effective flow rate for the current period for flow accumulation calculation.

[0113] In some embodiments, this step of prediction and application can be implemented in several ways: Optionally, direct application. The calculated predicted flow rate is directly used as the compensation flow rate. Optionally, weighted fusion. The predicted flow rate is weighted and averaged with the effective flow rate of the previous cycle, V_compensated=w*V_predict+(1-w)*V_last_valid, where w is the weighting coefficient. This method can make the change of the compensation value smoother and avoid abrupt changes.

[0114] In some embodiments, the predicted flow rate may be negative or an unrealistic maximum (e.g., due to significant fluctuations in historical data causing the fitted curve to diverge). To address this, the metering system performs range validation before outputting the predicted flow rate. The system sets a reasonable upper and lower limit for the flow rate (e.g., from 0 to the maximum flow rate designed for the water pipe). If the predicted value exceeds this range, it is forcibly corrected to the closest boundary value (e.g., corrected to 0 or the maximum flow rate) to ensure the physical reasonableness of the compensation value.

[0115] In some embodiments, to make the compensation measures more targeted, the metering system will classify anomalies and match different strategies, that is, the metering system will determine the anomaly type corresponding to the anomaly status information; and determine the corresponding preset compensation strategy according to the anomaly type.

[0116] The anomaly type is a preliminary judgment of the root cause of the detected anomaly. For example, by analyzing the magnitude and ratio of ΔV and ΔC, different fault modes can be distinguished. The corresponding preset compensation strategy library stores multiple compensation algorithms, each targeting one or more anomaly types. Specifically, when anomaly status information is generated, the metering system analyzes the characteristics of ΔV and ΔC. For example, if ΔV is much greater than the threshold while ΔC is near the threshold, it may be determined as uneven scaling or flow channel blockage; if ΔC is much greater than the threshold while ΔV is normal, it may be determined as sensor aging or circuit parameter drift. After determining the type, the system calls the corresponding compensation method from the strategy library. For example, for uneven scaling, predictive compensation based on historical trends may be more suitable; while for sensor aging, a strategy of maintaining the effective value from the previous moment may be adopted, while simultaneously issuing a hardware maintenance alarm.

[0117] In some embodiments, multiple anomalous features may occur concurrently, making it difficult to clearly categorize them. To address this, the metering system sets a default classification for unknown or composite types. When no known type can be explicitly matched, the system selects the most general and robust compensation strategy, such as historical data median compensation, and generates a complex fault alarm requiring priority attention. This ensures there is a solution in any situation while highlighting the complexity of the problem.

[0118] In this embodiment, by employing a core mechanism of alternating dual-frequency ultrasonic measurement and combining a judgment logic that compares the differences between flow velocity and sound velocity, the internal physical state changes of the ultrasonic water meter can be monitored in real time. By introducing a diagnostic frequency different from the conventional measurement frequency, two sets of measurement data that should be consistent but may differ due to faults are created, thereby constructing an internal reference system. This effectively solves the problem that traditional single-frequency water meters cannot detect gradual changes such as pipe wall scaling and transducer performance degradation, leading to long-term accumulation of measurement errors without awareness. Furthermore, it realizes the self-checking, diagnosis, and data compensation functions for measurement anomalies in ultrasonic water meters, improving their measurement accuracy and operational reliability throughout their entire lifecycle.

[0119] The metering system in the embodiments of this invention is described below from the perspective of hardware processing. Please refer to [link / reference]. Figure 3 This is a schematic diagram of the physical device structure of a metering system in an embodiment of this application.

[0120] It should be noted that, Figure 3The structure of the metering system shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0121] like Figure 3 As shown, the metering system includes a CPU 301, which can perform various appropriate actions and processes according to a program stored in ROM 302 or a program loaded from storage section 308 into RAM 303, such as executing the methods described in the above embodiments. RAM 303 also stores various programs and data required for system operation. The CPU 301, ROM 302, and RAM 303 are interconnected via bus 304. I / O interface 305 is also connected to bus 304.

[0122] The following components are connected to I / O interface 305: input section 306 including audio input devices, push-button switches, etc.; output section 307 including liquid crystal display (LCD) and audio output devices, indicator lights, etc.; storage section 308 including hard disks, etc.; and communication section 309 including network interface cards such as LAN (Local Area Network) cards, modems, etc. Communication section 309 performs communication processing via a network such as the Internet. Drive 310 is also connected to I / O interface 305 as needed. Removable media 311, such as disks, optical disks, magneto-optical disks, semiconductor memories, etc., are installed on drive 310 as needed so that computer programs read from them can be installed into storage section 308 as needed.

[0123] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 309, and / or installed from removable medium 311. When the computer program is executed by CPU 301, it performs the various functions defined in the present invention.

[0124] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention.

[0125] In this flowchart or block diagram, each box may represent a module, program segment, or part of code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the boxes may occur in a different order than those shown in the accompanying drawings.

[0126] Specifically, the metering system in this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, it implements the ultrasonic water meter metering anomaly self-checking method based on dynamic correction of sound velocity provided in the above embodiment.

[0127] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the metering system described in the above embodiments; or it may exist independently and not assembled into the metering system. The storage medium carries one or more computer programs that, when executed by a processor of the metering system, cause the metering system to implement the ultrasonic water meter metering anomaly self-checking method based on dynamic correction of sound velocity provided in the above embodiments.

[0128] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

[0129] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".

Claims

1. A self-checking method for metering anomalies in ultrasonic water meters based on dynamic correction of sound velocity, characterized in that, Applied to a metering system, the method includes: Within one metering cycle, the ultrasonic transducer is controlled to alternately emit and receive ultrasonic waves of a first frequency and ultrasonic waves of a second frequency; the first frequency ultrasonic waves and the second frequency ultrasonic waves have different frequencies. The first flow velocity and the first sound velocity are calculated based on the flight time data of the first frequency ultrasonic wave. The second flow velocity and the second speed of sound are calculated based on the flight time data of the second frequency ultrasonic wave. Calculate the velocity difference between the first flow velocity and the second flow velocity, and calculate the sound velocity difference between the first sound velocity and the second sound velocity; When the flow velocity difference exceeds a preset flow velocity difference threshold, or the sound velocity difference exceeds a preset sound velocity difference threshold, abnormal status information indicating a measurement anomaly has occurred in the current measurement cycle is generated. The compensation flow rate is determined according to a preset compensation strategy and is used as the effective flow rate for the current metering cycle.

2. The method according to claim 1, characterized in that, The step of determining the compensation flow rate according to the preset compensation strategy as the effective flow rate of the current metering cycle specifically includes: Acquire valid flow rate data for a preset number of historical metering cycles; Based on the effective flow velocity data of the preset number of historical metering cycles, a flow velocity trend curve is determined. The predicted flow rate for the current metering cycle is obtained based on the flow rate trend curve, and the predicted flow rate is used as the compensation flow rate.

3. The method according to claim 1, characterized in that, The step of controlling the ultrasonic transducer to alternately transmit and receive ultrasonic waves of the first frequency and ultrasonic waves of the second frequency within a metering cycle specifically includes: Determine the measurement ratio of the first frequency ultrasound and the second frequency ultrasound based on user settings. According to the aforementioned measurement ratio, the first and second measurement sub-cycles of the first frequency ultrasonic wave and the second frequency ultrasonic wave within a measurement cycle are determined respectively. Based on the first metering sub-cycle and the second metering sub-cycle, the ultrasonic transducer is controlled to alternately transmit and receive ultrasonic waves of the first frequency and ultrasonic waves of the second frequency.

4. The method according to claim 3, characterized in that, The step of generating abnormal status information indicating a measurement anomaly in the current measurement cycle when the flow velocity difference exceeds a preset flow velocity difference threshold or the sound velocity difference exceeds a preset sound velocity difference threshold specifically includes: Multiple velocity differences and multiple sound velocity differences are continuously acquired between multiple first metering sub-cycles and the previous second metering sub-cycle; When a preset number of the multiple flow velocity differences exceed a preset flow velocity difference threshold, or when a preset number of the multiple flow velocity differences exceed a preset sound velocity difference threshold, abnormal status information indicating a measurement anomaly has occurred in the current measurement cycle is generated.

5. The method according to claim 1, characterized in that, After the step of calculating the second flow velocity and the second sound velocity based on the time-of-flight data of the second frequency ultrasonic wave, the method further includes: The first simulated temperature and the second simulated temperature are determined according to the first sound velocity, the second sound velocity and the temperature sound velocity comparison table; Calculate the temperature difference between the first simulated temperature and the second simulated temperature; When the temperature difference exceeds a preset temperature difference threshold, a water temperature change confirmation request is sent to the water supply server. After receiving the denial information returned by the water supply server, data anomaly information is generated.

6. The method according to claim 5, characterized in that, After the step of sending a water temperature change confirmation request to the water supply server when the temperature difference is higher than a preset temperature difference threshold, the method further includes: After receiving the confirmation information returned by the water supply server, the water temperature change time and water temperature change range are determined; The preset sound velocity difference threshold is adjusted based on the water temperature change time and the water temperature change range.

7. The method according to claim 1, characterized in that, Before the step of determining the compensation flow rate as the effective flow rate for the current metering cycle according to a preset compensation strategy, the method further includes: Determine the anomaly type corresponding to the abnormal status information; The corresponding preset compensation strategy is determined based on the anomaly type.

8. A metering system, characterized in that, The metering system includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the metering system to perform the method as described in any one of claims 1-7.

9. A computer-readable storage medium comprising instructions, characterized in that, When the instruction is executed on the metering system, it causes the metering system to perform the method as described in any one of claims 1-7.

10. A computer program product, characterized in that, When the computer program product is run on the metering system, it causes the metering system to perform the method as described in any one of claims 1-7.