Method for filtering abnormal fluctuation of ultrasonic water meter based on variance algorithm

By applying a variance algorithm to ultrasonic water meters to filter abnormal fluctuations, the problem of false flow alarms caused by water hammer effect was solved, achieving accurate flow measurement and stability, and reducing the risk of false alarms and equipment energy consumption.

CN120970747APending Publication Date: 2025-11-18MAXTOR INSTR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511270358.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-08
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

Ultrasonic water meters are prone to detecting abnormal fluctuations in flow rate due to factors such as water hammer effect, leading to false alarms and increased data processing burden, and making it impossible to accurately distinguish between actual water usage and abnormal fluctuations.

Method used

A variance-based algorithm is used to accurately measure water consumption by judging flow variance and filtering abnormal fluctuations through multi-level logic. This includes setting a threshold for initiating variance calculation, a lower threshold for variance calculation, and an upper threshold for variance calculation, combined with the judgment of flow direction and instantaneous flow.

Benefits of technology

It effectively filters out abnormal water usage fluctuations, reduces the risk of false alarms, improves the accuracy and stability of water meter measurement, and saves storage space and equipment power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120970747A_ABST
    Figure CN120970747A_ABST
Patent Text Reader

Abstract

The invention provides a method for filtering abnormal fluctuation of an ultrasonic water meter based on a variance algorithm, and aims to solve the problem of metering misinformation of a user water meter. The method judges fluctuation of flow through variance, and comprises the following steps: firstly, judging whether variance fluctuation calculation is enabled or not, if so, measuring average instantaneous flow, accumulated water quantity and water flow direction in unit time, otherwise, directly settling the water quantity and ending the flow; performing multi-level judgment through a starting variance calculation threshold value, a variance calculation upper threshold value, a variance calculation lower threshold value and a variance algorithm instantaneous flow threshold value, and screening out normal water consumption data; and finally, settling and counting normal water quantity. According to the method, normal water consumption fluctuation is effectively filtered, so that the accuracy and reliability of statistical calculation of the water meter are improved, and the false alarm phenomenon is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of wave filtering of ultrasonic water meters, and particularly to a method for filtering abnormal fluctuations of ultrasonic water meters based on a variance algorithm. BACKGROUND

[0002] An ultrasonic water meter is a flow measurement device based on the principle of ultrasonic wave propagation. Its working principle is to emit and receive ultrasonic signals, and use the influence of water flow on the propagation time or frequency of ultrasonic waves to calculate the water flow velocity, and then obtain the flow data. However, in the actual application of ultrasonic water meters, due to the influence of water hammer effect and other water pressure fluctuation factors, the water meter may detect abnormal fluctuations of flow in the case of no actual water use by the user. Such fluctuations usually manifest as abnormal jumps or instability of flow, causing the water meter to be unable to accurately distinguish between real water use and abnormal fluctuations, thereby uploading false data status or triggering false alarms of water leakage. These false alarms not only cause unnecessary trouble to the user, but also increase the data processing burden and power consumption of the water meter. SUMMARY

[0003] To solve the above technical problems, the present application proposes a method for filtering abnormal fluctuations of ultrasonic water meters based on variance fluctuations.

[0004] The present application aims to filter abnormal water fluctuations, only calculate normal water consumption, reduce the risk of false alarms, and proposes a convenient method including the following steps: S1: Determine whether to enable variance fluctuation calculation through the FLOW_VAR_EN parameter in the ultrasonic water meter; if enabled, proceed to step S2; if not enabled, proceed directly to step S6; S2: Measure and calculate the average instantaneous flow rate W_SPEED, the cumulative water volume C, and the direction of the water flow within a unit time of the ultrasonic water meter; The unit time is a set unit time T; S21: Measure and calculate the direction of the water flow within a unit time of the ultrasonic water meter, including the following steps: Within the unit time T, collect the downstream sound wave propagation time and the upstream sound wave propagation time , the MCU module calculates the difference between the downstream and upstream propagation times , and the MCU module compares the size of and to determine the direction of the water flow, obtaining the direction of the water flow, which includes forward and reverse directions; the forward direction is identified by the "+" symbol, and the reverse direction is identified by the "-" symbol; S22: Measure and calculate the cumulative water volume C within a unit time of the ultrasonic water meter, including the following steps: Within the unit time T, First, the MCU module calculates and The axial velocity of water flow v is calculated to obtain the axial velocity of water flow ; then the MCU module calculates the single water inflow based on the axial velocity of water flow and the pipe cross-sectional area S of the water meter and the time interval of single measurement ; finally, the accumulator adds all the single water inflow Q in a unit time to obtain the accumulated water inflow C in the unit time ; S22 measures and calculates the average instantaneous flow rate W_SPEED of the ultrasonic water meter in a unit time, including the following steps: In a unit time T, the MCU module calculates the average instantaneous flow rate W_SPEED; The average instantaneous flow rate W_SPEED is the ratio of the accumulated water inflow C to the measurement unit time T; Thus, in a unit time T, a group of average instantaneous flow rate W_SPEED, accumulated water inflow C and water flow direction data are formed; By analogy, for the nth unit time T, the average instantaneous flow rate W_SPEED, accumulated water inflow C and water flow direction of the nth unit time T are obtained; after each unit time T ends, the ultrasonic water meter packs and stores the average instantaneous flow rate W_SPEED, accumulated water inflow C and water flow direction measured and calculated according to the preset byte data frame format, completes the data acquisition and storage of the average instantaneous flow rate W_SPEED, accumulated water inflow C and water flow direction in the unit time; the data frame includes the time stamp, water flow direction in the unit time T, average instantaneous flow rate W_SPEED and accumulated water inflow C; S3: determining whether each average instantaneous flow rate W_SPEED in all average instantaneous flow rates W_SPEED in step S2 is greater than a starting variance calculation threshold value, and executing the corresponding result; In step S3, for the average instantaneous flow rate W_SPEED not greater than the starting variance calculation threshold value, the average instantaneous flow rate W_SPEED is counted into , I is an integer, representing the number of average instantaneous flow rates W_SPEED in , and I≥0, and then the average instantaneous flow rate W_SPEED not greater than the starting variance calculation threshold value is processed in step S4; For the average instantaneous flow rate W_SPEED in the unit time greater than the starting variance calculation threshold value, it is determined that the accumulated water inflow C in the corresponding unit time is counted into the cumulative flow in step S6, and it is directly jumped to step S6; The starting variance calculation threshold value is a value artificially set in the ultrasonic water meter; S4: determining the variance Whether it is less than the lower threshold of variance calculation, and execute the corresponding result; For the in step S3, calculate the variance of each average instantaneous flow rate W_SPEED , including the following steps: Take a average instantaneous flow rate W_SPEED data greater than the start variance calculation threshold before the timestamp of the data frame corresponding to the average instantaneous flow rate W_SPEED, and b average instantaneous flow rate W_SPEED data greater than the start variance calculation threshold after it, to obtain a total of z average instantaneous flow rates W_SPEED; where a + b = z, both a and b are positive integers, and the specific values of a and b are configured through the ultrasonic water meter management platform; Count the obtained z average instantaneous flow rates W_SPEED as ; represents the th average instantaneous flow rate value ( = 1, 2,... z), , which is the arithmetic mean of z flow rates; Calculate the variance : When the number n of average instantaneous flow rate W_SPEED data greater than the start variance calculation threshold stored is < z, the sample size N for variance calculation takes the number n of all average instantaneous flow rate W_SPEED data greater than the start variance calculation threshold, and is calculated according to the calculation formula , and at this time ; ; When the number n of average instantaneous flow rate W_SPEED data greater than the start variance calculation threshold stored is ≥ z: If there are only p average instantaneous flow rate W_SPEED data greater than the start variance calculation threshold before the timestamp of the data frame corresponding to the average instantaneous flow rate W_SPEED and p < a, the sample size N for variance calculation takes the p average instantaneous flow rate W_SPEED data greater than the start variance calculation threshold and the z - p average instantaneous flow rate W_SPEED data greater than the start variance calculation threshold after the timestamp of the data frame corresponding to the average instantaneous flow rate W_SPEED; The p value is a value set manually in the ultrasonic water meter; If there are only q average instantaneous flow rate W_SPEED data greater than the start variance calculation threshold after the timestamp of the data frame corresponding to the average instantaneous flow rate W_SPEED, and q < b, the sample size N for variance calculation is taken as these q average instantaneous flow rate W_SPEED data greater than the start variance calculation threshold and z - q average instantaneous flow rate W_SPEED data greater than the start variance calculation threshold before the timestamp of the data frame corresponding to the average instantaneous flow rate W_SPEED; The q value is a value set manually in the ultrasonic water meter; According to the calculation formula Perform the calculation.

