Electromagnetic water meter error compensation method and system combining conductivity and temperature
By fitting the functional relationship between temperature and conductivity, and combining long short-term memory neural networks and transfer learning, a windowed dynamic compensation mechanism was constructed, which solved the metering error problem of electromagnetic water meters in complex environments and achieved high-precision flow measurement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG PRECISION CONTROL INSTR CO LTD
- Filing Date
- 2025-06-09
- Publication Date
- 2026-06-19
AI Technical Summary
In complex and variable field environments, electromagnetic water meters are prone to metering errors caused by factors such as conductivity and temperature changes, which are difficult to compensate for effectively, affecting the accuracy of flow measurement.
By fitting the functional relationship between temperature and conductivity, and combining long short-term memory neural networks and transfer learning, a windowed dynamic compensation mechanism is constructed to analyze the flow velocity change trend and generate a compensation vector to correct the error of the electromagnetic water meter.
It significantly improves the metering accuracy of electromagnetic water meters in complex environments, and has stronger robustness and generalization ability, meeting the high-precision requirements of smart water management and industrial metering.
Smart Images

Figure CN120609427B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electromagnetic water meter error compensation technology, specifically to an electromagnetic water meter error compensation method and system that combines conductivity and temperature. Background Technology
[0002] In urban and industrial water supply, the accuracy of flow measurement plays a crucial role in water resource management, billing, and water use analysis. Electromagnetic water meters, as a widely used flow measurement instrument, are gradually replacing traditional mechanical water meters and becoming the mainstream metering device in modern water supply systems due to their advantages such as having no moving mechanical parts, high measurement accuracy, and convenient maintenance.
[0003] However, electromagnetic water meters face a variety of complex factors affecting measurement accuracy in practical applications. First, the conductivity of the fluid is fundamental to the normal operation of an electromagnetic water meter. The conductivity of water varies significantly depending on the region, water quality, and even the season, leading to different measurement errors for the same instrument under different operating conditions. Second, the influence of water temperature on water conductivity and fluid dynamics characteristics cannot be ignored. Temperature changes not only alter the water's conductivity but may also affect sensor sensitivity and the stability of electronic components, causing drift or errors in flow measurement results.
[0004] Furthermore, water meters are subject to various disturbances during long-term operation, such as pipe aging, scaling, impurity deposition, and external electromagnetic interference. These problems further exacerbate the volatility and uncertainty of measurements. With the development of data acquisition and smart meter reading technologies, modern electromagnetic water meters can now record multi-dimensional data such as temperature, conductivity, and flow rate in real time, providing a rich data foundation for error compensation, anomaly diagnosis, and intelligent analysis.
[0005] Therefore, how to improve the metering accuracy of electromagnetic water meters by fully considering conductivity, temperature and other influencing factors in complex and ever-changing field environments has become an important technical challenge that continues to be of concern to the water industry, smart instrument manufacturers and the data processing field. Summary of the Invention
[0006] In view of the above-mentioned problems, the present invention is proposed.
[0007] To solve the above-mentioned technical problems, the present invention provides the following technical solution: an error compensation method for electromagnetic water meters combining conductivity and temperature, comprising:
[0008] Based on the relationship between temperature and conductivity in the test experiment, a functional relationship between temperature and conductivity was fitted to obtain 1; through experiments used for model training, each constant flow rate and conductivity was controlled, and using experimental data, a functional relationship was fitted with the measured value of flow rate and conductivity as independent variables, and the actual value of flow rate as dependent variable 2.
[0009] The temperature information and flow velocity of the water are obtained by using a temperature sensor and an electromagnetic water meter. Based on the function relationship 1 and function relationship 2, the predicted result of the actual flow velocity is obtained.
[0010] The predicted results are used to analyze the changing trend of the actual flow velocity, and trend vector 1 is constructed; the measured values are subtracted from the predicted values to analyze the changing trend of the differential flow velocity, and trend vector 2 is constructed.
[0011] In the time domain, the evolution process of generating trend vector 1 and trend vector 2;
[0012] Based on historical data, the evolution process is transferred and analyzed for features and compensated for features. The compensated vector is then combined with the trend vector 1 to obtain the compensated trend vector 1.
[0013] Using the compensated trend vector 1, the curve of the prediction result is corrected to obtain the electromagnetic water meter error compensation result.
[0014] As a preferred embodiment of the electromagnetic water meter error compensation method combining conductivity and temperature described in this invention, the test experiment is a temperature-conductivity coupling experiment. By controlling the fluid temperature, the conductivity at different temperatures is measured to obtain the functional fitting relationship between temperature and conductivity.
[0015] As a preferred embodiment of the electromagnetic water meter error compensation method combining conductivity and temperature described in this invention, the prediction result includes: obtaining water flow temperature information through a temperature sensor, converting the current temperature into water conductivity using function relationship 1; then inputting the water conductivity and the flow velocity measurement value obtained by the electromagnetic water meter into function relationship 2, and outputting the prediction result of the true flow velocity value at the current moment.
[0016] As a preferred embodiment of the electromagnetic water meter error compensation method combining conductivity and temperature described in this invention, wherein: the differential flow velocity is equal to the measured value minus the predicted result;
[0017] Within each time window, principal component analysis is performed on the time series data of actual flow velocity and differential flow velocity to reduce dimensionality, obtain the principal component sequence, and input the principal component sequence into a long short-term memory neural network for dynamic modeling, outputting trend vector 1 and trend vector 2 for the current window.
[0018] As a preferred embodiment of the electromagnetic water meter error compensation method combining conductivity and temperature described in this invention, the evolution process includes arranging the trend vector 1 and the trend vector 2 according to time sequence to obtain the vector sequence of the trend vector 1 and the trend vector 2.
[0019] As a preferred embodiment of the electromagnetic water meter error compensation method combining conductivity and temperature described in this invention, the transfer learning includes: adopting a dual-channel structure, with each channel utilizing a trained TCN; inputting the vector sequences of trend vector 1 and trend vector 2 into the corresponding channels respectively, and filtering out abnormal trend vectors in the sequences; marking the filtering results of abnormal trend vectors for each channel within a time window to obtain an abnormal marking window;
[0020] The anomaly marker windows of the two channels are merged, and the set of time windows where markers exist is output.
[0021] A recurrent network is used to compensate for the trend vector, generating a compensation vector.
[0022] Assuming that trend vector 1 and trend vector 2 within the same time window are related, it can be simplified as follows: if a positive compensation vector is superimposed on trend vector 1, then the superposition direction of the compensation vector on trend vector 2 is negative.
[0023] Simultaneously, compensation vectors are generated for all time windows marked as anomalous;
[0024] The compensation process is as follows:
[0025] Step 1: For the trend vector of each time window, generate a compensation vector with a step size in a random direction;
[0026] Step 2: The compensation vector is superimposed on trend vector 1 and trend vector 2 respectively, and then re-input into the original input channel for anomaly assessment;
[0027] Step 3: If the evaluation result is no anomaly, then determine the cumulative result of the compensation vector as the final compensation vector;
[0028] If the evaluation result is abnormal, but the abnormal evaluation parameter is increasing in the positive direction, the compensation vector is increased by one step size for the next round of compensation; if the evaluation result is abnormal, but the abnormal evaluation parameter is increasing in the negative direction, the compensation vector is reversed and the next round of compensation is carried out by one step size; until there are no abnormalities in the time window, the cumulative result of the compensation vector within the time window is used as the final compensation vector.
[0029] As a preferred embodiment of the electromagnetic water meter error compensation method combining conductivity and temperature described in this invention, the electromagnetic water meter error compensation result includes: within each time window, the trend vector 1 is superimposed using the final compensation vector, then decoded using an LSTM Decoder, and the output of the LSTM Decoder is subjected to inverse PCA transformation to restore the time-series data of the compensated flow velocity.
[0030] An electromagnetic water meter error compensation system combining conductivity and temperature, employing any of the methods described in this invention, wherein:
[0031] The test unit, based on the relationship between temperature and conductivity in the test experiment, fits a functional relationship between temperature and conductivity 1; through experiments used for model training, each constant flow rate and conductivity is controlled, and using experimental data, a functional relationship 2 is fitted with the measured value of flow rate and conductivity as independent variables, and the actual value of flow rate as dependent variable.
[0032] The fitting unit acquires the temperature information and flow velocity measurement values of the water flow through a temperature sensor and an electromagnetic water meter, and obtains the predicted result of the true flow velocity value based on the function relationship 1 and function relationship 2.
[0033] The calculation unit analyzes the changing trend of the actual flow velocity using the prediction results and constructs trend vector 1; it analyzes the changing trend of the differential flow velocity by subtracting the value of the prediction results from the measured value and constructs trend vector 2; and it generates the evolution process of trend vector 1 and trend vector 2 in the time domain.
[0034] The compensation unit performs feature analysis and feature compensation on the current evolution process based on transfer learning of historical data, and combines the feature-compensated compensation vector with the trend vector 1 to obtain the compensated trend vector 1.
[0035] The output unit uses the compensated trend vector 1 to correct the curve of the prediction result, thereby obtaining the electromagnetic water meter error compensation result.
[0036] A computer device includes: a memory and a processor; the memory stores a computer program, wherein: when the processor executes the computer program, it implements the steps of the method described in any one of the present invention.
[0037] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method described in any one of the present invention.
[0038] The beneficial effects of this invention are as follows: The electromagnetic water meter error compensation method combining conductivity and temperature provided by this invention constructs an intelligent error correction mechanism with windowed dynamic compensation by fusing multi-dimensional information on temperature, conductivity, and flow velocity. This significantly improves the metering accuracy of electromagnetic water meters in complex field environments. Compared to traditional compensation methods that rely solely on a single correction coefficient, the proposed scheme introduces intelligent modeling techniques such as principal component analysis and long short-term memory neural networks. This enables deep dynamic feature extraction of the water meter's operating conditions and allows for adaptive compensation for abnormal windows, dynamically eliminating measurement errors introduced by factors such as conductivity fluctuations, temperature changes, and environmental interference. The compensated flow velocity data more closely reflects the actual physical state, exhibiting stronger robustness and generalization ability. It effectively meets the needs of smart water management and industrial metering for high-precision, full-time-domain monitoring, thus providing a solid data foundation for water resource management, intelligent operation and maintenance, and improved economic benefits. Attached Figure Description
[0039] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 The first embodiment of the present invention provides an overall flowchart of an electromagnetic water meter error compensation method that combines conductivity and temperature. Detailed Implementation
[0041] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0042] Reference Figure 1 As one embodiment of the present invention, an error compensation method for an electromagnetic water meter combining conductivity and temperature is provided, comprising:
[0043] S1: Based on the relationship between temperature and conductivity in the test experiment, a functional relationship between temperature and conductivity is fitted to obtain 1; through experiments used for model training, each constant flow rate and conductivity is controlled, and using experimental data, a functional relationship is fitted with the measured value of flow rate and conductivity as independent variables, and the actual value of flow rate as dependent variable 2.
[0044] Specifically, the test experiment is a temperature-conductivity coupling experiment. By controlling the fluid temperature, the conductivity at different temperatures is measured to obtain a functional fitting relationship between temperature and conductivity. A Bayesian network is introduced into the functional relationship 2. Through training with the experimental data, the flow velocity measurement value and conductivity are used as inputs to perform probabilistic modeling on the fitting residual of each data point, and output the confidence level of the true flow velocity value.
[0045] In the field of water flow measurement, the electrical conductivity of water is closely related to temperature. At different temperatures, the rate of water molecule movement, the degree of ion dissociation, and solubility all change, directly affecting the water's electrical conductivity. Therefore, establishing a quantitative relationship between temperature and conductivity is fundamental to understanding and compensating for the impact of temperature on the accuracy of electromagnetic water meters when conducting water flow measurement experiments.
[0046] The basic procedure of the test experiment is as follows: the fluid temperature is gradually adjusted through external heating or cooling, and the conductivity of the water is collected at each target temperature point using a high-precision conductivity meter. During the experiment, graded isothermal control is typically employed to ensure that the water reaches thermal equilibrium at each temperature point before data recording, thus eliminating transient errors caused by temperature fluctuations. Through system sampling across the entire temperature range, a set of raw conductivity data corresponding to different temperatures is obtained. After the experiment, methods such as curve fitting and regression analysis are used to establish a mathematical mapping relationship between temperature and conductivity.
[0047] By comprehensively and realistically reflecting the impact of temperature changes on the electrical conductivity of water under on-site water supply conditions, a solid data and theoretical foundation is laid for subsequent metering error analysis, model training, and the development of dynamic compensation algorithms. This process not only enhances the scientific rigor of data modeling but also provides physical mechanism support for subsequent error compensation, making intelligent metering methods more aligned with actual working conditions and improving the model's adaptability and scalability.
[0048] S2: By using a temperature sensor and an electromagnetic water meter, the temperature information and flow velocity of the water flow are obtained, and the predicted result of the true flow velocity is obtained according to the function relationship 1 and function relationship 2.
[0049] The prediction results include: obtaining water flow temperature information through a temperature sensor; converting the current temperature into water conductivity using function relationship 1; inputting the water conductivity and the flow velocity measurement value obtained by the electromagnetic water meter into function relationship 2; and outputting the prediction result of the actual flow velocity value at the current moment.
[0050] S3: Analyze the actual flow velocity variation trend using the prediction results and construct trend vector 1; analyze the variation trend of differential flow velocity by subtracting the predicted value from the measured value and construct trend vector 2.
[0051] Furthermore, the differential flow velocity is equal to the measured value minus the predicted result. Within each time window, principal component analysis is performed on the time series data of the actual flow velocity and the differential flow velocity to reduce dimensionality, obtaining the principal component sequence. The principal component sequence is then input into a long short-term memory neural network for dynamic modeling, outputting trend vector 1 and trend vector 2 for the current window.
[0052] It should be noted that by comparing the real-time predicted velocity sequence with the actual measured sequence, not only can we obtain the changing trend representing the true physical state of the water flow (trend vector 1), but we can also capture the dynamic differences caused by systematic errors or occasional anomalies (trend vector 2). This bidirectional trend modeling helps to separate the relationship between the instrument's own measurement response and external disturbances or algorithm errors.
[0053] Within each time window, principal component analysis (PCA) is used to reduce the dimensionality of time-series data for actual and differential flow velocities, enabling the extraction of the most representative variation features and reducing data redundancy and noise interference. Inputting the dimensionality-reduced principal component sequences into a Long Short-Term Memory (LSTM) neural network for dynamic modeling not only enhances the ability to capture time-series dependencies, abrupt changes, and periodic features, but also lays the foundation for intelligent generation and adaptive adjustment of trend vectors.
[0054] In an optional embodiment, a Bayesian network can be introduced into the functional relationship 2. Through training on the experimental data, using flow velocity measurements and conductivity as inputs, probabilistic modeling is performed on the fitting residuals for each data point, outputting the confidence level of the true flow velocity value. Simultaneously with outputting the predicted flow velocity value at the current moment, the Bayesian network generates the confidence level for each time window, serving as a feature parameter for each time window in the principal component analysis process.
[0055] Furthermore, by introducing a Bayesian network into functional relationship 2, the measured values and conductivity are used as inputs to probabilistically model the fitting residuals and output the confidence score for each time window. This design enables the system to dynamically perceive the uncertainty of prediction during feature extraction, using the confidence score as a weight or feature parameter in principal component analysis, thereby improving the robustness and adaptability of feature extraction and subsequent compensation. Overall, this design significantly enhances the scientific rigor and intelligence of data modeling, providing solid data support for accurate compensation and anomaly self-diagnosis.
[0056] S4: In the time domain, the evolution process of generating trend vector 1 and trend vector 2.
[0057] Furthermore, the evolution process includes arranging the trend vector 1 and the trend vector 2 according to the time sequence to obtain the vector sequence of the trend vector 1 and the trend vector 2.
[0058] S5: Based on historical data, transfer learning of the evolution process is performed to analyze and compensate the current evolution process. The compensated vector is then combined with the trend vector 1 to obtain the compensated trend vector 1.
[0059] It should be noted that the transfer learning includes adopting a dual-channel structure, with each channel utilizing a trained TCN; inputting the vector sequences of trend vector 1 and trend vector 2 into the corresponding channels respectively, filtering out abnormal trend vectors in the sequences; and marking the filtering results of abnormal trend vectors for each channel with a time window to obtain an anomaly marking window.
[0060] The anomaly marker windows of the two channels are merged, and the set of time windows with markers is output.
[0061] A recurrent network is used to compensate for the trend vector, generating a compensation vector.
[0062] It should be noted that if the trend vector 1 and the trend vector 2 within the same time window are related, it can be simplified as follows: if a positive compensation vector is superimposed on the trend vector 1, then the superposition direction of the compensation vector on the trend vector 2 is negative.
[0063] By employing a dual-channel structure, and utilizing a pre-trained Temporal Convolutional Network (TCN) to independently model and filter anomaly trends for trend vector 1 and trend vector 2, differentiated anomaly identification can be performed for different types of dynamic features (such as true flow velocity trends and error trends). This parallel feature analysis approach effectively enhances the system's ability to discriminate multidimensional signal anomalies and its early warning capability, preventing misjudgment or missed detection by a single channel.
[0064] By merging the anomaly marker windows detected by the two channels, unified management and tracking of multi-source anomalies can be achieved, ensuring the comprehensiveness and accuracy of anomaly detection results. For these anomaly time windows, a recurrent neural network is used to further analyze trend evolution and anomaly dynamics, generating compensation vectors to achieve adaptive error correction for abnormal operating conditions.
[0065] In terms of compensation strategy, trend vector 1 and trend vector 2, which are set to be related within the same time window, are not only superimposed with a positive compensation vector on trend vector 1, but also with a negative compensation vector simultaneously superimposed on trend vector 2. This not only achieves bidirectional coordinated correction of errors, but also effectively maintains the dynamic balance of the system. This mechanism helps to suppress the impact of local anomalies on the overall measurement trend, improves the stability and robustness of compensation, and provides intelligent support for accurate measurement and anomaly self-healing.
[0066] Furthermore, compensation vectors are generated simultaneously for all time windows marked as anomalous.
[0067] The compensation process is as follows:
[0068] Step 1: For the trend vector of each time window, generate a compensation vector with a step size in a random direction.
[0069] Step 2: The compensation vector is superimposed on trend vector 1 and trend vector 2 respectively, and then re-input into the original input channel for anomaly assessment.
[0070] Step 3: If the evaluation result is no anomaly, then determine the cumulative result of the compensation vector as the final compensation vector;
[0071] If the evaluation result is abnormal, but the abnormal evaluation parameter is increasing in the positive direction, the compensation vector is increased by one step size for the next round of compensation; if the evaluation result is abnormal, but the abnormal evaluation parameter is increasing in the negative direction, the compensation vector is reversed and the next round of compensation is carried out by one step size; until there are no abnormalities in the time window, the cumulative result of the compensation vector within the time window is used as the final compensation vector.
[0072] For time windows marked as abnormal, an iterative superposition mechanism of compensation vector with adjustable step size and variable direction is adopted, which can flexibly cope with complex nonlinear error dynamics and achieve personalized and refined error elimination.
[0073] By generating a compensation vector with a random direction and preset step size within each anomaly window, and then synchronously correcting trend vector 1 and trend vector 2 in both positive and negative directions, and re-inputting the corrected trend vector into the original channel after each step for anomaly evaluation, the system can dynamically determine the effectiveness of the current compensation. If the anomaly is not eliminated, the compensation step size and direction are adaptively adjusted according to the growth direction of the anomaly parameters, enhancing the ability to track and respond to anomaly trends. This progressive, iterative compensation method effectively prevents false or false compensation caused by excessively large or small single compensation magnitudes, improving the stability and accuracy of the final compensation effect.
[0074] Overall, the design aims to endow the compensation algorithm with self-learning and self-adjustment capabilities, enabling it to quickly and accurately eliminate errors within abnormal windows by automatically adjusting the compensation amplitude and direction in complex and ever-changing field environments, thereby improving the overall metering reliability and intelligence level of the electromagnetic water meter.
[0075] S6: Using the compensated trend vector 1, the curve of the prediction result is corrected to obtain the electromagnetic water meter error compensation result.
[0076] The electromagnetic water meter error compensation result includes, within each time window, superimposing the trend vector 1 with the final compensation vector, decoding with an LSTM Decoder, performing an inverse PCA transformation on the output of the LSTM Decoder, and restoring it to the time-series data of the compensated flow velocity.
[0077] The compensated feature vector is effectively restored to physically meaningful flow velocity time-series data, achieving high-precision dynamic correction of the original measurement results, and finally outputting fully compensated electromagnetic water meter flow data. By first superimposing and adjusting the trend vector 1 with the final compensation vector within each time window, differentiated, window-level intelligent compensation can be achieved for various anomalies and dynamic disturbances, making the correction results closely match the actual water flow conditions.
[0078] Furthermore, by employing an LSTM Decoder to perform temporal feature decoding on the compensated trend vector, the dynamic structure and complex changes of the signal within the window can be deeply explored, fully capturing the high-order features of flow velocity evolution over time. Based on this, the principal component time series output by the LSTM is restored to the actual flow velocity data through inverse PCA transformation. This not only ensures the accurate correspondence between the decoding results and the physical measurement space but also takes into account data noise reduction and feature fidelity preservation.
[0079] This design enables error compensation to go beyond simple data-level corrections, achieving dynamic correction that integrates model-driven, data-driven, and physical mechanisms. This effectively improves the accuracy, intelligence, and adaptability to complex environmental changes in flow measurement.
[0080] Example 2: This example also provides an electromagnetic water meter error compensation system that combines conductivity and temperature, which includes: a testing unit that, based on the relationship between temperature and conductivity in the test experiment, fits a functional relationship 1 between temperature and conductivity; through experiments used for model training, controls each constant flow rate and conductivity, and uses experimental data to fit a functional relationship 2 with the measured value of flow rate and conductivity as independent variables and the actual value of flow rate as dependent variable.
[0081] The fitting unit acquires the temperature information and flow velocity measurement values of the water flow through a temperature sensor and an electromagnetic water meter, and obtains the predicted result of the true flow velocity value based on the function relationship 1 and function relationship 2.
[0082] The calculation unit uses the prediction results to analyze the changing trend of the actual flow velocity and constructs trend vector 1; it uses the measured value to subtract the value of the prediction result to analyze the changing trend of the differential flow velocity and constructs trend vector 2; in the time domain, it generates the evolution process of trend vector 1 and trend vector 2.
[0083] The compensation unit performs feature analysis and feature compensation on the current evolution process based on transfer learning of the evolution process using historical data. After combining the feature-compensated compensation vector with the trend vector 1, the compensated trend vector 1 is obtained.
[0084] The output unit uses the compensated trend vector 1 to correct the curve of the prediction result, thereby obtaining the electromagnetic water meter error compensation result.
[0085] If the above functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0086] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0087] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0088] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0089] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. An electromagnetic water meter error compensation method that combines conductivity and temperature, characterized by, include: Based on the relationship between temperature and conductivity in the test experiment, the functional relationship between temperature and conductivity is obtained by fitting 1; Through experiments used for model training, each constant flow rate and conductivity was controlled, and experimental data were used to fit a functional relationship with the measured flow rate and conductivity as independent variables and the actual flow rate as dependent variable.2 The temperature information and flow velocity of the water are obtained by using a temperature sensor and an electromagnetic water meter. Based on the function relationship 1 and function relationship 2, the predicted result of the actual flow velocity is obtained. The predicted results are used to analyze the changing trend of the actual flow velocity, and trend vector 1 is constructed; the measured values are subtracted from the predicted values to analyze the changing trend of the differential flow velocity, and trend vector 2 is constructed. In the time domain, the evolution process of generating trend vector 1 and trend vector 2; The evolutionary process is transferred to historical data for transfer learning, and the current evolutionary process is subjected to feature analysis and feature compensation. The compensated vector after feature compensation is combined with the trend vector 1 to obtain the compensated trend vector 1. Using the compensated trend vector 1, the curve of the prediction result is corrected to obtain the electromagnetic water meter error compensation result; The transfer learning includes: employing a dual-channel structure, with each channel utilizing a pre-trained TCN; inputting the vector sequences of trend vector 1 and trend vector 2 into the corresponding channels respectively, filtering out abnormal trend vectors in the sequences; and marking the filtering results of abnormal trend vectors for each channel within a time window to obtain an anomaly marking window. The anomaly marker windows of the two channels are merged, and the set of time windows where markers exist is output. A recurrent network is used to compensate for the trend vector, generating a compensation vector. Assuming that trend vector 1 and trend vector 2 within the same time window are related, it can be simplified as follows: if a positive compensation vector is superimposed on trend vector 1, then the superposition direction of the compensation vector on trend vector 2 is negative. Simultaneously, compensation vectors are generated for all time windows marked as anomalous; The compensation process is specifically as follows: Step 1: For the trend vector of each time window, generate a compensation vector with a step size in a random direction; Step 2: The compensation vector is superimposed on trend vector 1 and trend vector 2 respectively, and then re-input into the original input channel for anomaly assessment; Step 3: If the evaluation result is no anomaly, then determine the cumulative result of the compensation vector as the final compensation vector; If the evaluation result is abnormal, but the abnormal evaluation parameter is increasing in the positive direction, the compensation vector is increased by one step size for the next round of compensation; if the evaluation result is abnormal, but the abnormal evaluation parameter is increasing in the negative direction, the compensation vector is reversed and the next round of compensation is carried out by one step size; until there are no abnormalities in the time window, the cumulative result of the compensation vector within the time window is used as the final compensation vector.
2. The method for error compensation of an electromagnetic water meter combining conductivity and temperature according to claim 1, characterized in that: The test experiment is a temperature-conductivity coupling experiment. By controlling the fluid temperature, the conductivity at different temperatures is measured to obtain the functional fitting relationship between temperature and conductivity.
3. The electromagnetic water meter error compensation method combining conductivity and temperature as described in claim 2, characterized in that: The prediction results include: obtaining water flow temperature information through a temperature sensor; converting the current temperature into water conductivity using function relationship 1; inputting the water conductivity and the flow velocity measurement value obtained by the electromagnetic water meter into function relationship 2; and outputting the prediction result of the actual flow velocity value at the current moment.
4. The method for error compensation of an electromagnetic water meter combining conductivity and temperature according to claim 3, characterized in that: The differential flow rate is equal to the measured value minus the predicted result; Within each time window, principal component analysis is performed on the time series data of actual flow velocity and differential flow velocity to reduce dimensionality, obtain the principal component sequence, and input the principal component sequence into a long short-term memory neural network for dynamic modeling, outputting trend vector 1 and trend vector 2 for the current window.
5. The method for error compensation of an electromagnetic water meter combining conductivity and temperature according to claim 4, characterized in that: The evolution process includes arranging the trend vector 1 and the trend vector 2 according to time sequence to obtain the vector sequence of the trend vector 1 and the trend vector 2.
6. The method for error compensation of a combined conductivity and temperature electromagnetic water meter of claim 5, wherein: The electromagnetic water meter error compensation result includes, within each time window, superimposing the trend vector 1 with the final compensation vector, decoding with an LSTM Decoder, performing an inverse PCA transformation on the output of the LSTM Decoder, and restoring it to the time-series data of the compensated flow velocity.
7. An electromagnetic water meter error compensation system combining conductivity and temperature using the method described in any one of claims 1-6, characterized in that: The test unit, based on the relationship between temperature and conductivity in the test experiment, fits a functional relationship between temperature and conductivity 1; through experiments used for model training, each constant flow rate and conductivity is controlled, and using experimental data, a functional relationship 2 is fitted with the measured value of flow rate and conductivity as independent variables, and the actual value of flow rate as dependent variable. The fitting unit acquires the temperature information and flow velocity measurement values of the water flow through a temperature sensor and an electromagnetic water meter, and obtains the predicted result of the true flow velocity value based on the function relationship 1 and function relationship 2. The calculation unit analyzes the changing trend of the actual flow velocity using the prediction results and constructs trend vector 1; it analyzes the changing trend of the differential flow velocity by subtracting the value of the prediction results from the measured value and constructs trend vector 2; and it generates the evolution process of trend vector 1 and trend vector 2 in the time domain. The compensation unit performs transfer learning on the evolution process based on historical data, performs feature analysis and feature compensation on the current evolution process, and combines the feature-compensated compensation vector with the trend vector 1 to obtain the compensated trend vector 1. The output unit uses the compensated trend vector 1 to correct the curve of the prediction result, thereby obtaining the electromagnetic water meter error compensation result.
8. A computer device comprising: Memory and processor; The memory stores a computer program, characterized in that: when the processor executes the computer program, it implements the steps of the method as described in any one of claims 1-6.
9. A computer readable storage medium having stored thereon a computer program, characterized in that: When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-6.