A method to improve the measurement accuracy of ultrasonic gas meters under abnormal flow conditions
Through trapezoidal algorithm and flow threshold judgment, the normal and abnormal flows are distinguished, and the problem of unfair metering of ultrasonic gas meter under abnormal flows is solved, the measurement accuracy and fairness are improved, and power consumption is reduced.
Patent Information
- Application Number
- CN202211610699.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-14
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-12-14
AI Technical Summary
The metering accuracy and fairness of the ultrasonic gas meter under abnormal flow rates in the prior art are affected by the fluctuations of the air flow. Especially when the user does not use gas, the reverse instantaneous flow is not included in the cumulative flow rate, resulting in unfair measurement.
The trapezoidal algorithm is used to calculate the instantaneous flow, set the sampling period and threshold of the instantaneous flow, judge the start time of abnormal flow, determine the abnormal instantaneous flow time period through the average value and the minimum flow threshold of adjacent sampling times, distinguish between normal and abnormal flow, and process the accumulated flow respectively.
The erroneous measurement of small oscillating flow is reduced, the impact of flow fluctuations on metrology accuracy is reduced, the measurement fairness is improved, power consumption is reduced, and user economic losses are reduced.
Smart Images

Figure CN115931070B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method for improving the measurement accuracy of an ultrasonic gas meter under abnormal flow conditions. Background Art
[0002] With the continuous development of the gas industry, improving gas metering accuracy has become particularly important. Ultrasonic gas meters are rapidly being applied to the field of gas metering due to their advantages of high accuracy, low noise, and low pressure loss. Affected by factors such as temperature changes and pipeline pressure fluctuations, the air flow fluctuations in the ultrasonic gas meter may produce positive and negative oscillating flow. Ultrasonic gas meters support bidirectional measurement and can measure instantaneous flow below the starting flow. In the existing technical solution, the positive instantaneous flow is included in the calculation of the cumulative flow, while the reverse instantaneous flow is not included in the cumulative flow. This cumulative flow processing solution will affect the fairness of measurement when the user is not using gas. Therefore, the intermittent positive and reverse oscillating instantaneous flow should be reasonably calculated, and the calculation of the cumulative flow should consider setting a reasonable instantaneous flow threshold value to improve the metering accuracy and fairness of the gas meter. Summary of the Invention
[0003] In view of the problems existing in the prior art, the object of the present invention is to provide a technical solution for improving the measurement accuracy of ultrasonic gas meters under abnormal flow conditions.
[0004] The method for improving the measurement accuracy of an ultrasonic gas meter under abnormal flow conditions is characterized by comprising the following steps:
[0005] S101: The microcontroller of the ultrasonic gas meter sets the sampling period T of the instantaneous flow rate to obtain the real-time instantaneous flow rate q t ;
[0006] S102: Determine the instantaneous flow rate q at the current sampling time t Is it less than zero? If q t <0, then time t is taken as the start time of the abnormal instantaneous flow period, and the process goes to step S105; if q t ≥0, go to step S103;
[0007] S103: Determine the instantaneous flow rate q at the next sampling moment t+T Is it greater than zero? If q t+T ≥0, the cumulative flow rate within the sampling interval is calculated according to the trapezoidal algorithm; if q t+T <0, go to step S104;
[0008] S104: When q t+T When <0, the start time of abnormal flow is determined based on whether the average value of the instantaneous flow at adjacent sampling moments is greater than the threshold value b of the instantaneous flow average value, and the process goes to step S105;
[0009] S105: Record the instantaneous flow rate q at the time k when the abnormal flow rate starts k And the instantaneous flow rate obtained in the subsequent sampling period, and judge whether the instantaneous flow rate is greater than the minimum flow threshold q when the gas equipment is used h , set the maximum period of continuous judgment to m, where m is a positive integer, determine the abnormal instantaneous flow time period, and calculate the cumulative flow of the abnormal instantaneous flow time period based on the average instantaneous flow size in the abnormal instantaneous flow time period.
[0010] The method for improving the measurement accuracy of an ultrasonic gas meter under abnormal flow conditions is characterized in that the method for calculating the cumulative flow within the sampling interval according to the trapezoidal algorithm in step S103 is:
[0011] S1031: When the instantaneous flow rate satisfies 0≤q t <q s ,q s It is the starting flow of the ultrasonic gas meter. At this time, the instantaneous flow is close to zero and is not included in the calculation of the cumulative flow. The instantaneous flow at the current sampling moment is recorded as zero. t =0; when the instantaneous flow q t ≥q s , recorded in the calculation of cumulative flow;
[0012] S1032: When 0≤q tT+ < s At q, the instantaneous flow rate is q t+T It is not included in the calculation of cumulative flow and is recorded as q t+T =0; when q t+T ≥q s When , it is recorded in the calculation of cumulative flow;
[0013] S1033: When the instantaneous flow at adjacent sampling moments is greater than the starting flow, it is recorded in the calculation of the cumulative flow. The cumulative flow from sampling moment t to sampling moment t+T is is the average value of the instantaneous flow at adjacent sampling moments, q t ≥q s ,q t+T ≥q s And add the accumulated flow to the total gas consumption of the user; the instantaneous flow q at sampling time t+1 t+1 It is non-negative, so if the microcontroller of the ultrasonic gas meter obtains the instantaneous flow at the next sampling moment, go to step S103.
[0014] The method for improving the measurement accuracy of an ultrasonic gas meter under abnormal flow conditions is characterized in that, in step S104, the method for determining the start time of abnormal flow based on whether the average value of the instantaneous flow at adjacent sampling moments is greater than the instantaneous flow threshold is as follows:
[0015] S1041: Calculate the average instantaneous flow rate at adjacent sampling times When the instantaneous flow average b is the instantaneous flow threshold, b>0, indicating that q t+T The absolute value of q t If the current positive and negative instantaneous flow rates are both included in the calculation of the cumulative flow rate, that is, the cumulative flow rate from sampling time t to sampling time t+T And record the sampling time t+T as the start time of abnormal instantaneous flow, go to step S105; when the instantaneous flow average value Go to step S1042;
[0016] S1042: When the instantaneous flow average When q t+T The negative flow is large, and air flow fluctuations may cause positive flow and negative flow, so the sampling time t is recorded as the starting time of the abnormal instantaneous flow, and go to step S105.
[0017] The method for improving the measurement accuracy of an ultrasonic gas meter under abnormal flow conditions is characterized in that, in step S105, the method for determining the abnormal instantaneous flow time period and the method for calculating the cumulative flow in the abnormal instantaneous flow time period are as follows:
[0018] S1051: When the instantaneous flow rate at n consecutive sampling moments satisfies ≥q h When n is a positive integer less than m, that is, This indicates that there may be gas equipment being used at this time. is the instantaneous flow rate at sampling time t1, is the instantaneous flow rate at sampling time t2, is the instantaneous flow rate at sampling time t3, ..., It is t n-1 The instantaneous flow rate at the sampling moment, It is t n The instantaneous flow at the sampling time is calculated from the sampling time t1 to t n The sampling time is recorded as the normal instantaneous flow time period, and the sampling time from k to t1 is recorded as the abnormal instantaneous flow time period. The calculation of the cumulative flow goes to step S1052; when the continuous judgment is m cycles, the instantaneous flow q is recorded. k , the instantaneous flow rate q obtained in the first sampling period k+T , q obtained in the second sampling periodk+2T , ..., the instantaneous flow rate q obtained in the mth sampling period k+m * T , does not satisfy the instantaneous flow rate ≥q at n consecutive sampling moments h If the condition is met, the time period from sampling time k to sampling time k+m*T is recorded as the abnormal instantaneous flow time period, and the calculation of the cumulative flow from sampling time k to sampling time k+m*T is transferred to step S1053;
[0019] S1052:
[0020] 1) Accumulated flow during normal instantaneous flow period Processing, that is, t1 sampling time to t n At the sampling moment, the cumulative flow in adjacent sampling intervals still uses the trapezoidal algorithm.
[0021] 2) Accumulated flow Q during abnormal instantaneous flow period k The processing is the average value of the instantaneous flow in the abnormal instantaneous flow period from the k sampling time to the t1 sampling time. q k represents the instantaneous flow at sampling time k, q k+T represents the instantaneous flow at the k+T sampling time, ..., Represents the instantaneous flow at sampling time t1-T, when a is a positive integer, indicating that the average instantaneous flow value during the current abnormal instantaneous flow period is greater than a times the starting flow q s There may be a short period of gas equipment startup process, so the positive and negative instantaneous flow in this period are included in the cumulative flow, that is, the cumulative flow in the abnormal instantaneous flow period when That is, the average instantaneous flow value during the current abnormal instantaneous flow period is less than a times the starting flow q s , then the positive and negative instantaneous flow in this time period are not included in the cumulative flow, that is, the cumulative flow in the abnormal instantaneous flow time period
[0022] 3) Calculate the k sampling time to t n Cumulative flow at the sampling time And add the accumulated flow to the total gas consumption of the user, the instantaneous flow at the current sampling moment is non-negative, so if the ultrasonic gas meter microcontroller obtains the instantaneous flow rate at the next sampling moment, go to step S103;
[0023] S1053: Calculate the cumulative flow from the sampling time k to the sampling time k+m*T in the abnormal instantaneous flow time period. Similarly, the average instantaneous flow value in the abnormal instantaneous flow time period is used to determine whether the positive instantaneous flow and negative instantaneous flow in the time period are included in the cumulative flow. The average instantaneous flow in the abnormal instantaneous flow time period is when This indicates that there may be a short startup process of the gas-consuming equipment. Therefore, both the positive and negative instantaneous flow rates in this time period are included in the cumulative flow rate, that is, the cumulative flow rate from the sampling time k to the sampling time k+m*T in the abnormal instantaneous flow time period. And add the accumulated flow to the total gas consumption of the user, the determination of abnormal flow has ended. If the ultrasonic gas meter microcontroller obtains the instantaneous flow at the next sampling moment, it returns to step S102; when That is, if the average instantaneous flow value of the current abnormal instantaneous flow period is less than a times the starting flow, then the positive and negative instantaneous flows in this period are not included in the cumulative flow, that is, the cumulative flow Q from the sampling time k to the sampling time k+m*T in the abnormal instantaneous flow period k,k+m*T =0, if the ultrasonic gas meter microcontroller obtains the instantaneous flow at the next sampling moment, the process returns to step S102.
[0024] The beneficial effect of the present invention is that when the trapezoidal algorithm is used to calculate the cumulative flow within the sampling interval, the instantaneous flow that is less than the starting flow is not included in the calculation of the cumulative flow, which can reduce the mismeasurement problem caused by small oscillation flow and is conducive to reducing the impact of flow fluctuations on measurement accuracy; for positive and negative flow oscillations caused by factors such as airflow fluctuations, when a negative instantaneous flow is found, it is judged in turn whether the instantaneous flow is greater than the minimum flow threshold when the gas-using equipment is in use, and the maximum duration period of the abnormal instantaneous flow judgment, thereby reducing the power consumption problem caused by continuous judgment, thereby determining the abnormal flow time period, and using the average value of the instantaneous flow in the abnormal flow time period to determine whether the positive and negative instantaneous flows in the current time period are included in the cumulative flow. Unlike the conventional practice of treating the positive flow as generated by the user's gas use behavior and including it in the cumulative flow, while the reverse flow is directly not included in the cumulative flow, the present invention processes the cumulative flow in the abnormal instantaneous flow time period, which can reduce the mismeasurement of the ultrasonic gas meter caused by airflow fluctuations, reduce the economic losses of users, and improve metering fairness. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 This is a diagram showing pressure changes in the ultrasonic gas meter under airflow fluctuations of the present invention;
[0026] Figure 2 This is the instantaneous flow diagram obtained by the ultrasonic gas meter under the condition of air flow fluctuation of the present invention. DETAILED DESCRIPTION
[0027] The present invention provides a method for improving the measurement accuracy of an ultrasonic gas meter under abnormal flow. When a negative instantaneous flow is obtained, an abnormal instantaneous flow time period is entered, and the average instantaneous flow in the abnormal instantaneous flow time period is used to determine whether the positive and negative instantaneous flows in the current time period are included in the cumulative flow.
[0028] The specific steps of implementing the present invention are as follows:
[0029] S101: The microcontroller of the ultrasonic gas meter sets the sampling period T of the instantaneous flow rate to obtain the real-time instantaneous flow rate q t ;
[0030] S102: Affected by the pressure fluctuation and temperature of the pipe network, the air flow in the ultrasonic gas meter will fluctuate, resulting in an abnormal flow period in which the positive instantaneous flow and the negative instantaneous flow jump back and forth. Therefore, based on the value of the instantaneous flow, it is determined whether the current sampling time is the start time of the abnormal flow. If q t <0, then time t is taken as the start time of the abnormal instantaneous flow period, and the process goes to step S105; if q t ≥0, go to step S103;
[0031] S103: Determine the instantaneous flow rate q at the next sampling moment t+T Is it greater than zero? If q t+T ≥0, the cumulative flow rate within the sampling interval is calculated according to the trapezoidal algorithm (the average value of the instantaneous flow rate at adjacent sampling moments * sampling period); if q t+T <0, go to step S104;
[0032] S104: When q t+T When <0, it indicates that positive and negative oscillatory flow occurs in the current time period. The instantaneous flow in this sampling interval may be caused by airflow fluctuations. The start time of abnormal flow is determined based on whether the average value of the instantaneous flow at adjacent sampling moments is greater than the threshold value b of the instantaneous flow average value, and the process goes to step S105;
[0033] S105: Record the instantaneous flow rate q at the time k when the abnormal flow rate starts k And the instantaneous flow rate obtained in the subsequent sampling period, and judge whether the instantaneous flow rate is greater than the minimum flow threshold q when the gas equipment is used h , set the maximum period of continuous judgment to m (m is a positive integer), determine the abnormal instantaneous flow time period, and calculate the cumulative flow of the abnormal instantaneous flow time period based on the average instantaneous flow size in the abnormal instantaneous flow time period.
[0034] The method for calculating the cumulative flow rate within the sampling interval according to the trapezoidal algorithm in step S103 is:
[0035] S1031: When the instantaneous flow rate satisfies 0≤q t <q s (q s is the starting flow of the ultrasonic gas meter), the instantaneous flow is close to zero at this time and is not included in the calculation of the cumulative flow, and the instantaneous flow at the current sampling moment is recorded as zero q t =0; when the instantaneous flow q t ≥q s , recorded in the calculation of cumulative flow;
[0036] S1032: When 0≤q tT+ < s At q, the instantaneous flow rate is q t+T It is not included in the calculation of cumulative flow and is recorded as q t+T =0; when q t+T ≥q s When , it is recorded in the calculation of cumulative flow;
[0037] S1033: When the instantaneous flow at adjacent sampling moments is greater than the starting flow, it is recorded in the calculation of the cumulative flow. The cumulative flow from sampling moment t to sampling moment t+T is ( is the average value of the instantaneous flow at adjacent sampling moments, q t ≥q s ,q t+T ≥q s ), and add the accumulated flow to the total gas consumption of the user; the instantaneous flow q at sampling time t+1 t+1 is non-negative, so if the microcontroller of the ultrasonic gas meter obtains the instantaneous flow at the next sampling moment, it goes to step S103 and calculates the instantaneous flow q t+2 Make a judgment, when q t+2 When it is non-negative, the cumulative flow from sampling time t+1 to sampling time t+2 is calculated and added to the total gas consumption of the user.
[0038] In step S104, the method for determining the start time of abnormal flow according to whether the average value of the instantaneous flow at adjacent sampling moments is greater than the instantaneous flow threshold is as follows:
[0039] S1041: Calculate the average instantaneous flow rate at adjacent sampling times When the instantaneous flow average (b is the instantaneous flow threshold, b>0), indicating that q t+T The absolute value of q t If the current positive and negative instantaneous flow rates are both included in the calculation of the cumulative flow rate, that is, the cumulative flow rate from sampling time t to sampling time t+T And record the sampling time t+T as the start time of abnormal instantaneous flow, go to step S105; when the instantaneous flow average value Go to step S1042;
[0040] S1042: When the instantaneous flow average When q t+T The negative flow is large, and air flow fluctuations may cause positive flow and negative flow, so the sampling time t is recorded as the starting time of the abnormal instantaneous flow, and go to step S105.
[0041] In step S105, the method for determining the abnormal instantaneous flow time period and the method for calculating the accumulated flow in the abnormal instantaneous flow time period are as follows:
[0042] S1051: When the instantaneous flow rate at n consecutive sampling moments (n is a positive integer less than m) satisfies ≥q h When This indicates that there may be gas equipment being used at this time. is the instantaneous flow rate at sampling time t1, is the instantaneous flow rate at sampling time t2, is the instantaneous flow rate at sampling time t3, ..., It is t n-1 The instantaneous flow rate at the sampling moment, It is t n The instantaneous flow at the sampling time is calculated from the sampling time t1 to t n The sampling time is recorded as the normal instantaneous flow time period, and the sampling time from k to t1 is recorded as the abnormal instantaneous flow time period. The calculation of the cumulative flow goes to step S1052; when the continuous judgment is m cycles, the instantaneous flow q is recorded. k , instantaneous flow q k+T (Instantaneous flow rate obtained in the first sampling period), q k+2T (Instantaneous flow rate obtained in the second sampling period), ..., q k+m * T (Instantaneous flow rate obtained in the mth sampling period), does not satisfy the instantaneous flow rate ≥ q at n consecutive sampling moments h If the condition is met, the time period from sampling time k to sampling time k+m*T is recorded as the abnormal instantaneous flow time period, and the calculation of the cumulative flow from sampling time k to sampling time k+m*T is transferred to step S1053;
[0043] S1052:
[0044] 1) Accumulated flow during normal instantaneous flow period (t1 sampling time to t n Sampling time) processing, the cumulative flow in adjacent sampling intervals still uses the trapezoidal algorithm,
[0045] 2) Abnormal instantaneous flow time period (from sampling time k to sampling time t1) cumulative flow Q k When the useless gas equipment is started, the fluctuation of the airflow will be a gradually stable process, and according to the law of conservation of mass, the cumulative sum of its positive instantaneous flow and negative instantaneous flow should be close to zero, that is, the average value of the instantaneous flow in this stage should be close to zero. Therefore, the average instantaneous flow value in the abnormal instantaneous flow time period is used to determine whether the positive instantaneous flow and negative instantaneous flow in this time period are included in the cumulative flow. The average value of the instantaneous flow in the abnormal instantaneous flow time period is q k represents the instantaneous flow at sampling time k, q k+T represents the instantaneous flow at the k+T sampling time, ..., Represents the instantaneous flow at sampling time t1-T, when (a is a positive integer), indicating that the average instantaneous flow value during the current abnormal instantaneous flow period is greater than a times the starting flow q s There may be a short period of gas equipment startup process, so the positive and negative instantaneous flow in this period are included in the cumulative flow, that is, the cumulative flow in the abnormal instantaneous flow period when That is, the average instantaneous flow value during the current abnormal instantaneous flow period is less than a times the starting flow q s , then the positive and negative instantaneous flow in this time period are not included in the cumulative flow, that is, the cumulative flow in the abnormal instantaneous flow time period
[0046] 3) Calculate the k sampling time to t n Cumulative flow at the sampling time And add the accumulated flow to the total gas consumption of the user, the instantaneous flow at the current sampling moment is non-negative, so if the ultrasonic gas meter microcontroller obtains the instantaneous flow rate at the next sampling moment, go to step S103;
[0047] S1053: Calculate the cumulative flow from sampling time k to sampling time k+m*T (abnormal instantaneous flow time period). Similarly, the average instantaneous flow value in the abnormal instantaneous flow time period is used to determine whether the positive instantaneous flow and negative instantaneous flow in the time period are included in the cumulative flow. The average instantaneous flow in the abnormal instantaneous flow time period is when This indicates that there may be a short startup process of the gas-consuming equipment. Therefore, both the positive and negative instantaneous flow rates in this time period are included in the cumulative flow rate, that is, the cumulative flow rate in the abnormal instantaneous flow time period (from sampling time k to sampling time k+m*T). And add the accumulated flow to the total gas consumption of the user, the determination of abnormal flow has ended. If the ultrasonic gas meter microcontroller obtains the instantaneous flow at the next sampling moment, it returns to step S102; when That is, if the average instantaneous flow value of the current abnormal instantaneous flow time period is less than a times the starting flow, then the positive and negative instantaneous flows in this time period are not included in the cumulative flow, that is, the cumulative flow Q of the abnormal instantaneous flow time period (k sampling time to k+m*T sampling time) k,k+m*T =0, if the ultrasonic gas meter microcontroller obtains the instantaneous flow at the next sampling moment, the process returns to step S102.
[0048] In the above steps S101 to S105, the ultrasonic gas meter microcontroller can set the sampling period T of the instantaneous flow to 1s / time. Taking the G4-level household ultrasonic gas meter as an example, in step S1031, the starting flow q can be set. s is 5L / h, when the instantaneous flow rate satisfies 0≤q t <5, not included in the calculation of the cumulative flow; Step S1041, when positive and negative oscillation flow occurs, refer to the starting flow q s The value of the instantaneous flow average value can be set to 15L / h. When (that is, q t+T ≥30), enter the abnormal instantaneous flow period from the sampling time t+T; in step S1051, referring to the minimum fire flow of a single burner of a household stove is 37~70L / h, and the normal ignition time of a household gas stove is 2~3 seconds, set n to 5, and the minimum flow threshold q when the gas device is in use h It is 30L / h, that is, when the instantaneous flow rate is greater than 30L / h for 5 consecutive sampling periods, the determination of the abnormal instantaneous flow time period is terminated, and the average value threshold of the instantaneous flow rate in the abnormal instantaneous flow time period is set to 3 times the starting flow rate, that is, a=3 is set. When the average value of the instantaneous flow rate in the abnormal instantaneous flow time period is greater than 15L / h, both the positive instantaneous flow rate and the negative instantaneous flow rate are included in the calculation of the cumulative flow rate; in step S105, the maximum duration m of the abnormal instantaneous flow determination is set to 120, that is, when the continuous determination is made for 2 minutes, there is still no situation where 5 consecutive instantaneous flow values are greater than 30L / h, indicating that the gas equipment has not been continuously used until the current sampling moment. The user may not have used gas for a long time, and only intermittent instantaneous flow rates of zero or close to the starting flow rate appear. At this time, the abnormal instantaneous flow caused by airflow fluctuations has gradually stopped, the instantaneous flow rate has returned to normal, and the cumulative measurement of the normal instantaneous flow rate is promptly jumped to.
[0049] In this embodiment, a G4-level ultrasonic gas meter is selected, and a simulated ventilation device is used. The membrane box pressure gauge is set to about 3kPa. When the gas outlet of the ultrasonic gas meter is sealed, the air flow fluctuation of the ultrasonic gas meter is analyzed. Figure 1 This is a diagram of pressure changes inside the ultrasonic gas meter under airflow fluctuations of the present invention. The constant fluctuation of the airflow inside the meter causes continuous pressure changes; Figure 2 This is the instantaneous flow diagram obtained by the ultrasonic gas meter under the condition of airflow fluctuation of the present invention. The sampling period of the instantaneous flow is 1s / time. It can be seen that the positive instantaneous flow and the negative instantaneous flow oscillate back and forth. Using the method provided by the present invention, the abnormal flow judgment is entered from sampling time 1 (the average of the positive instantaneous flow at sampling time 1 and the negative instantaneous flow at sampling time 2 is -4L / h), and the judgment is continued for 2 minutes (no consecutive 5 instantaneous flow values greater than 30L / h are found). The cumulative flow of this abnormal instantaneous flow section is zero (the average of the instantaneous flow is 1.7L / h, less than 15L / h), and the instantaneous flow at sampling time 121 is negative (-79L / h), so it will enter the abnormal instantaneous flow judgment again. Through this embodiment, when positive instantaneous flow and negative instantaneous flow oscillation occur, the starting time of the abnormal instantaneous flow can be reasonably found by setting the average instantaneous flow threshold of adjacent sampling moments; after entering the abnormal instantaneous flow time period, it is judged in turn whether the instantaneous flow is greater than the minimum flow threshold when the gas equipment is in use, and the maximum period of continuous judgment is set, so as to accurately determine the time period of the abnormal instantaneous flow, and decide whether to include the positive instantaneous flow and the negative instantaneous flow in the cumulative flow based on the average value of the instantaneous flow in the abnormal instantaneous flow time period, thereby improving the fairness of metering.
Claims
1. A method for improving the measurement accuracy of an ultrasonic gas meter under abnormal flow conditions, characterized in that: The steps include: S101: The microcontroller of the ultrasonic gas meter sets the sampling period T of the instantaneous flow rate to obtain the real-time instantaneous flow rate q t ; S102: Determine the instantaneous flow rate q at the current sampling time t Is it less than zero? If q t <0, then time t is taken as the start time of the abnormal instantaneous flow period, and the process goes to step S105; if q t ≥0, go to step S103; S103: Determine the instantaneous flow rate q at the next sampling moment t+T Is it greater than zero? If q t+T ≥0, the cumulative flow rate within the sampling interval is calculated according to the trapezoidal algorithm; if q t+T <0, go to step S104; S104: When q t+T When <0, the start time of abnormal flow is determined based on whether the average value of the instantaneous flow at adjacent sampling moments is greater than the threshold value b of the instantaneous flow average value, and the process goes to step S105; S105: Record the instantaneous flow rate q at the time k when the abnormal flow rate starts k And the instantaneous flow rate obtained in the subsequent sampling period, and judge whether the instantaneous flow rate is greater than the minimum flow threshold q when the gas equipment is used h , set the maximum period of continuous judgment to m, where m is a positive integer, determine the abnormal instantaneous flow time period, and calculate the cumulative flow of the abnormal instantaneous flow time period based on the average instantaneous flow size in the abnormal instantaneous flow time period; The method for calculating the cumulative flow rate within the sampling interval according to the trapezoidal algorithm in step S103 is: S1031: When the instantaneous flow rate satisfies 0≤q t <q s ,q s It is the starting flow of the ultrasonic gas meter. At this time, the instantaneous flow is close to zero and is not included in the calculation of the cumulative flow. The instantaneous flow at the current sampling moment is recorded as zero. t =0; when the instantaneous flow q t ≥q s , recorded in the calculation of cumulative flow; S1032: When 0≤q t+T <q s When the instantaneous flow rate q t+T It is not included in the calculation of cumulative flow and is recorded as q t+T =0; when q t+T ≥q s When , it is recorded in the calculation of cumulative flow; S1033: When the instantaneous flow at adjacent sampling moments is greater than the starting flow, it is recorded in the calculation of the cumulative flow. The cumulative flow from sampling moment t to sampling moment t+T is is the average value of the instantaneous flow at adjacent sampling moments, And add the accumulated flow to the total gas consumption of the user; the instantaneous flow q at sampling time t+1 t+1 It is non-negative, so if the microcontroller of the ultrasonic gas meter obtains the instantaneous flow at the next sampling moment, go to step S103.
2. A method for improving the measurement accuracy of an ultrasonic gas meter under abnormal flow conditions according to claim 1, characterized in that: In step S104, the method for determining the start time of abnormal flow based on whether the average value of the instantaneous flow at adjacent sampling moments is greater than the instantaneous flow threshold is as follows: S1041: Calculate the average instantaneous flow rate at adjacent sampling times When the instantaneous flow average b is the instantaneous flow threshold, b>0, indicating that q t+T The absolute value of q t If the current positive and negative instantaneous flow rates are both included in the calculation of the cumulative flow rate, that is, the cumulative flow rate from sampling time t to sampling time t+T And record the sampling time t+T as the start time of abnormal instantaneous flow, go to step S105; when the instantaneous flow average value Go to step S1042; S1042: When the instantaneous flow average When q t+T The negative flow is large, and air flow fluctuations may cause positive flow and negative flow, so the sampling time t is recorded as the starting time of the abnormal instantaneous flow, and go to step S105.
3. The method for improving the measurement accuracy of an ultrasonic gas meter under abnormal flow conditions according to claim 1, characterized in that: In step S105, the method for determining the abnormal instantaneous flow time period and the method for calculating the accumulated flow in the abnormal instantaneous flow time period are as follows: S1051: When the instantaneous flow rate at n consecutive sampling moments satisfies ≥q h When n is a positive integer less than m, that is, This indicates that there may be gas equipment being used at this time. is the instantaneous flow rate at sampling time t1, is the instantaneous flow rate at sampling time t2, is the instantaneous flow rate at sampling time t3, ..., It is t n-1 The instantaneous flow rate at the sampling moment, It is t n The instantaneous flow at the sampling time is calculated from the sampling time t1 to t n The sampling time is recorded as the normal instantaneous flow time period, and the sampling time from k to t1 is recorded as the abnormal instantaneous flow time period. The calculation of the cumulative flow goes to step S1052; when the continuous judgment is m cycles, the instantaneous flow q is recorded. k , the instantaneous flow rate q obtained in the first sampling period k+T , q obtained in the second sampling period k+2T , ..., the instantaneous flow rate q obtained in the mth sampling period k+m*T , does not satisfy the instantaneous flow rate ≥q at n consecutive sampling moments h If the condition is met, the time period from sampling time k to sampling time k+m*T is recorded as the abnormal instantaneous flow time period, and the calculation of the cumulative flow from sampling time k to sampling time k+m*T is transferred to step S1053; S1052: 1) Accumulated flow during normal instantaneous flow period Processing, that is, t1 sampling time to t n At the sampling moment, the cumulative flow in adjacent sampling intervals still uses the trapezoidal algorithm. 2) Accumulated flow Q during abnormal instantaneous flow period k The processing is the average value of the instantaneous flow in the abnormal instantaneous flow period from the k sampling time to the t1 sampling time. q k represents the instantaneous flow at sampling time k, q k+T represents the instantaneous flow at the k+T sampling time, ..., Represents the instantaneous flow at sampling time t1-T, when a is a positive integer, indicating that the average instantaneous flow value during the current abnormal instantaneous flow period is greater than a times the starting flow q s There may be a short period of gas equipment startup process, so the positive and negative instantaneous flow in this period are included in the cumulative flow, that is, the cumulative flow in the abnormal instantaneous flow period when That is, the average instantaneous flow value during the current abnormal instantaneous flow period is less than a times the starting flow q s , then the positive and negative instantaneous flow in this time period are not included in the cumulative flow, that is, the cumulative flow in the abnormal instantaneous flow time period 3) Calculate the k sampling time to t n Cumulative flow at the sampling time And add the accumulated flow to the total gas consumption of the user, the instantaneous flow at the current sampling moment is non-negative, so if the ultrasonic gas meter microcontroller obtains the instantaneous flow rate at the next sampling moment, go to step S103; S1053: Calculate the cumulative flow from the sampling time k to the sampling time k+m*T in the abnormal instantaneous flow time period. Similarly, the average instantaneous flow value in the abnormal instantaneous flow time period is used to determine whether the positive instantaneous flow and negative instantaneous flow in the time period are included in the cumulative flow. The average instantaneous flow in the abnormal instantaneous flow time period is when This indicates that there may be a short startup process of the gas-consuming equipment. Therefore, both the positive and negative instantaneous flow rates in this time period are included in the cumulative flow rate, that is, the cumulative flow rate from the sampling time k to the sampling time k+m*T in the abnormal instantaneous flow time period. And add the accumulated flow to the total gas consumption of the user, the determination of abnormal flow has ended. If the ultrasonic gas meter microcontroller obtains the instantaneous flow at the next sampling moment, it returns to step S102; when That is, if the average instantaneous flow value of the current abnormal instantaneous flow period is less than a times the starting flow, then the positive and negative instantaneous flows in this period are not included in the cumulative flow, that is, the cumulative flow Q from the sampling time k to the sampling time k+m*T in the abnormal instantaneous flow period k,k+m*T =0, if the ultrasonic gas meter microcontroller obtains the instantaneous flow at the next sampling moment, the process returns to step S102.
Citation Information
Patent Citations
Random number sampling method for electronic meter
CN111174842A
Metering method of fluid meter
CN112665666A