[0005] Where σ² is the variance, represents the th average instantaneous flow rate value ( = 1, 2,... z), , and is the arithmetic mean of the z flow rates; The ultrasonic water meter compares the calculated variance with the lower threshold of variance calculation; If the variance is less than the lower threshold of variance calculation, it is considered that the flow rate fluctuation is small, and the current water consumption is within the normal range. Enter step S6 to include the current cumulative water volume C in the official cumulative flow rate of the water meter; if the variance is greater than or equal to the lower threshold of variance calculation, then the average instantaneous flow rate W_SPEED corresponding to the variance is temporarily stored in the internal buffer of the MCU, and enter step S5 for the next judgment; The lower threshold of variance calculation is a value set manually in the ultrasonic water meter; S5: Judge whether the variance is greater than the upper threshold of variance calculation, and execute the corresponding result; synchronously judge whether the average instantaneous flow rate W_SPEED is greater than the instantaneous flow rate threshold of the variance algorithm, and execute the corresponding result; When is not greater than the upper threshold of variance calculation, discard the current cumulative water volume C; When is greater than the upper threshold of variance calculation, synchronously judge whether the average instantaneous flow rate W_SPEED is greater than the instantaneous flow rate threshold of the variance algorithm; The average instantaneous flow rate W_SPEED judged in step S5 is in step S3 ; the average instantaneous flow W_SPEED in step S3 is greater than the variance algorithm instantaneous flow threshold, the accumulated water amount C is determined to be counted into the cumulative flow in step S6, and step S6 is entered; if the average instantaneous flow W_SPEED in step S3 is not greater than the variance algorithm instantaneous flow threshold, the accumulated water amount C is discarded; The variance calculation upper threshold is a value set artificially in the ultrasonic water meter. S6: Settle the water amount this time. In the current sequence step, for the positive accumulated water amount C, the positive accumulated water amount C is calculated into the positive cumulative flow, and for the negative accumulated water amount C, the negative accumulated water amount C is calculated into the negative cumulative flow. The cumulative flow is the total effective water amount with the water flow direction recorded by the ultrasonic water meter. The direction of the accumulated water amount C is determined according to the symbol marks "+" and "-" in the data frame. "+" represents the positive accumulated water amount C, and "-" represents the negative accumulated water amount C.

[0006] Further, the FLOW_VAR_EN parameter value is a binary state value, which is used to determine whether to enable the variance fluctuation calculation.

[0007] Further, when the calculated variance satisfies: the variance calculation upper threshold ≦ the variance ≦ the variance calculation lower threshold, the water amount this time is directly discarded, and is not counted into the cumulative flow.

[0008] Further, in step S5, the variance algorithm instantaneous flow threshold is set to further confirm whether it belongs to the real water demand in the case of large variance, effectively reduce the false alarm caused by abnormal fluctuation, and avoid missing the real water demand.

[0009] Further, in step S2, after the average instantaneous flow W_SPEED and the accumulated water amount C in the unit time are calculated, the water meter stores the average instantaneous flow W_SPEED and the accumulated water amount C in the unit time in the storage module according to the preset data frame format. The preset data frame includes a time stamp, the absolute value of the average instantaneous flow W_SPEED, the accumulated water amount C, the symbol mark of the accumulated water amount C, a CRC check bit, and a state bit.

[0010] Further, the default value of the start variance calculation threshold is 300 L / h, the default value of the variance calculation lower threshold is 50, the default value of the variance calculation upper threshold is 500, and the default value of the variance algorithm instantaneous flow threshold is 800 L / h.

[0011] Further, the start variance calculation threshold, variance calculation lower threshold, variance calculation upper threshold and variance algorithm instantaneous flow threshold in steps S3-S5 are all supported to be modified through an intelligent ultrasonic water meter management platform. Default values are determined through a large amount of experimental data (such as long-term monitoring of resident water and small industrial water scenes), to ensure that in typical scenes, abnormal fluctuations can be effectively filtered, while normal water use is not missed; setting needs to be combined with actual field conditions, including water use scenes (such as resident water and industrial water, the former of which has smaller and more regular fluctuations, and the latter of which may have intermittent fluctuations of large flow); common interference factor analysis (such as whether water hammer effect and bubble interference frequently occur).

[0012] Further, in step S6, when the cumulative water volume C is positive, the calculation of the new positive total cumulative value adopts the mode of "current positive total cumulative + absolute value of C"; when C is negative, the calculation of the new negative total cumulative value adopts the mode of "current negative total cumulative + absolute value of C".

[0013] The present application proposes a method for filtering abnormal fluctuations of ultrasonic water meters based on variance algorithm, which considers the dynamic change characteristics of water flow fluctuations in various complex scenes, and through variance fluctuation calculation and multi-level judgment logic, the algorithm only calculates and counts normal water consumption when the ultrasonic water meter measures water volume, and does not count water volume fluctuations caused by other reasons in complex scenes, effectively filters abnormal water fluctuations, reduces false alarm risk, improves the accuracy and stability of water meter measurement. At the same time, it avoids incorrectly counting non-normal fluctuation data multiple times, reduces invalid data writing and wireless reporting, and also saves storage space and efficiency, and reduces device power consumption. BRIEF DESCRIPTION OF DRAWINGS

[0014] Figure 1 The present application proposes a method for filtering abnormal fluctuations of ultrasonic water meters based on variance algorithm, which considers the dynamic change characteristics of water flow fluctuations in various complex scenes, and through variance fluctuation calculation and multi-level judgment logic, the algorithm only calculates and counts normal water consumption when the ultrasonic water meter measures water volume, and does not count water volume fluctuations caused by other reasons in complex scenes, effectively filters abnormal water fluctuations, reduces false alarm risk, improves the accuracy and stability of water meter measurement. At the same time, it avoids incorrectly counting non-normal fluctuation data multiple times, reduces invalid data writing and wireless reporting, and also saves storage space and efficiency, and reduces device power consumption. DETAILED DESCRIPTION

[0015] In order to further understand the purpose, structure, features and functions of the present application, the following embodiments are described in detail.

[0016] The method for filtering abnormal fluctuations of ultrasonic water meters based on variance algorithm comprises the following steps: S1: determining whether to enable variance fluctuation calculation through the FLOW_VAR_EN parameter in the ultrasonic water meter; if enabled, proceed to step S2; if not enabled, proceed directly to step S6; Further, the water meter is an intelligent ultrasonic water meter; The FLOW_VAR_EN parameter is written in the intelligent ultrasonic water meter, and the FLOW_VAR_EN parameter value is set. The parameter value of FLOW_VAR_EN is a binary state value; The binary state value is: "enable / disable", or "true / false", or "yes / no"; The value of the parameter FLOW_VAR_EN is determined, if the value of the parameter FLOW_VAR_EN is "disable", or "false", or "no", it is determined that the cumulative water volume C corresponding to the unit time is counted into the cumulative flow in step S6, and it directly enters the following step S6; if the value of the parameter FLOW_VAR_EN is "enable", or "true", or "yes", it enters step S2.

[0017] Further, the parameter value of FLOW_VAR_EN is "0" or "1"; "0" represents disable, or "false", or "no", and "1" represents "enable" or "true", or "yes"; The value of the parameter FLOW_VAR_EN is determined, if the value of the parameter FLOW_VAR_EN is 0, it is determined that the cumulative water volume C corresponding to the unit time is counted into the cumulative flow in step S6, and it directly enters the following step S6; if the value of the parameter FLOW_VAR_EN is 1, it enters step S2.

