Compensation method and system of temperature sensor

By interpolation of the equivalent temperature drift relationship in the temperature sensor as linear or segmented high-order splines, the measurement inaccuracy problem caused by the temperature drift of the existing temperature sensor is solved, efficient and low-resource temperature compensation is achieved, and the measurement of the PT200 sensor is improved Accuracy and stability.

CN119147123APending Publication Date: 2024-12-17NANJING IKAKAT EMISSIONS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411177133.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

The existing temperature sensors have temperature drifting when the temperature changes, resulting in inaccurate and unstable measurement results. The existing compensation methods such as the table lookup method and the fitting formula method have problems such as the large amount of data, high computing resource occupancy and low compensation accuracy. , especially in the application of PT200 temperature sensor, affects the processing effect of the SCR system.

Method used

By connecting the temperature sensor to the constant voltage source circuit, obtaining the current signal and performing A/D conversion, the temperature drift relationship of any two adjacent temperature points is a straight line, the slope is calculated, and the corresponding value is determined based on the actual detected analog quantity. Slope and temperature segments are used to quickly calculate the compensation output, or perform high-order spline interpolation by segmenting the data set, determine the window length and fit relationship, and calculate the compensated temperature detection value.

Benefits of technology

The temperature sensor compensation method with small computing resources, small calculation amount and high compensation accuracy is realized. It can quickly judge the compensation range and perform efficient compensation, improving the accuracy and stability of temperature measurement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119147123A_ABST
    Figure CN119147123A_ABST
Patent Text Reader

Abstract

The invention relates to the field of temperature sensors, and particularly discloses a temperature sensor compensation method and system, and the method comprises the steps: enabling a temperature sensor to be connected to a constant voltage source circuit, and detecting a current signal which is output due to the temperature change; carrying out A / D conversion on the current signal and obtaining a corresponding digital quantity value according to the relationship between the analog quantity and the digital quantity value; enabling any two temperature points to be equivalent to a straight line, calculating the slope of the straight line, and obtaining the slopes corresponding to a plurality of continuous temperature sections; in the actual detection process, a current signal output by the temperature sensor is converted and output through the A / D converter to obtain a corresponding analog quantity value; and finally, according to the analog quantity value, the temperature section where the analog quantity value is located and the slope corresponding to the temperature section, determining a compensated temperature detection value and outputting the compensated temperature detection value. According to the method, the occupied calculation resources are few, the calculation amount is small, the compensation interval can be judged according to detection output, the temperature after compensation is rapidly calculated, and the compensation calculation efficiency and precision are high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of temperature sensors, and in particular to a compensation method and system for a temperature sensor. Background Art

[0002] The temperature drift of a temperature sensor refers to the phenomenon that the output value of the sensor no longer corresponds linearly to the actual temperature under different temperature conditions. This is because the sensitive materials of the sensor have different thermal expansion coefficients. As the temperature changes, the conductivity, impedance and other characteristics of the sensitive materials will change. At the same time, the electronic components of the sensor (such as operational amplifiers, analog-to-digital converters, etc.) have different performances at different temperatures, which will cause the output signal (such as the sampling current signal, etc.) to shift, and ultimately cause its characteristics to change with temperature. Such a phenomenon usually leads to inaccuracy and instability in the measurement results, so calibration and compensation are usually performed, such as designing a dedicated temperature compensation circuit, digital filter circuit, or using algorithms to compensate in a microcontroller to compensate for the deviation in the temperature measurement results caused by temperature changes.

[0003] In the prior art, temperature sensor manufacturers usually configure software, hardware, calibration and digital compensation methods to reduce or eliminate sensor detection errors caused by temperature changes. Software compensation methods mainly use calibration curves or polynomial calibration methods: the calibration curve mainly establishes the calibration curve of the sensor through experimental data, and corrects according to the relationship between the actual temperature and the sensor output value. This method is suitable for most temperature sensors; polynomial regression refers to the use of a polynomial regression model to fit the relationship between temperature and sensor output, thereby performing compensation. The hardware compensation method is costly and requires the design of dedicated compensation circuits and components. The temperature compensation circuit is designed to compensate for the effects of temperature changes, such as using a temperature sensor to monitor the ambient temperature and adjusting the reference voltage in the circuit to compensate for the error of the main sensor; in addition, specially designed temperature compensation components (such as resistance temperature compensation components) can be used to reduce the effects of temperature changes on the sensor. This is a compensation strategy commonly used by temperature sensors such as ear thermometers and ear thermometers. In the prior art, calibration compensation for temperature sensors usually refers to a self-calibration strategy. Self-calibration refers to automatically adjusting the output value to compensate for changes in ambient temperature through the built-in temperature monitoring results of the sensor and according to the internal temperature information, or regularly using a consistent external standard temperature source for calibration to maintain the accuracy of the sensor.

