A dual-temperature sensor thermal interference self-compensation method based on independent MCUs and an intelligent terminal

By employing a dual-temperature sensor self-compensation method in smart home devices, and utilizing attribution analysis models and temperature difference calculations, the problems of individual temperature sensor differences and heat source interference are solved, achieving more accurate temperature measurement and system stability.

CN122360736APending Publication Date: 2026-07-10XIAMEN LEELEN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610741441.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-27
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

In existing smart home devices, individual parameter differences of temperature sensors and interference from internal heat sources lead to inaccurate temperature measurements. They cannot accurately distinguish between changes in ambient temperature and false temperature rises caused by internal heat conduction, resulting in deviations in the temperature information output by existing technologies.

Method used

A dual-temperature sensor thermal interference self-compensation method based on an independent MCU is adopted. By setting two temperature sensors at different locations, the temperature difference is calculated and self-compensation is performed. An attribution analysis model is established to quantify the contribution ratio of underlying physical causes, adjust the initial calibration coefficient, realize individualized adaptive calibration, and improve temperature measurement accuracy.

Benefits of technology

It achieves high accuracy and robustness in temperature measurement under complex working conditions, avoids overcompensation or undercompensation, ensures the accuracy and stability of the equipment under different load conditions, and prevents system malfunctions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122360736A_ABST
    Figure CN122360736A_ABST
Patent Text Reader

Abstract

This invention relates to a dual-temperature sensor thermal interference self-compensation method based on an independent MCU and a smart terminal. The method includes the following steps: calibrating two temperature sensors and calculating the theoretical temperature data of the two temperature sensors; defining the theoretical temperature data of the temperature sensor located near the device casing as T1, and the theoretical temperature data of the temperature sensor located near the device interior as T2; calculating the temperature difference between the two temperature sensors ΔT2 = T2 - T1; if ΔT2 is less than a preset interference temperature threshold, then outputting T1; if ΔT2 is greater than the preset interference temperature threshold but less than a preset invalid temperature threshold, then thermal interference is determined to exist and T1 is compensated by T2; if ΔT2 is greater than the preset invalid temperature threshold, then an anomaly is determined and discarded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of temperature correction, specifically to a method for self-compensation of thermal interference from dual temperature sensors based on an independent MCU, and a smart terminal. Background Technology

[0002] In smart home control devices, temperature detection is fundamental to achieving ambient temperature sensing and intelligent control. For example, temperature control panels and LCD control panels all have temperature detection functions. They typically contain temperature sensors or thermistors that detect temperature changes and are directly connected to the main controller. The main controller continuously samples, processes, and converts the temperature data into a final, visualized interface temperature.

[0003] Due to individual parameter differences in temperature sensors, their temperature sensing performance varies, which can lead to two temperature sensors of the same model returning different values ​​at the same temperature, resulting in inaccurate temperature measurements. Existing technologies typically involve multiple samplings, followed by linear fitting to calculate a correction coefficient between the temperature detected by the temperature sensor and the actual temperature. The corrected temperature is then output by multiplying the sensor's reading by this coefficient. Both the temperature sensor and thermistor use the same fixed correction coefficient, and all calculations are performed on the main control CPU. However, smart home devices are often installed in small spaces like 86-inch boxes. The inaccuracy of sensor detection on the MCU stems from the heat generated by the internal circuitry of the main control CPU, LCD screen, power supply, and speaker amplifier. The heavy load on the main control CPU generates significant heat, further affecting the temperature sensor's readings. Furthermore, existing technologies use a single temperature sensor to obtain the temperature at a specific location. When temperature differences exist across multiple locations, the information obtained by a single sensor is limited, failing to distinguish between genuine changes in ambient temperature and spurious temperature rises caused by internal heat conduction. This often leads to misinterpretations of the device's own heating as ambient temperature increases, resulting in inaccurate temperature information. Therefore, in applications requiring precise temperature measurement, the existing technologies lack sufficient temperature accuracy.

[0004] The purpose of this invention is to design a self-compensation method for thermal interference from dual temperature sensors based on an independent MCU and a smart terminal to address the problems existing in the prior art. Summary of the Invention

[0005] To address the problems existing in the prior art, the present invention provides a dual-temperature sensor thermal interference self-compensation method and a smart terminal based on an independent MCU, which can effectively solve at least one of the problems existing in the prior art.

