Nonlinear correction method for humidity sensor
Through the combination of polynomial fitting and Laguerre polynomial curve model, the correction parameters of the humidity sensor are dynamically adjusted, solving the problem of slow response of humidity sensors in the prior art in a variety of environments, and achieving high-precision humidity measurement.
Patent Information
- Application Number
- CN202510303647.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-06-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing humidity sensor correction methods lack dynamic parameter update mechanisms, making it difficult to respond quickly in a variable environment, resulting in continuous accumulation of errors, especially in the conditions of rapid fluctuation of temperature and humidity.
Through polynomial fitting and correction based on initial data of humidity and temperature, the humidity response parameters and temperature response parameters are extracted, and the weight update is performed. The curvature characteristics and offset characteristics are analyzed using the Laguerre polynomial curve model, the correction parameters are dynamically adjusted, and the humidity correction compensation coefficient set is generated, and the dynamic correction compensation value of the humidity measurement value is finally calculated.
It significantly improves the nonlinear correction accuracy of the humidity sensor, optimizes the real-time correction effect of the measured value, and improves the stability and accuracy of humidity measurement in complex environments.
Smart Images

Figure CN120195352A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data correction, and particularly to a method for non - linear correction of humidity sensors. Background Art
[0002] The technical field of data correction involves adjusting and optimizing the data output by various measurement devices to ensure the accuracy and reliability of the data. In many fields such as environmental monitoring, manufacturing, electronic products, and scientific research, sensors and measuring instruments are often affected by environmental factors, resulting in measurement errors. Data correction technology uses algorithms and mathematical models to identify and correct these errors, thereby improving the accuracy of the data. It includes methods such as linear correction, non - linear correction, temperature compensation, pressure compensation, etc., aiming to calibrate the device through a correction program to ensure that it can provide reliable output data under different environments.
[0003] Among them, the non - linear correction method for humidity sensors is a data correction technology for humidity sensors. Humidity sensors are widely used in fields such as environmental monitoring, meteorology, building automation, and agriculture for monitoring and controlling air humidity. However, the output of humidity sensors usually exhibits non - linear errors due to changes in environmental temperature and humidity. The non - linear correction method calibrates the readings of the sensors by applying mathematical models and algorithms to improve the accuracy of the measurement data, which can ensure that the humidity control system can operate precisely under different conditions, improving the overall efficiency and reliability.
[0004] The existing technologies often rely on fixed correction models in the correction of humidity sensors, lacking a dynamic parameter update mechanism, being slow to respond in a changing environment, and easily leading to the continuous accumulation of errors. For example, the existing correction models usually do not sufficiently correct the deviation of the initial measurement value, resulting in insufficient accuracy at the correction starting point and affecting the subsequent correction accuracy. The linear correction method is difficult to cope with humidity sensors with significant non - linear characteristics, especially when the temperature and humidity fluctuate rapidly, the error is amplified. Although some technologies use non - linear correction methods, most are based on static parameter settings, lacking strong targeted dynamic adjustment capabilities, having limited response capabilities to real - time data changes, lacking refined analysis of the non - linear relationship between humidity and temperature, and not deeply considering curvature characteristics or offset characteristics. Especially in complex measurement areas, under - compensation or over - compensation phenomena are likely to occur. Summary of the Invention
[0005] The purpose of the present invention is to solve the disadvantages existing in the prior art, and to propose a method for non - linear correction of humidity sensors.
[0006] To achieve the above - mentioned purpose, the present invention adopts the following technical solutions: A method for non - linear correction of humidity sensors, including the following steps:
[0007] S1: Based on the initial environmental humidity data and the initial environmental temperature data from the humidity sensor, perform pairwise matching, construct an initial polynomial fitting curve, and use the measurement deviation values of each set of data to correct the parameters of each curve node in the initial polynomial fitting curve, generating an initial humidity-temperature fitting parameter set;
[0008] S2: Based on the initial humidity-temperature fitting parameter set, extract the humidity response parameter and the temperature response parameter, calculate the weight ratios of the current humidity response parameter and the temperature response parameter in the curve, and update the humidity response parameter and the temperature response parameter one by one, generating a recursive humidity-temperature fitting parameter set;
[0009] S3: Based on the recursive humidity-temperature fitting parameter set, collect the humidity and temperature values in the current environmental data, call the corresponding parameter values for dynamic adjustment and recursion, and perform normalization processing on the humidity value and the temperature value, generating a normalized humidity-temperature parameter set;
[0010] S4: Based on the normalized humidity-temperature parameter set, input the humidity value and the temperature value into the Laguerre polynomial curve model, analyze the curvature characteristics and offset characteristics in the polynomial curve, conduct a differential analysis of the curvature characteristics and offset characteristics, determine the compensation parameters of the curve in the polynomial model, and construct a polynomial compensation and correction curve;
[0011] S5: Based on the polynomial compensation and correction curve, extract all the node parameters in the curve, perform a difference operation between the node parameters and the real-time measurement values of the humidity sensor, analyze the dynamic offset of the current humidity measurement value and the dynamic change trend of adjacent nodes, and verify the correction effect through the experimental curve verification link. After ensuring that the corrected curve accuracy passes the experimental curve verification, calculate the weight distribution ratio between the measurement value and adjacent nodes in the polynomial curve model, generating a humidity correction compensation coefficient set;
[0012] S6: Based on the humidity correction compensation coefficient set, perform a superposition analysis with the dynamic offset of the real-time humidity measurement value, call the optimal distribution weight value, calculate the compensation value of the humidity measurement value in the current environment, and generate a humidity dynamic correction compensation value.
[0013] As a further solution of the present invention, the humidity-temperature fitting initial parameter group includes humidity initial parameters, temperature initial parameters, and curve node parameters; the humidity-temperature recursive fitting parameter group includes humidity recursive update parameters, temperature recursive update parameters, and curve weight parameters; the normalized humidity-temperature parameter group includes normalized humidity data, normalized temperature data, and dynamic adjustment parameters; the polynomial compensation correction curve includes curve compensation node parameters, curvature characteristic parameters, and offset characteristic parameters; the humidity correction compensation coefficient set includes a real-time offset coefficient, a node distribution weight parameter, and a measurement deviation correction coefficient; the humidity dynamic correction compensation value includes a humidity compensation value, a weight distribution parameter, and a dynamic offset compensation value.
[0014] As a further solution of the present invention, based on the initial environmental humidity data and initial environmental temperature data of the humidity sensor, pairwise matching is performed to construct an initial polynomial fitting curve, and using the measurement deviation values of each group of data, the specific steps of correcting each curve node parameter in the initial polynomial fitting curve to generate the humidity-temperature fitting initial parameter group are as follows:
[0015] S101: Based on the initial data collected by the humidity sensor and the environmental temperature sensor, read and organize the humidity and temperature data, pairwise match the corresponding humidity and temperature data according to the time stamp, and screen the data pairs with complete and valid data to generate humidity-temperature data pairs;
[0016] S102: Based on the humidity-temperature data pairs, extract the corresponding value sets with temperature as the independent variable and humidity as the dependent variable, perform polynomial function fitting on each group of values in turn, calculate the initial coefficients of the fitting curve, and adjust the boundary range of the curve to generate polynomial initial model parameters;
[0017] S103: According to the polynomial initial model parameters, analyze the differences from the measurement deviation values of the humidity-temperature data pairs, correct the parameters of each curve node in turn, adjust the curve smoothness between the nodes, and update the fitting coefficients to generate the humidity-temperature fitting initial parameter group.
[0018] As a further solution of the present invention, based on the humidity-temperature fitting initial parameter group, extract the humidity response parameters and temperature response parameters, calculate the weight ratios of the current humidity response parameters and temperature response parameters in the curve, and update the humidity response parameters and temperature response parameters one by one to generate the specific steps of the humidity-temperature recursive fitting parameter group are as follows:
[0019] S201: Based on the humidity-temperature fitting initial parameter group, extract the humidity response coefficients and temperature response coefficients in each group of parameters, classify and organize the extracted humidity response coefficients and temperature response coefficients respectively, and sort them according to the curve nodes to generate a humidity-temperature response parameter set;
[0020] S202: Based on the humidity-temperature response parameter set, calculate the response weights of the humidity response parameter and the temperature response parameter point by point, perform normalization processing on each response weight, and re-associate the normalized response weights with the corresponding response parameters to generate a humidity-temperature response weight distribution result;
[0021] S203: Based on the humidity-temperature response weight distribution result, use the weight ratios of each humidity response parameter and temperature response parameter to update the original response parameters item by item, re-combine the adjusted parameters, and generate a humidity-temperature recursive fitting parameter set.
[0022] As a further solution of the present invention, the response weight is calculated according to the formula:
[0023]
[0024] Calculate the response weights of each point, where Z represents the response weight value, H r represents the humidity response parameter, indicating the sensitivity of this parameter to the change of environmental humidity, and T r represents the temperature response parameter, indicating the sensitivity of this parameter to the change of environmental temperature.
[0025] As a further solution of the present invention, based on the humidity-temperature recursive fitting parameter set, collect the humidity and temperature values in the current environmental data, call the corresponding parameter values for dynamic adjustment and recursion, and perform normalization processing on the humidity value and the temperature value. The specific steps for generating a normalized humidity-temperature parameter set are as follows:
[0026] S301: Based on the humidity-temperature recursive fitting parameter set, collect the humidity and temperature values in the current environmental data, pair and organize the humidity and temperature data according to the collection time, and perform item-by-item association matching between the organized humidity-temperature data and the recursive fitting parameter set to generate humidity-temperature dynamic matching parameters;
[0027] S302: Based on the humidity-temperature dynamic matching parameters, call the parameter values one by one to adjust the humidity value and the temperature value, calculate the offset of each humidity value and temperature value according to the node curve of the recursive match, and accumulate and correct it with the original value to generate a humidity-temperature correction data set;
[0028] S303: Based on the humidity-temperature correction data set, calculate the normalization coefficient of the current data according to the minimum and maximum values of the humidity and temperature data, and multiply each corrected humidity value and temperature value by the corresponding normalization coefficient for conversion to generate a normalized humidity-temperature parameter set.
[0029] As a further solution of the present invention, the offset is calculated according to the formula:
[0030]
[0031] Perform calculations, where Δo represents the offset value, and v t represents the target temperature value, which is derived from the data collected by the sensor in real time, and v p represents the predicted temperature value, which is obtained through historical data analysis, and v h represents the humidity value, which is also collected by the sensor. λ is the learning rate, which is used to control the adjustment step size of the offset.
[0032] As a further solution of the present invention, based on the normalized humidity-temperature parameter group, the humidity value and the temperature value are input into the Laguerre polynomial curve model, the curvature characteristics and offset characteristics in the polynomial curve are analyzed, and the difference analysis is performed on the curvature characteristics and offset characteristics to determine the compensation parameters of the curve in the polynomial model. The specific steps for constructing the polynomial compensation correction curve are as follows:
[0033] S401: Based on the normalized humidity-temperature parameter group, the humidity value and the temperature value are sequentially input into the Laguerre polynomial curve model according to the time series, and the curvature change rate at the corresponding positions of humidity and temperature in the curve model is calculated point by point, and the curvature change amount of each data point is extracted to generate a curvature characteristic set;
[0034] S402: Based on the curvature characteristic set, the offset characteristics of humidity and temperature are analyzed by using the node position difference, and the difference calculation is performed between the offset characteristics and the curvature characteristics to identify the difference parameters of the curvature and offset characteristics, and a characteristic difference parameter set is generated;
[0035] S403: Based on the characteristic difference parameter set, the compensation parameters are calculated point by point according to the difference values corresponding to the curvature characteristics and the offset characteristics, the node coefficients of the polynomial curve are adjusted by using the compensation parameters, and the curve data after adjustment are recalculated to establish a polynomial compensation correction curve.
[0036] As a further solution of the present invention, based on the polynomial compensation correction curve, all node parameters in the curve are extracted, the difference operation is performed between the node parameters and the real-time measurement value of the humidity sensor, the dynamic offset of the current humidity measurement value and the dynamic change trend of adjacent nodes are analyzed, and the weight distribution ratio between the measurement value and adjacent nodes in the polynomial curve model is calculated to generate the specific steps of the humidity correction compensation coefficient set as follows:
[0037] S501: Based on the polynomial compensation correction curve, all node parameters in the curve are extracted, and each node parameter is sorted and organized in order according to the position, and the repeated parameters between nodes are checked item by item and eliminated to generate a curve node parameter set;
[0038] S502: Based on the set of curve node parameters, call the real-time measurement values of the humidity sensor point by point, calculate the difference between each humidity measurement value and the corresponding node parameter in sequence, analyze the dynamic offset of the current humidity measurement value and the dynamic change trend of adjacent nodes, verify the correction effect through the experimental curve verification link, and store the measurement values in time series to generate a humidity dynamic offset data set;
[0039] S503: Based on the humidity dynamic offset data set, calculate the weight distribution ratio between each measurement value and adjacent nodes in the curve model in sequence, and match each weight value with the measurement value one by one to generate a humidity correction compensation coefficient set.
[0040] As a further solution of the present invention, based on the humidity correction compensation coefficient set, perform superposition analysis with the dynamic offset of the real-time humidity measurement value, call the optimal distribution weight value, and calculate the compensation value of the humidity measurement value in the current environment. The specific steps for generating the humidity dynamic correction compensation value are as follows:
[0041] S601: Based on the humidity correction compensation coefficient set, call the humidity dynamic offset data set, correspond each real-time humidity measurement value with the dynamic offset one by one, and perform superposition processing to generate a humidity superposition compensation data set;
[0042] S602: Based on the humidity superposition compensation data set, extract the corresponding distribution weight values point by point, multiply each humidity superposition compensation value by the weight value to calculate the weight correction value, map the relationship between the humidity and compensation value of each group of data, and generate a humidity weighted compensation data set;
[0043] S603: Based on the humidity weighted compensation data set, call the optimal distribution weight value of each group of data, apply the optimal weight value to dynamically adjust the current humidity measurement value, and generate a humidity dynamic correction compensation value.
[0044] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0045] In the present invention, through the pairwise matching of the initial data of humidity and temperature, a polynomial fitting initial curve is constructed and the node parameters are corrected to improve the accuracy of the initial correction result. By analyzing the curvature characteristics and offset characteristics through the Laguerre polynomial curve model, different data segments are distinguished and refined compensation adjustments are performed, significantly improving the accuracy of non-linear correction. Combining the difference operation between the curve node parameters and the real-time measurement values and the dynamic offset trend analysis, the real-time correction effect of the measurement values is optimized, and the superposition analysis of the correction compensation coefficient and the dynamic offset further improves the stability and accuracy of humidity measurement in complex environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 is a schematic diagram of the step flow of the present invention;
[0047] Figure 2 It is the flowchart of step S1 of the present invention;
[0048] Figure 3 It is the flowchart of step S2 of the present invention;
[0049] Figure 4 It is the flowchart of step S3 of the present invention;
[0050] Figure 5 It is the flowchart of step S4 of the present invention;
[0051] Figure 6 It is the flowchart of step S5 of the present invention;
[0052] Figure 7 It is the flowchart of step S6 of the present invention;
[0053] Figure 8 It is the curve graph of the third - order Laguerre polynomial of the present invention, showing the variation of the Laguerre polynomial within the range of x values from 0 to 10; Detailed implementation manners
[0054] In order to make the objectives, technical solutions and advantages of the present invention more clear and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0055] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. is based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus cannot be understood as a limitation of the present invention. In addition, in the description of the present invention, "a plurality of" means two or more unless otherwise specifically defined.
[0056] Please refer to Figure 1 , a method for non - linear correction of a humidity sensor, including the following steps:
[0057] S1: Based on the initial environmental humidity data and initial environmental temperature data of the humidity sensor, perform pairwise matching, construct an initial polynomial fitting curve, and use the measurement deviation values of each group of data to correct the parameters of each curve node in the initial polynomial fitting curve to generate an initial humidity - temperature fitting parameter group;
[0058] S2: Based on the humidity-temperature fitting initial parameter group, extract the humidity response parameter and the temperature response parameter, calculate the weight ratios of the current humidity response parameter and temperature response parameter in the curve, update the humidity response parameter and temperature response parameter one by one, and generate a humidity-temperature recursive fitting parameter group;
[0059] S3: Based on the humidity-temperature recursive fitting parameter group, collect the humidity and temperature values in the current environmental data, call the corresponding parameter values for dynamic adjustment and recursion, perform normalization processing on the humidity value and temperature value, and generate a normalized humidity-temperature parameter group;
[0060] S4: Based on the normalized humidity-temperature parameter group, input the humidity value and temperature value into the Laguerre polynomial curve model, analyze the curvature characteristics and offset characteristics in the polynomial curve, conduct a differential analysis for the curvature characteristics and offset characteristics, determine the compensation parameters of the curve in the polynomial model, and construct a polynomial compensation and correction curve;
[0061] S5: Based on the polynomial compensation and correction curve, extract all node parameters in the curve, perform a difference operation between the node parameters and the real-time measurement values of the humidity sensor, analyze the dynamic offset of the current humidity measurement value and the dynamic change trend of adjacent nodes, and verify the correction effect through the experimental curve verification link. After ensuring that the corrected curve accuracy passes the experimental curve verification, calculate the weight distribution ratio between the measurement value and adjacent nodes in the polynomial curve model, and generate a humidity correction compensation coefficient set;
[0062] S6: Based on the humidity correction compensation coefficient set, perform a superposition analysis with the dynamic offset of the real-time humidity measurement value, call the optimal distribution weight value, calculate the compensation value of the humidity measurement value in the current environment, and generate a humidity dynamic correction compensation value.
[0063] The humidity-temperature fitting initial parameter group includes humidity initial parameters, temperature initial parameters, and curve node parameters; the humidity-temperature recursive fitting parameter group includes humidity recursive update parameters, temperature recursive update parameters, and curve weight parameters; the normalized humidity-temperature parameter group includes normalized humidity data, normalized temperature data, and dynamic adjustment parameters; the polynomial compensation and correction curve includes curve compensation node parameters, curvature characteristic parameters, and offset characteristic parameters; the humidity correction compensation coefficient set includes real-time offset coefficient, node distribution weight parameters, and measurement deviation correction coefficients; the humidity dynamic correction compensation value includes humidity compensation value, weight distribution parameters, and dynamic offset compensation value.
[0064] Please refer to Figure 2 , the specific steps of S1 are:
[0065] S101: Based on the initial data collected by the humidity sensor and the ambient temperature sensor, read and organize the humidity and temperature data. Pair the corresponding humidity and temperature data according to the timestamp, and screen out the data pairs with complete and valid data to generate humidity-temperature data pairs.
[0066] Based on the initial data collected by the humidity sensor and the ambient temperature sensor, initially read and organize the collected humidity and temperature data. First, pair them according to the timestamp to ensure the time consistency of each data pair. Then, screen out the data pairs with complete and valid data, that is, eliminate those data pairs with missing values or outliers to ensure the quality and reliability of the data. Generate a paired dataset of humidity and temperature based on the valid data pairs. This dataset will serve as the basis for subsequent processing and analysis. The generation of humidity-temperature data pairs provides the necessary basic data structure for subsequent analysis, ensuring the accuracy of data processing and the efficiency of implementation.
[0067] S102: Based on the humidity-temperature data pairs, extract the corresponding value sets with temperature as the independent variable and humidity as the dependent variable. Fit each set of values with a polynomial function in turn, calculate the initial coefficients of the fitting curve, and adjust the boundary range of the curve to generate the initial polynomial model parameters.
[0068] Based on the data pairs of humidity and temperature, construct a data model with temperature as the independent variable and humidity as the dependent variable. Fit each data pair with a polynomial function, including calculating the best-fitting polynomial for each data pair and obtaining the initial coefficients. These coefficients initially describe the relationship between humidity and temperature. Next, adjust the boundary range of each fitting curve to control the fitness and prediction accuracy of the model, and generate the initial model parameters of the polynomial, providing a basis for further data analysis and model optimization.
[0069] S103: According to the initial polynomial model parameters, analyze the differences from the measurement deviation values of the humidity-temperature data pairs, correct the parameters of each curve node in turn, adjust the curve smoothness between nodes, update the fitting coefficients, and generate the initial humidity-temperature fitting parameter group.
[0070] Utilize the initial polynomial model parameters to conduct a detailed deviation analysis on each group of humidity and temperature data pairs. Correct each data point through the deviation between the measured data and the model prediction value, which involves adjusting the parameters of each curve node to optimize the overall smoothness and fitting accuracy of the curve. The updated fitting coefficients can better reflect the changing trend of the actual data. The generated initial humidity-temperature fitting parameter group provides the adjusted accurate parameters for the final application of the model, ensuring the effectiveness and reliability of the model.
[0071] Please refer to Figure 3 , the specific steps of S2 are as follows:
[0072] S201: Based on the initial humidity-temperature fitting parameter group, extract the humidity response coefficient and the temperature response coefficient from each group of parameters, separately classify and organize the extracted humidity response coefficient and temperature response coefficient, and sort them according to the curve nodes to generate a humidity-temperature response parameter set;
[0073] Based on the initial humidity-temperature fitting parameter group, by collecting and processing the original data of humidity and temperature responses, first obtain a series of humidity and temperature response points. Each response point contains a humidity value and the corresponding parameter value, as well as a temperature value and the corresponding parameter value. In the process of extracting the humidity response coefficient and the temperature response coefficient, by analyzing the humidity and temperature data points, gradually screen out the response points in the data that have an obvious relationship with the changes in humidity and temperature, and construct a response curve based on these points. Record the humidity response coefficient and the temperature response coefficient at each curve node respectively. By rearranging the data in a certain order, ensure that the nodes of the curve are evenly distributed according to the laws of humidity and temperature changes. At the same time, eliminate or adjust the possible abnormal points or nodes deviating from the normal values in the data to ensure the accuracy and integrity of the generated response parameter set, and finally form a humidity and temperature response parameter set.
[0074] S202: Based on the humidity-temperature response parameter set, calculate the response weights of the humidity response parameters and the temperature response parameters point by point, and perform normalization processing on each response weight. Reassociate the normalized response weights with the corresponding response parameters to generate a humidity-temperature response weight distribution result;
[0075] The response weight is calculated according to the formula:
[0076]
[0077] Calculate the response weight of each point. Among them, Z represents the response weight value, H r represents the humidity response parameter, indicating the sensitivity of this parameter to the change of environmental humidity, and T r represents the temperature response parameter, indicating the sensitivity of this parameter to the change of environmental temperature.
[0078] If the humidity value collected at a specific time point at a certain environmental monitoring point is 70%, after conversion and standardization, the humidity response parameter H r = 0.7; the temperature value at the same time point is 20 °C, and the standardized temperature response parameter T r = 0.2.
[0079] Substitute specific values into the formula for calculation:
[0080]
[0081] The results show that in the specific environmental points monitored, the comprehensive response weight of humidity and temperature is 0.192, which characterizes the sensitivity and importance of these two parameters to environmental changes under these environmental conditions.
[0082] S203: Based on the results of the humidity-temperature response weight distribution, use the weight ratios of each humidity response parameter and temperature response parameter to update the original response parameters item by item, recombine the adjusted parameters, and generate a humidity-temperature recursive fitting parameter group;
[0083] Based on the results of the humidity-temperature response weight distribution, apply the weight ratios of the humidity response parameters and temperature response parameters to the adjustment process of the original parameters. By analyzing the specific weights of each parameter item by item, according to the relationship between the weights of the humidity response parameters and temperature response parameters and the original parameters, calculate the weighted values of the humidity and temperature parameter values according to the proportion of the weights. Each adjustment combines the parameter change trends of the upper and lower adjacent nodes, calculates new parameter values to replace the original values, and after adjustment, recheck the node data of humidity and temperature. Further, use the interpolation calculation method to interpolate and correct the missing points and abnormal points to ensure that the adjusted data distribution maintains continuity and rationality. After all nodes are adjusted, recombine the adjusted humidity and temperature response parameters, and gradually optimize these parameters using linear and polynomial fitting to form a new humidity-temperature recursive fitting parameter group, laying a foundation for subsequent humidity-temperature response analysis.
[0084] Please refer to Figure 4 , the specific steps of S3 are as follows:
[0085] S301: Based on the humidity-temperature recursive fitting parameter group, collect the humidity and temperature values in the current environmental data, pair and sort the humidity and temperature data according to the collection time, and perform item-by-item correlation matching between the sorted humidity-temperature data and the recursive fitting parameter group to generate humidity-temperature dynamic matching parameters;
[0086] Based on the humidity-temperature recursive fitting parameter group, continuously monitor the humidity value and temperature value in the current environment, record the collected humidity and temperature data according to the time axis, sort the humidity value and temperature value of each sampling point one by one, and at the same time eliminate possible duplicate sampling or data anomalies in the records. Classify the sorted humidity and temperature values into two sets according to the time sequence. Use the distribution parameters of each node in the recursive fitting parameter group to match the collection points of the humidity and temperature data, associate each group of collected humidity-temperature data points with the nodes of the recursive fitting parameters respectively, compare the change amplitudes of adjacent data points and the difference relationships in the fitting parameter group, and generate humidity-temperature dynamic matching parameters in sequence for subsequent data correction and calculation.
[0087] S302: Based on the humidity-temperature dynamic matching parameters, call the parameter values one by one to adjust the humidity value and the temperature value. Calculate the offset of each humidity value and temperature value according to the recursive matching node curve, and accumulate and correct it with the original value to generate a humidity-temperature correction data set;
[0088] The offset is calculated according to the formula:
[0089]
[0090] where Δo represents the offset value, v t represents the target temperature value, which is sourced from the data collected by the sensor in real time, and v p represents the predicted temperature value, which is obtained through historical data analysis, and v h represents the humidity value, which is also collected by the sensor. λ is the learning rate, which is used to control the adjustment step of the offset.
[0091] v t (The target temperature value) is directly collected by the ambient temperature sensor at a specific moment. Assume that the temperature collected at a certain moment is 25°C;
[0092] v p (The predicted temperature value) is predicted through time series analysis based on past data. For example, the predicted temperature value is 23°C;
[0093] v h (The humidity value) is also collected by the humidity sensor at the same moment. Assume it is 60%, which is converted to the numerical value 0.6;
[0094] λ (the learning rate) is dynamically adjusted according to the effect of the previous adjustment. Generally, the value range is from 0.01 to 0.1. Assume it is 0.05.
[0095] Calculate v t -v p :
[0096] v t -v p = 25 - 23 = 2
[0097] Calculate |v h -v t |:
[0098] |v h -v t | = |0.6 - 25| = 24.4
[0099] Calculate the denominator:
[0100]
[0101] Substitute into the main formula:
[0102]
[0103] The results show that for the current environmental conditions, the offset between humidity and temperature is 0.1, which means that the predicted temperature value needs to be fine-tuned by increasing 0.1 °C to more accurately match the actual environmental state.
[0104] S303: Based on the humidity-temperature correction data set, calculate the normalization coefficient of the current data according to the minimum and maximum values of the humidity and temperature data, and sequentially multiply each corrected humidity value and temperature value by the corresponding normalization coefficient for conversion to generate a normalized humidity-temperature parameter group;
[0105] Based on the humidity-temperature correction data set, the corrected humidity values and temperature values are segmented. Interval division is performed according to the maximum and minimum values in the data, and the normalization coefficient of each humidity and temperature value is calculated. The normalization coefficient calculation uses a fixed formula. When normalizing the humidity, the denominator is the difference between the maximum humidity value and the minimum humidity value, and the numerator is the current humidity value minus the minimum humidity value. The calculation formula is the ratio of the current humidity value to the humidity interval. Similarly, the same processing method is used for normalizing the temperature value. Through the normalized data, a standardized parameter set for all humidity and temperature points is obtained, and each parameter value is sequentially organized into the corresponding normalized humidity-temperature parameter group.
[0106] Please refer to Figure 5 and Figure 8 , the specific steps of S4 are as follows:
[0107] S401: Based on the normalized humidity-temperature parameter group, input the humidity value and temperature value into the Laguerre polynomial curve model in sequence according to the time series, calculate the curvature change rate at the corresponding positions of humidity and temperature in the curve model point by point, extract the curvature change amount of each data point, and generate a curvature characteristic set;
[0108] When x ∈ [0, ∞], the Laguerre polynomial is defined as:
[0109] L n (x) = (2n - 1 - x)L n-1 (x) - (n - 1) 2 L n-2 (x), (n = 2, 3,...)(1)
[0110] where L0(x) = 1, L1(x) = 1 - x.
[0111] Taking the humidity measurement value (x k ), the environmental temperature value (t k)As the input of the non - linear correction model, taking the humidity standard value as the fitting sample data and the humidity estimated value (y) as the output of the non - linear correction model, the non - linear correction model based on Laguerre polynomial curve fitting is expressed as:
[0112]
[0113] In the formula: a j and b j are the model parameters of the fitting curve. For the convenience of analysis, let:
[0114] W = [a0, a1, … a n , b0, b1, … b m T
[0115] A(k, :) = [1, L1(x k ), …, L n (x k ), 1, L1(t k ), …, L m (t k )]
[0116] Then equation (2) can be rewritten as:
[0117] y(x k , t k ) = A(k, :)W(3)
[0118] According to equation (3), the measurement data is fitted to obtain the optimal fitting model parameters. Let the non - linear compensation error of temperature and humidity be:
[0119] e(k) = y dk - A(k, :)W(4)
[0120] In the formula: y dk represents the k - th humidity calibration value.
[0121] The performance index is:
[0122]
[0123] To minimize the performance index J, the recursive least - squares method is used to determine the model parameter vector W. The specific algorithm description is as follows:
[0124]
[0125] W k+1 = W k +Q k e(k)(7)
[0126]
[0127] In the formula, the initial covariance matrix P 0 = αI ∈ R (n+m+2)×(n+m+2) . λ is the forgetting factor, usually taken as 0.96 ≤ λ ≤ 1. When λ = 1, this recursive formula becomes the basic recursive least squares algorithm.
[0128] After iterative training of the sample data according to Equations (4) to (8), a set of optimal polynomial model parameters can be obtained, so that the Laguerre polynomial model shown in Equation (2) approximates the value y of the humidity sensor at the calibration point dk .
[0129] S402: Based on the curvature characteristic set, analyze the offset characteristics of humidity and temperature using the node position difference, calculate the difference between the offset characteristics and the curvature characteristics, identify the difference parameters of the curvature and offset characteristics, and generate a characteristic difference parameter set;
[0130] Based on the curvature characteristic set, analyze the offset characteristics of humidity and temperature using the node position difference. When extracting the offset characteristics of humidity and temperature, by comparing the difference between the curvature characteristics of each node and the position on the time axis, calculate the change amount existing in the offset characteristics of humidity and temperature point by point, quantify the offset amount of each data point in the way of absolute difference, match the curvature characteristics and the offset characteristics after calculating the offset characteristics, calculate the difference parameters through the absolute difference of the node positions, compare the curvature characteristic values and the offset characteristic values according to the node time, and each item of the difference parameters comes from the absolute difference values of the humidity and temperature nodes, and then generate a characteristic difference parameter set.
[0131] S403: Based on the characteristic difference parameter set, calculate the compensation parameters point by point according to the difference values corresponding to the curvature characteristics and the offset characteristics, adjust the node coefficients of the polynomial curve using the compensation parameters, and recalculate the curve data after adjustment to establish a polynomial compensation correction curve;
[0132] Based on the characteristic difference parameter set, use each difference value as the input basis for calculating the compensation parameters. When calculating the compensation parameters point by point, adjust the node coefficients of the polynomial curve according to the magnitude of the difference parameters, correct the parameter values of each node in a step-by-step increasing or decreasing manner, convert the difference value into a compensation amount and add it to the original node value, and reconstruct the polynomial curve through the adjusted node coefficients. During the correction process, the adjustment amount of each node changes successively according to the magnitude of the difference value, check the accumulated value of the compensation parameters and the curve node positions one by one to ensure the continuity of the curve at all adjustment points, and finally form an adjusted polynomial compensation correction curve to provide a dynamically corrected result for subsequent applications.
[0133] Please refer to Figure 6, the specific steps of S5 are as follows:
[0134] S501: Based on the polynomial compensation correction curve, extract all node parameters in the curve, sort and organize each node parameter in order of position, check the duplicate parameters between nodes item by item and eliminate them, and generate a curve node parameter set;
[0135] Based on the polynomial compensation correction curve, extract the parameter values and position information of all nodes from the curve. Scan each node one by one by reading the curve data, mark the parameter values of each node and record its index position in the curve at the same time, and store this node information as a complete node list. Then sort the list according to the node positions, and ensure the correctness of the sorting result by comparing the position information of adjacent nodes. Check each sorted node for duplicate parameters one by one. The specific operation is to compare the parameter values of adjacent nodes. If the parameter values of the two nodes are equal, mark one of the nodes as a duplicate item and eliminate it from the list. For the list after eliminating duplicate nodes, if a large parameter value interval is found between adjacent nodes, according to the change trend of the curve, use the method of linear interpolation to add new interpolation points between the two nodes to fill the gap. The parameter value of each interpolation point is obtained by proportional calculation based on the values of the two adjacent nodes at both ends. Finally, the sorted node parameter set should be a complete set without duplicates and arranged in order in the curve, providing a stable data basis for subsequent humidity measurement data processing and matching.
[0136] S502: Based on the curve node parameter set, call the real-time measurement values of the humidity sensor point by point, calculate the difference between each humidity measurement value and the corresponding node parameter in turn, analyze the dynamic offset of the current humidity measurement value and the dynamic change trend of adjacent nodes, and verify the correction effect through the test curve verification link, and store the measurement values in time series to generate a humidity dynamic offset data set;
[0137] Based on the set of curve node parameters, ambient humidity data is collected in real time from a humidity sensor, and continuous sampling is performed at fixed time intervals. The humidity measurement value of each sampling is recorded in a data table together with its acquisition timestamp, forming a time-series humidity dataset. After the humidity data acquisition is completed, the humidity measurement value at each time point is matched with the curve node parameters. By comparing the order relationship between the timestamp of the measurement value and the curve node index, each measurement value is associated with the node parameters one by one, and the numerical difference between the measurement value and the corresponding curve node parameters is calculated. During the difference calculation process, the integrity of the data is checked at the same time, and abnormal points in the time series are removed. For example, data with humidity values outside the normal range or with a large gap from adjacent measurement values is removed from the dataset. After removing the abnormal points, the dynamic offset of the current humidity measurement value and the dynamic change trend of adjacent nodes are analyzed, and the correction effect of the verification link of the test curve is verified. Then, the remaining valid data is rearranged in chronological order, and the humidity measurement value at each time point and its difference from the node parameters are stored in the humidity dynamic offset dataset, providing basic support for further processing of analyzing the humidity change and offset relationship in the future.
[0138] S503: Based on the humidity dynamic offset dataset, calculate the weight distribution ratio between each measurement value and adjacent nodes in the curve model in sequence, and match each weight value with the measurement value one by one to generate a humidity correction compensation coefficient set;
[0139] Based on the humidity dynamic offset dataset, extract each humidity measurement value in the dataset and its corresponding relationship with adjacent nodes in the curve item by item. For each humidity measurement value, first determine its adjacent nodes before and after on the curve, extract the parameter values and position index information of the adjacent nodes, and calculate the distance between the humidity measurement value and the adjacent nodes before and after. By proportionally allocating the front and back distances, calculate the weight distribution of the humidity measurement value relative to the two nodes. The specific operation is to use the distance between the measurement value and the previous node as the numerator, and the total distance (the sum of the distances between the front and back nodes) as the denominator to calculate the weight ratio of the humidity measurement value close to the previous node. Calculate the weight ratio close to the latter node in the same way. The calculation result of each weight ratio is associated with the current humidity measurement value and stored as a set of records, including information such as the measurement value, the parameters of the front and back nodes, the weight ratio, and the timestamp. After calculating the weight distribution of all humidity measurement values, the generated weight values and the corresponding measurement values are sorted in chronological order to form a humidity correction compensation coefficient set, providing basic data for subsequent correction of humidity values and curve optimization processing.
[0140] Please refer to Figure 7 , the specific steps of S6 are as follows:
[0141] S601: Based on the humidity correction compensation coefficient set, the humidity dynamic offset data set is called, each real-time humidity measurement value is matched with the dynamic offset one by one, and a superposition process is performed to generate a humidity superposition compensation data set;
[0142] Based on the humidity correction compensation coefficient set, the humidity dynamic offset data set is called, and each real-time humidity measurement value and its corresponding offset in the dynamic offset data set are read one by one. The corresponding relationship between the two is determined by timestamp matching, and the humidity measurement value and the offset are superimposed and calculated. In the specific operation, the original value of each sampling point is first obtained from the humidity measurement value, and the offset corresponding to the sampling point in the dynamic offset data set is extracted. The values of the two are added to obtain the humidity superposition compensation value. For each step of the superposition calculation, the integrity and accuracy of the data are checked to ensure that all humidity measurement values have corresponding offsets, and abnormal data points are eliminated, such as records with missing data or values deviating from the normal range. After the superposition calculation is completed, each superposition compensation value is stored in the humidity superposition compensation data set in chronological order to provide complete input data for subsequent correction calculations based on weight distribution.
[0143] S602: Based on the humidity superposition compensation data set, extract the corresponding distribution weight value point by point, multiply each group of humidity superposition compensation value and weight value to calculate the weight correction value, map the relationship between humidity and compensation value of each group of data, and generate a humidity weighted compensation data set;
[0144] Based on the humidity superposition compensation data set, each compensation value and the corresponding weight distribution value are extracted point by point, and the two are matched one by one according to the time series. By multiplying each group of humidity superposition compensation values with their corresponding weight values, the weight correction result of the humidity compensation value is calculated. During the calculation process, each humidity superposition compensation value and the weight value of its distribution before and after are extracted, the weight ratio of the current compensation value is determined, and the compensation value is directly multiplied by the weight ratio to obtain the correction value. After the correction value calculation of all humidity superposition compensation data is completed, the distribution of the correction value is checked, and the correction value is associated with the timestamp and the corresponding humidity measurement value and stored in the humidity weighted compensation data set. The humidity weighted compensation data set finally generated retains the correspondence between the humidity compensation value and the weight correction value in each group of data, providing support for subsequent dynamic adjustments.
[0145] S603: Based on the humidity weighted compensation data set, call the optimal distribution weight value of each group of data, apply the optimal weight value to dynamically adjust the current humidity measurement value, and generate a humidity dynamic correction compensation value;
[0146] Based on the humidity weighted compensation dataset, the optimal distribution weight value of each group of data is extracted, and the calibration process is achieved by dynamically adjusting each humidity measurement value. In the specific operation, the weight distribution of each group of humidity compensation values is read from the humidity weighted compensation dataset, and the optimal weight value in the current group is selected. This weight value is determined by the deviation relationship between the previous and subsequent humidity measurement values and the compensation values. The optimal weight value is applied to the current humidity measurement value for adjustment, and the calibration process is achieved by superimposing the dynamic compensation value and the weight value. The adjusted humidity measurement values are stored in chronological order to generate a humidity dynamic calibration compensation value dataset. At the same time, the consistency of the calibration values is checked to ensure that the calibrated humidity data reflects the accurate trend of dynamic changes, providing data support for the output of the final humidity measurement result.
[0147] The above is only a preferred embodiment of the present invention, and it is not intended to limit the present invention in other forms. Any person skilled in the art may use the disclosed technical content to make changes or modifications into equivalent embodiments with equivalent changes and apply them to other fields. However, as long as it does not depart from the technical solution content of the present invention, any simple modification, equivalent change, and modification made to the above embodiments based on the technical essence of the present invention still fall within the protection scope of the technical solution of the present invention.
Claims
1. A nonlinear correction method for a humidity sensor, characterized in that: The following steps are involved: S1: Based on the initial data of ambient humidity and initial data of ambient temperature from the humidity sensor, pairwise matching is performed to construct a polynomial fitting initial curve, and the measurement deviation value of each set of data is used to correct the parameters of each curve node in the polynomial fitting initial curve to generate a humidity and temperature fitting initial parameter group; S2: Based on the humidity-temperature fitting initial parameter group, extract the humidity response parameter and the temperature response parameter, calculate the weight proportion of the current humidity response parameter and the temperature response parameter in the curve, update the humidity response parameter and the temperature response parameter one by one, and generate a humidity-temperature recursive fitting parameter group; S3: Based on the humidity and temperature recursive fitting parameter group, the humidity and temperature values in the current environmental data are collected, the corresponding parameter values are called for dynamic adjustment recursion, the humidity and temperature values are normalized, and a normalized humidity and temperature parameter group is generated; S4: Based on the normalized humidity and temperature parameter group, the humidity value and the temperature value are input into the Laguerre polynomial curve model, the curvature characteristics and the offset characteristics in the polynomial curve are analyzed, the difference analysis is performed on the curvature characteristics and the offset characteristics, the compensation parameters of the curve in the polynomial model are determined, and the polynomial compensation correction curve is constructed; S5: Based on the polynomial compensation correction curve, all node parameters in the curve are extracted, and the node parameters are differenced with the real-time measurement value of the humidity sensor, and the dynamic offset of the current humidity measurement value and the dynamic change trend of the adjacent nodes are analyzed, and the correction effect of the link is verified through the test curve to ensure the accuracy of the corrected curve. After the test curve is verified, the weight distribution ratio between the measured value and the adjacent nodes in the polynomial curve model is calculated to generate a humidity correction compensation coefficient set; S6: Based on the humidity correction compensation coefficient set, a superposition analysis is performed with the dynamic offset of the real-time humidity measurement value, the optimal distribution weight value is called, the compensation value of the humidity measurement value in the current environment is calculated, and the humidity dynamic correction compensation value is generated.
2. The nonlinear correction method for humidity sensor according to claim 1, characterized in that: The humidity and temperature fitting initial parameter group includes humidity initial parameters, temperature initial parameters and curve node parameters; the humidity and temperature recursive fitting parameter group includes humidity recursive update parameters, temperature recursive update parameters and curve weight parameters; the normalized humidity and temperature parameter group includes normalized humidity data, normalized temperature data and dynamic adjustment parameters; the polynomial compensation correction curve includes curve compensation node parameters, curvature characteristic parameters and offset characteristic parameters; the humidity correction compensation coefficient set includes real-time offset coefficient, node distribution weight parameter and measurement deviation correction coefficient; the humidity dynamic correction compensation value includes humidity compensation value, weight distribution parameter and dynamic offset compensation value.
3. The nonlinear correction method for humidity sensor according to claim 1, characterized in that: Based on the initial ambient humidity data and the initial ambient temperature data of the humidity sensor, pairwise matching is performed to construct the initial polynomial fitting curve. The measurement deviation value of each set of data is used to correct the parameters of each curve node in the initial polynomial fitting curve. The specific steps to generate the initial parameter group of humidity and temperature fitting are as follows: S101: Based on the initial data collected by the humidity sensor and the ambient temperature sensor, the humidity and temperature data are read and sorted, the corresponding humidity and temperature data are matched in pairs according to the timestamp, and the data pairs with complete and valid data are selected to generate humidity and temperature data pairs; S102: based on the humidity-temperature data pair, extract a corresponding value set of temperature as an independent variable and humidity as a dependent variable, perform polynomial function fitting on each set of values in turn, calculate the initial coefficients of the fitting curve, and adjust the boundary range of the curve to generate polynomial initial model parameters; S103: Analyze the difference in the measured deviation value of the humidity and temperature data pair according to the polynomial initial model parameters, correct the parameters of each curve node in turn, adjust the curve smoothness between nodes, update the fitting coefficient, and generate a humidity and temperature fitting initial parameter group.
4. The nonlinear correction method for humidity sensor according to claim 1, characterized in that: Based on the humidity-temperature fitting initial parameter group, the humidity response parameters and the temperature response parameters are extracted, the weight proportions of the current humidity response parameters and the temperature response parameters in the curve are calculated, and the humidity response parameters and the temperature response parameters are updated one by one to generate the humidity-temperature recursive fitting parameter group. The specific steps are as follows: S201: extracting the humidity response coefficient and the temperature response coefficient in each parameter group based on the humidity and temperature fitting initial parameter group, classifying and sorting the extracted humidity response coefficients and temperature response coefficients respectively, and sorting them according to the curve nodes to generate a humidity and temperature response parameter set; S202: Based on the humidity-temperature response parameter set, the response weights of the humidity response parameter and the temperature response parameter are calculated point by point, and each response weight is normalized, and the normalized response weight is re-associated with the corresponding response parameter to generate a humidity-temperature response weight distribution result; S203: Based on the humidity-temperature response weight distribution result, the original response parameters are updated item by item using the weight ratio of each humidity response parameter to the temperature response parameter, and the adjusted parameters are recombined to generate a humidity-temperature recursive fitting parameter group.
5. The nonlinear correction method for humidity sensor according to claim 4, characterized in that: The response weight is according to the formula: Calculate the response weight of each point, where Z represents the response weight value, H r Represents the humidity response parameter, T r Represents the temperature response parameter.
6. The nonlinear correction method for humidity sensor according to claim 1, characterized in that: Based on the humidity and temperature recursive fitting parameter group, the humidity and temperature values in the current environmental data are collected, the corresponding parameter values are called for dynamic adjustment recursion, and the humidity and temperature values are normalized to generate the normalized humidity and temperature parameter group. The specific steps are as follows: S301: Based on the humidity and temperature recursive fitting parameter group, the humidity and temperature values in the current environment data are collected, the humidity and temperature data are paired and sorted according to the collection time, and the sorted humidity and temperature data are associated and matched with the recursive fitting parameter group item by item to generate humidity and temperature dynamic matching parameters; S302: Based on the humidity and temperature dynamic matching parameters, adjust the humidity and temperature values one by one by calling the parameter values, calculate the offset of each humidity and temperature value according to the recursive matching node curve, and perform cumulative correction with the original value to generate a humidity and temperature correction data set; S303: Based on the humidity and temperature correction data set, the normalization coefficient of the current data is calculated according to the minimum and maximum values of the humidity and temperature data, and each corrected humidity value and temperature value is converted by multiplying the corresponding normalization coefficient in turn to generate a normalized humidity and temperature parameter group.
7. The nonlinear correction method for a humidity sensor according to claim 6, characterized in that: The offset is according to the formula: Calculate, where Δo represents the offset value, v t Represents the target temperature value, v p Represents the predicted temperature value, v h represents the humidity value, and λ is the learning rate.
8. The nonlinear correction method for humidity sensor according to claim 1, characterized in that: Based on the normalized humidity and temperature parameter group, the humidity value and the temperature value are input into the Laguerre polynomial curve model, the curvature characteristics and the offset characteristics in the polynomial curve are analyzed, the difference analysis is performed on the curvature characteristics and the offset characteristics, and the compensation parameters of the curve in the polynomial model are determined. The specific steps of constructing the polynomial compensation correction curve are as follows: S401: Based on the normalized humidity and temperature parameter group, the humidity values and the temperature values are sequentially input into the Laguerre polynomial curve model in time series, the curvature change rate of the corresponding positions of the humidity and the temperature in the curve model is calculated point by point, the curvature change amount of each data point is extracted, and a curvature characteristic set is generated; S402: Based on the curvature characteristic set, using node position difference to analyze the offset characteristics of humidity and temperature, and performing difference calculation between the offset characteristic and the curvature characteristic, identifying difference parameters of the curvature and offset characteristics, and generating a characteristic difference parameter set; S403: Based on the characteristic difference parameter set, the compensation parameters are calculated point by point according to the difference values corresponding to the curvature characteristic and the offset characteristic, the node coefficients of the polynomial curve are adjusted using the compensation parameters, and the adjusted curve data is recalculated to establish a polynomial compensation correction curve.
9. The nonlinear correction method for humidity sensor according to claim 1, characterized in that: Based on the polynomial compensation correction curve, all node parameters in the curve are extracted, the node parameters are differenced with the real-time measurement value of the humidity sensor, the dynamic offset of the current humidity measurement value and the dynamic change trend of the adjacent nodes are analyzed, and the weight distribution ratio between the measurement value and the adjacent nodes in the polynomial curve model is calculated. The specific steps of generating the humidity correction compensation coefficient set are as follows: S501: Based on the polynomial compensation correction curve, extract all node parameters in the curve, sort each node parameter in order of position, check and remove repeated parameters between nodes one by one, and generate a curve node parameter set; S502: Based on the curve node parameter set, the real-time measurement value of the humidity sensor is called point by point, the difference between each humidity measurement value and the corresponding node parameter is calculated in turn, the dynamic offset of the current humidity measurement value and the dynamic change trend of the adjacent nodes are analyzed, and the correction effect of the link is verified through the test curve, and the measurement value is stored in time series to generate a humidity dynamic offset data set; S503: Based on the humidity dynamic offset data set, the weight distribution ratio between each measurement value and the adjacent nodes in the curve model is calculated in sequence, and each weight value is matched with the measurement value one by one to generate a humidity correction compensation coefficient set.
10. The nonlinear correction method for humidity sensor according to claim 1, characterized in that: Based on the humidity correction compensation coefficient set, the dynamic offset of the real-time humidity measurement value is superimposed and analyzed, the optimal distribution weight value is called, and the compensation value of the humidity measurement value in the current environment is calculated. The specific steps of generating the humidity dynamic correction compensation value are as follows: S601: Based on the humidity correction compensation coefficient set, call the humidity dynamic offset data set, correspond each real-time humidity measurement value to the dynamic offset one by one, and perform superposition processing to generate a humidity superposition compensation data set; S602: Based on the humidity superposition compensation data set, extract the corresponding distribution weight value point by point, multiply each group of humidity superposition compensation value and weight value to calculate the weight correction value, map the relationship between humidity and compensation value of each group of data, and generate a humidity weighted compensation data set; S603: Based on the humidity weighted compensation data set, call the optimal distribution weight value of each group of data, apply the optimal weight value to dynamically adjust the current humidity measurement value, and generate a humidity dynamic correction compensation value.
Citation Information
Cited By
Measurement system based on Ethernet-APL
CN120947840A
Intelligent portable terminal device with temperature and humidity detection function
CN121051593A
Curve synchronous adjustment method
CN121256751A