[0018] The intelligent ultrasonic water meter is a water meter that can set and configure parameters, and is internally provided with electronic components (such as sensors, controllers, communication modules, etc.), and supports parameter writing, adjustment and configuration of operation parameters, metering rules, communication settings and the like through a specific way; the application only uses the parameter writing function of the intelligent ultrasonic water meter, and does not improve the intelligent ultrasonic water meter, and the principle of writing parameters of the intelligent ultrasonic water meter is not repeated here.

[0019] The FLOW_VAR_EN parameter: FLOW: corresponding to "flow", which is the core monitoring object of the intelligent ultrasonic water meter; VAR: is the abbreviation of "Variance" (variance), which refers to the variance fluctuation calculation of the flow; EN: is the abbreviation of "Enable" (enable).

[0020] Further, the setting of the FLOW_VAR_EN parameter in the intelligent ultrasonic water meter includes the following steps: Logging into the intelligent ultrasonic water meter management platform, logging into the remote management platform (web page or APP) of the intelligent ultrasonic water meter through a computer or a mobile phone; Positioning the target water meter, in the device list of the intelligent ultrasonic water meter management platform, the water meter to be queried is found through the water meter number, installation address or user information; or it is quickly positioned through the search function; Enter the parameter details page, click the "parameter configuration" or "device information" option of the intelligent ultrasonic water meter, and enter the parameter management interface; Read the FLOW_VAR_EN parameter value: find the FLOW_VAR_EN parameter under the "function enable parameter" or "metering related parameter" category, and its current value will be marked as "0 (disabled)" or "1 (enabled)". Modify the FLOW_VAR_EN parameter value and save it.

[0021] Setting and adjusting the FLOW_VAR_EN parameter of the intelligent ultrasonic water meter through the intelligent ultrasonic water meter management platform belongs to the prior art. The present application only applies the method of setting the FLOW_VAR_EN parameter of the intelligent ultrasonic water meter, and does not improve the method of setting and adjusting the FLOW_VAR_EN parameter of the intelligent ultrasonic water meter through the intelligent ultrasonic water meter management platform. The principle of setting and adjusting the FLOW_VAR_EN parameter of the intelligent ultrasonic water meter through the intelligent ultrasonic water meter management platform is not repeated here.

[0022] Further, according to user requests, adjust the FLOW_VAR_EN parameter value of the intelligent ultrasonic water meter; the user determines whether to request adjustment of the FLOW_VAR_EN parameter of the intelligent ultrasonic water meter according to the metering accuracy requirement; The judgment principle of the metering accuracy requirement is: If the intelligent ultrasonic water meter is in a temporary water use scene with low metering accuracy requirement, the user can request to actively turn off the variance fluctuation calculation function. At this time, the intelligent ultrasonic water meter detects that the function is not enabled, and directly adds the current water inflow to the formal cumulative flow without further fluctuation analysis; If in the water supply system of a certain residential area, the user wants to monitor the household water consumption through the intelligent ultrasonic water meter and wants to know the approximate household water consumption. In this case, the user can request to actively turn on the variance fluctuation calculation function, and when the intelligent ultrasonic water meter receives the water quantity calculation instruction, it judges that the variance fluctuation calculation function is enabled, thereby entering the variance fluctuation calculation process.

[0023] This step provides "on-off control" for the variance fluctuation calculation function by writing the FLOW_VAR_EN parameter, realizes flexible control of the fluctuation calculation function, so that the water meter can choose whether to perform complex fluctuation calculation according to actual needs, which can meet the metering accuracy requirement in different scenes and save calculation resources and time. Moreover, the remote management platform is used to set the parameter, which supports batch configuration of multiple water meters and improves management efficiency.

[0024] S2: Measure the average instantaneous flow rate W_SPEED, cumulative water volume C, and direction of water flow of the ultrasonic water meter in a unit time. The intelligent ultrasonic water meter comprises a measurement assembly, a signal processing and control assembly, an auxiliary function assembly, a storage module, an address decoder and a data bus and a structural auxiliary assembly. (1) The measurement assembly comprises an ultrasonic transducer, a measurement pipe section and a temperature sensor. The ultrasonic transducer is used for transmitting and receiving ultrasonic signals; further, the ultrasonic transducer comprises a forward-flow transducer and a reverse-flow transducer, and is respectively installed on two sides of the measurement pipe section and is apart by a certain distance.

[0025] The measurement pipe section is a passage for water flow, and is used for providing a stable path for ultrasonic propagation.

[0026] The temperature sensor is a contact type temperature sensing element, is installed on the inner wall of the measurement pipe section, and is used for collecting temperature data of water flow, and provides a basic parameter for correction of ultrasonic propagation speed.

[0027] (2) The signal processing and control assembly comprises a main control circuit board and a signal conditioning circuit. The main control circuit board is used for receiving time difference signals transmitted by the ultrasonic transducer, calculating instantaneous flow and cumulative flow through a preset algorithm, and is responsible for controlling the operation logic (such as data storage, communication triggering) of the entire water meter. The main control circuit board comprises an MCU module, and is responsible for executing programs and calculating data. The signal conditioning circuit is used for amplifying, filtering and shaping weak electric signals received by the transducer, removing noise interference, and ensuring that the signals can be accurately recognized by the main control circuit.

[0028] (3) The auxiliary function assembly comprises a display screen (LCD / LED), a power module, a communication module and a valve control module. The display screen (LCD / LED) is used for directly displaying cumulative flow, instantaneous flow, working state (such as battery power, fault code) and the like, so as to facilitate user reading and maintenance. The power module is used for supplying power for the entire intelligent ultrasonic water meter. The communication module is used for realizing remote transmission of data, and is connected with a meter reading system and an Internet of Things platform. The valve control module is used for receiving remote instructions or local trigger signals (such as underpayment and failure), controlling the opening and closing of the valve, and realizing water cut-off / water passing.

[0029] (4) The storage module is a non-volatile memory, and the non-volatile memory is a memory with data retention capability after power failure. (5) The address decoder is used for converting a logical storage address into a physical address recognizable by the storage module. (6) The data bus is a hardware circuit connecting the host circuit board and the storage module, used for transmitting storage instructions, address signals and data signals. When water flows through the body of the intelligent ultrasonic water meter, the temperature sensor collects the water flow temperature Te, and transmits the temperature signal (analog signal) to the MCU module of the host circuit board after being converted into a digital signal by the signal conditioning circuit (including A / D conversion function); the MCU module stores the water flow temperature Te in the storage module; at the same time, under the control of the MCU module, the transducer alternately emits ultrasonic waves (once in the forward flow and once in the reverse flow), and gives a time difference signal by calculating the time difference of the propagation of the sound waves in the forward flow and the reverse flow; The transducer has two, respectively arranged at both ends of the measuring pipe section, respectively as the forward flow transducer and the reverse flow transducer; the forward flow transducer is arranged at the upstream of the measuring pipe section, and the reverse flow transducer is arranged at the downstream of the measuring pipe section.

[0030] Specifically, the method comprises the following steps: S21: collecting the forward flow sound wave propagation time ; The forward flow transducer emits an ultrasonic wave signal to the opposite bank, and the reverse flow transducer receives the ultrasonic wave signal passing through the water flow and converts it into a forward flow electric signal.

[0031] The reverse flow transducer transmits the received forward flow electric signal to the signal conditioning circuit, and after amplification (enhancing signal strength), filtering (removing pipeline vibration, electromagnetic interference and other noises), shaping (converting irregular signals into standard pulse signals) processing, transmits to the host circuit board. The MCU module of the host circuit board records the propagation time of the forward flow ultrasonic wave signal through the built-in timer (unit: s).

