A method, device, equipment and storage medium for obtaining ambient temperature

By obtaining the current temperature calibration value and the preset temperature calibration value, determining the target temperature calibration value, and combining the actual temperature value detected by the equipment, the problem of low accuracy in ambient temperature measurement of electronic equipment is solved, achieving higher accuracy in ambient temperature measurement.

CN114878027BActive Publication Date: 2025-06-17SHENZHEN LUMIUNITED TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210406680.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-18
Publication Date
2025-06-17
Estimated Expiration
2042-04-18

AI Technical Summary

Technical Problem

In the prior art, the ambient temperature obtained by electronic devices has a problem of low accuracy, especially because the temperature correction is inaccurate due to the difference in the heat dissipation power consumption of the device itself and the environment in which it is located.

Method used

By obtaining the current temperature calibration value, the temperature calibration is performed using the working heat of the equipment; determine the target temperature calibration value based on the current temperature calibration value and the preset temperature calibration value; obtain the current actual temperature value detected by the equipment; obtain the actual ambient temperature value based on the target temperature calibration value and the current actual temperature value.

Benefits of technology

It realizes that the equipment can automatically adapt to different installation environments and different heating power consumption scenarios, and improves the accuracy of ambient temperature measurement in the environment in which the equipment is located.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114878027B_ABST
    Figure CN114878027B_ABST
Patent Text Reader

Abstract

An embodiment of the present application discloses a method, apparatus, device, and storage medium for obtaining an ambient temperature. The method includes: obtaining a current temperature calibration value, which is used to calibrate the temperature of the device using the operating heat of the device; determining a target temperature calibration value according to the current temperature calibration value and a preset temperature calibration value; obtaining the current actual temperature value detected by the device; and obtaining the actual ambient temperature value according to the target temperature calibration value and the current actual temperature value. Therefore, by adopting the above method of the present application, the device can utilize its own operating heat, determine the target temperature calibration value of the ambient temperature by obtaining the current temperature calibration value and combining the current temperature calibration value and the preset temperature calibration value, and calibrate the ambient temperature obtained by the device using the target temperature calibration value, thereby improving the accuracy of the device in obtaining the ambient temperature.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of information processing, and more specifically, to a method, device, equipment, and storage medium for obtaining ambient temperature. Background Art

[0002] With the diversification of electronic products, the components of electronic devices are developing towards the direction of diversified functions and densification. Currently, the temperature of the environment where the electronic device is located detected by the temperature sensor of the electronic device often needs to be corrected. However, due to the heat dissipation power consumption of the electronic device itself and the differences in the environment where it is located, in the related art, the ambient temperature obtained after correcting the ambient temperature obtained by the electronic device has the problem of low accuracy. Summary of the Invention

[0003] This application proposes a method, device, equipment, and storage medium for obtaining ambient temperature to improve the above problems.

[0004] In a first aspect, an embodiment of this application provides a method for obtaining ambient temperature. The method includes: obtaining a current temperature calibration value, where the current temperature calibration value is used to calibrate the temperature of the device using the operating heat of the device; determining a target temperature calibration value according to the current temperature calibration value and a preset temperature calibration value; obtaining a current actual temperature value detected by the device; and obtaining an actual ambient temperature value according to the target temperature calibration value and the current actual temperature value.

[0005] In a second aspect, an embodiment of this application further provides an apparatus for obtaining ambient temperature. The apparatus includes: a current temperature calibration value obtaining unit, a target temperature calibration value obtaining unit, a current actual temperature obtaining unit, and an ambient temperature obtaining unit. Among them, the current temperature calibration value obtaining unit is configured to obtain a current temperature calibration value, where the current temperature calibration value is used to calibrate the temperature of the device using the operating heat of the device; the target temperature calibration value determining unit is configured to determine a target temperature calibration value according to the current temperature calibration value and a preset temperature calibration value; the current actual temperature value obtaining unit is configured to obtain a current actual temperature value detected by the device; and the ambient temperature obtaining unit is configured to obtain an actual ambient temperature value according to the target temperature calibration value and the current actual temperature value.

[0006] In one embodiment, the current temperature calibration value acquisition unit is further configured to obtain a first target temperature value, where the first target temperature value is a temperature value obtained based on a plurality of first temperatures detected by the device within a first target time period, and the first target time period is a time period when the device is in an idle state; obtain a reference ambient temperature value detected by the device at a target reference time, where the target reference time is the time when the device is turned on or awakened and starts to work; obtain a second target temperature value, where the second target temperature value is a temperature value obtained based on a plurality of second temperatures detected by the device within a second target time period, and the second target time period is a time period when the device is in a working state; and obtain the current temperature calibration value according to the first target temperature value, the reference ambient temperature value, and the second target temperature value.

[0007] In one embodiment, before the current temperature calibration value acquisition unit is further configured to obtain the first target temperature value, it determines whether a plurality of first temperatures detected by the device within the first target time period meet a first preset condition; if the plurality of first temperatures meet the first preset condition, the step of obtaining the first target temperature value is executed.

[0008] In one embodiment, the current temperature calibration value acquisition unit is further configured to determine whether the absolute value of the difference between the maximum temperature value and the minimum temperature value among the plurality of first temperatures is less than or equal to a first preset temperature difference; if the absolute value of the difference between the maximum temperature value and the minimum temperature value among the plurality of first temperatures is less than or equal to the first preset temperature difference, the plurality of first temperatures meet the first preset condition.

[0009] In one embodiment, the current temperature calibration value acquisition unit is further configured to calculate the temperature average of the plurality of first temperatures and use the obtained temperature average as the first target temperature value to obtain the first target temperature value.

[0010] In one embodiment, before the current temperature calibration value acquisition unit is further configured to obtain the second target temperature value, it determines whether a plurality of second temperatures detected by the device within the second target time period meet a second preset condition; if the plurality of second temperatures meet the second preset condition, the step of obtaining the second target temperature value is executed.

[0011] In one embodiment, the current temperature calibration value acquisition unit is further configured to determine whether the absolute value of the difference between the maximum temperature value and the minimum temperature value among the plurality of second temperatures is less than or equal to a second preset temperature difference; if the absolute value of the difference between the maximum temperature value and the minimum temperature value among the plurality of second temperatures is less than or equal to the second preset temperature difference, the plurality of second temperatures meet the second preset condition.

[0012] In one embodiment, the current temperature calibration value acquisition unit is further configured to calculate the temperature average of the plurality of second temperatures and use the obtained temperature average as the second target temperature value to obtain the second target temperature value.

