Temperature detection method and device, vehicle and storage medium

By introducing switching switches and compensation pull-up resistors into the temperature detection circuit, adjusting the resistance ratio of the circuit, the problem of insufficient temperature detection accuracy under low temperature conditions is solved, and the consistency and reliability of software control are improved.

CN119958726APending Publication Date: 2025-05-09GUANGZHOU AUTOMOBILE GROUP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510006503.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-02
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

The existing temperature detection circuits have insufficient measurement accuracy under low temperature conditions, which affects the consistency and reliability of software control.

Method used

A temperature detection circuit including switching switches, compensation pull-up resistors, pull-up resistors and sense resistors is adopted. By switching switches, the compensation pull-up resistors are controlled to adjust the resistance ratio of the circuit, thereby improving the accuracy of temperature detection under low temperature conditions.

Benefits of technology

Under low temperature conditions, this method can reduce detection errors, ensure that the temperature detection errors between different controllers do not exceed 2℃, and improve the consistency and reliability of software control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119958726A_ABST
    Figure CN119958726A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of vehicle electronic control, in particular to a temperature detection method and device, a vehicle and a storage medium, the method adopts a temperature detection circuit, the circuit comprises a change-over switch, a compensation pull-up resistor, a pull-up resistor and a sensing resistor, and the change-over switch is connected with the compensation pull-up resistor in parallel; the method comprises the following steps: controlling the change-over switch to be in an off state, calculating a first temperature value of a medium to be detected according to a first voltage value of the sensing resistor, if the first temperature value of the medium to be detected is smaller than a preset temperature value, controlling the change-over switch to be in a closed state, and if the first temperature value of the medium to be detected is smaller than the preset temperature value, controlling the change-over switch to be in a closed state; and the second voltage value of the sensing resistor is obtained again, and the actual temperature value of the to-be-detected medium is calculated according to the second voltage value. Therefore, the problem that an existing temperature detection circuit is insufficient in measurement precision under the low-temperature condition is solved, and the consistency and reliability of software control are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle electronic control technology, and in particular to a temperature detection method, device, vehicle and storage medium. Background Art

[0002] In the field of automotive electronic control, temperature sensors are often used to detect the temperature of a medium. After obtaining the temperature of the medium, the control software can execute a variety of algorithms including control and diagnosis. The sensing unit of a temperature sensor is usually a thermistor, whose resistance changes with temperature.

[0003] In actual engineering experience, the controller can only read the voltage value, but not the resistance value. Therefore, a 5V power supply, a pull-up resistor and a sensing resistor are usually used to form a series circuit. By measuring the voltage across the sensing resistor, the temperature at this time is calculated by looking up a table in the control software according to the characteristics of the temperature sensor.

[0004] However, although the above method can provide sufficient temperature detection accuracy in most cases, in practical applications, especially under extreme temperature conditions, such as low temperature environments, the accuracy of temperature detection is seriously affected. This is mainly because, when the temperature decreases, the resistance of the sensing resistor increases, and the proportional difference between it and the pull-up resistor increases, causing any slight resistance change to be amplified, thereby causing a large voltage reading error. In addition, the unreasonable design of the temperature detection circuit will also aggravate this problem, resulting in a significant deviation between the temperature calculated by the control software and the actual temperature. For example, the temperature measured by controllers of the same batch under the same conditions may differ by tens of degrees Celsius, which not only affects the consistency of software control, causing some engines to fail to behave according to the designed algorithm, but also leads to problems such as engine performance degradation and user complaints, which need to be solved urgently. Summary of the invention

[0005] The present application provides a temperature detection method, device, vehicle and storage medium to solve the problem of insufficient measurement accuracy of existing temperature detection circuits under low temperature conditions, thereby improving the consistency and reliability of software control.

[0006] In a first aspect, an embodiment of the present application provides a temperature detection method, the method adopts a temperature detection circuit, the circuit includes a switching switch, a compensating pull-up resistor, a pull-up resistor and a sensing resistor, the switching switch is connected in parallel with the compensating pull-up resistor, the compensating pull-up resistor, the pull-up resistor and the sensing resistor are sequentially connected in series, and the method includes the following steps:

[0007] Controlling the switching switch to be in an off state, acquiring a first voltage value of the sensing resistor, and calculating a first temperature value of the medium to be detected according to the first voltage value;

[0008] Determining whether the first temperature value of the medium to be detected is less than a preset temperature value;

[0009] If the first temperature value of the medium to be detected is less than the preset temperature value, the switch is controlled to be in a closed state, and the second voltage value of the sensing resistor is reacquired, and the actual temperature value of the medium to be detected is calculated according to the second voltage value.

[0010] According to an embodiment of the present application, calculating a first temperature value of the medium to be detected according to the first voltage value includes:

[0011] Calculating a first resistance value of the sensing resistor according to the first voltage value;

[0012] Determine whether the first resistance value exists in a first preset temperature-resistance comparison table;

[0013] If the first resistance value exists in the first preset temperature-resistance comparison table, the first temperature value of the medium to be detected is obtained by looking up the table based on the first preset temperature-resistance comparison table according to the first voltage value; otherwise, the first temperature value of the medium to be detected is determined based on a preset interpolation method.

[0014] According to an embodiment of the present application, calculating the actual temperature value of the medium to be detected according to the second voltage value includes:

[0015] Calculating a second resistance value of the sensing resistor according to the second voltage value;

[0016] Determine whether the second resistance value exists in a second preset temperature-resistance comparison table;

[0017] If the second resistance value exists in the second preset temperature-resistance comparison table, then based on the second preset temperature-resistance comparison table, the actual temperature value of the medium to be detected is obtained by looking up the table according to the second voltage value; otherwise, the actual temperature value of the medium to be detected is determined based on a preset interpolation method.

[0018] According to an embodiment of the present application, after determining whether the first temperature value of the medium to be detected is less than a preset temperature value, the method further includes:

[0019] If the first temperature value of the medium to be detected is greater than or equal to the preset temperature value, the switch is maintained in an off state, and the third voltage value of the sensing resistor is re-read;

[0020] Calculate a third resistance value of the sensing resistor according to the third voltage value, and determine whether the third resistance value exists in a third preset temperature-resistance comparison table;

[0021] If the third resistance value exists in the third preset temperature-resistance comparison table, then based on the third preset temperature-resistance comparison table, the actual temperature value of the medium to be detected is obtained by looking up the table according to the third voltage value; otherwise, the actual temperature value of the medium to be detected is determined based on a preset interpolation method.

[0022] According to one embodiment of the present application, before controlling the switching switch to be in an off state, the method further includes:

[0023] The resistance value of the compensating pull-up resistor, the resistance value of the pull-up resistor, and the supply voltage of the temperature detection circuit are determined based on a preset absolute error and a preset relative error.

[0024] According to the temperature detection method provided in the embodiment of the present application, the control switch is in an open state, and the first temperature value of the medium to be detected is calculated according to the first voltage value of the sensing resistor. If the first temperature value of the medium to be detected is less than the preset temperature value, the control switch is in a closed state, and the second voltage value of the sensing resistor is re-acquired, and the actual temperature value of the medium to be detected is calculated according to the second voltage value. Thus, the problem of insufficient measurement accuracy of the existing temperature detection circuit under low temperature conditions is solved, thereby improving the consistency and reliability of software control.

[0025] A second aspect of the present application provides a temperature detection device, wherein the device adopts a temperature detection circuit, wherein the circuit includes a switching switch, a compensating pull-up resistor, a pull-up resistor, and a sensing resistor, wherein the switching switch is connected in parallel with the compensating pull-up resistor, and the compensating pull-up resistor, the pull-up resistor, and the sensing resistor are sequentially connected in series, and the device includes:

[0026] A first calculation module, used for controlling the switch to be in an off state, obtaining a first voltage value of the sensing resistor, and calculating a first temperature value of the medium to be detected according to the first voltage value;

[0027] A judging module, used for judging whether the first temperature value of the medium to be detected is less than a preset temperature value;

[0028] The second calculation module is used to control the switching switch to be in a closed state if the first temperature value of the medium to be detected is less than the preset temperature value, and re-acquire the second voltage value of the sensing resistor, and calculate the actual temperature value of the medium to be detected according to the second voltage value.

[0029] According to one embodiment of the present application, the first computing module is used to:

[0030] Calculating a first resistance value of the sensing resistor according to the first voltage value;

[0031] Determine whether the first resistance value exists in a first preset temperature-resistance comparison table;

[0032] If the first resistance value exists in the first preset temperature-resistance comparison table, the first temperature value of the medium to be detected is obtained by looking up the table based on the first preset temperature-resistance comparison table according to the first voltage value; otherwise, the first temperature value of the medium to be detected is determined based on a preset interpolation method.

[0033] According to one embodiment of the present application, the second computing module is used to:

[0034] Calculating a second resistance value of the sensing resistor according to the second voltage value;

[0035] Determine whether the second resistance value exists in a second preset temperature-resistance comparison table;

[0036] If the second resistance value exists in the second preset temperature-resistance comparison table, then based on the second preset temperature-resistance comparison table, the actual temperature value of the medium to be detected is obtained by looking up the table according to the second voltage value; otherwise, the actual temperature value of the medium to be detected is determined based on a preset interpolation method.

[0037] According to an embodiment of the present application, after determining whether the first temperature value of the medium to be detected is less than a preset temperature value, the determination module is further configured to:

[0038] If the first temperature value of the medium to be detected is greater than or equal to the preset temperature value, the switch is maintained in an off state, and the third voltage value of the sensing resistor is re-read;

[0039] Calculate a third resistance value of the sensing resistor according to the third voltage value, and determine whether the third resistance value exists in a third preset temperature-resistance comparison table;

[0040] If the third resistance value exists in the third preset temperature-resistance comparison table, then based on the third preset temperature-resistance comparison table, the actual temperature value of the medium to be detected is obtained by looking up the table according to the third voltage value; otherwise, the actual temperature value of the medium to be detected is determined based on a preset interpolation method.

[0041] According to an embodiment of the present application, before controlling the switching switch to be in an off state, the first calculation module is further used to:

[0042] The resistance value of the compensating pull-up resistor, the resistance value of the pull-up resistor, and the supply voltage of the temperature detection circuit are determined based on a preset absolute error and a preset relative error.