[0032] S22: collecting the reverse flow sound wave propagation time ; The reverse flow transducer of the original receiving end is used as a transmitter to emit an ultrasonic wave signal to the forward flow transducer of the original transmitting end, and the signal propagation direction is opposite to the water flow direction (reverse flow). The forward flow transducer captures the ultrasonic wave signal passing through the water flow and converts it into a reverse flow electric signal.

[0033] The forward flow transducer transmits the received reverse flow electric signal to the signal conditioning circuit, and after amplification (enhancing signal strength), filtering (removing pipeline vibration, electromagnetic interference and other noises), shaping (converting irregular signals into standard pulse signals) processing, transmits to the host circuit board. The MCU module of the host circuit board records the propagation time of the forward flow ultrasonic wave signal through the built-in timer (unit: s).

[0034] S23: the MCU module calculates the difference between the forward flow and reverse flow propagation times (unit: s), and record the and , and the time difference signal as the core measurement data in the storage module; S24: The MCU module compares and to determine the direction of the water flow: if > , recorded as a positive value, i.e. the single water inflow is a positive water flow; if < , recorded as a negative value, i.e. the single water inflow ; S25: The MCU module calculates the water flow axial velocity v based on and . The specific calculation process is as follows: First, calculate the propagation speed Vc of the ultrasonic wave at the current water temperature Vc = 1482 + 2.5 × (Te-20) by the temperature correction formula, where Te is the water flow temperature in ℃.

[0035] When flowing downstream, the actual propagation speed of the ultrasonic wave is , and the downstream propagation time is ; When flowing upstream, the actual propagation speed of the ultrasonic wave is , and the upstream propagation time is , , then the positive and negative time difference is (unit: s).

[0036] Where is the straight-line distance between the two ultrasonic transducers (unit: m, determined by the water meter structure), is the angle between the ultrasonic wave propagation path and the pipe axis (unit: °, determined by the water meter structure), is the propagation speed of the ultrasonic wave in still water, is the water flow axial velocity (unit: m / s). Since is much smaller than , the denominator can be ignored, and it is further simplified as: .

[0037] Solving the water flow axial velocity .

[0038] S26: The MCU module calculates the single water inflow and the cumulative water volume C; The water meter pipe cross-sectional area (unit: m2) S = Where D is the pipe diameter (unit: m, determined by the water meter model, such as D = 0.025 m for a DN25 model).

[0039] Further, the single water intake amount Q is obtained = (unit: L), t is the single measurement time interval (unit: s, preset by the water meter), and 1000 is the conversion coefficient for converting units from to L.

[0040] In the set unit time T (unit: s, preset by the water meter), the accumulator accumulates all single water intake amounts Q in the unit time T to obtain the accumulated water amount in the unit time T

[0041] The "unit time T" and "single measurement time interval t" are respectively the basic period for calculating the accumulated water amount and the basic period for calculating the single water intake amount in the intelligent ultrasonic water meter, both in seconds (s). The intelligent ultrasonic water meter management platform is logged in, and the corresponding remote management platform (web page or APP) of the intelligent ultrasonic water meter is logged in through a computer or a mobile phone to modify the parameter value. The specific process is as follows: Log in to the management platform and locate the target water meter; enter the "metering parameter configuration" interface, find the "unit time" or "single measurement time interval" option; input the target value, submit and save, and then the platform will download the new parameter to the water meter through the communication module; the water meter receives and updates the unit time T or the single measurement time interval t, and restarts to take effect.

[0042] The preset of the unit time T or the single measurement time interval t is realized through the parameter configuration function of the existing intelligent ultrasonic water meter, which belongs to the prior art. The present application only uses the preset result and does not improve the configuration method. The data transmission principle of the communication module is not repeated here.

[0043] The accumulator is a special operation register integrated in the MCU module in the intelligent ultrasonic water meter, used for temporarily storing the accumulated water intake amount in the unit time, and the initial value is 0. The accumulation process is as follows: After step S1 determines that the variance fluctuation calculation is effective (FLOW_VAR_EN = 1), the accumulator is started, and the timer is started synchronously, with the unit time T as the period; in the unit time T, the calculation of the single water intake amount Q is completed each time, and Q is immediately transmitted to the accumulator; the accumulator updates its stored value according to the operation logic of C , where n is the number of measurements in the unit time T. That is, in the preset unit time T, each time Q is calculated, it is added to the accumulator. When the calculated C is negative, the sign is "-"; when the calculated C is positive, the sign is "+".

[0044] When the timer of the master control board reaches the preset unit time T, an interrupt signal is sent to the MCU module. After the MCU module receives the signal, it temporarily locks the current accumulated water volume C stored in the accumulator, ensures that the subsequent reset operation does not affect the value of C, and stores the value of C in the storage module.

[0045] S27: The MCU module calculates the average instantaneous flow rate W_SPEED. The average instantaneous flow rate W_SPEED is the ratio of the current accumulated water volume C to the measurement unit time T, and is converted to a unit of hourly flow rate (L / h) to obtain: where T is the unit time (unit: s), and 3600 is the conversion factor for converting seconds (s) to hours (h).

[0046] Further, in the storage module of the intelligent ultrasonic water meter, a dedicated storage space is allocated to save the current instantaneous flow rate W_SPEED and the accumulated water volume C, to ensure the integrity and accessibility of the data. When step S2 is executed, the intelligent ultrasonic water meter writes the current instantaneous flow rate W_SPEED and the accumulated water volume C into the specified storage location according to the preset data structure and storage format, and the specific process is as follows: First, after the MCU module of the master control board completes the calculation of the average instantaneous flow rate W_SPEED and the accumulated water volume C, the data is packaged and processed, and the field data is integrated in turn to generate a complete data frame. In the data frame: the first 4 bytes are the timestamp (based on the current time of the built-in RTC clock); the 5th-8th bytes are the average instantaneous flow rate W_SPEED (32-bit floating point number); the 9th-12th bytes are the absolute value of the accumulated water volume C (32-bit floating point number); the 13th byte is the sign of C (0x00 is written for "+", and 0x01 is written for "-"); the 14th byte is reserved (0xFF is filled as a reserved bit); the 15th-16th bytes are CRC check bits (the MCU module executes CRC16 algorithm on the first 14 bytes of data through the built-in CRC operation unit, generates 16-bit check value and fills in high 8 bits and low 8 bits); the 17th byte is the status bit (initially written as 0x00, and updated to 0x01 to indicate valid data after data writing is completed).

[0047] Then, the MCU module parses the logical storage address of the storage module (such as "metering data area n group", n is the current measurement period sequence number) through the address decoder: the system presets the starting address of the "metering data area" as 0x0200, each frame of data occupies 17 bytes of storage space, the MCU module determines the smallest target physical address (such as 0x0211) that is not occupied by reading the "address occupation table" (stored in the 0x0000-0x00FF address segment) of the storage module, and then the MCU module sends a write instruction to the storage module through the data bus: the instruction includes an operation code (0x02, representing "data write"), a target physical address (such as 0x0211) and a 17-byte data frame. After receiving the instruction, the storage module returns an acknowledgement signal (0x00, representing "successful reception of instruction") through the data bus, and then enters a data receiving state, receiving 17 bytes of data in sequence and temporarily storing them in the MCU internal buffer area.

[0048] After writing is completed, the storage module starts the verification mechanism: the built-in verification unit recalculates the CRC16 value of the first 14 bytes of the received data and compares it with the check bits of the 15th-16th bytes. If they are consistent, the storage module writes the 17-byte data in the buffer area to the target physical address (such as 0x0211-0x0221), and feeds back a "write success" signal (0x01) to the MCU module through the data bus; if the verification is inconsistent, the storage module feeds back a "verification failure" signal (0x02).

[0049] When the MCU module receives the "write success" signal, it updates the state bit of the 17th byte of the data frame from 0x00 to 0x01; at the same time, it updates the state of the corresponding address in the "address occupation table" of the storage module (marked as "occupied") and records the storage address of the data in the storage module. At this point, the storage process of the instantaneous flow W_SPEED and the cumulative water volume C is completed.