[0004] Taking the PT200 temperature sensor as an example, it is widely cited in the fields of industrial automation, environmental testing, medical equipment, etc. In particular, with the implementation of the "Action Plan for Air Pollution Prevention and Control", the treatment of diesel engine exhaust emissions has been carried out and implemented in more and more regions. The engine exhaust aftertreatment SCR system has become the main way and development direction of exhaust aftertreatment for medium and large functional engines. Among them, the widely used PT200 temperature sensor is an important sensor in the SCR system. The accuracy of temperature directly affects the treatment effect of the system. The existing compensation calculations of PT200 temperature sensors mainly include table lookup method, fitting formula, etc. Among them, the defect of the table lookup method is that a large amount of data is required, and it cannot be guaranteed that each resistance value is found in the table. If the resistance value cannot be found, it can only be approximated to the closest resistance value, and the error is relatively large. In addition, the fitting formula method is to fit an approximate formula through multiple sets of data. The single fitted formula cannot fully express the temperature curve. There are local fluctuations up and down, resulting in a large temperature deviation during actual compensation. Moreover, the fitted formula is a high-order equation, which will occupy a lot of computing resources. Summary of the invention

[0005] The purpose of the present invention is to provide a compensation method for a temperature sensor with small computing resource occupation, small calculation amount and high compensation accuracy. During the actual use of the temperature sensor, the compensation interval can be judged according to the obtained detection output and the compensation output can be quickly calculated with high efficiency and accuracy.

[0006] According to a first aspect of the present invention, a compensation method for a temperature sensor is provided, comprising:

[0007] Step 1, connecting a temperature sensor to a constant voltage source circuit, and obtaining a current signal output by the temperature sensor when monitoring temperature changes under different temperature conditions as an analog output, wherein each temperature corresponds to a current signal;

[0008] Step 2: Convert the current signal corresponding to each temperature through an A / D converter, and obtain the digital value at the corresponding temperature according to the relationship between the analog value and the digital value;

[0009] Step 3: Equivalent the temperature drift relationship between any two adjacent temperature points to a straight line, and calculate the slope of the straight line between the two adjacent temperature points to obtain the slopes ki corresponding to multiple continuous temperature segments, i = 1, 2, 3, ..., n;

[0010] Step 4: In the actual detection process, the current signal output by the temperature sensor is converted by an A / D converter to obtain the corresponding analog value Gm;

[0011] Step 5: Determine the corresponding slope k according to the temperature range where the analog value Gm is located. m ;as well as

[0012] Step 6: According to the analog value Gm, the temperature segment where the analog value Gm is located, and the slope km corresponding to the temperature segment, determine the compensated temperature detection value and output it.

[0013] According to a second aspect of the present invention, a compensation method for a temperature sensor is provided, comprising the following steps:

[0014] Step 1, connect the temperature sensor to a constant voltage source circuit, and obtain the current signal output by the temperature sensor when monitoring the temperature change under different temperature conditions as an analog output, wherein each temperature corresponds to a current signal, which is recorded as AI0~AIn;

[0015] Step 2, convert the current signal corresponding to each temperature through an A / D converter, obtain the digital value at the corresponding temperature according to the relationship between the analog value and the digital value, record the digital value as G0~Gn, correspond one-to-one with the AI0~AIn, construct a data set QI=(qt0,qt1,qt2,…,qti,…,qtn), where the i-th data qti is composed of Gi and its corresponding AIi;

[0016] Step 3: According to different pre-configured window lengths L, the data set is segmented to obtain multiple subsets, and high-order spline interpolation is performed on each subset to determine the fitting relationship fq=f for each subset. L (G);

[0017] Step 4: In each subset and the fitting relationship fq=f obtained according to any window length L L (G), calculate the fitting result corresponding to each AIi according to the data set QI = (qt0, qt1, qt2, ..., qti, ..., qtn), and calculate the standard deviation of the fitting result and Gi corresponding to AIi;

