Ultrasonic water meter flow automatic calibration method and device based on neural network
By using a neural network-based automatic calibration method to generate calibration points using water meter structural parameters and test data, the calibration deviation problem caused by individual differences in ultrasonic water meters is solved, achieving efficient and accurate water meter calibration and improving metering reliability and consistency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NINGBO WATER METER (GRP) CO LTD
- Filing Date
- 2026-01-08
- Publication Date
- 2026-06-02
AI Technical Summary
Existing ultrasonic water meter calibration technology relies on empirical flow point data, which cannot adapt to individual differences, leading to calibration deviations, low efficiency, and easy introduction of human error.
An automatic calibration method based on neural networks is adopted. By acquiring water meter structural parameters and test flow point data, a pre-trained neural network is used to generate suitable calibration points, and the calibration accuracy is improved through an iterative optimization process. Convolutional layers, recurrent neural networks and attention layers are combined to improve feature extraction and calibration accuracy.
It achieves accurate calibration that adapts to individual differences, improves water meter calibration efficiency and metering accuracy, and ensures the reliability and consistency of ultrasonic water meter measurement.
Smart Images

Figure CN122130188A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of ultrasonic water meter measurement technology, and in particular to an automatic flow calibration method and device for ultrasonic water meters based on neural networks. Background Technology
[0002] Current ultrasonic water meter calibration technology mainly relies on empirical flow point data, forming a calibration benchmark by statistically analyzing the test results of a single or small number of samples. However, uncontrollable factors such as differences in raw materials and process fluctuations lead to individual variations in the flow field characteristics of water meters of the same model, making it difficult for empirical data to accurately adapt to all water meters, resulting in calibration deviations. Specifically, this manifests as: 1) the flow point data acquisition method is singular and cannot reflect individual flow field characteristics; 2) calibration points are fixed, lacking dynamic adaptability; 3) the calibration process requires manual intervention, which is inefficient and prone to introducing human error. There is an urgent need for a technical solution that can adapt to individual differences and generate accurate calibration points using a small amount of test data. Summary of the Invention
[0003] In view of this, the present invention provides an automatic flow calibration method for ultrasonic water meters based on neural networks. One or more embodiments of this specification also relate to an automatic flow calibration device for ultrasonic water meters based on neural networks, a computing device, a computer-readable storage medium, and a computer program, to address the technical deficiencies existing in the prior art.
[0004] According to a first aspect of the present invention, an automatic calibration method for the flow rate of an ultrasonic water meter based on a neural network is provided, comprising: Obtain the structural parameters of the target water meter to be calibrated, and at least one test flow point data obtained by conducting a flow test on the target water meter. The structural parameters include the diameter, pipe length and material information of the target water meter, and the test flow point data includes the flow point value, the first relative error corresponding to the flow point value and the temperature information during the test. The structural parameters and test flow point data are input into a pre-trained neural network model to generate predictive calibration points adapted to the target water meter. The target water meter is calibrated using a predicted calibration point, and the second relative error of the calibrated target water meter at at least one verification flow point is obtained. The comprehensive calibration error value is calculated based on the second relative error and the flow value of the verification flow point, and the comprehensive calibration error value is compared with the preset error threshold to determine whether the preset accuracy condition is met. If the accuracy requirements are met, the predicted calibration point is determined as the optimal calibration point, and the target water meter is calibrated based on the predicted calibration point.
[0005] In some embodiments, the above method further includes: If the accuracy requirement is not met, the iterative optimization process begins, which includes: The structural parameters of the target water meter, the test flow point data, and the second relative error are combined into a training sample. Based on this training sample, the parameters of the neural network model are updated once to obtain an online optimization model. New predicted calibration points are regenerated using an online optimization model, and the steps of calibration, obtaining the second relative error, and judgment are repeated.
[0006] In some implementations, the training steps of the neural network model include: Obtain a training dataset containing multiple sets of sample data, where each set of sample data includes the structural parameters of the sample water meter, the historical flow point data of the sample water meter, and the historical relative error data corresponding to the historical flow point data. The initial neural network is trained using the training dataset, and the parameters of the initial neural network are optimized using a loss function that includes a prediction accuracy term and a feature distribution constraint term, so as to obtain a trained neural network model.
[0007] In some implementations, the initial neural network includes a convolutional layer, a pooling layer, a recurrent neural network layer, an attention layer, and a fully connected layer connected in sequence. The convolutional layer is used to extract local features from the input data, the recurrent neural network layer is used to capture sequence dependencies in the input data, the attention layer is used to dynamically weight the features, and the fully connected layer is used to output prediction calibration points. The recurrent neural network layer is a bidirectional long short-term memory network layer.
[0008] In some implementations, before calibrating the target water meter based on the predicted calibration point, the method further includes adding the structural parameters of the target water meter, test flow point data, and the final output optimal calibration point as new sample data to the training dataset for use in updating and training the neural network model.
[0009] In some implementations, a comprehensive calibration error value is calculated based on the second relative error and the flow rate value at the verification flow point, including: For each verification flow point, the absolute difference between the second relative error measured after calibration and the preset target relative error is calculated. The absolute difference is then divided by an error sensitivity coefficient corresponding to this verification flow point to obtain the normalized deviation value of the verification flow point. The normalized deviation values of all verification flow points are squared, the squared results are summed to obtain the first sum, the first sum is divided by the total number of verification flow points to obtain the first mean, and the first mean is squared to obtain the first error component. Determine the total number of parameter types included in the structural parameters; for each parameter type, calculate the estimated value of the structural parameter derived from the predicted calibration point and the preset physical relationship model, as well as the measured value of the structural parameter directly obtained from the structural parameters; calculate the difference between the estimated value and the measured value of the structural parameter, multiply this difference by a structural weight coefficient corresponding to the parameter type, and square the product result. The results of squaring all parameter types are summed to obtain the second sum, and the square root of the second sum is taken to obtain the second error component. The second error component is multiplied by a preset fusion weighting coefficient to obtain the weighted second error component; The first error component is added to the weighted second error component to obtain the comprehensive calibration error value.
[0010] In some implementations, the error sensitivity coefficient is obtained through the following steps: Obtain the flow value of the current verification flow point from the verification flow point data, and obtain its nominal flow value from the specification parameters of the target water meter; calculate the difference between the current flow value and the nominal flow value, perform a square operation on the difference, multiply the square operation result by a first adjustment coefficient, take its opposite number, and then perform an exponential operation with the natural constant as the base to obtain the first component; From the validation flow point data sequence, calculate the standard deviation and mean of all flow values; calculate the ratio of the standard deviation to the mean, add one to the ratio and take its natural logarithm, multiply the natural logarithm result by a second adjustment coefficient to obtain the second component; Adding the first component to the second component yields the error sensitivity coefficient corresponding to the current verification flow point.
[0011] According to a second aspect of the present invention, an automatic flow calibration device for ultrasonic water meters based on a neural network is provided, comprising: The acquisition module is configured to acquire the structural parameters of the target water meter to be calibrated, and at least one test flow point data obtained by conducting a flow test on the target water meter. The structural parameters include the diameter, pipe length and material information of the target water meter, and the test flow point data includes the flow point value, the first relative error corresponding to the flow point value and the temperature information during the test. The generation module is configured to input structural parameters and test flow point data into a pre-trained neural network model to generate predictive calibration points adapted to the target water meter. The calibration module is configured to calibrate the target water meter using a predicted calibration point and obtain the second relative error of the calibrated target water meter at at least one verification flow point. The judgment module is configured to calculate the comprehensive calibration error value based on the second relative error and the flow value of the verification flow point, and to determine whether the preset accuracy condition is met by comparing the comprehensive calibration error value with the preset error threshold. The first determining module is configured to determine the predicted calibration point as the optimal calibration point if the accuracy condition is met, and to calibrate the target water meter according to the predicted calibration point.
[0012] In some embodiments, the above-described apparatus further includes: The second determining module is configured to enter an iterative optimization process if the accuracy condition is not met. The iterative optimization process includes: The structural parameters of the target water meter, the test flow point data, and the second relative error are combined into a training sample. Based on this training sample, the parameters of the neural network model are updated once to obtain an online optimization model. The online optimization model is used to regenerate new prediction calibration points, and the steps of calibration, obtaining the second relative error, and judgment are repeated.
[0013] In some implementations, the training steps of the neural network model include: Obtain a training dataset containing multiple sets of sample data, where each set of sample data includes the structural parameters of the sample water meter, the historical flow point data of the sample water meter, and the historical relative error data corresponding to the historical flow point data. The initial neural network is trained using the training dataset, and the parameters of the initial neural network are optimized using a loss function that includes a prediction accuracy term and a feature distribution constraint term, so as to obtain a trained neural network model.
[0014] In some implementations, the initial neural network includes a convolutional layer, a pooling layer, a recurrent neural network layer, an attention layer, and a fully connected layer connected in sequence. The convolutional layer is used to extract local features from the input data, the recurrent neural network layer is used to capture sequence dependencies in the input data, the attention layer is used to dynamically weight the features, and the fully connected layer is used to output prediction calibration points. The recurrent neural network layer is a bidirectional long short-term memory network layer.
[0015] In some implementations, before calibrating the target water meter based on the predicted calibration point, the method further includes adding the structural parameters of the target water meter, test flow point data, and the final output optimal calibration point as new sample data to the training dataset for use in updating and training the neural network model.
[0016] In some implementations, a comprehensive calibration error value is calculated based on the second relative error and the flow rate value at the verification flow point, including: For each verification flow point, the absolute difference between the second relative error measured after calibration and the preset target relative error is calculated. The absolute difference is then divided by an error sensitivity coefficient corresponding to this verification flow point to obtain the normalized deviation value of the verification flow point. The normalized deviation values of all verification flow points are squared, the squared results are summed to obtain the first sum, the first sum is divided by the total number of verification flow points to obtain the first mean, and the first mean is squared to obtain the first error component. Determine the total number of parameter types included in the structural parameters; for each parameter type, calculate the estimated value of the structural parameter derived from the predicted calibration point and the preset physical relationship model, as well as the measured value of the structural parameter directly obtained from the structural parameters; calculate the difference between the estimated value and the measured value of the structural parameter, multiply this difference by a structural weight coefficient corresponding to the parameter type, and square the product result. The results of squaring all parameter types are summed to obtain the second sum, and the square root of the second sum is taken to obtain the second error component. The second error component is multiplied by a preset fusion weighting coefficient to obtain the weighted second error component; The first error component is added to the weighted second error component to obtain the comprehensive calibration error value.
[0017] In some implementations, the error sensitivity coefficient is obtained through the following steps: Obtain the flow value of the current verification flow point from the verification flow point data, and obtain its nominal flow value from the specification parameters of the target water meter; calculate the difference between the current flow value and the nominal flow value, perform a square operation on the difference, multiply the square operation result by a first adjustment coefficient, take its opposite number, and then perform an exponential operation with the natural constant as the base to obtain the first component; From the validation flow point data sequence, calculate the standard deviation and mean of all flow values; calculate the ratio of the standard deviation to the mean, add one to the ratio and take its natural logarithm, multiply the natural logarithm result by a second adjustment coefficient to obtain the second component; Adding the first component to the second component yields the error sensitivity coefficient corresponding to the current verification flow point.
[0018] According to a third aspect of the present invention, a computing device is provided, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, they implement the steps of the above-described automatic flow calibration method for ultrasonic water meters based on neural networks.
[0019] According to a fourth aspect of the present invention, a computer-readable storage medium is provided that stores computer-executable instructions, which, when executed by a processor, implement the steps of the above-described neural network-based automatic flow calibration method for ultrasonic water meters.
[0020] According to a fifth aspect of the present invention, a computer program is provided, wherein when the computer program is executed in a computer, the computer is instructed to perform the steps of the above-described neural network-based automatic flow calibration method for ultrasonic water meters.
[0021] At least one embodiment of this invention combines water meter structural parameters and a small amount of test flow data to generate calibration points suitable for individual meters using a neural network model, effectively solving the problem of insufficient adaptability caused by individual differences in traditional calibration methods; it does not rely on a large amount of empirical data and manual intervention, greatly improving the efficiency of water meter calibration; through intelligent and automated calibration logic, and with the calibration process revolving around accuracy condition judgment, it ensures that the metering accuracy of the calibrated water meter meets the standards, enhancing the reliability and consistency of ultrasonic water meter measurement. Attached Figure Description
[0022] Figure 1 This is a flowchart of an automatic flow calibration method for ultrasonic water meters based on neural networks provided by the present invention; Figure 2 This is a simplified structural diagram of an ultrasonic water meter flow automatic calibration device based on a neural network provided by the present invention. Figure 3 This is a structural block diagram of a computing device provided by the present invention. Detailed Implementation
[0023] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0024] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the one or more embodiments of this specification. The singular forms “a” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items. The modifications “a” and “a plurality” as used in this disclosure are illustrative and not restrictive, and those skilled in the art will understand that they should be understood as “one or more” unless the context clearly indicates otherwise.
[0025] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0026] See Figure 1 , Figure 1 The flowchart illustrates an automatic flow calibration method for ultrasonic water meters based on neural networks, according to some embodiments of this specification, specifically including the following steps: Step 101: Obtain the structural parameters of the target water meter to be calibrated, and at least one test flow point data obtained by conducting a flow test on the target water meter. The structural parameters include the diameter, pipe length and material information of the target water meter, and the test flow point data includes the flow point value, the first relative error corresponding to the flow point value and the temperature information during the test.
[0027] Step 102: Input the structural parameters and test flow point data into the pre-trained neural network model to generate a prediction calibration point adapted to the target water meter.
[0028] Step 103: Calibrate the target water meter using the predicted calibration point and obtain the second relative error of the calibrated target water meter at at least one verification flow point.
[0029] Step 104: Calculate the comprehensive calibration error value based on the second relative error and the flow rate value of the verification flow point, and determine whether the preset accuracy condition is met by comparing the comprehensive calibration error value with the preset error threshold.
[0030] Step 105: If the accuracy condition is met, the predicted calibration point is determined as the optimal calibration point, and the target water meter is calibrated according to the predicted calibration point.
[0031] Structural parameters refer to the set of key information characterizing the physical structure of the target water meter. Diameter refers to the inner diameter of the water meter pipe (e.g., common series like DN15 and DN20), pipe length is the length of the water flow channel inside the meter, and material refers to the type of material used to manufacture the water meter pipe and core components (e.g., copper, stainless steel, plastic). Test flow point data is correlated data obtained through actual flow tests. The flow point value is the specific water flow rate set during the test. The first relative error is the deviation ratio between the measured value and the standard value at that flow point. Temperature information is the actual temperature data of the water flow during the test, used to reflect the environmental impact on metering. The neural network model is an intelligent computational model that, after training, can generate calibration points based on input data. It adopts a convolutional-recurrent hybrid architecture and has the ability to extract data features and capture temporal relationships. The predicted calibration point is a dedicated calibration reference point output by the model based on the individual characteristics of the target water meter, used to correct metering deviations. The verification flow point is a specific flow value used to verify the calibration effect. The second relative error is the deviation ratio between the measured value and the standard value at the verification flow point after calibration. The comprehensive calibration error value is a quantitative indicator that comprehensively considers and verifies the deviation of the flow point and the matching degree of structural parameters. The preset error threshold is a set standard for judging whether the calibration meets the standard (such as the 2% error threshold commonly used in industry).
[0032] The invention is further illustrated by a detailed embodiment below: In the production and calibration of ultrasonic water meters, flow rate calibration is required for a batch of target water meters of different specifications. First, the structural parameters of each target water meter are collected using a water meter testing platform: diameter data (e.g., DN25), pipe length data (e.g., 120mm) are obtained using specialized measuring tools, and material information (e.g., stainless steel) is recorded. Then, the flow rate test process is initiated, allowing the target water meters to operate at a set test flow rate (e.g., selecting three different flow rate levels at test flow rate points). The flow rate value, the first relative error (i.e., the deviation ratio between the water meter measurement value and the standard flow meter measurement value at that flow rate), and the real-time water temperature during the test (e.g., 25℃) are recorded for each flow rate point. The collected structural parameters and test flow rate data are then uniformly organized and input into a pre-trained neural network model. This model has been trained and matured using a large amount of sample data from water meters of different specifications, enabling it to quickly process input information: First, it extracts the physical features from the structural parameters, then combines the flow-error correlation law from the test flow point data, and after internal multi-layer calculations, generates predictive calibration points adapted to the target water meter (including the number of calibration points and the specific flow value of each calibration point). Next, the target water meter is calibrated according to the predictive calibration points, adjusting the internal metering parameters. After calibration, at least one verification flow point (which may be different from the test flow point or may include some test flow points) is selected for retesting, and the measured values of the target water meter at these verification flow points are recorded. The second relative error is calculated by comparing the measured values with those of a standard flow meter. Based on the second relative error and the flow values of the verification flow points, a comprehensive calibration error value is derived according to a preset calculation logic, and this value is compared with a preset error threshold (e.g., 2%). If the comprehensive calibration error value is less than or equal to the preset error threshold, the preset accuracy condition is met, and the previously generated predictive calibration point is determined as the optimal calibration point. Subsequently, the target water meter can be finally calibrated according to this optimal calibration point to ensure that the metering accuracy meets the requirements.
[0033] The beneficial effects of this embodiment include at least the following: by combining water meter structural parameters and a small amount of test flow data, a neural network model is used to generate calibration points suitable for each individual, effectively solving the problem of insufficient adaptability caused by individual differences in traditional calibration methods; it does not rely on a large amount of empirical data and manual intervention, greatly improving the efficiency of water meter calibration; through intelligent and automated calibration logic, and the calibration process revolving around accuracy condition judgment, it ensures that the metering accuracy of the calibrated water meter meets the standards, enhancing the reliability and consistency of ultrasonic water meter measurement.
[0034] In some embodiments, if the accuracy condition is not met, an iterative optimization process is initiated. The iterative optimization process includes: combining the structural parameters of the target water meter, the test flow point data, and the second relative error into a training sample; performing a gradient update on the parameters of the neural network model based on the training sample to obtain an online optimization model; regenerating a new prediction calibration point using the online optimization model; and repeating the steps of calibration, obtaining the second relative error, and judgment.
[0035] Iterative optimization refers to a cyclical optimization process where, when the initial calibration fails to meet accuracy requirements, model parameters are continuously adjusted, calibration points are regenerated, and calibration is repeated until the accuracy conditions are met. Gradient update is a method for optimizing model parameters. By calculating the error gradient corresponding to the training samples, the weights and biases of each layer in the neural network model are fine-tuned, enabling the model to better adapt to the data characteristics of the current target water meter. The online optimization model is an optimized neural network model obtained after one gradient update, which has better adaptability to the individual characteristics of the current target water meter compared to the original model. The new predicted calibration point is a calibration point generated by the online optimization model based on the updated parameters, which is more closely aligned with the actual situation of the target water meter.
[0036] The following detailed embodiment further illustrates the present invention: Following the aforementioned calibration steps, if the calculated comprehensive calibration error value of the target water meter after its initial calibration exceeds a preset error threshold (e.g., 2%), it is determined that the accuracy condition is not met, and the iterative optimization process begins. First, the structural parameters of the target water meter (diameter, pipe length, material), the initially collected test flow point data (flow point value, first relative error, temperature information), and the second relative error obtained after the initial calibration are combined into a complete training sample. Using this training sample, a gradient update is performed on the parameters of the original neural network model using mini-batch gradient descent-related optimization logic: based on the error feedback corresponding to the sample data, the weight coefficients and bias parameters of each layer in the model, such as the convolutional layer, LSTM layer, and fully connected layer, are adjusted to enable the model to more accurately capture the flow field characteristics and metering deviation patterns of the target water meter, thereby obtaining an online optimization model. Subsequently, the structural parameters of the target water meter and the test flow point data are input again into the online optimization model, and the model recalculates based on the updated parameters to generate new predicted calibration points. The target water meter is recalibrated according to the new predicted calibration point, and then the verification process is repeated: test at the verification flow point, obtain the new second relative error, calculate the comprehensive calibration error value and compare it with the preset error threshold. If the accuracy condition is still not met, the new second relative error is added to the training samples, the model parameters are updated again, the updated predicted calibration point is generated and calibrated, until the comprehensive calibration error value meets the preset accuracy condition.
[0037] The beneficial effects of this embodiment include at least the following: through the iterative optimization mechanism, the parameters of the neural network model can be continuously corrected, so that the generated calibration points are closer to the actual characteristics of the target water meter, effectively making up for the deviation that may exist in the first calibration; without the need for manual resetting of calibration points, the calibration process is automated and closed-loop optimized, further improving the calibration accuracy and ensuring that even water meters with large individual differences can reach the preset measurement standards.
[0038] In some embodiments, a training dataset containing multiple sets of sample data is obtained, wherein each set of sample data includes the structural parameters of the sample water meter, the historical flow point data of the sample water meter, and the historical relative error data corresponding to the historical flow point data; the initial neural network is trained using the training dataset, and the parameters of the initial neural network are optimized using a loss function that includes a prediction accuracy term and a feature distribution constraint term, so as to obtain a trained neural network model.
[0039] The training dataset is the foundational data set used to train the neural network model. It consists of relevant data from multiple sets of different sample water meters, providing ample sample support for model learning. The sample water meters are various ultrasonic water meters used to collect training data, covering different diameters, pipe lengths, materials, and other specifications to ensure the trained model has broad adaptability. Historical flow point data consists of flow point data recorded by the sample water meters in past tests, and historical relative error data is the proportion of measurement deviation of the sample water meters at corresponding historical flow points. The initial neural network is the untrained, raw network structure with a basic hierarchical architecture but unoptimized parameters. The loss function is used to measure the deviation between the model's prediction and the actual result. The prediction accuracy term ensures the accuracy of the model's prediction calibration points, while the feature distribution constraint term ensures the model can adapt to the differences in feature distribution among different sample water meters, improving the model's robustness.
[0040] The invention is further illustrated by a detailed embodiment below: In constructing the neural network model, the training dataset is first collected and organized. Data from various specifications of sample water meters are collected extensively through a water meter testing platform, covering multiple specifications from DN15 to DN50, different pipe lengths greater than 0 mm, and materials including common types such as copper, stainless steel, and plastic. Each set of sample data includes the structural parameters of the sample water meter (diameter, pipe length, material), historical flow point data (flow point values at multiple different flow levels), and corresponding historical relative error data (the deviation ratio between the sample water meter's measured value and the standard value at each historical flow point). Finally, a training dataset containing 2000 sets of sample data is constructed. The training dataset is preprocessed by normalizing all data to eliminate the influence of dimensional differences between different parameters. It is then divided into a training set, a validation set, and a test set in an 8:1:1 ratio. An initial neural network is built (its specific structure can be referred to the aforementioned network architecture), and the initial neural network is trained using the training set. During training, a loss function comprising a prediction accuracy term and a feature distribution constraint term is employed. The prediction accuracy term is calculated based on the deviation between the model's predicted calibration points and the actual calibration points of the sample water meters, while the feature distribution constraint term is calculated based on the flow field characteristic entropy of the sample data. A weighted combination is used to comprehensively consider the model's prediction accuracy and adaptability to different sample feature distributions. During training, the parameters of the initial neural network are continuously adjusted, and the training effect is monitored using a validation set. Training is stopped when the loss value on the validation set fails to improve consecutively. The final trained neural network model, with its mean absolute error on the test set, meets the accuracy requirements for industrial calibration.
[0041] The beneficial effects of this embodiment include at least the following: by constructing a training dataset covering water meters of various specifications, the model has a wide range of adaptability; by using a loss function that includes a prediction accuracy term and a feature distribution constraint term for parameter optimization, the trained model has both high prediction accuracy and can adapt to the differences in feature distribution of different water meters, thus improving the robustness of the model; the training process is highly automated, requiring no manual intervention in parameter adjustment, which lays the foundation for the rapid and accurate calibration of the target water meters in the future.
[0042] In some embodiments, the initial neural network includes a convolutional layer, a pooling layer, a recurrent neural network layer, an attention layer, and a fully connected layer connected in sequence. The convolutional layer is used to extract local features from the input data, the recurrent neural network layer is used to capture sequence dependencies in the input data, the attention layer is used to dynamically weight the features, and the fully connected layer is used to output prediction calibration points. The recurrent neural network layer is a bidirectional long short-term memory network layer.
[0043] The convolutional layer is the first feature extraction unit in the initial neural network. It performs sliding computation on the input data by setting multiple fixed-size filters, extracting local features (such as the local correlation between structural parameters and flow errors). The pooling layer is the feature processing unit following the convolutional layer. Its main function is to reduce the dimensionality of the feature maps extracted by the convolutional layer, reducing the computational cost of the model while retaining key feature information and avoiding overfitting. The recurrent neural network layer (here, a bidirectional long short-term memory network layer) is the core unit for processing sequential data. The bidirectional structure can simultaneously capture the forward and backward dependencies of the input data, and the long short-term memory characteristic allows it to effectively remember long-term correlation information in the sequential data (such as the temporal variation pattern of flow point data). The attention layer is the unit that assigns weights to the extracted features. It can automatically identify features that are more important to the prediction result and assign them higher weights, improving the model's efficiency in utilizing key information. The fully connected layer is the output layer of the neural network, responsible for integrating the feature information extracted by the previous layers and mapping it to the final prediction result (i.e., prediction calibration points).
[0044] The invention is further illustrated by a detailed embodiment below: When building the initial neural network, the layers are arranged in the order of sequential connection. First, the input layer receives input data containing six features (covering key features of structural parameters and flow-error correlation data), which is then passed to the convolutional layer. The convolutional layer is configured with 32 3×3 filters to extract local features from the input data: through sliding operations of the filters on the input data, it captures the local correlation features between structural parameters (such as aperture and material) and flow error, generating 32 sets of feature maps, providing a foundation for subsequent feature processing. The feature maps output by the convolutional layer are passed to the pooling layer and processed using max pooling: the maximum value within a local region of the feature map is selected as the representative feature of that region, achieving feature dimensionality reduction, reducing the computational load and number of parameters in the model, while retaining key features crucial to the prediction results and avoiding overfitting. The feature data processed by the pooling layer is input into a bidirectional long short-term memory (LSTM) network layer, which is configured with 128 hidden units. This layer captures the temporal progression of the input data through forward computation and the inverse dependencies through backward computation, comprehensively extracting long-term correlation patterns from sequence information such as flow point data, thus solving the sequence dependency problem that traditional networks struggle to handle. The feature data output from the LSTM layer enters the attention layer. This layer automatically evaluates the importance of each feature through specific computational logic: assigning higher weights to key features highly correlated with calibration point prediction (such as flow error features corresponding to specific materials) and lower weights to secondary features with less influence, enabling the model to focus on core information and improve prediction accuracy. Finally, the weighted feature data output from the attention layer is transmitted to a fully connected layer. The fully connected layer, through the interconnected computation of multiple neurons, maps the integrated feature information into specific prediction results, outputting the predicted calibration points for the adapted sample water meters (including the number of calibration points and their specific values), completing the feature processing and prediction process of the entire initial neural network.
[0045] The beneficial effects of this embodiment include at least the following: through the synergistic effect of convolutional layers, bidirectional long short-term memory network layers, and attention layers, comprehensive extraction of local features, sequence dependency features, and key features of the input data is achieved. Compared with traditional network structures, feature capture is more comprehensive and accurate. The dimensionality reduction processing of the pooling layer optimizes the computational efficiency of the model and avoids overfitting. The reasonable configuration of each layer enables the initial neural network to have strong learning and prediction capabilities, providing solid structural support for the accurate generation of calibration points adapted to different water meters after the subsequent model training is completed.
[0046] In some embodiments, before calibrating the target water meter according to the predicted calibration point, the method further includes: adding the structural parameters of the target water meter, test flow point data, and the final output optimal calibration point as new sample data to the training dataset for use in updating and training the neural network model.
[0047] The new sample data is a dataset containing complete calibration information for the target water meter, integrating structural parameters, test flow point data, and optimal calibration points. It reflects the correspondence between the individual characteristics of the target water meter and the optimal calibration scheme. Update training refers to retraining the neural network model on the basis of the original training dataset after adding new sample data, enabling the model to learn the characteristic patterns of the new samples and continuously optimize its parameters.
[0048] The following detailed embodiment further illustrates the invention: During the calibration of the target water meter, after determining the optimal calibration point through the aforementioned steps, a data supplementation process is initiated before the final calibration of the target water meter according to this optimal calibration point. Complete relevant data of the target water meter is collected, including initially acquired structural parameters (diameter, pipe length, material), test flow point data (flow point value, first relative error, temperature information), and the finally determined optimal calibration point (number of calibration points and specific values for each point). This data is then organized according to the training dataset format requirements to form a new set of sample data. This new sample data is added to the original training dataset to enrich the sample coverage of the training dataset, especially increasing the sample data for this type of target water meter (specific combination of structural parameters). Subsequently, when updating and training the neural network model, the new training dataset (containing both original and new samples) will be used for model training. Based on learning the patterns of the original samples, the model will further learn the feature associations contained in the new samples (i.e., the correspondence between this type of structural parameter water meter and the optimal calibration point), thereby achieving continuous optimization of the model parameters.
[0049] The beneficial effects of this embodiment include at least the following: by adding the complete calibration-related data of the target water meter as new samples to the training dataset, the training samples of the model are continuously enriched, enabling the training dataset to cover water meters of more specifications and more individual characteristics; after the model is updated and trained, it can learn the feature patterns of the new samples, and the prediction of calibration points of subsequent similar water meters will be more accurate, realizing the self-iterative optimization of the model and improving the long-term adaptability and generalization performance of the model.
[0050] In some embodiments, calculating the comprehensive calibration error value based on the second relative error and the flow rate value of the verification flow point includes: for each verification flow point, calculating the absolute difference between the second relative error measured after calibration and the preset target relative error; quotienting the absolute difference with an error sensitivity coefficient corresponding to the verification flow point to obtain the normalized deviation value of the verification flow point; squaring the normalized deviation values of all verification flow points; summing the squaring results to obtain a first sum; dividing the first sum by the total number of verification flow points to obtain a first mean; and taking the square root of the first mean to obtain a first error component; and determining the total number of parameter types included in the structural parameters. For each parameter type, the estimated structural parameter value derived from the predicted calibration point and the preset physical relationship model, as well as the measured structural parameter value directly obtained from the structural parameters, are calculated. The difference between the estimated and measured structural parameter values is calculated, and this difference is multiplied by a structural weight coefficient corresponding to that parameter type. The product is then squared. The squared results for all parameter types are summed to obtain a second sum. The square root of the second sum is then taken to obtain a second error component. The second error component is multiplied by a preset fusion weight coefficient to obtain a weighted second error component. The first error component and the weighted second error component are then added to obtain the comprehensive calibration error value.
[0051] The target relative error is a preset, expected relative error standard that the water meter will achieve at the verification flow points, used to measure the degree of compliance of the second relative error. The error sensitivity coefficient reflects the degree of influence of different verification flow points on the error; the coefficient value varies depending on the characteristics of the flow points. The normalized deviation value is the result of standardizing the absolute difference between the second relative error and the target relative error, eliminating the influence of sensitivity differences at different flow points on the deviation assessment. The first error component is an error index calculated based on the normalized deviation values of all verification flow points, reflecting the overall deviation of the calibrated water meter in flow measurement accuracy. The physical relationship model is a model based on fluid mechanics principles, relating the calibration points to the water meter's structural parameters, used to derive the estimated structural parameters. The estimated structural parameters are theoretical values calculated by back-calculating the predicted calibration points and the physical relationship model; the measured structural parameters are the actual values of the target water meter's structural parameters obtained through direct measurement. The structural weight coefficient is a weight value set according to the degree of influence of different structural parameters on water meter measurement; the greater the influence, the higher the weight coefficient. The second error component is an error index calculated based on the deviation between the estimated and measured values of structural parameters, reflecting the degree of fit between the predicted calibration point and the target water meter's structural parameters. The fusion weighting coefficient is a parameter used to adjust the proportion of the second error component in the overall calibration error value, and can be set according to actual calibration needs. The overall calibration error value is a comprehensive index that integrates flow measurement accuracy deviation and structural parameter fit deviation, used to comprehensively evaluate the calibration effect.
[0052] The following detailed embodiment further illustrates the present invention: When calculating the comprehensive calibration error value, calculations are first performed for each verification flow point: First, a preset target relative error (e.g., 0.5%) is defined. The absolute difference between the second relative error corresponding to the verification flow point and the target relative error is calculated. Then, the error sensitivity coefficient corresponding to the verification flow point is obtained (the method of obtaining this coefficient can refer to the aforementioned related steps). The absolute difference and the error sensitivity coefficient are then divided to obtain the normalized deviation value of the verification flow point, completing the deviation standardization process for a single verification flow point. The normalized deviation values of all verification flow points are collected. The square of each normalized deviation value is performed, and the results of all square operations are summed to obtain the first cumulative sum. The total number of verification flow points is counted. The first cumulative sum is divided by the total number to obtain the first mean. The square root of the first mean is then performed to obtain the first error component, which reflects the overall measurement accuracy deviation of the calibrated water meter at each verification flow point. Next, the second error component is calculated: First, the total number of parameter types included in the structural parameters is determined (here, diameter, pipe length, and material are three categories). For each type of structural parameter, an estimated value is derived by reverse engineering using a pre-defined physical relationship model (established based on the correlation between flow rate, structure, and error in fluid mechanics) and the predicted calibration point. Simultaneously, the measured value of this type of parameter is directly extracted from the collected structural parameters. The difference between the estimated and measured values of the structural parameter is calculated, multiplied by the corresponding structural weight coefficient (e.g., the weight coefficient for caliber is higher than that for material), and then the product is squared. The squared results of the three types of structural parameters are summed to obtain a second sum. The square root of this second sum is then taken to obtain the second error component, which reflects the degree of fit between the predicted calibration point and the actual structural parameters of the target water meter. Subsequently, a pre-defined fusion weight coefficient (set based on industrial calibration experience, such as 0.3) is obtained, and the second error component is multiplied by this fusion weight coefficient to obtain a weighted second error component, thereby adjusting the influence of structural adaptation deviation in the overall error. Finally, the first error component is added to the weighted second error component to obtain the comprehensive calibration error value. This value comprehensively covers the error situation in both flow measurement accuracy and structural adaptability, providing a reliable basis for subsequent accuracy judgment.
[0053] The beneficial effects of this embodiment include at least the following: the calculation of the comprehensive calibration error value not only considers the flow measurement deviation of the water meter after calibration, but also takes into account the adaptability of the predicted calibration point and the structural parameters of the water meter. Compared with a single error index, the evaluation is more comprehensive and scientific. Through normalization processing, weight allocation and other methods, the error calculation can be adapted to the characteristics of different verification flow points and structural parameters, which improves the accuracy of error assessment, provides reliable support for the judgment of accuracy conditions, and ensures that the calibrated water meter not only meets the flow measurement accuracy requirements, but also is highly adapted to its own structural characteristics.
[0054] In some embodiments, the error sensitivity coefficient is obtained through the following steps: obtaining the flow value of the current verification flow point from the verification flow point data, and obtaining its nominal flow value from the specification parameters of the target water meter; calculating the difference between the current flow value and the nominal flow value, squaring the difference, multiplying the squaring result by a first adjustment coefficient, taking the negative of the result, and then performing an exponential operation with the natural constant as the base to obtain the first component; calculating the standard deviation and mean of all flow values from the verification flow point data sequence; calculating the ratio of the standard deviation to the mean, adding one to the ratio, taking its natural logarithm, multiplying the natural logarithm result by a second adjustment coefficient to obtain the second component; and adding the first component and the second component to obtain the error sensitivity coefficient corresponding to the current verification flow point.
[0055] The nominal flow rate is the rated flow rate explicitly stated in the target water meter specifications; it is the standard flow rate parameter set during the water meter design. The first adjustment coefficient is a parameter used to adjust the influence of the difference between the current flow rate and the nominal flow rate on the first component, set according to the industrial calibration scenario. The first component is a quantitative indicator reflecting the impact of the deviation between the current verification flow rate point and the nominal flow rate on error sensitivity. The standard deviation is a statistical measure reflecting the dispersion of each flow rate value in the verification flow rate point data sequence, and the mean is the average flow rate value of the verification flow rate point data sequence. The second adjustment coefficient is a parameter used to adjust the influence of the dispersion of flow rates on the second component; it is used in conjunction with the first adjustment coefficient to jointly optimize the calculation of the error sensitivity coefficient. The second component is a quantitative indicator reflecting the impact of the dispersion of the verification flow rate point data sequence on error sensitivity.
[0056] The present invention will be further described below through a detailed embodiment: When obtaining the error sensitivity coefficient of a certain verification flow point, the specific flow value of the verification flow point (e.g., 10m³) is first extracted from the verification flow point data. 3 / h), and at the same time, consult the specification parameter table of the target water meter to obtain its nominal flow rate value (e.g., 15m³ / h). 3 / h). Calculate the difference between the current flow rate and the nominal flow rate (e.g., 10-15=-5m). 3The difference is squared ( / h). This squared result is then multiplied by a preset first adjustment coefficient (e.g., 0.01), and the product is inversely multiplied. Finally, an exponential operation with the natural constant as the base is performed. This series of operations yields the first component, which primarily reflects the impact of the current flow point's deviation from the nominal flow value on error sensitivity. Next, the verification flow point data sequence is processed: flow values from all verification flow points are collected, and the standard deviation (reflecting the dispersion between flow values) and mean (the average level of all flow values) are calculated. The ratio of the standard deviation to the mean is calculated; this ratio reflects the relative dispersion of the flow value sequence. This ratio is incremented by one, and its natural logarithm is taken. The resulting natural logarithm is then multiplied by a preset second adjustment coefficient (e.g., 0.5) to obtain the second component, which primarily reflects the impact of the verification flow point sequence's dispersion on error sensitivity. Finally, the calculated first component and the second component are added together, and the sum is the error sensitivity coefficient corresponding to the current verification flow point. This coefficient can accurately reflect the influence of the characteristics of the verification flow point on the error assessment, and provide a reasonable basis for the subsequent calculation of the normalized deviation value.
[0057] The beneficial effects of this embodiment include at least the following: the calculation of the error sensitivity coefficient comprehensively considers the deviation of a single verification flow point from the nominal flow value, as well as the dispersion of the entire verification flow point sequence, so that the coefficient can accurately reflect the actual impact of different verification flow points on error assessment; through the flexible configuration of the first adjustment coefficient and the second adjustment coefficient, it can be adapted to water meters of different specifications and different usage scenarios, improving the universality and adaptability of the coefficient; the normalized deviation value calculated based on the error sensitivity coefficient is more reasonable, providing strong support for the accurate calculation of subsequent comprehensive calibration error values.
[0058] Corresponding to the above method embodiments, this specification also provides an embodiment of an automatic flow calibration device for ultrasonic water meters based on neural networks. Figure 2 This specification illustrates a schematic diagram of the structure of an automatic flow calibration device for ultrasonic water meters based on a neural network, provided in some embodiments. For example... Figure 2 As shown, the device includes: The acquisition module is configured to acquire the structural parameters of the target water meter to be calibrated, and at least one test flow point data obtained by conducting a flow test on the target water meter. The structural parameters include the diameter, pipe length and material information of the target water meter, and the test flow point data includes the flow point value, the first relative error corresponding to the flow point value and the temperature information during the test. The generation module is configured to input structural parameters and test flow point data into a pre-trained neural network model to generate predictive calibration points adapted to the target water meter. The calibration module is configured to calibrate the target water meter using a predicted calibration point and obtain the second relative error of the calibrated target water meter at at least one verification flow point. The judgment module is configured to calculate the comprehensive calibration error value based on the second relative error and the flow value of the verification flow point, and to determine whether the preset accuracy condition is met by comparing the comprehensive calibration error value with the preset error threshold. The first determining module is configured to determine the predicted calibration point as the optimal calibration point if the accuracy condition is met, and to calibrate the target water meter according to the predicted calibration point.
[0059] In some embodiments, the above-described apparatus further includes: The second determining module is configured to enter an iterative optimization process if the accuracy condition is not met. The iterative optimization process includes: The structural parameters of the target water meter, the test flow point data, and the second relative error are combined into a training sample. Based on this training sample, the parameters of the neural network model are updated once to obtain an online optimization model. The online optimization model is used to regenerate new prediction calibration points, and the steps of calibration, obtaining the second relative error, and judgment are repeated.
[0060] In some implementations, the training steps of the neural network model include: Obtain a training dataset containing multiple sets of sample data, where each set of sample data includes the structural parameters of the sample water meter, the historical flow point data of the sample water meter, and the historical relative error data corresponding to the historical flow point data. The initial neural network is trained using the training dataset, and the parameters of the initial neural network are optimized using a loss function that includes a prediction accuracy term and a feature distribution constraint term, so as to obtain a trained neural network model.
[0061] In some implementations, the initial neural network includes a convolutional layer, a pooling layer, a recurrent neural network layer, an attention layer, and a fully connected layer connected in sequence. The convolutional layer is used to extract local features from the input data, the recurrent neural network layer is used to capture sequence dependencies in the input data, the attention layer is used to dynamically weight the features, and the fully connected layer is used to output prediction calibration points. The recurrent neural network layer is a bidirectional long short-term memory network layer.
[0062] In some implementations, before calibrating the target water meter based on the predicted calibration point, the method further includes adding the structural parameters of the target water meter, test flow point data, and the final output optimal calibration point as new sample data to the training dataset for use in updating and training the neural network model.
[0063] In some implementations, a comprehensive calibration error value is calculated based on the second relative error and the flow rate value at the verification flow point, including: For each verification flow point, the absolute difference between the second relative error measured after calibration and the preset target relative error is calculated. The absolute difference is then divided by an error sensitivity coefficient corresponding to this verification flow point to obtain the normalized deviation value of the verification flow point. The normalized deviation values of all verification flow points are squared, the squared results are summed to obtain the first sum, the first sum is divided by the total number of verification flow points to obtain the first mean, and the first mean is squared to obtain the first error component. Determine the total number of parameter types included in the structural parameters; for each parameter type, calculate the estimated value of the structural parameter derived from the predicted calibration point and the preset physical relationship model, as well as the measured value of the structural parameter directly obtained from the structural parameters; calculate the difference between the estimated value and the measured value of the structural parameter, multiply this difference by a structural weight coefficient corresponding to the parameter type, and square the product result. The results of squaring all parameter types are summed to obtain the second sum, and the square root of the second sum is taken to obtain the second error component. The second error component is multiplied by a preset fusion weighting coefficient to obtain the weighted second error component; The first error component is added to the weighted second error component to obtain the comprehensive calibration error value.
[0064] In some implementations, the error sensitivity coefficient is obtained through the following steps: Obtain the flow value of the current verification flow point from the verification flow point data, and obtain its nominal flow value from the specification parameters of the target water meter; calculate the difference between the current flow value and the nominal flow value, perform a square operation on the difference, multiply the square operation result by a first adjustment coefficient, take its opposite number, and then perform an exponential operation with the natural constant as the base to obtain the first component; From the validation flow point data sequence, calculate the standard deviation and mean of all flow values; calculate the ratio of the standard deviation to the mean, add one to the ratio and take its natural logarithm, multiply the natural logarithm result by a second adjustment coefficient to obtain the second component; Adding the first component to the second component yields the error sensitivity coefficient corresponding to the current verification flow point.
[0065] The above is a schematic scheme of an automatic flow calibration device for ultrasonic water meters based on neural networks according to this embodiment. It should be noted that the technical solution of this automatic flow calibration device for ultrasonic water meters based on neural networks belongs to the same concept as the technical solution of the aforementioned automatic flow calibration method for ultrasonic water meters based on neural networks. Details not described in detail in the technical solution of the automatic flow calibration device for ultrasonic water meters based on neural networks can be found in the description of the aforementioned automatic flow calibration method for ultrasonic water meters based on neural networks.
[0066] Figure 3 A structural block diagram of a computing device 300 according to some embodiments of this specification is shown. The components of the computing device 300 include, but are not limited to, a memory 301 and a processor 302. The processor 302 is connected to the memory 301 via a bus 303, and a database 305 is used to store data.
[0067] The computing device 300 also includes an access device 304 that enables the computing device 300 to communicate via one or more networks 306. Examples of such networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 304 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, or a Near Field Communication (NFC) interface.
[0068] In one embodiment of this specification, the aforementioned components of the computing device 300 and Figure 3 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 3The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0069] The computing device 300 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 300 can also be a mobile or stationary server.
[0070] The processor 302 executes the following computer-executable instructions, which, when executed by the processor, implement the steps of the aforementioned automatic flow calibration method for ultrasonic water meters based on neural networks. The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the aforementioned automatic flow calibration method for ultrasonic water meters based on neural networks belong to the same concept. Details not described in detail in the technical solution of the computing device can be found in the description of the technical solution of the aforementioned automatic flow calibration method for ultrasonic water meters based on neural networks.
[0071] An embodiment of this specification also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the above-described neural network-based ultrasonic water meter flow rate automatic calibration method.
[0072] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium belongs to the same concept as the technical solution of the aforementioned neural network-based automatic flow calibration method for ultrasonic water meters. Details not described in detail in the technical solution of the storage medium can be found in the description of the aforementioned neural network-based automatic flow calibration method for ultrasonic water meters.
[0073] An embodiment of this specification also provides a computer program, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the above-described automatic flow calibration method for ultrasonic water meters based on neural networks.
[0074] The above is an illustrative example of a computer program in this embodiment. It should be noted that the technical solution of this computer program belongs to the same concept as the aforementioned automatic calibration method for ultrasonic water meter flow rate based on neural networks. Details not described in detail in the computer program's technical solution can be found in the description of the aforementioned automatic calibration method for ultrasonic water meter flow rate based on neural networks.
[0075] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0076] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added to or subtracted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.
[0077] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0078] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0079] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this invention. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A method for automatic calibration of ultrasonic water meter flow rate based on neural network, characterized in that, include: Obtain the structural parameters of the target water meter to be calibrated, and at least one test flow point data obtained by conducting a flow test on the target water meter. The structural parameters include the diameter, pipe length and material information of the target water meter, and the test flow point data includes the flow point value, the first relative error corresponding to the flow point value and the temperature information during the test. The structural parameters and the test flow point data are input into a pre-trained neural network model to generate a predictive calibration point adapted to the target water meter. The target water meter is calibrated using the predicted calibration point, and the second relative error of the calibrated target water meter at at least one verification flow point is obtained. The comprehensive calibration error value is calculated based on the second relative error and the flow value of the verification flow point, and the comprehensive calibration error value is compared with the preset error threshold to determine whether the preset accuracy condition is met. If the accuracy condition is met, the predicted calibration point is determined as the optimal calibration point, and the target water meter is calibrated according to the predicted calibration point.
2. The method according to claim 1, characterized in that, Also includes: If the accuracy condition is not met, an iterative optimization process is initiated, which includes: The structural parameters of the target water meter, the test flow point data, and the second relative error are combined into a training sample. Based on this training sample, the parameters of the neural network model are updated once to obtain an online optimization model. The online optimization model is used to regenerate new predicted calibration points, and the steps of calibration, obtaining the second relative error, and judgment are repeated.
3. The method according to claim 1, characterized in that, The training steps of the neural network model include: Obtain a training dataset containing multiple sets of sample data, wherein each set of sample data includes the structural parameters of the sample water meter, the historical flow point data of the sample water meter, and the historical relative error data corresponding to the historical flow point data; The initial neural network is trained using the training dataset, and the parameters of the initial neural network are optimized using a loss function that includes a prediction accuracy term and a feature distribution constraint term, so as to obtain the trained neural network model.
4. The method according to claim 3, characterized in that, The initial neural network comprises a convolutional layer, a pooling layer, a recurrent neural network layer, an attention layer, and a fully connected layer connected in sequence. The convolutional layer is used to extract local features from the input data. The recurrent neural network layer is used to capture the sequence dependencies in the input data. The attention layer is used to dynamically weight the features. The fully connected layer is used to output the prediction calibration point. The recurrent neural network layer is a bidirectional long short-term memory network layer.
5. The method according to claim 4, characterized in that, Before calibrating the target water meter according to the predicted calibration point, the method further includes: adding the structural parameters of the target water meter, the test flow point data, and the final output optimal calibration point as new sample data to the training dataset for use in updating and training the neural network model.
6. The method according to claim 1, characterized in that, The calculation of the comprehensive calibration error value based on the second relative error and the flow rate value of the verification flow point includes: For each verification flow point, the absolute difference between the second relative error measured after calibration and the preset target relative error is calculated. The absolute difference is then divided by an error sensitivity coefficient corresponding to this verification flow point to obtain the normalized deviation value of the verification flow point. The normalized deviation values of all verification flow points are squared, the squared results are summed to obtain a first sum, the first sum is divided by the total number of verification flow points to obtain a first mean, and the first mean is squared to obtain a first error component. Determine the total number of parameter types included in the structural parameters; for each parameter type, calculate the estimated value of the structural parameter derived from the predicted calibration point and the preset physical relationship model, as well as the measured value of the structural parameter directly obtained from the structural parameters; calculate the difference between the estimated value of the structural parameter and the measured value of the structural parameter, multiply this difference by a structural weight coefficient corresponding to the parameter type, and square the product result; The square operation results of all parameter types are summed to obtain a second accumulated sum, and the square root operation of the second accumulated sum is performed to obtain a second error component; The second error component is multiplied by a preset fusion weighting coefficient to obtain a weighted second error component; The first error component is added to the weighted second error component to obtain the comprehensive calibration error value.
7. The method according to claim 6, characterized in that, The error sensitivity coefficient is obtained through the following steps: Obtain the flow value of the current verification flow point from the verification flow point data, and obtain its nominal flow value from the specification parameters of the target water meter; Calculate the difference between the current flow rate and the nominal flow rate, square the difference, multiply the result of the square by a first adjustment coefficient, take the opposite of the result, and then perform an exponential operation with the natural constant as the base to obtain the first component. From the verification flow point data sequence, calculate the standard deviation and mean of all flow values; calculate the ratio of the standard deviation to the mean, add one to the ratio and take its natural logarithm, multiply the natural logarithm result by a second adjustment coefficient to obtain the second component; Add the first component to the second component to obtain the error sensitivity coefficient corresponding to the current verification flow point.
8. An automatic flow calibration device for ultrasonic water meters based on neural networks, characterized in that, include: The acquisition module is configured to acquire the structural parameters of the target water meter to be calibrated, and at least one test flow point data obtained by conducting a flow test on the target water meter. The structural parameters include the diameter, pipe length and material information of the target water meter, and the test flow point data includes the flow point value, a first relative error corresponding to the flow point value and the temperature information during the test. The generation module is configured to input the structural parameters and the test flow point data into a pre-trained neural network model to generate a predictive calibration point adapted to the target water meter. The calibration module is configured to calibrate the target water meter using the predicted calibration point and obtain the second relative error of the calibrated target water meter at at least one verification flow point. The judgment module is configured to calculate a comprehensive calibration error value based on the second relative error and the flow value of the verification flow point, and to determine whether the preset accuracy condition is met by comparing the comprehensive calibration error value with a preset error threshold. The first determining module is configured to determine the predicted calibration point as the optimal calibration point if the accuracy condition is met, and to calibrate the target water meter according to the predicted calibration point.
9. A computing device, characterized in that, include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, they implement the steps of the automatic flow calibration method for ultrasonic water meters based on neural networks as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing computer-executable instructions, characterized in that, When the computer-executable instructions are executed by the processor, they implement the steps of the automatic flow calibration method for ultrasonic water meters based on neural networks as described in any one of claims 1 to 7.