[0050] When the second unit time T is reached: The MCU module sends a "clear zero instruction" to the accumulator through the internal data bus (this instruction is a preset control signal between the MCU module and the accumulator, and the corresponding binary operation code is 0x00, for example). After receiving the clear zero instruction, the internal control circuit of the accumulator clears the cumulative water volume C value, and enters the second unit time T; Repeat steps S21-S26 to obtain the average instantaneous flow W_SPEED, the cumulative water volume C and the direction of the water flow in the second unit time T.

[0051] Similarly, in the nth unit time T, the average instantaneous flow W_SPEED, the cumulative water volume C and the direction of the water flow in the nth unit time T are obtained.

[0052] Suppose in 1 second unit time, water meter (DN25 caliber ultrasonic water meter, Q3) Calculate 3 times of water inflow, respectively +0.5L, +0.6L, +0.65L, then the cumulative water volume of this time L, average instantaneous flow rate .

[0053] This step can dynamically record the cumulative water volume C, average instantaneous flow rate W_SPEED and flow direction of each unit time T by monitoring the water flow, so as to ensure the accuracy of subsequent measurement and analysis.

[0054] S3: determine whether each average instantaneous flow rate W_SPEED in step S2 is greater than the start variance calculation threshold, and execute the corresponding result; The intelligent ultrasonic water meter reads each average instantaneous flow rate W_SPEED through the address decoder to analyze the storage address of W_SPEED (the preset metering data area address in step S2) according to the MCU module of the main control circuit board, and compares it with the preset start variance calculation threshold FLOW_VAR_START (default value 300L / h, length 16bit).

[0055] For the average instantaneous flow rate W_SPEED in unit time greater than the start variance calculation threshold, the intelligent ultrasonic water meter considers that the flow is in normal water use state at this time, directly skips the fluctuation analysis, determines that the cumulative water volume C in the corresponding unit time is counted into the cumulative flow in step S6, and enters step S6; Further, the MCU module is internally integrated with an internal counting unit, which supports assignment of integer type values and self-increment operation.

[0056] If the average instantaneous flow rate W_SPEED is not greater than the average instantaneous flow rate W_SPEED, count this average instantaneous flow rate W_SPEED into , I is an integer, representing the number of average instantaneous flow rates W_SPEED in the above formula, I≥0; then it is considered that the water volume at this time may belong to abnormal water use, and the next step of variance judgment needs to be entered in step S4; and set the parameter m through the internal counting unit of the MCU module, m is an integer index, the initial value is 1. In the subsequent processing steps, m will start from 1 and increase to I, so that each W_SPEED value in the above formula can be processed in turn. The meaning of m is that the mth data in the above formula is being processed.

[0057] ​​The starting variance calculation threshold (denoted as FLOW_VAR_START) is a flow rate threshold used to determine whether variance analysis needs to be started. The unit is L / h, the default value is 300L / h, and the data type is a 16-bit unsigned integer.

[0058] In the FLOW_VAR_START parameter: FLOW: corresponds to "flow rate" and indicates the monitoring object associated with the parameter; VAR is an abbreviation for "Variance," referring to the calculation of variance fluctuation. START: Indicates "start", which is the threshold that triggers variance calculation.

[0059] The threshold for calculating the initiation variance is modified through the intelligent ultrasonic water meter management platform. The specific process is as follows: Log in to the management platform and locate the target water meter; enter the "Threshold Parameter Configuration" interface and find "FLOW_VAR_START"; enter the target value, submit and save, and the platform will send it to the water meter through the communication module; the smart ultrasonic water meter receives the new value, overwrites the parameter stored at the original address, and takes effect after restarting.

[0060] The preset threshold for initiating variance calculation is achieved through the parameter configuration function of the smart ultrasonic water meter, which is existing technology. This invention only applies the method for setting the threshold for initiating variance calculation, without improving the setting method. The principle of setting the threshold for initiating variance calculation will not be elaborated here.

[0061] The threshold for calculating the starting variance is a "critical value for normal high flow" determined by a large number of experiments. If the average instantaneous flow rate W_SPEED is greater than the threshold for calculating the starting variance, it usually indicates real water demand with small and continuous fluctuations. If the average instantaneous flow rate W_SPEED is not greater than the threshold for calculating the starting variance, it may indicate normal and stable water use (such as dripping water from a faucet) or abnormal fluctuations (such as water hammer or bubble interference). Further judgment is needed to avoid omissions.

[0062] This step, by setting a flow threshold to initiate variance calculation, can quickly filter out flow situations that may be in a normal water usage state, avoiding unnecessary fluctuation analysis of large flow rates, improving the execution efficiency of the algorithm, and also reducing the risk of misjudgment caused by large flow fluctuations.

[0063] S4: Determine variance Check if it is less than the threshold calculated from the variance, and execute the corresponding result; The intelligent ultrasonic water meter reads the average instantaneous flow rate W_SPEED by parsing the storage address of W_SPEED (the metering data area address preset in step S2) through the address decoder of the MCU module on the main control circuit board. For step S3... The mth average instantaneous flow W_SPEED in the data frame is calculated by a number of z, which is the sum of a number of average instantaneous flow W_SPEED data greater than the start variance calculation threshold before the timestamp of the data frame, and a number of average instantaneous flow W_SPEED data greater than the start variance calculation threshold after the timestamp of the data frame. Wherein, a and b are positive integers, the values of a and b are preset according to the water use scene, and the specific values of a and b can be configured through the intelligent ultrasonic water meter management platform.

[0064] Further, the setting principles of a and b are dynamically adjusted in combination with the flow stability characteristics of the water use scene: For a scene with smooth flow fluctuations (such as daily water use of residents), a symmetric distribution of a=7 and b=8 is used by default, so that the sample set uniformly covers the front and rear intervals of the data to be processed on the time axis, reducing the influence of short-term random fluctuations on the mean value; For a scene with trend characteristics of flow changes (such as periodic water use of industrial production), set b>a to increase the weight of historical data to capture trend characteristics; For a scene with frequent burst flow (such as intermittent water use of commercial places), set b The above setting principles expand the applicability of the scheme through the scene-based value rules, which can meet the use requirements in different scenes.

[0065] The z average instantaneous flows W_SPEED obtained are counted as ; The mth average instantaneous flow value (m=1, 2,...z) is represented by , , , which is the arithmetic mean of 15 flows. For calculating the variance : When the number n of stored average instantaneous flow W_SPEED data greater than the start variance calculation threshold is greater than or equal to z: If there are only p average instantaneous flow W_SPEED data greater than the start variance calculation threshold before the timestamp of the data frame corresponding to the average instantaneous flow W_SPEED and p If the timestamp of the data frame corresponding to the average instantaneous flow W_SPEED has only q average instantaneous flow W_SPEED data greater than the start variance calculation threshold and q < b, the sample size N of variance calculation is the q average instantaneous flow W_SPEED data greater than the start variance calculation threshold and the z-q average instantaneous flow W_SPEED data greater than the start variance calculation threshold before the timestamp of the data frame corresponding to the average instantaneous flow W_SPEED; p, q are values set artificially in the ultrasonic water meter; so that when the effective data is less than the preset quantity, the total amount of samples is ensured to be z by supplement.

[0066] According to the calculation formula , the calculation is performed. Wherein σ² is the variance, , the average instantaneous flow value of the first =1, 2,...z), , the arithmetic mean of the z flow values.

[0067] When the number n of stored average instantaneous flow W_SPEED data greater than the start variance calculation threshold is less than z, the calculation is performed according to the calculation formula . The variance is calculated. The sample size N of variance calculation is the actual number n of average instantaneous flow W_SPEED data, and at this time .

[0068] Whether the current water quantity is fluctuation or normal water use is determined by the variance , and the fluctuation is filtered. The size of the variance reflects the fluctuation of the instantaneous flow, and the variance large reflects that the instantaneous flow fluctuation is large, and the variance small reflects that the instantaneous flow fluctuation is small.

[0069] The lower threshold of variance calculation (denoted as FLOW_VAR_DOWN_WIETH) is a critical value for determining whether the flow fluctuation is stable, and the default value is 50, and the data type is 32-bit unsigned integer.

