Temperature measurement data processing method and device, temperature sensor and storage medium
Patent Information
- Application Number
- CN202310830622.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-07
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2043-07-07
AI Technical Summary
但是这些处理方法得到的温度值的精度和稳定性还不够,随着使用场合的多样化、多变性,已无法满足当前的使用需求;并且,这些处理方法都无法解决硬件电路元件带来的偏差,且元件参数会随着使用时间的累积、环境(温度、湿度、应力等)变化等发生变化,这更进一步扩大了温度测量的全生命周内的偏差
[0044]根据本发明实施例的温度测量数据处理方法,通过基于记录热敏电阻的电阻值与温度值之间的对应关系的第一数据表,利用逐次逼近线性插值方法来确定测量得到的温度测量值,能够在基于硬件电路不变动的基础上,通过更改数据处理方法,提高温度测量的精度,且不增加硬件成本。
Smart Images

Figure CN116821569B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of temperature sensor technology, and in particular to a temperature measurement data processing method, apparatus, temperature sensor, and storage medium. Background Technology
[0002] In recent years, the market demand for temperature sensors has been growing rapidly, reflecting the significant role temperature plays in product performance and indirectly highlighting the urgent need for high-precision temperature measurement. In automotive electronics applications, negative temperature coefficient (NTC) sensors are typically used, employing a simple resistance voltage divider method for temperature measurement. The required temperature measurement range is generally between -40℃ and 150℃, with a measurement accuracy requirement of ±2℃. If some data (such as the state of charge (SOC) of a battery management system or the charge / discharge rate of an electric vehicle) needs to be corrected based on temperature, then the sensor's measurement accuracy requirement is ±1℃, or even less.
[0003] To meet the high requirements for measurement accuracy, the accuracy can be improved through hardware optimization, such as optimizing the accuracy of circuit components (e.g., using pull-up resistors with 1% or even 0.1% accuracy) and optimizing the power supply / pull-up power supply (e.g., using the voltage output of a low dropout regulator (LDO) with 1% accuracy, or even the voltage output of a reference power supply with 0.5% or ±10mV accuracy). However, hardware optimization greatly increases the cost of temperature sensors.
[0004] In addition, to meet the high requirements of measurement accuracy, the temperature data acquired by the analog-to-digital converter (ADC) can be further processed to improve measurement accuracy. A common processing method is the lookup table method based on the correspondence between resistance and temperature (RT table). This method calculates the corresponding NTC resistance value based on the temperature data acquired by the ADC and the circuit architecture and parameters of the temperature sensor, and then looks up the corresponding temperature value in the RT table. Currently, based on this method, simpler methods such as binary lookup table and median filtering have been introduced to reduce processing time, improve processing efficiency, and enhance anti-interference capabilities. However, the accuracy and stability of the temperature values obtained by these processing methods are still insufficient. With the diversification and variability of application scenarios, they can no longer meet current usage requirements. Furthermore, these processing methods cannot solve the deviations introduced by hardware circuit components, and component parameters change with the accumulation of usage time and environmental changes (temperature, humidity, stress, etc.), which further amplifies the deviation throughout the entire lifecycle of the temperature measurement. Summary of the Invention
[0005] In view of the above-mentioned problems in the prior art, the purpose of the present invention is to provide a temperature measurement data processing method, device, temperature sensor and storage medium, which can improve the accuracy and stability of temperature measurement and enhance anti-interference ability.
[0006] To address the aforementioned problems, this invention provides a temperature measurement data processing method applied to a temperature sensor, wherein the temperature sensor includes a thermistor and an analog-to-digital converter electrically connected to the thermistor, and the method includes:
[0007] Obtain the voltage measurement value output by the analog-to-digital converter in the temperature sensor;
[0008] Calculate the resistance value of the thermistor in the temperature sensor based on the voltage measurement value;
[0009] Based on the first data table, the temperature measurement value corresponding to the resistance measurement value is determined by the successive approximation linear interpolation method.
[0010] The first data table is used to record the correspondence between the resistance value and the temperature value of the thermistor.
[0011] Further, the step of determining the temperature measurement value corresponding to the resistance measurement value using a successive approximation linear interpolation method based on the first data table includes:
[0012] Based on the first data table, the target resistance value range in which the measured resistance value is located is determined;
[0013] Obtain the first maximum resistance value and the first minimum resistance value corresponding to the target resistance value range;
[0014] Obtain the first maximum temperature value corresponding to the first maximum resistance value and the first minimum temperature value corresponding to the first minimum resistance value;
[0015] Based on the measured resistance value, the first maximum resistance value, the first maximum temperature value, the first minimum resistance value, and the first minimum temperature value, the temperature measurement value corresponding to the measured resistance value is calculated using a linear interpolation method.
[0016] Optionally, determining the target resistance value range where the resistance measurement value falls based on the first data table includes:
[0017] The first resistance value interval containing the measured resistance value is obtained from the first data table and used as the target resistance value interval.
[0018] The step of obtaining the first maximum temperature value corresponding to the first maximum resistance value and the first minimum temperature value corresponding to the first minimum resistance value includes:
[0019] The first maximum temperature value corresponding to the first maximum resistance value and the first minimum temperature value corresponding to the first minimum resistance value are obtained respectively from the first data table.
[0020] Optionally, determining the target resistance value range where the resistance measurement value falls based on the first data table includes:
[0021] The first resistance value range in which the measured resistance value is located is obtained by querying the first data table.
[0022] Obtain the second data table corresponding to the first resistance value range. The second data table is used to record the correspondence between the resistance value and the temperature value in the first resistance value range.
[0023] The second resistance value interval containing the measured resistance value is obtained from the second data table and used as the target resistance value interval.
[0024] The step of obtaining the first maximum temperature value corresponding to the first maximum resistance value and the first minimum temperature value corresponding to the first minimum resistance value includes:
[0025] The first maximum temperature value corresponding to the first maximum resistance value and the first minimum temperature value corresponding to the first minimum resistance value are obtained from the second data table respectively.
[0026] Furthermore, obtaining the second data table corresponding to the first resistance value range includes:
[0027] Obtain the second maximum resistance value and the second minimum resistance value corresponding to the first resistance value range;
[0028] Retrieve the second maximum temperature value corresponding to the second maximum resistance value and the second minimum temperature value corresponding to the second minimum resistance value from the first data table;
[0029] Within the first resistance value range, multiple interpolated resistance values are determined;
[0030] Based on each of the interpolated resistor values, the second maximum resistance value, the second maximum temperature value, the second minimum resistance value, and the second minimum temperature value, the temperature value corresponding to each of the interpolated resistor values is calculated using a linear interpolation method.
[0031] The second data table is generated based on each of the interpolation resistor values and their corresponding temperature values.
[0032] Furthermore, the method also includes:
[0033] The temperature measurement value is filtered to obtain the target temperature value.
[0034] Preferably, the step of filtering the temperature measurement value to obtain the target temperature value includes:
[0035] The temperature measurement value is filtered using a Kalman filter algorithm to obtain the target temperature value.
[0036] Another aspect of the present invention provides a temperature measurement data processing device disposed on a temperature sensor, the temperature sensor including a thermistor and an analog-to-digital converter electrically connected to the thermistor, the device comprising:
[0037] A voltage measurement value acquisition module is used to acquire the voltage measurement value output by the analog-to-digital converter in the temperature sensor;
[0038] The resistance measurement calculation module is used to calculate the resistance measurement value of the thermistor in the temperature sensor based on the voltage measurement value.
[0039] The temperature measurement value determination module is used to determine the temperature measurement value corresponding to the resistance measurement value based on the first data table and using a successive approximation linear interpolation method.
[0040] The first data table is used to record the correspondence between the resistance value and the temperature value of the thermistor.
[0041] In another aspect, the present invention provides an electronic device including a processor and a memory, wherein the memory stores at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the temperature measurement data processing method described above.
[0042] In another aspect, the present invention provides a computer-readable storage medium storing at least one instruction or at least one program, wherein the at least one instruction or the at least one program is loaded and executed by a processor to implement the temperature measurement data processing method described above.
[0043] Due to the above technical solution, the present invention has the following beneficial effects:
[0044] According to the temperature measurement data processing method of the present invention, the measured temperature value is determined by using a successive approximation linear interpolation method based on a first data table recording the correspondence between the resistance value and temperature value of a thermistor. This method can improve the accuracy of temperature measurement without increasing hardware costs by changing the data processing method without altering the hardware circuit.
[0045] Furthermore, by applying Kalman filtering to the temperature measurement obtained using the successive approximation linear interpolation method, the final target temperature value can be obtained, which can further improve the accuracy and stability of temperature measurement, and has strong anti-interference ability. It can effectively cope with the diversity and variability of application scenarios. It has significant practical value for systems that need to use high-precision and high-stability temperature measurement values as an input condition for closed-loop control or use temperature to modify a key parameter. Attached Figure Description
[0046] To more clearly illustrate the technical solutions of the present invention, the accompanying drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without any creative effort.
[0047] Figure 1 This is a schematic diagram of the structure of a temperature sensor provided in one embodiment of the present invention;
[0048] Figure 2 This is a flowchart of a temperature measurement data processing method provided in one embodiment of the present invention;
[0049] Figure 3 This is a schematic diagram of a linear interpolation method provided in an embodiment of the present invention;
[0050] Figure 4 This is a flowchart of a temperature measurement data processing method provided in another embodiment of the present invention;
[0051] Figure 5 This is a schematic diagram of the filtering result provided in one embodiment of the present invention;
[0052] Figure 6 This is a schematic diagram of a test environment provided in one embodiment of the present invention;
[0053] Figure 7 This is a schematic diagram showing the comparison results of temperature measurement values provided in one embodiment of the present invention;
[0054] Figure 8 This is a schematic diagram of the structure of a temperature measurement data processing device provided in one embodiment of the present invention;
[0055] Figure 9 This is a schematic diagram of the structure of a temperature measurement data processing device provided in another embodiment of the present invention. Detailed Implementation
[0056] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0057] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0058] To make the objectives, technical solutions, and advantages disclosed in the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of the present invention and are not intended to limit the embodiments of the present invention.
[0059] Reference manual attached Figure 1 This illustrates a schematic diagram of the structure of a temperature sensor provided in one embodiment of the present invention. Figure 1 As shown, the temperature sensor may include a thermistor 110, a pull-up resistor 120, an analog-to-digital converter 130, and a data processing unit 140. The first terminal of the thermistor 110 is grounded, and the second terminal is electrically connected to the first terminal of the pull-up resistor 120 and the input terminal of the analog-to-digital converter 130, respectively. The second terminal of the pull-up resistor 120 is electrically connected to the power supply / pull-up power supply Vcc, and the output terminal of the analog-to-digital converter 130 is electrically connected to the data processing unit 140.
[0060] The temperature sensor can be an NTC sensor or a Positive Temperature Coefficient (PTC) sensor, and the thermistor 110 can be either an NTC or PTC sensor. The pull-up resistor 120 can be set to 10kΩ / ±1%, the power supply / pull-up power supply Vcc can be set to 5V with a deviation of ±60mV, the reference power supply of the analog-to-digital converter 130 can be set to be consistent with the power supply / pull-up power supply Vcc, and the total non-adjustable error of the analog-to-digital converter 130 can be ±4LSB. Furthermore, the deviation of the pull-up resistor 120 can be expanded to ±3% using worst-case analysis (WCA) techniques.
[0061] Specifically, the resistance value of the thermistor 110 can change with the ambient temperature, thus it can be used to detect the ambient temperature. As the resistance value of the thermistor 110 changes, the voltage value across the thermistor 110 also changes accordingly. The analog-to-digital converter 130 can receive the analog signal of the voltage across the thermistor 110, convert the analog signal into a digital signal, thereby obtaining the voltage measurement value across the thermistor 110, and transmitting it to the data processing unit 140.
[0062] In some embodiments, the voltage value converted by the analog-to-digital converter 130 and the resistance value of the thermistor 110 have the following relationship:
[0063]
[0064] Where Rntc(t) represents the resistance value of the thermistor 110 (NTC), Rup represents the resistance value of the pull-up resistor 120, Vcc represents the power supply / pull-up power supply, and Uad(t) represents the voltage value converted by the analog-to-digital converter 130.
[0065] Therefore, the data processing unit 140 can calculate the resistance value of the thermistor 110 based on the voltage value converted by the analog-to-digital converter 130 using the following formula (1):
[0066]
[0067] Then, based on the RT table, the resistance value closest to the calculated Rntc(t) can be found, and the corresponding temperature value can be obtained. The RT table represents a unique correspondence between NTC resistance and temperature under ideal conditions. For example, the RT table can be shown in Table 1 below:
[0068] Table 1
[0069]
[0070] As can be seen from Table 1, the temperature value obtained by this method has a resolution of 1℃. This shows that the accuracy and stability of the temperature value obtained by the above processing method are not enough. With the diversification and variability of application scenarios, it can no longer meet the current application requirements. Furthermore, these processing methods cannot solve the deviations caused by hardware circuit components, and the component parameters will change with the accumulation of usage time and environmental changes (temperature, humidity, stress, etc.), which further expands the deviation throughout the entire life cycle of temperature measurement.
[0071] To address the aforementioned problems, embodiments of the present invention provide a temperature measurement data processing method, apparatus, temperature sensor, and storage medium. The temperature measurement data processing method can be applied to... Figure 1 The temperature sensor shown aims to improve the accuracy and stability of temperature measurement without changing the hardware circuitry.
[0072] Specifically, the data processing unit 140 can use the temperature measurement data processing method provided in the embodiments of the present invention to process the voltage value converted by the analog-to-digital converter 130 to obtain the temperature value of the current environment.
[0073] It should be noted that, Figure 1 The temperature sensor shown is merely exemplary; in practical applications, the temperature sensor may also include components that are more... Figure 1 The embodiments of the present invention do not limit the number of more or fewer components shown.
[0074] Reference manual attached Figure 2 This illustrates a flowchart of a temperature measurement data processing method according to an embodiment of the present invention, which can be applied to... Figure 1 In the data processing unit of the temperature sensor, specifically, as shown in... Figure 2 As shown, the method may include the following steps:
[0075] S210: Obtain the voltage measurement value output by the analog-to-digital converter in the temperature sensor.
[0076] In this embodiment of the invention, the analog-to-digital converter in the temperature sensor can receive the analog signal of the voltage across the thermistor in the temperature sensor, convert the analog signal into a digital signal, thereby obtaining the voltage measurement value across the thermistor, and transmitting it to the data processing unit. Correspondingly, the data processing unit can receive the voltage measurement value output by the analog-to-digital converter.
[0077] Specifically, the temperature sensor can be an NTC sensor or a PTC sensor, and the thermistor in the temperature sensor can be an NTC or a PTC.
[0078] S220: Calculate the resistance measurement value of the thermistor in the temperature sensor based on the voltage measurement value.
[0079] In this embodiment of the invention, the resistance measurement value of the thermistor can be calculated using the above formula (1) based on the voltage measurement value.
[0080] S230: Based on the first data table, the temperature measurement value corresponding to the resistance measurement value is determined using a successive approximation linear interpolation method; wherein, the first data table is used to record the correspondence between the resistance value and the temperature value of the thermistor.
[0081] In this embodiment of the invention, based on the first data table, a larger resistance value range can be determined according to the measured resistance value. This larger range is then divided into multiple smaller resistance value ranges. Similarly, a smaller resistance value range is determined based on the measured resistance value, and this smaller range is further divided into multiple even smaller resistance value ranges. This process is repeated until the target resistance value range is finally determined. Using the first maximum and first minimum resistance values corresponding to this target resistance value range, as well as the first maximum temperature value corresponding to the first maximum resistance value and the first minimum temperature value corresponding to the first minimum resistance value, the temperature measurement value corresponding to the measured resistance value can be calculated using a linear interpolation method.
[0082] It should be noted that the levels of interval division can be preset according to actual needs, and the embodiments of the present invention do not impose specific restrictions on this.
[0083] Specifically, determining the temperature measurement value corresponding to the resistance measurement value based on the first data table using a successive approximation linear interpolation method may include: determining the target resistance value range in which the resistance measurement value lies based on the first data table; obtaining the first maximum resistance value and the first minimum resistance value corresponding to the target resistance value range; obtaining the first maximum temperature value corresponding to the first maximum resistance value and the first minimum temperature value corresponding to the first minimum resistance value; and calculating the temperature measurement value corresponding to the resistance measurement value using a linear interpolation method based on the resistance measurement value, the first maximum resistance value, the first maximum temperature value, the first minimum resistance value, and the first minimum temperature value.
[0084] In one possible embodiment, determining the target resistance value range where the resistance measurement value is located based on the first data table may include: querying the first data table to obtain the first resistance value range where the resistance measurement value is located, and using it as the target resistance value range.
[0085] Specifically, after the resistance measurement value is calculated, it can be determined from the first data table which two resistance values in the first data table the resistance measurement value falls between. The temperature values in the first data table are in 1°C increments. The first data table can be pre-determined based on the performance of the thermistor; for example, it can record the correspondence between the resistance value and temperature value of the thermistor under ideal conditions.
[0086] For example, the first data table can be as shown in Table 2 below:
[0087] Table 2
[0088]
[0089] Assuming the calculated resistance measurement value is 190000, the first resistance value interval (181900, 198170) can be obtained from the data table shown in Table 2. That is, the target resistance value interval is (181900, 198170). Furthermore, the first maximum resistance value corresponding to the target resistance value interval can be determined to be 198170, and the first minimum resistance value to be 181900.
[0090] Accordingly, obtaining the first maximum temperature value corresponding to the first maximum resistance value and the first minimum temperature value corresponding to the first minimum resistance value may include: querying the first maximum temperature value corresponding to the first maximum resistance value and the first minimum temperature value corresponding to the first minimum resistance value from the first data table, respectively.
[0091] Specifically, since the first data table records the correspondence between resistance values and temperature values, the first maximum temperature value corresponding to the first maximum resistance value and the first minimum temperature value corresponding to the first minimum resistance value can be directly obtained from the first data table.
[0092] For example, the first maximum temperature corresponding to the first maximum resistance value of 198170 can be obtained from the data table shown in Table 2, which is -38.2℃, and the first minimum temperature corresponding to the first minimum resistance value of 181900 is -40℃.
[0093] Specifically, refer to the appendix of the instruction manual. Figure 3After determining the measured resistance value (denoted as Rntc(t)), the first maximum resistance value (denoted as Ra), the first maximum temperature value (denoted as Ta), the first minimum resistance value (denoted as Rb), and the first minimum temperature value (denoted as Tb), it can be assumed that there is a linear relationship between the first maximum resistance value and the first minimum resistance value, and that the measured resistance value lies exactly on the line connecting (Ta, Ra) and (Tb, Rb). Then, the following relationship can be obtained:
[0094] tanφ=(Ra-Rb) / (Tb-Ta)=(Ra-Rntc(t)) / (T(t)-Ta)
[0095] Wherein, T(t) represents the temperature measurement value corresponding to the resistance measurement value Rntc(t).
[0096] Therefore, the temperature measurement value T(t) corresponding to the resistance measurement value Rntc(t) can be calculated using the following formula (2):
[0097] T(t)=(Ra-Rntc(t))×(Tb-Ta) / (Ra-Rb)+Ta (2)
[0098] For example, assuming the measured resistance value is 190000, the first maximum resistance value is 198170, the first maximum temperature value is -38.2℃, the first minimum resistance value is 181900, and the first minimum temperature value is -40℃, the measured temperature value can be calculated to be -39.1℃, and the resolution of the calculated temperature value is 0.1℃.
[0099] It is understood that the embodiments of the present invention can improve the accuracy of the final determined temperature measurement value by using a linear interpolation method to calculate the temperature measurement value corresponding to the resistance measurement value.
[0100] In another possible embodiment, determining the target resistance value range based on the first data table may include: querying the first data table to obtain the first resistance value range in which the resistance measurement value is located; obtaining a second data table corresponding to the first resistance value range, wherein the second data table is used to record the correspondence between resistance values and temperature values in the first resistance value range; and querying the second data table to obtain the second resistance value range in which the resistance measurement value is located, as the target resistance value range.
[0101] In this embodiment of the invention, after the resistance measurement value is calculated, it can be determined from the first data table which two resistance values in the first data table the resistance measurement value falls between, thereby obtaining a first resistance value interval. To further improve accuracy, the first resistance value interval can be further divided into multiple smaller resistance value intervals, and the smaller resistance value interval in which the resistance measurement value belongs can be determined as the target resistance value interval to calculate the corresponding temperature measurement value.
[0102] Specifically, a second data table corresponding to the first resistance value range can be obtained first, and the resistance measurement value can be queried from the second data table to determine which two resistance values in the second data table the resistance measurement value falls between. The temperature value step in the second data table is 0.1℃. The second data table can be predetermined or generated during the calculation process; this embodiment of the invention does not impose specific limitations on this.
[0103] In one possible embodiment, obtaining the second data table corresponding to the first resistance value range may include: obtaining a second maximum resistance value and a second minimum resistance value corresponding to the first resistance value range; querying the first data table to obtain a second maximum temperature value corresponding to the second maximum resistance value and a second minimum temperature value corresponding to the second minimum resistance value; determining multiple interpolated resistance values within the first resistance value range; calculating the temperature value corresponding to each interpolated resistance value using a linear interpolation method based on each interpolated resistance value, the second maximum resistance value, the second maximum temperature value, the second minimum resistance value, and the second minimum temperature value; and generating the second data table based on each interpolated resistance value and its corresponding temperature value.
[0104] Alternatively, assuming the first resistance value range is (Rb, Ra), that is, the second maximum resistance value is Ra and the second minimum resistance value is Rb, then several interpolated resistance values can be linearly interpolated between the data Ra and Rb to obtain a set of resistance value data {Ra, Rc1, Rc2…Rcn, Rb}. Then, the temperature values Tc1, Tc2…Tcn corresponding to each interpolated resistance value are calculated using the linear interpolation method. Finally, based on Ra, Rc1, Rc2…Rcn, Rb and their corresponding temperature values Ta, Tc1, Tc2…Tcn, Tb, a second data table can be generated (temperature value step is 0.1℃).
[0105] It should be noted that the number of interpolated resistor values can be preset according to actual needs, for example, it can be set to 8. This embodiment of the invention does not impose a specific limitation on this. The more interpolated resistor values there are, the closer they are to the actual values in principle, but the processing time will also be longer. Therefore, in practical applications, a comprehensive consideration can be made according to the actual situation. The method for calculating the temperature value corresponding to each interpolated resistor value using the linear interpolation method can refer to the aforementioned method for calculating the temperature measurement value T(t) corresponding to the resistance measurement value Rntc(t), which will not be repeated here in this embodiment of the invention.
[0106] Alternatively, instead of using linear interpolation to determine multiple interpolated resistance values within the first resistance value range, multiple interpolated resistance values can be determined directly from the first resistance value range using a random or equally spaced method, and then a second data table can be generated.
[0107] Specifically, once the second data table is obtained, the resistance measurement value can be queried from the second data table to determine which two resistance values in the second data table the resistance measurement value falls between.
[0108] Accordingly, obtaining the first maximum temperature value corresponding to the first maximum resistance value and the first minimum temperature value corresponding to the first minimum resistance value may include: querying the second data table to obtain the first maximum temperature value corresponding to the first maximum resistance value and the first minimum temperature value corresponding to the first minimum resistance value.
[0109] Specifically, since the target resistance value range in this embodiment of the invention is the resistance value range in the second data table, and the second data table records the correspondence between resistance value and temperature value, the first maximum temperature value corresponding to the first maximum resistance value and the first minimum temperature value corresponding to the first minimum resistance value can be directly obtained from the second data table.
[0110] Specifically, the method for calculating the temperature measurement value corresponding to the resistance measurement value can refer to the aforementioned method for calculating the temperature measurement value T(t) corresponding to the resistance measurement value Rntc(t), and will not be repeated here in this embodiment of the invention.
[0111] For example, suppose the resistance measurement value is between resistance values Ra and Rc1, that is, the first maximum resistance value is Ra, and the first minimum resistance value becomes Rc1. And assume that there is a linear relationship between Ra and Rc1, and the resistance measurement value is exactly located on the line connecting (Ta, Ra) and (Tc1, Rc1). Then, Rc1 can be used to replace Rb in formula (2), and Tc1 can be used to replace Tb in formula (2) to calculate the temperature measurement value corresponding to the resistance measurement value. At this time, the resolution of the temperature value is 0.01℃.
[0112] It should be noted that in some possible embodiments, after determining the second resistance value range, the above process can be repeated to divide the second resistance value range into multiple smaller resistance value ranges, and determine the smaller resistance value range to which the measured resistance value belongs as the target resistance value range, thereby calculating a more accurate temperature measurement value. The more repetitions, the higher the calculation accuracy in principle, but the longer the processing time will also be. Therefore, in practical applications, the successive approximation level can be comprehensively considered based on the actual situation.
[0113] It is understood that the embodiments of the present invention determine the target resistance value range in which the resistance measurement value is located by a multi-level successive approximation method, which can obtain a range of resistance and temperature values with a smaller range and higher temperature resolution, and then use a linear interpolation method to obtain a more accurate temperature measurement value.
[0114] It should be noted that if a unique temperature value equal to the voltage measurement value Rntc(t) can be found in the data table (e.g., the first data table or the second data table), the found temperature value can be directly used as the temperature measurement value corresponding to the resistance measurement value.
[0115] In summary, the temperature measurement data processing method according to the embodiments of the present invention determines the measured temperature value by using a successive approximation linear interpolation method based on a first data table recording the correspondence between the resistance value and temperature value of a thermistor. This method can improve the accuracy of temperature measurement without increasing hardware costs by changing the data processing method without altering the hardware circuit.
[0116] In one possible embodiment, referencing the appendix to the specification... Figure 4 The method may further include the following steps:
[0117] S240: Filter the temperature measurement value to obtain the target temperature value.
[0118] In practical applications, due to the influence of the NTC installation location and the environment of the wiring harness, especially in automotive electronics scenarios where electromagnetic radiation interference is most common, temperature changes are generally measured in minutes, but temperature data is often collected in seconds, such as 1 second or 10 seconds. From the perspective of thermal effect principles, there should be no sudden temperature changes at the second level. However, due to electromagnetic compatibility (EMC) interference from temperature sensors and wiring harnesses, the temperature value collected at the previous time t-1 may differ significantly from the temperature value collected at the current time t. Therefore, the collected temperature measurement values can be filtered to improve the accuracy of the temperature values.
[0119] In this embodiment of the invention, temperature data can be collected multiple times continuously to obtain multiple temperature measurement values. Then, algorithms such as median filtering, removing the maximum and minimum values, and averaging are used to process the data to obtain the final target temperature value.
[0120] Preferably, the step of filtering the temperature measurement value to obtain the target temperature value may include: using a Kalman filter algorithm to filter the temperature measurement value to obtain the target temperature value.
[0121] In practical applications, Kalman filtering is an algorithm that uses the state equations of a linear system to optimally estimate the system state using observed input and output data. Since the observed data includes noise and interference from the system, the optimal estimation can also be viewed as a filtering process. Data filtering is a data processing technique that removes noise and restores the true data. Kalman filtering, given known measurement variance, can estimate the state of a dynamic system from a series of data containing measurement noise.
[0122] In this embodiment of the invention, the Kalman filter model can be pre-established as follows:
[0123] Observation equation: Z(t)=H×X(t)+V(t)
[0124] State equation: X(t)=A×X(t-1)+r×W(t-1)
[0125] Where X(t) represents the ambient temperature of the system at time t, Z(t) represents the temperature measurement at time t, W(t) represents the white noise (i.e., environmental interference such as radiation) at time t, V(t) represents the observation noise (i.e., measurement error) at time t, W(t) and V(t) are uncorrelated white noise with a mean of 0 and variances of Q and R respectively, A is the state transition matrix, r is the noise driving matrix, and H is the observation matrix.
[0126] In this embodiment of the invention, it can be assumed that R = 1 (the measurement bias guaranteed by the system), Q = 0.05, A = 1, H = 1, and r = 1 (because X(t) is a one-dimensional variable temperature). Therefore, the target temperature value at the current moment can be calculated using the Kalman filter model based on the measured temperature value. Specifically, the observation equation can be used first to calculate the observed temperature value at the current moment based on the measured temperature value. Then, the state equation can be used to calculate the target temperature value at the current moment based on the observed temperature value at the current moment, the observed temperature value at the previous moment, and the target temperature value at the previous moment.
[0127] It should be noted that the specific details of using the Kalman filter algorithm to filter the temperature measurement value can be found in existing filtering techniques, and will not be repeated here in this embodiment of the invention.
[0128] For example, by writing simulation code to perform Kalman filtering on the calculated temperature measurement values, the following can be obtained: Figure 5 The filtering results shown are as follows: Figure 5 As shown, when the ambient temperature is 10℃, multiple temperature measurements can be collected after the influence of environmental interference and noise (as shown in Figure a). After performing Kalman filtering on the collected temperature measurements, the state filtering result shown in Figure b can be obtained. It can be seen that the deviation of the temperature value has been effectively controlled.
[0129] It is understood that, considering the diversity and variability of application scenarios, the embodiments of the present invention perform two processing steps on the temperature data (successive approximation linear interpolation and Kalman filtering), which improves the robustness of temperature measurement and makes it more resistant to interference from the external environment, especially to strong EMC interference and long-term interference.
[0130] To facilitate comparison between existing temperature measurement data processing methods and the temperature measurement data processing method provided in this embodiment of the invention, Worst Case Analysis (WCA) can be introduced. WCA is a circuit reliability analysis and design technique used to evaluate circuit performance when the parameters of each component simultaneously undergo worst-case variations, ensuring reliable operation throughout the circuit's lifespan. The idea behind WCA is to obtain a limiting value when all deviations occur simultaneously. In practical applications, the theoretical WCA value is typically referenced, and then further converged (e.g., using Monte Carlo analysis) to obtain the applicable value.
[0131] Reference manual attached Figure 6 This illustrates a schematic diagram of a test environment provided in one embodiment of the present invention. Figure 6 As shown, the test environment may include a high / low temperature chamber 610, an NTC sensor harness 620, a Bulk Current Injection (BCI) coupling clip 630, a test NTC 640, and multiple metrology calibration NTCs 650. Each of the metrology calibration NTCs 650 and the test NTC 640 can be the same model of NTC. Each of the metrology calibration NTCs 650 can be electrically connected to a metrology calibration device 660. The test NTC 640 is electrically connected to a controller via the NTC sensor harness 620. The controller is electrically connected to a host computer and a 12V power supply. The BCI coupling clip 630 is mounted on the NTC sensor harness 620.
[0132] In practical applications, it can be used in, for example Figure 6 In the test environment shown, the methods in the prior art and the methods provided in the embodiments of the present invention are respectively used to apply a large current injection of EMC into the BCI on the high and low temperature chamber and the NTC sensor harness, so as to make a horizontal comparison of the collected target temperature values.
[0133] Specifically, the test NTC640 can be placed in the middle of the high and low temperature chamber 610, and multiple calibration NTC650s of the same model can be arranged in different positions. A high-precision calibration device 660 is then used to record the temperature measurements of each calibration NTC650 in real time (the acquisition period is consistent with the controller temperature acquisition period, for example, both can be 1 second). The average temperature measurement of each calibration NTC650 is then taken as the actual temperature of the high and low temperature chamber 610. The BCI coupling clip 630 is clamped to the NTC sensor harness 620, and BCI current noise is injected. The target temperature value of the high and low temperature chamber 610 is then measured using both existing methods and the method provided in this embodiment of the invention. This value is compared with the actual temperature obtained by the calibration device 660 to compare the deviations of different processing methods. The actual temperature data shown in Table 3 and other data are obtained as follows. Figure 7 The comparison results are shown.
[0134] As can be seen from Table 3, the temperature measurement accuracy of the temperature measurement data processing method provided by the embodiments of the present invention is significantly higher than that of the temperature measurement data processing methods in the prior art. Figure 7 It can be seen that the temperature measurement results obtained by the temperature measurement data processing method provided in this embodiment of the invention (as shown by line a in the figure) have significantly higher stability and accuracy than the temperature measurement results obtained by the temperature measurement data processing method in the prior art (as shown by line b in the figure).
[0135] Table 3
[0136]
[0137] In summary, by further processing the temperature measurement values obtained using the successive approximation linear interpolation method with Kalman filtering to obtain the final target temperature value, the accuracy and stability of temperature measurement can be further improved. Furthermore, it exhibits strong anti-interference capabilities and can effectively address the diversity and variability of application scenarios, meeting the needs of various situations. It has significant practical value for systems that require high-precision, highly stable temperature measurements as an input condition for closed-loop control or for modifying a key parameter using temperature.
[0138] In addition, by performing two processing steps on the temperature data (successive approximation linear interpolation and Kalman filtering), the deviation caused by hardware circuit components can be minimized. Even if the component parameters change with the accumulation of usage time and environmental changes (temperature, humidity, stress, etc.), high-precision temperature measurement results can still be obtained.
[0139] Reference manual attached Figure 8 This illustrates the structure of a temperature measurement data processing device 800 according to an embodiment of the present invention. The device 800 can be disposed within a temperature sensor, which includes a thermistor and an analog-to-digital converter electrically connected to the thermistor, such as... Figure 8 As shown, the device 800 may include:
[0140] The voltage measurement value acquisition module 810 is used to acquire the voltage measurement value output by the analog-to-digital converter in the temperature sensor;
[0141] The resistance measurement calculation module 820 is used to calculate the resistance measurement value of the thermistor in the temperature sensor based on the voltage measurement value.
[0142] Temperature measurement value determination module 830 is used to determine the temperature measurement value corresponding to the resistance measurement value based on the first data table and using a successive approximation linear interpolation method.
[0143] The first data table is used to record the correspondence between the resistance value and the temperature value of the thermistor.
[0144] In one possible embodiment, referencing the appendix to the specification... Figure 9 The device 800 may further include:
[0145] The filtering module 840 is used to filter the temperature measurement value to obtain the target temperature value.
[0146] In one possible embodiment, the filtering module 840 is specifically used to filter the temperature measurement value using a Kalman filter algorithm to obtain the target temperature value.
[0147] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus provided in the above embodiments and the corresponding method embodiments belong to the same concept, and the specific implementation process can be found in the corresponding method embodiments, which will not be repeated here.
[0148] One embodiment of the present invention also provides a temperature sensor, the temperature sensor including a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the temperature measurement data processing method provided in the above method embodiments.
[0149] Memory can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. Memory can primarily include a program storage area and a data storage area. The program storage area can store the operating system, application programs required for the functions, etc.; the data storage area can store data created based on the use of the device, etc. Furthermore, memory can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, memory can also include a memory controller to provide the processor with access to the memory.
[0150] One embodiment of the present invention also provides a computer-readable storage medium, which may be disposed in a temperature sensor to store at least one instruction or at least one program related to implementing a temperature measurement data processing method, wherein the at least one instruction or the at least one program is loaded and executed by the processor to implement the temperature measurement data processing method provided in the above-described method embodiment.
[0151] Optionally, in embodiments of the present invention, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0152] One embodiment of the present invention also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. These computer instructions are read from and executed by a processor from the computer-readable storage medium to implement the temperature measurement data processing method provided in the above-described method embodiment.
[0153] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0154] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0155] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0156] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A temperature measurement data processing method, applied to a temperature sensor, wherein the temperature sensor includes a thermistor and an analog-to-digital converter electrically connected to the thermistor, characterized in that, The method includes: Obtain the voltage measurement value output by the analog-to-digital converter in the temperature sensor; Calculate the resistance value of the thermistor in the temperature sensor based on the voltage measurement value; Based on the first data table, the temperature measurement value corresponding to the resistance measurement value is determined using a successive approximation linear interpolation method, including: Based on the first data table, the target resistance value range in which the measured resistance value is located is determined; Obtain the first maximum resistance value and the first minimum resistance value corresponding to the target resistance value range; Obtain the first maximum temperature value corresponding to the first maximum resistance value and the first minimum temperature value corresponding to the first minimum resistance value; Based on the measured resistance value, the first maximum resistance value, the first maximum temperature value, the first minimum resistance value, and the first minimum temperature value, the temperature measurement value corresponding to the measured resistance value is calculated using a linear interpolation method. The step of determining the target resistance value range in which the resistance measurement value falls based on the first data table includes: The first resistance value range in which the measured resistance value is located is obtained by querying the first data table. Obtain the second data table corresponding to the first resistance value range. The second data table is used to record the correspondence between the resistance value and the temperature value in the first resistance value range. The second resistance value interval containing the measured resistance value is obtained from the second data table and used as the target resistance value interval. The step of obtaining the first maximum temperature value corresponding to the first maximum resistance value and the first minimum temperature value corresponding to the first minimum resistance value includes: The first maximum temperature value corresponding to the first maximum resistance value and the first minimum temperature value corresponding to the first minimum resistance value are retrieved from the second data table respectively. The step of obtaining the second data table corresponding to the first resistance value range includes: Obtain the second maximum resistance value and the second minimum resistance value corresponding to the first resistance value range; Retrieve the second maximum temperature value corresponding to the second maximum resistance value and the second minimum temperature value corresponding to the second minimum resistance value from the first data table; Within the first resistance value range, multiple interpolated resistance values are determined; Based on each of the interpolated resistor values, the second maximum resistance value, the second maximum temperature value, the second minimum resistance value, and the second minimum temperature value, the temperature value corresponding to each of the interpolated resistor values is calculated using a linear interpolation method. The second data table is generated based on each of the interpolation resistor values and their corresponding temperature values; The first data table is used to record the correspondence between the resistance value and the temperature value of the thermistor.
2. The method according to claim 1, characterized in that, The method further includes: The temperature measurement value is filtered to obtain the target temperature value.
3. The method according to claim 2, characterized in that, The step of filtering the temperature measurement value to obtain the target temperature value includes: The temperature measurement value is filtered using a Kalman filter algorithm to obtain the target temperature value.
4. A temperature measurement data processing device, disposed at a temperature sensor, the temperature sensor including a thermistor and an analog-to-digital converter electrically connected to the thermistor, characterized in that, The apparatus is used to perform the temperature measurement data processing method according to any one of claims 1-3, and the apparatus comprises: A voltage measurement value acquisition module is used to acquire the voltage measurement value output by the analog-to-digital converter in the temperature sensor; The resistance measurement calculation module is used to calculate the resistance measurement value of the thermistor in the temperature sensor based on the voltage measurement value. The temperature measurement value determination module is used to determine the temperature measurement value corresponding to the resistance measurement value based on the first data table and using a successive approximation linear interpolation method. The first data table is used to record the correspondence between the resistance value and the temperature value of the thermistor.
5. A temperature sensor, characterized in that, The temperature sensor includes a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the temperature measurement data processing method as described in any one of claims 1-3.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction or at least one program, which is loaded and executed by a processor to implement the temperature measurement data processing method as described in any one of claims 1-3.
Citation Information
Patent Citations
Optical power calibration method and device, electronic equipment and storage medium
CN112367116A
Data processing method and device, computer equipment and storage medium
CN114564689A