[0018] Step 5: According to the minimum standard deviation, determine the corresponding window length Lm and the obtained fitting relationship fq=f Lm (G) as a temperature compensation relationship within each window range;

[0019] Step 6: According to the analog value Gm, the window range is determined according to the window length Lm, and according to the fitting relationship within the corresponding window range, the compensated temperature detection value is calculated and output.

[0020] According to a third aspect of the present invention, a computer system is provided, comprising:

[0021] one or more processors;

[0022] The memory stores operable instructions, which, when executed by the one or more processors, enable the one or more processors to perform operations, including the process of executing the aforementioned temperature sensor compensation method. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The accompanying drawings are not intended to be drawn to scale. In the accompanying drawings, each identical or nearly identical component shown in each figure may be represented by the same reference numeral. For clarity, not every component is labeled in each figure. Embodiments of various aspects of the present invention will now be described by way of example and with reference to the accompanying drawings.

[0024] Figure 1 FIG. 4 is a flow chart of a compensation method for a temperature sensor according to a first embodiment of the present invention.

[0025] Figure 2 Schematic diagram of the temperature-current relationship of the measured PT200 temperature sensor according to the first embodiment of the present invention.

[0026] Figure 3 is a schematic diagram of measured temperature compensation according to the first embodiment of the present invention.

[0027] Figure 4 FIG. 4 is a flow chart of a compensation method for a temperature sensor according to a second embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to better understand the technical content of the present invention, specific embodiments are given and described as follows in conjunction with the accompanying drawings.

[0029] Various aspects of the present invention are described in this disclosure with reference to the accompanying drawings, in which many illustrative embodiments are shown. The embodiments of the present disclosure are not necessarily intended to include all aspects of the present invention. It should be understood that the various concepts and embodiments introduced above, as well as those described in more detail below, can be implemented in any of many ways, because the concepts and embodiments disclosed by the present invention are not limited to any implementation. In addition, some aspects disclosed by the present invention can be used alone or in any appropriate combination with other aspects disclosed by the present invention.

[0030] {Example 1}

[0031] Combination Figure 1 According to the example shown, the compensation method of the temperature sensor according to the first embodiment of the present invention includes:

[0032] Step 1, connecting a temperature sensor to a constant voltage source circuit, and obtaining a current signal output by the temperature sensor when monitoring temperature changes under different temperature conditions as an analog output, wherein each temperature corresponds to a current signal;

[0033] Step 2: Convert the current signal corresponding to each temperature through an A / D converter, and obtain the digital value at the corresponding temperature according to the relationship between the analog value and the digital value;

[0034] Step 3: Equivalent the temperature drift relationship between any two adjacent temperature points to a straight line, and calculate the slope of the straight line between the two adjacent temperature points to obtain the slopes ki corresponding to multiple continuous temperature segments, i = 1, 2, 3, ..., n;

[0035] Step 4: In the actual detection process, the current signal output by the temperature sensor is converted by an A / D converter to obtain the corresponding analog value Gm;

[0036] Step 5: Determine the corresponding slope k according to the temperature range where the analog value Gm is located. m ;as well as

[0037] Step 6: According to the analog value Gm, the temperature segment where the analog value Gm is located, and the slope km corresponding to the temperature segment, determine the compensated temperature detection value and output it.

[0038] In an optional embodiment, the different temperature conditions in the aforementioned step 1 specifically refer to different temperature conditions divided by gradients; the different temperature conditions divided by gradients are set to decrease or increase by gradients according to a preset temperature change value, thereby determining different temperature points with increasing or decreasing temperature change values.

[0039] The temperature change value ranges from 0.5 to 50°C.

[0040] In the first embodiment, within each interval, the change in detection current caused by the temperature sensor as the temperature changes is equivalent to a linear change, which is beneficial to the subsequent calculation efficiency and speed, and the smaller the interval of different temperature conditions, the better the linearity, which can be approximately understood as a linear relationship approaching a point.

[0041] As an optional embodiment, obtaining the digital value at the corresponding temperature according to the relationship between the analog value and the digital value includes:

[0042] Under different temperature conditions, the current signal output by the temperature sensor to monitor the temperature change is recorded as AI0~AIn;

[0043] The current signals AI0 to AIn corresponding to each temperature are converted by an A / D converter, and the digital values ​​after analog-to-digital conversion are output, and the digital values ​​are recorded as G0 to Gn;

