Online self-adaptive zero compensation method for flow sensor
By employing an online adaptive zero-point compensation method based on multi-parameter joint judgment and model decomposition, the problem of zero-point drift of flow sensors in complex environments is solved, achieving accurate compensation and stability improvement of the sensor throughout its entire life cycle, thus ensuring measurement accuracy and settlement accuracy.
Patent Information
- Application Number
- CN202512017706.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-28
AI Technical Summary
Existing flow sensors are susceptible to fluctuations in environmental parameters when there is no flow or low flow, leading to zero drift. Existing compensation methods cannot effectively address the effects of multi-source coupling and sensor aging, affecting measurement accuracy and settlement accuracy.
A multi-parameter joint judgment mechanism is adopted to identify the zero-flow state. A zero-point drift model is constructed and decomposed into multiple independent drift components. Closed-loop optimization is performed through an online adaptive zero-point compensation method. Combined with aging drift components and smooth model updates, accurate compensation of the sensor is achieved throughout its entire life cycle.
It achieves long-term zero-point stability and improved measurement accuracy of sensors in complex environments, eliminates reliance on manual calibration, and ensures fairness in settlement and accuracy of data.
Smart Images

Figure CN121933099A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of flow measurement and intelligent compensation technology, specifically to an online adaptive zero-point compensation method for flow sensors. Background Technology
[0002] Flow sensors are core measurement components in smart water management, industrial fluid monitoring, and process control systems. Their measurement accuracy directly affects the fairness of water resource billing and the accuracy of water consumption statistics. In actual operation, flow sensors typically operate continuously for extended periods, while environmental parameters (such as water temperature and pipeline pressure) and sensor power supply voltage often fluctuate over time. When the sensor is in a state of no flow or low flow, interference from these external variables can easily cause the output signal to deviate from zero, resulting in "zero drift." This phenomenon can lead to mismeasurement when no water is flowing or cumulative flow errors, severely impacting billing accuracy and long-term system stability.
[0003] In existing technologies, there are two main solutions to zero-point drift in flow sensors: one is to manually close the pipeline valves periodically to stop the flow and perform zero-point calibration, forcibly resetting the output; the other is to use a single compensation circuit or algorithm based on water temperature to correct the flow signal in real time (water temperature has the most significant impact, and data acquisition and calculation are simple). These methods have some effect, but they still have significant shortcomings in complex actual operating environments.
[0004] Specifically, the limitations are as follows: First, relying on manual flow-stop calibration is not only costly to maintain, but also makes it difficult to achieve real-time automated management of large-scale instrument networks. Second, relying solely on water temperature for compensation ignores the combined effects of multiple factors such as water pressure stress and voltage fluctuations on the measurement reference, and cannot accurately reflect the multi-source coupling characteristics of zero-point drift. Third, existing methods lack effective mechanisms to suppress progressive drift such as sensor material aging, resulting in a significant decrease in measurement accuracy as the service life increases. Summary of the Invention
[0005] The purpose of this invention is to provide an online adaptive zero-point compensation method for flow sensors. This method enables the flow sensor to accurately identify the true zero-flow state and automatically correct its zero point under continuous flow conditions. It can perform multi-parameter closed-loop optimization autonomously throughout the entire process, significantly improving the long-term zero-point stability and full-lifecycle measurement accuracy of the sensor in complex environments.
[0006] To achieve the above objectives, the technical means adopted by the present invention are as follows:
[0007] In a first aspect, the present invention provides an online adaptive zero-point compensation method for a flow sensor, the method comprising:
[0008] S01, continuously acquire the original output signal of the flow sensor during normal operation and the environmental parameter group; the environmental parameter group includes multiple environmental parameters;
[0009] S02, based on the original output signal, the environmental parameter group and the preset multi-parameter joint judgment conditions, identify the time interval corresponding to the flow sensor being in zero flow condition, and mark it as the zero flow state interval;
[0010] S03, Construct a zero-point drift model, which is used to decompose the zero-point drift amount into multiple independent drift components, each of which corresponds to an environmental parameter;
[0011] S04, the original output signal of the flow sensor located in the zero flow state interval and each environmental parameter are marked as drift observation value and target environmental parameter, respectively; based on the drift observation value and the target environmental parameter, a set of real-time parameter estimates of the zero drift model are calculated;
[0012] S05, obtain the historical model parameters of the zero-point drift model, perform model fusion based on the real-time parameter estimates and the historical model parameters, obtain the updated target model parameters and fix them in the zero-point drift model to complete the smooth update;
[0013] S06, the real-time output signal of the flow sensor is compensated using the zero-point drift model with updated parameters, thus completing the online dynamic zero-point compensation of the flow sensor.
[0014] As a preferred embodiment of the present invention, after acquiring the original output signal and the environmental parameter set, a data preprocessing step is further included: performing time synchronization, sliding window averaging filtering, and outlier removal on each environmental parameter in the acquired original output signal and environmental parameter set.
[0015] As a preferred embodiment of the present invention, the environmental parameter group specifically includes water temperature parameter T(t), water pressure parameter P(t), and power supply voltage parameter V(t).
[0016] As a preferred embodiment of the present invention, the multi-parameter joint determination condition is specifically as follows:
[0017] The absolute value of the amplitude of the original output signal is less than the preset flow rate threshold;
[0018] The absolute value of the rate of change of the original output signal is less than a preset stability threshold;
[0019] The absolute value of the fluctuation of the water pressure parameter within the preset time window is less than the preset water pressure change threshold;
[0020] The power supply voltage variance within the current time window is less than the preset voltage variance threshold.
[0021] As a preferred embodiment of the present invention, in step S03, the independent drift components include water temperature drift component, water pressure drift component, and power supply voltage drift component.
[0022] As a preferred embodiment of the present invention, in step S03, the independent drift component further includes an aging drift component, which is used to characterize the drift caused by the aging of the sensor material.
[0023] As a preferred embodiment of the present invention, in step S05, the updated target model parameters are obtained in the following specific way: θ new =λθ old +(1-λ)θ now, Where λ is the preset smoothing coefficient; θ new For the updated target model parameters; θ old For historical model parameters; θ now These are real-time parameter estimates.
[0024] As a preferred embodiment of the present invention, the online adaptive zero-point compensation method for flow sensors further includes a model freezing step: when the rate of change of any environmental parameter in the environmental parameter group is detected to exceed a preset safety limit, the parameter update action in step S05 is suspended, and the compensation calculation is performed using the target model parameters in the most recent stable state.
[0025] In a second aspect, the present invention also provides an electronic device, including a processor and a memory;
[0026] The processor is connected to the memory;
[0027] Memory, used to store executable program code;
[0028] The processor reads the executable program code stored in the memory and runs the program corresponding to the executable program code to perform the steps of the above-described online adaptive zero-point compensation method for a flow sensor.
[0029] Thirdly, the present invention also provides 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 above-described online adaptive zero-point compensation method for a flow sensor.
[0030] In summary, the present invention has the following beneficial effects:
[0031] This invention intelligently identifies the zero-flow state range through a multi-parameter joint judgment mechanism, achieving accurate identification and online adaptive correction of the true zero-flow state under continuous flow conditions, eliminating the reliance on manual flow-stop calibration; by performing closed-loop correction under true zero-flow conditions, it avoids misjudgment interference, making zero-point compensation more accurate; and through a model freezing mechanism, it ensures the safety and reliability of compensation results under sudden environmental changes, guaranteeing the fairness of settlement and the accuracy of data.
[0032] The method of this invention overcomes the limitations of existing technologies that only consider a single factor, and can accurately reflect the combined effect of the coupling of multiple environmental factors on the zero point. At the same time, the introduction of aging drift components and the adaptive smooth update mechanism for model parameters enable the system to track and compensate for the gradual performance degradation of the sensor itself, thereby significantly improving the measurement accuracy and stability of the sensor throughout its entire life cycle. Attached Figure Description
[0033] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0034] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0035] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed merely to enable those skilled in the art to better understand and implement the subject matter described herein, and are not intended to limit the scope, applicability, or examples set forth in the claims. The function and arrangement of the elements discussed may be changed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the various examples. For example, the described methods may be performed in a different order than described, and steps may be added, omitted, or combined. Furthermore, features described in some examples may be combined in other examples.
[0036] As used herein, the term "comprising" and its variations are open terms meaning "including but not limited to". The term "based on" means "at least partially based on". The terms "one embodiment" and "an embodiment" mean "at least one embodiment". The term "another embodiment" means "at least one other embodiment". The terms "first", "second", etc., may refer to different or the same objects. Other definitions, whether explicit or implicit, may be included below. Unless explicitly indicated by the context, the definition of a term shall remain consistent throughout the specification.
[0037] like Figure 1 As shown in the figure, this embodiment provides an online adaptive zero-point compensation method for a flow sensor, which includes the following steps:
[0038] S01 continuously acquires the raw output signal of the flow sensor during normal operation and the environmental parameter group; the environmental parameter group contains multiple environmental parameters.
[0039] Specifically, when the flow sensor is working normally, the original output signal F is synchronously acquired at each sampling time t. raw (t) and an environmental parameter group, which includes multiple environmental parameters such as water temperature parameter T(t), water pressure parameter P(t), and power supply voltage parameter V(t); among which the original output signal F raw (t) represents the time-series data of the flow.
[0040] In acquiring the original output signal F raw After obtaining the environmental parameter set (t), data preprocessing steps are performed: time synchronization, sliding window averaging filtering, and outlier removal are applied to the acquired raw output signal and each environmental parameter in the environmental parameter set. The purpose of time synchronization is to ensure that the raw output signal F... raw (t) is strictly aligned with each environmental parameter in terms of timestamp to eliminate errors caused by asynchronous sampling times; in the sliding window averaging filter, a sliding window of length N (usually N=5-10 sampling points) is used to process the original output signal F. raw (t) Smoothing is performed to suppress high-frequency noise; in outlier removal, outlier data points that deviate significantly from the normal range can be identified and removed based on the 3σ criterion or box plot method.
[0041] After preprocessing, a multidimensional feature vector X(t) = {F} can be formed. raw (t),T(t),P(t),V(t)}.
[0042] S02, based on the original output signal, environmental parameter group and preset multi-parameter joint judgment conditions, identifies the time interval corresponding to the flow sensor being in zero flow condition and marks it as the zero flow state interval.
[0043] The zero-flow state interval refers to the period during which the fluid in the pipeline is in a static state when the flow sensor is operating normally, due to factors such as pipeline closure, user water outages, or nighttime periods when water usage is not being used. This invention identifies this time interval through a multi-parameter joint judgment condition, and subsequently uses the signal within this time interval as a "reference" to capture the zero-point drift.
[0044] The specific multi-parameter joint determination condition is as follows:
[0045] The absolute value of the amplitude of the original output signal | F raw (t)| less than the preset flow threshold F th ;
[0046] | F raw (t)| < F th
[0047] Among them, the preset traffic threshold F th It can be set to 0.02-0.05 L / min to exclude working conditions where there is obvious actual flow;
[0048] absolute value of the rate of change of the original output signal Less than the preset stability threshold ε; , The preset stability threshold ε can be set to 0.005 L / min·s to ensure that the flow signal remains stable for a short period of time.
[0049] The absolute value of the fluctuation of water pressure parameters within the preset time window |P(t)- | Less than the preset water pressure change threshold P th ; |P(t)- | < P th, in, This represents the average water pressure value within the current time window, with a preset water pressure change threshold P. th This is used to ensure that zero flow determination occurs when the pipeline pressure is relatively stable;
[0050] The supply voltage variance Var(V(t)) within the current time window is less than the preset voltage variance threshold V. th .
[0051] This condition is used to ensure that zero-current sample collection occurs under stable power supply conditions, avoiding zero-point misjudgment caused by power fluctuations.
[0052] When the above conditions are met simultaneously in multiple consecutive sampling periods, the corresponding time interval is marked as the zero-flow state interval.
[0053] S03, Construct a zero-point drift model. The zero-point drift model is used to decompose the zero-point drift into multiple independent drift components, each of which corresponds to an environmental parameter.
[0054] A zero-point drift model is constructed based on a multi-component decoupling modeling method, thereby treating the complex zero-point drift as the superposition of multiple independent physical factors and decomposing it into multiple independent drift components through mathematical means. In this embodiment, the independent drift components are set to include three components: water temperature drift, water pressure drift, and power supply voltage drift.
[0055] Specifically, the zero-point drift model is: Z offset (t)=Z T (t)+Z P (t)+Z V (t)+Z aging (t)
[0056] The water temperature drift component is: Z T (t)=a1T(t)+a2T 2 (t);
[0057] This component model introduces first-order and second-order terms of water temperature to characterize the linear and nonlinear effects of water temperature changes on the zero-point drift of the sensor, making the compensation model applicable to a wider temperature range.
[0058] The water pressure drift component is: Z P (t)=b1P(t)+b2ΔP(t);
[0059] Wherein, ΔP(t) represents the water pressure change within adjacent sampling periods. This component model not only reflects the influence of static water pressure on the structural stress of the flow sensor, but also considers the dynamic influence of water pressure change on the zero point.
[0060] The supply voltage drift component is: Z V (t)=c1V(t)+c2 ;
[0061] V(t) represents the current power supply voltage of the flow sensor. This represents the rate of change of the supply voltage over time. This component model is used to characterize the impact of the absolute value of the supply voltage and its change on the stability of the flow sensor analog front end, bridge, or sampling reference, thereby reflecting the contribution of power supply state changes to zero drift.
[0062] In addition, this embodiment addresses the problem that existing methods lack an effective mechanism to suppress progressive drift such as sensor material aging, which leads to a significant decrease in measurement accuracy with increasing service life. It also includes an aging drift component Z. aging (t)=d1ln(t+t0);
[0063] This component model is used to describe the slow zero-point drift characteristics of flow sensors caused by factors such as material aging and stress release during long-term operation. It adopts a logarithmic form to reflect the characteristics of rapid changes in the early stage of aging and slowing down in the later stage.
[0064] The parameters in each component model can be uniformly represented as a parameter vector: θ = {a1, a2, b1, b2, c1, c2, d1}; and in order to maintain accuracy throughout the entire lifecycle, the system will continuously optimize the model parameters.
[0065] S04, the original output signal of the flow sensor located in the zero flow state interval and each environmental parameter are marked as drift observation value and target environmental parameter, respectively; based on the drift observation value and target environmental parameter, a set of real-time parameter estimates of the zero drift model are calculated.
[0066] Specifically, the raw output signals of the flow sensor and various environmental parameters located in the zero-flow state interval are labeled as drift observations and target environmental parameters, respectively. Based on regression algorithms such as least squares or gradient descent, a set of real-time parameter estimates θ for the zero-point drift model are calculated. now .
[0067] S05, Obtain the historical model parameters of the zero-point drift model, and perform model fusion based on the real-time parameter estimates and historical model parameters;
[0068] To avoid the model parameters being affected by transient noise or occasional anomalies, this embodiment uses an exponential weighting method to smoothly update the zero-point drift model parameters.
[0069] Obtain the historical model parameters θ of the zero-point drift model old The acquisition methods include, but are not limited to, obtaining data from experimental databases, obtaining manufacturer production records, or pre-setting data in analysis software; then, model fusion is performed based on the exponential weighted average method to obtain the updated target model parameters θ. new : θ new =λθ old +(1-λ)θ now, Where λ is a preset smoothing coefficient (e.g., 0.2), used to balance the weights of historical information and current observations; θ new For the updated target model parameters; θ old For historical model parameters; θ now The parameters are estimated in real time; this smooth update mechanism effectively suppresses random fluctuations caused by occasional noise interference during parameter estimation, ensuring the stability of model updates.
[0070] Then, θnew Fixed within the zero-point drift model, smooth updates are achieved: Z offset (t)=f(T(t),P(t),V(t),t;θ new ); Z offset (t) represents the real-time zero-point drift compensation amount.
[0071] S06 uses the zero-point drift model with updated parameters to compensate the real-time output signal of the flow sensor, thus completing the online dynamic zero-point compensation of the flow sensor.
[0072] Real-time compensation is performed, using the updated zero-point drift model to compensate for the real-time output signal of the flow sensor. F comp (t)= F raw (t)- Z offset (t);
[0073] F comp (t) represents the calibrated output signal of the flow sensor.
[0074] This method eliminates the reliance on manual periodic zeroing and can autonomously track the performance evolution of sensors throughout their entire lifecycle, significantly improving the fairness of settlement in smart water management and industrial fluid monitoring.
[0075] In addition, the following embodiments also provide an electronic device, including a processor and a memory;
[0076] The processor is connected to the memory;
[0077] Memory, used to store executable program code;
[0078] The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, in order to perform the steps of the online adaptive zero-point compensation method for a flow sensor in the above embodiments.
[0079] Furthermore, the following embodiments also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the online adaptive zero-point compensation method for a flow sensor according to the above embodiments.
[0080] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this specification are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., Digital Versatile Discs (DVDs)), or semiconductor media (e.g., Solid State Disks (SSDs)).
[0081] Several embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, and are not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or technological improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for online adaptive zero-point compensation of a flow sensor, characterized in that, The methods include: S01, continuously acquire the raw output signal of the flow sensor and the environmental parameter set during normal operation; The environmental parameter group includes multiple environmental parameters; S02, based on the original output signal, the environmental parameter group and the preset multi-parameter joint judgment conditions, identify the time interval corresponding to the flow sensor being in zero flow condition, and mark it as the zero flow state interval; S03, Construct a zero-point drift model, which is used to decompose the zero-point drift amount into multiple independent drift components, each of which corresponds to an environmental parameter; S04, the original output signal of the flow sensor located in the zero flow state interval and each environmental parameter are marked as drift observation value and target environmental parameter, respectively; based on the drift observation value and the target environmental parameter, a set of real-time parameter estimates of the zero drift model are calculated; S05, obtain the historical model parameters of the zero-point drift model, perform model fusion based on the real-time parameter estimates and the historical model parameters, obtain the updated target model parameters and fix them in the zero-point drift model to complete the smooth update; S06, the real-time output signal of the flow sensor is compensated using the zero-point drift model with updated parameters, thus completing the online dynamic zero-point compensation of the flow sensor.
2. The online adaptive zero-point compensation method for a flow sensor according to claim 1, characterized in that, After acquiring the raw output signal and environmental parameter set, the data preprocessing steps are also included: time synchronization, sliding window averaging filtering, and outlier removal are performed on each environmental parameter in the acquired raw output signal and environmental parameter set.
3. The online adaptive zero-point compensation method for a flow sensor according to claim 2, characterized in that, The environmental parameter group specifically includes water temperature parameter T(t), water pressure parameter P(t), and power supply voltage parameter V(t).
4. The online adaptive zero-point compensation method for a flow sensor according to claim 3, characterized in that, The specific multi-parameter joint determination condition is as follows: The absolute value of the amplitude of the original output signal is less than the preset flow rate threshold; The absolute value of the rate of change of the original output signal is less than a preset stability threshold; The absolute value of the fluctuation of the water pressure parameter within the preset time window is less than the preset water pressure change threshold; The power supply voltage variance within the current time window is less than the preset voltage variance threshold.
5. The online adaptive zero-point compensation method for a flow sensor according to claim 4, characterized in that, In step S03, the independent drift components include water temperature drift component, water pressure drift component, and power supply voltage drift component.
6. The online adaptive zero-point compensation method for a flow sensor according to claim 5, characterized in that, In step S03, the independent drift component further includes an aging drift component, which is used to characterize the drift caused by the aging of the sensor material.
7. The online adaptive zero-point compensation method for a flow sensor according to claim 1, characterized in that, In step S05, the updated target model parameters are obtained as follows: i new =λθ old +(1-λ)θ now Where λ is the preset smoothing coefficient; θ new For the updated target model parameters; θ old For historical model parameters; θ now These are real-time parameter estimates.
8. The online adaptive zero-point compensation method for a flow sensor according to claim 1, characterized in that, The online adaptive zero-point compensation method for flow sensors also includes a model freezing step: when the rate of change of any environmental parameter in the environmental parameter group is detected to exceed a preset safety limit, the parameter update action in step S05 is paused, and the compensation calculation is performed using the target model parameters in the most recent stable state.
9. An electronic device, characterized in that, Including the processor and memory; The processor is connected to the memory; Memory, used to store executable program code; The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, in order to perform the steps of the online adaptive zero-point compensation method for a flow sensor as described in any one of claims 1-8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the online adaptive zero-point compensation method for a flow sensor as described in any one of claims 1-8.