[0043] According to the temperature detection device provided in the embodiment of the present application, the control switch is in an open state, and the first temperature value of the medium to be detected is calculated according to the first voltage value of the sensing resistor. If the first temperature value of the medium to be detected is less than the preset temperature value, the control switch is in a closed state, and the second voltage value of the sensing resistor is re-acquired, and the actual temperature value of the medium to be detected is calculated according to the second voltage value. Thus, the problem of insufficient measurement accuracy of the existing temperature detection circuit under low temperature conditions is solved, thereby improving the consistency and reliability of software control.

[0044] A third aspect of the present application provides a vehicle, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the temperature detection method as described in the above embodiment.

[0045] A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the temperature detection method as described in the above embodiment.

[0046] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0048] Figure 1 It is a structural schematic diagram of a temperature detection circuit in the related art;

[0049] Figure 2 It is a flowchart of the processing of temperature signal by software in the related art;

[0050] Figure 3 It is a structural diagram of the analog signal interface circuit of the main control chip in the related art;

[0051] Figure 4 is a schematic structural diagram of a temperature detection circuit according to an embodiment of the present application;

[0052] Figure 5 A flow chart of a temperature detection method provided according to an embodiment of the present application;

[0053] Figure 6 is a flow chart of a temperature detection method according to an embodiment of the present application;

[0054] Figure 7 is a block diagram of a temperature detection device according to an embodiment of the present application;

[0055] Figure 8 A schematic diagram of the structure of a vehicle provided in an embodiment of the present application. DETAILED DESCRIPTION

[0056] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0057] The temperature detection method, device, vehicle, and storage medium of the embodiments of the present application are described below with reference to the accompanying drawings.

[0058] Before introducing the temperature detection method of the embodiment of the present application, the temperature detection method in the related art and the temperature detection circuit involved in the temperature detection method of the present application are briefly introduced.

[0059] First, a temperature detection method in related art is introduced.

[0060] Specifically, in the field of automotive electronics, temperature sensors are usually used to detect the temperature of the medium. A temperature sensor is a sensor that can sense the temperature of the medium and convert it into a usable output signal. In the automotive industry, thermistor temperature sensors are generally used, that is, the sensing unit of the sensor is a thermistor that changes with the temperature of the medium. For the normal operating temperature (-40℃~140℃) environment of the sensor, NTC (Negative Temperature Coefficient) resistors are generally used as sensing units. NTC resistors are thermistors whose resistance value decreases as the temperature of the medium increases.

[0061] Furthermore, the temperature sensor is essentially a thermistor, and the controller used in the vehicle cannot directly read the resistance value, but can only read the voltage value. Therefore, the internal design of the controller is usually Figure 1 The temperature detection circuit shown in the figure is composed of a series voltage divider circuit consisting of a 5V power supply, a pull-up resistor and a sensing resistor. The bottom software interface of the controller reads the voltage across the sensing resistor. After internal processing, the application software can further calculate the temperature at this time.

[0062] Further, Figure 1 The pull-up resistor value in the temperature detection circuit shown is selected based on the voltage division principle. When the pull-up resistor and the sensing resistor have similar resistance values, the sensor can measure more accurately. Therefore, a temperature value commonly used by the sensor is selected based on experience, the resistance value corresponding to the temperature value is obtained, and then a pull-up resistor with a similar resistance value is selected.

[0063] Furthermore, the temperature signal is processed by software, which usually includes underlying software and control software. Figure 2 As shown in the figure, the software processes the temperature signal in the following steps: ① The underlying software interface reads the voltage across the sensor resistor, which ranges from 0V to 5V; ② The underlying software converts the voltage read in step ① into a voltage available to the controller main control chip, which ranges from 0V to 3.3V; ③ The underlying software converts the voltage in step ② into a voltage available to the application software, which ranges from 0V to 5V; ④ The application software converts the voltage in step ③ into a temperature value by looking up the temperature-resistance table.

[0064] It should be noted that if Figure 1 As shown, in the controller, the sensing resistor is connected to a series voltage divider circuit powered by 5V, and the voltage across the sensing resistor is calculated according to the voltage divider formula:

[0065] Voltage across the sensing resistor = voltage supply voltage of the voltage divider circuit × [sensing resistor / (sensing resistor + pull-up resistor)] (1)

[0066] In the above formula, the supply voltage of the voltage divider circuit is 5V, the pull-up resistor is the nominal value of the selected resistor, the sensing resistor is the sensor resistance value corresponding to a certain temperature, and the voltage across the sensing resistor is the voltage read by the underlying software interface at that temperature.

[0067] Generally, different controllers use the same version of software (including underlying software and application software). In the same version of software, various parameters are the same and fixed, and there is only one set, which leads to Figure 2 There is an error in the processing steps of the software.

[0068] Specifically, Figure 2 As shown, in step ①, the underlying software interface reads the voltage across the sensing resistor, which is calculated by equation (1). However, in actual situations, each independent variable in equation (1) may be different for different controllers. For example, the supply voltage of the voltage divider circuit is set to 5V, and the pull-up resistor is set to 4.02kΩ. However, due to the inevitable dispersion of the parts used in different controllers, the voltage output by the 5V power supply used in the voltage divider circuit of a certain controller may not be exactly 5V, and the nominal 4.02kΩ resistor used may not be exactly 4.02kΩ.

[0069] In step ②, according to the analog signal reading principle of the main control chip, the analog signal of the sensor cannot be used directly. The analog signal of the sensor must first be converted by the controller to digital, and then converted to digital to analog before it can be converted into an analog signal that can be used by the main control chip. Figure 3The analog signal interface circuit of the main control chip is used to convert the 0V to 5V voltage in step ① into the 0V to 3.3V voltage available to the main control chip in the underlying software. The voltage conversion can be completed by the following conversion formula:

[0070] out1=Vin1*3.3V / 5V(2)

[0071] ADC_NUM = out1 / U ref *4095(3)

[0072] U 主控 =ADC_NUM / 4095*3.3V(4)

[0073] Among them, Vin is the voltage across the sensing resistor, out1 is the available voltage of the main control chip, ADC_NUM is the digital value corresponding to the voltage, and U ref It is the 3.3V reference power supply in analog-to-digital conversion. 主控 It is the voltage available to the main control chip after digital-to-analog conversion.

[0074] Among them, formula (2) is used for voltage range conversion, formula (3) is used for analog-to-digital conversion, and formula (4) is used for digital-to-analog conversion. In formula (3), U ref Provided by a 3.3V power chip, its actual value may not be exactly 3.3V. According to the selected 3.3V power chip manual, its actual value is usually in the range of [3.27V, 3.33V]. However, in formula (4), it is based on U ref Calculated for 3.3V, not U ref Therefore, the error in step ② comes from the U of different controllers. ref and 3.3V.

[0075] Furthermore, the errors in steps ① and ② will eventually be reflected in step ③ together, and the accumulated error is called the reading error. The standard for the temperature signal reading error of the controller used in the automotive industry is generally: when the reading voltage is ≤1V, the absolute error is ≤20mV; when the reading voltage is >1V, the relative error is ≤2%. The existence of the reading error makes the selection of the nominal value of the pull-up resistor particularly important. If the nominal value of the pull-up resistor is not selected reasonably, the temperature value calculated by the application software will deviate seriously from the actual value. For example, in a certain example: at -30℃, the minimum value of the sensor resistor is 109522.1Ω, the nominal value is 113347.1Ω, and the maximum value is 117294Ω; the selected pull-up resistor is 4.02kΩ, and the power supply voltage is 5V; the reading error is 2%, then according to the voltage divider formula, the minimum value of the voltage across the sensor resistor is 4823mV, the nominal value is 4829mV, and the maximum value is 4834mV. Assume that there are two controllers, and the sensor resistors used by them are exactly the minimum value, then the corresponding voltage should be 4823mV, but due to the existence of 2% reading error, the range of the value read by the underlying software interface is [4727mV, 4919mV]. That is, in the extreme case, the reading value of one controller is 4727mV, and the reading value of the other controller is 4919mV. However, the underlying software only considers that 4823mV corresponds to -30℃. When reading other voltages, it performs linear interpolation calculation according to the temperature-resistance comparison table to calculate the temperature value. The temperature calculated by [4727mV, 4919mV] is [-19.6℃, -50.4℃]. That is, in the extreme case, at -30℃, the temperature detected by one controller is -19.6℃, and the temperature detected by the other is -50.4℃. If the sensor resistors of these two controllers are exactly the maximum value and the minimum value, the temperature difference between the two will be even greater, and it is obviously impossible to guarantee the consistency of the performance of the same batch of products.

[0076] Although there are inaccuracies in temperature measurement at low temperatures, the temperature sensor detection circuits of all current controllers still use this method, because for the ECU of fuel engines and the BMS of power batteries, accurate measurements are usually not required at low temperatures (such as -30°C). For fuel engines, more attention is paid to heat dissipation at high water temperatures (generally above 80°C), and for low temperatures, only emissions at -7°C are concerned. In the range of -7°C to 140°C, the measurement results of the current temperature detection circuit are still relatively accurate, and the temperature detection error between the same batch of controllers does not exceed 3°C. For power batteries, they should avoid working at low temperatures. Generally, various methods are used to heat the power batteries to above 0°C, and then the power batteries can work normally.

[0077] However, for fuel cell engines, it is necessary to pay attention to the starting conditions in an environment of -30℃ and below. In terms of fuel cell vehicles, a clear indicator is that the starting temperature of the fuel cell engine used in fuel cell vehicles is not higher than -30℃. In order to meet this indicator requirement, the software of the fuel cell engine generally uses some special algorithms at around -30℃ to enable it to start cold smoothly. If the controller of the extracted fuel cell engine just detects a temperature of -19.6℃ during the verification test, the software will not be able to execute these special algorithms because it cannot accurately detect -30℃, which will cause the fuel cell engine to fail to start cold smoothly.

[0078] In addition, for fuel cell engines, in addition to meeting the -30°C cold start indicator, their software will also design some state machine algorithms that use temperature as a judgment mark under low temperatures. If the temperature measurement is inaccurate, it will cause the software state machine to fail and be unable to enter the corresponding algorithm.

[0079] Aiming at the problem that the existing temperature detection circuit cannot accurately measure the temperature at low temperature, the present invention adds a compensating pull-up resistor to the existing temperature detection circuit and designs a set of Figure 4 The precise temperature detection circuit shown in the figure ensures that within the temperature detection range of key concern of the software (e.g. within the range of about -30°C), the error between the detected temperature and the actual temperature between different controllers does not exceed 2°C, thus avoiding the problem of the temperature sensor being unable to accurately measure the actual temperature at low temperatures, and enabling the algorithm in the software that uses temperature as a judgment basis to be correctly executed.