[0044] Wherein, for any current signal A, after A / D conversion, the digital value G is obtained, and the first functional relationship A=f(G) between the two is determined, which is expressed as: A=(G-G0)*(AIn-AI0) / (Gn-G0)+A0;

[0045] According to the above functional relationship A=f(G), an inverse transformation is performed to obtain a second functional relationship G=f(A), which is expressed as: G=(A-A0)×(Gn-G0) / (AIn-AI0)+G0;

[0046] Accordingly, according to the second functional relationship G=f(A), the temperature values ​​under different temperature conditions and their corresponding digital values ​​are obtained.

[0047] As an optional embodiment, the temperature drift relationship between any two adjacent temperature points is equivalent to a straight line, and the slope of the straight line between the two adjacent temperature points is calculated, including:

[0048] Calculate the temperature drift relationship between any two adjacent temperature points, expressed as:

[0049] K N =T N+1 -T N G N +1-G N

[0050] Among them, K N Indicates the slope of the Nth segment of the broken line; N indicates that the area between the two adjacent temperature points is the Nth segment of the broken line;

[0051] T N Indicates the starting temperature of the Nth segment of the broken line; T N+1 Indicates the end point temperature of the Nth segment of the broken line;

[0052] G N Indicates the starting number of the Nth segment of the line; G N+1 The numerical value representing the end point of the Nth segment of the polyline.

[0053] As an optional embodiment, in step 6, according to the analog value Gm, the temperature segment where the analog value Gm is located, and the slope k corresponding to the temperature segment, m , determine the compensated temperature detection value and output it, including:

[0054] Determine the starting temperature of the broken line according to the temperature segment where the analog value Gm is located;

[0055] According to the formula y = k m *xk m *x m +y m Calculate the compensated temperature detection value and output it;

[0056] Where x represents the analog value Gm obtained by actual detection, x m Indicates the starting digital value of the temperature segment where the analog value Gm is located, y m Indicates the starting digital value x m The corresponding starting temperature.

[0057] {Example 2}

[0058] In this example, in combination with the temperature compensation method of the first embodiment, we take the PT200 temperature sensor as an example for further explanation.

[0059] First, measure the correspondence table between 18 temperatures (corresponding to T1 to T18) and the resistance value of the PT200 temperature sensor.

[0060] T1 T2 T3 T4 T5 T6 T7 T8 T9 temperature -40 -20 0 25 50 100 150 200 250 Resistance 170 185 201 220 239 276 313 349 385 T10 T11 T12 T13 T14 T15 T16 T17 T18 temperature 300 350 400 450 500 600 700 800 850 Resistance 420 454 488 522 555 618 680 739 767

[0061] Then, the PT200 temperature sensor is connected to a 5000mV constant voltage circuit to obtain current signals under different resistance values. Assuming that the electrical signal range of the analog quantity of the current signal is recorded as AI0~AIn, the changing current signal is connected to the A / D converter of the controller, and the digital output is obtained after analog-to-digital conversion. The digital quantity value is recorded as G0~Gn.

[0062] Assume that the analog electrical signal is A, and the corresponding value after A / D conversion is G. Since it is a linear relationship, the function relationship A=f(G) can be expressed as a mathematical equation:

[0063] A=(G-G0)×(AIn-AI0) / (Gn-G0)+A0

[0064] According to the above equation, the A value can be calculated from the G value.

[0065] By inversely transforming the above equation, we can obtain the functional relationship G = f(A), which can be expressed as the following mathematical equation:

[0066] G=(A-A0)×(Gn-G0) / (AIn-AI0)+G0

[0067] Substituting into the formula, we can get the digital values ​​at different temperatures, as shown in the following table:

[0068] T1 T2 T3 T4 T5 T6 T7 T8 T9 temperature -40 -20 0 25 50 100 150 200 250 Digital quantity 21431 20208 19736 18742 17820 16217 14983 13888 12922 T10 T11 T12 T13 T14 T15 T16 T17 T18 temperature 300 350 400 450 500 600 700 800 850 Digital quantity 12214 11473 10853 10172 9691 8913 8255 7731 7485

[0069] Then, according to the formula of Example 1, each two points are approximated as a straight line, and the slope K between any two points is calculated. N .

[0070] In this example, the slope of each temperature segment is calculated according to the slope formula, as shown in the following table:

[0071] T1 T2 T3 T4 T5 T6 T7 T8 T9 temperature -40 -20 0 25 50 100 150 200 250 Slope -0.0165975 -0.0423728 -0.0251509 -0.0271149 -0.0311915 -0.0405186 -0.045662 -0.051759 -0.070621 T10 T11 T12 T13 T14 T15 T16 T17 temperature 300 350 400 450 500 600 700 800 Slope -0.067476 -0.080645 -0.073421 -0.103950 -0.128534 -0.151975 -0.190839 -0.203252

[0072] Combination Figure 2 As shown in the figure, through the above steps, the PT200 sensor is first connected to the constant voltage source. The change in temperature will change the resistance of the PT200, thereby changing the current. Then the changing current is connected to the A / D converter to obtain a digital value that changes with temperature. The corresponding relationship between 18 fixed resistance values ​​and temperatures is approximated into 18 broken lines, and each broken line is expressed by a different equation.

[0073] Finally, the input digital signal is screened to determine in which interval it is in, and is substituted into the equation of the corresponding temperature segment (i.e. which segment of the broken line) to calculate the corresponding temperature.

[0074] In this embodiment, combined with Figure 3 The process shown in the figure screens out the interval within which the measured digital quantity belongs, and determines and outputs the compensated temperature detection value according to the analog value, the temperature segment in which the analog value is located, and the slope corresponding to the temperature segment, and specifically includes the following steps:

[0075] Determine the starting temperature of the broken line according to the temperature segment where the analog value Gm is located;

[0076] According to the formula y = k m *xk m *x m +y m Calculate the compensated temperature detection value and output it;

[0077] Where x represents the analog value Gm obtained by actual detection, x m Indicates the starting digital value of the temperature segment where the analog value Gm is located, y m Indicates the starting digital value x m The corresponding starting temperature.

[0078] For example, if it is determined that the measured digital quantity belongs to the 4th segment, then m=4, and the compensated temperature value of the corresponding point is determined by rapid calculation according to the formula y=k4*x-k4*x4+y4.

[0079] It should be understood that in this embodiment, if it is determined that the measured digital quantity is the endpoint of a certain broken line, it can be calculated based on the previous broken line or the current broken line. Of course, in actual detection and testing, the probability of this situation occurring is very small.

[0080] {Example 3}

[0081] It should be understood that in the above-mentioned Embodiment 1 and Embodiment 2, the linear fitting method is used for segmented fitting. When the segments are small enough, the change law can be regarded as a linear relationship and determined by calculating the slope. The final corresponding compensation segment function (i.e., the slope) is determined in combination with the measured digital quantity, thereby calculating the compensated temperature value output.

[0082] In this embodiment, for different thermometers, due to the sensitive materials used and other system factors, the detection output of the thermometer is affected by temperature changes and exhibits nonlinear changes. When it is difficult to accurately obtain the true value of the measurement by using linear change fitting, the segmented multi-point nonlinear fitting of the embodiment of the present invention can be used. By screening different segmented nonlinear fittings, the fitting scheme with the smallest error is determined to achieve the final temperature compensation.

[0083] Combination Figure 4 The compensation method of the temperature sensor of the example shown includes the following steps:

[0084] Step 1, connect the temperature sensor to a constant voltage source circuit, and obtain the current signal output by the temperature sensor when monitoring the temperature change under different temperature conditions as an analog output, wherein each temperature corresponds to a current signal, which is recorded as AI0~AIn;

[0085] Step 2, convert the current signal corresponding to each temperature through an A / D converter, obtain the digital value at the corresponding temperature according to the relationship between the analog value and the digital value, record the digital value as G0~Gn, correspond one-to-one with the AI0~AIn, construct a data set QI=(qt0,qt1,qt2,…,qti,…,qtn), where the i-th data qti is composed of Gi and its corresponding AIi;

[0086] Step 3: According to different pre-configured window lengths L, the data set is segmented to obtain multiple subsets, and high-order spline interpolation is performed on each subset to determine the fitting relationship fq=f for each subset. L (G);

[0087] Step 4: In each subset and the fitting relationship fq=f obtained according to any window length L L (G), calculate the fitting result corresponding to each AIi according to the data set QI = (qt0, qt1, qt2, ..., qti, ..., qtn), and calculate the standard deviation of the fitting result and Gi corresponding to AIi;

[0088] Step 5: According to the minimum standard deviation, determine the corresponding window length Lm and the obtained fitting relationship fq=f Lm (G) as a temperature compensation relationship within each window range;

