Thermistor temperature measurement method and device, electronic equipment and storage medium

CN122708960APending Publication Date: 2026-09-08SHENZHEN TOPOS SENSOR TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611193906.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-07
Publication Date
2026-09-08

AI Technical Summary

Technical Problem

[0004]这种通用的温度测量方法在处理很宽的温度工作范围时会出现一些局限问题:

Benefits of technology

本发明的热敏电阻测温方案实现了软硬件的高度协同,显著提升了设备在宽温区内的全量程测温精度。在硬件层面,本发明通过动态判定阻值区间并自适应切换不同档位的上拉电阻,确保模数转换采样节点在极端高低温度下始终处于最佳分辨率窗口,有效克服了传统固定上拉电阻导致的信号采集失真缺陷。在数据处理层面,本发明引入三点恒温标定工序以提取各传感器的专属特征常数,并结合多项式对数测温模型进行换算,替代了常规的B值公式法,从而有效消除元器件制造公差及温度阻值曲线非线性带来的拟合误差。该方案构建出包含动态采样、精准计算与硬件状态反馈的自适应测温闭环,实现了物理组件标定与底层算法的深度融合,尤为适用于无线食物探针等对全量程测温一致性与精度要求极高的终端设备。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122708960A_ABST
    Figure CN122708960A_ABST
Patent Text Reader

Abstract

This application proposes a thermistor temperature measurement method, device, electronic device, and storage medium. The thermistor temperature measurement method of this invention includes the following steps: obtaining a configuration command to control a switching circuit; connecting a target pull-up resistor in series with the thermistor to form a voltage divider network; acquiring the node voltage signals of the voltage divider network to determine the current measured resistance value; reading characteristic constants pre-calibrated based on three different isothermal environments; using the measured resistance value and characteristic constants, calculating the target ambient temperature through a preset temperature measurement model; subsequently comparing the current measured resistance value with a preset resistance range, and updating the pull-up configuration command for the next temperature measurement cycle. This solution effectively overcomes sampling distortion and fitting errors within a wide temperature range through the synergy of underlying hardware adaptive range switching and polynomial precise calculation, significantly improving the temperature measurement accuracy across the entire range.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a thermistor temperature measurement method, device, electronic equipment, and storage medium, belonging to the field of sensor and electronic measurement technology. Background Technology

[0002] With the rapid development of smart home and Internet of Things technologies, temperature measurement devices are widely used in various fields, such as temperature sensors, wireless thermometers, wireless food probes, and household kitchen appliances. In particular, in the application scenario of wireless food probes, the device usually needs to work over a wide temperature range. In extreme cases, such as measuring the extremely low temperature of frozen food while monitoring the high temperature of oven cooking, the full-range accuracy of the measuring device is required to be extremely high.

[0003] Existing temperature measurement methods typically use NTC (negative temperature coefficient) thermistors as the core temperature sensor. The working principle of the temperature measurement circuit based on NTC thermistors is as follows: a fixed pull-up resistor is connected in series with the thermistor to construct a voltage divider sampling circuit. During the actual measurement, the microcontroller uses its internal ADC analog-to-digital converter to collect the analog voltage signal at the voltage divider node, and uses the B-value formula method or table lookup method to convert the voltage signal into the corresponding temperature data.

[0004] This general-purpose temperature measurement method has some limitations when dealing with a wide operating temperature range: First, because the temperature-resistance curve of a thermistor exhibits strong nonlinearity, its precise operating range is narrow. If the environment is in an extremely low or high temperature range, exceeding its precise operating range, the thermistor's resistance will change drastically. In this case, if a traditional fixed pull-up resistor is still used, the voltage change rate at the ADC sampling node will decrease significantly, making it difficult for the microcontroller to accurately sense even small fluctuations in resistance. This means that the sampling resolution decreases unavoidably and is difficult to resolve at extreme temperatures. Furthermore, at the data processing level, conventional B-value formulas or lookup table methods cannot well fit the nonlinear curve across the entire range, and existing systems cannot achieve temperature calibration through isothermal calibration.

[0005] The limitations of the aforementioned hardware structure and software algorithm combine to result in large errors in temperature measurement results of temperature measuring electronic devices in both negative and high temperature ranges. This makes it difficult to meet the technical requirements of modern high-end application scenarios for wide temperature range and high-precision temperature measurement, and a new hardware and software collaborative solution is urgently needed to overcome the above technical problems. Summary of the Invention

[0006] In view of the shortcomings of the prior art, the purpose of this invention is to provide a thermistor temperature measurement method, device, electronic device and storage medium.

[0007] According to an embodiment of the present invention, a first solution is provided: a thermistor temperature measurement method applied to an electronic device, the electronic device including a control unit, a plurality of pull-up resistors with increasing resistance values, and a thermistor, the method comprising: Obtain the pull-up configuration instruction corresponding to the current cycle, and control the corresponding switch circuit to close according to the pull-up configuration instruction, so as to connect the target pull-up resistor and the thermistor in series to form a voltage divider network; The node voltage signals of the voltage divider network are collected, and the current measured resistance R of the thermistor is determined based on the node voltage signals and the known resistance value of the target pull-up resistor. Read the preset characteristic constants A, B, and C from the memory. The characteristic constants are obtained based on the reference resistance values ​​of the thermistor under three different constant temperature environments. Using the current measured resistance R and the characteristic constants A, B, and C, the target ambient temperature T is calculated through a preset temperature measurement model, which satisfies the following:

[0008] The current measured resistance value is compared with the preset resistance range division conditions to determine the target resistance range to which the current measured resistance value belongs. Based on the target resistance range, the pull-up configuration command is updated to control the corresponding switching circuit in the next temperature measurement cycle. The pull-up resistor that matches the target resistance range is connected to the voltage divider network as the new target pull-up resistor.