[0080] It can be understood by those skilled in the art that in formula (1), the voltage across the sensing resistor is the reading value of the underlying software interface, and then the corresponding temperature is calculated in the application software. It can be concluded from formula (1) that when the sensing resistor is much larger than the pull-up resistor, the voltage supply voltage of the voltage divider circuit will be mainly applied to both ends of the sensing resistor. At this time, even if the sensing resistor has only a slight change, it will be amplified and cause a large change in the voltage across the sensing resistor, thereby amplifying the error. For temperature sensors using NTC resistors, the lower the temperature, the larger the sensing resistance. At -30°C, the sensing resistance is as high as about 113kΩ, which is about 28 times the selected 4.02kΩ pull-up resistor, which is a big difference. Therefore, the reading error has a huge impact on temperature detection at low temperatures. However, the selection of the pull-up resistor should not be too large. If the sensing resistor is much smaller than the pull-up resistor, then the change in the sensing resistor will hardly cause a change in the voltage across it, which also leads to inaccurate temperature measurement. Therefore, a method to improve the accuracy of temperature detection is to ensure that the sensing resistor is close to the pull-up resistor.

[0081] The temperature detection circuit proposed in this application is as follows Figure 4As shown, it includes a switching switch, a compensating pull-up resistor, a pull-up resistor and a sensing resistor, the switching switch is connected in parallel with the compensating pull-up resistor, the compensating pull-up resistor, the pull-up resistor and the sensing resistor are connected in series in sequence, wherein, Figure 4 The voltage value of the supply voltage is 5V, the resistance value of the compensation pull-up resistor is 110kΩ, and the resistance value of the pull-up resistor is 4.02KΩ. These are only exemplary and are not intended to limit the present application. By controlling the switching switch, the compensation pull-up resistor can be connected to or disconnected from the temperature detection circuit.

[0082] Therefore, in order to cooperate with the accurate temperature detection circuit, the present application also proposes the following Figure 5 The temperature detection method shown is used to control the switching switch.

[0083] Specifically, Figure 5 A flow chart of a temperature detection method provided in an embodiment of the present application.

[0084] like Figure 5 As shown, the temperature detection method includes the following steps:

[0085] In step S501, the switching switch is controlled to be in an off state, and a first voltage value of the sensing resistor is obtained, and a first temperature value of the medium to be detected is calculated according to the first voltage value.

[0086] In some embodiments, before controlling the switching switch to be in the off state, it also includes: determining the resistance value of the compensating pull-up resistor, the resistance value of the pull-up resistor and the supply voltage of the temperature detection circuit based on a preset absolute error and a preset relative error.

[0087] Optionally, the embodiment of the present application may design the read error of the underlying software to be: when the read voltage is ≤2V, the preset absolute error is ≤20mV; when the read voltage is >2V, the preset relative error is ≤1%.

[0088] Specifically, the reading error of the embodiment of the present application can be measured by using a precise six-and-a-half-digit multimeter to measure the voltage across the sensing resistor and compare it with the voltage value read in the underlying software. Absolute error = measured voltage value - read voltage value, relative error = (measured voltage value - read voltage value) / measured voltage value. Through relevant calculations and component selection, the reading error is controlled within the aforementioned range of "when the read voltage is ≤2V, the preset absolute error is ≤20mV; when the read voltage is >2V, the preset relative error is ≤1%".

[0089] Furthermore, the embodiments of the present application can select appropriate pull-up resistors and compensating pull-up resistors from the E96 series chip resistors based on the temperature-resistance comparison table of the temperature sensor and the temperature detection range of focus. For example, in a certain instance, the temperature detection range of focus is [-40°C, -20°C] and [10°C, 90°C]. According to the temperature-resistance comparison table of the temperature sensor, the middle values ​​of -30°C and 50°C in these two ranges are selected, and the corresponding nominal sensor resistance values ​​are 113.3kΩ and 4.16kΩ. Select a pull-up resistor with a value close to the sensor resistance from the E96 series chip resistors. For example, select 110kΩ (such as Figure 4 As shown, the total series pull-up resistance at low temperature is 110+4.02=114.02kΩ) and 4.02kΩ. Through voltage division calculation and linear interpolation calculation, it can be seen that within these two temperature detection ranges, the detection errors of different controllers do not exceed 2°C.

[0090] Further, in some embodiments, calculating the first temperature value of the medium to be detected based on the first voltage value includes: calculating the first resistance value of the sensing resistor based on the first voltage value; determining whether the first resistance value exists in a first preset temperature-resistance comparison table; if the first resistance value exists in the first preset temperature-resistance comparison table, then based on the first preset temperature-resistance comparison table, looking up the table according to the first voltage value to obtain the first temperature value of the medium to be detected; otherwise, determining the first temperature value of the medium to be detected based on a preset interpolation method.

[0091] Specifically, after determining the resistance value of the pull-up resistor, the switch is controlled to be in the disconnected state, and the voltage across the sensing resistor can be calculated by the voltage divider formula. Taking the reading error into account, the first voltage value of the sensing resistor can be calculated by the underlying software, and the first resistance value of the sensing resistor is calculated based on the first voltage value. If the first resistance value exists in the first preset temperature-resistance comparison table, the application software can calculate the first temperature value of the medium to be detected by querying the first preset temperature-resistance comparison table of the temperature sensor. In addition, for the temperature value not defined in the first preset temperature-resistance comparison table, that is, the first resistance value does not exist in the first preset temperature-resistance comparison table, the embodiment of the present application can be calculated by a preset interpolation method (such as a linear interpolation method).