[0089] Step 6: According to the measured analog value Gm, the window range described is determined according to the window length Lm, and according to the fitting relationship within the corresponding window range, the compensated temperature detection value is calculated and output.

[0090] It should be understood that the different temperature conditions here especially refer to different temperature conditions divided by gradients.

[0091] The different temperature conditions divided by the aforementioned gradient refer to a gradient decrease or a gradient increase according to a preset temperature change value, thereby determining different temperature points with a temperature change value in an increasing or decreasing pattern.

[0092] In an embodiment of the present invention, different pre-configured window lengths L are set to be related to the variation of different temperatures divided by the gradient, and are in a negative correlation. The greater the temperature variation, the smaller the setting value of the window length L.

[0093] It should be understood that the window length L in this embodiment refers to the division standard and basis for the obtained data set, and it is divided. For example, for 200 data points (i.e. corresponding to 200 temperature points), if L is taken as 10, then every 10 data points are regarded as a subset, and a total of 20 subsets are divided. On this basis, the high-order spline interpolation function corresponding to each subset is fitted. This example uses the cubic spline interpolation algorithm as an example.

[0094] Preferably, the temperature change value ranges from 0.5 to 50°C, and more preferably, from 0.5 to 10°C.

[0095] When the temperature change value ranges from 0.5 to 5°C, the pre-configured different window lengths L are positive integers greater than or equal to 10; when the temperature change value ranges from greater than 5°C, the pre-configured different window lengths L are positive integers less than or equal to 10.

[0096] Therefore, on the one hand, we can avoid the data being too dense, resulting in a large amount of data and cutting off the temperature points with the same pattern during fitting, which will lead to overfitting or large fitting deviations at both ends. On the other hand, we can ensure that there are enough temperature point detection intervals to fully explore the changing patterns within the interval and improve the accuracy of fitting and subsequent detection compensation.

[0097] {Example 4}

[0098] In combination with the examples of the temperature sensor compensation method shown in the above embodiments 1-3, according to the embodiments disclosed in the present invention, a computer system is further provided, including: one or more processors, and a memory.

[0099] The aforementioned memory may be used to store operable instructions. When these instructions are executed by one or more processors, the one or more processors may perform operations, including the process of executing the temperature sensor compensation method of the aforementioned embodiment.

[0100] Although the present invention has been disclosed as above with preferred embodiments, it is not intended to limit the present invention. A person with ordinary knowledge in the technical field to which the present invention belongs may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the definition of the claims.

Claims

1. A temperature sensor compensation method, characterized in that: include: Step 1, connecting a temperature sensor to a constant voltage source circuit, and obtaining a current signal output by the temperature sensor when monitoring temperature changes under different temperature conditions as an analog output, wherein each temperature corresponds to a current signal; Step 2: Convert the current signal corresponding to each temperature through an A / D converter, and obtain the digital value at the corresponding temperature according to the relationship between the analog value and the digital value; Step 3: Equivalent the temperature drift relationship between any two adjacent temperature points to a straight line, and calculate the slope of the straight line between the two adjacent temperature points to obtain the slopes ki corresponding to multiple continuous temperature segments, i = 1, 2, 3, ..., n; Step 4: In the actual detection process, the current signal output by the temperature sensor is converted by an A / D converter to obtain the corresponding analog value Gm; Step 5: Determine the corresponding slope k according to the temperature range where the analog value Gm is located m ; as well as Step 6: According to the analog value Gm, the temperature segment where the analog value Gm is located, and the slope km corresponding to the temperature segment, determine the compensated temperature detection value and output it.

2. The temperature sensor compensation method according to claim 1, characterized in that: The different temperature conditions are different temperature conditions divided by gradients; The different temperature conditions divided by the gradient are set to decrease or increase in gradient according to a preset temperature change value, so as to determine different temperature points with increasing or decreasing temperature change values.

3. The temperature sensor compensation method according to claim 2, characterized in that: The temperature variation value ranges from 0.5 to 50°C.

