Temperature sensor correction method and device, electronic equipment and storage medium
By constructing a temperature response model and relational function, the temperature sensor is dynamically calibrated, solving the problems of long calibration time and errors caused by sensor aging in traditional methods. This enables intelligent and real-time calibration of the temperature sensor, improving measurement accuracy and production efficiency.
Patent Information
- Application Number
- CN202511490800.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-17
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-10-17
AI Technical Summary
Existing temperature sensor calibration methods are time-consuming and require factory recalibration, resulting in low production efficiency. Furthermore, sensor aging leads to a gradual increase in nonlinear errors, affecting measurement accuracy.
By acquiring the temperature difference values of the temperature sensor over multiple preset time periods, a temperature response model is constructed, a relationship function is fitted, and the target temperature difference value is dynamically acquired, thereby realizing the intelligent and real-time correction of the temperature sensor.
It avoids the inconvenience of traditional factory calibration, reduces errors caused by temperature fluctuations, reduces calibration time and cost, and improves measurement accuracy and efficiency.
Smart Images

Figure CN120970853A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of temperature sensor calibration, and in particular to a temperature sensor calibration method and device, an electronic device and a storage medium. BACKGROUND
[0002] In food processing monitoring, the accuracy of temperature sensors is crucial to product quality and safety. However, existing temperature sensor calibration methods face many technical challenges. First, the traditional calibration process requires the sensor to be returned to the manufacturer for correction, which not only takes a long time, usually several days, but also causes the equipment to be continuously shut down, affecting production efficiency and operational safety. Second, the aging of temperature sensors causes their non-linear errors to gradually increase, and over time, linear analysis cannot guarantee measurement accuracy over a wide range of preset temperatures. SUMMARY
[0003] Therefore, it is necessary to propose a temperature sensor calibration method, device, electronic device and storage medium to address the existing temperature sensor calibration problem.
[0004] A temperature sensor calibration method, the method comprising: obtaining temperature difference values of a specified temperature sensor in a plurality of preset temperature ranges over a plurality of preset time periods to obtain a temperature difference value set corresponding to each preset temperature range; wherein the temperature difference value is the difference between the temperature value measured by the specified temperature sensor and the actual temperature value; calculating the change value of the temperature difference values of the adjacent two preset time periods in the temperature difference value set to obtain a temperature difference value change set; fitting a relationship function for each preset temperature range according to the temperature difference value set and the temperature difference value change set; obtaining a current time point and obtaining a target temperature difference value for each preset temperature range according to the relationship function and the current time point; preliminarily calibrating the specified temperature sensor based on the target temperature difference value.
[0005] Further, the step of fitting a relationship function for each preset temperature range according to the temperature difference value set and the temperature difference value change set comprises: previously setting an initial relationship function for each preset temperature range , ; wherein, represents the s-th preset time period in the r-th preset temperature range, represents the predicted temperature difference value corresponding to the s-th preset time period in the r-th preset temperature range, t, , ,..., are to be solved, is derivative of error minimum value calculation formula limit the error minimum value between the to-be-fitted curve and each weighted sum of the same preset temperature range; wherein n is the number of preset time periods, is an error value, is an error value derivative, when 1 , denotes the temperature difference value corresponding to the s-th preset time period in the r-th preset temperature range, denotes the temperature difference value corresponding to the s+1-th preset time period in the r-th preset temperature range, denotes the temperature difference value corresponding to the s-1-th preset time period in the r-th preset temperature range, denotes the s+1-th preset time period in the r-th preset temperature range, denotes the s-1-th preset time period in the r-th preset temperature range, when s=1, , when s=n, , denotes finding the minimum value; take the partial derivative of the right side of the two equations of the error minimum value calculation formula to obtain , converted into a matrix and simplified to obtain the first matrix and the second matrix ; According to the first matrix and the second matrix, the parameters t, , ,..., are solved and substituted into the initial relationship function respectively to obtain the relationship function of each preset temperature range.
[0006] Further, after the step of preliminarily calibrating the specified temperature sensor based on the target temperature difference, the method further comprises: placing the preliminarily calibrated specified temperature sensor in a plurality of external environments of preset temperatures in sequence to obtain test temperatures of the specified temperature sensor; obtaining a corresponding target preset temperature range based on the test temperatures; arranging the test temperatures, and determining a first test temperature to be processed currently from the test temperatures based on the arrangement order; obtaining a preset temperature range and a preset temperature corresponding to the first test temperature, correcting the first test temperature based on the preset temperature to obtain a correction result, and recording the correction result in the preset temperature range; determining a second test temperature for next processing from the test temperatures based on the arrangement order; determining the second test temperature as the first test temperature, and repeating the target step of obtaining a preset temperature range corresponding to the first test temperature, correcting the first test temperature based on the preset temperature to obtain a correction result, and recording the correction result in the preset temperature range; setting a correction parameter of each preset temperature range based on the correction result of each test temperature when all the test temperatures are corrected; re-calibrating the specified temperature sensor based on the correction parameter.
[0007] Further, the step of obtaining temperature difference values of the specified temperature sensor in a plurality of preset temperature ranges in a plurality of preset time periods to obtain a temperature difference value set corresponding to each preset temperature range comprises: obtaining a first temperature value set of the specified temperature sensor after the last re-calibration in each preset time period, and a second temperature value set actually measured by each specified temperature sensor; wherein the first temperature value set includes first temperature values of the plurality of preset time periods, and the second temperature value set includes second temperature values of the plurality of preset time periods; subtracting the corresponding second temperature value from the first temperature value to obtain a temperature difference value set corresponding to all preset temperature ranges.
[0008] Further, before the step of sequentially placing the preliminary calibrated specified temperature sensor in an external environment of a plurality of preset temperatures to obtain test temperatures of the specified temperature sensor, further comprising: obtaining a historical time point of the last re-calibration; monitoring whether an interval duration from the historical time point to the current time point reaches a preset interval period; monitoring that the interval duration reaches the preset interval period, and determining that the condition for performing the step of sequentially placing the preliminary calibrated specified temperature sensor in an external environment of a plurality of preset temperatures to obtain test temperatures of the specified temperature sensor is met.
[0009] Further, the step of setting a correction parameter of each preset temperature range based on the correction result of each test temperature when all the test temperatures are corrected comprises: setting an initial count matrix; wherein the dimension of the initial count matrix is the same as the number of preset temperature ranges; assigning values to the numbers in the initial count matrix according to the number of each test temperature in each preset temperature range to obtain a target count matrix; For the first coordinate which is not 0 in the target count matrix, an average value of each temperature correction result is calculated as a correction parameter of the preset temperature range.
[0010] Further, after the step of calculating the average value of each temperature correction result of the first coordinate which is not 0 in the target count matrix as the correction parameter of the preset temperature range, the method further comprises: marking the second coordinate which is 0 in each target count matrix; obtaining the correction parameter of the adjacent preset temperature range corresponding to the preset temperature range of the second coordinate; setting the correction parameter of the preset temperature range according to the correction parameter of the adjacent preset temperature range.
[0011] A correction device of a temperature sensor, the device comprising: a first obtaining module, configured to obtain temperature difference values of a specified temperature sensor in a plurality of preset temperature ranges in a plurality of preset time periods, to obtain a temperature difference value set corresponding to each preset temperature range; wherein the temperature difference value is a difference value between a measured temperature value and an actual temperature value of the specified temperature sensor; a calculating module, configured to calculate a change value of temperature difference values of two adjacent preset time periods in the temperature difference value set, to obtain a temperature difference value change set; a fitting module, configured to fit a relationship function of each preset temperature range according to the temperature difference value set and the temperature difference value change set; a second obtaining module, configured to obtain a current time point, and obtain a target temperature difference value of each preset temperature range according to the relationship function and the current time point; a calibration module, configured to preliminarily calibrate the specified temperature sensor based on the target temperature difference value.
[0012] An electronic device, comprising a memory and a processor, the memory storing a computer program, the computer program being executed by the processor to make the processor execute the following steps: obtaining temperature difference values of a specified temperature sensor in a plurality of preset temperature ranges in a plurality of preset time periods, to obtain a temperature difference value set corresponding to each preset temperature range; wherein the temperature difference value is a difference value between a measured temperature value and an actual temperature value of the specified temperature sensor; calculating a change value of temperature difference values of two adjacent preset time periods in the temperature difference value set, to obtain a temperature difference value change set; fitting a relationship function of each preset temperature range according to the temperature difference value set and the temperature difference value change set; acquire a current time point, and acquire a target temperature difference value of each preset temperature range according to the relationship function and the current time point; preliminarily calibrate the specified temperature sensor based on the target temperature difference value.
[0013] A computer readable storage medium stores a computer program, when the computer program is executed by a processor, the processor executes the following steps: acquire a temperature difference value of a specified temperature sensor in a plurality of preset temperature ranges in a plurality of preset time periods to obtain a temperature difference value set corresponding to each preset temperature range; wherein the temperature difference value is a difference value between a measured temperature value and an actual temperature value of the specified temperature sensor; calculate a change value of the temperature difference values of two adjacent preset time periods in the temperature difference value set to obtain a temperature difference value change set; fit a relationship function of each preset temperature range according to the temperature difference value set and the temperature difference value change set; acquire a current time point, and acquire a target temperature difference value of each preset temperature range according to the relationship function and the current time point; preliminarily calibrate the specified temperature sensor based on the target temperature difference value.
[0014] The beneficial effects of the present application are: by acquiring temperature difference values of different preset temperature ranges in a plurality of preset time periods, a comprehensive temperature response model is constructed, the change value of adjacent temperature difference values is used to extract nonlinear characteristics, a relationship function is fitted, a target temperature difference value of a current time point is dynamically acquired, and the intelligentization and real-time of temperature correction are realized. The inconvenience of traditional temperature sensors relying on factory calibration is avoided, the error caused by temperature floating in actual application is reduced, and the calibration time and cost are also reduced. BRIEF DESCRIPTION OF DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0016] Among them: Figure 1 It is an application environment diagram of the temperature sensor correction method in an embodiment; Figure 2 It is a flowchart of the temperature sensor correction method in an embodiment; Figure 3 It is a structure block diagram of the temperature sensor correction device in an embodiment; Figure 4 A structural diagram of an electronic device in one embodiment. DETAILED DESCRIPTION
[0017] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0018] Figure 1 A temperature sensor correction application environment diagram in one embodiment. Refer to Figure 1 The temperature sensor correction method is applied to a temperature sensor correction system. The temperature sensor correction system includes a terminal 110 and a server 120. The terminal 110 and the server 120 are connected through a network. The terminal 110 can be a desktop terminal or a mobile terminal. The mobile terminal can be at least one of a mobile phone, a tablet computer, a notebook computer, etc. The server 120 can be implemented by an independent server or a server cluster composed of multiple servers. The terminal 110 is used to calibrate a specified temperature sensor, and the server 120 is used to calculate calibration parameters.
[0019] As Figure 2 shown in one embodiment, a temperature sensor correction method is provided. The method can be applied to a terminal or a server. The embodiment is exemplified by application to a terminal. The temperature sensor correction method specifically includes the following steps: S1: Obtain temperature difference values of a specified temperature sensor in multiple preset temperature ranges in multiple preset time periods to obtain a temperature difference value set corresponding to each preset temperature range. The temperature difference value is the difference between a measured temperature value and an actual temperature value of the specified temperature sensor. S2: Calculate the change value of the temperature difference values of two adjacent preset time periods in the temperature difference value set to obtain a temperature difference value change set. S3: Fit a relationship function of each preset temperature range according to the temperature difference value set and the temperature difference value change set. S4: Obtain a current time point and obtain target temperature difference values of each preset temperature range according to the relationship function and the current time point. S5: Preliminarily calibrate the specified temperature sensor based on the target temperature difference values.
[0020] As described in step S1, the temperature difference values of the specified temperature sensor in multiple preset temperature ranges within multiple preset time periods are obtained. The temperature difference values of the sensor in different preset temperature ranges and multiple time periods are collected and recorded. The temperature difference value refers to the difference between the actual measured temperature of the sensor and the temperature value measured by the specified temperature sensor. The way to obtain these values can be to determine a series of fixed time periods, and the time span of each time period should not be too large, for example, 3 days, and specifically, from 1st to 3rd of each month. Since the aging degree of the specified temperature sensor can be considered unchanged within a short period of time, the data measured in this time period can be considered as the aging degree of the specified temperature sensor being unchanged, i.e., the error of the specified temperature sensor being unchanged, and measured within a given preset range (such as -20℃ to 100℃). Specifically, the external environment temperature can be set, and then measured by the specified temperature sensor. The external environment temperature needs to be within the above-mentioned preset range, and needs to be valued within each preset temperature range. Assuming that there are 5 preset temperature ranges, -10℃ to 0℃, 0℃ to 10℃, 10℃ to 20℃, 20℃ to 30℃, and 30℃ to 40℃, different external environment temperatures can be set as -5℃, 5℃, 15℃, 25℃, and 35℃. If the specified temperature sensor measures the temperature as -5.1℃, -5.0℃, -4.8℃, -4.3℃, and -4.1℃ in the external environment of -5℃ from 1st to 5th of January 2020, the corresponding temperature difference values in the temperature difference value set are 0.1℃, 0℃, -0.2℃, -0.7℃, and -0.9℃, respectively. The preset time periods are January 1, 2020, February 1, 2020, March 1, 2020, April 1, 2020, and May 1, 2020, respectively, i.e., temperature data collection is performed at any time on the 1st of each month, and it is best to ensure that there is at least one test external environment temperature in each preset temperature range to facilitate correction of each preset temperature range. If there are multiple test external environment temperatures in a preset temperature range, the average value can be calculated. The test temperature value measured by the specified temperature sensor is compared with the set external environment temperature to obtain the corresponding temperature difference value. In some embodiments, the external environment of the specified temperature sensor can be obtained by other temperature sensors, so the actual working environment temperature of the specified temperature sensor can also be obtained. In this way, the measurement values are concentrated in one or a few preset temperature ranges, but the calibration accuracy is better due to the larger number of samples in the corresponding preset temperature range in the subsequent calculation process. Therefore, enterprises need to optimize the working environment temperature, and thus a corresponding temperature difference value set can be established to better reflect the performance of the sensor under different temperature conditions.The preset temperature range can be preset, such as the aforementioned -10℃ to 0℃, 0℃ to 10℃, 10℃ to 20℃, 20℃ to 30℃, 30℃ to 40℃. In a preferred embodiment, the preset temperature range can be preset according to the working environment of the designated temperature sensor. For example, if the working environment temperature of the designated temperature sensor is -20℃ to 10℃, and most of the working environment temperature is concentrated in -10℃ to 0℃, the preset temperature range can be set as -20℃ to -10℃, -10℃ to -5℃, -5℃ to -0℃, 0℃ to 10℃. That is, for the region where the working environment temperature is concentrated, the temperature range is divided into smaller ranges. Specifically, a period of measurement values can be obtained, and then divided into a first temperature range with a density greater than a set density value and a second temperature range with a density less than or equal to a set density value. The first temperature range is executed according to a first range division standard to obtain a plurality of preset temperature ranges corresponding to the first temperature range. The second temperature range is executed according to a second range division standard to obtain a plurality of preset temperature ranges corresponding to the second temperature range. The set density value is a preset density value, for example, 10 per unit temperature range. The first range division standard and the second range division standard are preset standards, wherein the temperature range divided by the first range division standard is smaller than the temperature range divided by the second range division standard. In addition, the first range division standard and the second range division standard can correspond to the corresponding density value, that is, a relationship table of the range division standard and the density value can be preset, and the range division standard can be obtained according to the relationship table. In the implementation process, the device can automatically record these temperature values through the acquisition system. The measurement results of each preset time period are stored in the system database. Through repeated testing and recording, it can be observed that the temperature data fluctuates with time and environmental temperature. In a specific embodiment, each designated temperature sensor triggers a fine adjustment every interval, that is, the subsequent recalibration is triggered, and therefore the preset time period is preferably the historical time point of the recalibration.
[0021] In an embodiment, before the step S1 of obtaining the temperature difference value of the designated temperature sensor in the plurality of preset temperature ranges in the plurality of preset time periods to obtain the temperature difference value set corresponding to each preset temperature range, the method further comprises: obtaining the working environment temperature gradient of the designated temperature sensor; setting the plurality of preset temperature ranges according to the working environment temperature gradient.
[0022] As described in the above step, since the specified temperature sensor is generally used for temperature detection of a single food, the working environment temperature gradient is generally the working temperature of the food, so the corresponding working environment temperature gradient can be obtained from the corresponding database or from the processing temperature of the food. According to the working environment temperature gradient, the appropriate preset temperature range is determined. These preset ranges should consider the variation characteristics of the temperature gradient to ensure that they can effectively cover possible temperature changes. Multiple ranges, such as low-temperature range, medium-temperature range, and high-temperature range, can be set to adapt to different application requirements.
[0023] As described in the above step S2, the change value of the temperature difference value of the adjacent two preset time periods in the temperature difference value set is calculated. The obtained temperature difference value set is analyzed to calculate the change value of the adjacent two temperature difference values. By comparing the temperature difference values of adjacent time periods, the change of the temperature difference in each time period can be derived. This change value is one of the key data indicators and can reflect the stability and reliability of the sensor in a specific time period. The collected change values are used for subsequent relationship function fitting to help build a mathematical model reflecting the relationship between temperature and difference.
[0024] As described in the above step S3, the relationship function of each preset temperature range is fitted according to the temperature difference value set and the temperature difference value change set. By using the temperature difference value set and their change value set, the relationship function is fitted. This process is a key step in establishing a mathematical model between temperature and sensor output. The fitted relationship function is usually achieved through regression analysis methods, and common models include linear regression and nonlinear regression models (such as polynomial regression). In order to successfully build the relationship function, the performance of different types of fitting methods needs to be evaluated, and an appropriate model needs to be selected to ensure the accuracy of the fitting. On this basis, the dynamic characteristics and change trend of the temperature difference value need to be considered to ensure that the model not only expresses the current data but also makes a prediction of future temperature changes. After the fitting is completed, the obtained relationship function will become the basis for actual calibration operations, which can effectively represent the working characteristics of the temperature sensor in different environments and time conditions. In addition, with the fitted relationship function, the subsequent target temperature difference value calculation will become clearer, which helps to improve the calibration accuracy of the temperature sensor, grasp the temperature flow characteristics, and adapt to complex working environments.
[0025] As described in step S4, the current time point is obtained, and the target temperature difference value of each preset temperature range is obtained according to the relationship function and the current time point. The target temperature difference value of each preset temperature range corresponding to the current time point is obtained through the relationship function. First, the system needs to obtain the real-time time information, which will be the basis for the following calculation. Then, using the relationship function fitted in the previous step, the time period is taken as the input, and the corresponding target temperature difference value of each preset temperature range is generated. This target temperature difference value represents the error value of the sensor under the current environmental conditions, which needs to be referenced and corrected during actual calibration. Through this dynamic calculation, the error caused by the static model can be avoided, and the performance of the sensor and the change of the environment can be adapted in real time. In addition, the acquisition of this target value provides the required calibration basis for the subsequent preliminary calibration of the sensor, making the calibration process more targeted and timely. It should be noted that the current time point needs to be mapped to the corresponding time value. In a specific embodiment, the time period when the specified temperature sensor is first used can be recorded as 0 point, and then 10 days can be taken as a length unit, that is, each 10 days corresponds to a time unit. If the current time point is 22 days away from the time period when the specified temperature sensor is first used, the corresponding time value is 2.2. In some other embodiments, 0 point and the unit can also be determined by oneself for the convenience of calculation.
[0026] As described in step S5, the specified temperature sensor is preliminarily calibrated based on the target temperature difference value. The preliminary calibration is a dynamic correction based on the relationship function, and the trigger condition of the preliminary calibration is dynamically performed based on historical data. Specific trigger conditions can be set, such as: the deviation of the temperature reading exceeds a preset threshold (such as ±2°C); a regular time interval (for example, calibration after 100 hours of use); and the performance of the device changes significantly under specific environmental conditions (such as high temperature, low temperature, or high humidity). The target temperature difference value is applied to the actual calibration of the temperature sensor. Based on the target temperature difference value calculated in the previous step, the calibration process will adjust the output of the sensor to ensure that the measured value is close to the expected standard temperature. This preliminary calibration involves modifying parameters such as the output gain, offset, and sensitivity of the sensor. Specifically, the result of the calibration can be achieved by adjusting the internal variables of the sensor or updating its processing algorithm. For example, the data is collected in the cloud and calculated, and then the calculation result is sent to the terminal where the specified temperature sensor is located. After receiving the data of the specified temperature sensor, the terminal corrects it through the correction parameter. In general, through the calibration operation based on the target temperature difference value, the temperature sensor can better adapt to the changing working environment and eliminate the risk of performance degradation due to sensor aging. This process lays a solid foundation for the long-term effectiveness and reliability of temperature measurement, and provides a safer and more effective solution for related industries.
[0027] In one embodiment, the step S3 of fitting the relational function of each preset temperature range according to the temperature difference value set and the temperature difference value change set comprises: S301: presetting an initial relational function of each preset temperature range , ; wherein, represents the s-th preset time period in the r-th preset temperature range, represents the predicted temperature difference value corresponding to the s-th preset time period in the r-th preset temperature range, , , are all parameters to be solved, is the derivative of ; S302: calculating the error minimum value between the to-be-fitted curve and each weighted sum of the same preset temperature range by an error minimum value calculation formula ; wherein, n is the number of preset time periods, is an error value, is the derivative of the error value, when 1 , represents the temperature difference value corresponding to the s-th preset time period in the r-th preset temperature range, represents the temperature difference value corresponding to the s+1-th preset time period in the r-th preset temperature range, represents the temperature difference value corresponding to the s-1-th preset time period in the r-th preset temperature range, represents the s+1-th preset time period in the r-th preset temperature range, represents the s-1-th preset time period in the r-th preset temperature range, when s=1, , when s=n, , represents the minimum value; S303: taking the partial derivative of the right side of the two equations of the error minimum value calculation formula to obtain , which is converted into a matrix and simplified to obtain a first matrix and a second matrix ; S304: solving the parameters , ,..., and according to the first matrix and the second matrix, and substituting them into the initial relational function to obtain the relational function of each preset temperature range.
[0028] As described in the above step S301, an initial relationship function of each preset temperature range is set in advance. An initial relationship function is defined for each preset temperature range, and the relationship function is a polynomial fitting function, with time as the independent variable and temperature difference as the dependent variable.
[0029] As described in the above step S302, the minimum error between the to-be-fitted curve and the weighted sum of each preset temperature range is calculated by the minimum error calculation formula. The error between the fitting curve and the measured data is defined and calculated, the error is regarded as an objective function, and the optimal fitting parameter is determined by minimizing the function. It should be noted that, in order to improve the accuracy of calculation, not only the predicted temperature difference and the actual temperature difference are predicted, but also the corresponding derivative is predicted. With the optimization of the parameters, the to-be-fitted curve is constantly adjusted to be consistent with the actual measured data as much as possible.
[0030] As described in the above step S303, the partial derivatives of the right sides of the two equations of the minimum error calculation formula are taken to obtain a first matrix and a second matrix. The partial derivatives of the minimum error function defined in step S302 are calculated, and an equation set can be obtained by taking the derivatives of the error function, which systematically expresses the relationship between the parameters. After sorting all the partial derivative results, a matrix equation can be constructed, which is usually called the Jacobian matrix. After simplification, this equation set forms two main matrices: the first matrix (related to the change relationship of the actual temperature difference) and the second matrix (related to the derivative of the to-be-solved parameter). Through these matrices, the problem of solving parameters can be solved more efficiently, the multi-variable function optimization is realized, and the accurate mathematical implementation ensures that the results obtained in the fitting process can reflect the fundamental relationship between the temperature and the sensor output.
[0031] As described in the above step S304, the parameters are solved according to the first matrix and the second matrix, and are substituted into the initial relationship function to obtain the relationship function of each preset temperature range. The main task of the first matrix and the second matrix obtained in the previous steps is to solve the to-be-solved parameters. Through the matrix solving method of linear algebra, such as Gaussian elimination method or least square method, this relationship equation set can be solved efficiently, so as to obtain the optimal value of each parameter. Specifically, the least square method is used to solve the matrix equation to obtain the parameters t, 、 、...、 Then, the obtained parameters are verified by an index for evaluating the fitting capability, such as mean square error (MSE), and if the verification is passed, it is determined that the parameters meet the requirements. These parameters represent key factors in the fitting relationship function and can specifically describe the change relationship between the temperature and the sensor output in different preset temperature ranges. After successfully solving the parameters, the next step is to substitute these parameters into the pre-set initial relationship function, and through this specific combination operation, the final relationship function for each preset temperature range can be obtained. These relationship functions can accurately reflect the characteristics of the sensor under different operating conditions, providing reliable basis for current temperature measurement and future calibration. The finally generated relationship function not only can significantly improve the calibration accuracy of the temperature sensor, but also helps to maintain stable temperature measurement under different operating conditions, ensuring the reliable performance of the sensor during use.
[0032] In one embodiment, after the step S5 of performing preliminary calibration on the specified temperature sensor based on the target temperature difference, the method further comprises: S601: sequentially placing the preliminary calibrated specified temperature sensor in an external environment of a plurality of preset temperatures to obtain a test temperature of the specified temperature sensor; S602: obtaining a corresponding target preset temperature range based on the test temperature; S603: arranging the test temperatures, and determining a first test temperature to be processed currently from the test temperatures based on the arrangement order; S604: obtaining a preset temperature range and a preset temperature corresponding to the first test temperature, correcting the first test temperature based on the preset temperature to obtain a correction result, and recording the correction result in the preset temperature range; S605: determining a second test temperature to be processed next from the test temperatures based on the arrangement order; S606: determining the second test temperature as the first test temperature, and repeatedly performing a target step; the target step comprises obtaining a preset temperature range and a preset temperature corresponding to the first test temperature, correcting the first test temperature based on the preset temperature to obtain a correction result, and recording the correction result in the preset temperature range; S607: when all the test temperatures are corrected, setting correction parameters of each preset temperature range based on the correction results of the test temperatures; S608: recalibrating the specified temperature sensor based on the correction parameters.
[0033] As described in step S601, the specified temperature sensor after preliminary calibration is placed in a plurality of external environments with preset temperatures in sequence to obtain the test temperature of the specified temperature sensor. The temperature sensor after preliminary calibration is placed in a plurality of external environments one by one for testing, which covers a series of representative temperatures, usually including a plurality of temperature values (such as -20℃, 0℃, 25℃, 50℃, 75℃ and 100℃, etc.), ensuring that the operating range of the sensor can be widely covered. Specifically, the temperature of the external environment can be controlled by a thermostat, and the test temperature of the sensor at different preset temperatures is recorded. It should be noted that the plurality of temperature values are not necessarily complete integers, and can be 36.5℃, etc. The number of measurements should be sufficient, for example, 500 external environments. In order to ensure the temperature during work, the number ratio of the specified temperature sensor measuring each preset temperature range is counted, and the number of external environments of each preset temperature range is set in proportion according to the corresponding number ratio, so that the number of corresponding preset temperature ranges is more, thereby improving the accuracy of the corresponding preset temperature range and meeting the needs of actual work. Specifically, during the test process, the sensor will be stable in each temperature zone for a period of time, and then the output temperature (i.e. the actual test temperature) will be recorded after reaching the equilibrium state. These data will include the sensor output corresponding to each preset temperature, so as to be analyzed and compared subsequently.
[0034] As described in step S602, the corresponding target preset temperature range is obtained based on the test temperature. According to the actual temperature measured by the sensor recorded during the test process, the corresponding target preset temperature range is obtained. The target preset temperature range is usually set in advance based on the system standard or application requirement, and the purpose is to ensure that the measured temperature value matches the system specification well, and each test temperature corresponds to only one target preset temperature range.
[0035] As described in step S603, each test temperature is arranged, and the first test temperature to be processed is determined from each test temperature based on the arrangement order. The test temperature input data obtained is sorted, and each temperature is arranged in a logical sequence to ensure a reasonable and clear order. Usually, the test temperatures are arranged in ascending order, or can be randomly arranged. Here, only a serial number is given to each test temperature for subsequent processing and statistics. The first test temperature to be processed is determined by selecting the first temperature value as the initial processing object after sorting.
[0036] The preset temperature range corresponding to the first test temperature is obtained as described in step S604, and the first test temperature is corrected based on the preset temperature to obtain a correction result, and the correction result is recorded in the preset temperature range. The preset temperature range corresponding to the current first test temperature is identified, and the target preset temperature in the temperature range is retrieved, based on the target preset temperature and the measured temperature, the corrected parameter is calculated, and the corrected parameter is recorded in the preset temperature range to establish the correction history record in the form of a document, which will become an important reference for future correction and optimization process, and help to track the change and drift of sensor performance.
[0037] As described in step S605, the second test temperature for next processing is determined from each test temperature based on the arrangement order. According to the previously determined order, the second test temperature for next processing is determined. By selecting the next target from each collected test temperature in turn, the system ensures that all measurement values can be covered, so as to perform comprehensive correction.
[0038] As described in step S606, the second test temperature is determined as the first test temperature, and the target step is repeatedly executed. This repeated step ensures that each temperature value in the system can be corrected, thereby maximizing the measurement accuracy of the sensor. By continuously executing the target step, the relevant correction information and data will be recorded and support subsequent analysis. This mechanism not only ensures the accurate processing of each specific test temperature, but also forms a cyclic correction process, which realizes more concentrated effect through continuous feedback and correction. This repetition significantly reduces the risk of error, ensures the performance of the temperature sensor under all potential environmental conditions, and thus ensures its reliability and stability in long-term use. The whole process not only improves the traceability of data, but also makes the calibration process more reasonable, and ensures that the setting of correction parameters for each preset temperature range is more reasonable.
[0039] As described in step S607, when all test temperatures are corrected, the correction parameters of each preset temperature range are set based on the correction results of each test temperature. When all test temperatures are corrected, the correction result of each temperature is used to initialize and set the corresponding correction parameter. The setting process of the correction parameter usually involves summarizing and analyzing the correction results of each preset temperature range, and forming a systematic parameter through average value calculation or weighted value of effective data.
[0040] As described in step S608, the specified temperature sensor is recalibrated based on the correction parameters. Recalibration refers to fine-tuning based on experimental data, and the trigger condition can be triggered once every preset time interval. Recalibration of the sensor is performed by using the previously set correction parameters. In this process, the correction parameters will be directly applied to the working algorithm of the temperature sensor to ensure that the sensor can accurately provide measurement values according to the latest environmental conditions and historical operation data. The recalibration process ensures that the sensor maintains high performance and reliability throughout its long-term use based on the correction results obtained from these values, which not only effectively prevents the spread of false temperature information but also provides a stable temperature monitoring solution for subsequent users. Recalibration can also be integrated with real-time tracking data of the system to lay the foundation for responding to dynamic environmental changes. Through this complete recalibration process, the performance of the sensor will not only be affected by the initial calibration but also continuously adapt to new calibration requirements based on historical data and the gradual evolution of parameters. This implementation step ensures that all potential errors are eliminated through an effective feedback and correction mechanism, thereby achieving stable and continuous temperature measurement results.
[0041] Therefore, recalibration uses the correction results obtained at each test temperature to make detailed adjustments for different temperature ranges. Through these correction parameters, the output signal of the sensor is further adjusted to accurately reflect the actual environmental temperature, ensuring that the sensor can always provide accurate data under varying external conditions without being affected by previous potential biases, significantly improving its measurement accuracy. In the recalibration process, by setting correction parameters for different temperature ranges, the sensor can be more widely applicable to various operating conditions, which enables the sensor to maintain reasonable output performance under different environmental conditions such as high temperature, low temperature, or rapid temperature changes. This feature is particularly important for industrial applications, climate monitoring, and scientific experiments, as these fields have high requirements for accuracy and consistency. Temperature sensors are usually connected to automatic monitoring systems to provide real-time feedback on environmental changes. Through recalibration, the system can continuously and accurately record temperature change data and automatically adjust. This adaptive capability enables the system to more intelligently respond to changing environmental conditions, improving the efficiency and effectiveness of the entire monitoring system. In summary, recalibration based on correction parameters is of great significance for improving the performance of sensors, ensuring data accuracy, and enhancing user confidence, and can provide more reliable and efficient services in various applications. This process helps to establish a better temperature monitoring system and effectively supports scientific research and industrial production in various fields.
[0042] In one embodiment, the step S1 of obtaining the temperature difference values of the specified temperature sensor in multiple preset temperature ranges within multiple preset time periods to obtain a temperature difference value set corresponding to each preset temperature range includes: S101: Obtain a first temperature value set of each preset time period after the last recalibration of the specified temperature sensor, and a second temperature value set actually measured by each specified temperature sensor; wherein the first temperature value set includes first temperature values of multiple preset time periods, and the second temperature value set includes second temperature values of multiple preset time periods; S102: Subtract the corresponding second temperature value from the first temperature value to obtain a temperature difference value set corresponding to all preset temperature ranges.
[0043] As described in step S101, a first temperature value set of each preset time period after the last recalibration of the specified temperature sensor is obtained, and a second temperature value set actually measured by each specified temperature sensor is obtained. Collecting temperature measurement data of the last recalibration sensor in different preset time periods, two data sets are constructed: the first temperature value set and the second temperature value set. The first temperature value set contains the theoretically predicted temperature values of the recalibrated sensor in multiple preset temperature ranges in the preset time period. For example, temperature data can be obtained in multiple set time periods (such as every 15 days or every month), and these temperature values are ideal values obtained after standardization and calibration under actual environmental conditions. This set will provide ideal temperature reference points for subsequent analysis. The process of collecting these data needs to be recorded in time to ensure that the data collected in different time periods can be directly compared.
[0044] As described in step S102, subtract the corresponding second temperature value from the first temperature value to obtain a temperature difference value set corresponding to all preset temperature ranges. The deviation of the sensor is determined by simple mathematical operation, that is, the temperature difference value set is obtained. Specifically, in order to obtain the temperature difference, each element (representing the calibrated predicted temperature) in the first temperature value set is subtracted from the corresponding element (the actually measured temperature value) in the second temperature value set. In this way, the temperature difference set obtained can reflect the actual deviation of the sensor in each specific preset temperature range and specific time period. The calculation of these temperature differences provides key information for the calibration process, helping to identify the accuracy and stability of the sensor in operation. In the subsequent analysis, these differences will be used as the basis for establishing models and relationship functions, making the correction of the sensor more systematic and reasonable.
[0045] In one embodiment, before the step S601 of sequentially placing the specified temperature sensor after preliminary calibration in multiple preset temperature external environments to obtain the test temperature of the specified temperature sensor, the following steps are further included: S6001: Obtain a historical time point of the last recalibration; S6002: Monitor whether the interval length from the historical time point to the current time point reaches a preset interval period; S6003: Monitoring whether the interval length reaches a preset interval period, and determining that the condition for performing the step of sequentially placing the preliminary calibrated designated temperature sensor in multiple preset temperature external environments to obtain the test temperature of the designated temperature sensor is met.
[0046] As described in the above step S6001, the historical time point of the last recalibration is obtained. Since each calibration can be preliminary calibration and recalibration, the historical time point of the last recalibration can be obtained from the historical record. The accurate historical time point of the last calibration of the temperature sensor is recorded and extracted, which can be realized by the log stored in the sensor or the information registered in the software management system. The reason for obtaining the last calibration date is to identify the length of time the sensor has experienced since the last calibration, and then determine whether a new calibration operation is needed.
[0047] As described in the above step S6002, whether the interval length from the historical time point to the current time point reaches a preset interval period is monitored. The extracted historical time point is analyzed to determine whether the time interval from the last calibration to the current time point reaches the preset interval period. This preset interval period is based on the recommended maintenance period of the equipment manufacturer, industry standards or actual use experience of the user, for example, set to 15 days or one month.
[0048] As described in the above step S6003, when the interval length reaches the preset interval period, it is determined that the condition for performing the step of sequentially placing the preliminary calibrated designated temperature sensor in multiple preset temperature external environments to obtain the test temperature of the designated temperature sensor is met. When it is determined that the historical length is greater than the preset length, the system will automatically trigger the subsequent steps to arrange the calibration program of the temperature sensor. This can ensure that the sensor always maintains the best performance state during use, prevents deviation caused by long time without calibration, and maintains its ability to accurately measure and respond to external temperature. Through these steps, the system can automatically trigger the recalibration step to improve the accuracy of the temperature sensor.
[0049] In one embodiment, the step S607 of setting the correction parameters of each preset temperature range based on the correction results of each test temperature after all test temperatures are corrected, comprises: S6071: setting an initial count matrix, wherein the dimension of the initial count matrix is the same as the number of preset temperature ranges; S6072: assigning values to the numbers in the initial count matrix according to the number of each test temperature in each preset temperature range to obtain a target count matrix; S6073: Calculate the average of each temperature correction result of the first coordinate which is not 0 in the target count matrix as the correction parameter of the preset temperature range.
[0050] As described in steps S6071-S6073 above, an initial count matrix is created with dimensions consistent with the number of preset temperature ranges involved. This matrix serves to track and count the number of valid correction results measured within different preset temperature ranges. The initial count matrix is typically set to zero upon creation, indicating that no measured correction data has been recorded for each preset temperature range at the beginning. The count matrix is a two-dimensional array with dimensions equal to the number of preset temperature ranges. When a corresponding dimension has a numerical value, the corresponding dimension value is incremented by 1, and then all test temperatures are traversed to obtain the number of test temperatures for each dimension, thereby obtaining the target count matrix. By assigning a unique matrix element to each preset temperature range, the system can classify and organize measurement data within different preset temperature ranges in subsequent steps. This structured data organization lays the foundation for subsequent temperature correction processes, improving system processing and analysis efficiency and reducing errors caused by data confusion. The measurement data before traversal is counted to obtain the number of measurement results for each preset temperature range, and this value is filled into the corresponding position of the target count matrix. The non-zero coordinates in the target count matrix are analyzed to obtain the corresponding temperature correction results, and the average of these results is calculated as the correction parameter of the specific preset temperature range. The system identifies the coordinates with valid data in the target count matrix. Then, the corresponding temperature correction results are extracted from each non-zero first coordinate. These results are usually actual values recorded during previous correction processes, reflecting the sensor's response under specific environmental conditions. Subsequently, the system will count all extracted correction results, add these values and calculate their average. For example, in a specific embodiment, the preset temperature range is 20-30°C, corresponding to the dimension value of the target count matrix as 3, and the corresponding three sets of test temperature-preset temperature are (23, 24), (24, 27), and (22, 21), respectively. The corresponding correction results are 1, 3, and -1, respectively. The correction parameter of the preset temperature range is [1+3+(-1)] / 3=1.
[0051] In one embodiment, after step S6073 of calculating the average of each temperature correction result of the first coordinate which is not 0 in the target count matrix as the correction parameter of the preset temperature range, it further includes: S60741: Mark each second coordinate of the target count matrix which is 0; S60742: Obtain the correction parameter of the adjacent preset temperature range of the preset temperature range corresponding to the second coordinate. S60743: Setting the correction parameter of the preset temperature range according to the correction parameter of the adjacent preset temperature range.
[0052] As described in steps S60741-S60743, all coordinates with zero in the target count matrix are identified and marked. These coordinates correspond to the preset temperature range where no valid measurement data is recorded, which may be due to no measurement in this preset temperature range, unavailable measurement data, or data considered invalid, etc. The marking process usually involves traversing the target count matrix through an automated algorithm, checking the value of each element. If the value of an element is 0, the system marks its coordinate as "unused" or other appropriate identifier. Based on the previously marked zero coordinates, the corresponding preset temperature range is found, and the correction parameter of the adjacent preset temperature range is obtained. This is to fill in the missing valid correction data in the current preset temperature range to ensure that the overall calibration process of the system remains rigorous and effective. The correction parameter of the adjacent preset temperature range can provide a basis for filling in the missing data, making it easier to rely on known adjacent parameters for reasonable estimation in the absence of valid data. In addition, the process of finding the adjacent correction parameter can use mathematical interpolation methods, especially in the case of smooth changes in the correction parameter of the adjacent preset temperature range, linear interpolation or polynomial interpolation can be used to estimate the missing correction data. Using the correction parameter of the adjacent preset temperature range to set the parameter of the current unrecorded range not only improves the flexibility and adaptability of the temperature sensor, but also creates a more solid foundation for temperature management under complex combination conditions. In the implementation process, the parameter acquisition algorithm needs to be continuously optimized based on actual running data to continuously improve the performance of the entire temperature measurement system.
[0053] In one embodiment, after the step S5 of performing preliminary calibration on the specified temperature sensor based on the target temperature difference, the method further comprises: S621: Obtaining detection difference values of other sensors in multiple preset temperature ranges in multiple preset time periods to obtain a detection difference value set corresponding to each preset temperature range; S622: Calculating the conversion parameter of the detection difference value set and the temperature difference value set according to the formula ; wherein, represents the kth detection difference value in the xth detection difference value set, represents the hth detection difference value in the xth detection difference value set, and T is the conversion parameter, represents the kth temperature difference value in the xth temperature difference value set, represents the hth temperature difference value in the xth temperature difference value set, is a preset error range; S623: Obtain a target detection difference value of the other sensors at the current time point; S624: Calculate a reference temperature difference value of the specified temperature sensor according to the target detection difference value and the conversion parameter; S625: Perform reference calibration on the specified temperature sensor based on the reference temperature difference value.
[0054] As described in steps S621-S622 above, since the degradation of each sensor is related in the same environment, the change of the specified temperature sensor can be reflected by obtaining the change of other sensors. Specifically, the detection difference values of other sensors in multiple preset temperature ranges within multiple preset time periods are obtained to obtain a detection difference value set corresponding to each preset temperature range, the data source is expanded to reduce the potential error of a single sensor, and the performance of the specified temperature sensor can be compared and verified by introducing the measurement results of other sensors (such as humidity and pressure sensors). First, appropriate other sensors should be selected, which need to have good calibration and reliable measurement capability to ensure the authenticity and reliability of the data. For each preset temperature range, the detection results of other sensors are recorded within each time period and compared with the actual measurement value to calculate the detection difference value set of each sensor. The conversion parameter of the detection difference value set and the temperature difference value set is calculated according to the formula. Wherein, the relationship between multiple detection difference values and temperature difference values is involved. In order to achieve this, the relationship between the data sets needs to be first determined and the corresponding mathematical model needs to be established. Specifically, a formula is set to define the conversion parameter T to establish the relationship between the detection difference value and the temperature difference value. This can be achieved by statistical analysis of the difference values in the same temperature range. By comparing the difference between the kth value and the hth value of each detection difference value set with the difference between the kth value and the hth value of the temperature difference value set, the conversion parameter T can be obtained, which reflects the mutual relationship between the two. The calculation process involves mathematical tools such as linear regression and least squares method to ensure that an optimal conversion parameter is obtained.
[0055] As described in steps S623-S625 above, the target detection difference of other sensors at the time point corresponding to the temperature range queried using the previously defined time period can help understand the impact of temperature changes at that time. By applying the set formula, the reference temperature difference that the specified temperature sensor should adjust based on the current environmental conditions can be obtained, i.e. calculating the reference temperature difference of the specified temperature sensor according to the target detection difference and the conversion parameter. Specifically, the calculation can be directly performed by the conversion parameter, or a specific historical detection difference and historical temperature difference can be obtained and input into the formula. Since the conversion parameter and z are known, the only unknown parameter in the formula is the temperature difference, so the reference temperature difference can be directly obtained. The implementation of reference calibration usually involves adjusting the output of the sensor so that its measurement results can be consistent with the reference temperature difference obtained by the steps. This includes recalibrating the zero point, gain or other related parameters of the sensor. In addition, after performing the reference calibration, the calibration effect can also be verified through experiments or further measurements to confirm whether the sensor can effectively reproduce the real temperature data under the new settings. The purpose of this step is not only to correct the current error, but also to provide a stable and consistent output to ensure the accuracy and reliability of long-term monitoring and data in the future.
[0056] In one embodiment, before the step S1 of obtaining the temperature difference of the specified temperature sensor in a plurality of preset temperature ranges within a plurality of preset time periods to obtain a temperature difference set corresponding to each preset temperature range, the method further comprises: S001: obtaining the historical use record of the specified temperature sensor; S002: setting a target interval time for preliminary calibration according to the historical use record; S003: obtaining the historical calibration time point of the last preliminary calibration, and determining whether the interval between the historical calibration time point and the current time point reaches the target interval time; S004: if the interval between the historical calibration time point and the current time point reaches the target interval time, it is determined that the condition for performing the step of obtaining the temperature difference of the specified temperature sensor in a plurality of preset temperature ranges within a plurality of preset time periods to obtain a temperature difference set corresponding to each preset temperature range is met.
[0057] As described in steps S001-S004 above, since the specified sensor has a small probability of aging degree at different usage history records, such as just updated, its detection error will be small for a long period of time, and its detection error will increase significantly with time after being used for some time or in harsh environmental conditions, so the target interval time for preliminary calibration can be set according to the historical usage record of the sensor, which refers to all the operation data and performance of the sensor in the past period of time, including but not limited to working time, environmental conditions, usage frequency, fault record, and the date and result of periodic calibration. These information can be extracted through internal storage of the sensor, external database or related monitoring system. Analyze the stability data of the sensor performance in the historical usage record. If the sensor maintains good performance for a long time, the frequency of preliminary calibration can be set relatively long; on the contrary, if deviation or failure occurs frequently during use, the interval time can be shortened. The time stamp of the last calibration is extracted. This time point is the starting reference of the calibration period, then the system will calculate the interval time from this time point to the current time point. The measurement is usually in hours, days or other suitable time units, by comparing the calculated interval time with the target interval time set before, the system can determine whether the current time is suitable for calibration, if the interval time from the historical calibration time point to the current time point reaches the target interval time, it is determined that the condition of obtaining the temperature difference value of the specified temperature sensor in a plurality of preset time periods and a plurality of preset temperature ranges is met, to obtain a temperature difference value set corresponding to each preset temperature range.
[0058] Reference Figure 3 The present application also provides a correction device for a temperature sensor, comprising: A first obtaining module 902 is configured to obtain temperature difference values of a specified temperature sensor in a plurality of preset time periods and a plurality of preset temperature ranges, to obtain a temperature difference value set corresponding to each preset temperature range; wherein the temperature difference value is the difference between the temperature value measured by the specified temperature sensor and the actual temperature value; A calculation module 904 is configured to calculate the change value of the temperature difference values of adjacent two preset time periods in the temperature difference value set, to obtain a temperature difference value change set; A fitting module 906 is configured to fit a relationship function of each preset temperature range according to the temperature difference value set and the temperature difference value change set; A second obtaining module 908 is configured to obtain a current time point, and obtain target temperature difference values of each preset temperature range according to the relationship function and the current time point; A calibration module 910 is configured to preliminarily calibrate the specified temperature sensor based on the target temperature difference value.
[0059] In one embodiment, the fitting module 906 comprises: An initial relationship function setting sub-module, configured to preset an initial relationship function of each preset temperature range , ; wherein, represents the s-th preset time period in the r-th preset temperature range, represents the predicted temperature difference value corresponding to the s-th preset time period in the r-th preset temperature range, , , are parameters to be solved, is a derivative of ; An error minimum value setting sub-module, configured to limit the error minimum value between the to-be-fitted curve and each weighted sum of the same preset temperature range by an error minimum value calculation formula ; wherein, n is the number of preset time periods, is an error value, is a derivative of the error value, when 1 , represents the temperature difference value corresponding to the s-th preset time period in the r-th preset temperature range, represents the temperature difference value corresponding to the s+1-th preset time period in the r-th preset temperature range, represents the temperature difference value corresponding to the s-1-th preset time period in the r-th preset temperature range, represents the s+1-th preset time period in the r-th preset temperature range, represents the s-1-th preset time period in the r-th preset temperature range, when s = 1, , when s = n, , represents finding the minimum value; A partial derivative obtaining module, configured to take the partial derivative of the right side of the two equations of the error minimum value calculation formula to obtain , which is converted into a matrix and simplified to obtain a first matrix and a second matrix ; A parameter solving sub-module, configured to solve the parameters , , according to the first matrix and the second matrix, and substitute them into the initial relationship function respectively to obtain the relationship function of each preset temperature range.
[0060] In one embodiment, the correction device of the temperature sensor further comprises: The designated temperature sensor placement module is configured to place the preliminary calibrated designated temperature sensor in external environments of multiple preset temperatures in sequence to obtain test temperatures of the designated temperature sensor. The target preset temperature range acquisition module is configured to obtain a corresponding target preset temperature range based on the test temperatures. The test temperature arrangement module is configured to arrange the test temperatures and determine a first test temperature to be processed currently from the test temperatures based on an arrangement order. The preset temperature range acquisition module is configured to obtain a preset temperature range and a preset temperature corresponding to the first test temperature, correct the first test temperature based on the preset temperature to obtain a correction result, and record the correction result in the preset temperature range. The second test temperature determination module is configured to determine a second test temperature to be processed next from the test temperatures based on the arrangement order. The repetition module is configured to determine the second test temperature as the first test temperature and repeat the target steps, wherein the target steps include obtaining a preset temperature range and a preset temperature corresponding to the first test temperature, correcting the first test temperature based on the preset temperature to obtain a correction result, and recording the correction result in the preset temperature range. The correction parameter setting module is configured to set correction parameters of each preset temperature range based on correction results of each test temperature when all the test temperatures are corrected. The re-calibration module is configured to re-calibrate the designated temperature sensor based on the correction parameters.
[0061] In one embodiment, the first acquisition module 902 includes: The first temperature value set acquisition submodule is configured to obtain a first temperature value set of each preset time period after the last re-calibration of the designated temperature sensor and a second temperature value set actually measured by each designated temperature sensor, wherein the first temperature value set includes first temperature values of multiple preset time periods, and the second temperature value set includes second temperature values of multiple preset time periods. The temperature difference value calculation submodule is configured to subtract the corresponding second temperature value from the first temperature value to obtain a temperature difference value set corresponding to all preset temperature ranges.
[0062] In one embodiment, the correction device of the temperature sensor further includes: The historical time point acquisition module is configured to obtain a historical time point of the last re-calibration. The historical time point judgment module is configured to monitor whether an interval duration from the historical time point to the current time point reaches a preset interval period. The determination module is used to monitor the interval duration and determine if the conditions for performing the step of placing the pre-calibrated specified temperature sensor in an external environment with multiple preset temperatures to obtain the test temperature of the specified temperature sensor are met.
[0063] In one embodiment, the calibration parameter setting module includes: An initial counting matrix setting submodule is used to set an initial counting matrix; wherein the dimension of the initial counting matrix is the same as the number of preset temperature ranges; The assignment submodule is used to assign values to the numbers in the initial counting matrix according to the number of each test temperature within each preset temperature range, so as to obtain the target counting matrix; The first correction parameter setting submodule is used to calculate the average value of each temperature correction result for the first coordinate in the target counting matrix that is not zero, so as to use it as the correction parameter for the preset temperature range.
[0064] In one embodiment, the calibration parameter setting module further includes: The second coordinate marking submodule is used to mark the second coordinate that is 0 in each of the target counting matrices; The adjacent preset temperature range correction parameter acquisition submodule is used to acquire the correction parameters of the adjacent preset temperature ranges of the preset temperature range corresponding to the second coordinate; The second calibration parameter setting submodule is used to set the calibration parameters for the preset temperature range according to the calibration parameters of the adjacent preset temperature range.
[0065] Figure 4 An internal structural diagram of an electronic device in one embodiment is shown. This electronic device can specifically be a terminal or a server, and more specifically, a temperature measuring device containing the designated sensor. Figure 4 As shown, the electronic device includes a processor, a memory, and a network interface connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and may also store a computer program. When executed by the processor, this computer program enables the processor to implement a temperature sensor calibration method. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to implement the temperature sensor calibration method. Those skilled in the art will understand that... Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0066] In one embodiment, an electronic device is provided, comprising a memory and a processor, the memory storing a computer program, the computer program being executed by the processor to cause the processor to perform the following steps: obtaining temperature difference values of the specified temperature sensor in a plurality of preset temperature ranges within a plurality of preset time periods to obtain a temperature difference value set corresponding to each preset temperature range; wherein the temperature difference value is the difference between the measured temperature value and the actual temperature value of the specified temperature sensor; calculating the change value of the temperature difference values of adjacent two preset time periods in the temperature difference value set to obtain a temperature difference value change set; fitting a relationship function of each preset temperature range according to the temperature difference value set and the temperature difference value change set; obtaining a current time point and obtaining a target temperature difference value of each preset temperature range according to the relationship function and the current time point; Based on the target temperature difference value, the specified temperature sensor is preliminarily calibrated. By obtaining the temperature difference values of different preset temperature ranges in a plurality of preset time periods, a comprehensive temperature response model is constructed. The change value of adjacent temperature difference values is used to extract the nonlinear characteristics to fit the relationship function, and the target temperature difference value of the current time point is dynamically obtained, realizing the intelligentization and real-time of temperature correction. The inconvenience of traditional temperature sensor relying on factory calibration is avoided, the error caused by temperature floating in actual application is reduced, and the calibration time and cost are reduced.
[0067] In one embodiment, a computer readable storage medium is provided, storing a computer program, the computer program being executed by a processor to cause the processor to perform the following steps: obtaining temperature difference values of the specified temperature sensor in a plurality of preset temperature ranges within a plurality of preset time periods to obtain a temperature difference value set corresponding to each preset temperature range; wherein the temperature difference value is the difference between the measured temperature value and the actual temperature value of the specified temperature sensor; calculating the change value of the temperature difference values of adjacent two preset time periods in the temperature difference value set to obtain a temperature difference value change set; fitting a relationship function of each preset temperature range according to the temperature difference value set and the temperature difference value change set; obtaining a current time point and obtaining a target temperature difference value of each preset temperature range according to the relationship function and the current time point; The specified temperature sensor is preliminarily calibrated based on the target temperature difference. By acquiring temperature differences of different preset temperature ranges at multiple preset time periods, a comprehensive temperature response model is constructed, and the change value of adjacent temperature differences is used to extract nonlinear characteristics to fit a relationship function, so that the target temperature difference at the current time point is dynamically acquired, and the intelligentization and real-time of temperature correction are realized. The inconvenience of the traditional temperature sensor depending on factory calibration is avoided, the error caused by temperature fluctuation in actual application is reduced, and the calibration time and cost are reduced.
[0068] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware. The program can be stored in a non-volatile computer readable storage medium. When the program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, storage, database or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM) and memory bus dynamic RAM (RDRAM).
[0069] The technical features of the above embodiments can be combined in any manner. To make the description concise, all possible combinations of the technical features in the above embodiments are not described, but as long as the combinations of the technical features do not exist, they should be considered as the scope of the present application.
[0070] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the patent scope of the present application. It should be noted that for ordinary skilled persons in the art, without departing from the concept of the present application, some modifications and improvements can be made, which are within the protection scope of the present application. Therefore, the patent protection scope of the present application should be subject to the appended claims.
Claims
1. A method of calibrating a temperature sensor, characterized by, The method comprises: obtaining temperature difference values of a specified temperature sensor in a plurality of preset temperature ranges within a plurality of preset time periods to obtain a temperature difference value set corresponding to each preset temperature range; wherein the temperature difference value is the difference between the temperature value measured by the specified temperature sensor and the actual temperature value; calculating the change value of the temperature difference values of two adjacent preset time periods in the temperature difference value set to obtain a temperature difference value change set; fitting a relationship function of each preset temperature range according to the temperature difference value set and the temperature difference value change set; obtaining a current time point and obtaining a target temperature difference value of each preset temperature range according to the relationship function and the current time point; preliminarily calibrating the specified temperature sensor based on the target temperature difference value.
2. The temperature sensor correction method according to claim 1, characterized by, The step of fitting a relationship function of each preset temperature range according to the temperature difference value set and the temperature difference value change set comprises: The initial relationship function of each preset temperature range is preset , then ; wherein, denotes the s-th preset time period in the r-th preset temperature range, denotes the predicted temperature difference corresponding to the s-th preset time period in the r-th preset temperature range, t, , ,..., are all parameters to be solved, is the derivative of . The error minimum value is calculated by an error minimum value calculation formula The error minimum value is calculated by an error minimum value calculation formula is an error value, is a derivative of the error value, when 1 , represents a temperature difference value corresponding to the s preset time period in the r preset temperature range, represents a temperature difference value corresponding to the s+1 preset time period in the r preset temperature range, represents a temperature difference value corresponding to the s-1 preset time period in the r preset temperature range, represents the s+1 preset time period in the r preset temperature range, represents the s-1 preset time period in the r preset temperature range, when s=1, , when s=n, , represents finding a minimum value; Taking partial derivatives of the right side of the two equations of the error minimum calculation formula, we get , which is converted into a matrix and simplified to get the first matrix and the second matrix , respectively; According to the first matrix and the second matrix, a parameter t is solved, , , and substituted into the initial relationship function respectively, to obtain a relationship function of each preset temperature range.
3. The temperature sensor correction method according to claim 1, characterized by, After the step of preliminarily calibrating the specified temperature sensor based on the target temperature difference value, the method further comprises: placing the preliminarily calibrated specified temperature sensor in a plurality of preset temperature external environments in turn to obtain test temperatures of the specified temperature sensor; obtaining a corresponding target preset temperature range based on the test temperatures; arranging the test temperatures and determining a first test temperature to be processed currently from the test temperatures based on the arrangement order; obtaining a preset temperature range and a preset temperature corresponding to the first test temperature, correcting the first test temperature based on the preset temperature to obtain a correction result, and recording the correction result in the preset temperature range; determining a second test temperature to be processed next from the test temperatures based on the arrangement order; determining the second test temperature as the first test temperature and repeating the target step; the target step is to obtain a preset temperature range and a preset temperature corresponding to the first test temperature, correct the first test temperature based on the preset temperature to obtain a correction result, and record the correction result in the preset temperature range; when all the test temperatures are corrected, setting correction parameters of each preset temperature range based on the correction results of the test temperatures; re-calibrating the specified temperature sensor based on the correction parameters.
4. The temperature sensor correction method according to claim 3, wherein The step of obtaining temperature difference values of a specified temperature sensor in a plurality of preset temperature ranges within a plurality of preset time periods to obtain a temperature difference value set corresponding to each preset temperature range comprises: obtaining a first temperature value set of the specified temperature sensor after the last re-calibration of each preset time period and a second temperature value set actually measured by each specified temperature sensor; wherein the first temperature value set includes first temperature values of a plurality of preset time periods, and the second temperature value set includes second temperature values of a plurality of preset time periods; subtracting the corresponding second temperature value from the first temperature value to obtain a temperature difference value set corresponding to all preset temperature ranges.
5. The temperature sensor correction method according to claim 3, wherein The step of sequentially placing the preliminary calibrated specified temperature sensor in multiple preset temperature external environments to obtain the test temperature of the specified temperature sensor further comprises the following steps before the step of sequentially placing the preliminary calibrated specified temperature sensor in multiple preset temperature external environments to obtain the test temperature of the specified temperature sensor: Obtaining a historical time point of the last recalibration; Monitoring whether an interval length from the historical time point to the current time point reaches a preset interval period; If the interval length reaches the preset interval period, it is determined that the condition for executing the step of sequentially placing the preliminary calibrated specified temperature sensor in multiple preset temperature external environments to obtain the test temperature of the specified temperature sensor is met.
6. The temperature sensor correction method according to claim 3, wherein The step of setting the correction parameters of each preset temperature range based on the correction results of each test temperature after all test temperatures are corrected comprises the following steps: Setting an initial count matrix; wherein the dimension of the initial count matrix is the same as the number of preset temperature ranges; According to the number of each test temperature in each preset temperature range, the numbers in the initial count matrix are valued to obtain a target count matrix; For the first coordinates in the target count matrix that are not 0, the average value of each temperature correction result is calculated as the correction parameter of the preset temperature range.
7. The temperature sensor correction method according to claim 6, wherein The step of setting the correction parameters of each preset temperature range based on the correction results of each test temperature after all test temperatures are corrected further comprises the following steps after the step of calculating the average value of each temperature correction result for the first coordinates in the target count matrix that are not 0 as the correction parameter of the preset temperature range: Marking the second coordinates in each target count matrix that are 0; Obtaining the correction parameters of the adjacent preset temperature range of the preset temperature range corresponding to the second coordinates; Setting the correction parameters of the preset temperature range according to the correction parameters of the adjacent preset temperature range.
8. A correction device for a temperature sensor, characterized in that The device comprises: A first obtaining module for obtaining temperature difference values of a specified temperature sensor in multiple preset temperature ranges within multiple preset time periods to obtain a temperature difference value set corresponding to each preset temperature range; wherein the temperature difference value is the difference between the temperature value measured by the specified temperature sensor and the actual temperature value; A calculation module for calculating the change value of the temperature difference values of adjacent two preset time periods in the temperature difference value set to obtain a temperature difference value change set; A fitting module for fitting a relationship function of each preset temperature range according to the temperature difference value set and the temperature difference value change set; A second obtaining module for obtaining a current time point and obtaining a target temperature difference value of each preset temperature range according to the relationship function and the current time point; A calibration module for preliminarily calibrating the specified temperature sensor based on the target temperature difference value.
9. A computer-readable storage medium, characterized in that, A computer program is stored, and when the computer program is executed by a processor, the processor executes the steps of the temperature sensor correction method according to any one of claims 1 to 7.
10. An electronic device, comprising: The device comprises a memory and a processor, and the memory stores a computer program, which is executed by the processor to make the processor execute the steps of the temperature sensor correction method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Temperature correction method, device, and computer readable storage medium
CN109341899A
Temperature correction device, sensor module, and temperature correction method
CN111735480A
Temperature calibration method and system, storage medium and electronic equipment
CN113483919A
Sensor data calibration method and calibration system
CN114440866A
Calibration device and method for long-rod low-temperature thermometer
CN115560880A