[0092] In step S502, it is determined whether the first temperature value of the medium to be detected is less than a preset temperature value.

[0093] In step S503, if the first temperature value of the medium to be detected is less than the preset temperature value, the switch is controlled to be in a closed state, and the second voltage value of the sensing resistor is re-acquired, and the actual temperature value of the medium to be detected is calculated according to the second voltage value.

[0094] It is understandable that the embodiment of the present application needs to set a precise preset temperature value, and close the switching switch according to the preset temperature value, so that the compensation pull-up resistor is connected to the circuit. Exemplarily, according to calculations, when the pull-up resistor is 4.02kΩ, the medium temperature is 20°C, and the temperature calculated by the application software is 20°C±1.41°C; when the pull-up resistor is 114.02kΩ, the medium temperature is 20°C, and the temperature calculated by the application software is 20°C±1.38°C, and the temperature detection error does not exceed 2°C. Therefore, the embodiment of the present application can use 20°C as the preset temperature value for the temperature detection circuit to change the switching switch state.

[0095] Further, in some embodiments, the actual temperature value of the medium to be detected is calculated according to the second voltage value, including: calculating the second resistance value of the sensing resistor according to the second voltage value; determining whether the second resistance value exists in a second preset temperature-resistance comparison table; if the second resistance value exists in the second preset temperature-resistance comparison table, then based on the second preset temperature-resistance comparison table, the actual temperature value of the medium to be detected is obtained by looking up the table according to the second voltage value; otherwise, the actual temperature value of the medium to be detected is determined based on a preset interpolation method.

[0096] Specifically, if the first temperature value of the medium to be detected is lower than the preset temperature value, the control switch is changed from the open state to the closed state, the temperature detection circuit of the compensation pull-up resistor is connected, and after the switch is closed, the second voltage value across the sensing resistor is re-read. Since the compensation pull-up resistor has been connected to the circuit, the second voltage value reflects the performance of the sensing resistor under the new pull-up resistor configuration. The second resistance value of the sensing resistor can be calculated according to the second voltage value, and the actual temperature value of the medium to be detected can be calculated according to the second preset temperature-resistance comparison table through the application software. In addition, for the temperature value not defined in the second preset temperature-resistance comparison table, that is, the second resistance value does not exist in the second preset temperature-resistance comparison table, the embodiment of the present application can be calculated by a preset interpolation method (such as a linear interpolation method).

[0097] Therefore, by switching to the compensating pull-up resistor under low temperature conditions, the detection error caused by the large difference in resistance between the pull-up resistor and the sensing resistor can be reduced, thereby improving the accuracy of temperature detection.

[0098] Furthermore, in some embodiments, after determining whether the first temperature value of the medium to be detected is less than the preset temperature value, it also includes: if the first temperature value of the medium to be detected is greater than or equal to the preset temperature value, maintaining the switching switch in the off state, and re-reading the third voltage value of the sensing resistor; calculating the third resistance value of the sensing resistor according to the third voltage value, and determining whether the third resistance value exists in the third preset temperature-resistance comparison table; if the third resistance value exists in the third preset temperature-resistance comparison table, based on the third preset temperature-resistance comparison table, looking up the table according to the third voltage value to obtain the actual temperature value of the medium to be detected; otherwise, determining the actual temperature value of the medium to be detected based on a preset interpolation method.

[0099] Specifically, if the calculated first temperature value is greater than or equal to the preset temperature value, it means that the temperature of the medium to be detected is high, the switch is kept in the off state, that is, the compensation pull-up resistor is not connected to the circuit, and the third voltage value across the sensing resistor is re-read, and the third resistance value of the sensing resistor is calculated by the voltage divider formula according to the third voltage value, and it is determined whether the third resistance value exists in the third preset temperature-resistance comparison table, if the third resistance value is in the third preset temperature-resistance comparison table, then the actual temperature value of the medium to be detected is obtained by looking up the third preset temperature-resistance comparison table and the third voltage value. In addition, if the third resistance value is not in the third preset temperature-resistance comparison table, the actual temperature value of the medium to be detected is calculated based on a preset interpolation method (such as linear interpolation).

[0100] In order to facilitate those skilled in the art to more clearly and intuitively understand the temperature detection method proposed in this application, Figure 4 and Figure 6 Provide detailed explanation.

[0101] like Figure 6 As shown, the temperature detection method includes the following steps:

[0102] First, disconnect the switch in the temperature detection circuit to make the pull-up resistor 4.02kΩ.

[0103] Secondly, the underlying software reads the voltage across the sensing resistor, and the application software converts it to temperature based on a temperature-resistance comparison table.

[0104] Thirdly, it is determined whether the temperature is greater than or equal to 20° C. If so, the switch is kept open; otherwise, the switch is closed to connect the compensating pull-up resistor to the circuit so that the total pull-up resistor is 114.02 kΩ.

[0105] Finally, the underlying software interface reads the voltage across the sensing resistor, and the application software converts it to temperature based on the temperature-resistance comparison table.