[0006] The technical solution of this invention is: A dual-temperature sensor thermal interference self-compensation method based on an independent MCU includes two temperature sensors, one of which is located near the device housing, and the other is located near the device interior. The method includes the following steps: The two temperature sensors are calibrated and their theoretical temperature data are calculated. Define the theoretical temperature data of the temperature sensor located near the device casing as T1, and the theoretical temperature data of the temperature sensor located near the device interior as T2. Calculate the temperature difference between the two temperature sensors ΔT2 = T2 - T1. If ΔT2 is less than the preset interference temperature threshold, then output T1; If ΔT2 is greater than the preset interference temperature threshold and less than the preset invalid temperature threshold, then thermal interference is determined to exist and T1 is compensated by T2. If ΔT2 is greater than the preset invalid temperature threshold, it is considered abnormal and discarded.

[0007] Furthermore, calibrating the two temperature sensors and calculating their theoretical temperature data includes: S1, Establish a temperature sensor attribution analysis model for multiple underlying physical causes of temperature difference corresponding to the temperature measurement error of the output temperature sensor and the contribution ratio of each underlying physical cause of temperature difference; S2, within a preset temperature range, traverse multiple temperature points at a preset step, collect the measurement data of the temperature sensor, and record the actual data at the same time. Analyze the measurement data and actual data through the temperature sensor attribution analysis model, and output the corresponding underlying physical cause of the temperature difference and the contribution ratio of each underlying physical cause of the temperature difference. S3. Solve the initial calibration coefficient of the temperature sensor based on the actual data and the measurement data. Adjust the initial calibration coefficient according to the contribution ratio corresponding to the underlying physical cause of the temperature difference to obtain the accurate calibration coefficients of the two temperature sensors respectively. Calculate the theoretical temperature data of the two temperature sensors based on the accurate calibration parameters.

[0008] Further, step S1 includes: The underlying physical causes of temperature differences for each temperature sensor and the contribution ratio of each underlying physical cause of temperature differences are collected to form a multidimensional difference feature vector. The measured temperature set and the corresponding actual temperature set of each temperature sensor are obtained by measuring the temperature multiple times. The large model is then trained to obtain the temperature sensor attribution analysis model.

[0009] Further, step S1 includes: S1.1, Determine the underlying physical causes of multiple temperature sensors and the contribution percentage of each underlying physical cause through destructive analysis, and the sum of the contribution percentages is 1; S1.2 Extract statistical features of temperature error from the measured temperature set and the actual temperature set. Use the multidimensional difference feature vector and the statistical features of temperature error as input features and the contribution ratio as output target to train a multi-output regression model to obtain the temperature sensor attribution analysis model. The output layer of the multi-output regression model uses the Softmax activation function to make the predicted values ​​of each contribution ratio satisfy the normalization constraint that the summation is 1.

[0010] Further, step S3 includes: S3.1, using the Steinhart-Hart equation and combining the collected measurement data with the actual data, a least-squares solution matrix containing calibration coefficients A0, A1, and A2 is constructed to obtain the initial calibration coefficient A0 corresponding to the temperature sensor. init A1 init A2 init ; S3.2, Establish the mapping relationship between the underlying physical cause of the temperature difference and the calibration coefficients A0, A1, and A2 to obtain the sensitivity coefficient matrix, and calculate the adjustment weight of each of the initial calibration coefficients based on the sensitivity coefficient matrix, the underlying physical cause of the temperature difference, and the contribution ratio. S3.3, adjust the initial calibration coefficient A0 according to the adjustment weights of each of the initial calibration coefficients. init A1 init A2 init To make corrections, the precise calibration coefficient A0 is obtained using the following formula. opt A1 opt A2 opt , A0 opt =A0 init +βw0, A1 opt =A1 init +βw1, A2 opt =A2 init +βw2, Where β is the global adjustment factor, 0 < β ≤ 1; Theoretical temperature data are calculated based on the precise calibration parameters.

[0011] Further, step S3.2 includes: S3.2.1, change the underlying physical causes of each temperature difference and control the deviation, and monitor the changes in the calibration coefficients A0, A1, and A2; S3.2.2, for each underlying physical cause of the temperature difference j, perform linear regression on the changes ΔA0, ΔA1, and ΔA2 corresponding to the multiple deviations δj and calibration coefficients A0, A1, and A2 respectively to obtain slopes α0j, α1j, and α2j. Organize all the underlying physical causes of the temperature difference into a matrix form to obtain the sensitivity coefficient matrix α: ; S3.2.3, the adjustment weights for each calibration coefficient are w0, w1, and w2, which are obtained by multiplying each contribution percentage pj by the sensitivity coefficient corresponding to the sensitivity coefficient matrix and then summing the results: ; ; .