[0013] In one embodiment, the current temperature calibration value acquisition unit is further configured to calculate the average value of the first difference and the second difference, and use the obtained average value as the current temperature calibration value of the device; wherein, the first difference is the difference between the first target temperature value and the reference ambient temperature value, and the second difference is the difference between the second target temperature value and the reference ambient temperature value.

[0014] In one embodiment, before the current temperature calibration value acquisition unit calculates the average value of the first difference and the second difference, it is further configured to determine whether the absolute value of the difference between the first difference and the second difference is less than or equal to a third preset difference; if the absolute value of the difference between the first difference and the second difference is less than or equal to the third preset difference, then execute the step of calculating the average value of the first difference and the second difference.

[0015] In one embodiment, the target temperature calibration value determination unit is further configured to determine whether the difference between the current temperature calibration value and the preset temperature calibration value meets a third preset condition; if the difference between the current temperature calibration value and the preset temperature calibration value meets the third preset condition, then determine the current temperature calibration value as the target temperature calibration value; if the difference between the current temperature calibration value and the preset temperature calibration value does not meet the third preset condition, then determine the preset temperature calibration value as the target temperature calibration value.

[0016] In a third aspect, an embodiment of the present application further provides an electronic device, including: a temperature sensor, one or more processors, a memory, and one or more application programs. Among them, the temperature sensor is used to collect the current actual temperature value; one or more application programs are stored in the memory and configured to be executed by one or more processors, and the one or more programs are configured to execute to implement the method described in the first aspect above.

[0017] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which program code is stored, and the program code can be called by a processor to execute the method described in the first aspect above.

[0018] The technical solution provided by this application obtains the current temperature calibration value, which is used to calibrate the temperature of the device by using the working heat of the device; determines the target temperature calibration value according to the current temperature calibration value and the preset temperature calibration value; obtains the current actual temperature value detected by the device; and obtains the actual ambient temperature value according to the target temperature calibration value and the current actual temperature value. Therefore, by adopting the above method of this application, under the condition that the device has its own working heat, the ambient temperature detected by the device is corrected by obtaining the current temperature calibration value and combining the current temperature calibration value and the preset temperature calibration value, so that the device can automatically adapt to different installation environments and different heat dissipation power consumption scenarios to obtain a more accurate ambient temperature of the environment where the device is located. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of this application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of this application. For those skilled in the art, without creative efforts, other drawings can be obtained according to these drawings.

[0020] Figure 1 The flowchart of a method for obtaining ambient temperature provided by an embodiment of this application is shown;

[0021] Figure 2 The device connection diagram of the technical solution of turning off and then turning on the device in a method for obtaining ambient temperature provided by another embodiment of this application is shown;

[0022] Figure 3 The temperature detection timing diagram in a method for obtaining ambient temperature provided by an embodiment of this application is shown;

[0023] Figure 4 The flowchart of a method for obtaining the current temperature calibration value in a method for obtaining ambient temperature provided by another embodiment of this application is shown;

[0024] Figure 5 The structural diagram of an ambient temperature acquisition device proposed by an embodiment of this application is shown;

[0025] Figure 6 The structural block diagram of an electronic device proposed by an embodiment of this application is shown;

[0026] Figure 7 The structural block diagram of an electronic device proposed by another embodiment of this application is shown;

[0027] Figure 8 The structural block diagram of a computer-readable storage medium proposed by an embodiment of this application is shown. Detailed implementation mode

[0028] In order to enable those skilled in the art to better understand the solution of this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of this application.

[0029] With the development of the Internet of Everything, controller and sensor products are developing towards functional diversification and device densification. To achieve real-time display of temperature sensor information for users and direct execution of control based on temperature information, heat-generating devices such as screens, main control chips, power supplies, and relays need to be integrated inside the product. The existence of heat-generating devices makes the internal temperature of the product higher than the ambient temperature. The temperature measured by arranging a temperature sensor at any position inside the product is higher than the ambient temperature of the product, which makes it impossible for the sensor to accurately detect the ambient temperature.

[0030] In the related art, in response to the problem of temperature detection deviation, a solution of using an algorithm to correct the data measured by the temperature sensor has also been proposed. The temperature correction value is generally pre-tested in a laboratory environment, and there are certain differences between the actual installation environment of the device and the standard environment of the laboratory. Therefore, the temperature correction value preset before the device leaves the factory will not be able to adapt to the actual installation scenario of the device. Using the temperature correction value preset before the device leaves the factory to correct the detected ambient temperature will cause a secondary deviation between the ambient temperature detected by the device and the actual ambient temperature; at the same time, as the device is used over time, the heat generation power consumption of the device may drift compared with the power consumption before leaving the factory. Using this temperature correction value to correct the detected ambient temperature will further lead to low accuracy of the ambient temperature detected by the device.

[0031] To alleviate the above problems, the inventors of the present application proposed an environmental temperature acquisition method, device, equipment, and storage medium provided by the present application. By obtaining the current temperature calibration value, which is used to calibrate the temperature of the device using the operating heat of the device; determining the target temperature calibration value according to the current temperature calibration value and the preset temperature calibration value; obtaining the current actual temperature value detected by the device; and obtaining the actual environmental temperature value according to the target temperature calibration value and the current actual temperature value. Therefore, by adopting the above method of the present application, the current temperature calibration value of the device is obtained, the target temperature calibration value is determined according to the current temperature calibration value and the preset temperature calibration value, and the current actual temperature detected by the device is corrected using the target temperature calibration value, eliminating the influence of the secondary deviation between the detected environmental temperature and the actual environmental temperature caused by different installation environments and device heat dissipation power drift, enabling the device to automatically adapt to different installation environments and different heat dissipation power scenarios to obtain a more accurate environmental temperature in the environment where the device is located.

[0032] The following will specifically describe the embodiments of the present application with reference to the drawings.

[0033] Please refer to Figure 1 , an environmental temperature acquisition method provided by an embodiment of the present application can be applied to an electronic device with a temperature sensor. The steps and processes on the device side are described in this embodiment. The method includes steps S110 to S140.

[0034] Step S110: Obtain the current temperature calibration value, which is used to calibrate the temperature of the device using the operating heat of the device.