[0009] Furthermore, the plurality of pull-up resistors with increasing resistance values ​​include at least a first pull-up resistor, a second pull-up resistor, and a third pull-up resistor; The resistance range division conditions include a first resistance threshold and a second resistance threshold, wherein the first resistance threshold is less than the second resistance threshold.

[0010] Furthermore, the step of updating the pull-up configuration command according to the target resistance range includes: If the current measured resistance value is less than or equal to the first resistance threshold, a first configuration instruction is generated to control the corresponding switch circuit to close in the next temperature measurement cycle, and the first pull-up resistor is connected to the voltage divider network as a new target pull-up resistor. If the current measured resistance value is greater than the first resistance threshold and less than or equal to the second resistance threshold, a second configuration instruction is generated to control the corresponding switch circuit to close in the next temperature measurement cycle, and the second pull-up resistor is connected to the voltage divider network as a new target pull-up resistor. If the current measured resistance value is greater than the second resistance threshold, a third configuration instruction is generated to control the corresponding switch circuit to close in the next temperature measurement cycle, and the third pull-up resistor is connected to the voltage divider network as a new target pull-up resistor.

[0011] Furthermore, the method further includes the following steps when the device is first powered on and reset or when no historical resistance measurement value is obtained: Generate a default configuration instruction to control the corresponding switch circuit to close during the first temperature measurement cycle, connect the second pull-up resistor as the initial target pull-up resistor to the voltage divider network, and execute the step of acquiring the node voltage signal of the voltage divider network.

[0012] Furthermore, before reading the preset characteristic constants A, B, and C from the memory, a characteristic constant calibration step is included, which includes: The thermistor is placed in a first preset constant temperature environment, a second preset constant temperature environment and a third preset constant temperature environment respectively, wherein the temperature values ​​of the first preset constant temperature environment, the second preset constant temperature environment and the third preset constant temperature environment increase sequentially. Under the first preset constant temperature environment, a calibration command is sent to the electronic device, and the first reference resistance value R1 of the thermistor is collected and recorded; Under the second preset constant temperature environment, a calibration command is sent to the electronic device, and the second reference resistance value R2 of the thermistor is collected and recorded; Under the third preset constant temperature environment, a calibration command is sent to the electronic device, and the third reference resistance value R3 of the thermistor is collected and recorded; Based on the first reference resistance value R1, the second reference resistance value R2, the third reference resistance value R3, and the corresponding ambient temperature value, the characteristic constants A, B, and C are calculated and stored in the memory.

[0013] Further, the step of calculating the characteristic constants A, B, and C based on the first reference resistance value R1, the second reference resistance value R2, the third reference resistance value R3, and the corresponding ambient temperature value includes: Calculate the logarithmic parameters of the resistance: , , ; Calculate the reciprocal parameter of temperature: , , ; Where T1, T2, and T3 are the Celsius temperatures of the first, second, and third preset constant temperature environments, respectively. The characteristic constants C, B, and A are calculated and obtained according to the following formulas:

[0014]

[0015] .

[0016] According to an embodiment of the present invention, a second solution is provided as follows: A thermistor temperature measuring device is applied to an electronic device, the electronic device including a control unit, a plurality of pull-up resistors with increasing resistance values, and a thermistor, the device comprising: The hardware configuration module is used to obtain the pull-up configuration instruction corresponding to the current cycle, and control the corresponding switch circuit to close according to the pull-up configuration instruction, so as to connect the target pull-up resistor and the thermistor in series to form a voltage divider network. The signal acquisition and conversion module is used to acquire the node voltage signals of the voltage divider network, and determine the current measured resistance R of the thermistor based on the node voltage signals and the known resistance value of the target pull-up resistor; The parameter reading module is used to read preset characteristic constants A, B, and C from the memory. The characteristic constants are obtained based on the reference resistance values ​​of the thermistor under three different constant temperature environments. The temperature calculation module is used to calculate the target ambient temperature T using the current measured resistance R and the characteristic constants A, B, and C through a preset temperature measurement model. The preset temperature measurement model satisfies the following:

[0017] The instruction update module compares the current measured resistance value with the preset resistance range division conditions to determine the target resistance range to which the current measured resistance value belongs. Based on the target resistance range, the pull-up configuration instruction is updated to control the corresponding switching circuit in the next temperature measurement cycle and connects the pull-up resistor that matches the target resistance range as the new target pull-up resistor to the voltage divider network.

[0018] According to an embodiment of the present invention, a third solution is provided as follows: An electronic device, comprising: At least one microprocessor; The memory is communicatively connected to the at least one microprocessor. Multiple pull-up resistors with increasing resistance values, and at least one thermistor; The memory stores a computer program that can be executed by the at least one microprocessor. When the at least one microprocessor executes the computer program, it implements the thermistor temperature measurement method as described above.

[0019] Furthermore, the electronic device also includes a multi-channel switching circuit, the connection structure of which includes: The first ends of the plurality of pull-up resistors with increasing resistance values ​​are respectively connected to a plurality of configuration pins of the at least one microprocessor, and the second ends are connected to the analog signal acquisition node. The first end of the at least one thermistor is connected to the analog signal acquisition node, and the second end is connected to the channel selection pin of the at least one microprocessor. The at least one microprocessor is configured to: control a corresponding configuration pin to output an effective level to connect a target pull-up resistor to the circuit; and read the voltage of the analog signal acquisition node through an internal analog-to-digital converter to obtain the node voltage signal.