[0012] Further, after calibrating the two temperature sensors and calculating their theoretical temperature data, the process includes: Multiple theoretical temperature data are collected to form a theoretical temperature dataset. The theoretical temperature dataset is subjected to abrupt change detection and small change filtering. Based on trend judgment, only theoretical temperature data that show a continuous increase or decrease are identified as valid changes and reported.

[0013] Furthermore, including: Theoretical temperature data is collected periodically according to a preset sampling period and stored in a circular buffer of preset length. The theoretical temperature dataset is subjected to mutation detection. Data with mutation values ​​greater than a preset mutation threshold is discarded, and the weighted average of the theoretical temperature data in the circular buffer is used to replace the mutation values. The current theoretical temperature data is compared with the previous theoretical temperature data. If the difference is greater than the preset alarm threshold, proceed to the next step. If the theoretical temperature data continues to increase or decrease for M consecutive cycles, it is considered a valid change and reported.

[0014] Furthermore, compensating T1 through T2 includes: T1 is compensated by T1-K×ΔT2, where K is 0-0.5.

[0015] Furthermore, a smart terminal is provided that implements the aforementioned dual-temperature sensor thermal interference self-compensation method based on an independent MCU during operation.

[0016] Therefore, the present invention provides the following effects and / or advantages: This application establishes an attribution analysis model to output the underlying physical causes and their contribution percentages. Then, it collects measured and actual data through a controllable temperature chamber, uses the model to output the causes and their proportions, and solves for initial calibration coefficients based on the actual and measured data. These initial calibration coefficients are then adjusted by the contribution percentages to obtain precise calibration coefficients, which are subsequently used to calculate theoretical temperature data. Finally, the theoretical temperature dataset undergoes abrupt change detection, small change filtering, and trend judgment before only reporting continuously changing data. By introducing an attribution analysis model to quantify the contribution percentage of each underlying physical cause and adjusting the initial calibration coefficients accordingly, individualized adaptive calibration is achieved, improving the accuracy of temperature measurement across the entire temperature range. Simultaneously, by linking the placement of two temperature sensors and their calculated temperature data, the temperature data from both locations can be considered simultaneously, and a comprehensive judgment can be made based on the temperature difference between them, obtaining more accurate temperature information according to specific circumstances.

[0017] This segmented strategy matches the compensation behavior to the actual intensity of the heat source, avoiding overcompensation or undercompensation. When the equipment is in standby or under low load, no compensation is needed, ensuring original accuracy. Under high load, resulting in corresponding temperature differences, compensation is automatically activated to maintain the accuracy of the ambient temperature. In extreme abnormal situations, erroneous data is automatically masked and safety values ​​are activated to prevent system malfunctions. This adaptive hierarchical processing significantly improves the system's robustness under complex operating conditions.

[0018] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained through the structures particularly pointed out in the description and the drawings.

[0019] It should be understood that the above summary and the following detailed description of the invention are exemplary and explanatory, and are intended to provide further explanation of the invention as claimed. Attached Figure Description

[0020] Figure 1 This is a flowchart illustrating one embodiment of the present invention. Detailed Implementation

[0021] To facilitate understanding by those skilled in the art, the present invention will now be described in further detail with reference to the embodiments: refer to Figure 1 A dual-temperature sensor thermal interference self-compensation method based on an independent MCU includes two temperature sensors, one of which is located near the device housing, and the other is located near the device interior. The method includes the following steps: S1, Establish a temperature sensor attribution analysis model for multiple underlying physical causes of temperature difference corresponding to the temperature measurement error of the output temperature sensor and the contribution ratio of each underlying physical cause of temperature difference; S2, within a preset temperature range, traverse multiple temperature points at a preset step, collect the measurement data of the temperature sensor, and record the actual data at the same time. Analyze the measurement data and actual data through the temperature sensor attribution analysis model, and output the corresponding underlying physical cause of the temperature difference and the contribution ratio of each underlying physical cause of the temperature difference. S3, calculate the initial calibration coefficient of the temperature sensor based on the actual data and the measured data, adjust the initial calibration coefficient according to the contribution ratio corresponding to the underlying physical cause of the temperature difference, and obtain the precise calibration coefficients of the two temperature sensors respectively, and calculate the theoretical temperature data of the two temperature sensors based on the precise calibration parameters. S4, define the theoretical temperature data of the temperature sensor located near the device casing as T1, and the theoretical temperature data of the temperature sensor located near the device interior as T2, and calculate the temperature difference between the two temperature sensors ΔT2=T2-T1; If ΔT2 is less than the preset interference temperature threshold, then output T1; If ΔT2 is greater than the preset interference temperature threshold and less than the preset invalid temperature threshold, then thermal interference is determined to exist and T1 is compensated by T2. If ΔT2 is greater than the preset invalid temperature threshold, it is considered abnormal and discarded.