[0035] In an embodiment of the present application, the manner of obtaining the current temperature calibration value may be to obtain a first target temperature value, which is the temperature value obtained according to multiple first temperatures detected by the device within a first target time period, and the first target time period is the time period when the device is in an idle state; obtain the reference environmental temperature value detected by the device at the target reference time, and the target reference time is the time when the device is turned on or awakened and starts to work; obtain a second target temperature value, which is the temperature value obtained according to multiple second temperatures detected by the device within a second target time period, and the second target time period is the time period when the device is in a working state; and obtain the current temperature calibration value according to the first target temperature value, the reference environmental temperature value, and the second target temperature value.

[0036] In some embodiments, before obtaining the first target temperature value, the processor in the device determines whether multiple first temperatures detected by the device within the first target time period meet a first preset condition; if the multiple first temperatures meet the first preset condition, then obtain the first target temperature value.

[0037] Specifically, the way to determine whether multiple first temperatures detected by the device within the first target time period meet the first preset condition can be to determine whether the absolute value of the difference between the maximum temperature value and the minimum temperature value among the multiple first temperatures is less than or equal to the first preset temperature difference; if the absolute value of the difference between the maximum temperature value and the minimum temperature value among the multiple first temperatures is less than or equal to the first preset temperature difference, then the multiple first temperatures meet the first preset condition.

[0038] In some other embodiments, the way to determine whether multiple first temperatures detected by the device within the first target time period meet the first preset condition can also be to determine whether the ambient temperature of the environment where the device is located is stable according to the multiple first temperatures detected within the first target time period; if it is stable, then obtain the first target temperature value according to the multiple first temperatures detected within the first target time period.

[0039] Among them, to determine whether the ambient temperature of the environment where the device is located is stable according to the multiple first temperatures detected within the first target time period, it can be by calculating the variance of the multiple first temperatures. If the variance is less than the preset variance, then the ambient temperature of the environment where the device is located is stable; it can also be by calculating the standard deviation of the multiple first temperatures. If the standard deviation is less than the preset standard deviation, then the ambient temperature of the environment where the device is located is stable; it can also be by calculating the average difference of the multiple first temperatures. If the average difference is less than the preset average difference, then the ambient temperature of the environment where the device is located is stable; it can also be by other ways to determine whether the ambient temperature of the environment where the device is located is stable. Specifically, the way for the device to determine whether the ambient temperature of the environment where it is located is stable is not limited herein.

[0040] In the embodiments of the present application, the first preset temperature difference can be pre-stored in the device, or obtained from other associated devices through a serial peripheral interface (SPI) or wireless communication technology, or obtained from an associated cloud through wireless communication technology; the specific value of the first preset temperature difference can be obtained through third-party experimental data, or an appropriate value can be selected according to the actual accuracy requirements of the device.

[0041] In some embodiments, if it is determined according to the multiple first temperatures detected within the first target time period that the ambient temperature of the environment where the device is located is unstable, that is, the multiple first temperatures detected by the device within the first target time period do not meet the first preset condition, the device can re-determine a first target time period, obtain the multiple first temperatures detected by the device within this first target time period, and obtain the first target temperature value according to the multiple first temperatures that meet the first preset condition.

[0042] Among them, the processor in the device obtaining multiple first temperatures detected by the device within the first target time period may be obtaining multiple first temperatures continuously or at intervals detected by a temperature sensor in the device during a continuous time period when the device is in an idle state. Among them, the first target time period may be a continuous time period such as 0.5h, 1h, 1.5h, etc. when the device is in an idle state. The time period when the device is in an idle state can be understood as the time period when the device is in a state where the user does not operate the device or the device does not execute control tasks. Specifically, if the device is in an idle state, that is, the device only performs the operation of detecting the ambient temperature, and at this time, there is no user operating the device, such as the user viewing historical ambient temperature data on the device, etc., or there is no linkage with other devices, that is, no control tasks are executed, such as controlling air conditioners, fresh air, etc.

[0043] After the processor in the device obtains multiple first temperatures detected by the device within the first target time period and determines that the multiple first temperatures detected by the device within the first target time period meet the first preset condition, a first target temperature value is obtained according to the multiple first temperatures detected within the first target time period.

[0044] Optionally, obtaining the first target temperature value according to the multiple first temperatures detected within the first target time period may be obtaining the temperature mean of the multiple first temperatures detected within the first target time period and using the obtained temperature mean as the first target temperature value to obtain the first target temperature value; it may also be obtaining the median of the multiple first temperatures detected within the first target time period and using the obtained median as the first target temperature value to obtain the first target temperature value; it may also be obtaining the mode, arithmetic mean, weighted mean, geometric mean, etc. of the multiple first temperatures detected within the first target time period to obtain the first target temperature value.

[0045] In the embodiments of the present application, first, it is determined whether the multiple first temperatures detected by the device within the first target time period meet the first preset condition. If they meet, then a first target temperature value is obtained according to the multiple first temperatures detected by the device within the first target time period. It is necessary to ensure that the ambient temperature of the current environment is stable when the device is in an idle state, so as to avoid errors in the current temperature calibration value finally obtained through the first target temperature value, and to obtain a more accurate ambient temperature in the environment where the device is located.

[0046] In the embodiments of the present application, a reference ambient temperature value detected by the device at the target reference time is obtained, and the target reference time is the time when the device is turned on or awakened and starts to work.

[0047] It should be noted that the temperature detected by the temperature sensor and algorithm judgment can only be obtained when the device starts to work.

[0048] Specifically, the target reference time can be the moment when the device is in the off state or in the low-power mode operating state and then is turned on or awakened to start working. Since the device has just started working and the heat generated by the heating components inside the device can be ignored, the ambient temperature value detected by the device at this time is closest to the actual ambient temperature value, and this detected ambient temperature value can be used as the reference ambient temperature value.

[0049] In some embodiments, the target reference time can also be the moment when the device is restarted or reawakened to start working after being turned off or operating in the low-power mode for a preset duration.

[0050] Among them, the value of the preset duration mainly depends on the position of the temperature sensor from the heat source, the weight and material of the device, etc., and can be obtained through third-party experimental data. After the device is turned off or operates in the low-power mode for the preset duration, the temperature of the temperature sensor of the device can drop to the ambient temperature, and at this time, the ambient temperature value detected by the temperature sensor is closest to the actual ambient temperature value. It should be understood that the value of the preset duration should satisfy that after the device is turned off for the preset duration, the ambient temperature value that can be detected by the temperature sensor of the device is closest to the actual ambient temperature value.

[0051] In some other embodiments, the target reference time can also be the moment when the device is restarted or reawakened to start working after being turned off or operating in the low-power mode for a preset duration after the device obtains the first target temperature value, so as to eliminate the influence of the heat generated by the heating components inside the device on the measurement of the ambient temperature by the temperature sensor.