[0070] The LOW_VAR_DOWN_WIETH parameter: FLOW: corresponds to "flow", indicating the monitoring object associated with the parameter; VAR: is the abbreviation of "Variance", which refers to variance fluctuation calculation; DOWN: indicates "lower limit", that is, the critical value of fluctuation stability.

[0071] The lower threshold of variance calculation can be set and modified through the intelligent ultrasonic water meter management platform, and the specific process is as follows: ​Log in to the management platform, locate the target water meter; enter the "threshold parameter configuration" interface, find "FLOW_VAR_DOWN_WIETH"; input the target value, submit and save, then the platform issues to the water meter through the communication module; the water meter receives the new value, overwrites the parameters stored in the original address, and takes effect after restarting.

[0072] The threshold preset is realized by the parameter configuration function of the intelligent ultrasonic water meter, and belongs to the prior art; the present application only applies the preset value, and does not improve the configuration method.

[0073] The intelligent ultrasonic water meter compares the calculated variance with the threshold under variance calculation.

[0074] The threshold under variance calculation is a "stable fluctuation threshold", and if the variance is less than the threshold under variance calculation, the intelligent ultrasonic water meter considers that the flow fluctuation is small, and the cumulative water amount C corresponding to the unit time in this use is determined to be included in the cumulative flow in step S6, and step S6 is entered; otherwise, the mth average instantaneous flow W_SPEED in the step is temporarily stored in the MCU internal buffer area, and step S5 is entered for next step judgment.

[0075] The variance calculation is the core part of the algorithm, which calculates the variance through 15 average instantaneous flow data greater than the start variance calculation threshold, and the size of the variance reflects the volatility of the flow. If the variance is less than the threshold under variance calculation, it indicates that the flow is relatively stable, indicating that the current water use is relatively stable, and the water demand changes little, which usually occurs in normal and continuous water use processes, such as slow water flow of a faucet in a family, constant water use of small household appliances, etc., indicating that the water flow is relatively smooth in the pipeline without obvious interference factors, and the cumulative water amount C can be included in the cumulative flow.

[0076] The present application preliminarily screens stable water use by judging whether the variance is less than the threshold under variance calculation, reducing the workload of subsequent complex judgment. If the variance is small to a certain extent, it indicates that the average instantaneous flow is relatively stable, and it can be determined as normal water use, at which time more complex judgment is not needed, and water amount can be directly calculated, simplifying the judgment process and improving the execution efficiency of the algorithm.

[0077] S5: judge whether the variance is greater than the upper threshold of variance calculation, and execute the corresponding result; simultaneously judge whether the average instantaneous flow W_SPEED is greater than the threshold of instantaneous flow of variance algorithm, and execute the corresponding result; ​When the calculated variance When the calculated variance is not less than the variance calculation lower threshold, the step S4 continues to judge the variance calculated in step S4 whether it is greater than the preset variance calculation upper threshold FLOW_VAR_UP_WIETH.

[0078] The variance calculation upper threshold (denoted as FLOW_VAR_UP_WIETH) is a critical value for judging whether the flow fluctuation is stable, and the default value is 500, and the data type is 32-bit unsigned integer.

[0079] The FLOW_VAR_UP_WIETH parameter: FLOW: corresponds to "flow", indicating the monitoring object associated with the parameter; VAR: is the abbreviation of "Variance", which refers to variance fluctuation calculation; UP: represents "upper limit", that is, the critical value of fluctuation stability.

[0080] The variance calculation upper threshold can be modified through the intelligent ultrasonic water meter management platform, and the specific process is similar to the modification of the variance calculation lower threshold in step S4, which will not be repeated here.

[0081] Only when the variance is not less than the variance calculation lower threshold, that is, the variance is greater than the variance calculation lower threshold, it is further judged whether it is greater than the variance calculation upper threshold, which is to more accurately distinguish the degree of flow fluctuation.

[0082] If the variance is less than or equal to the variance calculation upper threshold, and the variance is greater than or equal to the variance calculation lower threshold, that is, the variance calculation lower threshold ≦ variance ≦ variance calculation upper threshold, in this case, these fluctuations usually correspond to non-real water demand, such as slight vibration of the pipeline, water hammer, bubbles, intermittent start and stop of equipment, etc. In order to prevent misjudgment and avoid cumulative errors, this time water will be discarded and not included in the cumulative calculation.

[0083] The variance calculation upper threshold is used to identify cases where the flow fluctuation is large. If the variance exceeds the variance calculation upper threshold, that is, the variance > variance calculation upper threshold, then it means that the flow fluctuation is large, indicating that the current water use is unstable and there is a large change in water demand. This may be due to multiple water-using devices being turned on or off at the same time, bubbles or turbulent flow in the pipeline, etc. For example, in household water use, the start and stop of multiple water-using devices such as washing machines and showers will cause significant changes in flow. In order to avoid missing the real large flow, it is necessary to further judge in combination with the average instantaneous flow W_SPEED: Read from the MCU's internal buffer The m-th average instantaneous flow rate W_SPEED in the data will be... The m-th average instantaneous flow rate W_SPEED is numerically compared with the instantaneous flow rate threshold FLOW_VAR_SPEED from the variance algorithm to determine... The system checks whether the m-th average instantaneous flow rate W_SPEED is greater than the instantaneous flow rate threshold FLOW_VAR_SPEED in the variance algorithm. If the comparison result is "greater than", the current fluctuation is determined to be a normal large flow rate fluctuation, and the accumulated water volume C within the corresponding unit time is included in the accumulated flow rate in step S6, and the program flow is controlled to enter step S6; if it is "not greater than", it is determined to be an abnormal fluctuation, and the current water volume is directly discarded and not included in the accumulated flow rate.

[0084] The instantaneous flow threshold of the variance algorithm (denoted as FLOW_VAR_SPEED) is the critical value for judging whether the flow fluctuation is stable. The default value is 800L / h, and the data type is a 16-bit integer.

[0085] The FLOW_VAR_SPEED parameter: FLOW: corresponds to "flow rate" and indicates the monitoring object associated with the parameter; VAR is an abbreviation for "Variance," referring to the calculation of variance fluctuation. SPEED: Indicates "instantaneous", which means the average instantaneous flow rate.

[0086] If the previous steps indicate significant traffic fluctuations, further assessment is required in this step. The calculation checks whether the m-th average instantaneous flow rate W_SPEED exceeds the instantaneous flow rate threshold of the variance algorithm. The instantaneous flow rate threshold of the variance algorithm is used to further confirm whether the water volume needs to be included in the calculation when the variance is high, thus obtaining a more accurate result. If... When the m-th average instantaneous flow rate W_SPEED in the calculation exceeds the instantaneous flow rate threshold of the variance algorithm, the smart ultrasonic water meter considers that even with high variance and large flow rate fluctuations, it may be due to normal high water demand. In this case, the smart ultrasonic water meter will consider this normal water usage behavior, rather than a misjudgment caused by small flow rate fluctuations, and thus proceed to step S6 to include this water volume in the formal cumulative flow; conversely, if... If the m-th average instantaneous flow rate W_SPEED is not greater than the instantaneous flow rate threshold of the variance algorithm, it indicates that the water flow rate fluctuates greatly but the flow rate is low. This is often not normal water use behavior. For example, when there is a leak in the pipe, irregular water flow in and out will occur under low flow conditions, resulting in a large variance, and thus the water volume of this time will be discarded.

[0087] S6: Settle the water volume for this transaction.

[0088] The current sequence step determines whether the current cumulative water volume C is added to the cumulative flow. If so, the forward flow is calculated into the forward cumulative flow, and the reverse flow is calculated into the reverse cumulative flow. If not, the current cumulative water volume C is discarded.

[0089] The cumulative flow is the total effective water volume recorded by the ultrasonic water meter with direction.