[0022] This embodiment establishes an attribution analysis model to output the underlying physical causes and their contribution percentages. Then, it collects measured and actual data through a controllable temperature chamber, uses the model to output the causes and their proportions, and solves for initial calibration coefficients based on the actual and measured data. These initial calibration coefficients are then adjusted by the contribution percentages to obtain precise calibration coefficients, which are used to calculate theoretical temperature data. Finally, the theoretical temperature dataset undergoes abrupt change detection, small change filtering, and trend judgment before only reporting continuously changing data. By introducing an attribution analysis model to quantify the contribution percentage of each underlying physical cause and adjusting the initial calibration coefficients accordingly, individualized adaptive calibration is achieved, improving the accuracy of temperature measurement across the entire temperature range. Simultaneously, by linking the placement of two temperature sensors and their calculated temperature data, the temperature data from both locations can be considered simultaneously, and a comprehensive judgment can be made based on the temperature difference between them, obtaining more accurate temperature information according to specific circumstances.

[0023] This segmented strategy matches the compensation behavior to the actual intensity of the heat source, avoiding overcompensation or undercompensation. When the equipment is in standby or under low load, no compensation is needed, ensuring original accuracy. Under high load, resulting in corresponding temperature differences, compensation is automatically activated to maintain the accuracy of the ambient temperature. In extreme abnormal situations, erroneous data is automatically masked and safety values ​​are activated to prevent system malfunctions. This adaptive hierarchical processing significantly improves the system's robustness under complex operating conditions.

[0024] Further, step S1 includes: The underlying physical causes of temperature differences for each temperature sensor and the contribution ratio of each underlying physical cause of temperature differences are collected to form a multidimensional difference feature vector. The measured temperature set and the corresponding actual temperature set of each temperature sensor are obtained by measuring the temperature multiple times. The large model is then trained to obtain the temperature sensor attribution analysis model.

[0025] Specifically, step S1 includes: S1.1, Determine the underlying physical causes of multiple temperature sensors and the contribution percentage of each underlying physical cause through destructive analysis, and the sum of the contribution percentages is 1; S1.2 Extract statistical features of temperature error from the measured temperature set and the actual temperature set. Use the multidimensional difference feature vector and the statistical features of temperature error as input features and the contribution ratio as output target to train a multi-output regression model. The output layer of the multi-output regression model adopts the Softmax activation function so that the predicted values ​​of each contribution ratio in the output satisfy the normalization constraint that the summation is 1.

[0026] In this step, the underlying physical reasons may include: Resistance reference deviation is the deviation of the actual resistance of the temperature sensor from the nominal value at 25℃. It will produce an approximately constant temperature shift across the entire temperature range, which is manifested as an overall upward or downward shift of the calibration curve, while the shape remains unchanged. The deviation of the B-value curve is that the error increases significantly when it is far from 25℃, while the error is very small near 25℃. When the B-value is small, the temperature sensor reading is higher in the low-temperature region and lower in the high-temperature region. When the B-value is large, the opposite is true, and the error curve crosses zero near 25℃, and the error signs are opposite in the low-temperature region and the high-temperature region. Chip geometric deviation is the actual size of the temperature sensor deviating from the design value. It is usually manifested as a systematic deviation in both resistance and B value. The influence mode is similar to the combined effect of resistance deviation and B value deviation, which is manifested as R25 and B25 / 85 both exceeding the tolerance at the same time, and the error curve has mixed characteristics. Voltage divider resistor drift is when the actual resistance value of the voltage divider resistor connected in series with the temperature sensor deviates from the design value, or when the temperature drift is too large. This manifests as a residual error related to the measured temperature value still existing after the temperature sensor has been calibrated. ADC reference voltage deviation is the deviation of the actual value of the reference voltage of the ADC inside the MCU from the nominal value. When the ADC converts analog voltage into digital quantity, the deviation causes all voltage measurement values ​​to be scaled proportionally. The error increases with the increase of temperature by a fixed percentage deviation. Self-heating effect deviation is caused by the Joule heat generated on the temperature sensor by the measuring excitation current, which makes the temperature sensor itself higher than the ambient temperature. This manifests as normal readings in the high-temperature range and higher readings in the low-temperature range. The failure of the thermal insulation structure is caused by the independent cavity used to isolate the internal heat source, the thermal insulation material being damaged, falling off, or being short-circuited, resulting in heat being transferred to the ambient temperature sensor. This manifests as the ambient temperature reading continuously rising after the equipment has been running for a period of time, and the reading rapidly dropping after the internal heat source is disconnected.