[0020] A computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the following steps: Obtain the pull-up configuration instruction corresponding to the current cycle, and control the corresponding switch circuit to close according to the pull-up configuration instruction, so as to connect the target pull-up resistor and the thermistor in series to form a voltage divider network; The node voltage signals of the voltage divider network are collected, and the current measured resistance R of the thermistor is determined based on the node voltage signals and the known resistance value of the target pull-up resistor. Read the preset characteristic constants A, B, and C from the memory. The characteristic constants are obtained based on the reference resistance values ​​of the thermistor under three different constant temperature environments. Using the current measured resistance R and the characteristic constants A, B, and C, the target ambient temperature T is calculated through a preset temperature measurement model, which satisfies the following:

[0021] The current measured resistance value is compared with the preset resistance range division conditions to determine the target resistance range to which the current measured resistance value belongs. Based on the target resistance range, the pull-up configuration command is updated to control the corresponding switching circuit in the next temperature measurement cycle. The pull-up resistor that matches the target resistance range is connected to the voltage divider network as the new target pull-up resistor.

[0022] Compared with the prior art, the beneficial effects of the technical solution provided in this application are as follows: The thermistor temperature measurement solution of this invention achieves a high degree of synergy between hardware and software, significantly improving the full-range temperature measurement accuracy of the device across a wide temperature range. At the hardware level, this invention dynamically determines the resistance range and adaptively switches between different pull-up resistor levels, ensuring that the analog-to-digital conversion sampling node remains within the optimal resolution window under extreme high and low temperatures, effectively overcoming the signal acquisition distortion defects caused by traditional fixed pull-up resistors. At the data processing level, this invention introduces a three-point isothermal calibration process to extract the unique characteristic constants of each sensor, and combines this with a polynomial-logarithmic temperature measurement model for conversion, replacing the conventional B-value formula method, thereby effectively eliminating fitting errors caused by component manufacturing tolerances and the nonlinearity of the temperature-resistance curve. This solution constructs an adaptive temperature measurement closed loop that includes dynamic sampling, precise calculation, and hardware status feedback, achieving deep integration of physical component calibration and underlying algorithms, making it particularly suitable for terminal devices such as wireless food probes that have extremely high requirements for consistency and accuracy in full-range temperature measurement. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] in: Figure 1 This is a main flowchart of a thermistor temperature measurement method in one embodiment; Figure 2 This is a flowchart of the characteristic constant calibration steps of a thermistor temperature measurement method in one embodiment; Figure 3 This is a schematic diagram of the microprocessor main control pin connections for a thermistor temperature measurement method in one embodiment. Figure 4 This is a schematic diagram of a multi-stage pull-up and thermistor voltage divider network circuit for a thermistor temperature measurement method in one embodiment. Figure 5 This is a virtual module structure block diagram of a thermistor temperature measuring device in one embodiment; Figure 6 This is a structural block diagram of a computer device in one embodiment.

[0025] Figure label: 100 - Hardware configuration module; 200 - Signal acquisition and conversion module; 300 - Parameter reading module; 400 - Temperature calculation module; 500 - Instruction update module.

[0026] U2 - Microprocessor; C15 - Bypass capacitor; R3 - First pull-up resistor; R4 - Second pull-up resistor; R5 - Third pull-up resistor; R6 - First measurement channel thermistor; R8 - Second measurement channel thermistor; R9 - Third measurement channel thermistor; R10 - Fourth measurement channel thermistor. Detailed Implementation

[0027] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0028] Example 1 An embodiment of the present invention provides a thermistor temperature measurement method, which is applied to an electronic device, the electronic device including a control unit, a plurality of pull-up resistors with increasing resistance values, and a thermistor.

[0029] In wide-temperature measurement scenarios such as wireless food probes, ranging from -40°C to over 100°C, the resistance of NTC thermistors undergoes non-linear and wide-ranging changes, often fluctuating from tens of kilohms to hundreds of ohms. If the system uses a single fixed pull-up resistor, the voltage at the thermistor's voltage divider node will approach 0V or the power supply voltage under extreme high or low temperatures. This physical phenomenon results in a very small rate of change in the sampling voltage of the analog-to-digital converter, leading to a severe measurement blind zone and a sharp drop in resolution. Furthermore, traditional conversion formulas based on a single B value have significant theoretical fitting errors over a wide temperature range, also failing to meet the high-precision testing requirements of the equipment.

[0030] To address the aforementioned technical bottlenecks, this embodiment restructures the architecture from both hardware and software perspectives. At the physical hardware level, this solution introduces adaptive range switching logic, where the device dynamically connects pull-up resistors of different values ​​based on the current temperature range, ensuring that the sampling node voltage of the analog-to-digital converter remains within the optimal resolution window. At the data algorithm level, this solution replaces the conventional B-value conversion algorithm with a polynomial-logarithmic temperature measurement model that accurately characterizes semiconductor properties, and combines this with physical isothermal calibration data from three different temperature points performed before shipment to ultimately achieve high-precision temperature back-calculation.

[0031] First, a preliminary calibration step of characteristic constants needs to be performed, combined with... Figure 2 As shown, before performing routine temperature measurement procedures and reading preset characteristic constants A, B, and C from memory, electronic devices require characteristic constant calibration during the factory manufacturing process. This specifically includes: The thermistor is placed in a first preset constant temperature environment (e.g., 0℃), a second preset constant temperature environment (e.g., 50℃), and a third preset constant temperature environment (e.g., 90℃) with increasing temperatures in sequence. After thermal equilibrium is reached in each constant temperature environment, a calibration command is sent to the electronic device, and the first reference resistance value R1, the second reference resistance value R2, and the third reference resistance value R3 of the thermistor are collected and recorded in sequence.