[0106] Therefore, the present invention can enable the software of any fuel cell engine to accurately measure temperature in an environment of -30°C or below, correctly execute special algorithms at low temperatures, and ensure its smooth cold start to meet the key indicators and subsidy standards formulated by national government departments. At the same time, it avoids the problem of excessive temperature difference that may occur during the temperature measurement process between different controllers, and ensures the consistency of software control.

[0107] According to the temperature detection method proposed in the embodiment of the present application, the control switch is in an open state, and the first temperature value of the medium to be detected is calculated according to the first voltage value of the sensing resistor. If the first temperature value of the medium to be detected is less than the preset temperature value, the control switch is in a closed state, and the second voltage value of the sensing resistor is re-acquired, and the actual temperature value of the medium to be detected is calculated according to the second voltage value. Thus, the problem of insufficient measurement accuracy of the existing temperature detection circuit under low temperature conditions is solved, thereby improving the consistency and reliability of software control.

[0108] Next, the temperature detection device proposed according to the embodiment of the present application is described with reference to the accompanying drawings.

[0109] In this embodiment, the device adopts a temperature detection circuit, which includes a switching switch, a compensating pull-up resistor, a pull-up resistor and a sensing resistor. The switching switch is connected in parallel with the compensating pull-up resistor, and the compensating pull-up resistor, the pull-up resistor and the sensing resistor are connected in series in sequence.

[0110] Figure 7 Schematic diagram of a temperature detection device according to an embodiment of the present application.

[0111] like Figure 7 As shown, the temperature detection device 10 includes: a first calculation module 100 , a judgment module 200 and a second calculation module 300 .

[0112] Among them, the first calculation module 100 is used to control the switching switch to be in an open state, obtain the first voltage value of the sensing resistor, and calculate the first temperature value of the medium to be detected according to the first voltage value; the judgment module 200 is used to judge whether the first temperature value of the medium to be detected is less than the preset temperature value; the second calculation module 300 is used to control the switching switch to be in a closed state if the first temperature value of the medium to be detected is less than the preset temperature value, and re-acquire the second voltage value of the sensing resistor, and calculate the actual temperature value of the medium to be detected according to the second voltage value.

[0113] Further, in some embodiments, the first calculation module 100 is used to: calculate a first resistance value of the sensing resistor based on the first voltage value; determine whether the first resistance value exists in a first preset temperature-resistance comparison table; if the first resistance value exists in the first preset temperature-resistance comparison table, then based on the first preset temperature-resistance comparison table, look up the table according to the first voltage value to obtain the first temperature value of the medium to be detected; otherwise, determine the first temperature value of the medium to be detected based on a preset interpolation method.

[0114] Furthermore, in some embodiments, the second calculation module 300 is used to: calculate the second resistance value of the sensing resistor according to the second voltage value; determine whether the second resistance value exists in the second preset temperature-resistance comparison table; if the second resistance value exists in the second preset temperature-resistance comparison table, then based on the second preset temperature-resistance comparison table, look up the table according to the second voltage value to obtain the actual temperature value of the medium to be detected; otherwise, determine the actual temperature value of the medium to be detected based on a preset interpolation method.

[0115] Further, in some embodiments, after determining whether the first temperature value of the medium to be detected is less than the preset temperature value, the judgment module 200 is also used to: if the first temperature value of the medium to be detected is greater than or equal to the preset temperature value, maintain the switching switch in an off state, and re-read the third voltage value of the sensing resistor; calculate the third resistance value of the sensing resistor according to the third voltage value, and determine whether the third resistance value exists in the third preset temperature-resistance comparison table; if the third resistance value exists in the third preset temperature-resistance comparison table, then based on the third preset temperature-resistance comparison table, look up the table according to the third voltage value to obtain the actual temperature value of the medium to be detected; otherwise, determine the actual temperature value of the medium to be detected based on a preset interpolation method.

[0116] Furthermore, in some embodiments, before controlling the switching switch to be in the off state, the first calculation module 100 is also used to: determine the resistance value of the compensation pull-up resistor, the resistance value of the pull-up resistor and the supply voltage of the temperature detection circuit based on a preset absolute error and a preset relative error.

[0117] It should be noted that the above explanation of the temperature detection method embodiment is also applicable to the temperature detection device of this embodiment, and will not be repeated here.

[0118] According to the temperature detection device proposed in the embodiment of the present application, the control switch is in an open state, and the first temperature value of the medium to be detected is calculated according to the first voltage value of the sensing resistor. If the first temperature value of the medium to be detected is less than the preset temperature value, the control switch is in a closed state, and the second voltage value of the sensing resistor is re-acquired, and the actual temperature value of the medium to be detected is calculated according to the second voltage value. Thus, the problem of insufficient measurement accuracy of the existing temperature detection circuit under low temperature conditions is solved, thereby improving the consistency and reliability of software control.

[0119] Figure 8 A schematic diagram of the structure of a vehicle provided in an embodiment of the present application. The vehicle may include:

[0120] A memory 801 , a processor 802 , and a computer program stored in the memory 801 and executable on the processor 802 .

[0121] When the processor 802 executes the program, the temperature detection method provided in the above embodiment is implemented.

[0122] Furthermore, the vehicle also includes:

[0123] The communication interface 803 is used for communication between the memory 801 and the processor 802 .

[0124] The memory 801 is used to store computer programs that can be executed on the processor 802 .