[0027] In this embodiment, through destructive analysis, such as intentionally altering a feature of the temperature sensor or changing it in a simulation environment, the contribution ratio is determined as follows: for each underlying physical cause, the temperature measurement error amplitude caused by the maximum deviation of its corresponding characteristic parameter within a preset variation range is determined in advance through experiments or simulations, and then each error component is normalized to obtain the contribution ratio of each cause.

[0028] Further, step S3 includes: S3.1, using the Steinhart-Hart equation and combining the collected measurement data with the actual data, a least-squares solution matrix containing calibration coefficients A0, A1, and A2 is constructed to obtain the initial calibration coefficient A0 corresponding to the temperature sensor. init A1 init A2 init ; In this step, the least squares calibration treats the errors at all temperature points equally, resulting in an initial calibration coefficient A0. init A1 init A2 init The initial calibration coefficients are mathematically globally optimal, minimizing the sum of squared residuals across all temperature points. However, they do not consider the physical causes of these errors. Different underlying physical causes have completely different effects on the Steinhart-Hart equation coefficients A0, A1, and A2. For example, resistance reference deviation mainly causes an overall offset, thus primarily affecting A0, with little impact on A1 and A2. Alternatively, B-value curve deviation mainly affects the temperature sensor's sensitivity and nonlinearity, significantly impacting A1 and A2, but minimally affecting A0.

[0029] Specifically, according to the Steinhart-Hart equation, the temperature and resistance of the temperature sensor have the following relationship: 1 / T=A0+A1×ln(R)+A2×[ln(R)]^3.

[0030] Generally, indoor temperatures are mostly between -20℃ and 55℃. For temperatures within this range, each actual temperature value Ti corresponds to an observed value Rn. Substituting Rn into the above formula, we can obtain the theoretically calculated temperature value Tn, i.e., 1 / Tn = A0 + A1 × ln(Rn) + A2 × [ln(Rn)]^3, where i and n are positive integers in the interval [1, 76]. Assuming Xn = ln(Rn), Zn = [ln(Rn)]^3, Yn = 1 / Tn, and Yi = 1 / Ti, we can obtain the defined function of the total residual sum of squares. Simplified and synchronized into matrix form, it is as follows: .

[0031] Then, by substituting the measured values ​​into the above matrix, the initial calibration coefficient A0 can be calculated. init A1 init A2 init .

[0032] S3.2, Establish the mapping relationship between the underlying physical cause of the temperature difference and the calibration coefficients A0, A1, and A2 to obtain the sensitivity coefficient matrix, and calculate the adjustment weight of each of the initial calibration coefficients based on the sensitivity coefficient matrix, the underlying physical cause of the temperature difference, and the contribution ratio. In this step, if we already know the contribution percentage (pj) of each underlying physical cause of the current temperature difference in the sensor, and understand the impact of each underlying physical cause on the sensitivity coefficients A0, A1, and A2, then we can predict the deviation of the underlying physical causes in the coefficient space. The combined contribution will result in the expected offset of A0, A1, and A2, which will be used as adjustment weights. At this point, the deviation proportion at the physical cause level can be converted into the appropriate correction amount in the coefficient space, thereby performing targeted fine-tuning of the initial coefficients to obtain more accurate coefficients that better reflect the actual physical characteristics of the sensor. S3.3, adjust the initial calibration coefficient A0 according to the adjustment weights of each of the initial calibration coefficients. init A1 init A2 init After correction, the accurate calibration coefficient A0 is obtained. opt A1 opt A2 opt The theoretical temperature data is calculated based on the precise calibration parameters.

[0033] Further, step S3.2 includes: S3.2.1, change the underlying physical causes of each temperature difference and control the deviation, and monitor the changes in the calibration coefficients A0, A1, and A2; In this step, a single variable is controlled and all deviations are iterated step by step. For example, a precision adjustable resistor is connected in series with the pin of the temperature sensor, and resistors are introduced at +2%, +1%, 0%, -1%, and -2% respectively to simulate the change in the resistance reference deviation of the temperature sensor. Then, the changes corresponding to the calibration coefficients A0, A1, and A2 are recorded.

