Bidirectional metering method and device applied to pipe network disturbance abnormal flow, medium and product
By obtaining the sampling data of the ultrasonic water meter, determining the cycle flow time difference and flow direction encoding, building a cycle flow time difference sequence, and calculating the accumulated flow, the problem of metering error of ultrasonic water meter under pipeline disturbance in the existing technology is solved, and the measurement accuracy and fairness are improved sex.
Patent Information
- Application Number
- CN202411328280.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-09-23
AI Technical Summary
The existing ultrasonic water meter is difficult to accurately identify abnormal flows when the pipeline network is disturbed and pressure imbalanced, resulting in net accumulated flow metering errors and affecting the fairness of the measurement.
By obtaining the sampling data of the ultrasonic water meter, determining the periodic flow time difference and flow direction encoding, building a periodic flow time difference sequence, calculating the accumulated flow, and thus improving the accuracy and rationality of bidirectional measurement.
Accurate measurement of abnormal flows under pipeline disturbances is achieved, metering accuracy and fairness are improved, and errors are reduced.
Smart Images

Figure CN119164458A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of ultrasonic water meter measurement technology, and in particular to a bidirectional measurement method, equipment, medium and product applied to abnormal flow under pipeline network disturbance. Background Art
[0002] With the development of electronic technology, smart water meters have gone through the development of 1.0 and 2.0, and gradually moved towards smart water meters 3.0, providing more accurate pipe network monitoring and flow measurement. Ultrasonic water meters are widely used in water volume measurement in scenarios such as large-diameter water supply pipe networks due to their advantages such as high measurement accuracy, large range ratio, and low pressure loss.
[0003] Affected by factors such as temperature changes, bubbles in the pipe network, and pressure fluctuations, the water flow in the ultrasonic water meter pipe fluctuates back and forth, which may produce forward and reverse oscillating flow. In the existing algorithm scheme, the net cumulative flow is the forward cumulative flow minus the reverse cumulative flow. Due to errors in positive and negative metering, when the pipe network is disturbed or the pressure before and after the water meter is unbalanced, and the user is not using water, the abnormal flow cannot be correctly identified, and the positive and negative metering will result in a certain net cumulative flow, thereby affecting the fairness of the metering. Summary of the invention
[0004] The purpose of this application is to provide a bidirectional metering method, equipment, medium and product for use in pipeline network disturbance and abnormal flow, which can improve the accuracy of bidirectional metering used in pipeline network disturbance and abnormal flow.
[0005] To achieve the above objectives, this application provides the following solutions:
[0006] In a first aspect, the present application provides a bidirectional metering method for abnormal flow under pipeline network disturbance, comprising:
[0007] Obtain sampling data of the ultrasonic water meter within the current flow sampling cycle sequence;
[0008] Based on the sampling data, determine the periodic flow time difference and periodic flow direction code corresponding to each period of the current flow sampling period sequence;
[0009] Using the periodic flow direction code as an index, the periodic flow time difference sequence is constructed in chronological order;
[0010] Based on the periodic flow time difference sequence, the cumulative flow corresponding to the current flow sampling period sequence is determined.
[0011] Optionally, based on the sampling data, determining the periodic flow time difference and periodic flow direction code of each period corresponding to the current flow sampling period sequence includes:
[0012] Determine any cycle in the current traffic sampling cycle sequence as the current cycle;
[0013] Get the total sampling times n of the ultrasonic water meter in the current cycle;
[0014] Based on the sampling data, determine the sampling flow time difference and sampling flow direction at each sampling in the current cycle; the sampling flow direction includes forward and reverse;
[0015] The number of times the sampling flow direction is forward in the current cycle is obtained as the forward flow time difference number m;
[0016] The number of times the sampling flow direction is reverse in the current cycle is obtained as the reverse flow time difference number k;
[0017] Determine the periodic flow direction code of the current period based on the total sampling times n, the forward flow time difference times m and the reverse flow time difference times k;
[0018] Determine the periodic flow time difference of the current period based on the periodic flow direction code of the current period, and the sampling flow time difference and sampling flow direction at each sampling in the current period;
[0019] Update the current cycle and return to step "obtain the total number of sampling times n of the ultrasonic water meter in the current cycle" until the current flow sampling cycle sequence is traversed to obtain the periodic flow time difference and periodic flow direction coding corresponding to each cycle of the current flow sampling cycle sequence.
[0020] Optionally, based on the sampling data, determining the sampling flow time difference and sampling flow direction at each sampling in the current cycle includes:
[0021] Let sampling number i = 1;
[0022] Determine the sampling data at the i-th sampling as the current sampling data; the current sampling data includes the downstream flight time T of the sound wave at the i-th sampling d and the acoustic wave countercurrent flight time T at the i-th sampling u ;
[0023] Determine the acoustic wave countercurrent flight time T at the i-th sampling in the current sampling data u Is it greater than or equal to the downstream flight time T of the sound wave at the i-th sampling time? d , obtain the first judgment result;
[0024] If the first judgment result is yes, then determining that the sampling flow direction at the i-th sampling is forward;
[0025] Determine the acoustic wave countercurrent flight time T at the i-th sampling u The time T of the sound wave flying downstream at the i-th sampling d The difference is the sampling flow time difference;
[0026] If the first judgment result is no, determining that the sampling flow direction during the i-th sampling is reverse;
[0027] Determine the downstream flight time T of the sound wave at the i-th sampling d The acoustic wave countercurrent flight time T at the i-th sampling u The difference is the sampling flow time difference;
[0028] Determine whether the sampling number i reaches the total sampling number n in the current cycle, and obtain a second determination result;
[0029] If the second judgment result is no, the value of the sampling number i is increased by 1, and the process returns to the step of "judging the acoustic wave countercurrent flight time T of the i-th sampling in the current sampling data"; u Is it greater than or equal to the downstream flight time T of the sound wave at the i-th sampling time? d , get the first judgment result";
[0030] If the second judgment result is yes, the sampling flow time difference and sampling flow direction at each sampling in the current cycle are obtained.
[0031] Optionally, based on the total sampling times n, the forward flow time difference times m, and the reverse flow time difference times k, determining the periodic flow direction code of the current period includes:
[0032] Get the effective sampling times threshold;
[0033] Determine the sum of the forward flow time difference number m and the reverse flow time difference number k as the effective sampling number;
[0034] Determine whether the effective sampling number reaches the effective sampling number threshold, and obtain a third determination result;
[0035] If the third judgment result is no, then the cycle flow direction code of the current cycle is set to be equal to 3; the cycle flow direction code equal to 3 indicates that the flow measurement of the current cycle is wrong;
[0036] If the third judgment result is yes, then the difference between the total sampling times n and the preset value is set as the second judgment value;
[0037] Determine whether the forward flow time difference number m is less than the reverse flow time difference number k, and obtain a fourth determination result;
[0038] If the fourth judgment result is no, then determining the difference between the forward flow time difference number m and the reverse flow time difference number k as the third judgment value;
[0039] Determine whether the third determination value is less than the second determination value, and obtain a fifth determination result;
[0040] If the fifth judgment result is no, then the cycle flow direction code of the current cycle is set to 1; the cycle flow direction code equal to 1 indicates that the flow direction of the current cycle is positive;
[0041] If the fifth judgment result is yes, then the periodic flow direction code of the current period is set to 0; the periodic flow direction code being 0 indicates that the flow direction of the current period has no definite direction;
[0042] If the fourth judgment result is yes, the difference between the reverse flow time difference number k and the forward flow time difference number m is determined as a fourth judgment value;
[0043] Determine whether the fourth determination value is less than the second determination value, and obtain a sixth determination result;
[0044] If the sixth judgment result is no, then the cycle flow direction code of the current cycle is set to 2; the cycle flow direction code equal to 2 indicates that the flow direction of the current cycle is reverse;
[0045] If the sixth judgment result is yes, the cycle flow direction code of the current cycle is set to 0.
[0046] Optionally, based on the periodic flow direction code of the current period, and the sampling flow time difference and the sampling flow direction at each sampling in the current period, determining the periodic flow time difference of the current period includes:
[0047] Determine that all sampling flow time differences in the current cycle whose sampling flow direction is the same as the cycle flow direction are effective sampling flow time differences;
[0048] The arithmetic mean of all valid sampled flow time differences is determined as the period flow time difference of the current period.
[0049] Optionally, determining the cumulative flow corresponding to the current flow sampling period sequence based on the periodic flow time difference sequence includes:
[0050] In chronological order, the first cycle whose flow direction code is not equal to 3 is obtained from the back to the front as the reference cycle;
[0051] Determine the periodic flow direction code of the reference period as the reference periodic flow direction code;
[0052] Based on the reference period and the periodic flow time difference sequence, determine the instantaneous flow corresponding to the current flow sampling period sequence;
[0053] Determine the product of the instantaneous flow corresponding to the current flow sampling period sequence and the pipe network area as the current cumulative flow;
[0054] Get the forward cumulative flow and reverse cumulative flow;
[0055] When the flow direction code in the reference period is equal to 1, the current cumulative flow is added to the positive cumulative flow;
[0056] When the reference cycle flow direction code is equal to 2, the current accumulated flow is added to the reverse accumulated flow.
[0057] Optionally, determining the instantaneous flow corresponding to the current flow sampling period sequence based on the reference period and the period flow time difference sequence includes:
[0058] Obtain the element number of the reference period in the current traffic sampling period sequence as the reference period number;
[0059] Determine half of the number of elements in the current flow sampling period sequence as the fifth determination quantity;
[0060] Determine whether the reference cycle number is greater than the fifth determination value to obtain a seventh determination result;
[0061] If the seventh judgment result is no, then determining that the instantaneous flow corresponding to the current flow sampling period sequence is 0;
[0062] If the seventh judgment result is yes, then judging whether the reference period flow direction code is equal to 0, and obtaining an eighth judgment result;
[0063] If the eighth judgment result is yes, then determining that the instantaneous flow corresponding to the current flow sampling period sequence is 0;
[0064] If the eighth judgment result is no, obtaining the number of elements in the periodic flow time difference sequence whose index is not equal to 3 as a first number C;
[0065] Obtaining a reference element sequence in the periodic flow time difference sequence; all elements in the reference element sequence are continuous in the periodic flow time difference sequence, and the indexes of all elements in the reference element sequence in the periodic flow time difference sequence are equal to the reference periodic flow direction code;
[0066] Determine the base element sequence with the largest number of elements as the current base element sequence;
[0067] Determine the number of elements of the current reference element sequence as a second number G;
[0068] When the reference period flow direction code is equal to 1, it is determined whether the first condition is met to obtain a ninth determination result; the first condition is G>1, and G>(K / 2); K is the number of elements in the periodic flow time difference sequence whose index is equal to the reference period flow direction code;
[0069] If the ninth judgment result is yes, then the arithmetic mean of all elements in the current reference element sequence is the reference period flow time difference;
[0070] Based on the reference period flow time difference and the relationship between flow time difference and instantaneous flow, determine the instantaneous flow corresponding to the current flow sampling period sequence;
[0071] If the ninth judgment result is no, then determining that the instantaneous flow corresponding to the current flow sampling period sequence is 0;
[0072] When the reference period flow direction code is equal to 2, it is determined whether the second condition is met to obtain a tenth determination result; the second condition is G>1, and G>(C / 2);
[0073] If the tenth judgment result is yes, then the arithmetic mean of all elements in the current reference element sequence is the reference period flow time difference;
[0074] Based on the reference period flow time difference and the relationship between flow time difference and instantaneous flow, determine the instantaneous flow corresponding to the current flow sampling period sequence;
[0075] If the tenth judgment result is no, it is determined that the instantaneous flow corresponding to the current flow sampling period sequence is 0.
[0076] In a second aspect, the present application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-mentioned bidirectional metering method applied to abnormal flow caused by pipeline network disturbance.
[0077] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned bidirectional metering method applied to abnormal flow caused by pipeline network disturbance.
[0078] In a fourth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above-mentioned bidirectional metering method applied to abnormal flow caused by pipeline network disturbance.
[0079] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0080] The present application provides a bidirectional metering method, device, medium and product for use in abnormal flow under pipe network disturbance, which obtains sampling data of an ultrasonic water meter in a current flow sampling cycle sequence; based on the sampling data, determines the periodic flow time difference and periodic flow direction code corresponding to each cycle of the current flow sampling cycle sequence; uses the periodic flow direction code as an index and constructs a periodic flow time difference sequence in chronological order; based on the periodic flow time difference sequence, determines the cumulative flow corresponding to the current flow sampling cycle sequence; by constructing the periodic flow time difference sequence, accurately measures the abnormal flow under bidirectional metering pipe network disturbance, and judges the disturbed flow, thereby improving the accuracy and rationality of the measurement. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0082] Figure 1 This is a flow chart of a bidirectional metering method applied to abnormal flow in a pipe network disturbance in one embodiment of the present application;
[0083] Figure 2 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0084] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0085] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0086] In an exemplary embodiment, Figure 1 As shown, a bidirectional metering method for abnormal flow in a pipeline network is provided, comprising:
[0087] Step 101: Acquire sampling data of the ultrasonic water meter in the current flow sampling cycle sequence.
[0088] Step 102: Based on the sampling data, determine the periodic flow time difference and periodic flow direction code corresponding to each period of the current flow sampling period sequence.
[0089] Step 103: Using the periodic flow direction code as an index, construct a periodic flow time difference sequence in chronological order.
[0090] Step 104: Based on the periodic flow time difference sequence, determine the cumulative flow corresponding to the current flow sampling period sequence.
[0091] Step 102 includes:
[0092] Determine any period in the current traffic sampling period sequence as the current period.
[0093] Get the total sampling times n of the ultrasonic water meter in the current cycle.
[0094] Based on the sampling data, the sampling flow time difference and sampling flow direction of each sampling in the current cycle are determined. The sampling flow direction includes forward and reverse.
[0095] The number of times the sampling flow direction is forward in the current cycle is obtained as the forward flow time difference number m.
[0096] The number of times the sampling flow direction is reverse in the current cycle is obtained as the reverse flow time difference number k.
[0097] Based on the total sampling times n, the forward flow time difference times m and the reverse flow time difference times k, the periodic flow direction code of the current period is determined.
[0098] The periodic flow time difference of the current period is determined based on the periodic flow direction code of the current period, and the sampling flow time difference and the sampling flow direction at each sampling in the current period.
[0099] Update the current cycle and return to step "obtain the total number of sampling times n of the ultrasonic water meter in the current cycle" until the current flow sampling cycle sequence is traversed to obtain the periodic flow time difference and periodic flow direction coding corresponding to each cycle of the current flow sampling cycle sequence.
[0100] Determine the sampling flow time difference and sampling flow direction at each sampling time in the current cycle, including:
[0101] Let the sampling number i=1.
[0102] The sampling data at the i-th sampling is determined as the current sampling data. The current sampling data includes the downstream flight time T of the sound wave at the i-th sampling. d and the acoustic wave countercurrent flight time T at the i-th sampling u .
[0103] Determine the acoustic wave countercurrent flight time T at the i-th sampling in the current sampling data u Is it greater than or equal to the downstream flight time T of the sound wave at the i-th sampling time? d , and obtain the first judgment result.
[0104] If the first judgment result is yes, it is determined that the sampling flow direction during the i-th sampling is forward.
[0105] Determine the acoustic wave countercurrent flight time T at the i-th sampling u The time T of the sound wave flying downstream at the i-th sampling d The difference is the sampling flow time difference.
[0106] If the first judgment result is no, it is determined that the sampling flow direction during the i-th sampling is reverse.
[0107] Determine the downstream flight time T of the sound wave at the i-th sampling d The acoustic wave countercurrent flight time T at the i-th sampling u The difference is the sampling flow time difference.
[0108] It is determined whether the sampling number i reaches the total sampling number n in the current cycle to obtain a second determination result.
[0109] If the second judgment result is no, the value of the sampling number i is increased by 1, and the process returns to the step of "judging the acoustic wave countercurrent flight time T of the i-th sampling in the current sampling data" u Is it greater than or equal to the downstream flight time T of the sound wave at the i-th sampling time? d , get the first judgment result".
[0110] If the second judgment result is yes, the sampling flow time difference and sampling flow direction at each sampling in the current cycle are obtained.
[0111] Based on the total sampling times n, the forward flow time difference times m, and the reverse flow time difference times k, the cycle flow direction code of the current cycle is determined, including:
[0112] Gets the effective sampling times threshold.
[0113] Determine the sum of the forward flow time difference number m and the reverse flow time difference number k as the effective sampling number.
[0114] It is determined whether the effective sampling number reaches the effective sampling number threshold to obtain a third determination result.
[0115] If the third judgment result is no, then the cycle flow direction code of the current cycle is set to be equal to 3. The cycle flow direction code equal to 3 indicates that the flow measurement of the current cycle is wrong.
[0116] If the third determination result is yes, the difference between the total sampling times n and the preset value is set as the second determination value.
[0117] It is determined whether the forward flow time difference number m is less than the reverse flow time difference number k to obtain a fourth determination result.
[0118] If the fourth judgment result is no, then the difference between the forward flow time difference number m and the reverse flow time difference number k is determined as the third judgment value.
[0119] It is determined whether the third determination value is smaller than the second determination value to obtain a fifth determination result.
[0120] If the fifth judgment result is no, the cycle flow direction code of the current cycle is set to 1. The cycle flow direction code equal to 1 indicates that the flow direction of the current cycle is forward.
[0121] If the fifth judgment result is yes, the cycle flow direction code of the current cycle is set to 0. The cycle flow direction code equal to 0 indicates that the flow direction of the current cycle has no definite direction.
[0122] If the fourth determination result is yes, the difference between the reverse flow time difference number k and the forward flow time difference number m is determined as the fourth determination amount.
[0123] It is determined whether the fourth determination value is smaller than the second determination value to obtain a sixth determination result.
[0124] If the sixth judgment result is no, the cycle flow direction code of the current cycle is set to 2. The cycle flow direction code equal to 2 indicates that the flow direction of the current cycle is reverse.
[0125] If the sixth judgment result is yes, the cycle flow direction code of the current cycle is set to 0.
[0126] Based on the cycle flow direction code of the current cycle, as well as the sampling flow time difference and sampling flow direction at each sampling in the current cycle, the cycle flow time difference of the current cycle is determined, including:
[0127] Determine all sampling flow time differences in the current cycle whose sampling flow direction is the same as the cycle flow direction as the effective sampling flow time difference.
[0128] The arithmetic mean of all valid sampled flow time differences is determined as the period flow time difference of the current period.
[0129] Step 104 includes:
[0130] In chronological order, the first cycle whose flow direction code is not equal to 3 is obtained from the back to the front as the reference cycle.
[0131] The periodic flow direction code of the reference period is determined as the reference periodic flow direction code.
[0132] Based on the reference period and the periodic flow time difference sequence, the instantaneous flow corresponding to the current flow sampling period sequence is determined.
[0133] The product of the instantaneous flow corresponding to the current flow sampling period sequence and the pipe network area is determined as the current cumulative flow.
[0134] Get the forward and reverse accumulated flow rates.
[0135] When the flow direction code in the reference cycle is equal to 1, the current accumulated flow is added to the positive accumulated flow.
[0136] When the reference cycle flow direction code is equal to 2, the current accumulated flow is added to the reverse accumulated flow.
[0137] Wherein, based on the reference period and the periodic flow time difference sequence, determining the instantaneous flow corresponding to the current flow sampling period sequence includes:
[0138] The element number of the reference period in the current traffic sampling period sequence is obtained as the reference period number.
[0139] A half of the number of elements in the current flow sampling period sequence is determined as the fifth determination quantity.
[0140] It is determined whether the reference cycle number is greater than the fifth determination value to obtain a seventh determination result.
[0141] If the seventh judgment result is no, it is determined that the instantaneous flow corresponding to the current flow sampling period sequence is 0.
[0142] If the seventh judgment result is yes, then it is determined whether the reference period flow direction code is equal to 0 to obtain the eighth judgment result.
[0143] If the eighth judgment result is yes, it is determined that the instantaneous flow corresponding to the current flow sampling period sequence is 0.
[0144] If the result of the eighth judgment is no, the number of elements in the periodic flow time difference sequence whose index is not equal to 3 is obtained as the first number C.
[0145] Get the reference element sequence in the periodic flow time difference sequence. All elements in the reference element sequence are continuous in the periodic flow time difference sequence, and the indexes of all elements in the reference element sequence in the periodic flow time difference sequence are equal to the reference periodic flow direction code.
[0146] The base element sequence with the largest number of elements is determined as the current base element sequence.
[0147] The number of elements of the current reference element sequence is determined to be a second number G.
[0148] When the reference period flow direction code is equal to 1, it is determined whether the first condition is met to obtain a ninth determination result. The first condition is G>1, and G>(K / 2). K is the number of elements in the periodic flow time difference sequence whose index is equal to the reference period flow direction code.
[0149] If the ninth judgment result is yes, the arithmetic mean of all elements in the current reference element sequence is the reference period flow time difference.
[0150] Based on the reference period flow time difference and the relationship between flow time difference and instantaneous flow, the instantaneous flow corresponding to the current flow sampling period sequence is determined. The relationship between flow time difference and instantaneous flow is: q is the instantaneous flow rate, is the flow time difference, c is the speed of sound in water, R is the radius of the water meter, and L is the ultrasonic sound path of the water meter.
[0151] If the ninth judgment result is no, it is determined that the instantaneous flow corresponding to the current flow sampling period sequence is 0.
[0152] When the flow direction code in the reference period is equal to 2, it is determined whether the second condition is satisfied to obtain the tenth determination result. The second condition is that G > 1 and G > (C / 2).
[0153] If the tenth determination result is yes, the arithmetic mean of all elements in the current reference element sequence is the flow difference of the reference period.
[0154] Based on the flow difference of the reference period and the relationship between the flow difference - instantaneous flow, the instantaneous flow corresponding to the current flow sampling period sequence is determined.
[0155] If the tenth determination result is no, it is determined that the instantaneous flow corresponding to the current flow sampling period sequence is 0.
[0156] In an exemplary embodiment, a two-way metering method applied to abnormal flow in pipeline network disturbances is provided, including:
[0157] S101: The microprocessor of the ultrasonic water meter is set with a flow sampling period T, a sampling number n, records the number of times m of positive flow differences and the number of times k of negative flow differences in n samplings within the sampling period T, and n ≥ (m + k).
[0158] S102: Calculate and judge the positive flow difference m and the negative flow difference number k in multiple samplings n within the sampling period T.
[0159] S1021: If m ≥ k and (m - k) ≥ (n - 2), it is determined that the flow direction of the current sampling period T is positive, record the cycle flow direction code dir = 1, and the flow difference data of this sampling indicating the average flow difference of this sampling, t f is the arithmetic mean average difference of m positive flow differences in this sampling, otherwise it is determined that the direction of the current sampling period T is undetermined, record dir = 0, and the flow difference data of this sampling
[0160] S1022: If m < k and (k - m) ≥ (n - 2), it is determined that the flow direction of the current sampling period T is negative, record the cycle flow direction code dir = 2, and the flow difference data of this sampling t r is the arithmetic mean of k negative flow differences in this sampling, otherwise it is determined that the direction of the current sampling period T is undetermined, record dir = 0, and the flow difference data of this sampling
[0161] S1023: If (m+k)≤g, it is determined that the flow measurement error of this sampling period T is not met (the minimum requirement for the number of sampling times is not met), and the direction of this sampling period T is determined to be wrong, and dir=3 and the flow time difference data of this sampling are recorded.
[0162] Traffic time difference data Contains the sound wave downstream flight time T d , acoustic counterflow flight time T u If during a single flow sampling process, T u ≥T d , then the flow time difference of this sampling is determined to be positive Δt = T u -T d Otherwise, the flow time difference of this sampling is determined to be the reverse Δt = T d -T u . Record the flow time difference and direction (Δt1, d1), (Δt2, d2), (Δt i ,d i ), i≤n. The flow direction of this sampling period T is determined according to the method of S102. R .
[0163] The time difference data of the i-th sampling flow in this sampling period T is calculated according to the flow direction d R Process the data, such as the flow direction d in the i-th data i With d R The direction is different, then the flow time difference data Δt of the i-th sampling i Eliminate, and finally satisfy d R The arithmetic mean of the flow time difference data in the same direction is calculated to obtain the flow time difference of the sampling period T.
[0164] S103: For M sampling periods T j (j≤M), collect flow time difference data, and obtain flow time difference data of M cycles Synchronously obtain the traffic direction data d of M cycles Rj , and manage its data according to the queue method.
[0165] According to the M sampling periods T sampled in S103 j , in the case of unbalanced pressure in the pipe network, the flow direction data d of M cycles Rj The direction of the flow in adjacent sampling periods may be inconsistent. In the case of actual water use by users, the flow direction data d of M cycles Rj Continuity should be met.
[0166] S201: locate and index the M queue data obtained in S103, and find the traffic direction that was most recently sampled normally, i.e., d Rj =0,1,2, and the index value of the traffic direction of the most recent normal sampling in the M queue data cannot exceed half of M, that is, M / 2. If it exceeds, the instantaneous traffic q calculated this time is determined t =0.
[0167] S202: Obtain the instantaneous flow rate q calculated this time according to the method in S201 t Flow direction d Rk , judge the flow direction of M sampling periods T, and Rj =d Rk The flow direction of the sampling is counted and the number is recorded as K. At the same time, the normal sampling flow direction d Rj =0,1,2, count them and record the number as C.
[0168] S203: The instantaneous flow rate q calculated this time obtained according to the method of S201 t and flow direction d Rk , if the flow direction is determined to be undetermined, that is, d Rk =0, then the instantaneous flow q is calculated this time t = 0, otherwise the flow direction of the queue data M is continuous d Rj =d Rk Calculate the statistics and record the number of consecutive occurrences as G.
[0169] S204: This calculation instantaneous flow q t , according to S203 method to obtain G, if d Rk =1, it should satisfy G>1, and G>(K / 2), then calculate the instantaneous flow q t The arithmetic mean of the traffic time difference M sampling periods T continuous time difference data G Through the relationship between flow time difference and instantaneous flow, the instantaneous flow is calculated to be q t , otherwise the above conditions are not met, then q t =0.
[0170] If d Rk =2, it should satisfy G>1, and G>(C / 2), then calculate the instantaneous flow q t The arithmetic mean of the traffic time difference M sampling periods T continuous time difference data G Through the relationship between flow time difference and instantaneous flow, the instantaneous flow is calculated to be q t , otherwise the above conditions are not met, then q t =0.
[0171] S205: q calculated according to S204 method t , should meet the system's restrictions on instantaneous flow, that is, q t ≥q s , then the instantaneous flow q t The relationship between d and the cumulative flow Q is calculated to obtain the cumulative flow through the water meter. Rk =1, the cumulative flow calculated this time is added to the forward cumulative flow Q F If d Rk =2, then the accumulated flow calculated this time is added to the reverse accumulated flow Q R .
[0172] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 2 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a bidirectional metering method applied to abnormal flow under pipeline disturbance is implemented.
[0173] Those skilled in the art will understand that Figure 2 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components. In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0174] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0175] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0176] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0177] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0178] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.
[0179] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0180] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A bidirectional metering method for abnormal flow in a pipe network, characterized in that: include: Obtain sampling data of the ultrasonic water meter within the current flow sampling cycle sequence; Based on the sampling data, determine the periodic flow time difference and periodic flow direction code corresponding to each period of the current flow sampling period sequence; Using the periodic flow direction code as an index, the periodic flow time difference sequence is constructed in chronological order; Based on the periodic flow time difference sequence, the cumulative flow corresponding to the current flow sampling period sequence is determined.
2. The bidirectional metering method for abnormal flow in pipeline network disturbance according to claim 1 is characterized in that: Based on the sampling data, determining the periodic flow time difference and periodic flow direction code of each period corresponding to the current flow sampling period sequence includes: Determine any cycle in the current traffic sampling cycle sequence as the current cycle; Get the total sampling times n of the ultrasonic water meter in the current cycle; Based on the sampling data, determine the sampling flow time difference and sampling flow direction at each sampling in the current cycle; the sampling flow direction includes forward and reverse; The number of times the sampling flow direction is forward in the current cycle is obtained as the forward flow time difference number m; The number of times the sampling flow direction is reverse in the current cycle is obtained as the reverse flow time difference number k; Determine the periodic flow direction code of the current period based on the total sampling times n, the forward flow time difference times m and the reverse flow time difference times k; Determine the periodic flow time difference of the current period based on the periodic flow direction code of the current period, and the sampling flow time difference and sampling flow direction at each sampling in the current period; Update the current cycle, and return to step "obtain the total number of sampling times n of the ultrasonic water meter in the current cycle" until the current flow sampling cycle sequence is traversed to obtain the periodic flow time difference and periodic flow direction code corresponding to each cycle of the current flow sampling cycle sequence.
3. The bidirectional metering method for abnormal flow in pipeline network disturbance according to claim 2 is characterized in that: Based on the sampling data, the sampling flow time difference and sampling flow direction at each sampling in the current cycle are determined, including: Let sampling number i = 1; Determine the sampling data at the i-th sampling as the current sampling data; the current sampling data includes the downstream flight time T of the sound wave at the i-th sampling d and the acoustic wave countercurrent flight time T at the i-th sampling u ; Determine the acoustic wave countercurrent flight time T at the i-th sampling in the current sampling data u Is it greater than or equal to the downstream flight time T of the sound wave at the i-th sampling time? d , obtain the first judgment result; If the first judgment result is yes, then determining that the sampling flow direction at the i-th sampling is forward; Determine the acoustic wave countercurrent flight time T at the i-th sampling u The time T of the sound wave flying downstream at the i-th sampling d The difference is the sampling flow time difference; If the first judgment result is no, determining that the sampling flow direction during the i-th sampling is reverse; Determine the downstream flight time T of the sound wave at the i-th sampling d The acoustic wave countercurrent flight time T at the i-th sampling u The difference is the sampling flow time difference; Determine whether the sampling number i reaches the total sampling number n in the current cycle, and obtain a second determination result; If the second judgment result is no, the value of the sampling number i is increased by 1, and the process returns to step "judging the acoustic wave countercurrent flight time T of the i-th sampling in the current sampling data". u Is it greater than or equal to the downstream flight time T of the sound wave at the i-th sampling time? d , get the first judgment result"; If the second judgment result is yes, the sampling flow time difference and sampling flow direction at each sampling in the current cycle are obtained.
4. The bidirectional metering method for abnormal flow in pipeline network disturbance according to claim 2 is characterized in that: Based on the total sampling times n, the forward flow time difference times m, and the reverse flow time difference times k, the periodic flow direction code of the current period is determined, including: Get the effective sampling times threshold; Determine the sum of the forward flow time difference number m and the reverse flow time difference number k as the effective sampling number; Determine whether the effective sampling number reaches the effective sampling number threshold, and obtain a third determination result; If the third judgment result is no, then the cycle flow direction code of the current cycle is set to be equal to 3; the cycle flow direction code equal to 3 indicates that the flow measurement of the current cycle is wrong; If the third judgment result is yes, then the difference between the total sampling times n and the preset value is set as the second judgment value; Determine whether the forward flow time difference number m is less than the reverse flow time difference number k, and obtain a fourth determination result; If the fourth judgment result is no, then determining the difference between the forward flow time difference number m and the reverse flow time difference number k as the third judgment value; Determine whether the third determination value is less than the second determination value, and obtain a fifth determination result; If the fifth judgment result is no, then the cycle flow direction code of the current cycle is set to 1; the cycle flow direction code equal to 1 indicates that the flow direction of the current cycle is positive; If the fifth judgment result is yes, then the periodic flow direction code of the current period is set to 0; the periodic flow direction code being 0 indicates that the flow direction of the current period has no definite direction; If the fourth judgment result is yes, the difference between the reverse flow time difference number k and the forward flow time difference number m is determined as a fourth judgment value; Determine whether the fourth determination value is less than the second determination value, and obtain a sixth determination result; If the sixth judgment result is no, then the cycle flow direction code of the current cycle is set to 2; the cycle flow direction code equal to 2 indicates that the flow direction of the current cycle is reverse; If the sixth judgment result is yes, the cycle flow direction code of the current cycle is set to 0.
5. The bidirectional metering method for abnormal flow in pipeline network disturbance according to claim 4 is characterized in that: Based on the cycle flow direction code of the current cycle, as well as the sampling flow time difference and sampling flow direction at each sampling in the current cycle, the cycle flow time difference of the current cycle is determined, including: Determine that all sampling flow time differences in the current cycle whose sampling flow direction is the same as the cycle flow direction are effective sampling flow time differences; The arithmetic mean of all valid sampled flow time differences is determined as the period flow time difference of the current period.
6. The bidirectional metering method for abnormal flow in pipe network disturbance according to claim 4 is characterized in that: Based on the periodic flow time difference sequence, determining the cumulative flow corresponding to the current flow sampling period sequence includes: In chronological order, the first cycle whose flow direction code is not equal to 3 is obtained from the back to the front as the reference cycle; Determine the periodic flow direction code of the reference period as the reference periodic flow direction code; Based on the reference period and the periodic flow time difference sequence, determine the instantaneous flow corresponding to the current flow sampling period sequence; Determine the product of the instantaneous flow corresponding to the current flow sampling period sequence and the pipe network area as the current cumulative flow; Obtain forward cumulative flow and reverse cumulative flow; When the flow direction code in the reference period is equal to 1, the current cumulative flow is added to the positive cumulative flow; When the reference cycle flow direction code is equal to 2, the current accumulated flow is added to the reverse accumulated flow.
7. The bidirectional metering method for abnormal flow in pipe network disturbance according to claim 6 is characterized in that: Determining the instantaneous flow corresponding to the current flow sampling period sequence based on the reference period and the period flow time difference sequence includes: Obtain the element number of the reference period in the current traffic sampling period sequence as the reference period number; Determine half of the number of elements in the current flow sampling period sequence as the fifth determination quantity; Determine whether the reference cycle number is greater than the fifth determination value to obtain a seventh determination result; If the seventh judgment result is no, then determining that the instantaneous flow corresponding to the current flow sampling period sequence is 0; If the seventh judgment result is yes, then judging whether the reference period flow direction code is equal to 0, and obtaining an eighth judgment result; If the eighth judgment result is yes, then determining that the instantaneous flow corresponding to the current flow sampling period sequence is 0; If the eighth judgment result is no, obtaining the number of elements in the periodic flow time difference sequence whose index is not equal to 3 as a first number C; Obtaining a reference element sequence in the periodic flow time difference sequence; all elements in the reference element sequence are continuous in the periodic flow time difference sequence, and the indexes of all elements in the reference element sequence in the periodic flow time difference sequence are equal to the reference periodic flow direction code; Determine the base element sequence with the largest number of elements as the current base element sequence; Determine the number of elements of the current reference element sequence as a second number G; When the reference period flow direction code is equal to 1, it is determined whether the first condition is met to obtain a ninth determination result; the first condition is G>1, and G>(K / 2); K is the number of elements in the periodic flow time difference sequence whose index is equal to the reference period flow direction code; If the ninth judgment result is yes, then the arithmetic mean of all elements in the current reference element sequence is the reference period flow time difference; Based on the reference period flow time difference and the relationship between flow time difference and instantaneous flow, determine the instantaneous flow corresponding to the current flow sampling period sequence; If the ninth judgment result is no, then determining that the instantaneous flow corresponding to the current flow sampling period sequence is 0; When the reference period flow direction code is equal to 2, it is determined whether the second condition is met to obtain a tenth determination result; the second condition is G>1, and G>(C / 2); If the tenth judgment result is yes, then the arithmetic mean of all elements in the current reference element sequence is the reference period flow time difference; Based on the reference period flow time difference and the relationship between flow time difference and instantaneous flow, determine the instantaneous flow corresponding to the current flow sampling period sequence; If the tenth judgment result is no, it is determined that the instantaneous flow corresponding to the current flow sampling period sequence is 0.
8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the bidirectional metering method described in any one of claims 1 to 7 for use under abnormal flow conditions caused by pipeline network disturbances.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the bidirectional metering method applied to abnormal flow in a pipeline network disturbance as described in any one of claims 1 to 7 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the bidirectional metering method applied to abnormal flow in a pipeline network disturbance as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Ultrasonic flow measuring method and device
CN106643931A
Flow measurement method, device and system, electronic equipment and readable storage medium
CN110579251A
Anti-interference filtering method and device for high-precision household ultrasonic water meter
CN113865659A
Method for improving metering precision of ultrasonic gas meter under abnormal flow
CN115931070A
Flow metering method of ultrasonic water meter
CN116952318A
Cited By
Ultrasonic water meter detection device and detection method
CN120293245A