[0032] After obtaining the actual physical reference data, calculate the logarithmic parameter of the resistance: , , ; Calculate the reciprocal parameter of temperature: , , ; Where T1, T2, and T3 are the Celsius temperatures of the first, second, and third preset constant temperature environments, respectively.

[0033] The characteristic constants C, B, and A specific to this sensor are then precisely calculated according to the following set of characteristic equations and stored in the non-volatile memory of the electronic device:

[0034]

[0035]

[0036] Combination Figure 1 As shown, after the equipment enters normal operating mode, it performs the following core steps in each temperature measurement cycle: S1: Obtain the pull-up configuration instruction corresponding to the current cycle, and control the corresponding switch circuit to close according to the pull-up configuration instruction, so as to connect the target pull-up resistor and the thermistor in series to form a voltage divider network.

[0037] Specifically, when the device is powered on for the first time or in a cold start state where no historical resistance values ​​have been obtained, the system generates a configuration command for the intermediate range by default. In the first temperature measurement cycle, the second pull-up resistor with a medium resistance value is connected to the voltage divider network first to prevent misjudgment caused by directly entering the extreme range during cold start.

[0038] S2: Acquire the node voltage signals of the voltage divider network, and determine the current measured resistance R of the thermistor based on the node voltage signals and the known resistance value of the target pull-up resistor.

[0039] At this point, the microprocessor's ADC channel reads the voltage divider and, based on whether the first, second, or third pull-up resistor is currently connected, uses the series voltage divider formula to solve for R.

[0040] S3: Read the preset characteristic constants A, B, and C from memory.

[0041] Using the current measured resistance R and the characteristic constants A, B, and C, the target ambient temperature T is calculated through a preset temperature measurement model, which satisfies the following:

[0042] It can then calculate and output the target ambient temperature.

[0043] S5: Compare the current measured resistance value with the preset resistance range division conditions, determine the target resistance range, and update the pull-up configuration command for the next temperature measurement cycle.

[0044] This solution sets a first resistance threshold and a second resistance threshold, with the first resistance threshold being less than the second resistance threshold. The device executes adaptive range switching logic based on the attenuation law of the measured resistance. Specifically: if the current measured resistance R is less than or equal to the first resistance threshold, the thermistor is in the high-temperature range and has extremely low resistance, then a first configuration command is generated, causing the system to switch to the first pull-up resistor with the smallest resistance in the next temperature measurement cycle; if the current measured resistance R is greater than the first resistance threshold and less than or equal to the second resistance threshold, then a second configuration command is generated, causing the system to switch to the second pull-up resistor in the next temperature measurement cycle; if the current measured resistance R is greater than the second resistance threshold, the thermistor is in the low-temperature range and has extremely high resistance, then a third configuration command is generated, causing the system to switch to the third pull-up resistor with the largest resistance in the next temperature measurement cycle.

[0045] Through the above implementation steps, this embodiment constructs a hardware-software integrated feedback system. At the hardware measurement level, by determining the resistance range at the end of the current cycle and updating the hardware configuration for the next cycle, the voltage divider network can dynamically adjust to the ambient temperature, ensuring that the sampling node voltage of the analog-to-digital converter remains within a high signal-to-noise ratio effective range, effectively overcoming sampling distortion defects under extreme temperatures. At the data calculation level, based on the constant-temperature calibration data from three actual physical reference points (0℃, 50℃, and 90℃) before shipment, interference from component manufacturing tolerances and parasitic parameters of peripheral circuits is effectively eliminated. Combined with a polynomial-logarithmic model for conversion, this ensures that the final output ambient temperature T has good linearity and extremely high measurement accuracy across a wide temperature range.

[0046] Example 2 This embodiment provides a thermistor temperature measurement method, specifically disclosing the calculation and verification process of the characteristic constant.

[0047] Before performing specific numerical calculations, this embodiment first tests the preset temperature measurement model.

[0048]

[0049] The parameter formulas were algebraically verified. Substituting the reciprocal parameters of temperature (x1, x2, x3) and the logarithmic parameters of resistance (y1, y2, y3) under three preset constant temperature environments into the temperature measurement model, a system of three linear equations can be constructed: First equation:

[0050] Second equation:

[0051] Third equation:

[0052] Subtracting the second equation from the first equation and simplifying it, we can extract the expression for the constant B, which is shown in Example 1:

[0053] Subtracting the second and third equations from the first equation, eliminating constants A and B, and extracting constant C, then combining the polynomials and like terms, the numerator on the right side of the equation is: The denominator on the right side of the equation is:

[0054] The above calculations verify the mathematical calculation process of the formulas for solving the constants C, B, and A provided in Example 1.

[0055] In this embodiment, a thermistor with a nominal resistance of 10 kΩ is used as the measuring probe for three-point constant temperature calibration before leaving the factory.

[0056] The first preset constant temperature environment is set to 0 degrees Celsius, at which point the absolute temperature is 273.15 Kelvin, and the measured first reference resistance R1 is 32650 ohms.

[0057] The second preset constant temperature environment is set to 50 degrees Celsius, at which point the absolute temperature is 323.15 Kelvin, and the measured second reference resistance R2 is 3600 ohms.

[0058] The third preset constant temperature environment is set to 90 degrees Celsius, at which point the absolute temperature is 363.15 Kelvin, and the measured third reference resistance R3 is 920 ohms.

[0059] Based on the above physical reference data, the equipment automatically calculates the corresponding basic parameters: Calculate the logarithmic parameters of the resistance:

[0060]

[0061]

[0062] Calculate the reciprocal parameter of temperature:

[0063]

[0064]

[0065] Then the operation of the characteristic constant C is performed.

[0066] Substituting the basic parameters into the numerator of formula C, we get:

[0067] Substituting the basic parameters into the denominator of formula C, we get:

[0068] Divide the numerator and denominator to obtain the constant. .

[0069] Next, the calculation of characteristic constant B is performed. Substituting the obtained constant C and the fundamental parameters into formula B, the numerator is calculated as follows: Divide by the denominator That is, 2.2049, which yields the constant. .

[0070] Finally, the calculation of characteristic constant A is performed. Constants B and C are substituted into the formula. .

[0071] After obtaining the highly accurate characteristic constants, they are saved to memory. When the electronic device performs actual measurements under normal temperature conditions, for example, the node voltage feedback from the voltage divider network yields a measured resistance R of 10000 ohms, with its natural logarithm lnR being 9.2103. The device then calls up the temperature measurement model:

[0072] Taking the reciprocal gives the absolute temperature T. 298.15 Kelvin, converted to degrees Celsius, gives a temperature value of 25.0 degrees Celsius.

[0073] Simultaneously, the device executes adaptive gear switching logic. The system sets the first resistance threshold to 2000 ohms and the second resistance threshold to 15000 ohms. The currently measured 10000 ohms is greater than the first resistance threshold but less than the second resistance threshold, so the system determines that the probe is currently within the second resistance range at room temperature. Based on this, the system generates a second configuration command in the next sampling cycle to maintain the closed second switching circuit, ensuring that the 10kΩ second pull-up resistor remains stably connected to the voltage divider network, effectively guaranteeing the voltage sampling resolution in the next cycle.

[0074] Example 3 This embodiment further addresses the technical problem that, during the execution of adaptive gear switching logic, the microprocessor controls the state of the switching circuit to connect a new target pull-up resistor. Since the voltage divider network nodes inevitably contain the internal sampling capacitor of the analog-to-digital converter, the parasitic capacitance of the printed circuit board traces, and the external anti-interference filter capacitor, these three components are connected in parallel to form the system's equivalent load capacitance. The node voltage cannot undergo a step change at the instant of gear switching; instead, it must slowly approach the new steady-state level following the physical curve of RC charging and discharging. If the microprocessor immediately starts the analog-to-digital converter for sampling after the switching command is issued, the sampled voltage will be a spurious transient voltage in the transition process. This hardware delay not only causes the system to calculate an incorrect current measured resistance value but also, when the ambient temperature is at the boundary between two resistance thresholds, triggers an oscillating dead loop where the control logic frequently switches back and forth between adjacent gears.

[0075] To address the aforementioned technical problems, this embodiment provides a dynamic blanking sampling method based on the RC time constant.

[0076] Specifically, a mapping table of pull-up configuration instructions and blanking wait times is pre-established in non-volatile memory. The duration data in this mapping table are not arbitrarily set fixed empirical values, but are strictly calculated based on the dynamic RC time constant formed by the equivalent load capacitance and the pull-up resistors at each level. For example, the first pull-up resistor has a resistance of 1 kΩ, and its charge / discharge time constant is extremely small; therefore, the first blanking wait time configured in the mapping table is 5 microseconds. The third pull-up resistor has a resistance of 30 kΩ, and its charge / discharge physical cycle is long; therefore, the third blanking wait time configured in the mapping table is precisely set to 150 microseconds.

[0077] During the low-level instruction flow phase of the temperature measurement cycle, after the microprocessor's general-purpose input / output pins complete level toggling and establish a new voltage divider network topology, the program pointer does not directly call the analog-to-digital converter (ADC) trigger function. Instead, it looks up the mapping table based on the current target pull-up resistor value, extracts the matching blanking wait time value, and writes this value directly into the microprocessor's internal hardware timer reload register. The microprocessor then starts this hardware timer to perform a countdown suspension. During this blanking window, the ADC channel is forced to remain in a sleep or high-impedance state. Only when the hardware timer overflows and sends a hardware interrupt signal to the system kernel does the system use this interrupt vector as the sole trigger source to wake up the ADC and execute the actual voltage capture sequence.

[0078] The control strategy in this embodiment differs from the conventional method of using a uniform maximum delay to mask transient interference. By introducing a timer interrupt blanking mechanism that matches the hardware equivalent impedance state, the system effectively skips the unstable charging and discharging phase of the resistor and capacitor during the initial stage of gear switching. This control logic, designed for the timing of the underlying circuitry, not only eliminates gear-switching oscillations caused by transient voltage distortion but also optimizes the waiting time based on the actual resistor-capacitor time constants for different gears. This allows the device to effectively shorten the invalid waiting period while ensuring temperature measurement stability over a wide temperature range, thereby improving the overall system response speed and data sampling efficiency.

[0079] Example 4 This embodiment provides a thermistor temperature measuring device applied to an electronic device. The electronic device includes a control unit, multiple pull-up resistors with increasing resistance values, and a thermistor, such as... Figure 5 As shown, the device includes: The hardware configuration module 100 is used to obtain the pull-up configuration instruction corresponding to the current cycle, and control the corresponding switch circuit to close according to the pull-up configuration instruction, so as to connect the target pull-up resistor and the thermistor in series to form a voltage divider network. The signal acquisition and conversion module 200 is used to acquire the node voltage signals of the voltage divider network, and determine the current measured resistance R of the thermistor based on the node voltage signals and the known resistance value of the target pull-up resistor; The parameter reading module 300 is used to read preset characteristic constants A, B, and C from the memory. The characteristic constants are obtained based on the reference resistance values ​​of the thermistor under three different constant temperature environments. Temperature calculation module 400 is used to calculate the target ambient temperature T using the current measured resistance R and the characteristic constants A, B, and C through a preset temperature measurement model, wherein the preset temperature measurement model satisfies:

[0080] The instruction update module 500 compares the current measured resistance value with the preset resistance value interval division conditions to determine the target resistance value interval to which the current measured resistance value belongs. Based on the target resistance value interval, it updates the pull-up configuration instruction to control the corresponding switching circuit in the next temperature measurement cycle and connects the pull-up resistor that matches the target resistance value interval as the new target pull-up resistor to the voltage divider network.

[0081] Example 5 This invention provides an electronic device and the underlying hardware structure for implementing the above-described thermistor temperature measurement method and adaptive gear switching logic.

[0082] Combination Figure 6As shown, the electronic device includes a computing device body, which is internally configured with a microprocessor, non-volatile memory connected to the microprocessor via a system bus, internal memory, and a network interface. Figure 6 The system structure, illustrated with real component diagrams, is presented. The non-volatile memory stores the operating system and computer program, which, when executed by the microprocessor, enables a thermistor temperature measurement method that includes adaptive range switching logic and characteristic constant calculations. This arrangement of physical components clearly defines the physical space and data interaction relationships between the temperature probe, microprocessor, and memory chip.

[0083] The core control circuit in this embodiment relies on a microprocessor for instruction issuance and signal acquisition. Combined with... Figure 3 Microprocessor main control pin connection diagram and Figure 4 This diagram illustrates a multi-stage pull-up resistor and thermistor voltage divider network circuit. The main control chip of the control system is U2, which has multiple general-purpose input / output pins and analog signal acquisition pins. On the power supply side of the voltage divider network, the system is configured with three independent pull-up resistors with increasing resistance values: a first pull-up resistor R3 with a resistance of 1 kΩ, a second pull-up resistor R4 with a resistance of 10 kΩ, and a third pull-up resistor R5 with a resistance of 30 kΩ. The pull-up resistor configuration pins GEAR1, GEAR2, and GEAR3 of the main control chip U2 are independently connected to one end of R3, R4, and R5, respectively, to control the connection state of the target pull-up resistors with output level signals.

[0084] On the measurement side of the voltage divider network, the system is configured with multiple independent temperature probes, including thermistors R6 for the first measurement channel, R8 for the second measurement channel, R9 for the third measurement channel, and R10 for the fourth measurement channel. The numbering here smoothly transitions from R6 to R8; R7 is not assigned. This node division ensures the uniqueness of the text markings in the entire set of drawings and instructions to avoid duplicate designations. One end of each of the four thermistors is connected to a convergence node, which is also connected to the other end of R3, R4, and R5, forming the analog signal acquisition node NTC_AD, which is directly connected to the analog-to-digital conversion input pin of the main control chip U2. The other ends of R6, R8, R9, and R10 are independently connected to the measurement channel selection pins NTC1, NTC2, NTC3, and NTC4 of the main control chip U2, respectively, to control the grounding selection of different probe measurement channels.

[0085] During the temperature measurement cycle, the main control chip U2 changes the voltage division ratio at the physical level by varying the high and low levels of its pins. Taking the current environment as an example where the intermediate setting needs to be connected and the second channel needs to be measured, the main control chip U2 pulls the measurement channel selection pin NTC2 low to ground and configures the other channel pins NTC1, NTC3, and NTC4 to a high impedance state or a floating state, thus uniquely selecting the thermistor R8 for the second measurement channel. Subsequently, the main control chip U2 outputs a valid high level on the pull-up configuration pin GEAR2 and configures the GEAR1 and GEAR3 pins to a high impedance state or an input state, cutting off the current path between the first pull-up resistor R3 and the third pull-up resistor R5.

[0086] With this pin configuration, the power supply voltage flows sequentially through the conducting second pull-up resistor R4, the analog signal acquisition node NTC_AD, and the selected thermistor R8 before flowing to ground. At this time, the main control chip U2 starts its internal analog-to-digital converter, obtains the current voltage divider signal through the analog signal acquisition node NTC_AD, and completes the precise execution of the adaptive gear switching command at the physical circuit level.

[0087] Furthermore, this embodiment also addresses the following technical problem: the calibration of characteristic constants primarily aims to eliminate manufacturing tolerances in the thermistor probe itself. However, in practical engineering applications, the reference voltage of the analog-to-digital converter built into the main control chip of electronic devices and the output voltage of the front-end power supply network will both experience non-negligible temperature drift due to changes in the ambient temperature of the motherboard and the aging of components. In addition, the analog-to-digital converter itself will also generate offset and gain errors after long-term operation. This offset of the system-level physical reference is a hardware-level variable, and conventional external temperature measurement calibration algorithms cannot dynamically sense and correct it, which will lead to inherent deviations in the input voltage parameters of the preset temperature measurement model.

[0088] To compensate for the aforementioned system deviations, this embodiment performs a local topology expansion of the multi-level pull-up and thermistor voltage divider network.

[0089] In terms of hardware circuit layout, a high-precision reference resistor R11 with a low temperature coefficient is added, and a fifth measurement channel is added to the multiplexing network. One end of the high-precision reference resistor R11 is connected to the converged analog signal acquisition node NTC_AD, and the other end is independently connected to the newly added fifth measurement channel selection pin NTC5 of the microprocessor. The physical resistance value of the high-precision reference resistor R11 is pre-written as an absolutely known constant and stored in non-volatile memory.