[0052] Specifically, please refer to Figure 2 , in some embodiments, the technical solution for restarting the device to start working after the device is turned off for a preset duration is as Figure 2 shown. This solution mainly includes the main control 10, power supply 20, MCU (Micro Control Unit) 30, and external timer 40 of the device. Specifically, the main control 10 can be connected to the MCU (Micro Control Unit) 30 through interfaces such as UART (Universal Asynchronous Receiver-Transmitter) interface, SPI (Serial Peripheral Interface), COM (Serial Port Connection), or GPIO (General-Purpose Input / Output); the MCU (Micro Control Unit) 30 can be connected to the power switch of the main control 10 through interfaces such as UART (Universal Asynchronous Receiver-Transmitter) interface, SPI (Serial Peripheral Interface), COM (Serial Port Connection), or GPIO (General-Purpose Input / Output), and by controlling the power switch of the main control 10, the device can be restarted to start working after being turned off for the preset duration.

[0053] Among them, the control process of the technical solution for restarting the device to work after the device is turned off for a preset duration can be as follows: When the main control 10 is turned on and the timer 40 is cleared, when the device is in an idle state (that is, when the user does not operate the device and the device does not execute tasks), the main control 10 sends an instruction to turn off the power supply 20 to the MCU (microcontroller unit) 30 through UART. After receiving the instruction to turn off the power supply 20, the MCU (microcontroller unit) 30 turns on the power switch of the main control 10 to turn off the power supply 20 and turns on the timer 40 to start timing. At this time, the operation of turning off the device is completed; after the timer 40 reaches the preset duration, it starts to be cleared, and at the same time, the MCU (microcontroller unit) 30 controls the power switch of the main control 10 to close to turn on the power supply 20, so that the device starts to work. It should be noted that when the device starts to work, the ambient temperature detected by the temperature sensor can be obtained and algorithm judgment calculations can be performed.

[0054] In some embodiments, the target reference time can be the time when the device is restarted to work after being switched to the low-power state for a preset duration. Among them, the technical solution for restarting the device to work after the device is switched to the low-power state for a preset duration can be to utilize the low-power mode built into the main control chip of the device and set an interrupt source through the RTC (real-time clock chip) to make the main control chip core of the device enter the sleep state, that is, the low-power state. At this time, the power consumption required for the main chip to operate is extremely low, and the temperature sensor of the device can be cooled to the ambient temperature; after the device remains in the sleep state for the duration of the interrupt source (that is, the preset duration), the main program is restored under the guidance of the main control chip core, so that the device starts to work, that is, after the device is switched to the low-power state for a preset duration, the device is restarted.

[0055] In some embodiments, in a scenario where the device has a low requirement for the detection accuracy of the ambient temperature, the ambient temperature value detected during the warm-up window period when the device is powered on for the first time can be directly obtained, and the detected ambient temperature value can be used as the reference ambient temperature value. This is because during the warm-up window period when the device is powered on for the first time, the ambient temperature value detected by the device is less affected by the heat generated by the heating components, and the detected ambient temperature value is closer to the actual ambient temperature value.

[0056] In some embodiments, before obtaining the second target temperature value, the processor in the device determines whether a plurality of second temperatures detected by the device within the second target time period meet a second preset condition; if the plurality of second temperatures meet the second preset condition, the second target temperature value is obtained.

[0057] Specifically, the method for determining whether multiple second temperatures detected by the device within the second target time period meet the second preset condition can be to determine whether the absolute value of the difference between the maximum temperature value and the minimum temperature value among the multiple second temperatures is less than or equal to the second preset temperature difference; if the absolute value of the difference between the maximum temperature value and the minimum temperature value among the multiple second temperatures is less than or equal to the second preset temperature difference, then the multiple second temperatures meet the second preset condition.

[0058] In some other embodiments, the method for determining whether multiple second temperatures detected by the device within the second target time period meet the second preset condition can also be to determine whether the ambient temperature of the environment where the device is located is stable according to the multiple second temperatures detected within the second target time period; if it is stable, then according to the multiple second temperatures detected within the second target time period, a second target temperature value is obtained.

[0059] Among them, determining whether the ambient temperature of the environment where the device is located is stable according to the multiple second temperatures detected within the second target time period can be by calculating the variance of the multiple second temperatures. If the variance is less than the preset variance, then the ambient temperature of the environment where the device is located is stable; it can also be by calculating the standard deviation of the multiple second temperatures. If the standard deviation is less than the preset standard deviation, then the ambient temperature of the environment where the device is located is stable; it can also be by calculating the variance of the multiple second temperatures. If the average difference is less than the preset average difference, then the standard deviation of the ambient temperature of the environment where the device is located is stable; it can also be by other methods to determine whether the ambient temperature of the environment where the device is located is stable. Specifically, the method for the device to determine whether the ambient temperature of the environment where it is located is stable is not limited herein.

[0060] In the embodiments of the present application, the second preset temperature difference can be pre-stored in the device, or obtained from other associated devices through a serial peripheral interface (SPI) or wireless communication technology, or obtained from an associated cloud through wireless communication technology; the specific value of the second preset temperature difference can be obtained through third-party experimental data, or an appropriate value can be selected according to the actual accuracy requirements of the device. Among them, the first preset temperature difference and the second preset temperature difference can be the same or different.

[0061] In some embodiments, if it is determined according to the multiple second temperatures within the second target time period that the ambient temperature of the environment where the device is located is unstable, that is, the multiple second temperatures detected by the device within the second target time period do not meet the second preset condition, the device can re-determine a second target time period, obtain the multiple second temperatures detected by the device within this second target time period, and obtain the second target temperature value according to the multiple first temperatures that meet the first preset condition.

[0062] Among them, the processor in the device obtaining multiple second temperatures detected by the device within the second target time period may be obtaining multiple second temperatures continuously or intermittently detected by a temperature sensor in the device during a continuous time period when the device is in a working state. Among them, the second target time period may be a continuous time period such as 0.5h, 1h, 1.5h, etc. when the device is in a working state. The time period when the device is in a working state can be understood as the time period when the device is under user operation or the device is performing a control task. Specifically, if the device is in a working state, the device is not only detecting the ambient temperature at this time, but there is also user operation on the device, such as viewing historical ambient temperature data on the device, etc., or the device is also linked with other devices, that is, performing a control task, such as controlling an air conditioner, fresh air, etc., or there is user operation on the device and the device is also linked with other devices, etc.

