Temperature measurement method, device, equipment and medium
By generating a segmented polynomial fitting function to process the temperature signal, the problems of strong nonlinearity and poor interchangeability of NTC thermistors in temperature measurement are solved, and the accuracy of temperature measurement is improved.
Patent Information
- Application Number
- CN202411660719.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-03-11
Smart Images

Figure CN119595137A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of temperature measurement technology, and in particular to a temperature measurement method, device, equipment and medium. Background Art
[0002] At present, negative temperature coefficient (NTC) thermistors have the advantages of high sensitivity, good stability, low cost and small size, and are widely used as resistance elements of temperature sensors for measuring temperature in many fields. However, due to the shortcomings of NTC thermistors such as strong nonlinearity and poor interchangeability, the accuracy of temperature measurement results is affected. Summary of the invention
[0003] The present invention provides a temperature measurement method, device, computer equipment and medium to solve the technical problem that the accuracy of temperature measurement results is affected due to the shortcomings of NTC thermistors such as strong nonlinearity and poor interchangeability.
[0004] In a first aspect, a temperature measurement method is provided, comprising:
[0005] Get the current resistance value of the target thermistor of the temperature sensor;
[0006] Acquire a resistance temperature data set of a target thermistor, wherein the resistance temperature data set includes a plurality of groups of resistance temperature value pairs indicating a corresponding relationship between temperature and resistance;
[0007] Based on the resistance temperature data set, a piecewise polynomial fitting function corresponding to the target thermistor is generated;
[0008] Based on the current resistance value and the piecewise polynomial fitting function, a current temperature value output by the temperature sensor is determined.
[0009] In a second aspect, a temperature measurement device is provided, comprising:
[0010] A first acquisition module, used to acquire a current resistance value of a target thermistor of the temperature sensor;
[0011] A second acquisition module is used to acquire a resistance temperature data set of a target thermistor, wherein the resistance temperature data set includes a plurality of resistance temperature value pairs of corresponding relationships between temperature and resistance;
[0012] A generation module, used for generating a piecewise polynomial fitting function corresponding to a target thermistor based on a resistance temperature data set;
[0013] The determination module is used to determine the current temperature value output by the temperature sensor based on the current resistance value and the piecewise polynomial fitting function.
[0014] In a third aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned temperature measurement method when executing the computer program.
[0015] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned temperature measurement method are implemented.
[0016] In the scheme implemented by the temperature measurement method, device, computer equipment and storage medium, a piecewise polynomial fitting function of the temperature of the target thermistor in different resistance value intervals is pre-created. After obtaining the current resistance value of the target thermistor of the temperature sensor, the current temperature value output by the temperature sensor is determined based on the current resistance value and the pre-created piecewise polynomial fitting function. By using the fitted piecewise polynomial fitting function to process the temperature signal, it can better adapt to the complexity and nonlinear changes of the signal, effectively reduce the risk of overfitting, and improve the accuracy of the temperature output by the thermistor. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0018] Figure 1 is a schematic flow chart of a temperature measurement method in one embodiment of the present invention;
[0019] Figure 2 yes Figure 1 A schematic flow chart of a specific implementation of step S30;
[0020] Figure 3 is a structural schematic diagram of a temperature measuring device in one embodiment of the present invention;
[0021] Figure 4 is a schematic diagram of a structure of a computer device in one embodiment of the present invention;
[0022] Figure 5 It is another structural schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0024] The temperature measurement method provided by the present invention can be applied to the temperature detection scenario of the transmission line. Specifically, in modern power systems, the transmission line is a key part of power transmission, and ensuring its safe, stable and efficient operation is crucial to the reliability of the entire power system. Temperature monitoring, as an important part of the state monitoring of the transmission line, plays a vital role. High temperature may cause insulation aging, wire damage, and even cause serious accidents such as fire. Therefore, real-time and accurate temperature monitoring of the transmission line can effectively prevent faults, ensure the safe operation of the power system, reduce maintenance costs, and improve transmission efficiency. Negative temperature coefficient (NTC) thermistors have been widely used in temperature monitoring of transmission lines due to their high precision and high sensitivity. However, NTC thermistors have two significant disadvantages: poor interchangeability and strong nonlinearity. Among them, poor interchangeability refers to the inconsistency of parameters between NTC thermistors of the same model and batch given by the manufacturer, and the difference between individuals may reach 5% to 10% or even higher. This inconsistency will affect the accuracy of temperature measurement. Strong nonlinearity refers to the exponential relationship between the resistance and temperature of the NTC thermistor, showing a strong nonlinear characteristic, which makes it difficult to accurately measure the temperature in practical applications.
[0025] Based on the above problems, an embodiment of the present application provides a temperature measurement method, which obtains the current resistance value of the target thermistor and creates a piecewise polynomial fitting function to obtain the current temperature value output by the NTC thermistor, wherein the piecewise polynomial function is a function of the corresponding relationship between the temperature and resistance of the fitted target thermistor. By using the fitted piecewise polynomial function to process the temperature signal, the reading accuracy of the NTC thermistor is effectively improved.
[0026] See also Figure 1 As shown, Figure 1 A flow chart of a temperature measurement method provided by an embodiment of the present invention includes the following steps:
[0027] S10: Obtain the current resistance value of the target thermistor of the temperature sensor;
[0028] In this step, the target thermistor is used as a resistance element of the temperature sensor, and different temperature values will correspond to different resistance values. The current resistance value of the target thermistor in the temperature sensor used to measure the object to be measured is obtained to measure the temperature value of the object to be measured.
[0029] It should be noted that the temperature sensor is used to monitor the temperature of the object to be measured. The target thermistor in the temperature sensor, that is, the resistance element, has the characteristic of changing with temperature. Different types of target thermistors can be selected according to the different application fields, application requirements and measurement requirements of the temperature sensor.
[0030] S20: Acquire a resistance temperature data set of a target thermistor;
[0031] The resistance-temperature data set includes multiple sets of resistance-temperature value pairs with corresponding relationships between temperature and resistance;
[0032] In this step, the resistance temperature data set is a table of the correspondence between resistance and temperature given by the temperature sensor manufacturer when it leaves the factory. The correspondence between the resistance and temperature of different types of thermistors is different. The resistance temperature data set includes multiple sets of value pairs of the correspondence between temperature and resistance.
[0033] In one embodiment of the present application, a specific solution for obtaining a resistance temperature data set of a target thermistor is provided. In S20, that is, obtaining a resistance temperature data set of a target thermistor, specifically includes the following steps S21-S22:
[0034] S21: Based on preset task requirements, select a target thermistor as a resistance element of the temperature sensor;
[0035] S22: Acquire a resistance temperature data set of a target thermistor.
[0036] For steps S21-S22, the preset task requirements are used to guide the selection of a suitable NTC thermistor, which should cover the requirements of temperature range, accuracy, response time, environmental conditions, etc., to ensure that the temperature sensor can meet the performance in actual applications. Based on the preset task requirements, after selecting a suitable NTC thermistor, obtain a resistance temperature data set from the NTC thermistor data sheet or manufacturer. The resistance data set is a data set composed of multiple resistance temperature value pairs. The elements in the resistance temperature data set can be a value pair composed of the resistance value in the actual observation and the temperature value corresponding to the resistance value, that is, (resistance, temperature).
[0037] S30: generating a piecewise polynomial fitting function corresponding to the target thermistor based on the resistance temperature data set;
[0038] In practical applications, each group of value pairs in the resistance temperature data set provided by the sensor manufacturer is composed of discontinuous points, and it is impossible to directly determine the temperature value corresponding to the current resistance by querying the resistance temperature data set. In the related art, linear interpolation is usually used to read the temperature. However, the density of the resistance temperature data set is not enough to cover the entire range of use, and the linear interpolation method is not accurate in estimating the nonlinear correspondence, which leads to the problem of inaccurate temperature reading by the temperature sensor. Based on the above problems, the present application proposes to divide the resistance temperature data set into intervals to construct a sub-fitting function for each interval, and then derive a piecewise polynomial fitting function for the temperature in different resistance value intervals to improve the accuracy of the temperature output by the temperature sensor.
[0039] In one embodiment of the present application, Figure 2 As shown, a specific piecewise polynomial fitting function construction scheme is provided. In S30, a piecewise polynomial fitting function of a target thermistor is generated based on a resistance temperature data set, specifically including the following steps S31-S34:
[0040] S31: Determine at least two resistance value intervals based on the resistance-temperature characteristic;
[0041] Among them, the resistance-temperature characteristic refers to the characteristic between resistance and temperature, that is, the dependence between resistance and temperature. In practical applications, the resistance values of thermistors at different temperatures are different. Within a certain range of temperature, there is a certain change rule between temperature and resistance, that is, within a certain range of temperature, the resistance-temperature characteristic between temperature and resistance is consistent. Therefore, based on the resistance-temperature characteristic between temperature and resistance in the resistance-temperature data set, at least two resistance value intervals of the piecewise polynomial fitting function are obtained.
[0042] It should be noted that the resistance value of the NTC thermistor will decrease as the temperature value increases. Within different temperature ranges, the degree to which the resistance value decreases with the increase of the temperature value varies, while within a certain temperature range, the degree to which the resistance value decreases with the increase of the temperature value is the same. Therefore, it can be considered that within this temperature range, the resistance-temperature characteristics between temperature and resistance are consistent, and the resistance value range corresponding to this temperature range can be used as a resistance value interval. In order to better divide the resistance value interval, a rectangular coordinate system is constructed, and the horizontal axis of the rectangular coordinate system represents resistance, and the vertical axis represents temperature. The value pair can be reflected in the rectangular coordinate system of temperature and resistance in the form of coordinate points, and each coordinate point is connected to form a resistance-temperature curve between temperature and resistance. Obtain the slope of the straight line between any two data points. If the slope of the straight line between any two data points is approximately equal to the slope of the straight line between the two adjacent data points, that is, the change rules between the four value pairs are approximately consistent, that is, the resistance-temperature characteristics are approximately consistent. The slopes of the straight lines between the value pairs are compared in turn in the above manner. After determining that the temperature characteristics between the multiple value pairs included in the resistance-temperature curve are approximately consistent, a resistance value range corresponding to the multiple value pairs is determined.
[0043] S32: Obtain multiple groups of resistance-temperature value pairs corresponding to each resistance value interval;
[0044] S33: generating a target sub-fitting function corresponding to each resistance value interval based on a plurality of resistance-temperature value pairs corresponding to each resistance value interval;
[0045] S34: merging at least two target sub-fitting functions of at least two resistance value intervals to generate a piecewise polynomial fitting function.
[0046] For steps S32-S34, for any resistance value interval that has been divided, the resistance value interval includes multiple groups of resistance-temperature value pairs, and the multiple groups of resistance-temperature value pairs within the resistance value interval are fitted to obtain the target sub-fitting function corresponding to the resistance value interval. After obtaining the target sub-fitting function corresponding to each resistance value interval, the target sub-fitting function corresponding to each resistance value interval is combined in order from small to large according to the resistance value range of the resistance value interval segment to obtain the final piecewise polynomial fitting function.
[0047] In the above manner, a sub-fitting function is constructed based on the resistance-temperature value pair corresponding to each resistance value interval, and then a piecewise polynomial fitting function of temperature in different resistance value intervals is obtained, which can improve the accuracy of the temperature output by the temperature sensor.
[0048] In one embodiment of the present application, a specific solution for constructing a target sub-fitting function corresponding to each resistance value interval is provided. In S33, based on multiple groups of resistance-temperature value pairs corresponding to each resistance value interval, a target sub-fitting function corresponding to each resistance value interval is generated, which specifically includes the following steps S331-S334:
[0049] S331: for any resistance value interval, dividing multiple groups of resistance-temperature value pairs corresponding to the resistance value interval into a training set and a validation set;
[0050] In this step, for any resistance value interval, the resistance-temperature value pairs within the resistance value interval are divided into a training set and a validation set. The training set is used to fit a sub-fitting function so that the sub-fitting function has sufficient generalization ability to make reasonable predictions for new, unseen data; the validation set is a data set for evaluating the generalization ability of the sub-fitting function and performing hyperparameter adjustment. The validation set is used to verify the performance of the sub-fitting function on unseen data, thereby avoiding overfitting.
[0051] Optionally, the division ratio of the training set and the validation set may be 80% training set and 20% validation set.
[0052] S332: Obtain a preset polynomial order set;
[0053] In this step, the polynomial order refers to the degree of the highest power in the polynomial. The preset polynomial order set consists of the degrees of the highest powers in multiple polynomials, which limits the degree of the highest power of the training model.
[0054] Optionally, the preset polynomial order set is {3, 4, 5, ..., 12}. By presetting the polynomial order set, the highest power of the polynomial order is controlled within a reasonable range to avoid sample data from being unable to fit or overfitting, and reduce the possibility of data being out of touch with reality and causing excessive computation. The advanced polynomial fitting model is used to fit polynomial models from 3rd to 12th order, and the effects of different orders on the linearization effect are compared.
[0055] S333: starting from the first polynomial order in the preset polynomial order set and looping through to the last polynomial order, performing fitting based on the training set for each target polynomial order traversed, and obtaining a sub-fitting function of the target polynomial order;
[0056] The loop starts from the first polynomial order in the preset polynomial set and ends at the last polynomial order. In each loop, the polynomial order value is determined based on the element value in the polynomial order set each time the function is fitted, and the function fitting is performed at the corresponding order according to the order value.
[0057] Furthermore, the target polynomial order is the element value currently traversed when traversing the polynomial order set. Each time a target polynomial order is traversed, the polynomial corresponding to the target polynomial order is obtained, and the polynomial is fitted using the training set, so that the fitted target polynomial can capture the variation trend of resistance and temperature as much as possible, thereby better reflecting the relationship between resistance and temperature, and the fitted polynomial is used as a sub-fitting function.
[0058] In actual application scenarios, the preset polynomial order set is {3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, where 3 represents the polynomial order of 3, and 5 represents the polynomial order of 5. First, traverse and obtain the first preset polynomial order 3, then traverse and obtain the second polynomial order 4, and then traverse and obtain each preset polynomial order in the above manner, and stop when the last polynomial order 12 is traversed. When the polynomial order set is traversed for the first time and the first polynomial order 3 is obtained from the preset polynomial set, a third-order polynomial is obtained, and a sub-fitting function corresponding to the third-order polynomial is obtained by fitting based on the training set.
[0059] In one embodiment of the present application, a specific scheme for constructing a sub-fitting function is provided. In S333, fitting is performed based on the training set to obtain a sub-fitting function of the target polynomial order, which specifically includes the following steps S3331-S3332:
[0060] S3331: Obtain the least squares function corresponding to the target polynomial order;
[0061] S3332: Perform least square function fitting based on the training set to obtain a sub-fitting function of the target polynomial order.
[0062] For steps S3331-S3332, the least squares method finds the best function match for the data by minimizing the sum of squares of errors, brings the resistance-temperature value pairs in the training set into the least squares function for fitting, determines the coefficients of each variable of the least squares function of the target polynomial order, and then obtains the sub-fitting function of the target polynomial order.
[0063] Through the above method, using the least squares method for fitting, a function that has a good fitting effect on the training set under a given polynomial order can be obtained; by learning the least squares function from the training set, the fitting function has a certain adaptability and generalization ability, can cope with unseen data, and perform well in practical applications.
[0064] In practical application scenarios, polynomial fitting is one of the most commonly used statistical methods to analyze the interaction between parameters and data and to establish a statistical model between parameters and data. Polynomial fitting is to express a series of data as a polynomial equation and to quickly and accurately obtain the parameters of the model by solving the polynomial equation. Specifically, a suitable polynomial is selected as formula (1):
[0065]
[0066] Wherein, the above m refers to the target polynomial order; the above w refers to the coefficient of the polynomial; the above x refers to the independent variable temperature; and the above y(x) refers to the resistance value at temperature x.
[0067] Use the matrix to change formula (1) into formula (2):
[0068] y(x) = XW;
[0069] in,
[0070] Calculate a W so that the square error of the difference is minimized, and we can get formula 3:
[0071]
[0072] Using formula (3), we can get the loss function E(ω) to be non-negative, and the minimum value is where all partial derivatives are 0. The partial derivatives are obtained to get formula 4:
[0073]
[0074] For this loss function, it is a quadratic function of w, and its gradient with respect to w is a linear function of w. Therefore, a unique solution can be found, which is the coefficient w in the polynomial.
[0075] S334: verifying each sub-fitting function based on the verification set to obtain an average prediction error of each sub-fitting function;
[0076] S335: Determine a target sub-fitting function based on a plurality of average prediction errors corresponding to a preset polynomial order set.
[0077] For steps S334-S335, the sub-fitting function corresponding to any polynomial order is verified based on the verification set to obtain the predicted value of the verification set. Thereafter, the error between the predicted value and the actual value of the verification set is calculated to obtain multiple predicted error values, and the average of the multiple predicted error values is calculated to obtain the average predicted error value. Finally, according to the average predicted error value corresponding to each polynomial order, it is determined which of the multiple sub-fitting functions is the best, and the determined best sub-fitting function is used as the target sub-fitting function of the resistance value range.
[0078] In the above way, cross-validation is used to evaluate the performance of each polynomial model, and the optimal model is selected based on multiple performance indicators.
[0079] In one embodiment of the present application, a specific scheme for obtaining the average prediction error is provided. In S334, each sub-fitting function is verified based on the verification set to obtain the average prediction error of each sub-fitting function, which specifically includes the following steps S3341-S3343:
[0080] S3341: For any sub-fitting function, input each resistor in the validation set into the sub-fitting function to obtain a predicted temperature corresponding to each resistor;
[0081] S3342: Calculate a prediction error value based on the temperature corresponding to each resistor in the validation set and the predicted temperature;
[0082] S3343: Based on multiple prediction error values, determine an average prediction error value.
[0083] For steps S3341-S3343: For any sub-fitting function, traverse all resistance-temperature value pairs in the validation set, input the resistance in each resistance-temperature value pair into the sub-fitting function, and the sub-fitting function predicts based on the input resistance value and outputs the predicted temperature. Calculate the error value between the temperature in the resistance-temperature value pair and the predicted temperature to obtain the predicted error value corresponding to the resistance-temperature value pair. Then, calculate the average of all the predicted error values to obtain the average predicted error value.
[0084] In the above manner, the difference between the predicted temperature fitted by the sub-fitting function and the corresponding actual temperature is calculated as a basis for selecting the optimal fitting function.
[0085] In one embodiment of the present application, a specific scheme for obtaining the average prediction error is provided. In S335, a target sub-fitting function is determined based on multiple average prediction errors corresponding to a preset polynomial order set, specifically including the following steps S3351-S3352:
[0086] S3351: Obtain the minimum average prediction error value among the multiple average prediction error values;
[0087] S3352: Determine the sub-fitting function corresponding to the minimum average prediction error value from multiple sub-fitting functions as the target sub-fitting function.
[0088] For steps S3351-S3352: sort the multiple average prediction error values in ascending order, and according to the sorting result, determine the sub-fitting function corresponding to the smallest average prediction error value as the target sub-fitting function.
[0089] S40: Determine a current temperature value output by the temperature sensor based on the current resistance value and the piecewise polynomial fitting function.
[0090] In this step, the current resistance value is substituted into the created piecewise polynomial fitting function to obtain the temperature value corresponding to the current resistance value.
[0091] It can be seen that in the above scheme, a piecewise polynomial fitting function of the temperature of the target thermistor in different resistance intervals is pre-created. After obtaining the current resistance value of the target thermistor of the temperature sensor, the current temperature value output by the temperature sensor is determined based on the current resistance value and the pre-created piecewise polynomial fitting function. By using the fitted piecewise polynomial fitting function to process the temperature signal, it can better adapt to the complexity and nonlinear changes of the signal, effectively reduce the risk of overfitting, and improve the accuracy of the thermistor output temperature.
[0092] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0093] In one embodiment, a temperature measurement device is provided, which corresponds one-to-one to the temperature measurement method in the above embodiment. Figure 3 As shown, the temperature measurement device includes: a first acquisition module 101, a second acquisition module 102, a generation module 103 and a determination module 104. The functional modules are described in detail as follows:
[0094] A first acquisition module 101 is used to acquire a current resistance value of a target thermistor of a temperature sensor;
[0095] A second acquisition module 102 is used to acquire a resistance temperature data set of a target thermistor, wherein the resistance temperature data set includes a plurality of resistance temperature value pairs of corresponding relationships between temperature and resistance;
[0096] A generating module 103, for generating a piecewise polynomial fitting function corresponding to a target thermistor based on a resistance temperature data set;
[0097] The determination module 104 is used to determine the current temperature value output by the temperature sensor based on the current resistance value and the piecewise polynomial fitting function.
[0098] In one embodiment, the second acquisition module 102 specifically includes:
[0099] A screening unit, used for screening a target thermistor as a resistance element of the temperature sensor based on preset task requirements;
[0100] The first acquisition unit is used to acquire a resistance temperature data set of a target thermistor.
[0101] In one embodiment, the generating module 103 specifically includes:
[0102] A first determining unit, configured to determine at least two resistance value intervals based on the resistance-temperature characteristic;
[0103] The second acquisition unit is used to acquire multiple groups of resistance-temperature value pairs corresponding to each resistance value interval;
[0104] A first generating unit is used to generate a target sub-fitting function corresponding to each resistance value interval based on a plurality of groups of resistance-temperature value pairs corresponding to each resistance value interval;
[0105] The second generating unit is used to merge at least two target sub-fitting functions of at least two resistance value intervals to generate a piecewise polynomial fitting function.
[0106] In one embodiment, the first generating unit is specifically configured to:
[0107] For any resistance value interval, multiple groups of resistance-temperature value pairs corresponding to the resistance value interval are divided into a training set and a validation set;
[0108] Get the preset polynomial order set;
[0109] Starting from the first polynomial order in the preset polynomial order set, looping through to the last polynomial order, fitting is performed based on the training set for each target polynomial order traversed, to obtain a sub-fitting function of the target polynomial order;
[0110] Each sub-fitting function is verified based on the validation set to obtain the average prediction error of each sub-fitting function;
[0111] Based on a plurality of average prediction errors corresponding to a preset polynomial order set, a target sub-fitting function is determined.
[0112] In one embodiment, the first generating unit is further configured to:
[0113] Get the least squares function corresponding to the target polynomial order;
[0114] The least square function is fitted based on the training set to obtain the sub-fitting function of the target polynomial order.
[0115] In one embodiment, the first generating unit is further configured to:
[0116] For any sub-fitting function, each resistor in the validation set is input into the sub-fitting function to obtain the predicted temperature corresponding to each resistor;
[0117] Calculate the prediction error value based on the temperature corresponding to each resistor in the validation set and the predicted temperature;
[0118] Based on the plurality of prediction error values, an average prediction error value is determined.
[0119] In one embodiment, the first generating unit is further configured to:
[0120] Obtain the minimum average prediction error value among multiple average prediction error values;
[0121] The sub-fitting function corresponding to the minimum average prediction error value is determined from multiple sub-fitting functions as the target sub-fitting function.
[0122] The present invention provides a temperature measurement device, which pre-creates a piecewise polynomial fitting function of the temperature of a target thermistor in different resistance value intervals, and after obtaining the current resistance value of the target thermistor of the temperature sensor, determines the current temperature value output by the temperature sensor based on the current resistance value and the pre-created piecewise polynomial fitting function. By using the fitted piecewise polynomial fitting function to process the temperature signal, it can better adapt to the complexity and nonlinear changes of the signal, effectively reduce the risk of overfitting, and improve the accuracy of the temperature output by the thermistor.
[0123] For the specific definition of the temperature measuring device, please refer to the definition of the temperature measuring method above, which will not be repeated here. Each module in the above-mentioned temperature measuring device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0124] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client via a network connection. When the computer program is executed by the processor, it implements a function or step on the service side of a temperature measurement method.
[0125] In one embodiment, a computer device is provided. The computer device may be a client, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server via a network connection. When the computer program is executed by the processor, the functions or steps on the client side of a temperature measurement method are implemented.
[0126] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0127] Get the current resistance value of the target thermistor of the temperature sensor;
[0128] Acquire a resistance temperature data set of a target thermistor, wherein the resistance temperature data set includes a plurality of groups of resistance temperature value pairs indicating a corresponding relationship between temperature and resistance;
[0129] Based on the resistance temperature data set, a piecewise polynomial fitting function corresponding to the target thermistor is generated;
[0130] Based on the current resistance value and the piecewise polynomial fitting function, a current temperature value output by the temperature sensor is determined.
[0131] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0132] Get the current resistance value of the target thermistor of the temperature sensor;
[0133] Acquire a resistance temperature data set of a target thermistor, wherein the resistance temperature data set includes a plurality of groups of resistance temperature value pairs indicating a corresponding relationship between temperature and resistance;
[0134] Based on the resistance temperature data set, a piecewise polynomial fitting function corresponding to the target thermistor is generated;
[0135] Based on the current resistance value and the piecewise polynomial fitting function, a current temperature value output by the temperature sensor is determined.
[0136] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can refer to the relevant descriptions on the server side and the client side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.
[0137] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0138] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0139] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A temperature measurement method, characterized in that: The method comprises: Get the current resistance value of the target thermistor of the temperature sensor; Acquire a resistance temperature data set of the target thermistor, wherein the resistance temperature data set includes a plurality of groups of resistance temperature value pairs of corresponding relationships between temperature and resistance; Based on the resistance temperature data set, generating a piecewise polynomial fitting function corresponding to the target thermistor; A current temperature value output by the temperature sensor is determined based on the current resistance value and the piecewise polynomial fitting function.
2. The method according to claim 1, characterized in that The step of obtaining the resistance temperature data set of the target thermistor specifically includes: Based on preset task requirements, selecting the target thermistor as a resistance element of the temperature sensor; The resistance temperature data set of the target thermistor is acquired.
3. The method according to claim 1, characterized in that The step of generating a piecewise polynomial fitting function corresponding to the target thermistor based on the resistance temperature data set specifically includes: Based on the resistance-temperature characteristic, determining at least two resistance value intervals; Obtain multiple groups of resistance-temperature value pairs corresponding to each resistance value interval; Based on the multiple groups of resistance-temperature value pairs corresponding to each resistance value interval, generating a target sub-fitting function corresponding to each resistance value interval; At least two target sub-fitting functions of at least two resistance value intervals are combined to generate the piecewise polynomial fitting function.
4. The method according to claim 3, characterized in that: The step of generating a target sub-fitting function corresponding to each resistance value interval based on the multiple groups of resistance-temperature value pairs corresponding to each resistance value interval specifically includes: For any resistance value interval, multiple groups of resistance-temperature value pairs corresponding to the resistance value interval are divided into a training set and a validation set; Get the preset polynomial order set; Looping from the first polynomial order in the preset polynomial order set to the last polynomial order, fitting the target polynomial order traversed each time based on the training set to obtain a sub-fitting function of the target polynomial order; Verifying each sub-fitting function based on the verification set to obtain an average prediction error of each sub-fitting function; The target sub-fitting function is determined based on a plurality of average prediction errors corresponding to the preset polynomial order set.
5. The method according to claim 4, characterized in that The step of performing fitting based on the training set to obtain a sub-fitting function of the target polynomial order specifically includes: Obtaining a least squares function corresponding to the target polynomial order; A least square function fitting is performed based on the training set to obtain a sub-fitting function of the target polynomial order.
6. The method according to claim 4, characterized in that The step of verifying each sub-fitting function based on the verification set to obtain the average prediction error of each sub-fitting function specifically includes: For any sub-fitting function, each resistor in the verification set is input into the sub-fitting function to obtain a predicted temperature corresponding to each resistor; Calculate the prediction error value based on the temperature corresponding to each resistor in the validation set and the predicted temperature; Based on a plurality of prediction error values, the average prediction error value is determined.
7. The method according to claim 4, characterized in that The step of determining the target sub-fitting function based on the multiple average prediction errors corresponding to the preset polynomial order set specifically includes: Obtaining the minimum average prediction error value among the multiple average prediction error values; The sub-fitting function corresponding to the minimum average prediction error value is determined from multiple sub-fitting functions as the target sub-fitting function.
8. A temperature measuring device, characterized in that: include: A first acquisition module, used to acquire a current resistance value of a target thermistor of the temperature sensor; A second acquisition module is used to acquire a resistance temperature data set of the target thermistor, wherein the resistance temperature data set includes a plurality of groups of resistance temperature value pairs of corresponding relationships between temperature and resistance; A generating module, used for generating a piecewise polynomial fitting function corresponding to the target thermistor based on the resistance temperature data set; A determination module is used to determine a current temperature value output by the temperature sensor based on the current resistance value and the piecewise polynomial fitting function.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the video search method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the video search method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Junction temperature testing method and system for laser diode chip
CN120405369A
Processing method and system for high-resolution seabed in-situ heat flow data
CN120578862A
A method and system for processing high-resolution in-situ seabed heat flux data
CN120578862B
Semiconductor EPI process bulb life test device and test method
CN120870950A
Semiconductor epi process lamp bulb life test apparatus and method
CN120870950B