[0034] S3.2.2, for each underlying physical cause of the temperature difference j, perform linear regression on the changes ΔA0, ΔA1, and ΔA2 corresponding to the multiple deviations δj and calibration coefficients A0, A1, and A2 respectively to obtain slopes α0j, α1j, and α2j. Organize all the underlying physical causes of the temperature difference into a matrix form to obtain the sensitivity coefficient matrix α: ; In this step, for each temperature difference underlying physical cause j, multiple deviations δj are generated, resulting in multiple variables ΔA0, ΔA1, and ΔA2. Within a small deviation range, linear approximation is usually sufficient to express the relationship between the two. Therefore, linear regression fitting is performed on the deviation δj using the variables ΔA0, ΔA1, and ΔA2 to obtain the slopes α0j, α1j, and α2j between the variables ΔA0, ΔA1, and ΔA2 and the deviation δj. Combining all the slopes into a matrix yields the sensitivity coefficient matrix α.

[0035] S3.2.3, the adjustment weights for each calibration coefficient are w0, w1, and w2, which are obtained by multiplying each contribution percentage pj by the sensitivity coefficient corresponding to the sensitivity coefficient matrix and then summing the results: ; ; .

[0036] In this step, the contribution percentage pj is introduced because the contribution of each underlying cause of temperature difference reflected in the temperature error of each temperature sensor is different. This step determines what proportion of the total error of the current sensor is caused by the j-th underlying cause of temperature difference. Then, the system can rationally allocate adjustment weights to each coefficient based on this proportion. For example, if the contribution percentage of the resistance reference deviation is high, the system needs to focus on the influence of the resistance reference deviation when adjusting the calibration coefficients, and A0 needs to be adjusted accordingly. By using a weighted summation method, the required adjustment weight for each calibration coefficient can be accurately determined.

[0037] Further, in step S3.3, the initial calibration coefficient A0 is adjusted according to the adjustment weights of each of the initial calibration coefficients. init A1 init A2 init After correction, the accurate calibration coefficient A0 is obtained.opt A1 opt A2 opt include: The correction should be made according to the following formula: A0 opt =A0 init +βw0, A1 opt =A1 init +βw1, A2 opt =A2 init +βw2, Where β is the global adjustment factor, 0 < β ≤ 1.

[0038] In this step, β is a global adjustment factor, representing the degree of confidence in the weights. For example, β=1 indicates complete confidence in the attribution analysis results and full correction, while a β value of 0.5 indicates conservative confidence in the attribution analysis results and full correction. In this embodiment, β can be 0.5 or 0.8.

[0039] For example, for a temperature sensor, the actual test temperature error range before calibration correction is ±1℃. Using the correction calibration factor A0... opt A1 opt A2 opt The actual test temperature error range was reduced to ±0.3℃, and the accuracy in the high and low temperature ranges was significantly increased, while the overall root mean square error was significantly reduced.

[0040] Furthermore, the period after S3 and before S4 includes: Multiple theoretical temperature data are collected to form a theoretical temperature dataset. The theoretical temperature dataset is subjected to abrupt change detection and small change filtering. Based on trend judgment, only theoretical temperature data that show a continuous increase or decrease are identified as valid changes and reported.

[0041] Furthermore, including: Theoretical temperature data is collected periodically according to a preset sampling period and stored in a circular buffer of preset length. The theoretical temperature dataset is subjected to mutation detection. Data with mutation values ​​greater than a preset mutation threshold is discarded, and the weighted average of the theoretical temperature data in the circular buffer is used to replace the mutation values. In this step, after each temperature sensor reading, the MCU first performs a sudden change detection: Sudden change value = |T – T_last|, where T_last is the temperature value of the previous reading and T is the temperature value of the current reading. If the sudden change value is greater than the preset sudden change threshold (e.g., 3℃), the current data is considered to be an abnormal sudden change, which may be caused by transient interference, electromagnetic interference or poor sensor contact, and this value is not used directly.

[0042] Next, the abrupt change value is replaced with a weighted average of the historical data within the sliding window.

[0043] The current theoretical temperature data is compared with the previous theoretical temperature data. If the difference is greater than the preset alarm threshold, proceed to the next step. In this step, ΔT = |T - T_rep|, where T_rep is the temperature value previously reported to the CPU.