[0063] After the processor in the device obtains multiple second temperatures detected by the device within the second target time period and determines that the multiple second temperatures detected by the device within the second target time period meet the second preset condition, the second target temperature value is obtained according to the multiple second temperatures detected within the second target time period.

[0064] Optionally, obtaining the second target temperature value according to the multiple second temperatures detected within the second target time period may be calculating the temperature mean of the multiple second temperatures within the second target time period and using the obtained temperature mean as the second target temperature value to obtain the second target temperature value; it may also be calculating the median of the multiple second temperatures within the second target time period and using the obtained median as the second target temperature value to obtain the second target temperature value; it may also be calculating the mode, arithmetic mean, weighted average, geometric mean, etc. of the multiple second temperatures detected within the second target time period to obtain the second target temperature value.

[0065] In the embodiment of the present application, first determine whether the multiple second temperatures detected by the device within the second target time period meet the second preset condition. If so, then obtain the second target temperature value according to the multiple second temperatures detected by the device within the second target time period. It is necessary to ensure that the ambient temperature of the current environment is stable when the device is in a working state, so as to avoid errors in the current temperature calibration value finally obtained through the second target temperature value, and to obtain a more accurate ambient temperature in the environment where the device is located.

[0066] In the embodiment of the present application, obtaining the current temperature calibration value according to the first target temperature value, the reference ambient temperature value, and the second target temperature value may be calculating the mean of the first difference and the second difference and using the obtained mean as the current temperature calibration value of the device; where the first difference is the difference between the first target temperature value and the reference ambient temperature value, and the second difference is the difference between the second target temperature value and the reference ambient temperature value.

[0067] In some embodiments, before calculating the average value of the first difference and the second difference, it is determined whether the absolute value of the difference between the first difference and the second difference is less than or equal to a third preset difference; if the absolute value of the difference between the first difference and the second difference is less than or equal to the third preset difference, the average value of the first difference and the second difference is calculated, and the obtained average value is used as the current temperature calibration value of the device.

[0068] In the embodiments of the present application, the third preset temperature difference can be pre-stored in the device, or obtained from other associated devices through a serial peripheral interface (SPI) or wireless communication technology, or obtained from an associated cloud through wireless communication technology; the specific value of the third preset temperature difference can be obtained through third-party experimental data or an appropriate value can be selected according to the actual accuracy requirements of the device. Among them, the third preset difference may be the same as or different from the first preset difference and the second preset difference, and no specific limitation is made here.

[0069] Taking an embodiment provided by the present application as an example for illustration, the specific calculation process for obtaining the current temperature calibration value is as follows:

[0070] Please refer to Figure 3 、 Figure 4 As shown in Figure 3 , the time period from t0 to t1 is the first target time period, that is, the time period when the device is in the idle state, the moment t2 is the target reference time, that is, the moment when the device is turned on or awakened to start working, and the time period from t3 to t4 is the second target time period, that is, the time period when the device is in the working state. Combining Figure 4 , when the device is in the idle state, multiple first temperatures within the time period from t0 to t1 are obtained. Among them, the maximum temperature value among the multiple first temperatures is T_01max, and the minimum temperature value is T_01min; if |T_01max - T_01min| ≤ 0.5 °C (i.e., the first preset temperature difference, and a specific value can be selected according to actual requirements, and no limitation is made here), it indicates that the external environmental temperature is in a stable state, that is, the multiple first temperatures detected by the device within the first target time period meet the first preset condition. At this time, the average temperature T1 of the multiple first temperatures within the time period from t0 to t1 is calculated, and at the same time, the device is turned off or the device is operated in a low-power state (in the low-power state, the influence of the heating components in the device on the temperature detected by the temperature sensor can be eliminated).

[0071] After the device is turned off or operates in a low-power state for a preset duration and then is turned on or awakened at time t2, that is, the device is turned on or awakened at the target reference time. At this time, the temperature of the temperature sensor has dropped to the ambient temperature. Obtain the reference ambient temperature value detected by the device at the target reference time, record the temperature T2 detected at this time, and T2 is the reference ambient temperature value. Calculate the difference △T_a (i.e., the first difference) between the first target temperature value and the reference ambient temperature value, △T_a = T1 - T2.

[0072] Obtain multiple second temperatures within the time period from t3 to t4 (i.e., the second target time period). Among them, the maximum temperature value of the multiple second temperatures is T_34max, and the minimum temperature value is T_34min. Determine whether |T_34max - T_34min| ≤ 0.5 °C (i.e., the second preset temperature difference, which can be selected according to actual needs and is not limited here) holds. If it holds (the ambient temperature is stable), that is, the multiple second temperatures detected by the device within the second target time period meet the second preset condition. Calculate the temperature average value T3 of the multiple second temperatures within the time period from t3 to t4, that is, the second target temperature value.

[0073] Calculate the difference △T_b (i.e., the second difference) between the second target temperature value and the reference ambient temperature value, △T_b = T3 - T2; if |△T_a - △T_b| ≤ 0.5 °C (i.e., the third preset temperature difference, which can be selected according to actual needs and is not limited here), that is, the absolute value of the difference between the first difference and the second difference is less than or equal to the third preset difference, it indicates that the ambient temperature is stable; calculate the current temperature calibration value △T, △T = (△T_a + △T_b) / 2, that is, take the average of the first difference and the second difference, and take the obtained average value as the current temperature calibration value of the device.

[0074] Among them, during the process of obtaining the current ambient temperature calibration value, when the situation of |T_01max - T_01min| > 0.5 °C, |T_34max - T_34min| > 0.5 °C, or |△T_a - △T_b| > 0.5 °C occurs, it indicates that the temperature of the environment where the device is located is unstable. Then, it is necessary to re-execute the steps of obtaining the current ambient temperature calibration value to ensure that the finally obtained current ambient temperature calibration value is obtained under the condition that the temperature of the environment where the device is located is stable, so as to obtain a more accurate ambient temperature in the environment where the device is located.

[0075] Step S120: Determine the target temperature calibration value according to the current temperature calibration value and the preset temperature calibration value.

[0076] In the embodiments of the present application, the current temperature calibration value is used to calibrate the temperature of the device by using the working heat of the device. In some embodiments, the device determines the target temperature calibration value according to the current temperature calibration value △T and the preset temperature calibration value, so as to select a suitable target temperature calibration value to correct the temperature calibration value of the device according to the different influences brought by different installation environments of the device and the drift of the heat generation power consumption of the device components, thereby obtaining a more reliable ambient temperature and enabling the device to automatically adapt to different installation environments and scenarios with different heat generation power consumptions.