[0090] The MCU module sends a read instruction (operation code 0x03) to the storage module through the data bus, specifies the target physical address (the preset metering data area address in step S2), and reads a 17-byte data frame. After the storage module returns the data, the MCU module parses it according to the preset format: extracts the absolute value of C from bytes 9-12; extracts the sign identifier (0x00 represents "+", 0x01 represents "-") from byte 13; and checks whether the state bit is 0x01 (confirms that the data is valid) from byte 17. Further, the storage module also contains a "total cumulative data area", which contains two 64-bit floating-point storage units: forward total cumulative and reverse total cumulative. The forward cumulative flow (ADDR: 0x0500-0x0507) is used to store the total sum of forward effective water volume; the reverse cumulative flow (ADDR: 0x0508-0x050F) is used to record the total sum of reverse effective water volume (store absolute value). The specific update logic is: if the sign identifier is 0x00, indicating that C is positive, the new forward total cumulative = current forward total cumulative + C, and is written to the 0x0500-0x0507 address through the data bus; if the sign identifier is 0x01, indicating that C is negative, the new reverse total cumulative = current reverse total cumulative + |C|, and is written to the 0x0508-0x050F address through the data bus. Finally, the settlement of this water volume is completed, and the real-time cumulative flow value can be updated on the display screen of the auxiliary function component for the user to view.

[0091] After completing the processing of the mth average instantaneous flow W_SPEED in , the count unit in the MCU module executes "m = m + 1". If the updated m value is ≤ I, steps S4-S6 are continued to process the average instantaneous flow W_SPEED that has not been processed in .

[0092] This step realizes the entire algorithm to count normal water consumption, respectively accumulates forward and reverse water volume, realizes accurate differentiation and accumulation of flow with water flow direction. Separately storing the total cumulative flow according to the water flow direction is to meet the metering demand of "differentiating forward or reverse water consumption" (such as needing to count reverse flow loss in some scenarios); realizing independent statistics of flow with water flow direction improves the degree of metering refinement.

[0093] Through the implementation of the above detailed steps, the method for filtering abnormal fluctuation of an ultrasonic water meter based on variance fluctuation of the application calculates the variance of the average instantaneous flow data collected within a certain unit of time , so as to determine the degree of fluctuation of the flow . The size of the variance reflects the fluctuation of the average instantaneous flow: the smaller the variance , the more stable the flow; the larger the variance , the more intense the fluctuation of the flow. By setting a reasonable threshold, normal water fluctuation and abnormal water fluctuation can be effectively distinguished, thereby realizing accurate filtering of abnormal fluctuation. This method can effectively distinguish between normal water use and abnormal water use, realize efficient and accurate water quantity calculation, reduce the risk of false positives, and bring convenience to users.

[0094] The application has been described by the above related embodiments, however, the above embodiments are only examples for implementing the application. It must be pointed out that the disclosed embodiments do not limit the scope of the application. On the contrary, modifications and improvements made without departing from the spirit and scope of the application are within the scope of the patent protection of the application.

Claims

1. A method for filtering abnormal fluctuations of an ultrasonic water meter based on a variance algorithm, characterized in that, The method comprises the following steps: S1: determining whether to enable variance fluctuation calculation through the FLOW_VAR_EN parameter in the ultrasonic water meter; if enabled, proceeding to step S2; if not enabled, directly proceeding to step S6; S2: measuring and calculating the average instantaneous flow W_SPEED, the cumulative water volume C, and the direction of the water flow in the ultrasonic water meter within a unit time; The unit time is a set unit time T; S21: measuring and calculating the direction of the water flow in the ultrasonic water meter within a unit time comprises the following steps: In unit time T, respectively collect the forward sound wave propagation time and the reverse sound wave propagation time , the MCU module calculates the difference between the forward and reverse propagation times , the MCU module compares the size of and to determine the direction of the water flow, and obtains the direction of the water flow, which includes forward and reverse; the forward is marked with "+" symbol, and the reverse is marked with "-" symbol; S22: measuring and calculating the cumulative water volume C in the ultrasonic water meter within a unit time comprises the following steps: Within the unit time T, First, the MCU module is based on and Calculate the axial velocity v of the water flow to obtain the axial velocity of the water flow. Then the MCU module is based on the axial velocity of the water flow. The single inflow volume is calculated from the water meter pipe cross-sectional area S and the time interval of a single measurement. Finally, the accumulator sums up all the individual water inflow volumes Q within a unit of time to obtain the cumulative water volume for this unit of time. ; S22: measuring and calculating the average instantaneous flow W_SPEED in the ultrasonic water meter within a unit time comprises the following steps: Within the unit time T, The MCU module calculates the average instantaneous flow W_SPEED; The average instantaneous flow W_SPEED is the ratio of the cumulative water volume C to the measurement unit time T; Thus, within a unit time T, a set of average instantaneous flow W_SPEED, cumulative water volume C, and water flow direction data are formed; By analogy, for the nth unit time T, the average instantaneous flow W_SPEED, the cumulative water volume C, and the direction of the water flow in the nth unit time T are obtained; after each unit time T ends, the ultrasonic water meter packages and stores the measured and calculated average instantaneous flow W_SPEED, cumulative water volume C, and water flow direction according to a preset byte data frame format, and completes the data acquisition and storage of the average instantaneous flow W_SPEED, cumulative water volume C, and water flow direction within the unit time; the data frame comprises a timestamp, the water flow direction within the unit time T, the average instantaneous flow W_SPEED, and the cumulative water volume C; S3: determining whether each average instantaneous flow W_SPEED in all average instantaneous flows W_SPEED in step S2 is greater than a start variance calculation threshold value, and executing the corresponding result; In the step S3, for the average instantaneous flow rate W_SPEED not greater than the start variance calculation threshold value, the average instantaneous flow rate W_SPEED is counted into , I is an integer, representing the number of the average instantaneous flow rates W_SPEED in the step S2, and I≥0, and then the step S4 is entered to process the average instantaneous flow rate W_SPEED not greater than the start variance calculation threshold value; For the average instantaneous flow W_SPEED within the unit time that is greater than the start variance calculation threshold value, it is determined that the cumulative water volume C within the corresponding unit time is counted into the cumulative flow in step S6, and directly jumps to step S6; The start variance calculation threshold value is a value set by a person in the ultrasonic water meter; S4: Determine variance Check if it is less than the threshold calculated from the variance, and execute the corresponding result; For each average instantaneous flow rate W_SPEED in step S3 the variance is calculated comprising the steps of: The average instantaneous flow W_SPEED corresponding to the timestamp of the data frame is obtained, and a total of z average instantaneous flows W_SPEED are obtained; wherein a+b=z, a and b are positive integers, and the specific values of a and b are configured through an ultrasonic water meter management platform; The obtained z average instantaneous flow rates W_SPEED are counted ; represents the average instantaneous flow value for the first time, wherein = 1, 2,... z, is the arithmetic average of the z flow values; Computing variance : When the number n of average instantaneous flow rate W_SPEED data greater than the start-up variance calculation threshold value has been stored, n < z, the variance The calculated sample size N takes all the number n of average instantaneous flow rate W_SPEED data greater than the start-up variance calculation threshold value, according to the calculation formula The calculation is performed, at which time ; When the number n of the stored average instantaneous flows W_SPEED greater than the start variance calculation threshold value is greater than or equal to z: If there are only p average instantaneous flow rate W_SPEED data greater than the threshold value of starting variance calculation before the timestamp of the data frame corresponding to the average instantaneous flow rate W_SPEED, and p < a, the sample size N of variance calculation is taken as the p average instantaneous flow rate W_SPEED data greater than the threshold value of starting variance calculation and the z-p average instantaneous flow rate W_SPEED data greater than the threshold value of starting variance calculation after the timestamp of the data frame corresponding to the average instantaneous flow rate W_SPEED; The value of p is a value set artificially in the ultrasonic water meter; If there are only q average instantaneous flow rate W_SPEED data greater than the threshold value of starting variance calculation after the timestamp of the data frame corresponding to the average instantaneous flow rate W_SPEED, and q < b, the sample size N of variance calculation is taken as the q average instantaneous flow rate W_SPEED data greater than the threshold value of starting variance calculation and the z-q average instantaneous flow rate W_SPEED data greater than the threshold value of starting variance calculation before the timestamp of the data frame corresponding to the average instantaneous flow rate W_SPEED; The value of q is a value set artificially in the ultrasonic water meter; According to the calculation formula the calculation is performed; where σ2is the variance, denotes the average instantaneous flow value of the zth flow, where = 1, 2,... z, is the arithmetic mean of the z flows; The ultrasonic water meter will calculate the variance Numerically compare the calculated variance to the threshold value under variance calculation; If variance If the flow rate is less than the threshold calculated by variance, the flow rate fluctuation is considered small and the water consumption is within the normal range. Proceed to step S6 to add the accumulated water volume C to the water meter's official accumulated flow rate. If the variance... If the variance is greater than or equal to the threshold value used for variance calculation, then the variance will be... Corresponding The average instantaneous flow rate W_SPEED is temporarily stored in the internal buffer of the MCU and then proceeds to step S5 for the next judgment. The lower threshold value of variance calculation is a value set artificially in the ultrasonic water meter; S5: Determine Variance Check if the value is greater than the threshold calculated by the variance algorithm, and execute the corresponding result; simultaneously check if the average instantaneous flow rate W_SPEED is greater than the instantaneous flow rate threshold of the variance algorithm, and execute the corresponding result; When If the accumulated water amount C is not greater than the variance calculation upper threshold value, the accumulated water amount C is discarded. When If the variance calculation upper threshold is exceeded, it is determined whether the average instantaneous flow rate W_SPEED is greater than the variance algorithm instantaneous flow rate threshold. The average instantaneous flow rate W_SPEED determined in the step S5 is the average instantaneous flow rate W_SPEED in the step S3 If the average instantaneous flow rate W_SPEED not greater than the start variance calculation threshold value to be processed in the step S3 is greater than the variance algorithm instantaneous flow rate threshold value, it is determined that the accumulated water amount C in the corresponding unit time is counted into the cumulative flow rate in the step S6, and the step S6 is entered. If the average instantaneous flow rate W_SPEED not greater than the start variance calculation threshold value to be processed in the step S3 is not greater than the variance algorithm instantaneous flow rate threshold value, the present accumulated water amount C is discarded. The upper threshold value of variance calculation is a value set artificially in the ultrasonic water meter; S6: Settle the water quantity of this time; In the current sequence step, the accumulated water quantity C of this time is counted into the cumulative flow rate, and for the positive accumulated water quantity C, it is calculated into the positive cumulative flow rate, and for the negative accumulated water quantity C, it is calculated into the negative cumulative flow rate; the cumulative flow rate is the total effective water quantity with water flow direction recorded by the ultrasonic water meter; The direction of the accumulated water quantity C is determined according to the symbol marks "+" and "-" in the data frame, "+" represents the positive accumulated water quantity C, and "-" represents the negative accumulated water quantity C.