[0044] If ΔT is less than the preset alarm threshold (e.g., 0.2℃), the temperature change is considered too small, belonging to normal fluctuations or noise, and is not reported to the CPU. This mechanism can reduce the amount of data reported by 60%-80%, significantly reducing bus bandwidth usage and CPU interrupt count, while not affecting the user experience of temperature display.

[0045] If the theoretical temperature data continues to increase or decrease for M consecutive cycles, it is considered a valid change and reported.

[0046] In this step, when the temperature change exceeds the 0.2℃ threshold, it is not reported immediately, but the data is added to the trend judgment buffer for trend analysis: Determine the data trend over the most recent N sampling periods (e.g., three consecutive periods). If there is a continuous upward or downward trend, it indicates that the ambient temperature is indeed rising, and the data should be reported. If the data fluctuates between rising and falling or falling and rising, it may indicate noise interference, and the data should not be reported immediately; continued observation is advised. This reduces the amount of data uploaded and lowers the processing load on the main control CPU.

[0047] Furthermore, in step S4, compensating T1 through T2 includes: T1 is compensated by T1-K×ΔT2, where K is 0-0.5.

[0048] Furthermore, a smart terminal is provided that implements the aforementioned dual-temperature sensor thermal interference self-compensation method based on an independent MCU during operation.

[0049] In this embodiment, compared to traditional single-temperature sensor solutions that cannot distinguish between real changes in ambient temperature and false temperature rises caused by internal heat source conduction, often misinterpreting device self-heating as ambient temperature rise, the heat generated by the internal heat source is transferred to T1 through thermal conduction, thermal radiation, or air convection, causing the T1 reading to be artificially high. The compensation formula subtracts a quantity (K×ΔT2) proportional to the degree of overheating ΔT2 from T1, thereby restoring the true ambient temperature. The relationship coefficient between ΔT2 and the sensor temperature rise is theoretically less than 0.5, or even smaller. Preferably, the K value is between 0.2 and 0.4, so limiting K ≤ 0.5 better reflects the combined effects of PCB copper foil thermal conduction, air gap convection, and cavity radiation. By monitoring the heat source intensity in real time with one temperature sensor and dynamically subtracting its coupling effect on the other temperature sensor, the reported ambient temperature is closer to the true external temperature.

[0050] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0051] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0052] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0053] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0054] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms should not be construed as necessarily referring to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

Claims

1. A self-compensation method for thermal interference from dual temperature sensors based on an independent MCU, characterized in that: The method includes two temperature sensors, one located near the device housing and the other located near the device interior. The method comprises the following steps: The two temperature sensors are calibrated and their theoretical temperature data are calculated. Define the theoretical temperature data of the temperature sensor located near the device casing as T1, and the theoretical temperature data of the temperature sensor located near the device interior as T2. Calculate the temperature difference between the two temperature sensors ΔT2 = T2 - T1. If ΔT2 is less than the preset interference temperature threshold, then output T1; If ΔT2 is greater than the preset interference temperature threshold and less than the preset invalid temperature threshold, then thermal interference is determined to exist and T1 is compensated by T2. If ΔT2 is greater than the preset invalid temperature threshold, it is considered abnormal and discarded.

2. The thermal interference self-compensation method based on a dual temperature sensor with an independent MCU according to claim 1, characterized in that: The calibration of the two temperature sensors and the calculation of their theoretical temperature data include: S1, Establish a temperature sensor attribution analysis model for multiple underlying physical causes of temperature difference corresponding to the temperature measurement error of the output temperature sensor and the contribution ratio of each underlying physical cause of temperature difference; S2, within a preset temperature range, traverse multiple temperature points at a preset step, collect the measurement data of the temperature sensor, and record the actual data at the same time. Analyze the measurement data and actual data through the temperature sensor attribution analysis model, and output the corresponding underlying physical cause of the temperature difference and the contribution ratio of each underlying physical cause of the temperature difference. S3. Solve the initial calibration coefficient of the temperature sensor based on the actual data and the measurement data. Adjust the initial calibration coefficient according to the contribution ratio corresponding to the underlying physical cause of the temperature difference to obtain the accurate calibration coefficients of the two temperature sensors respectively. Calculate the theoretical temperature data of the two temperature sensors based on the accurate calibration parameters.

3. The thermal interference self-compensation method based on a dual temperature sensor with an independent MCU according to claim 2, characterized in that: Step S1 includes: The underlying physical causes of temperature differences for each temperature sensor and the contribution ratio of each underlying physical cause of temperature differences are collected to form a multidimensional difference feature vector. The measured temperature set and the corresponding actual temperature set of each temperature sensor are obtained by measuring the temperature multiple times. The large model is then trained to obtain the temperature sensor attribution analysis model.