[0090] At the underlying control timing level, during the execution of a regular temperature measurement cycle, the microprocessor, relying on its internal hardware timer, forcibly suspends the current temperature measurement task at set time intervals, inserting an independent system self-test cycle. During this self-test cycle, the microprocessor's general-purpose input / output port controller configures all measurement channel selection pins NTC1 to NTC4 to a high-impedance state, completely isolating the external actual temperature probe from the physical path; simultaneously, it pulls the fifth measurement channel selection pin, NTC5, low to ground. Subsequently, it controls the pull-up configuration pin GEAR2 to output a high level, selecting the second pull-up resistor R4 with a resistance of 10 kΩ, and sets GEAR1 and GEAR3 to a high-impedance state. On this specific hardware path, the microprocessor triggers the analog-to-digital converter to sample the analog signal acquisition node NTC_AD, acquiring the reference node voltage signal. The microprocessor reads this reference node voltage signal and performs differential calculations with the theoretical standard voltage value calculated based on the nominal resistance values ​​of R4 and R11, extracting the real-time voltage bias value of the current analog-to-digital conversion system due to overall temperature drift and power supply fluctuations. Subsequently, the microprocessor uses this real-time voltage bias value to generate a feedforward compensation coefficient and updates it in the static random access memory. After exiting the self-test cycle and resuming the normal temperature measurement cycle, when the microprocessor receives the raw voltage data sampled by the analog-to-digital converter, it first calls the feedforward compensation coefficient at the underlying register level to linearly correct the raw voltage data, and then substitutes the corrected node voltage into the subsequent algorithm to convert it into the current measured resistance value R.

[0091] The above solution adds a hardware reference channel with constant resistance to the existing multi-channel temperature measurement network. Combined with a periodically executed self-test cycle, this allows the system to acquire voltage bias data in real time under its current operating condition. This internal calibration mechanism can use voltage fluctuations and the physical temperature drift of the analog-to-digital converter as known errors for compensation calculations, thereby eliminating common-mode interference at the measurement system's underlying level. Therefore, without relying on high-cost external temperature compensation components, even under conditions of drastic ambient temperature changes or after long-term service, the equipment can still maintain high and stable temperature measurement accuracy.

[0092] Example 6 Figure 6 An internal structural diagram of a computer device in one embodiment is shown. This computer device can specifically be a terminal or a server. Figure 6As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and may also store a computer program that, when executed by the processor, enables the processor to implement a temperature measurement method. The memory may also store a computer program that, when executed by the processor, enables the processor to implement the temperature measurement method. Those skilled in the art will understand that... Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0093] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the following steps: Obtain the pull-up configuration instruction corresponding to the current cycle, and control the corresponding switch circuit to close according to the pull-up configuration instruction, so as to connect the target pull-up resistor and the thermistor in series to form a voltage divider network; The node voltage signals of the voltage divider network are collected, and the current measured resistance R of the thermistor is determined based on the node voltage signals and the known resistance value of the target pull-up resistor. Read the preset characteristic constants A, B, and C from the memory. The characteristic constants are obtained based on the reference resistance values ​​of the thermistor under three different constant temperature environments. Using the current measured resistance R and the characteristic constants A, B, and C, the target ambient temperature T is calculated through a preset temperature measurement model, which satisfies the following:

[0094] The current measured resistance value is compared with the preset resistance range division conditions to determine the target resistance range to which the current measured resistance value belongs. Based on the target resistance range, the pull-up configuration command is updated to control the corresponding switching circuit in the next temperature measurement cycle. The pull-up resistor that matches the target resistance range is connected to the voltage divider network as the new target pull-up resistor.

[0095] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, causes the processor to perform the following steps: Obtain the pull-up configuration instruction corresponding to the current cycle, and control the corresponding switch circuit to close according to the pull-up configuration instruction, so as to connect the target pull-up resistor and the thermistor in series to form a voltage divider network; The node voltage signals of the voltage divider network are collected, and the current measured resistance R of the thermistor is determined based on the node voltage signals and the known resistance value of the target pull-up resistor. Read the preset characteristic constants A, B, and C from the memory. The characteristic constants are obtained based on the reference resistance values ​​of the thermistor under three different constant temperature environments. Using the current measured resistance R and the characteristic constants A, B, and C, the target ambient temperature T is calculated through a preset temperature measurement model, which satisfies the following:

[0096] The current measured resistance value is compared with the preset resistance range division conditions to determine the target resistance range to which the current measured resistance value belongs. Based on the target resistance range, the pull-up configuration command is updated to control the corresponding switching circuit in the next temperature measurement cycle. The pull-up resistor that matches the target resistance range is connected to the voltage divider network as the new target pull-up resistor.

[0097] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, 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. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0098] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0099] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A thermistor temperature measurement method, applied to an electronic device, the electronic device comprising a control unit, a plurality of pull-up resistors with increasing resistance values, and a thermistor, characterized in that, The method includes: Obtain the pull-up configuration instruction corresponding to the current cycle, and control the corresponding switch circuit to close according to the pull-up configuration instruction, so as to connect the target pull-up resistor and the thermistor in series to form a voltage divider network; The node voltage signals of the voltage divider network are collected, and the current measured resistance R of the thermistor is determined based on the node voltage signals and the known resistance value of the target pull-up resistor. Read the preset characteristic constants A, B, and C from the memory. The characteristic constants are obtained based on the reference resistance values ​​of the thermistor under three different constant temperature environments. Using the current measured resistance R and the characteristic constants A, B, and C, the target ambient temperature T is calculated through a preset temperature measurement model, which satisfies the following: The current measured resistance value is compared with the preset resistance range division conditions to determine the target resistance range to which the current measured resistance value belongs. Based on the target resistance range, the pull-up configuration command is updated to control the corresponding switching circuit in the next temperature measurement cycle. The pull-up resistor that matches the target resistance range is connected to the voltage divider network as the new target pull-up resistor.