2. The method for filtering abnormal fluctuations of an ultrasonic water meter based on a variance algorithm according to claim 1, characterized in that Step S1 specifically includes: Write the FLOW_VAR_EN parameter in the ultrasonic water meter, and set the value of the FLOW_VAR_EN parameter; The value of the FLOW_VAR_EN parameter is a binary state value; The binary state value is "enable / disable", or "true / false", or "yes / no"; Determine the value of the parameter FLOW_VAR_EN, if the value of the parameter FLOW_VAR_EN is "disable", or "false", or "no", it is determined that the accumulated water quantity C corresponding to the unit time is counted into the cumulative flow rate in step S6, and directly enters the following step S6; if the value of the parameter FLOW_VAR_EN is "enable", or "true", or "yes", it enters step S2.

3. The method for filtering abnormal fluctuation of ultrasonic water meter based on variance algorithm according to claim 1, characterized in that: The step S2 further includes the following sub-steps: S21 : Collecting downstream acoustic wave propagation time ; S22: Collecting counterflow sound wave propagation time ; S23: The MCU module calculates the difference between the forward and reverse flow propagation times , in seconds, and stores the recorded and , as well as the time difference signal as core measurement data in the storage module; S24: MCU module compares and judges the direction of water flow: if > , is positive, i.e. the single water inflow is positive water flow; if < , is negative, i.e. the single water inflow is negative water flow; S25: The MCU module calculates the water flow axial velocity v based on and the water flow axial velocity v; The specific calculation process is as follows: First, calculate the propagation speed Vc of the ultrasonic wave at the current water temperature by the temperature correction formula Vc=1482+2.5×(Te-20), where Te is the water flow temperature, unit: ℃; In the downstream direction, the actual propagation speed of the ultrasound waves is , and the downstream propagation time is ; In the case of counter flow, the actual propagation speed of the ultrasound waves is , the counter flow propagation time , the positive-negative swing time difference in seconds; wherein is the straight-line distance between the two ultrasonic transducers, in m, determined by the water meter structure; is the angle between the ultrasonic propagation path and the pipe axis, in °, determined by the water meter structure; is the speed of ultrasonic propagation in still water, is the water flow axial velocity, in m / s; Again, since much less than , further simplified as: ; The axial velocity of the water flow is found ; S26: The MCU module calculates the single water intake amount and the cumulative water amount C; Water meter pipe cross-sectional area S= The unit is square meters; Where D is the pipe diameter, unit: m, determined by the water meter model; Further, the single water amount = is obtained, in L, t is the time interval of the single measurement, in s, and 1000 is a conversion factor from L. In a set unit time T, the unit of which is s, the accumulator accumulates all single water inflow amounts Q in the unit time T to obtain an accumulated water amount in the unit time ; S27: The MCU module calculates the average instantaneous flow rate W_SPEED; The average instantaneous flow rate W_SPEED is the ratio of the accumulated water quantity C of this time to the measurement unit time T, and then converted to the unit of hour flow rate L / h to obtain: , 3600 is a conversion coefficient for converting s to h in units.

4. The method for filtering abnormal fluctuation of ultrasonic water meter based on variance algorithm according to claim 1, characterized in that: In step S3, the I average instantaneous flow rates W_SPEED in the set are indexed and managed by a counting unit inside the MCU module, which is preset with an integer parameter m, with the initial value of 1 and the meaning of the mth W_SPEED in the set currently to be processed. ​​ After the processing of the mth W_SPEED is completed, i.e. after step S6 is completed, the counting unit automatically performs the operation "m = m + 1"; if the updated m value is ≤ I, the processing flow of steps S4 to S6 is repeated from the mth W_SPEED in the list. After the processing of the mth W_SPEED is completed, i.e. after step S6 is completed, the counting unit automatically performs the operation "m = m + 1"; if the updated m value is ≤ I, the processing flow of steps S4 to S6 is repeated from the mth W_SPEED in the list.

5. The method for filtering abnormal fluctuation of ultrasonic water meter based on variance algorithm according to claim 1, characterized in that, In step S2, after the average instantaneous flow rate W_SPEED and the accumulated water volume C in unit time are calculated, the water meter stores the average instantaneous flow rate W_SPEED and the accumulated water volume C in unit time in a preset data frame format to the storage module. The preset data frame includes a time stamp, the average instantaneous flow rate W_SPEED, the absolute value of the accumulated water volume C, the sign identification of the accumulated water volume C, a CRC check bit and a state bit.

6. The method for filtering abnormal fluctuation of ultrasonic water meter based on variance algorithm according to claim 1, characterized in that, In step S6, when the accumulated water volume C is positive, the calculation of the new positive total cumulative value adopts the mode of "current positive total cumulative + absolute value of C"; when C is negative, the calculation of the new negative total cumulative value adopts the mode of "current negative total cumulative + absolute value of C".

7. The method for filtering abnormal fluctuation of ultrasonic water meter based on variance algorithm according to claim 1, characterized in that: The start variance calculation threshold, the variance calculation lower threshold, the variance calculation upper threshold and the variance algorithm instantaneous flow rate threshold in steps S3-S5 all support modification through the ultrasonic water meter management platform, and the ultrasonic water meter covers the original storage parameters and takes effect after restarting.