4. The thermal interference self-compensation method based on a dual temperature sensor with an independent MCU according to claim 3, characterized in that: Step S1 includes: S1.1, Determine the underlying physical causes of multiple temperature sensors and the contribution percentage of each underlying physical cause through destructive analysis, and the sum of the contribution percentages is 1; S1.2 Extract statistical features of temperature error from the measured temperature set and the actual temperature set. Use the multidimensional difference feature vector and the statistical features of temperature error as input features and the contribution ratio as output target to train a multi-output regression model to obtain the temperature sensor attribution analysis model. The output layer of the multi-output regression model uses the Softmax activation function to make the predicted values ​​of each contribution ratio satisfy the normalization constraint that the summation is 1.

5. The thermal interference self-compensation method based on a dual temperature sensor with an independent MCU according to claim 2, characterized in that: Step S3 includes: S3.1, using the Steinhart-Hart equation and combining the collected measurement data with the actual data, a least-squares solution matrix containing calibration coefficients A0, A1, and A2 is constructed to obtain the initial calibration coefficient A0 corresponding to the temperature sensor. init A1 init A2 init ; S3.2, Establish the mapping relationship between the underlying physical cause of the temperature difference and the calibration coefficients A0, A1, and A2 to obtain the sensitivity coefficient matrix, and calculate the adjustment weight of each of the initial calibration coefficients based on the sensitivity coefficient matrix, the underlying physical cause of the temperature difference, and the contribution ratio. S3.3, adjust the initial calibration coefficient A0 according to the adjustment weights of each initial calibration coefficient. init A1 init A2 init To make corrections, the precise calibration coefficient A0 is obtained using the following formula. opt A1 opt A2 opt , A0 opt =A0 init +βw0, A1 opt =A1 init +βw1, A2 opt =A2 init +βw2, Where β is the global adjustment factor, 0 < β ≤ 1; Theoretical temperature data are calculated based on the precise calibration parameters.

6. The thermal interference self-compensation method based on a dual temperature sensor with an independent MCU according to claim 5, characterized in that: Step S3.2 includes: S3.2.1, change the underlying physical causes of each temperature difference and control the deviation, and monitor the changes in the calibration coefficients A0, A1, and A2; S3.2.2, for each underlying physical cause of the temperature difference j, perform linear regression on the changes ΔA0, ΔA1, and ΔA2 corresponding to the multiple deviations δj and calibration coefficients A0, A1, and A2 respectively to obtain slopes α0j, α1j, and α2j. Organize all the underlying physical causes of the temperature difference into a matrix form to obtain the sensitivity coefficient matrix α: ; S3.2.3, the adjustment weights for each calibration coefficient are w0, w1, and w2, which are obtained by multiplying each contribution percentage pj by the sensitivity coefficient corresponding to the sensitivity coefficient matrix and then summing the results: ; ; 。 7. The thermal interference self-compensation method based on a dual temperature sensor with an independent MCU according to claim 1, characterized in that: After calibrating the two temperature sensors and calculating their theoretical temperature data, the process includes: Multiple theoretical temperature data are collected to form a theoretical temperature dataset. The theoretical temperature dataset is subjected to abrupt change detection and small change filtering. Based on trend judgment, only theoretical temperature data that show a continuous increase or decrease are identified as valid changes and reported.

8. The thermal interference self-compensation method based on a dual temperature sensor with an independent MCU according to claim 7, characterized in that: include: Theoretical temperature data is collected periodically according to a preset sampling period and stored in a circular buffer of preset length. The theoretical temperature dataset is subjected to mutation detection. Data with mutation values ​​greater than a preset mutation threshold is discarded, and the weighted average of the theoretical temperature data in the circular buffer is used to replace the mutation values. The current theoretical temperature data is compared with the previous theoretical temperature data. If the difference is greater than the preset alarm threshold, proceed to the next step. If the theoretical temperature data continues to increase or decrease for M consecutive cycles, it is considered a valid change and reported.

9. The thermal interference self-compensation method based on a dual temperature sensor with an independent MCU according to claim 1, characterized in that: Compensation for T1 using T2 includes: T1 is compensated by T1-K×ΔT2, where K is 0-0.

5.

10. A smart terminal, characterized in that: During operation, it implements the thermal interference self-compensation method based on a dual temperature sensor with an independent MCU as described in any one of claims 1-9.