[0125] The memory 801 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0126] If the memory 801, the processor 802 and the communication interface 803 are implemented independently, the communication interface 803, the memory 801 and the processor 802 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0127] Optionally, in a specific implementation, if the memory 801, the processor 802 and the communication interface 803 are integrated on a chip, the memory 801, the processor 802 and the communication interface 803 can communicate with each other through an internal interface.

[0128] The processor 802 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0129] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the above temperature detection method is implemented.

[0130] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0131] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0132] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0133] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or N wirings (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0134] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0135] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0136] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0137] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A temperature detection method, characterized in that: The method adopts a temperature detection circuit, the circuit includes a switching switch, a compensating pull-up resistor, a pull-up resistor and a sensing resistor, the switching switch is connected in parallel with the compensating pull-up resistor, the compensating pull-up resistor, the pull-up resistor and the sensing resistor are sequentially connected in series, and the method includes the following steps: Controlling the switching switch to be in an off state, acquiring a first voltage value of the sensing resistor, and calculating a first temperature value of the medium to be detected according to the first voltage value; Determining whether the first temperature value of the medium to be detected is less than a preset temperature value; If the first temperature value of the medium to be detected is less than the preset temperature value, the switch is controlled to be in a closed state, and the second voltage value of the sensing resistor is reacquired, and the actual temperature value of the medium to be detected is calculated according to the second voltage value.

2. The method according to claim 1, characterized in that The step of calculating a first temperature value of the medium to be detected according to the first voltage value comprises: Calculating a first resistance value of the sensing resistor according to the first voltage value; Determine whether the first resistance value exists in a first preset temperature-resistance comparison table; If the first resistance value exists in the first preset temperature-resistance comparison table, the first temperature value of the medium to be detected is obtained by looking up the table based on the first preset temperature-resistance comparison table according to the first voltage value; otherwise, the first temperature value of the medium to be detected is determined based on a preset interpolation method.

3. The method according to claim 1, characterized in that The calculating the actual temperature value of the medium to be detected according to the second voltage value comprises: Calculating a second resistance value of the sensing resistor according to the second voltage value; Determine whether the second resistance value exists in a second preset temperature-resistance comparison table; If the second resistance value exists in the second preset temperature-resistance comparison table, then based on the second preset temperature-resistance comparison table, the actual temperature value of the medium to be detected is obtained by looking up the table according to the second voltage value; otherwise, the actual temperature value of the medium to be detected is determined based on a preset interpolation method.

4. The method according to claim 1, characterized in that After determining whether the first temperature value of the medium to be detected is less than a preset temperature value, the method further includes: If the first temperature value of the medium to be detected is greater than or equal to the preset temperature value, the switch is maintained in an off state, and the third voltage value of the sensing resistor is re-read; Calculate a third resistance value of the sensing resistor according to the third voltage value, and determine whether the third resistance value exists in a third preset temperature-resistance comparison table; If the third resistance value exists in the third preset temperature-resistance comparison table, then based on the third preset temperature-resistance comparison table, the actual temperature value of the medium to be detected is obtained by looking up the table according to the third voltage value; otherwise, the actual temperature value of the medium to be detected is determined based on a preset interpolation method.

5. The method according to claim 1, characterized in that Before controlling the switching switch to be in an off state, the method further includes: The resistance value of the compensating pull-up resistor, the resistance value of the pull-up resistor, and the supply voltage of the temperature detection circuit are determined based on a preset absolute error and a preset relative error.

6. A temperature detection device, characterized in that: The device adopts a temperature detection circuit, the circuit includes a switching switch, a compensating pull-up resistor, a pull-up resistor and a sensing resistor, the switching switch is connected in parallel with the compensating pull-up resistor, the compensating pull-up resistor, the pull-up resistor and the sensing resistor are connected in series in sequence, and the device includes: A first calculation module, used for controlling the switch to be in an off state, obtaining a first voltage value of the sensing resistor, and calculating a first temperature value of the medium to be detected according to the first voltage value; A judging module, used for judging whether the first temperature value of the medium to be detected is less than a preset temperature value; The second calculation module is used to control the switching switch to be in a closed state if the first temperature value of the medium to be detected is less than the preset temperature value, and re-acquire the second voltage value of the sensing resistor, and calculate the actual temperature value of the medium to be detected according to the second voltage value.

7. The device according to claim 6, characterized in that The first computing module is used for: Calculating a first resistance value of the sensing resistor according to the first voltage value; Determine whether the first resistance value exists in a first preset temperature-resistance comparison table; If the first resistance value exists in the first preset temperature-resistance comparison table, the first temperature value of the medium to be detected is obtained by looking up the table based on the first preset temperature-resistance comparison table according to the first voltage value; otherwise, the first temperature value of the medium to be detected is determined based on a preset interpolation method.

8. The device according to claim 6, characterized in that The second computing module is used for: Calculating a second resistance value of the sensing resistor according to the second voltage value; Determine whether the second resistance value exists in a second preset temperature-resistance comparison table; If the second resistance value exists in the second preset temperature-resistance comparison table, then based on the second preset temperature-resistance comparison table, the actual temperature value of the medium to be detected is obtained by looking up the table according to the second voltage value; otherwise, the actual temperature value of the medium to be detected is determined based on a preset interpolation method.

9. A vehicle, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the temperature detection method according to any one of claims 1 to 5.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the temperature detection method according to any one of claims 1 to 5.