A wireless low-power sensor calibration method
By analyzing power supply voltage and temperature data, the system classifies power levels and drift risk levels, generates a calibration strategy table, and solves the problems of energy waste and untimely calibration in wireless low-power sensor calibration methods. This enables adaptive calibration and improves the energy utilization efficiency and calibration accuracy of the sensor.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- THE FIRST COMPARY OF CHINA EIGHTH ENG BUREAU LTD
- Filing Date
- 2025-12-30
- Publication Date
- 2026-06-26
AI Technical Summary
Existing wireless low-power sensor calibration methods cannot effectively distinguish between environmental changes and sensor drift, resulting in energy waste or untimely calibration, making it difficult to achieve adaptive dynamic calibration under limited energy conditions.
By collecting power supply voltage, on-chip temperature, and sensor measurements, the system classifies power levels and drift risk levels, generates a calibration strategy table, and combines energy and calibration error optimization to dynamically adjust the calibration mode and algorithm complexity, thereby achieving adaptive calibration.
Under energy-constrained conditions, adaptive calibration of sensor output was achieved, reducing energy waste, improving the relevance and effectiveness of calibration, and extending sensor lifespan.
Smart Images

Figure CN121702444B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of sensor calibration technology, and specifically relates to a wireless low-power sensor calibration method. Background Technology
[0002] With the development of IoT and wireless sensor network technologies, a large number of low-power wireless sensor nodes are widely used in scenarios such as building environment monitoring, structural health monitoring, and industrial process monitoring. These nodes typically integrate sensor front-ends, wireless communication modules, power management modules, and microcontrollers, relying on batteries or energy harvesting devices for power supply, and are deployed long-term in locations where infrequent maintenance is difficult. To ensure the reliability of the collected data, sensors generally need to be calibrated at the factory or during installation, and periodically recalibrated during operation to compensate for zero-point offset and sensitivity drift caused by factors such as temperature changes, power supply fluctuations, and aging.
[0003] In existing technologies, the calibration of wireless low-power sensors mainly falls into the following categories: First, a periodic calibration scheme with fixed time intervals is used. This involves triggering a unified calibration process at the node or host computer according to a preset calibration cycle. While simple to implement, this method ignores the node's current operating state and environmental changes. When ambient temperature changes drastically or sensor aging accelerates, the fixed cycle may be too long, causing the sensor output to remain in a state of significant deviation for an extended period. Conversely, during periods of long-term environmental stability and power scarcity, a large number of "unnecessary" calibrations may be performed, resulting in energy waste and shortening node lifespan. Second, some systems perform simple "over-limit triggering" self-calibration based on a single state variable. For example, calibration is triggered only when the measured value deviates from a certain reference value or historical average value exceeding a fixed threshold. This method typically does not consider power status and lacks comprehensive analysis of environmental factors such as temperature change rate and power supply voltage fluctuations. It is prone to misinterpreting anomalies caused by power supply interference or short-term noise as sensor drift, thus triggering unnecessary calibration calculations.
[0004] On the other hand, with long-term changes in the building environment, structural conditions, and equipment operating status, the statistical characteristics of sensor output often exhibit complex behavior of "slow drift superimposed with short-term fluctuations." Traditional methods using fixed thresholds or simple mean comparisons are insufficient to effectively distinguish between measurement changes caused by environmental conditions and systematic deviations caused by sensor drift. Furthermore, it is difficult to select calibration strategies of varying intensities, such as full calibration, micro-calibration, or delayed calibration, based on different levels of drift risk. Given the limited computing power and energy supply of microcontroller units, how to jointly decide on calibration behavior based on state of charge, environmental change characteristics, and residual statistical properties during long-term operation, and achieve adaptive dynamic calibration under energy constraints, has become a pressing technical problem in the field of wireless low-power sensors. Summary of the Invention
[0005] The purpose of this invention is to provide a wireless low-power sensor calibration method.
[0006] This invention is achieved through the following measures: a wireless low-power sensor calibration method, applied to a wireless sensor node including a sensor, a wireless communication module, a power supply module, and a microcontroller unit (MCU), characterized in that the method includes the following steps:
[0007] S1: The wireless sensor node collects power supply voltage, on-chip temperature and sensor measurement values according to the sampling period, averages the sensor measurement values within a preset time window, obtains the difference between the current measurement value and the average value as the residual, and divides the power supply voltage into corresponding power levels according to a preset power supply voltage threshold.
[0008] The preset time window is a time interval containing several recent sampling periods, and the number of several sampling periods is an integer greater than or equal to 2. The wireless sensor node updates the preset time window in each sampling period, so that the preset time window forms a sliding window.
[0009] The average of sensor measurements within a preset time window is calculated by performing an arithmetic mean on the sensor measurements corresponding to each sampling period within the preset time window. The residual is the absolute value of the difference between the sensor measurement in the current sampling period and the arithmetic mean.
[0010] The process of classifying power supply voltage into power levels based on thresholds includes the following steps: based on a preset first power supply voltage threshold and a second power supply voltage threshold, the state where the power supply voltage is lower than the first power supply voltage threshold is classified as a low power level, the state where the power supply voltage is between the first power supply voltage threshold and the second power supply voltage threshold is classified as a medium power level, and the state where the power supply voltage is higher than the second power supply voltage threshold is classified as a high power level.
[0011] S2: The microcontroller calculates the rate of environmental change and drift trend based on the temperature difference between adjacent sampling periods, the fluctuation range of the power supply voltage within a short time window, and the mean and variance of the residual within a preset time window. Based on this, it classifies the current state into one of the following: drift stability level, drift level, and drift severity level, thereby obtaining the drift risk level.
[0012] The rate of environmental change is the ratio of the on-chip temperature difference between adjacent sampling periods to the duration of the sampling period. The fluctuation amplitude of the power supply voltage within a short time window is the difference between the maximum and minimum power supply voltage within the short time window. The short time window includes a preset number of consecutive sampling periods, and the preset number is an integer greater than or equal to two.
[0013] The microcontroller compares the environmental change rate, the fluctuation amplitude of the power supply voltage within a short time window, the mean of the residual within a preset time window, and the variance of the residual within a preset time window with corresponding drift stability threshold groups, moderate drift threshold groups, and severe drift threshold groups, respectively. When the environmental change rate, the fluctuation amplitude of the power supply voltage within a short time window, and the variance of the residual within a preset time window are all less than each threshold in the drift stability threshold group, the current state is classified as a drift stability level. When the environmental change rate, the fluctuation amplitude of the power supply voltage within a short time window, and the variance of the residual within a preset time window are all greater than each threshold in the severe drift threshold group, the current state is classified as a severe drift level. When the current state does not meet the conditions for drift stability level and severe drift level, the current state is classified as a moderate drift level.
[0014] S3: Before the deployment of the wireless sensor node, the energy consumption and calibration error of various calibration configurations are measured. Based on the dual objective optimization of energy and calibration error, a calibration strategy table is generated with the power level and the drift risk level as indexes, and the output calibration mode and algorithm complexity are output. The calibration mode includes full calibration mode, micro calibration mode and delayed calibration mode. The calibration strategy table is stored in the microcontroller.
[0015] The determination of energy consumption and calibration error for multiple calibration configurations includes: controlling the wireless sensor node to perform a complete calibration process once for each calibration configuration; collecting power supply voltage and supply current during the calibration process duration; calculating the integral value of the product of the power supply voltage and the supply current relative to time as the energy consumption of the calibration configuration; collecting a set of sensor measurements and a reference measurement value corresponding to the sensor measurements during the calibration process; and calculating the average of the squares of the differences between the calibrated sensor measurements and the reference measurement values as the calibration error of the calibration configuration.
[0016] The dual-objective optimization of energy and calibration error to generate a calibration strategy table includes: comparing the energy consumption and calibration error point set of all calibration configurations, eliminating cases where another calibration configuration has energy consumption less than or equal to the energy consumption of the current calibration configuration and calibration error less than the calibration error of the current calibration configuration, obtaining the optimal calibration configuration set in terms of energy consumption and calibration error, and using the optimal calibration configuration set as the candidate calibration configuration set for generating the calibration strategy table.
[0017] The step of generating a calibration strategy table using the power level and the drift risk level as indexes includes: for each combination of power level and drift risk level, selecting a target calibration configuration from the optimal calibration configuration set, wherein the target calibration configuration has a calibration error not greater than a preset error upper limit under the condition of satisfying the upper limit of allowable energy consumption corresponding to the power level, and using the calibration mode and algorithm complexity corresponding to the target calibration configuration as the output content of the calibration strategy table under the corresponding power level index and the corresponding drift risk level index.
[0018] S4: During node operation, the microcontroller queries the target calibration strategy in the calibration strategy table based on the current power level and the current drift risk level to obtain the calibration triggering time and target calibration mode, limits the number of samples and the number of algorithm iterations used for calibration, and executes the corresponding calibration process under the condition of satisfying the power level constraint to obtain updated sensor calibration parameters.
[0019] After the microcontroller finds the target calibration mode in the calibration strategy table based on the current power level and the current drift risk level, when the target calibration mode is a full calibration mode, it sets the number of samples used for calibration to be greater than or equal to a first sample number threshold and the number of algorithm iterations to be greater than or equal to a first algorithm iteration number threshold. When the target calibration mode is a micro calibration mode, it sets the number of samples used for calibration to be greater than or equal to a second sample number threshold and less than the first sample number threshold, and the number of algorithm iterations to be greater than or equal to the second algorithm iteration number threshold and less than the first algorithm iteration number threshold. When the target calibration mode is a delayed calibration mode, it sets the number of samples used for calibration to zero and the number of algorithm iterations to zero.
[0020] The power level constraint includes the maximum allowable calibration energy consumption threshold corresponding to each power level. Before executing the corresponding calibration process, the microcontroller estimates the energy consumption of the current calibration process based on the number of samples used for calibration and the number of algorithm iterations. When the estimated energy consumption is less than or equal to the maximum allowable calibration energy consumption threshold corresponding to the current power level, the corresponding calibration process is executed. When the estimated energy consumption is greater than the maximum allowable calibration energy consumption threshold corresponding to the current power level, the corresponding calibration process is not executed.
[0021] S5: The microcontroller writes the updated sensor calibration parameters into the non-volatile memory and updates the statistics of the residual for the state determination of the next sampling period, so that the wireless sensor node can achieve adaptive calibration of the sensor output under energy-constrained conditions during long-term operation.
[0022] The sensor calibration parameters include bias parameters, gain parameters, and nonlinear calibration parameters. When the microcontroller writes the updated sensor calibration parameters to the non-volatile memory, it writes the bias parameters, gain parameters, and nonlinear calibration parameters in the form of a parameter vector, and simultaneously writes the timestamp corresponding to the current sampling period and the current power level to form a calibration record.
[0023] The non-volatile memory reserves a circular storage area for the calibration records, which is used to store a preset number of calibration records. The preset number is an integer greater than or equal to two. When a new calibration record is written, the microcontroller overwrites the oldest calibration record in the circular storage area.
[0024] When updating the statistics of the residuals, the microcontroller adds the residuals of the current sampling period to the residual sequence in the preset time window, removes the residuals corresponding to the earliest sampling period in the preset time window, calculates new residual mean and residual variance based on the updated residual sequence, and uses the new residual mean and the new residual variance as the statistics of the residuals used for the state determination of the next sampling period.
[0025] The beneficial effects of the technical solution provided by the embodiments of the present invention are as follows: The present invention proposes a wireless low-power sensor calibration method based on joint decision-making of energy and drift. Through multi-dimensional state quantity acquisition, environmental change rate and drift risk classification, construction of energy-error dual-objective optimization strategy table, calibration mode classification and energy constraint execution, and parameter recording and residual statistical closed-loop update, adaptive calibration of sensor output under energy-constrained conditions is realized. Attached Figure Description
[0026] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings listed 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.
[0027] Figure 1 This is a flowchart of a wireless low-power sensor calibration method according to an embodiment of the present invention. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments. Of course, the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0029] See Figure 1, a wireless low-power sensor calibration method, applied to a wireless sensor node including a sensor, a wireless communication module, a power supply module, and a microcontroller unit (MCU), characterized in that the method includes the following steps:
[0030] S1: The wireless sensor node collects the power supply voltage, on-chip temperature, and sensor measurement values according to the sampling period, calculates the average of the sensor measurement values within a preset time window, obtains the difference between the current measurement value and the average value as the residual, and divides the power supply voltage into corresponding power levels according to a preset power supply voltage threshold;
[0031] The preset time window is a time interval including the most recent several sampling periods, the number of several sampling periods is an integer greater than or equal to 2, and the wireless sensor node updates the preset time window in each sampling period, so that the preset time window forms a sliding window.
[0032] Calculating the average of the sensor measurement values within the preset time window means performing an arithmetic average on the sensor measurement values corresponding to each sampling period within the preset time window, and the residual is the absolute value of the difference between the sensor measurement value of the current sampling period and the arithmetic average value.
[0033] Dividing the power supply voltage into power levels according to the threshold includes the following steps: According to the preset first power supply voltage threshold and second power supply voltage threshold, the state where the power supply voltage is lower than the first power supply voltage threshold is divided into a low power level, the state where the power supply voltage is between the first power supply voltage threshold and the second power supply voltage threshold is divided into a medium power level, and the state where the power supply voltage is higher than the second power supply voltage threshold is divided into a high power level.
[0034] In a preferred embodiment, let the sampling period number be a positive integer , the preset time window length is an integer L, and L≥2, and the index set of the sliding time window is:
[0035]
[0036] The arithmetic average of the sensor measurement values within the time window: , the residual of the current sampling period is: ; Let the preset first power supply voltage threshold be U1, the second power supply voltage threshold be U2, and U1 < U2, the power supply voltage of the nth sampling period is , the power level is , then there is
[0037]
[0038] ., ., are the low power level, medium power level, and high power level respectively.
[0039] Where n is the index of the current sampling period, which is a positive integer starting from 1 and used to identify the sampling period of the wireless sensor node at different times; L is the number of sampling periods contained in the preset time window, which is an integer greater than or equal to 2 and is determined by the system configuration. Let j be the set of time window indices corresponding to the nth sampling period; j is the sampling period index within the sliding time window, with values ranging from... An integer up to n, used to iterate through each sampling period of the time window during summation; The sensor measurement value collected in the nth sampling period is the physical quantity value that can be directly read from the sensor output; The average measurement value is obtained by averaging the sensor measurements in each sampling period within a preset time window corresponding to the nth sampling period. The residual for the nth sampling period is denoted as and the current measurement value is denoted as . Compared with average measurement value The absolute value of the difference is used to characterize the degree to which the current measurement deviates from the recent average level; Let be the power supply voltage in the nth sampling period, and be the voltage value measured in that sampling period.
[0040] In step S1, not only are the power supply voltage and on-chip temperature collected in each sampling cycle, but the sensor measurements from multiple sampling cycles are also arithmetically averaged within a preset time window. The absolute value of the difference between the current measurement and this average value is used as the residual. Simultaneously, the power supply voltage is divided into low, medium, and high charge levels based on two power supply voltage thresholds. By calculating the residual through a sliding time window, compared to judging from a single instantaneous value, it better reflects the overall level and deviation of the measured quantity in the recent period, reducing the interference of random noise on drift judgment.
[0041] S2: The microcontroller calculates the rate of environmental change and drift trend based on the temperature difference between adjacent sampling periods, the fluctuation range of power supply voltage within a short time window, and the mean and variance of the residual within a preset time window. Based on this, it classifies the current state into one of the following: drift stability level, drift level, and drift severity level, thus obtaining the drift risk level.
[0042] The rate of environmental change is the ratio of the on-chip temperature difference between adjacent sampling periods to the duration of the sampling period. The fluctuation amplitude of the power supply voltage within a short time window is the difference between the maximum and minimum power supply voltage within the short time window. The short time window includes a preset number of consecutive sampling periods, and the preset number is an integer greater than or equal to two.
[0043] The microcontroller compares the rate of change of the environment, the fluctuation amplitude of the power supply voltage within a short time window, the mean of the residual within a preset time window, and the variance of the residual within a preset time window with the corresponding drift stability threshold group, drift moderate threshold group, and drift severe threshold group, respectively. When the rate of change of the environment, the fluctuation amplitude of the power supply voltage within a short time window, and the variance of the residual within a preset time window are all less than the thresholds in the drift stability threshold group, the current state is classified as drift stable. When the rate of change of the environment, the fluctuation amplitude of the power supply voltage within a short time window, and the variance of the residual within a preset time window are all greater than the thresholds in the drift severe threshold group, the current state is classified as drift severe. When the current state does not meet the conditions for drift stability or drift severe, the current state is classified as drift moderate.
[0044] In a preferred embodiment, let the on-chip temperature of the nth sampling period be... The sampling period duration is The rate of environmental change in the nth sampling period is defined as:
[0045]
[0046] Let M be the number of sampling periods contained in the short time window, and M≥2. Then the set of short time window indices corresponding to the nth sampling period is:
[0047]
[0048] The power supply voltage fluctuation amplitude in the nth sampling period is defined as: .
[0049] in Let the power supply voltage be the voltage in the k-th sampling period. Then, the mean and variance of the residuals corresponding to the n-th sampling period are defined as follows:
[0050]
[0051]
[0052] Suppose three sets of thresholds are given in advance:
[0053] Drift stability threshold group , , ,in, The drift risk level of the nth sampling period is defined as follows: Its determination rule can be written as a piecewise function:
[0054]
[0055] in These correspond to "Drift Stability Level", "Drift Moderate Level", and "Drift Severe Level", respectively.
[0056] n is the index of the current sampling period, which is a positive integer starting from 1 and incrementing, used to identify the sampling period of the wireless sensor node at different times; The on-chip temperature is collected during the nth sampling period, and the temperature measurement value is obtained through the temperature sensor inside the node. The sampling period duration is the time between adjacent sampling periods, which is a fixed time interval determined by the system configuration; The environmental change rate in the nth sampling period is the ratio of the absolute value of the difference between two adjacent sampling temperatures to the sampling period duration; M is the number of sampling periods used to calculate the power supply voltage fluctuation amplitude within a short time window, and is an integer greater than or equal to 2. This is a set of short-time window indices corresponding to the nth sampling period, where each element k is the index of the sampling period contained in the short-time window; k is the sampling period index within the short-time window, used to traverse each sampling period within the short-time window when finding the maximum and minimum values; Let be the power supply voltage in the kth sampling period, and be the voltage value measured by the power supply sampling circuit. The power supply voltage fluctuation amplitude in the nth sampling period is the difference between the maximum and minimum power supply voltage values within the corresponding short time window; L is the number of sampling periods contained in the preset time window, which is an integer greater than or equal to 2, and is the same as the time window length defined in step S1. Let j be the residual of the j-th sampling period, where j is the index of the sampling period within the preset time window, used to traverse each residual sample within the time window when calculating the residual mean and residual variance. is the mean residual value corresponding to the nth sampling period, and is the arithmetic mean of each residual sample within the current preset time window; The residual variance corresponding to the nth sampling period is the sum of squared deviations of each residual sample relative to the residual mean within the current preset time window, divided by... The obtained unbiased variance estimate; This is the threshold corresponding to the rate of environmental change in the drift stability threshold group, used to determine whether the rate of environmental change is within the drift stability level; This is the threshold value corresponding to the power supply voltage fluctuation amplitude in the drift stability threshold group; This is the threshold for the residual variance in the drift stabilization threshold set; This is the intermediate threshold corresponding to the rate of environmental change in the drift threshold group; This is the median threshold for the power supply voltage fluctuation amplitude in the drift threshold group; This is the median threshold of the residual variance in the drift threshold group; This is the high threshold corresponding to the rate of environmental change in the group of thresholds for severe drift; This is the high threshold value corresponding to the power supply voltage fluctuation amplitude in the severe drift threshold group; This is the high threshold of the residual variance in the group of thresholds for severe drift; Let be the drift risk level for the nth sampling period. , a discrete variable, is used to indicate whether the current state is classified as a stable drift level, a moderate drift level, or a severe drift level.
[0057] In step S2, the environmental change rate is constructed using the ratio of the on-chip temperature difference between adjacent sampling periods to the sampling period duration. The power supply fluctuation amplitude is constructed using the difference between the maximum and minimum power supply voltage values within a short time window. The mean and variance of the residuals are calculated within a preset time window. Then, the environmental change rate, power supply fluctuation, and residual variance are compared with three preset thresholds to classify the current state into three levels: stable drift, moderate drift, and severe drift. By considering three factors—ambient temperature change, power supply quality, and residual statistical characteristics—it can effectively distinguish between short-term disturbances caused by sudden temperature changes and power supply jitter, and long-term drift caused by sensor aging and calibration failure. This reduces the possibility of falsely triggering full calibration due to short-term interference, and improves the targeting and effectiveness of calibration actions.
[0058] S3: Before deploying wireless sensor nodes, measure the corresponding energy consumption and calibration error for various calibration configurations. Based on the dual objective optimization of energy and calibration error, generate a calibration strategy table indexed by power level and drift risk level, outputting calibration mode and algorithm complexity. The calibration modes include full calibration mode, micro calibration mode and delayed calibration mode, and store the calibration strategy table in the microcontroller unit.
[0059] The determination of energy consumption and calibration error for various calibration configurations includes: for each calibration configuration, controlling the wireless sensor node to perform a complete calibration process once, collecting power supply voltage and supply current during the calibration process duration, calculating the integral value of the product of power supply voltage and supply current relative to time as the energy consumption of the calibration configuration, collecting a set of sensor measurements and corresponding reference measurements during the calibration process, and calculating the average of the squares of the differences between the calibrated sensor measurements and the reference measurements as the calibration error of the calibration configuration.
[0060] The dual-objective optimization of energy and calibration error to generate a calibration strategy table includes: comparing the energy consumption and calibration error point set of all calibration configurations, eliminating cases where another calibration configuration has energy consumption less than or equal to the energy consumption of the current calibration configuration and calibration error less than the calibration error of the current calibration configuration, obtaining the optimal calibration configuration set in terms of energy consumption and calibration error, and using the optimal calibration configuration set as the candidate calibration configuration set for generating the calibration strategy table.
[0061] The calibration strategy table generated using power level and drift risk level as indexes includes: for each combination of power level and drift risk level, selecting a target calibration configuration from the optimal calibration configuration set. The target calibration configuration has a calibration error of no more than a preset error limit while meeting the upper limit of allowable energy consumption corresponding to the power level. The calibration mode and algorithm complexity corresponding to the target calibration configuration are used as the output content of the calibration strategy table under the corresponding power level index and the corresponding drift risk level index.
[0062] Specifically, there are Q candidate calibration configurations, and the configuration index is... For the qth calibration configuration, within the duration interval of a complete calibration procedure... Internal acquisition of instantaneous power supply voltage and supply current The energy consumption of this calibration configuration is defined as follows:
[0063]
[0064] Data collected during this calibration process For the sample pair of "calibrated sensor measurement value – reference measurement value", let the h-th sample pair be... The calibration error of this calibration configuration is defined as follows:
[0065]
[0066] Let the set of all calibration configuration indexes be:
[0067]
[0068] The Pareto optimal calibration configuration set for energy consumption and calibration error is defined as follows:
[0069]
[0070] Let the set of power levels be:
[0071]
[0072] The drift risk level set is as follows:
[0073]
[0074] For each power level Preset corresponding maximum allowable energy consumption For each combination of power level and drift risk level Preset the corresponding calibration error upper limit Then, in the Pareto optimal calibration configuration set... In this context, the set of candidate target calibration configurations matching power level a and drift risk level b is as follows:
[0075] .
[0076] exist The calibration configuration with the lowest energy consumption is selected as the target calibration configuration under this index:
[0077]
[0078] Configure q for each calibration. And the corresponding algorithm complexity parameters The output item of the calibration strategy table, indexed by power level a and drift risk level b, is defined as follows:
[0079]
[0080] This refers to the calibration mode and algorithm complexity output by the microcontroller under the corresponding power level index and the corresponding drift risk level index.
[0081] Where Q is the total number of candidate calibration configurations, which is an integer greater than or equal to one; q is the calibration configuration index, which is an integer ranging from 1 to Q, used to identify different calibration configurations; The duration of the complete calibration procedure corresponding to the q-th calibration configuration is a real number greater than zero, obtained experimentally or by setting; τ is the time interval... The continuous-time integral variable within is used to integrate the product of the power supply voltage and the supply current over time. Let τ be the instantaneous value of the power supply voltage at time τ during the calibration process using the q-th calibration configuration, and let τ be the voltage data measured by the voltage sampling circuit. Let τ be the instantaneous value of the supply current at the moment when the calibration process is executed using the q-th calibration configuration, and let τ be the current data measured by the current sampling circuit. The energy consumption for the qth calibration configuration is the energy metric obtained by time integration of the voltage and current product over the duration of the complete calibration process. The number of sample pairs used to evaluate calibration error when performing the calibration procedure with the q-th calibration configuration is an integer greater than or equal to one; h is the sample pair index, ranging from 1 to... Integers are used to identify different "calibrated measurement - reference measurement" sample pairs; Let h be the sensor measurement value obtained after using the qth calibration configuration and completing the calibration, and let be the physical quantity value after being output by the sensor and processed by calibration calculation. To and The corresponding reference measurement value can be obtained from a standard sensor or experimental calibration device and used as an approximation of the true value of the sample. The calibration error for the q-th calibration configuration is the arithmetic mean of the squares of the differences between the calibrated and reference measurements for all sample pairs under that configuration; Ω is the set of indices for all candidate calibration configurations, i.e. , Let q be the Pareto optimal calibration configuration set for energy consumption and calibration error, where any configuration index q in the set satisfies that no other configuration index exists. Make Less than or equal to and Less than ; Let 'a' be a set of battery levels; 'a' is the index of the battery level in the set. The value 'b' is used to identify the current battery level; 'b' is the drift risk level index in the set. The internal value is used to identify the current drift risk level. This is the upper limit of allowable energy consumption corresponding to power level a, and is a positive real number used to constrain the maximum energy consumption of the calibration configuration that is allowed to be used under this power level; The upper limit of calibration error corresponding to the combination of power level a and drift risk level b is a non-negative real number used to constrain the maximum calibration error of the calibration configuration allowed under this state combination. To obtain the Pareto optimal set under the conditions of power level a and drift risk level b. The candidate target calibration configuration set obtained from the screening process has elements q that simultaneously satisfy energy consumption. No more than And calibration error No more than , For the target calibration configuration index corresponding to power level a and drift risk level b, for the set It has the minimum energy consumption Configuration index; Configure the corresponding calibration mode identifier for the q-th calibration, with a value that is the full calibration mode identifier. Micro-calibration mode identifier Or delayed calibration mode identifier ; The algorithm complexity parameter corresponding to the q-th calibration configuration is a positive real number used to characterize the computational complexity level of the calibration algorithm under this configuration; The output items of the calibration strategy table are indexed by the power level AAA and drift risk level B, and are indexed by the target calibration configuration. Corresponding calibration mode identifier and algorithm complexity parameters It is a component used to guide the microcontroller unit in selecting specific calibration modes and algorithm complexity during node operation.
[0082] In step S3, for various calibration configurations (including different sampling numbers, algorithm iteration counts, parameter update ranges, etc.), the energy consumption of each configuration is calculated by time integration of actual measured power supply voltage and current before node deployment. The calibration error of each configuration is calculated using a set of "post-calibration measurement value – reference value" samples, forming an energy-error point set. Configurations that are not dominant in both energy consumption and error are eliminated through comparison and dominance relationships, resulting in the Pareto optimal calibration configuration set for energy-calibration error. This set is then used as a candidate set to construct a calibration strategy table indexed by power level and drift risk level. This strategy table pre-selects a target calibration configuration for each "power level – drift risk level" combination that minimizes energy consumption while meeting the upper limits of allowed energy consumption and error for that power level, and outputs the corresponding calibration mode and algorithm complexity parameters. In this way, the complex energy-accuracy trade-off optimization is moved to the offline stage. When the node is running, the microcontroller only needs to look up the policy table according to the current power level and drift risk level to obtain the near-optimal calibration policy. There is no need to solve the multi-objective optimization problem online, which greatly reduces the computational burden of the algorithm on the low-power microcontroller, while maintaining a near-optimal combination of energy utilization efficiency and calibration accuracy throughout the entire life cycle.
[0083] S4: During node operation, the microcontroller queries the calibration strategy table for the target calibration strategy based on the current power level and the current drift risk level to obtain the calibration triggering time and target calibration mode, limits the number of samples and the number of algorithm iterations used for calibration, and executes the corresponding calibration process under the condition of meeting the power level constraints to obtain updated sensor calibration parameters.
[0084] After the microcontroller finds the target calibration mode in the calibration strategy table based on the current power level and the current drift risk level, when the target calibration mode is full calibration mode, it sets the number of samples used for calibration to be greater than or equal to the first sample number threshold and the number of algorithm iterations to be greater than or equal to the first algorithm iteration number threshold. When the target calibration mode is micro calibration mode, it sets the number of samples used for calibration to be greater than or equal to the second sample number threshold and less than the first sample number threshold, and the number of algorithm iterations to be greater than or equal to the second algorithm iteration number threshold and less than the first algorithm iteration number threshold. When the target calibration mode is delayed calibration mode, it sets the number of samples used for calibration to zero and the number of algorithm iterations to zero.
[0085] The power level constraint includes the maximum allowable calibration energy consumption threshold corresponding to each power level. Before executing the corresponding calibration procedure, the microcontroller estimates the energy consumption of the current calibration procedure based on the number of samples used for calibration and the number of algorithm iterations. When the estimated energy consumption is less than or equal to the maximum allowable calibration energy consumption threshold corresponding to the current power level, the corresponding calibration procedure is executed. When the estimated energy consumption is greater than the maximum allowable calibration energy consumption threshold corresponding to the current power level, the corresponding calibration procedure is not executed.
[0086] Specifically, the current battery level is obtained through steps S1 and S2. and current drift risk level Based on the strategy table defined in step S3, define:
[0087]
[0088] in The target calibration mode is obtained by querying during the nth sampling period. This represents the corresponding algorithm complexity parameter.
[0089] Let the first sampling number threshold be... The second sampling quantity threshold is ,satisfy The threshold for the number of iterations in the first algorithm is The threshold for the number of iterations in the second algorithm is ,satisfy The number of samples used for calibration in the nth sampling period is defined as... The number of algorithm iterations is Then there is a segmentation relationship:
[0090]
[0091] The constraints are "different lower limits / zero" for the number of samples and the number of iterations corresponding to the three modes.
[0092] Let the average energy consumption per unit sample be... The average energy consumption of a single algorithm iteration is Both values were obtained through offline measurement and calibration and are positive real numbers. Therefore, the estimated energy consumption for this calibration process in the nth sampling period is:
[0093]
[0094] In step S3, for each power level The maximum allowable energy consumption has been preset. Therefore, the current battery level The corresponding maximum allowable calibration energy consumption threshold is Define execution flags. Indicate whether this calibration procedure has been performed:
[0095]
[0096] when When the corresponding calibration procedure is executed, This calibration procedure will not be performed at this time.
[0097] Let the nth The sensor calibration parameter vector stored at the end of one sampling period is Based on the current number of samples in the nth sampling period and the number of algorithm iterations The candidate update parameter vector calculated by the calibration algorithm is: Then, the actual effective sensor calibration parameter vector after the nth sampling period ends Defined as:
[0098]
[0099] When the estimated energy meets the power level constraints Select candidate update parameters; when the estimated energy exceeds the constraint, Keep the parameters from the previous cycle unchanged.
[0100] in, For the nth sampling period, based on the current power level and current drift risk level The target calibration mode identifier obtained from the calibration strategy table has a value that represents the full calibration mode identifier. Micro-calibration mode identifier Delay calibration mode identifier One of them; The algorithm complexity parameter obtained from the calibration strategy table for the nth sampling period is a positive real number used to characterize the computational complexity level of this calibration process. The first sampling number threshold is an integer greater than or equal to 1, used to limit the lower limit of the number of samples used for calibration in full calibration mode; The second sampling quantity threshold is greater than or equal to 1 and less than 1. An integer used to limit the lower limit of the number of samples used for calibration in micro-calibration mode; The threshold for the number of iterations of the first algorithm is an integer greater than or equal to 1, used to limit the lower limit of the number of algorithm iterations in the full calibration mode; The threshold for the number of iterations in the second algorithm is greater than or equal to 1 and less than 1. An integer used to limit the lower limit of the number of algorithm iterations in micro-calibration mode; The number of samples used to perform the calibration procedure in the nth sampling period, based on the target calibration mode. , Values between 0 and 0; The number of algorithm iterations used to execute the calibration process in the nth sampling period, based on the target calibration mode. , Values between 0 and 0; The average energy consumption coefficient per unit sample is a positive real number obtained through offline measurement, used to characterize the energy consumption increment caused by each additional sample value used for calibration. is the average energy consumption coefficient for a single algorithm iteration, and is a positive real number obtained through offline measurement, used to characterize the energy consumption increment brought about by each additional algorithm iteration; The estimated energy consumption for this calibration process in the nth sampling period is the product of the energy consumption per unit sample and the number of samples, plus the product of the energy consumption per iteration and the number of iterations. To match the current battery level The corresponding maximum allowable calibration energy consumption threshold is a positive real number, used to limit the maximum energy consumed in a single calibration process at this power level; This is the calibration execution flag for the nth sampling period, a binary variable taking the value 0 or 1, used when estimating energy consumption. Less than or equal to A value of 1 indicates that the corresponding calibration procedure is executed when estimating energy consumption. Greater than A value of 0 indicates that the corresponding calibration procedure is not executed. The sensor calibration parameter vector stored in non-volatile memory at the end of the (n-1)th sampling period is a multi-dimensional column vector containing bias parameters, gain parameters, and nonlinear calibration parameters. To be based on the nth sampling period Each sample value and The candidate updated sensor calibration parameter vector is calculated by the calibration algorithm in the next iteration; The sensor calibration parameter vector that actually takes effect and is written to non-volatile memory at the end of the nth sampling period, when When equal to 1, it equals ,when When equal to 0, it equals .
[0101] In step S4, based on the target calibration mode output by the strategy table, the calibration process is divided into three modes: full calibration, micro-calibration, and delayed calibration. Different sampling quantity thresholds and algorithm iteration number thresholds are set for each mode. Simultaneously, estimation parameters for unit sample processing energy and unit iteration energy are introduced. The energy consumption of this calibration is estimated based on the required sampling quantity and iteration number, and compared with the maximum allowable calibration energy consumption threshold corresponding to the current power level. The calibration process is only executed if the estimated energy consumption does not exceed the threshold. This achieves adaptive behavior: "full calibration is prioritized during high drift and high power, while micro-calibration or delayed calibration is prioritized during low drift and low power."
[0102] S5: The microcontroller writes the updated sensor calibration parameters into the non-volatile memory and updates the residual statistics for the state determination of the next sampling period, enabling the wireless sensor node to achieve adaptive calibration of the sensor output under energy-constrained conditions during long-term operation.
[0103] The sensor calibration parameters include bias parameters, gain parameters, and nonlinear calibration parameters. When the microcontroller writes the updated sensor calibration parameters to the non-volatile memory, it writes the bias parameters, gain parameters, and nonlinear calibration parameters in the form of a parameter vector, and simultaneously writes the timestamp corresponding to the current sampling period and the current power level to form a calibration record.
[0104] A circular storage area is reserved in the non-volatile memory for calibration records, which is used to store a preset number of calibration records. The preset number is an integer greater than or equal to two. When a new calibration record is written, the microcontroller overwrites the oldest calibration record in the circular storage area.
[0105] When updating the residual statistics, the microcontroller adds the residual of the current sampling period to the residual sequence in the preset time window, removes the residual corresponding to the earliest sampling period in the preset time window, calculates the new residual mean and residual variance based on the updated residual sequence, and uses the new residual mean and new residual variance as the residual statistics used for the state determination of the next sampling period.
[0106] Specifically, at the end of the nth sampling period, let the bias parameter be... The gain parameter is The nonlinear calibration parameter column vector is Then the sensor calibration parameter vector updated in this cycle can be written as:
[0107]
[0108] Let the timestamp corresponding to the nth sampling period be . The current battery level is Then, the vector of a calibration record that needs to be written to non-volatile memory in this cycle is defined as:
[0109]
[0110] Assume that the maximum number of records that can be stored in the circular storage area reserved for calibration records in the non-volatile memory is an integer. The storage slot index set is:
[0111]
[0112] Define the storage slot index corresponding to the nth sampling period as:
[0113]
[0114] Then the calibration record will be recorded in the nth sampling period. Write to non-volatile memory at index Storage slots:
[0115]
[0116] in This represents the calibration record currently stored in the p-th storage slot in the circular storage area, when p equals The time indicates the calibration record written in the nth sampling period; when hour, It will cycle from 1 to P, automatically overwriting the earliest written record.
[0117] Using the preset time window length L≥2 defined in S1 and S2, the residual of the j-th sampling period The mean residual value of the nth sampling period and residual variance To explicitly represent the process of "adding the current residual, removing the oldest residual, and updating the mean and variance," two auxiliary quantities are introduced:
[0118] Residuals and Sequences : Represents the sum of residuals within the window;
[0119] residual sum of squares sequence : Represents the sum of the squares of the residuals within the window.
[0120] Define the update relation (assuming n>L, the window is already in a stable sliding state) as follows:
[0121]
[0122] in To slide in a new residual in the current window The residual corresponding to the earliest sampling period that was removed is used to obtain the updated value. and Then, the new residual mean and residual variance are calculated as follows:
[0123]
[0124]
[0125] The bias parameter at the end of the nth sampling period is a scalar used to correct the zero-point offset of the sensor output. is the gain parameter at the end of the nth sampling period, which is a scalar used to correct the proportional coefficient of the sensor output; This is the column vector of nonlinear calibration parameters at the end of the nth sampling period. It can be a one-dimensional or multi-dimensional column vector used to describe the nonlinear compensation coefficients of the sensor output. Let be the sensor calibration parameter vector at the end of the nth sampling period, which is determined by the bias parameters. Gain parameters and nonlinear calibration parameter column vector A column vector formed by concatenating columns; The timestamp corresponding to the nth sampling period is denoted as , and the real-time time value can be obtained from the system clock. The power level for the nth sampling period is the discrete level identifier obtained in step S1 based on the power supply voltage. The calibration record vector generated for the nth sampling period is the vector of sensor calibration parameters. timestamp and battery level The column vector is formed by concatenating columns; P is the maximum number of calibration records that can be stored in the circular storage area reserved for calibration records in the non-volatile memory, which is an integer greater than or equal to 2; The set of storage slot indices for the circular storage area is a set of integers from 1 to P; The storage slot index used when writing the calibration record for the nth sampling period, whose value cycles between 1 and P; The sum of residuals corresponding to the nth sampling period is denoted as , and the algebraic sum of the residuals of each sampling period within the current preset time window is denoted as . The sum of squared residuals corresponding to the nth sampling period is the algebraic sum of the squared residuals of each sampling period within the current preset time window; The residual for the nth sampling period is the absolute value of the difference between the current sensor measurement value defined in step S1 and the average measurement value within the time window. The residual corresponding to the earliest sampling period that was removed when updating the window in the nth sampling period; Let be the mean of the residuals after the nth sampling period update, and let be the sum of the residuals. Divide by the window length L to get; Let be the residual variance after updating in the nth sampling period, and be the residual sum of squares. Subtract L times the square of the residual mean and then divide by L 1. The obtained unbiased variance estimate.
[0126] In step S5, the bias parameters, gain parameters, and nonlinear calibration parameters obtained after each calibration are written into a non-volatile memory in the form of a parameter vector. Simultaneously, the timestamp of the current sampling period and the current power level are written to form a calibration record. A circular storage method is used to retain the most recent calibration records, facilitating subsequent analysis of the calibration effect of the node under different energy states and operating conditions. Simultaneously, in each sampling period, the residual sum and residual square sum are maintained through a sliding update method, thereby updating the residual mean and residual variance. This allows these statistics to dynamically reflect the measurement state over the latest period and be used for drift risk assessment in the next period. Compared to schemes that only update parameters during a single calibration and lack historical information management, this invention organically combines calibration decision-making, parameter updates, and state assessment in a closed loop through circular storage and statistical recursive update mechanisms. This enables wireless sensor nodes to continuously adjust their calibration behavior based on the latest residual statistical results and energy status during long-term operation, enhancing the system's adaptability and long-term stability under environmental changes, sensor aging, and energy supply fluctuations.
[0127] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A wireless low-power sensor calibration method, applied to a wireless sensor node including a sensor, a wireless communication module, a power supply module, and a microcontroller unit (MCU), characterized in that, The method includes the following steps: S1: The wireless sensor node collects power supply voltage, on-chip temperature and sensor measurement values according to the sampling period, obtains the difference between the current measurement value and the average value as the residual, and divides the power supply voltage into corresponding power levels according to the preset power supply voltage threshold. S2: The microcontroller calculates the rate of environmental change and drift trend based on the temperature difference between adjacent sampling periods, the fluctuation range of the power supply voltage within a short time window, and the mean and variance of the residual within a preset time window, and classifies the current state into drift risk levels accordingly. S3: Before the wireless sensor node is deployed, the energy consumption and calibration error of various calibration configurations are measured. Based on the dual objective optimization of energy and calibration error, a calibration strategy table is generated with the power level and the drift risk level as indexes, and the output calibration mode and algorithm complexity are calculated. S4: During node operation, the microcontroller queries the target calibration strategy in the calibration strategy table based on the current power level and the current drift risk level to obtain the calibration triggering time and target calibration mode, limits the number of samples and the number of algorithm iterations used for calibration, and executes the corresponding calibration process under the condition of satisfying the power level constraint to obtain updated sensor calibration parameters. S5: The microcontroller writes the updated sensor calibration parameters into the non-volatile memory and updates the statistics of the residual for the state determination of the next sampling period.
2. The wireless low-power sensor calibration method according to claim 1, characterized in that, The process of classifying power supply voltage into power levels based on thresholds includes the following steps: based on a preset first power supply voltage threshold and a second power supply voltage threshold, the state where the power supply voltage is lower than the first power supply voltage threshold is classified as a low power level, the state where the power supply voltage is between the first power supply voltage threshold and the second power supply voltage threshold is classified as a medium power level, and the state where the power supply voltage is higher than the second power supply voltage threshold is classified as a high power level.
3. The wireless low-power sensor calibration method according to claim 1, characterized in that, The rate of environmental change is the ratio of the on-chip temperature difference between adjacent sampling periods to the duration of the sampling period. The fluctuation amplitude of the power supply voltage within a short time window is the difference between the maximum and minimum power supply voltage values within the short time window. The short time window includes a preset number of consecutive sampling periods, and the preset number is an integer greater than or equal to two.
4. The wireless low-power sensor calibration method according to claim 3, characterized in that, The classification of drift risk levels includes: The microcontroller compares the environmental change rate, the fluctuation amplitude of the power supply voltage within a short time window, the mean of the residual within a preset time window, and the variance of the residual within a preset time window with corresponding drift stability threshold groups, moderate drift threshold groups, and severe drift threshold groups, respectively. When the environmental change rate, the fluctuation amplitude of the power supply voltage within a short time window, and the variance of the residual within a preset time window are all less than each threshold in the drift stability threshold group, the current state is classified as a drift stability level. When the environmental change rate, the fluctuation amplitude of the power supply voltage within a short time window, and the variance of the residual within a preset time window are all greater than each threshold in the severe drift threshold group, the current state is classified as a severe drift level. When the current state does not meet the conditions for drift stability level and severe drift level, the current state is classified as a moderate drift level.
5. The wireless low-power sensor calibration method according to claim 1, characterized in that, The determination of energy consumption and calibration error for multiple calibration configurations includes: controlling the wireless sensor node to perform a complete calibration process once for each calibration configuration; collecting power supply voltage and supply current during the calibration process duration; calculating the integral value of the product of the power supply voltage and the supply current relative to time as the energy consumption of the calibration configuration; collecting a set of sensor measurements and a reference measurement value corresponding to the sensor measurements during the calibration process; and calculating the average of the squares of the differences between the calibrated sensor measurements and the reference measurements as the calibration error of the calibration configuration.
6. The wireless low-power sensor calibration method according to claim 5, characterized in that, The dual-objective optimization of energy and calibration error to generate a calibration strategy table includes: comparing the energy consumption and calibration error point set of all calibration configurations, eliminating cases where another calibration configuration has energy consumption less than or equal to the energy consumption of the current calibration configuration and calibration error less than the calibration error of the current calibration configuration, obtaining the optimal calibration configuration set in terms of energy consumption and calibration error, and using the optimal calibration configuration set as the candidate calibration configuration set for generating the calibration strategy table; Generating a calibration strategy table using the power level and the drift risk level as indexes includes: for each combination of power level and drift risk level, selecting a target calibration configuration from the optimal calibration configuration set, wherein the target calibration configuration has a calibration error not greater than a preset error upper limit under the condition of satisfying the upper limit of allowable energy consumption corresponding to the power level, and using the calibration mode and algorithm complexity corresponding to the target calibration configuration as the output content of the calibration strategy table under the corresponding power level index and the corresponding drift risk level index.
7. The wireless low-power sensor calibration method according to claim 1, characterized in that, The power level constraint includes the maximum allowable calibration energy consumption threshold corresponding to each power level. Before executing the corresponding calibration process, the microcontroller estimates the energy consumption of the current calibration process based on the number of samples used for calibration and the number of algorithm iterations. When the estimated energy consumption is less than or equal to the maximum allowable calibration energy consumption threshold corresponding to the current power level, the corresponding calibration process is executed. When the estimated energy consumption is greater than the maximum allowable calibration energy consumption threshold corresponding to the current power level, the corresponding calibration process is not executed.
8. The wireless low-power sensor calibration method according to claim 1, characterized in that, The sensor calibration parameters include bias parameters, gain parameters, and nonlinear calibration parameters. When the microcontroller writes the updated sensor calibration parameters to the non-volatile memory, it writes the bias parameters, gain parameters, and nonlinear calibration parameters in the form of a parameter vector, and simultaneously writes the timestamp corresponding to the current sampling period and the current power level to form a calibration record.
9. The wireless low-power sensor calibration method according to claim 8, characterized in that, When updating the statistics of the residuals, the microcontroller adds the residuals of the current sampling period to the residual sequence in the preset time window, removes the residuals corresponding to the earliest sampling period in the preset time window, calculates new residual mean and residual variance based on the updated residual sequence, and uses the new residual mean and the new residual variance as the statistics of the residuals used for the state determination of the next sampling period.