[0077] Among them, the preset temperature calibration value can be pre-stored in the device, or the device can obtain it from the associated cloud or electronic device through wireless communication technology, or the device can obtain it from the associated electronic device through the serial communication interface. No specific limitation is made here.

[0078] Among them, the method for determining the target temperature calibration value according to the current temperature calibration value and the preset temperature calibration value can be to judge whether the difference between the current temperature calibration value and the preset temperature calibration value meets the third preset condition; if the difference between the current temperature calibration value and the preset temperature calibration value meets the third preset condition, the current temperature calibration value is determined as the target temperature calibration value; if the difference between the current temperature calibration value and the preset temperature calibration value does not meet the third preset condition, the preset temperature calibration value is determined as the target temperature calibration value.

[0079] In some embodiments, if the difference between the current temperature calibration value and the preset temperature calibration value is non-negative, judging whether the difference between the current temperature calibration value and the preset temperature calibration value meets the third preset condition can be to judge whether the difference between the current temperature calibration value and the preset temperature calibration value is greater than or equal to the preset threshold; if the difference between the current temperature calibration value and the preset temperature calibration value is greater than or equal to the preset threshold, the difference between the current temperature calibration value and the preset temperature calibration value meets the third preset condition, that is, it indicates that the preset temperature calibration value pre-stored in the device is not applicable to the current installation environment and the heat generation power consumption of the current device components. At this time, the obtained current temperature calibration value needs to be updated to the device to calibrate the detected ambient temperature, so as to eliminate the influence of different installation environments and heating components on the device ambient temperature detection and obtain a more accurate ambient temperature in the environment where the device is located; if the difference between the current temperature calibration value and the preset temperature calibration value is less than the preset threshold, the difference between the current temperature calibration value and the preset temperature calibration value does not meet the third preset condition, that is, it indicates that the preset temperature calibration value pre-stored in the device is applicable to the current installation environment and the heat generation power consumption of the current device components, and there is no need to update the obtained current temperature calibration value to the device.

[0080] In some other embodiments, if the difference between the current temperature calibration value and the preset temperature calibration value is negative, determining whether the difference between the current temperature calibration value and the preset temperature calibration value meets the third preset condition may be to determine whether the absolute value of the difference between the current temperature calibration value and the preset temperature calibration value is greater than or equal to a preset threshold; if the absolute value of the difference between the current temperature calibration value and the preset temperature calibration value is greater than or equal to the preset threshold, then the difference between the current temperature calibration value and the preset temperature calibration value meets the third preset condition; if the absolute value of the difference between the current temperature calibration value and the preset temperature calibration value is less than the preset threshold, then the difference between the current temperature calibration value and the preset temperature calibration value does not meet the third preset condition.

[0081] Step S130: Obtain the current actual temperature value detected by the device.

[0082] In the embodiments of the present application, the processor of the device obtains the current actual temperature value collected by the temperature sensor in the device. Wherein, the current actual temperature value includes: the temperature value of the components in the device generating heat and the actual ambient temperature value in the environment where the device is located.

[0083] Step S140: Obtain the actual ambient temperature value according to the target temperature calibration value and the current actual temperature value.

[0084] In the embodiments of the present application, the processor in the device obtaining the actual ambient temperature value according to the target temperature calibration value and the current actual temperature value may be to calculate the difference between the actual ambient temperature value and the target temperature calibration value, and use this difference as the actual ambient temperature value to obtain a more accurate ambient temperature value.

[0085] An ambient temperature acquisition method proposed in the embodiments of the present application includes obtaining a current temperature calibration value, which is used to calibrate the temperature of the device using the working heat of the device; determining a target temperature calibration value according to the current temperature calibration value and the preset temperature calibration value; obtaining the current actual temperature value detected by the device; and obtaining the actual ambient temperature value according to the target temperature calibration value and the current actual temperature value. Therefore, by adopting the above method of the present application, the current temperature calibration value of the device is obtained, and the target temperature calibration value is determined according to the current temperature calibration value and the preset temperature calibration value of the device, so as to correct the current actual temperature value obtained by the device using the target temperature calibration value to obtain the actual ambient temperature value, thereby enabling the device to self-calibrate the obtained ambient temperature, eliminating the influence of the secondary deviation between the detected ambient temperature and the actual ambient temperature caused by different installation environments of the device and the drift of the heat generation power consumption of the components, enabling the device to automatically adapt to different installation environments and different heat generation power consumption scenarios, and improving the accuracy of the device in obtaining the temperature of the environment where the device is located.

[0086] Please refer to Figure 5, which shows an ambient temperature acquisition device provided by an embodiment of the present invention. The device 200 includes: a current temperature calibration value acquisition unit 210, a target temperature calibration value determination unit 220, a current actual temperature value acquisition unit 230, and an ambient temperature acquisition unit 240. Specifically, the current temperature calibration value acquisition unit 210 is configured to acquire a current temperature calibration value, and the current temperature calibration value is used to calibrate the temperature of the device using the operating heat of the device; the target temperature calibration value determination unit 220 is configured to determine a target temperature calibration value according to the current temperature calibration value and a preset temperature calibration value; the current actual temperature value acquisition unit 230 is configured to acquire the current actual temperature value detected by the device; the ambient temperature acquisition unit 240 is configured to obtain the actual ambient temperature value according to the target temperature calibration value and the current actual temperature value.

[0087] In one embodiment, the current temperature calibration value acquisition unit 210 is further configured to acquire a first target temperature value, where the first target temperature value is a temperature value obtained according to a plurality of first temperatures detected by the device within a first target time period, and the first target time period is a time period when the device is in an idle state; acquire a reference ambient temperature value detected by the device at a target reference time, where the target reference time is the time when the device is turned on or awakened to start working; acquire a second target temperature value, where the second target temperature value is a temperature value obtained according to a plurality of second temperatures detected by the device within a second target time period, and the second target time period is a time period when the device is in a working state; and acquire the current temperature calibration value according to the first target temperature value, the reference ambient temperature value, and the second target temperature value.

[0088] In one embodiment, before the current temperature calibration value acquisition unit 210 is further configured to acquire the first target temperature value, it is configured to determine whether a plurality of first temperatures detected by the device within the first target time period meet a first preset condition; if the plurality of first temperatures meet the first preset condition, then perform the step of acquiring the first target temperature value.

