Ultrasonic water meter flow correction method and system
By combining multi-dimensional data fusion of ultrasonic water meter and adaptive threshold algorithm combined with reinforcement learning algorithm, a dynamic correction model is constructed, which solves the measurement deviation problem caused by dynamic changes in fluid characteristics in the existing technology, and achieves more accurate and adaptive flow correction Effect.
Patent Information
- Application Number
- CN202411080372.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-08-08
AI Technical Summary
During the measurement process, the existing ultrasonic water meter is affected by factors such as fluid temperature, pressure, and flow rate, which leads to deviations in the measurement results. The existing correction methods rely on static calibration coefficients and are difficult to adapt to the dynamic changes in fluid characteristics.
By obtaining real-time data, historical data and component data of ultrasonic water meter, multi-dimensional data fusion is carried out, and adaptive threshold algorithms and reinforcement learning algorithms are introduced to build a dynamic correction model to achieve accurate correction of ultrasonic water meter flow.
It improves the accuracy and adaptability of flow measurement, reduces false alarms and missed alarms, and can optimize itself when fluid composition or environmental conditions are unstable, achieving rapid and accurate correction effects.
Smart Images

Figure CN118603264B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of flow correction, and in particular relates to an ultrasonic water meter flow correction method and a system thereof. Background Art
[0002] Ultrasonic water meters are advanced fluid measuring instruments that use ultrasonic technology to accurately measure water flow. This type of water meter sends and receives ultrasonic signals in water, and calculates flow rate and flow based on the change in the speed at which the signal propagates in the water flow. Due to its simple installation process and flexible location without cutting off the water flow, ultrasonic water meters have been widely used in industrial and commercial fields, especially in environments with extremely high requirements for measurement accuracy and reliability. In addition, they are also very suitable for home and agricultural irrigation systems, helping users effectively monitor and control water consumption.
[0003] However, existing ultrasonic water meters may be affected by various factors such as fluid temperature, pressure, and flow rate during the measurement process, which may cause deviations in the measurement results and require correction. Currently, existing correction methods rely on static calibration coefficients, which limits their adaptability to dynamic changes in fluid properties. Summary of the invention
[0004] In order to overcome the above-mentioned defects of the prior art, the present invention provides an ultrasonic water meter flow correction method and system, which can provide more accurate flow measurement, adapt to the dynamic changes of fluid characteristics, and then accurately correct the ultrasonic water meter flow.
[0005] The present invention provides the following technical solution: a method for correcting the flow rate of an ultrasonic water meter, comprising the following steps:
[0006] S1: Obtain the real-time data, historical data and composition data of the ultrasonic water meter fluid, and fuse the multi-dimensional data to obtain the fused fluid data;
[0007] S2: Perform pattern recognition on the fused fluid data, and introduce an adaptive threshold algorithm during pattern recognition to dynamically adjust the abnormality standard to adapt to the data characteristics under different working conditions;
[0008] S3: Based on the fused fluid data, a data-driven approach is adopted and combined with the principles of fluid dynamics to build a dynamic correction model to accurately correct the flow of the ultrasonic water meter;
[0009] S4: Use reinforcement learning algorithm to learn the optimal threshold adjustment strategy, optimize the threshold, and achieve adaptive dynamic correction.
[0010] Preferably, in said S1, the multidimensional data includes:
[0011] Both real-time parameters and historical data include the fluid’s temperature b, pressure p, flow rate v, density m, and viscosity n;
[0012] Composition data include pH and salt content Y of the fluid.
[0013] Preferably, in S1, the multidimensional data fusion step is as follows:
[0014] S11: Standardize each parameter of different data separately:
[0015] ;
[0016] Among them, z is the standardized data, α is the original data point, μ is the mean of the data point, and σ is the standard deviation of the data point;
[0017] S12: Integrate real-time data and historical data into one data set:
[0018] ;
[0019] ;
[0020] S rt and S ht are the data sets of real-time data and historical data, respectively, r , p r , v r , m r , n r Represent the temperature, pressure, flow rate, density and viscosity of the real-time fluid, b h , p h , v h , m h , n h represent the temperature, pressure, flow rate, density and viscosity of the historical fluid respectively;
[0021] S13: Use the resampling method to adjust the real-time data and historical data to ensure that the time intervals of the two are the same;
[0022] ;
[0023] in, is at time t j The resampled data, N j is at time t j The number of data points in the interval, Indicates that at time t i Data within the interval;
[0024] S14: Weighting of real-time data and historical data:
[0025] ;
[0026] in, It is weighted data, w1 and w2 are the weights of real-time data and historical data sets respectively;
[0027] At the same time, consider the effect of the fluid salt content Y on the density m:
[0028] ;
[0029] Among them, m fu represents an estimate of the density in multidimensional data, is the coefficient of the influence of salt content Y on density, m atd represents the density after fusion;
[0030] Also consider the effect of pH on fluid characteristics:
[0031] ;
[0032] Among them, 7 is the neutral pH value, β is the coefficient of pH influence, and n atd represents the adjusted viscosity, n fu Represents an estimate of fluid viscosity in multidimensional data;
[0033] S15: Fusion of temperature, pressure, flow rate, density and viscosity data:
[0034] ;
[0035] Among them, W b , W p , W v , W m and W n Represent the weights of temperature, pressure, flow rate, density and viscosity respectively, and their sum is 1. is the fused data value for each observation sample.
[0036] Preferably, in said S2, the pattern recognition step is as follows:
[0037] S21: Classify the fused data through SVM:
[0038] ;
[0039] in, is the function output, used for data classification, is a data point in the training set, yi is the corresponding label, αi is the Lagrange multiplier, is the kernel function, e is the bias term, n sis the number of support vectors, sign is the sign function;
[0040] S22: Use mean and standard deviation to calculate the threshold:
[0041] ;
[0042] ;
[0043] in, represents the mean of the fused data, represents the standard deviation of the fused data, and N is the number of observed samples;
[0044] S23: Calculate the adaptive threshold:
[0045] ;
[0046] Where T is the threshold value, is a user-defined constant;
[0047] S24: By monitoring the distribution changes of data, the sliding window method is used to recalculate and , and then update the threshold T:
[0048] Set the length of the sliding window to c, and use the most recent c data points to calculate the mean and standard deviation;
[0049] ;
[0050] ;
[0051] in, is the current time point, and Represents at different time points The mean and variance of
[0052] S25: Calculate the dynamic threshold:
[0053] ;
[0054] in, It's at the time The dynamic threshold of It's at the time The constant of
[0055] S26: At each time point , calculate the new mean, standard deviation and threshold. If the data point is greater than the threshold, the data point is considered abnormal and marked, otherwise it is normal.
[0056] Preferably, in S3, the steps of constructing the dynamic correction model are as follows:
[0057] S31: Extracting descriptors of fluid state from raw data to enhance the performance of the model:
[0058] ;
[0059] Where W is the vorticity vector, is the gradient operator, V sc represents the velocity field of the fluid;
[0060] S32: Use neural network algorithm to fit data and build model:
[0061] ;
[0062] in, is the output of the model, f is the neural network model itself, w0 and w1 are weight matrices, w0 is the weight from the input layer to the hidden layer, w1 is the weight from the hidden layer to the output layer, e0 and e1 are bias terms, is the activation function, is the input feature vector;
[0063] S33: For regression tasks, the mean square error is used as the loss function to quantify the difference between the predicted value and the actual value time:
[0064] ;
[0065] Among them, L sh is the loss function, is the true value of the g-th sample, is the predicted value of the g-th sample.
[0066] Preferably, in S4, the steps of adaptive dynamic correction are as follows:
[0067] S41: Define the reward function:
[0068] ;
[0069] Where RU represents the number of correctly identified anomalies, zp represents the total number of detections, and R(T) represents the threshold-based reward function;
[0070] S42: Establish update rules for the threshold adjustment strategy:
[0071] ;
[0072] in, represents the Q value, which represents the expected utility of taking the current action a from the current state s under the current strategy, is the learning rate, is the discount factor, sx and ax represent the next state and the next action respectively. is the updated Q value, is the reward function, This is the maximum Q value of all possible actions ax in the next state sx;
[0073] S43: For state s and actions To define:
[0074] ;
[0075] ;
[0076] in, T represents an integer or a negative number;
[0077] S44: Initialize a Q value table or matrix for storing the Q value of each state and action, and set the initial Q value to 0;
[0078] S45: For the reward function, it is defined based on the anomaly detection accuracy:
[0079] ;
[0080] S46: Define the update rule of Q value:
[0081] ;
[0082] Among them, s t and a t Represent the current state and current action at time point t, sx t+1 is the next state at time point t;
[0083] S47: Select the action strategy:
[0084] Always choose the action with the highest current Q value:
[0085] ;
[0086] Among them, argmax a Indicates that the choice makes The largest action a;
[0087] By probability Randomly choose an action with probability 1- Choose the action with the highest Q value:
[0088] ;
[0089] in, is a decimal between 0 and 1, rdan means randomly selecting an action from all possible actions;
[0090] S48: At each time step, select an action a based on the current measurement t , execute the action, and observe and record the next state sx t+1 and rewards ;
[0091] S49: using S46 to update the current state and the Q value of the action, and repeating steps S46 to S48 until a predetermined number of iterations is reached;
[0092] S50: The threshold T is updated and adjusted based on the Q value:
[0093] ;
[0094] in , which means that the adjustment amount of the threshold T is the difference between the current Q value and the maximum Q value.
[0095] Preferably, in S49, the predetermined number of iterations is as follows:
[0096] Set the maximum number of iterations D CM , when the maximum number of iterations D is reached CM , stop the iteration.
[0097] An ultrasonic water meter flow correction system, used in the above ultrasonic water meter flow correction method, comprises:
[0098] The acquisition module is used to obtain the real-time data, historical data and composition data of the ultrasonic water meter fluid, and fuse the multi-dimensional data to obtain the fused fluid data;
[0099] The recognition module is used to perform pattern recognition on the fused fluid data and introduce an adaptive threshold algorithm during pattern recognition to dynamically adjust the abnormality standard to adapt to the data characteristics under different working conditions;
[0100] The construction module uses a data-driven approach based on the fused fluid data and combines the principles of fluid dynamics to build a dynamic correction model to accurately correct the flow of the ultrasonic water meter;
[0101] The adaptive correction module uses a reinforcement learning algorithm to learn the optimal threshold adjustment strategy, optimize the threshold, and achieve adaptive dynamic correction.
[0102] Technical effects and advantages of the present invention:
[0103] The present invention collects and fuses data from multiple dimensions, performs pattern recognition on the fused fluid data, introduces an adaptive threshold algorithm, and then adjusts the abnormal judgment standard according to the actual working conditions, which can reduce false alarms and missed alarms, improve data quality and reliability, and at the same time, the data-driven dynamic correction model can adapt to changes in fluid characteristics, provide more accurate flow measurement, and achieve the effect of adapting to dynamic changes in fluid characteristics, and then accurately correct the flow of the ultrasonic water meter. At the same time, when the fluid composition or environmental conditions are unstable, the reinforcement learning algorithm is used to enable the model to self-optimize over time and automatically adjust to the optimal operating state without frequent manual intervention, and it integrates multiple types of data and algorithms to improve the adaptability and robustness of the system in complex and changing environments. Compared with the prior art, the present invention has a fast correction speed, high accuracy, and strong adaptability. BRIEF DESCRIPTION OF THE DRAWINGS
[0104] Figure 1 It is a flow chart of the steps of the ultrasonic water meter flow correction method of the present invention;
[0105] Figure 2 This is a modular structure diagram of the ultrasonic water meter flow correction system of the present invention. DETAILED DESCRIPTION
[0106] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.
[0107] Embodiment 1:
[0108] like Figure 1 As shown, a method for correcting the flow rate of an ultrasonic water meter comprises the following steps:
[0109] S1: Obtain the real-time data, historical data and composition data of the ultrasonic water meter fluid, and fuse the multi-dimensional data to obtain the fused fluid data;
[0110] S2: Perform pattern recognition on the fused fluid data, and introduce an adaptive threshold algorithm during pattern recognition to dynamically adjust the abnormality standard to adapt to the data characteristics under different working conditions;
[0111] S3: Based on the fused fluid data, a data-driven approach is adopted and combined with the principles of fluid dynamics to build a dynamic correction model to accurately correct the flow of the ultrasonic water meter;
[0112] S4: Use reinforcement learning algorithm to learn the optimal threshold adjustment strategy, optimize the threshold, and achieve adaptive dynamic correction.
[0113] In S1, multidimensional data includes:
[0114] Both real-time parameters and historical data include the fluid’s temperature b, pressure p, flow rate v, density m, and viscosity n;
[0115] Composition data include pH and salt content Y of the fluid.
[0116] In S1, the steps for fusion of multidimensional data are as follows:
[0117] S11: Standardize each parameter of different data separately:
[0118] ;
[0119] Among them, z is the standardized data, α is the original data point, μ is the mean of the data point, and σ is the standard deviation of the data point;
[0120] S12: Integrate real-time data and historical data into one data set:
[0121] ;
[0122] ;
[0123] S rt and S ht are the data sets of real-time data and historical data, respectively, r , p r , v r , m r , n r Represent the temperature, pressure, flow rate, density and viscosity of the real-time fluid, b h , p h , v h , m h , n h represent the temperature, pressure, flow rate, density and viscosity of the historical fluid respectively;
[0124] S13: Use the resampling method to adjust the real-time data and historical data to ensure that the time intervals between the two are the same;
[0125] ;
[0126] in, is at time t j The resampled data, N j is at time t j The number of data points in the interval, Indicates that at time t i Data within the interval;
[0127] S14: Weighting of real-time data and historical data:
[0128] ;
[0129] in, It is weighted data, w1 and w2 are the weights of real-time data and historical data sets respectively;
[0130] At the same time, consider the effect of the fluid salt content Y on the density m:
[0131] ;
[0132] Among them, m fu represents an estimate of the density in multidimensional data, is the coefficient of the influence of salt content Y on density, m atd represents the density after fusion;
[0133] Also consider the effect of pH on fluid characteristics:
[0134] ;
[0135] Among them, 7 is the neutral pH value, β is the coefficient of pH influence, and n atd represents the adjusted viscosity, n fu Represents an estimate of fluid viscosity in multidimensional data;
[0136] S15: Fusion of temperature, pressure, flow rate, density and viscosity data:
[0137] ;
[0138] Among them, W b , W p , W v , W m and W n Represent the weights of temperature, pressure, flow rate, density and viscosity respectively, and their sum is 1. is the fused data value for each observation sample.
[0139] In S2, the steps of pattern recognition are as follows:
[0140] S21: Classify the fused data through SVM:
[0141] ;
[0142] in, is the function output, used for data classification, is a data point in the training set, yi is the corresponding label, αi is the Lagrange multiplier, is the kernel function, e is the bias term, n s is the number of support vectors, sign is the sign function;
[0143] S22: Use mean and standard deviation to calculate the threshold:
[0144] ;
[0145] ;
[0146] in, represents the mean of the fused data, represents the standard deviation of the fused data, and N is the number of observed samples;
[0147] S23: Calculate the adaptive threshold:
[0148] ;
[0149] Where T is the threshold value, is a user-defined constant;
[0150] S24: By monitoring the distribution changes of data, the sliding window method is used to recalculate and , and then update the threshold T:
[0151] Set the length of the sliding window to c, and use the most recent c data points to calculate the mean and standard deviation;
[0152] ;
[0153] ;
[0154] in, is the current time point, and Represents at different time points The mean and variance of
[0155] S25: Calculate the dynamic threshold:
[0156] ;
[0157] in, It's at the time The dynamic threshold of It's at the time The constant of
[0158] S26: At each time point , calculate the new mean, standard deviation and threshold. If the data point is greater than the threshold, the data point is considered abnormal and marked, otherwise it is normal.
[0159] In S3, the steps for building the dynamic correction model are as follows:
[0160] S31: Extract descriptors of fluid state from raw data to enhance the performance of the model:
[0161] ;
[0162] Where W is the vorticity vector, is the gradient operator, V sc represents the velocity field of the fluid;
[0163] S32: Use neural network algorithm to fit data and build model:
[0164] ;
[0165] in, is the output of the model, f is the neural network model itself, w0 and w1 are weight matrices, w0 is the weight from the input layer to the hidden layer, w1 is the weight from the hidden layer to the output layer, e0 and e1 are bias terms, is the activation function, is the input feature vector;
[0166] S33: For regression tasks, the mean square error is used as the loss function to quantify the difference between the predicted value and the actual value time:
[0167] ;
[0168] Among them, L sh is the loss function, is the true value of the g-th sample, is the predicted value of the g-th sample.
[0169] In S4, the steps of adaptive dynamic correction are as follows:
[0170] S41: Define the reward function:
[0171] ;
[0172] Where RU represents the number of correctly identified anomalies, zp represents the total number of detections, and R(T) represents the threshold-based reward function;
[0173] S42: Establish update rules for the threshold adjustment strategy:
[0174] ;
[0175] in, represents the Q value, which represents the expected utility of taking the current action a from the current state s under the current strategy, is the learning rate, is the discount factor, sx and ax represent the next state and the next action respectively. is the updated Q value, is the reward function, This is the maximum Q value of all possible actions ax in the next state sx;
[0176] S43: For state s and actions To define:
[0177] ;
[0178] ;
[0179] in, T represents an integer or a negative number;
[0180] S44: Initialize a Q value table or matrix for storing the Q value of each state and action, and set the initial Q value to 0;
[0181] S45: For the reward function, it is defined based on the anomaly detection accuracy:
[0182] ;
[0183] S46: Define the update rule of Q value:
[0184] ;
[0185] Among them, s t and a t Represent the current state and current action at time point t, sx t+1 is the next state at time point t;
[0186] S47: Select the action strategy:
[0187] Always choose the action with the highest current Q value:
[0188] ;
[0189] Among them, argmax a Indicates that the choice makes The largest action a;
[0190] By probability Randomly choose an action with probability 1- Choose the action with the highest Q value:
[0191] ;
[0192] in, is a decimal between 0 and 1, rdan means randomly selecting an action from all possible actions;
[0193] S48: At each time step, select an action a based on the current measurement t , execute the action, and observe and record the next state sx t+1 and rewards ;
[0194] S49: using S46 to update the current state and the Q value of the action, and repeating steps S46 to S48 until a predetermined number of iterations is reached;
[0195] S50: The threshold T is updated and adjusted based on the Q value:
[0196] ;
[0197] in , which means that the adjustment amount of the threshold T is the difference between the current Q value and the maximum Q value.
[0198] In S49, the predetermined number of iterations is as follows:
[0199] Set the maximum number of iterations D CM , when the maximum number of iterations D is reached CM , stop the iteration.
[0200] Example 2
[0201] An ultrasonic water meter flow correction system, used to implement the ultrasonic water meter flow correction method in embodiment 1, comprising:
[0202] The acquisition module is used to obtain the real-time data, historical data and composition data of the ultrasonic water meter fluid, and fuse the multi-dimensional data to obtain the fused fluid data;
[0203] The recognition module is used to perform pattern recognition on the fused fluid data and introduce an adaptive threshold algorithm during pattern recognition to dynamically adjust the abnormality standard to adapt to the data characteristics under different working conditions;
[0204] The construction module uses a data-driven approach based on the fused fluid data and combines the principles of fluid dynamics to build a dynamic correction model to accurately correct the flow of the ultrasonic water meter;
[0205] The adaptive correction module uses a reinforcement learning algorithm to learn the optimal threshold adjustment strategy, optimize the threshold, and achieve adaptive dynamic correction.
Claims
1. A method for correcting the flow rate of an ultrasonic water meter. It is characterized in that The following steps are involved: S1: Obtain the real-time data, historical data and composition data of the ultrasonic water meter fluid, and fuse the multi-dimensional data to obtain the fused fluid data; S2: Perform pattern recognition on the fused fluid data, and introduce an adaptive threshold algorithm during pattern recognition to dynamically adjust the abnormality standard to adapt to the data characteristics under different working conditions; S3: Based on the fused fluid data, a data-driven approach is adopted and combined with the principles of fluid dynamics to build a dynamic correction model to accurately correct the flow of the ultrasonic water meter; S4: Use reinforcement learning algorithm to learn the optimal threshold adjustment strategy, optimize the threshold, and achieve adaptive dynamic correction; In the above S1, the multidimensional data includes: Both real-time parameters and historical data include the fluid’s temperature b, pressure p, flow rate v, density m, and viscosity n; Composition data include pH and salt content Y of the fluid; In S1, the steps of fusion of multidimensional data are as follows: S11: Standardize each parameter of different data separately: ; Among them, z is the standardized data, α is the original data point, μ is the mean of the data point, and σ is the standard deviation of the data point; S12: Integrate real-time data and historical data into one data set: ; ; S rt and S ht are the data sets of real-time data and historical data, respectively, r , p r , v r , m r , n r Represent the temperature, pressure, flow rate, density and viscosity of the real-time fluid, b h , p h , v h , m h , n h represent the temperature, pressure, flow rate, density and viscosity of the historical fluid respectively; S13: Use the resampling method to adjust the real-time data and historical data to ensure that the time intervals of the two are the same; ; in, is at time t j The resampled data, N j is at time t j The number of data points in the interval, Indicates that at time t i Data within the interval; S14: Weighting of real-time data and historical data: ; in, is the weighted data, w 1 and w 2 are the weights of real-time data and historical data sets respectively; At the same time, consider the effect of the fluid salt content Y on the density m: ; Among them, m fu represents an estimate of the density in multidimensional data, is the coefficient of the influence of salt content Y on density, m atd represents the density after fusion; Also consider the effect of pH on fluid characteristics: ; Among them, 7 is the neutral pH value, β is the coefficient of pH influence, and n atd represents the adjusted viscosity, n fu Represents an estimate of fluid viscosity in multidimensional data; S15: Fusion of temperature, pressure, flow rate, density and viscosity data: ; Among them, W b , W p , W v , W m and W n Represent the weights of temperature, pressure, flow rate, density and viscosity respectively, and their sum is 1. is the fused data value of each observation sample; In the above-mentioned S2, the steps of pattern recognition are as follows: S21: Classify the fused data through SVM: ; in, is the function output, used for data classification, is a data point in the training set, yi is the corresponding label, αi is the Lagrange multiplier, is the kernel function, e is the bias term, n s is the number of support vectors, sign is the sign function; S22: Use mean and standard deviation to calculate the threshold: ; ; in, represents the mean of the fused data, represents the standard deviation of the fused data, and N is the number of observed samples; S23: Calculate the adaptive threshold: ; Where T is the threshold value, is a user-defined constant; S24: By monitoring the distribution changes of data, the sliding window method is used to recalculate and , and then update the threshold T: Set the length of the sliding window to c, and use the most recent c data points to calculate the mean and standard deviation; ; ; in, is the current time point, and Represents at different time points The mean and variance of S25: Calculate the dynamic threshold: ; in, It's at the time The dynamic threshold of It's at the time The constant of S26: At each time point , calculate the new mean, standard deviation and threshold. If the data point is greater than the threshold, the data point is considered abnormal and marked, otherwise it is normal; In S3, the steps for constructing the dynamic correction model are as follows: S31: Extracting descriptors of fluid state from raw data to enhance the performance of the model: ; Where W is the vorticity vector, is the gradient operator, V sc represents the velocity field of the fluid; S32: Use neural network algorithm to fit data and build model: ; in, is the output of the model, f is the neural network model itself, and w 0 and w 1 is the weight matrix, w 0 is the weight from the input layer to the hidden layer, w 1 is the weight from the hidden layer to the output layer, e 0 and e 1 is the bias term, is the activation function, is the input feature vector; S33: For regression tasks, the mean square error is used as the loss function to quantify the difference between the predicted value and the actual value time: ; Among them, L sh is the loss function, is the true value of the g-th sample, is the predicted value of the g-th sample.
2. The ultrasonic water meter flow correction method according to claim 1, It is characterized in that In the above-mentioned S4, the steps of adaptive dynamic correction are as follows: S41: Define the reward function: ; Where RU represents the number of correctly identified anomalies, zp represents the total number of detections, and R(T) represents the threshold-based reward function; S42: Establish update rules for the threshold adjustment strategy: ; in, represents the Q value, which represents the expected utility of taking the current action a from the current state s under the current strategy, is the learning rate, is the discount factor, sx and ax represent the next state and the next action respectively. is the updated Q value, is the reward function, This is the maximum Q value of all possible actions ax in the next state sx; S43: For state s and actions To define: ; ; in, T represents an integer or a negative number; S44: Initialize a Q value table or matrix for storing the Q value of each state and action, and set the initial Q value to 0; S45: For the reward function, it is defined based on the anomaly detection accuracy: ; S46: Define the Q value update rule: ; Among them, s t and a t Represent the current state and current action at time point t, sx t+1 is the next state at time point t; S47: Select the action strategy: Always choose the action with the highest current Q value: ; Among them, argmax a Indicates that the choice makes The largest action a; Choose an action randomly with probability ϵ, and choose the action with the highest Q value with probability 1-ϵ: ; Among them, ϵ is a decimal between 0 and 1, and rdan means randomly selecting an action from all possible actions; S48: At each time step, select an action a based on the current measurement t , execute the action, and observe and record the next state sx t+1 and rewards ; S49: using S46 to update the current state and the Q value of the action, and repeating steps S46 to S48 until a predetermined number of iterations is reached; S50: The threshold T is updated and adjusted based on the Q value: ; in , which means that the adjustment amount of the threshold T is the difference between the current Q value and the maximum Q value.
3. The ultrasonic water meter flow correction method according to claim 2, It is characterized in that In the above S49, the predetermined number of iterations is as follows: Set the maximum number of iterations D CM , when the maximum number of iterations D is reached CM , stop the iteration.
4. An ultrasonic water meter flow correction system, used to implement the ultrasonic water meter flow correction method according to any one of claims 1 to 3, It is characterized in that include: The acquisition module is used to obtain the real-time data, historical data and composition data of the ultrasonic water meter fluid, and fuse the multi-dimensional data to obtain the fused fluid data; The recognition module is used to perform pattern recognition on the fused fluid data and introduce an adaptive threshold algorithm during pattern recognition to dynamically adjust the abnormality standard to adapt to the data characteristics under different working conditions; The construction module uses a data-driven approach based on the fused fluid data and combines the principles of fluid dynamics to build a dynamic correction model to accurately correct the flow of the ultrasonic water meter; The adaptive correction module uses a reinforcement learning algorithm to learn the optimal threshold adjustment strategy, optimize the threshold, and achieve adaptive dynamic correction.
Citation Information
Patent Citations
Detection method for metering characteristics of mechanical water meter
CN109990873A
Ultrasonic water meter flow data calibration method based on deep learning
CN114166318A
Metering method suitable for ultrasonic water meter
CN116147724A
Physical model calibration method and system based on deep reinforcement learning
CN116187189A
Ultrasonic water meter flow data fusion method and device based on BP neural network
CN116304968A