4. The temperature sensor compensation method according to claim 1, characterized in that: The method of obtaining the digital value at the corresponding temperature according to the relationship between the analog value and the digital value includes: Under different temperature conditions, the current signal output by the temperature sensor to monitor the temperature change is recorded as AI0~AIn; The current signals AI0 to AIn corresponding to each temperature are converted by an A / D converter, and the digital values ​​after analog-to-digital conversion are output, and the digital values ​​are recorded as G0 to Gn; Wherein, for any current signal A, after A / D conversion, the digital value G is obtained, and the first functional relationship A=f(G) between the two is determined, which is expressed as: A=(G-G0)*(AIn-AI0) / (Gn-G0)+A0; According to the above functional relationship A=f(G), an inverse transformation is performed to obtain a second functional relationship G=f(A), which is expressed as: G=(A-A0)×(Gn-G0) / (AIn-AI0)+G0; Accordingly, according to the second functional relationship G=f(A), the temperature values ​​under different temperature conditions and their corresponding digital values ​​are obtained.

5. The temperature sensor compensation method according to claim 1, characterized in that: The temperature drift relationship between any two adjacent temperature points is equivalent to a straight line, and the slope of the straight line between the two adjacent temperature points is calculated, including: Calculate the temperature drift relationship between any two adjacent temperature points, expressed as: K N =T N+1 -T N G N +1-G N Among them, K N Indicates the slope of the Nth segment of the broken line; N indicates that the area between the two adjacent temperature points is the Nth segment of the broken line; T N Indicates the starting temperature of the Nth segment of the broken line; T N+1 Indicates the end point temperature of the Nth segment of the broken line; G N Indicates the starting number of the Nth segment of the line; G N+1 The numerical value representing the end point of the Nth segment of the polyline.

6. The temperature sensor compensation method according to claim 1, characterized in that: The analog value Gm, the temperature segment where the analog value Gm is located, and the slope k corresponding to the temperature segment m , determine the compensated temperature detection value and output it, including: Determine the starting temperature of the broken line according to the temperature segment where the analog value Gm is located; According to the formula y=k m *xk m *x m +y m Calculate the compensated temperature detection value and output it; Where x represents the analog value Gm obtained by actual detection, x m Indicates the starting digital value of the temperature segment where the analog value Gm is located, y m Indicates the starting digital value x m The corresponding starting temperature.

7. A temperature sensor compensation method, characterized in that: The following steps are involved: Step 1, connect the temperature sensor to a constant voltage source circuit, and obtain the current signal output by the temperature sensor when monitoring the temperature change under different temperature conditions as an analog output, wherein each temperature corresponds to a current signal, which is recorded as AI0~AIn; Step 2, convert the current signal corresponding to each temperature through an A / D converter, obtain the digital value at the corresponding temperature according to the relationship between the analog value and the digital value, record the digital value as G0~Gn, correspond one-to-one with the AI0~AIn, construct a data set QI=(qt0,qt1,qt2,…,qti,…,qtn), where the i-th data qti is composed of Gi and its corresponding AIi; Step 3: According to different pre-configured window lengths L, the data set is segmented to obtain multiple subsets, and high-order spline interpolation is performed on each subset to determine the fitting relationship fq=f for each subset. L (G); Step 4: In each subset and the fitting relationship fq=f obtained according to any window length L L (G), calculate the fitting result corresponding to each AIi according to the data set QI = (qt0, qt1, qt2, ..., qti, ..., qtn), and calculate the standard deviation of the fitting result and Gi corresponding to AIi; Step 5: According to the minimum standard deviation, determine the corresponding window length Lm and the obtained fitting relationship fq=f Lm (G) as a temperature compensation relationship within each window range; Step 6: According to the measured analog value Gm, the window range is determined according to the window length Lm, and according to the fitting relationship within the corresponding window range, the compensated temperature detection value is calculated and output.

8. The temperature sensor compensation method according to claim 7, characterized in that: The different temperature conditions are different temperature conditions divided by gradients; The different temperature conditions divided by the gradient are set to decrease or increase in gradient according to the preset temperature change value, so as to determine different temperature points with increasing or decreasing temperature change values; The preconfigured different window lengths L are set to be related to the change amounts of different temperatures divided by the gradient, and are in a negative correlation.

9. The temperature sensor compensation method according to claim 8, characterized in that: The temperature change value ranges from 0.5 to 50°C, and: When the temperature change value ranges from 0.5 to 5° C., the pre-configured different window lengths L are positive integers greater than or equal to 10. When the temperature change value has a range greater than 5° C., the pre-configured different window lengths L are positive integers less than or equal to 10.

10. A computer system, characterized in that: include: one or more processors; A memory storing operable instructions, wherein when the instructions are executed by the one or more processors, the one or more processors are caused to perform operations, wherein the operations include the process of executing the temperature sensor compensation method according to any one of claims 1 to 9.