[0089] In one embodiment, the current temperature calibration value acquisition unit 210 is further configured to determine whether the absolute value of the difference between the maximum temperature value and the minimum temperature value among the plurality of first temperatures is less than or equal to a first preset temperature difference; if the absolute value of the difference between the maximum temperature value and the minimum temperature value among the plurality of first temperatures is less than or equal to the first preset temperature difference, then the plurality of first temperatures meet the first preset condition.

[0090] In one embodiment, the current temperature calibration value acquisition unit 210 is further configured to calculate the temperature average of the plurality of first temperatures and use the obtained temperature average as the first target temperature value to acquire the first target temperature value.

[0091] In one embodiment, before the current temperature calibration value acquisition unit 210 further obtains the second target temperature value, it determines whether multiple second temperatures detected by the device within the second target time period meet the second preset condition; if the multiple second temperatures meet the second preset condition, the step of obtaining the second target temperature value is executed.

[0092] In one embodiment, the current temperature calibration value acquisition unit 210 further determines whether the absolute value of the difference between the maximum temperature value and the minimum temperature value among the multiple second temperatures is less than or equal to the second preset temperature difference; if the absolute value of the difference between the maximum temperature value and the minimum temperature value among the multiple second temperatures is less than or equal to the second preset temperature difference, the multiple second temperatures meet the second preset condition.

[0093] In one embodiment, the current temperature calibration value acquisition unit 210 further obtains the temperature mean value of the multiple second temperatures and uses the obtained temperature mean value as the second target temperature value to obtain the second target temperature value.

[0094] In one embodiment, the current temperature calibration value acquisition unit 210 further obtains the mean value of the first difference and the second difference and uses the obtained mean value as the current temperature calibration value of the device; wherein, the first difference is the difference between the first target temperature value and the reference ambient temperature value, and the second difference is the difference between the second target temperature value and the reference ambient temperature value.

[0095] In one embodiment, before the current temperature calibration value acquisition unit 210 obtains the mean value of the first difference and the second difference, it determines whether the absolute value of the difference between the first difference and the second difference is less than or equal to the third preset difference; if the absolute value of the difference between the first difference and the second difference is less than or equal to the third preset difference, the step of obtaining the mean value of the first difference and the second difference is executed.

[0096] In one embodiment, the target temperature calibration value determination unit 220 further determines whether the difference between the current temperature calibration value and the preset temperature calibration value meets the third preset condition; if the difference between the current temperature calibration value and the preset temperature calibration value meets the third preset condition, the current temperature calibration value is determined as the target temperature calibration value; if the difference between the current temperature calibration value and the preset temperature calibration value does not meet the third preset condition, the preset temperature calibration value is determined as the target temperature calibration value.

[0097] An ambient temperature acquisition device proposed in an embodiment of the present application obtains the current temperature calibration value of the device by using the temperature value obtained when the device is idle, the temperature value obtained when the device is turned on or awakened, and the temperature value obtained in the device working state, so as to calibrate the temperature of the device by using the working heat of the device. According to the current temperature calibration value and the preset temperature calibration value, the target temperature calibration value is determined, and the ambient temperature under the environment where the device is located detected by the device is calibrated by using the target temperature calibration value, so as to eliminate the influence of the differences in the device installation environment and the device heating on the temperature of the environment where the device is located, so that the device can adapt to the installation environment differences and automatically calibrate the ambient temperature for the heat dissipation power drift, and obtain a more accurate ambient temperature.

[0098] It should be noted that the embodiments of this specification are all described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For device embodiments, since they are basically similar to method embodiments, they are described relatively simply. For the relevant parts, refer to the partial description of the method embodiments. For any processing method described in the method embodiments, it can be implemented by the corresponding processing module in the device embodiments, and will not be elaborated one by one in the device embodiments.

[0099] Please refer to Figure 6 , based on the above ambient temperature acquisition method, the present application also provides another electronic device 300 that can execute the foregoing ambient temperature acquisition method. The electronic device 300 includes: a temperature sensor 310, one or more processors 320, a memory 330, and one or more application programs. Among them, the temperature sensor 310 is used to collect the current actual temperature value. The memory 330 stores a program that can execute the content in the foregoing embodiments, and the processor 320 can execute the program stored in the memory 330. Among them, the electronic device 300 can be a smart phone, a smart wearable device, a smart home, a smart robot, a tablet computer, a personal computer, etc.

[0100] Among them, the temperature sensor 310 can be one or a combination of a thermocouple sensor, a thermistor sensor, a resistance temperature detector, an analog integrated sensor, a digital transmission sensor, etc. Exemplarily, the temperature sensor 310 is a thermistor sensor. The temperature is detected by using the thermistor sensor. When there is thermal radiation around the thermosensitive material, it will absorb the radiation heat, cause the temperature to rise, and cause the resistance value of the material to change, so as to detect the temperature.

[0101] The processor 320 may include one or more cores for processing data and a message matrix unit. The processor 320 connects various parts within the entire electronic device 300 using various interfaces and lines, and executes various functions of the electronic device 300 and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 330, and by invoking data stored in the memory 330. Optionally, the processor 320 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), or programmable logic array (PLA).