2. The thermistor temperature measurement method according to claim 1, characterized in that, The plurality of pull-up resistors with increasing resistance values ​​include at least a first pull-up resistor, a second pull-up resistor, and a third pull-up resistor; The resistance range division conditions include a first resistance threshold and a second resistance threshold, wherein the first resistance threshold is less than the second resistance threshold.

3. The thermistor temperature measurement method according to claim 2, characterized in that, The step of updating the pull-up configuration command according to the target resistance range includes: If the current measured resistance value is less than or equal to the first resistance threshold, a first configuration instruction is generated to control the corresponding switch circuit to close in the next temperature measurement cycle, and the first pull-up resistor is connected to the voltage divider network as a new target pull-up resistor. If the current measured resistance value is greater than the first resistance threshold and less than or equal to the second resistance threshold, a second configuration instruction is generated to control the corresponding switch circuit to close in the next temperature measurement cycle, and the second pull-up resistor is connected to the voltage divider network as a new target pull-up resistor. If the current measured resistance value is greater than the second resistance threshold, a third configuration instruction is generated to control the corresponding switch circuit to close in the next temperature measurement cycle, and the third pull-up resistor is connected to the voltage divider network as a new target pull-up resistor.

4. The thermistor temperature measurement method according to claim 3, characterized in that, The method further includes the following steps when the device is first powered on and reset or when historical resistance measurements are not obtained: Generate a default configuration instruction to control the corresponding switch circuit to close during the first temperature measurement cycle, connect the second pull-up resistor as the initial target pull-up resistor to the voltage divider network, and execute the step of acquiring the node voltage signal of the voltage divider network.

5. The thermistor temperature measurement method according to claim 1, characterized in that, Before reading the preset characteristic constants A, B, and C from the memory, a characteristic constant calibration step is included, which includes: The thermistor is placed in a first preset constant temperature environment, a second preset constant temperature environment and a third preset constant temperature environment respectively, wherein the temperature values ​​of the first preset constant temperature environment, the second preset constant temperature environment and the third preset constant temperature environment increase sequentially. Under the first preset constant temperature environment, a calibration command is sent to the electronic device, and the first reference resistance value R1 of the thermistor is collected and recorded; Under the second preset constant temperature environment, a calibration command is sent to the electronic device, and the second reference resistance value R2 of the thermistor is collected and recorded; Under the third preset constant temperature environment, a calibration command is sent to the electronic device, and the third reference resistance value R3 of the thermistor is collected and recorded; Based on the first reference resistance value R1, the second reference resistance value R2, the third reference resistance value R3, and the corresponding ambient temperature value, the characteristic constants A, B, and C are calculated and stored in the memory.

6. The thermistor temperature measurement method according to claim 5, characterized in that, The step of calculating the characteristic constants A, B, and C based on the first reference resistance value R1, the second reference resistance value R2, the third reference resistance value R3, and the corresponding ambient temperature value includes: Calculate the logarithmic parameters of the resistance: , , ; Calculate the reciprocal parameter of temperature: , , ; Where T1, T2, and T3 are the Celsius temperatures of the first, second, and third preset constant temperature environments, respectively. The characteristic constants C, B, and A are calculated and obtained according to the following formulas: 。 7. A thermistor temperature measuring device, applied to electronic equipment, the electronic equipment comprising a control unit, a plurality of pull-up resistors with increasing resistance values, and a thermistor, characterized in that, The device includes: The hardware configuration module is used to obtain the pull-up configuration instruction corresponding to the current cycle, and control the corresponding switch circuit to close according to the pull-up configuration instruction, so as to connect the target pull-up resistor and the thermistor in series to form a voltage divider network. The signal acquisition and conversion module is used to acquire the node voltage signals of the voltage divider network, and determine the current measured resistance R of the thermistor based on the node voltage signals and the known resistance value of the target pull-up resistor; The parameter reading module is used to read preset characteristic constants A, B, and C from the memory. The characteristic constants are obtained based on the reference resistance values ​​of the thermistor under three different constant temperature environments. The temperature calculation module is used to calculate the target ambient temperature T using the current measured resistance R and the characteristic constants A, B, and C through a preset temperature measurement model. The preset temperature measurement model satisfies the following: The instruction update module compares the current measured resistance value with the preset resistance range division conditions to determine the target resistance range to which the current measured resistance value belongs. Based on the target resistance range, the pull-up configuration instruction is updated to control the corresponding switching circuit in the next temperature measurement cycle and connects the pull-up resistor that matches the target resistance range as the new target pull-up resistor to the voltage divider network.

8. An electronic device, characterized in that, include: At least one microprocessor; The memory is communicatively connected to the at least one microprocessor. Multiple pull-up resistors with increasing resistance values, and at least one thermistor; The memory stores a computer program that can be executed by the at least one microprocessor, and when the at least one microprocessor executes the computer program, it implements the thermistor temperature measurement method as described in any one of claims 1 to 6.

9. The electronic device according to claim 8, characterized in that, The electronic device further includes a multi-channel switching circuit, the connection structure of which includes: The first ends of the plurality of pull-up resistors with increasing resistance values ​​are respectively connected to a plurality of configuration pins of the at least one microprocessor, and the second ends are connected to the analog signal acquisition node. The first end of the at least one thermistor is connected to the analog signal acquisition node, and the second end is connected to the channel selection pin of the at least one microprocessor. The at least one microprocessor is configured to: control a corresponding configuration pin to output an effective level to connect a target pull-up resistor to the circuit; and read the voltage of the analog signal acquisition node through an internal analog-to-digital converter to obtain the node voltage signal.

10. A computer-readable storage medium, characterized in that, The device contains a computer program that, when executed by a microprocessor, implements the steps of the thermistor temperature measurement method as described in any one of claims 1 to 6.