[0102] The memory 330 may include a random access memory and may also include a read-only memory. The memory 330 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 330 may include a program storage area and a data storage area. Among them, the program storage area may store instructions for implementing the operating system, instructions for implementing at least one function (such as obtaining the current temperature calibration value, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data created during the use of the terminal (such as the current temperature calibration value, preset temperature calibration value, target temperature calibration value, etc.).

[0103] Please refer to Figure 7 , in some embodiments, the electronic device 300 further includes a housing structure 340, a chip 350, and a PCB board 360. Among them, the temperature sensor 310 and the chip 350 are respectively disposed on the PCB board 360, and the PCB board 360 is disposed within the housing structure 340.

[0104] Please refer to Figure 8 , which shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application. Program code 810 is stored in the computer-readable storage medium 800, and the program code 810 can be called by a processor to execute the method described in the above method embodiments.

[0105] The computer-readable storage medium 800 can be an electronic memory such as a flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, a hard disk, or a ROM. Optionally, the computer-readable storage medium 400 includes a non-volatile computer-readable medium. The computer-readable storage medium 400 has a storage space for program code 410 that executes any of the method steps in the above-described method. These program codes 410 can be read from or written to one or more computer program products. The program code 410 can be compressed in a suitable form, for example.

[0106] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and are not intended to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments or equivalently replace some of the technical features. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for obtaining ambient temperature, characterized in that, The method includes: Obtaining a first target temperature value, where the first target temperature value is a temperature value obtained based on a plurality of first temperatures detected by the device within a first target time period, and the first target time period is a time period when the device is in an idle state; Obtaining a reference ambient temperature value detected by the device at a target reference time, where the target reference time is the time when the device is turned on or awakened to start working; Obtaining a second target temperature value, where the second target temperature value is a temperature value obtained based on a plurality of second temperatures detected by the device within a second target time period, and the second target time period is a time period when the device is in a working state; According to the first target temperature value, the reference ambient temperature value, and the second target temperature value, obtaining a current temperature calibration value, where the current temperature calibration value is used to calibrate the temperature of the device using the working heat of the device; Judging whether the difference between the current temperature calibration value and a preset temperature calibration value satisfies a third preset condition to determine a target temperature calibration value; Obtaining a current actual temperature value detected by the device; According to the target temperature calibration value and the current actual temperature value, obtaining an actual ambient temperature value.

2. The method for obtaining ambient temperature according to claim 1, characterized in that, Before obtaining the first target temperature value, the method further includes: Judging whether the plurality of first temperatures detected by the device within the first target time period satisfy a first preset condition; If the plurality of first temperatures satisfy the first preset condition, then execute the step of obtaining the first target temperature value.

3. The method for obtaining ambient temperature according to claim 2, characterized in that, The judging whether the plurality of first temperatures detected by the device within the first target time period satisfy a first preset condition includes: Judging whether the absolute value of the difference between the maximum temperature value and the minimum temperature value among the plurality of first temperatures is less than or equal to a first preset temperature difference; If the absolute value of the difference between the maximum temperature value and the minimum temperature value among the plurality of first temperatures is less than or equal to the first preset temperature difference, then the plurality of first temperatures satisfy the first preset condition.

4. The method for obtaining ambient temperature according to claim 2, characterized in that, The obtaining the first target temperature value includes: Calculating the temperature mean of the plurality of first temperatures and using the obtained temperature mean as the first target temperature value to obtain the first target temperature value.

5. The method for obtaining ambient temperature according to claim 1, characterized in that, Before obtaining the second target temperature value, the method further includes: Judging whether the plurality of second temperatures detected by the device within the second target time period satisfy a second preset condition; If the plurality of second temperatures satisfy the second preset condition, then execute the step of obtaining the second target temperature value.

6. The method for obtaining ambient temperature according to claim 5, characterized in that, The judging whether the plurality of second temperatures detected by the device within the second target time period satisfy a second preset condition includes: Judging whether the absolute value of the difference between the maximum temperature value and the minimum temperature value among the plurality of second temperatures is less than or equal to a second preset temperature difference; If the absolute value of the difference between the maximum temperature value and the minimum temperature value among the plurality of second temperatures is less than or equal to the second preset temperature difference, then the plurality of second temperatures satisfy the second preset condition.

7. The method for obtaining ambient temperature according to claim 5, characterized in that, The obtaining the second target temperature value includes: Obtain the temperature mean value of the multiple second temperatures and use the obtained temperature mean value as the second target temperature value, and obtain the second target temperature value.

8. The method for obtaining ambient temperature according to any one of claims 1-7, characterized in that, The obtaining the current temperature calibration value according to the first target temperature value, the reference ambient temperature value, and the second target temperature value includes: Obtain the mean value of the first difference and the second difference, and use the obtained mean value as the current temperature calibration value of the device; wherein, the first difference is the difference between the first target temperature value and the reference ambient temperature value, and the second difference is the difference between the second target temperature value and the reference ambient temperature value.

9. The method for obtaining ambient temperature according to claim 8, characterized in that, Before obtaining the mean value of the first difference and the second difference, the method further includes: Judge whether the absolute value of the difference between the first difference and the second difference is less than or equal to a third preset difference; If the absolute value of the difference between the first difference and the second difference is less than or equal to the third preset difference, then execute the step of obtaining the mean value of the first difference and the second difference.

10. The environmental temperature acquisition method according to claim 1, characterized in that The determining the target temperature calibration value according to the current temperature calibration value and the preset temperature calibration value includes: Judge whether the difference between the current temperature calibration value and the preset temperature calibration value meets a third preset condition; If the difference between the current temperature calibration value and the preset temperature calibration value meets the third preset condition, then determine the current temperature calibration value as the target temperature calibration value; If the difference between the current temperature calibration value and the preset temperature calibration value does not meet the third preset condition, then determine the preset temperature calibration value as the target temperature calibration value.

11. An environmental temperature acquisition device, characterized in that including: A current temperature calibration value acquisition unit, configured to obtain a first target temperature value, where the first target temperature value is a temperature value obtained according to multiple first temperatures detected by the device within a first target time period, and the first target time period is a time period when the device is in an idle state; obtain the reference ambient temperature value detected by the device at a target reference time, where the target reference time is the time when the device is turned on or awakened and starts to work; obtain a second target temperature value, where the second target temperature value is a temperature value obtained according to multiple second temperatures detected by the device within a second target time period, and the second target time period is a time period when the device is in a working state; Obtain a current temperature calibration value according to the first target temperature value, the reference ambient temperature value, and the second target temperature value, where the current temperature calibration value is used to calibrate the temperature of the device by using the working heat of the device; A target temperature calibration value determination unit, configured to judge whether the difference between the current temperature calibration value and the preset temperature calibration value meets a third preset condition, and determine the target temperature calibration value; A current actual temperature value acquisition unit, configured to obtain the current actual temperature value detected by the device; An ambient temperature acquisition unit, configured to obtain the actual ambient temperature value according to the target temperature calibration value and the current actual temperature value.

12. An electronic device, characterized in that including: A temperature sensor, configured to collect the current actual temperature value; One or more processors; A memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1-10.

13. The electronic device according to claim 12, characterized in that The electronic device further includes a housing structure, a chip, and a PCB board; The temperature sensor and the chip are respectively disposed on the PCB board; The PCB board is disposed within the housing structure.

14. A computer-readable storage medium, characterized in that Program code is stored in the computer-readable storage medium, and the program code can be called by a processor to execute the method according to any one of claims 1-10.

Citation Information

Patent Citations

  • Method of improving temperature measuring accuracy during the thermal starting process of air box

    CN106679850A

  • Portable electronic device

    US20140328368A1