[go: up one dir, main page]

CN112414587B - A temperature detection method and terminal equipment - Google Patents

A temperature detection method and terminal equipment Download PDF

Info

Publication number
CN112414587B
CN112414587B CN202011046068.5A CN202011046068A CN112414587B CN 112414587 B CN112414587 B CN 112414587B CN 202011046068 A CN202011046068 A CN 202011046068A CN 112414587 B CN112414587 B CN 112414587B
Authority
CN
China
Prior art keywords
temperature
terminal device
sensors
values
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011046068.5A
Other languages
Chinese (zh)
Other versions
CN112414587A (en
Inventor
朱向军
张腾飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Genius Technology Co Ltd
Original Assignee
Guangdong Genius Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Genius Technology Co Ltd filed Critical Guangdong Genius Technology Co Ltd
Priority to CN202011046068.5A priority Critical patent/CN112414587B/en
Publication of CN112414587A publication Critical patent/CN112414587A/en
Application granted granted Critical
Publication of CN112414587B publication Critical patent/CN112414587B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01KMEASURING TEMPERATURE; MEASURING QUANTITY OF HEAT; THERMALLY-SENSITIVE ELEMENTS NOT OTHERWISE PROVIDED FOR
    • G01K13/00Thermometers specially adapted for specific purposes
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01KMEASURING TEMPERATURE; MEASURING QUANTITY OF HEAT; THERMALLY-SENSITIVE ELEMENTS NOT OTHERWISE PROVIDED FOR
    • G01K15/00Testing or calibrating of thermometers
    • G01K15/005Calibration

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Measuring And Recording Apparatus For Diagnosis (AREA)
  • Testing Or Calibration Of Command Recording Devices (AREA)

Abstract

The embodiment of the invention discloses a temperature detection method and terminal equipment, which are applied to the technical field of terminal equipment and can solve the problem that the detected environmental temperature value is inaccurate. The method comprises the following steps: acquiring reading values of M sensors to obtain M first temperature values, wherein the M sensors are arranged in the terminal equipment, and the distances between different sensors and the surface of the terminal equipment are different, wherein M is an integer greater than or equal to 3; judging whether the M first temperature values and the distances between the different sensors and the surface of the terminal equipment have a direct proportion relation or an inverse proportion relation; if a direct proportion relation or an inverse proportion relation exists, fitting by adopting a least square method according to the M first temperature values to obtain a temperature parabolic curve; determining a vertex temperature value of the temperature parabolic curve as an ambient temperature value; and outputting the ambient temperature value. The method is applied to a scene where the ambient temperature value of the user changes suddenly.

Description

一种温度检测方法及终端设备A temperature detection method and terminal equipment

技术领域technical field

本发明实施例涉及终端设备技术领域,尤其涉及一种温度检测方法及终端设备。Embodiments of the present invention relate to the technical field of terminal equipment, and in particular, to a temperature detection method and a terminal equipment.

背景技术Background technique

目前终端设备都会设置有温度传感器,进行温度的测量。但是当用户进入一个新环境的时候,传感器的读数值可能无法快速的稳定下来,这样就需要较长时间去检测,并且环境中会一直有空气的流动,这样就会有热量的流动,导致传感器检测到的温度值会不准确。At present, the terminal equipment is equipped with a temperature sensor to measure the temperature. But when the user enters a new environment, the reading value of the sensor may not be able to stabilize quickly, so it will take a long time to detect, and there will always be air flow in the environment, so there will be heat flow, causing the sensor to The detected temperature value will be inaccurate.

发明内容Contents of the invention

本发明实施例提供一种温度检测方法及终端设备,用以解决现有技术中温度检测不准确的问题。为了解决上述技术问题,本发明实施例是这样实现的:Embodiments of the present invention provide a temperature detection method and terminal equipment to solve the problem of inaccurate temperature detection in the prior art. In order to solve the above-mentioned technical problems, the embodiment of the present invention is implemented as follows:

第一方面,提供一种温度检测方法,该方法包括:获取M个传感器的读数值,以得到M个第一温度值,所述M个传感器设置在终端设备内部,且不同传感器与所述终端设备表面的距离不同,其中,M为大于或等于3的整数;In a first aspect, a temperature detection method is provided, the method includes: obtaining readings of M sensors to obtain M first temperature values, the M sensors are arranged inside the terminal device, and different sensors are connected to the terminal The distances from the surface of the equipment are different, where M is an integer greater than or equal to 3;

判断所述M个第一温度值,以及所述不同传感器与所述终端设备表面的距离,是否存在正比例关系或反比例关系;judging whether there is a direct proportional relationship or an inverse proportional relationship between the M first temperature values and the distance between the different sensors and the surface of the terminal device;

若存在正比例关系,或,反比例关系,根据所述M个第一温度值,采用最小二乘法拟合得到温度抛物曲线;If there is a direct proportional relationship, or an inverse proportional relationship, according to the M first temperature values, a temperature parabolic curve is obtained by fitting the least squares method;

将所述温度抛物曲线的顶点温度值确定为环境温度值;determining the apex temperature value of the temperature parabolic curve as the ambient temperature value;

输出所述环境温度值。Output the ambient temperature value.

作为一种可选的实施方式,在本发明实施例的第一方面中,所述判断所述M个第一温度值,以及所述不同传感器与所述终端设备表面的距离,是否存在正比例关系或反比例关系之后,所述方法还包括:As an optional implementation manner, in the first aspect of the embodiments of the present invention, the judging whether there is a proportional relationship between the M first temperature values and the distance between the different sensors and the surface of the terminal device Or after the inverse proportional relationship, the method also includes:

若存在反比例关系,则确定所述终端设备所处环境的温度升高;If there is an inverse proportional relationship, then determine that the temperature of the environment where the terminal device is located increases;

若存在正比例关系,则确定所述终端设备所处环境的温度降低。If there is a direct proportional relationship, it is determined that the temperature of the environment where the terminal device is located decreases.

作为一种可选的实施方式,在本发明实施例第一方面中,所述确定终端设备所处环境的温度升高之后,所述方法还包括:As an optional implementation manner, in the first aspect of the embodiments of the present invention, after determining that the temperature of the environment where the terminal device is located rises, the method further includes:

输出第一提示消息,所述第一提示消息用于提示所述终端设备所处环境的温度升高;Outputting a first prompt message, where the first prompt message is used to prompt that the temperature of the environment where the terminal device is located increases;

所述确定终端设备所处环境的温度降低之后,所述方法还包括:After it is determined that the temperature of the environment where the terminal device is located decreases, the method further includes:

输出第二提示消息,所述第二提示消息用于提示所述终端设备所处环境的温度降低。Outputting a second prompt message, where the second prompt message is used to prompt that the temperature of the environment where the terminal device is located drops.

作为一种可选的实施方式,在本发明实施例第一方面中,所述获取M个传感器的读数值,以得到M个第一温度值之前,还包括:As an optional implementation manner, in the first aspect of the embodiments of the present invention, before acquiring the reading values of M sensors to obtain M first temperature values, it further includes:

在恒温环境中,获取所述M个传感器的读数值,以得到M个第二温度值;In a constant temperature environment, acquire the reading values of the M sensors to obtain M second temperature values;

根据所述M个第二温度值,计算相邻设置的两个传感器的温度差值,以得到M-1个第一差值;Calculate the temperature difference between two adjacent sensors according to the M second temperature values to obtain M-1 first differences;

所述获取M个传感器的读数值,以得到M个第一温度值,包括:The acquisition of the reading values of M sensors to obtain M first temperature values includes:

若所述M-1个第一差值均小于第一预设值,获取所述M个传感器的读数值,以得到M个第一温度值;If the M-1 first difference values are all smaller than the first preset value, acquiring the reading values of the M sensors to obtain M first temperature values;

或者,or,

若所述M-1个第一差值中的第二差值大于或等于第一预设值,则根据第三差值所对应的任一第二温度值,校准所有传感器的温度值,所述第三差值为所述M-1个第一差值中所述第二差值以外的任一差值。If the second difference among the M-1 first differences is greater than or equal to the first preset value, the temperature values of all sensors are calibrated according to any second temperature value corresponding to the third difference, so The third difference is any difference other than the second difference among the M-1 first differences.

作为一种可选的实施方式,在本发明实施例第一方面中,所述获取M个传感器的读数值,以得到M个第一温度值之后,还包括:As an optional implementation manner, in the first aspect of the embodiment of the present invention, after acquiring the reading values of M sensors to obtain M first temperature values, it further includes:

根据所述M个第一温度值,计算第一目标温度值与第二目标温度值的第四差值,所述第一目标温度值为与所述终端设备表面的距离最大的传感器所检测到的第一温度值,所述第二目标温度值为与所述终端设备表面的距离最小的传感器所检测到的第一温度值;Calculate a fourth difference between the first target temperature value and the second target temperature value according to the M first temperature values, where the first target temperature value is detected by the sensor with the largest distance from the surface of the terminal device the first temperature value, the second target temperature value is the first temperature value detected by the sensor with the smallest distance from the surface of the terminal device;

若所述第四差值的绝对值大于第二预设值,则输出第三提示信息,所述第三提示信息用于提示用户增减衣物。If the absolute value of the fourth difference is greater than the second preset value, output third prompt information, the third prompt information is used to prompt the user to add or remove clothes.

第二方面,提供一种终端设备,该终端设备包括:获取模块,用于获取M个传感器的读数值,以得到M个第一温度值,所述M个传感器设置在终端设备内部,且不同传感器与所述终端设备表面的距离不同,其中,M为大于或等于3的整数;In a second aspect, a terminal device is provided. The terminal device includes: an acquisition module, configured to acquire readings of M sensors to obtain M first temperature values. The M sensors are arranged inside the terminal device and are different from each other. The distance between the sensor and the surface of the terminal device is different, where M is an integer greater than or equal to 3;

处理模块,用于判断所述M个第一温度值,以及所述不同传感器与所述终端设备表面的距离,是否存在正比例关系或反比例关系,以及用于若存在正比例关系,或,反比例关系,根据所述M个第一温度值,采用最小二乘法拟合得到温度抛物曲线;A processing module, configured to determine whether there is a proportional relationship or an inverse proportional relationship between the M first temperature values and the distance between the different sensors and the surface of the terminal device, and if there is a proportional relationship or an inverse proportional relationship, According to the M first temperature values, a temperature parabolic curve is obtained by fitting a least square method;

确定模块,用于将所述温度抛物曲线的顶点温度值确定为环境温度值;A determination module, configured to determine the temperature value at the apex of the temperature parabolic curve as the ambient temperature value;

输出模块,用于输出所述环境温度值。An output module, configured to output the ambient temperature value.

作为一种可选的实施方式,在本发明实施例第二方面中,所述确定模块,还用于若存在反比例关系,则确定所述终端设备所处环境的温度升高,以及若存在正比例关系,则确定所述终端设备所处环境的温度降低。As an optional implementation, in the second aspect of the embodiments of the present invention, the determination module is further configured to determine that the temperature of the environment where the terminal device is located rises if there is an inverse proportional relationship, and if there is a direct proportional relationship relationship, it is determined that the temperature of the environment where the terminal device is located decreases.

作为一种可选的实施方式,在本发明实施例第二方面中,所述输出模块,还用于确定终端设备所处环境的温度升高之后,输出第一提示消息,所述第一提示消息用于提示所述终端设备所处环境的温度升高。As an optional implementation manner, in the second aspect of the embodiments of the present invention, the output module is further configured to output a first prompt message after determining that the temperature of the environment where the terminal device is located rises, and the first prompt The message is used to prompt that the temperature of the environment where the terminal device is located increases.

所述输出模块,还用于确定终端设备所处环境的温度降低之后,输出第二提示消息,所述第二提示消息用于提示所述终端设备所处环境的温度降低。The output module is further configured to output a second prompt message after it is determined that the temperature of the environment where the terminal device is located has decreased, and the second prompt message is used to prompt that the temperature of the environment where the terminal device is located has decreased.

作为一种可选的实施方式,在本发明实施例第二方面中,所述获取模块,还用于在恒温环境中,获取所述M个传感器的读数值,以得到M个第二温度值;As an optional implementation manner, in the second aspect of the embodiment of the present invention, the acquisition module is further configured to acquire the reading values of the M sensors in a constant temperature environment to obtain M second temperature values ;

所述处理模块,还用于根据所述M个第二温度值,计算相邻设置的两个传感器的温度差值,以得到M-1个第一差值;The processing module is further configured to calculate the temperature difference between two adjacent sensors according to the M second temperature values, so as to obtain M-1 first differences;

所述获取模块,还用于若所述M-1个第一差值均小于第一预设值,获取所述M个传感器的读数值,以得到M个第一温度值;The obtaining module is further configured to obtain the reading values of the M sensors if the M-1 first difference values are all smaller than the first preset value, so as to obtain M first temperature values;

所述处理模块,还用于若所述M-1个第一差值中的第二差值大于或等于第一预设值,则根据第三差值所对应的任一第二温度值,校准所有传感器的温度值,所述第三差值为所述M-1个第一差值中所述第二差值以外的任一差值。The processing module is further configured to: if the second difference among the M-1 first differences is greater than or equal to the first preset value, according to any second temperature value corresponding to the third difference, The temperature values of all sensors are calibrated, and the third difference is any difference other than the second difference among the M-1 first differences.

作为一种可选的实施方式,在本发明实施例第二方面中,所述处理模块,还用于根据所述M个第一温度值,计算第一目标温度值与第二目标温度值的第四差值,所述第一目标温度值为与所述终端设备表面的距离最大的传感器所检测到的第一温度值,所述第二目标温度值为与所述终端设备表面的距离最小的传感器所检测到的第一温度值;As an optional implementation manner, in the second aspect of the embodiments of the present invention, the processing module is further configured to calculate the difference between the first target temperature value and the second target temperature value according to the M first temperature values. The fourth difference, the first target temperature value is the first temperature value detected by the sensor with the largest distance from the surface of the terminal device, and the second target temperature value is the smallest distance from the surface of the terminal device The first temperature value detected by the sensor;

所述输出模块,还用于若所述第四差值的绝对值大于第二预设值,则输出第三提示信息,所述第三提示信息用于提示用户增减衣物。The output module is further configured to output third prompt information if the absolute value of the fourth difference is greater than a second preset value, and the third prompt information is used to prompt the user to add or remove clothes.

第三方面,提供一种终端设备,包括:In a third aspect, a terminal device is provided, including:

存储有可执行程序代码的存储器;a memory storing executable program code;

与所述存储器耦合的处理器;a processor coupled to the memory;

所述处理器调用所述存储器中存储的所述可执行程序代码,执行本发明实施例第一方面中温度检测方法。The processor invokes the executable program code stored in the memory to execute the temperature detection method in the first aspect of the embodiments of the present invention.

第四方面,提供一种计算机可读存储介质,其存储计算机程序,所述计算机程序使得计算机执行本发明实施例第一方面中的温度检测方法。所述计算机可读存储介质包括ROM/RAM、磁盘或光盘等。In a fourth aspect, a computer-readable storage medium is provided, which stores a computer program, and the computer program causes a computer to execute the temperature detection method in the first aspect of the embodiments of the present invention. The computer-readable storage medium includes ROM/RAM, magnetic disk or optical disk, and the like.

第五方面,提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行第一方面的任意一种方法的部分或全部步骤。In a fifth aspect, a computer program product is provided. When the computer program product is run on a computer, the computer is made to execute part or all of the steps of any one method of the first aspect.

第六方面,提供一种应用发布平台,所述应用发布平台用于发布计算机程序产品,其中,当所述计算机程序产品在计算机上运行时,使得所述计算机执行第一方面的任意一种方法的部分或全部步骤。According to the sixth aspect, an application distribution platform is provided, and the application distribution platform is used to distribute a computer program product, wherein, when the computer program product is run on a computer, the computer is made to execute any one of the methods in the first aspect some or all of the steps.

与现有技术相比,本发明实施例具有以下有益效果:Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

本发明实施例中,获取同一时刻设置在终端设备内部的M个传感器检测到的M个温度值,如果该M个温度值以及传感器与终端设备表面的距离存在正比例或者反比例关系,则可以说明用户所处的外界环境温度发生变化,然后根据这M个温度值通过最小二乘法拟合得到一条温度抛物曲线,并确定该温度抛物曲线的顶点对应的温度值为环境温度值,最后向用户输出得到的环境温度值。该技术方案不需要等到传感器读数稳定,可以在很短时间内计算得到环境温度值,并且通过最小二乘法拟合的方法可以使得计算到的环境温度值更加准确。In the embodiment of the present invention, M temperature values detected by M sensors installed inside the terminal device at the same time are obtained. If there is a direct or inverse proportional relationship between the M temperature values and the distance between the sensor and the surface of the terminal device, it can be explained that the user The temperature of the external environment changes, and then according to the M temperature values, a temperature parabolic curve is obtained by least squares fitting, and the temperature value corresponding to the apex of the temperature parabolic curve is determined to be the ambient temperature value, and finally output to the user to obtain ambient temperature value. The technical solution does not need to wait for the sensor readings to be stable, and can calculate the ambient temperature value in a short time, and the calculated ambient temperature value can be made more accurate by the method of least square fitting.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the accompanying drawings that need to be used in the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For Those of ordinary skill in the art can also obtain other drawings based on these drawings without making creative efforts.

图1a是本发明实施例提供的一种温度检测方法的流程示意图一;Figure 1a is a schematic flow diagram of a temperature detection method provided by an embodiment of the present invention;

图1b是本发明实施例提供的一种终端设备的结构示意图一;FIG. 1b is a first structural schematic diagram of a terminal device provided by an embodiment of the present invention;

图1c是本发明实施例提供的一种终端设备的结构示意图二;FIG. 1c is a second structural schematic diagram of a terminal device provided by an embodiment of the present invention;

图1d是本发明实施例提供的一种温度值以及传感器与终端设备表面的距离的关系示意图一;Figure 1d is a first schematic diagram of the relationship between a temperature value and the distance between the sensor and the surface of the terminal device provided by the embodiment of the present invention;

图1e是本发明实施例提供的一种温度值以及传感器与终端设备表面的距离的关系示意图二;Figure 1e is a second schematic diagram of the relationship between a temperature value and the distance between the sensor and the surface of the terminal device provided by the embodiment of the present invention;

图2是本发明实施例提供的一种温度检测方法的流程示意图二;Fig. 2 is a schematic flow diagram II of a temperature detection method provided by an embodiment of the present invention;

图3是本发明实施例提供的一种温度检测方法的流程示意图三;FIG. 3 is a schematic flow diagram III of a temperature detection method provided by an embodiment of the present invention;

图4是本发明实施例提供的一种终端设备的结构示意图三;FIG. 4 is a third schematic structural diagram of a terminal device provided by an embodiment of the present invention;

图5是本发明实施例提供的一种终端设备的结构示意图四;FIG. 5 is a fourth schematic structural diagram of a terminal device provided by an embodiment of the present invention;

图6是本发明实施例提供的一种终端设备的硬件结构示意图。Fig. 6 is a schematic diagram of a hardware structure of a terminal device provided by an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

本发明的说明书和权利要求书中的术语“第一”和“第二”等是用于区别不同的对象,而不是用于描述对象的特定顺序。例如,第一温度值和第二温度值等是用于区别不同的温度值,而不是用于描述温度值的特定顺序。The terms "first" and "second" in the specification and claims of the present invention are used to distinguish different objects, rather than to describe a specific order of objects. For example, the first temperature value and the second temperature value are used to distinguish different temperature values, rather than describing a specific sequence of temperature values.

本发明实施例的术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "comprising" and "having" and any variations thereof in the embodiments of the present invention are intended to cover a non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to expressly instead of those steps or elements listed, may include other steps or elements not explicitly listed or inherent to the process, method, product or apparatus.

需要说明的是,本发明实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本发明实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。It should be noted that, in the embodiments of the present invention, words such as "exemplary" or "for example" are used for example, illustration or illustration. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present invention shall not be construed as being more preferred or more advantageous than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete manner.

本发明实施例提供一种温度检测方法及终端设备,可以快速准确的检测到用户所处的外界环境温度并输出温度值。Embodiments of the present invention provide a temperature detection method and a terminal device, which can quickly and accurately detect the temperature of an external environment where a user is located and output a temperature value.

本发明实施例涉及的终端设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载终端设备、可穿戴设备、超级移动个人计算机(Ultra-Mobile Personal Computer,UMPC)、上网本或者个人数字助理(Personal Digital Assistant,PDA)等终端设备。其中,可穿戴设备可以为智能手表、智能手环、手表电话、智能脚环、智能耳环、智能项链、智能耳机等,本发明实施例不作限定。The terminal device involved in the embodiment of the present invention may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle-mounted terminal device, a wearable device, an Ultra-Mobile Personal Computer (Ultra-Mobile Personal Computer, UMPC), a netbook or a personal digital assistant (Personal Digital Assistant). Digital Assistant, PDA) and other terminal equipment. Wherein, the wearable device may be a smart watch, a smart bracelet, a watch phone, a smart anklet, a smart earring, a smart necklace, a smart earphone, etc., which are not limited in this embodiment of the present invention.

本发明实施例提供的温度检测方法的执行主体可以为上述的终端设备,也可以为该终端设备中能够实现该温度检测方法的功能模块和/或功能实体,具体的可以根据实际使用需求确定,本发明实施例不作限定。下面以终端设备为例,对本发明实施例提供的温度检测方法进行示例性的说明。The execution subject of the temperature detection method provided by the embodiment of the present invention may be the above-mentioned terminal device, or may be a functional module and/or a functional entity in the terminal device capable of implementing the temperature detection method, which may be specifically determined according to actual usage requirements, The embodiments of the present invention are not limited. The following uses a terminal device as an example to illustrate the temperature detection method provided by the embodiment of the present invention.

本发明实施例提供的温度检测方法,可以应用于用户所处的环境突然发生变化,导致温度变化的场景。The temperature detection method provided by the embodiment of the present invention can be applied to a scene where the user's environment changes suddenly, resulting in a temperature change.

实施例一Embodiment one

如图1a所示,本发明实施例提供一种温度检测方法,该方法可以包括下述步骤:As shown in Figure 1a, an embodiment of the present invention provides a temperature detection method, which may include the following steps:

101、获取M个传感器的读数值,以得到M个第一温度值。101. Acquire reading values of M sensors to obtain M first temperature values.

其中,终端设备的内部设置有M个传感器,且不同传感器与终端设备表面的距离不同,其中,M为大于或等于3的整数。在任一时刻,分别获取第一传感器、第二传感器、…、第M传感器的读数值,以得到M个第一温度值。Wherein, M sensors are arranged inside the terminal device, and different sensors have different distances from the surface of the terminal device, where M is an integer greater than or equal to 3. At any moment, the reading values of the first sensor, the second sensor, ..., the Mth sensor are obtained respectively, so as to obtain M first temperature values.

本发明实施例中,以终端设备为例,如图1b所示,M个传感器设置在终端设备11内部,因为终端设备的表面暴露在空气中,所以需要每个传感器与终端设备的表面12的距离不同,如图仅在终端设备内部的靠近显示屏13所在表面的空间里设置了M个传感器,任意两个传感器之间存在一定的距离,该距离可以是固定的距离,也可以是灵活设置的距离。在任一时刻分别获取第一传感器、第二传感器、…、第M传感器的读数值,以得到在该时刻的M个第一温度值。In the embodiment of the present invention, the terminal device is taken as an example. As shown in FIG. The distances are different. As shown in the figure, only M sensors are set in the space near the surface of the display screen 13 inside the terminal device. There is a certain distance between any two sensors. The distance can be fixed or flexibly set. distance. At any moment, the reading values of the first sensor, the second sensor, .

但是面对可穿戴设备,由于可穿戴设备会有部分表面与人体接触,并不会暴露在空气中,所以可穿戴设备中设置的每个传感器只需要与可穿戴设备的显示屏所在的某一平面的距离不同即可。以电话手表为例,如图1c所示,M个传感器设置在电话手表的表体14内部,从表体的底板15到表体的表壳16的中间区域,每个传感器都与表体的表壳16的距离不同,任意两个传感器之间存在一定的距离。在任一时刻分别获取第一传感器、第二传感器、…、第M传感器的读数值,以得到在该时刻的M个第一温度值。But in the face of wearable devices, since part of the surface of the wearable device is in contact with the human body and will not be exposed to the air, each sensor set in the wearable device only needs to be connected to a certain area where the display screen of the wearable device is located. The distance between the planes may be different. Take the phone watch as an example, as shown in Figure 1c, M sensors are arranged inside the watch body 14 of the phone watch, from the bottom plate 15 of the watch body to the middle area of the watch case 16 of the watch body, each sensor is connected to the watch body of the watch body The distances of the watch case 16 are different, and there is a certain distance between any two sensors. At any moment, the reading values of the first sensor, the second sensor, .

可选的,在获取M个传感器的读数值之前,终端设备还可以检测是否处于佩戴状态,如果检测到该终端设备处于佩戴状态,则按照图1c中的传感器设置,进行101~105步骤。如果检测到该终端设备没有处于佩戴状态,则按照图1b中的传感器设置,仅通过靠近显示屏所在表面的传感器进行温度检测,并进行101~105步骤。Optionally, before obtaining the readings of the M sensors, the terminal device can also detect whether it is in the wearing state, and if it is detected that the terminal device is in the wearing state, then perform steps 101-105 according to the sensor settings in Figure 1c. If it is detected that the terminal device is not in the wearing state, according to the sensor setting in Fig. 1b, the temperature is detected only through the sensor close to the surface where the display screen is located, and steps 101-105 are performed.

102、判断M个第一温度值,以及不同传感器与终端设备表面的距离,是否存在正比例关系或反比例关系。102. Determine whether there is a direct proportional relationship or an inverse proportional relationship between the M first temperature values and the distances between different sensors and the surface of the terminal device.

本发明实施例中,通过M个第一温度值和该M个传感器和终端设备表面的距离,可以确定温度值以及传感器和终端设备表面的距离的关系。在这M个传感器中,每一个传感器都会有一个读数值,此时将每一个传感器的读数值以及每个传感器和终端设备表面的距离一一对应起来,然后确定两者之间的关系。In the embodiment of the present invention, by using the M first temperature values and the distances between the M sensors and the surface of the terminal device, the relationship between the temperature value and the distance between the sensors and the surface of the terminal device can be determined. Among the M sensors, each sensor will have a reading value. At this time, the reading value of each sensor and the distance between each sensor and the surface of the terminal device are one-to-one, and then the relationship between the two is determined.

可以理解的是,当用户在一段时间内处于固定环境中时,终端设备内部不会有热量流动,此时终端设备内部的多个传感器的读数值应该相同,当用户突然离开固定环境进入到一个新环境中时,外界环境温度会发生变化,这样会导致M个传感器的读数值发生变化。可以想到的是,和终端设备表面距离越近的传感器,越靠近外界环境,那么温度变化速度也会越快;相反的,和终端设备表面距离越远的传感器,越远离外界环境,那么温度变化速度也会越慢。所以,可以说明,无论外界环境的温度是升高还是降低,距离终端设备表面越近的传感器的读数值都会变化越快,即变化的数值越大。It is understandable that when the user is in a fixed environment for a period of time, there will be no heat flow inside the terminal device. At this time, the reading values of multiple sensors inside the terminal device should be the same. When the user suddenly leaves the fixed environment and enters a When in a new environment, the temperature of the external environment will change, which will cause the reading values of the M sensors to change. It is conceivable that the closer the sensor is to the surface of the terminal device, the closer it is to the external environment, and the faster the temperature change will be; on the contrary, the farther the sensor is from the surface of the terminal device, the farther it is from the external environment, the temperature change will be faster The speed will also be slower. Therefore, it can be shown that no matter whether the temperature of the external environment increases or decreases, the reading value of the sensor closer to the surface of the terminal device will change faster, that is, the value of the change will be larger.

103、若存在正比例关系,或,反比例关系,根据M个第一温度值,采用最小二乘法拟合得到温度抛物曲线。103. If there is a direct proportional relationship or an inverse proportional relationship, according to the M first temperature values, a temperature parabolic curve is obtained by fitting the least squares method.

如果该M个第一温度值,以及不同传感器与终端设备表面的距离,存在正比例关系或反比例关系,那么可以确定用户离开了固定环境进入到一个不同温度的全新环境中。此时根据同一时刻M个温度值通过最小二乘法算法进行曲线拟合,可以得到一条温度抛物曲线。温度抛物曲线的横坐标为传感器与终端设备表面的距离,温度抛物曲线的纵坐标为温度值。其中,曲线拟合是一种用连续曲线近似地刻画多个离散点组成的表示各个点之间函数关系的曲线的一种数据处理方法。If there is a direct proportional relationship or an inverse proportional relationship between the M first temperature values and the distances between different sensors and the surface of the terminal device, then it can be determined that the user has left the fixed environment and entered a new environment with a different temperature. At this time, a temperature parabolic curve can be obtained by performing curve fitting according to the M temperature values at the same time through the least squares algorithm. The abscissa of the temperature parabolic curve is the distance between the sensor and the surface of the terminal equipment, and the ordinate of the temperature parabolic curve is the temperature value. Among them, curve fitting is a data processing method that uses a continuous curve to approximately describe a curve composed of multiple discrete points that represents the functional relationship between each point.

本发明实施例中,通过获取M个传感器的读数值,将这些读数值与传感器和终端设备表面的距离关联起来,先得到多个数据点pi(xi,yi),其中i=1,2,…,k(3≤k≤M),然后求这k个数据点的近似曲线y=φ(x),为了使得近似曲线与每个数据点之间的偏差最小时,就需要用到最小二乘法,最小二乘法可以按照偏差平方和最小的原则,以及拟合多项式,确定出温度抛物曲线。In the embodiment of the present invention, by acquiring the reading values of M sensors, and correlating these reading values with the distance between the sensor and the surface of the terminal device, a plurality of data points p i ( xi , y i ) are first obtained, where i=1 . To the least squares method, the least squares method can determine the temperature parabolic curve according to the principle of the smallest sum of squared deviations and fitting polynomials.

首先,可以假设拟合多项式为以下公式(1):First, the fitting polynomial can be assumed to be the following formula (1):

y=a0+a1x+…+akxk (1)y=a 0 +a 1 x+…+a k x k (1)

拟合得到的温度抛物曲线需要尽量与每个数据点的温度值相差最小,所以需要求得各个数据点的纵坐标值与这条曲线的差值平方和,如下公式(2)所示:The temperature parabolic curve obtained by fitting needs to have the smallest difference with the temperature value of each data point, so it is necessary to obtain the sum of the squares of the difference between the ordinate value of each data point and this curve, as shown in the following formula (2):

Figure BDA0002705896660000091
Figure BDA0002705896660000091

然后对差值平方和求偏导数,可以得到下列(3)(4)(5)等公式:Then calculate the partial derivative of the sum of squares of the differences, and the following formulas (3)(4)(5) can be obtained:

Figure BDA0002705896660000092
Figure BDA0002705896660000092

再分别对(3)(4)(5)公式进行化简,可以得到下列(6)(7)(8)公式:Then the formulas (3)(4)(5) are simplified respectively, and the following formulas (6)(7)(8) can be obtained:

Figure BDA0002705896660000093
Figure BDA0002705896660000093

Figure BDA0002705896660000094
Figure BDA0002705896660000094

Figure BDA0002705896660000095
Figure BDA0002705896660000095

再将公式(6)(7)(8)表示为矩阵形式,可以得到公式(9):Then formula (6)(7)(8) is expressed in matrix form, and formula (9) can be obtained:

Figure BDA0002705896660000096
Figure BDA0002705896660000096

对公式(9)中每个矩阵进行简化,可以得到公式(10):Simplify each matrix in formula (9), and formula (10) can be obtained:

Figure BDA0002705896660000101
Figure BDA0002705896660000101

即X*A=Y,所以A=(X′*X-1*X′*Y),这样就可以得到系数矩阵A,即a0,a1,…,ak的值,带入拟合多项式(1)中可以得到温度抛物曲线。That is, X*A=Y, so A=(X′*X-1*X′*Y), so that the coefficient matrix A can be obtained, that is, the values of a 0 , a 1 ,…, a k , which are brought into the fitting The temperature parabola can be obtained from polynomial (1).

104、将温度抛物曲线的顶点温度值确定为环境温度值。104. Determine the apex temperature value of the temperature parabolic curve as the ambient temperature value.

终端设备可以将上述温度抛物曲线的顶点对应的温度值作为环境温度值。The terminal device may use the temperature value corresponding to the apex of the temperature parabolic curve as the ambient temperature value.

其中,如果用户是从温度高的环境进入到温度低的环境中,那么该温度抛物曲线则是一条先降低再升高的抛物线,开口向上,如图1d所示,可以将温度抛物曲线的最低点对应的温度值确定为环境温度值;如果用户是从温度低的环境进入到温度高的环境中,那么该温度抛物曲线则是一条先升高再降低的抛物线,开口向下,如图1e所示,可以将温度抛物曲线的最高点对应的温度值确定为环境温度值。Among them, if the user enters from a high-temperature environment to a low-temperature environment, the temperature parabolic curve is a parabola that first decreases and then increases, with the opening upward, as shown in Figure 1d, the lowest point of the temperature parabolic curve can be The temperature value corresponding to the point is determined as the ambient temperature value; if the user enters from a low-temperature environment to a high-temperature environment, then the temperature parabolic curve is a parabola that first increases and then decreases, with the opening downward, as shown in Figure 1e As shown, the temperature value corresponding to the highest point of the temperature parabolic curve can be determined as the ambient temperature value.

105、输出环境温度值。105. Output the ambient temperature value.

本发明实施例提供一种温度检测方法,通过获取同一时刻的终端设备内部设置的多个传感器的读数值得到多个温度值,如果这多个温度值和传感器与终端设备表面的距离之间存在一定的正比例关系或者反比例关系,则可以说明用户所处的当前环境温度发生了一定的变化,这时可以根据多个温度值拟合出一条温度抛物曲线,将曲线顶点所对应的温度值确定为环境温度值,最后输出环境温度值。该技术方案可以在检测到用户所处的当前环境温度发生了一定的变化之后,不需要等到传感器的读数值稳定,获取任意一个时刻的多个传感器读数值就可以快速的得到准确的环境温度值,并提醒用户当前环境的温度。An embodiment of the present invention provides a temperature detection method. Multiple temperature values are obtained by obtaining the readings of multiple sensors installed inside the terminal device at the same time. If there is a gap between the multiple temperature values and the distance between the sensor and the surface of the terminal device A certain proportional relationship or inverse proportional relationship can indicate that the current ambient temperature of the user has changed to a certain extent. At this time, a temperature parabolic curve can be fitted according to multiple temperature values, and the temperature value corresponding to the apex of the curve can be determined as The ambient temperature value, and finally output the ambient temperature value. This technical solution can quickly obtain an accurate ambient temperature value by acquiring multiple sensor readings at any time after detecting that the current ambient temperature of the user has changed to a certain extent without waiting for the sensor reading to stabilize. , and remind the user of the current ambient temperature.

作为一种可选的实施方式,终端设备还可以获取N个时刻M个传感器的读数值,以得到N*M个第一温度值;根据每个时刻M个第一温度值得到温度抛物曲线,以得到N条温度抛物曲线;分别获取每条温度抛物曲线的顶点温度值,以得到N个顶点温度值;取N个顶点温度值的平均值作为环境温度值,并输出该环境温度值。As an optional implementation, the terminal device can also obtain the readings of M sensors at N times to obtain N*M first temperature values; obtain a temperature parabolic curve according to the M first temperature values at each time, To obtain N temperature parabolic curves; respectively obtain the apex temperature value of each temperature parabolic curve to obtain N apex temperature values; take the average value of the N apex temperature values as the ambient temperature value, and output the ambient temperature value.

该可选的实施方式中,终端设备可以获取多个时刻的多个温度值,然后根据每个时刻确定出的顶点对应的温度值求平均值,从而得到环境温度值。该方案根据多个温度值求平均值得到最终的环境温度值,可以使得环境温度检测更加精确,避免造成因为传感器灵敏度不足而造成环境温度值不准确的情况。In this optional implementation manner, the terminal device may acquire multiple temperature values at multiple times, and then calculate an average value according to the temperature values corresponding to the vertices determined at each time, so as to obtain the ambient temperature value. This solution calculates the average value of multiple temperature values to obtain the final ambient temperature value, which can make the detection of the ambient temperature more accurate and avoid inaccurate environmental temperature values caused by insufficient sensitivity of the sensor.

作为一种可选的实施方式,终端设备还可以获取用户的课程表信息,在体育课结束时间若检测到用户的体温升高了,并且高于人体正常体温范围,则可以说明用户刚才结束了体育课,此时可以获取M个传感器的读数值,以得到M个第一温度值,并根据M个第一温度值得到温度抛物曲线,将温度抛物曲线的顶点温度值确定为环境温度值。此时将上述环境温度值与预设温度值进行比较,如果环境温度值低于预设温度值,则输出第四提示消息,提示用户在当前环境温度较低,会有感冒风险。可选的,如果该环境温度值低于预设温度值,终端设备还可以控制屏幕发出红光警告以提示用户。As an optional implementation, the terminal device can also obtain the user's class schedule information. If it is detected that the user's body temperature has risen at the end of the physical education class and is higher than the normal body temperature range, it can be explained that the user has just finished. Physical education class, at this time, the reading values of M sensors can be obtained to obtain M first temperature values, and a temperature parabolic curve can be obtained according to the M first temperature values, and the temperature value at the apex of the temperature parabolic curve can be determined as the ambient temperature value. At this time, the above-mentioned ambient temperature value is compared with the preset temperature value. If the ambient temperature value is lower than the preset temperature value, a fourth prompt message is output to remind the user that the current ambient temperature is low and there is a risk of catching a cold. Optionally, if the ambient temperature value is lower than the preset temperature value, the terminal device can also control the screen to emit a red light warning to prompt the user.

示例性的,预设温度值是预存的用户感觉比较适宜的温度(例如,可以是低于人体正常体温的某一温度值),该预设温度值可以是终端设备根据用户当地的地理位置、季节以及用户信息(可以包括用户的病假记录、课程表等)综合设定的,也可以是用户自行设定的。Exemplarily, the preset temperature value is a pre-stored temperature that the user feels more comfortable (for example, it may be a certain temperature value lower than the normal body temperature of the human body). The season and user information (may include the user's sick leave record, class schedule, etc.) are comprehensively set, and can also be set by the user.

例如:终端设备获取到用户某一次请病假时当天的气温为20度,说明20度对于该用户来说较冷不适宜,那么该预设温度值可以预存为25度。For example: the terminal device acquires that the temperature on the day when the user asks for sick leave is 20 degrees, indicating that 20 degrees is not suitable for the user, so the preset temperature value can be pre-stored as 25 degrees.

例如:终端设备在课表中体育课结束时间16:30时,检测到用户的体温为39度,已经超过了人体正常体温范围,那么可以确定用户刚上完体育课。For example: when the terminal device detects that the user's body temperature is 39 degrees at 16:30 when the physical education class ends in the class schedule, which has exceeded the normal body temperature range of the human body, it can be determined that the user has just finished the physical education class.

例如:通过终端设备内部设置的5个传感器,根据本发明实施例中提供的温度检测方法,确定当前环境温度为20度时,低于25度,可以说明用户进入到了较冷的空调房中,此时可以输出提示消息“已进入较冷环境,小心感冒哦”提示用户当前环境温度较低,并且屏幕不停闪烁红色光,直到用户离开温度值为20度的环境。For example: through the five sensors installed inside the terminal device, according to the temperature detection method provided in the embodiment of the present invention, when it is determined that the current ambient temperature is 20 degrees, if it is lower than 25 degrees, it can indicate that the user has entered a cooler air-conditioned room. At this time, the prompt message "You have entered a colder environment, be careful of catching a cold" can be output to remind the user that the current ambient temperature is low, and the screen keeps flashing red until the user leaves the environment with a temperature value of 20 degrees.

该实施方式可以在检测到刚上完体育课的用户进入到较冷环境时,输出提醒或者屏幕闪烁红光提醒用户环境温度较低。一般来说儿童在上完体育课比较热的情况下会尽快进入空调房,但是这样会容易生病,及时的检测到当前环境温度,并在温度较低时输出相应的提醒就可以起到提示用户的作用,从而可以一定程度上避免用户生病。This embodiment can output a reminder or flash a red light on the screen to remind the user that the ambient temperature is low when it is detected that the user who has just finished a physical education class enters a colder environment. Generally speaking, children will enter the air-conditioned room as soon as possible when it is relatively hot after physical education, but this will easily get sick. Timely detection of the current ambient temperature and outputting corresponding reminders when the temperature is low can remind the user , so as to avoid users from getting sick to a certain extent.

需要说明的是,本发明实施例中的提示信息的形式可以包括语音、文字、动画或者灯光闪烁等,在实际实现中可以根据实际需求进行设置,本发明实施例不作具体限定。It should be noted that the form of the prompt information in the embodiment of the present invention may include voice, text, animation or light flashing, etc., which can be set according to actual needs in actual implementation, and is not specifically limited in the embodiment of the present invention.

实施例二Embodiment two

如图2所示,本发明实施例提供的温度检测方法,还可以包括下述步骤:As shown in Figure 2, the temperature detection method provided by the embodiment of the present invention may also include the following steps:

201、获取M个传感器的读数值,以得到M个第一温度值。201. Acquire reading values of M sensors to obtain M first temperature values.

202、判断M个第一温度值,以及不同传感器与终端设备表面的距离,是否存在正比例关系或反比例关系。202. Determine whether there is a direct proportional relationship or an inverse proportional relationship between the M first temperature values and the distances between different sensors and the surface of the terminal device.

本发明实施例中,针对步骤201~202的描述,请参照实施例一中针对步骤101~102的详细描述,本发明实施例不再赘述。In the embodiment of the present invention, for the description of steps 201 to 202, please refer to the detailed description of steps 101 to 102 in Embodiment 1, which will not be repeated in this embodiment of the present invention.

203、若存在反比例关系,确定所述终端设备所处环境的温度升高。203. If there is an inverse proportional relationship, determine that the temperature of the environment where the terminal device is located rises.

如果检测到相邻两个传感器中,距离终端设备表面较近的传感器的读数值较大,距离终端设备表面较远的传感器的读数值较小,可以说明这两个相邻传感器变化之前的温度值会低于距离终端设备表面较远的传感器的读数值,这样可以说明两个传感器的读数值正在变大,即终端设备所处环境的温度正在升高。If it is detected that among two adjacent sensors, the reading value of the sensor closer to the surface of the terminal device is larger, and the reading value of the sensor farther away from the surface of the terminal device is smaller, it can indicate that the temperature of the two adjacent sensors before the change The value will be lower than the reading value of the sensor farther from the surface of the terminal device, which can indicate that the reading value of the two sensors is getting higher, that is, the temperature of the environment in which the terminal device is located is increasing.

示例性的,如果传感器A和传感器B相邻,传感器A比传感器B更接近终端设备的表面,如果检测到传感器A的读数值为25度,传感器B的读数值为20度,又因为距离终端设备表面越近的传感器的读数值会变化越快,所以可以得到传感器A和传感器B变化之前的读数值会低于20度,那么说明传感器A和传感器B的读数值正在变大,即终端设备所处环境的温度正在升高。For example, if sensor A is adjacent to sensor B, and sensor A is closer to the surface of the terminal device than sensor B, if it is detected that the reading value of sensor A is 25 degrees, the reading value of sensor B is 20 degrees, and because the distance from the terminal The reading value of the sensor closer to the surface of the device will change faster, so it can be obtained that the reading value of sensor A and sensor B will be lower than 20 degrees before the change, which means that the reading value of sensor A and sensor B is increasing, that is, the terminal device The temperature of your environment is rising.

本发明实施例中,相邻可以指接触,或者不接触两种情况。例如:传感器A和传感器B相邻,可以是指传感器A和传感器B在终端设备内部接触设置,两者之间没有空间间隔,也可以是指传感器A和传感器B之间有一定的空间间隔,没有接触,但是两个传感器之间没有设置其他的传感器。In the embodiment of the present invention, adjacent may refer to contact or non-contact. For example, if sensor A is adjacent to sensor B, it may mean that sensor A and sensor B are placed in contact with each other inside the terminal device, and there is no space between them, or it may mean that there is a certain space between sensor A and sensor B. There is no contact, but no other sensors are placed between the two sensors.

204、输出第一提示消息。204. Output the first prompt message.

当确定终端设备所处环境的温度升高之后,可以输出第一提示消息,该第一提示消息用于提示终端设备所处环境的温度升高。After it is determined that the temperature of the environment where the terminal device is located rises, a first prompt message may be output, where the first prompt message is used to prompt that the temperature of the environment where the terminal device is located has increased.

205、若存在正比例关系,确定所述终端设备所处环境的温度降低。205. If there is a direct proportional relationship, determine that the temperature of the environment where the terminal device is located decreases.

如果检测到相邻两个传感器中,距离终端设备表面较远的传感器的读数值较大,距离终端设备表面较近的传感器的读数值较小,可以说明这两个相邻传感器变化之前的温度值会高于距离终端设备表面较远的传感器的读数值,这样可以说明两个传感器的读数值正在变小,即终端设备所处环境的温度正在降低。If it is detected that among two adjacent sensors, the reading value of the sensor farther from the surface of the terminal device is larger, and the reading value of the sensor closer to the surface of the terminal device is smaller, it can indicate that the temperature of the two adjacent sensors before the change The value will be higher than the reading value of the sensor farther from the surface of the terminal device, which can indicate that the reading value of the two sensors is getting smaller, that is, the temperature of the environment where the terminal device is located is decreasing.

示例性的,如果传感器A和传感器B相邻,传感器A比传感器B更接近终端设备的表面,如果检测到传感器A的读数值为20度,传感器B的读数值为25度,又因为距离终端设备表面越近的传感器的读数值会变化越快,所以可以得到传感器A和传感器B变化之前的读数值会高于25度,那么说明传感器A和传感器B的读数值正在变小,即终端设备所处环境的温度正在降低。For example, if sensor A is adjacent to sensor B, and sensor A is closer to the surface of the terminal device than sensor B, if it detects that the reading value of sensor A is 20 degrees, the reading value of sensor B is 25 degrees, and because the distance from the terminal The reading value of the sensor closer to the surface of the device will change faster, so it can be obtained that the reading value of sensor A and sensor B before the change will be higher than 25 degrees, which means that the reading value of sensor A and sensor B is getting smaller, that is, the terminal device The temperature of the environment is decreasing.

206、输出第二提示消息。206. Output a second prompt message.

当确定终端设备所处环境的温度降低之后,可以输出第二提示消息,该第二提示消息用于提示终端设备所处环境的温度降低。After it is determined that the temperature of the environment where the terminal device is located drops, a second prompt message may be output, where the second prompt message is used to prompt that the temperature of the environment where the terminal device is located has dropped.

207、根据M个第一温度值得到温度抛物曲线。207. Obtain a temperature parabolic curve according to the M first temperature values.

208、将温度抛物曲线的顶点温度值确定为环境温度值。208. Determine the apex temperature value of the temperature parabolic curve as the ambient temperature value.

209、输出环境温度值。209. Output the ambient temperature value.

本发明实施例中,针对步骤207~209的描述,请参照实施例一中针对步骤102~104的详细描述,本发明实施例不再赘述。In the embodiment of the present invention, for the description of steps 207-209, please refer to the detailed description of steps 102-104 in Embodiment 1, which will not be repeated in this embodiment of the present invention.

需要说明的是,本发明实施例中,203~204步骤和205~206步骤是针对202步骤的两种不同情况,不会同时出现。203~204步骤或者205~206步骤和207~209步骤可以是同时发生的,也可以是先进行203~204步骤或者205~206步骤再进行207~209步骤,也可以是先进行207~209步骤再进行203~204步骤或者205~206步骤的,本发明实施例不做具体限定。It should be noted that, in the embodiment of the present invention, steps 203-204 and steps 205-206 are for two different situations of step 202, and will not appear at the same time. Steps 203 to 204 or steps 205 to 206 and steps 207 to 209 can occur simultaneously, or steps 203 to 204 or steps 205 to 206 can be performed first and then steps 207 to 209 can be performed, or steps 207 to 209 can be performed first Steps 203-204 or steps 205-206 are performed again, which is not specifically limited in this embodiment of the present invention.

类似的,针对204步骤中的输出第一提示消息或者206步骤中的输出第二提示消息以及209步骤中的输出环境温度值,可以是同时输出环境温度值以及第一提示消息或者第二提示消息,也可以是先输出第一提示消息或者第二提示消息再输出环境温度值,也可以是先输出环境温度值再输出第一提示消息或者第二提示消息,本发明实施例不做具体限定。Similarly, for the output of the first prompt message in step 204 or the output of the second prompt message in step 206 and the output of the ambient temperature value in step 209, the ambient temperature value and the first prompt message or the second prompt message can be output at the same time , or first output the first prompt message or the second prompt message and then output the ambient temperature value, or output the ambient temperature value first and then output the first prompt message or the second prompt message, which is not specifically limited in this embodiment of the present invention.

本发明实施例提供一种温度检测方法,通过终端设备内部设置的多个传感器获得的温度值,可以确定温度值与传感器和终端设备表面的距离之间的关系,如果是正比例关系,则可以确定当前环境温度是降低的,如果是反比例关系,则可以确定当前环境温度是升高的,然后根据不同的环境温度变化输出不同的提示消息以及环境温度值。该技术方案可以使得用户更加直观的了解到环境温度的变化,并且检测到的环境温度值更加精确,而且不仅可以输出环境温度值,还可以输出环境温度的变化情况,更加直观。An embodiment of the present invention provides a temperature detection method. The temperature value obtained by multiple sensors installed inside the terminal device can determine the relationship between the temperature value and the distance between the sensor and the surface of the terminal device. If it is a proportional relationship, it can be determined The current ambient temperature is decreasing. If the relationship is inversely proportional, it can be determined that the current ambient temperature is increasing, and then output different prompt messages and ambient temperature values according to different ambient temperature changes. This technical solution can enable the user to understand the change of the ambient temperature more intuitively, and the detected ambient temperature value is more accurate, and not only the ambient temperature value but also the change of the ambient temperature can be output, which is more intuitive.

作为一种可选的实施方式,在通过终端设备内部设置的传感器得到的温度值拟合出温度抛物曲线并确定出当前环境温度值之后,终端设备还可以获取前一天的平均温度值,如果当前环境温度值与前一天的平均温度值之间的差值绝对值大于预设温度差值,则可以向关联的监护人设备发送提示消息,用于提示监护人,用户当前所处环境的温度与昨日平均温度相比变化较大,从而可以提示监护人关注用户穿衣或者出行情况。As an optional implementation, after fitting the temperature parabolic curve with the temperature value obtained by the sensor installed inside the terminal device and determining the current ambient temperature value, the terminal device can also obtain the average temperature value of the previous day, if the current If the absolute value of the difference between the ambient temperature value and the average temperature value of the previous day is greater than the preset temperature difference value, a prompt message can be sent to the associated guardian device to remind the guardian that the temperature of the user's current environment is different from yesterday's average temperature. The temperature has a relatively large change, which can prompt the guardian to pay attention to the user's clothing or travel situation.

示例性的,预设温度差值为根据当地的四季环境温度变化以及人体可以接受的温度变化值进行设定的,假设为8度。用户甲在终端设备中关联了用户甲的母亲的手机作为监护人设备,假如用户甲的终端设备在通过内部设置的传感器得到的温度值拟合出温度抛物曲线并确定出当前环境温度值为20度,并且检测到昨天的平均温度值为30度,今日环境温度降低了10度,大于30度,则可以说明今日环境温度有大幅度降低的变化趋势,终端设备会向用户甲的母亲的手机发送提示消息,提示用户甲的母亲今日环境温度大幅度降低。Exemplarily, the preset temperature difference is set according to the local four-season ambient temperature change and the acceptable temperature change value of the human body, and is assumed to be 8 degrees. User A associates User A's mother's mobile phone as a guardian device in the terminal device. If User A's terminal device uses the temperature value obtained by the internal sensor to fit a temperature parabolic curve and determine that the current ambient temperature is 20 degrees , and detected that yesterday’s average temperature was 30 degrees, and today’s ambient temperature has dropped by 10 degrees. If it is greater than 30 degrees, it can indicate that today’s ambient temperature has a trend of decreasing significantly, and the terminal device will send a message to user A’s mother’s mobile phone. The prompt message reminds user A's mother that the ambient temperature has dropped significantly today.

该实施方式可以提醒家长用户当前所处环境温度较昨日相比有了比较大的变化,这样家长可以就会提醒用户注意温度变化并采取一些措施以防生病。This embodiment can remind the parents that the current ambient temperature of the user has changed greatly compared with yesterday, so that the parents can remind the user to pay attention to the temperature change and take some measures to prevent getting sick.

作为一种可选的实施方式,在通过终端设备内部设置的传感器得到的温度值拟合出温度抛物曲线并确定出当前环境温度值之后,终端设备还可以获取关联的好友设备的定位信息,根据定位信息确定好友设备与该终端设备之间的距离,得到一个或多个距离小于预设距离的目标好友设备,然后向目标好友设备发送提示消息,用于提示好友所处环境的温度升高或者降低。As an optional implementation, after fitting the temperature parabolic curve with the temperature value obtained by the sensor installed inside the terminal device and determining the current ambient temperature value, the terminal device can also obtain the location information of the associated friend device, according to The positioning information determines the distance between the friend device and the terminal device, obtains one or more target friend devices whose distance is less than the preset distance, and then sends a prompt message to the target friend device, which is used to remind the friend's environment that the temperature rises or reduce.

该实施方式可以根据关联的好友设备与该终端设备的距离确定好友所处的位置,如果好友设备与该终端设备的距离小于预设距离,说明好友可能也处于和该终端设备的用户相同的环境中,这时还可以向好友设备输出同样的提示消息,用于提示好友所处环境的温度升高或者降低。This embodiment can determine the location of the friend according to the distance between the associated friend device and the terminal device. If the distance between the friend device and the terminal device is less than the preset distance, it means that the friend may also be in the same environment as the user of the terminal device. At this time, the same prompt message can also be output to the friend's device, which is used to prompt the temperature of the friend's environment to increase or decrease.

实施例三Embodiment three

如图3所示,本发明实施例提供的温度检测方法,还可以包括下述步骤:As shown in Figure 3, the temperature detection method provided by the embodiment of the present invention may also include the following steps:

301、在恒温环境中,获取M个传感器的读数值,以得到M个第二温度值。301. In a constant temperature environment, acquire reading values of M sensors to obtain M second temperature values.

终端设备保持开机状态处于恒温环境中时,可以获取M个传感器的读数值,可以得到M个第二温度值。上述恒温环境可以是一个密闭的温度不变的空间,也可以是一个设定好温度的恒温箱。When the terminal device remains turned on and is in a constant temperature environment, reading values of M sensors can be obtained, and M second temperature values can be obtained. The above-mentioned constant temperature environment can be a closed space with constant temperature, or a constant temperature box with a set temperature.

302、计算相邻设置的两个传感器的温度差值,以得到M-1个第一差值。302. Calculate temperature differences between two adjacent sensors to obtain M-1 first differences.

根据M个第二温度值,计算相邻两个传感器之间的温度差值,这样可以得到M-1个第一差值。According to the M second temperature values, the temperature difference between two adjacent sensors is calculated, so that M−1 first differences can be obtained.

303、若M-1个第一差值均小于第一预设值,获取M个传感器的读数值,以得到M个第一温度值。303. If the M-1 first difference values are all less than the first preset value, acquire the reading values of M sensors to obtain M first temperature values.

在理想情况下,恒温环境中因为热量流动平衡,所以各传感器的读数值应该相等,即M个第一差值均为零。但是实际情况下,考虑到传感器的灵敏度以及终端设备内部空间中会有部分空气流动,会造成微弱的热量流动,所以当M-1个第一差值不为零但是均小于第一预设值的时候,就可以认为该M个传感器的读数值为准确的。然后开始获取M个传感器的读数值,得到M个第一温度值。Ideally, in a constant temperature environment, due to the balance of heat flow, the reading values of each sensor should be equal, that is, the M first differences are all zero. However, in reality, considering the sensitivity of the sensor and some air flow in the internal space of the terminal device, it will cause weak heat flow, so when the first difference of M-1 is not zero but is less than the first preset value When , it can be considered that the readings of the M sensors are accurate. Then start to acquire the reading values of M sensors, and obtain M first temperature values.

其中,第一预设值是终端设备根据内置传感器的灵敏度以及终端设备内部空间的空气流动等客观因素设置的一个极为微小的数值,例如,0.05度、0.08度。Wherein, the first preset value is an extremely small value set by the terminal device according to objective factors such as the sensitivity of the built-in sensor and the air flow in the internal space of the terminal device, for example, 0.05 degrees, 0.08 degrees.

示例性的,假设M为5,第一预设值为0.05度。如果通过终端设备内部的传感器可以获取到5个读数值,传感器A的读数值为25.50度,传感器B的读数值为25.51度,传感器C的读数值为25.51度,传感器D的读数值为25.54度,传感器E的读数值为25.56度。那么通过计算可以得到四个第一差值分别为0.01度、0度、0.03度和0.02度,这四个第一差值均小于0.05度,可以确定这五个传感器是准确的。Exemplarily, assuming that M is 5, the first preset value is 0.05 degrees. If 5 readings can be obtained through the sensors inside the terminal device, the reading value of sensor A is 25.50 degrees, the reading value of sensor B is 25.51 degrees, the reading value of sensor C is 25.51 degrees, and the reading value of sensor D is 25.54 degrees , the reading value of sensor E is 25.56 degrees. Then, four first differences can be obtained through calculation, which are 0.01 degrees, 0 degrees, 0.03 degrees and 0.02 degrees, respectively, and these four first differences are all less than 0.05 degrees, so it can be determined that the five sensors are accurate.

304、若M-1个第一差值中的第二差值大于或等于第一预设值,则根据第三差值所对应的任一第二温度值,校准所有传感器的温度值。304. If the second difference among the M-1 first differences is greater than or equal to the first preset value, calibrate the temperature values of all sensors according to any second temperature value corresponding to the third difference.

其中,上述第三差值为M-1个第一差值中第二差值以外的任一差值。Wherein, the above-mentioned third difference value is any difference value other than the second difference value among the M-1 first difference values.

如果M-1个第一差值中存在至少一个大于或等于第一预设值的第二差值,则可以说明该第二差值对应的至少一个传感器读数不准确,此时需要进行校准。根据第三差值所对应的两个传感器中的任意一个传感器的读数值,对所有传感器进行校准。If there is at least one second difference greater than or equal to the first preset value among the M-1 first difference values, it may indicate that at least one sensor reading corresponding to the second difference value is inaccurate, and calibration is required at this time. All the sensors are calibrated according to the reading value of any one of the two sensors corresponding to the third difference.

示例性的,假设M为5,第一预设值为0.05度。如果通过终端设备内部的传感器获取到5个读数值,传感器A的读数值为25.50度,传感器B的读数值为25.52度,传感器C的读数值为25.59度,传感器D的读数值为25.65度,传感器E的读数值为25.68度。那么通过计算可以得到4个第一差值,分别为0.02度、0.07度、0.06度、0.03度,其中有两个第二差值0.07度和0.06度均大于0.05度,则需要进行校准。这时可以取两个第三差值0.02度和0.03度中的任意一个进行校准,以0.02度为例。第三差值0.02度对应的A、B两个传感器的读数值分别为25.50度和25.52度,则可以将五个传感器的读数值均校准为传感器A的读数值25.50度或者传感器B的读数值25.52度。同样的,也可以取第三差值0.03度进行校准,第三差值0.03度对应的D、E两个传感器的读数值分别为25.65度和25.68度,这时将所有传感器的读数值均校准为传感器D的读数值25.65度或者传感器E的读数值25.68度。Exemplarily, assuming that M is 5, the first preset value is 0.05 degrees. If 5 readings are obtained through the sensors inside the terminal device, the reading value of sensor A is 25.50 degrees, the reading value of sensor B is 25.52 degrees, the reading value of sensor C is 25.59 degrees, and the reading value of sensor D is 25.65 degrees, Sensor E reads 25.68 degrees. Then, four first differences can be obtained through calculation, which are 0.02 degrees, 0.07 degrees, 0.06 degrees, and 0.03 degrees, and two of the second differences, 0.07 degrees and 0.06 degrees, are greater than 0.05 degrees, and calibration is required. At this time, any one of the two third difference values of 0.02 degrees and 0.03 degrees can be used for calibration, taking 0.02 degrees as an example. The readings of the two sensors A and B corresponding to the third difference of 0.02 degrees are 25.50 degrees and 25.52 degrees respectively, then the readings of the five sensors can be calibrated to the reading value of sensor A at 25.50 degrees or the reading value of sensor B 25.52 degrees. Similarly, the third difference of 0.03 degrees can also be used for calibration. The readings of the D and E sensors corresponding to the third difference of 0.03 degrees are 25.65 degrees and 25.68 degrees respectively. At this time, the readings of all sensors are calibrated The reading value of sensor D is 25.65 degrees or the reading value of sensor E is 25.68 degrees.

305、获取M个传感器的读数值,以得到M个第一温度值。305. Acquire reading values of M sensors to obtain M first temperature values.

本发明实施例中,针对步骤305的描述,请参照实施例一中针对步骤101的详细描述,本发明实施例不再赘述。In this embodiment of the present invention, for the description of step 305, please refer to the detailed description of step 101 in Embodiment 1, which will not be repeated in this embodiment of the present invention.

306、根据M个第一温度值,计算第一目标温度值与第二目标温度值的第四差值。306. Calculate a fourth difference between the first target temperature value and the second target temperature value according to the M first temperature values.

其中,第一目标温度值为距离终端设备表面距离最近的传感器的读数值,第二目标温度值为距离终端设备表面距离最远的传感器的读数值。获取这两个传感器的读数值之后,计算得到两者之间的第四差值。Wherein, the first target temperature value is the reading value of the sensor closest to the surface of the terminal device, and the second target temperature value is the reading value of the sensor farthest from the surface of the terminal device. After the readings of the two sensors are obtained, a fourth difference between them is calculated.

307、若第四差值的绝对值大于第二预设值,则输出第三提示信息。307. If the absolute value of the fourth difference is greater than the second preset value, output third prompt information.

如果第四差值的绝对值大于第二预设值,说明外界环境的温度都较大的变化,此时输出第三提示信息,该第三提示信息用于提示用户需要增减衣物。If the absolute value of the fourth difference is greater than the second preset value, it means that the temperature of the external environment has changed greatly. At this time, the third prompt message is output, and the third prompt message is used to prompt the user to add or remove clothes.

其中,如果终端设备检测到距离终端设备表面距离最近的传感器的读数值大于距离终端设备表面距离最远的传感器的读数值,且两者的差值大于第二预设值,则可以说明用户从较冷的环境进入到较热的环境中,而且环境温差较大,此时输出第三提示消息,建议用户可以采取一些措施进行降温;如果终端设备检测到距离终端设备表面距离最近的传感器的读数值小于距离终端设备表面距离最远的传感器的读数值,且两者的差值大于第二预设值,则可以说明用户从较热的环境进入到较冷的环境中,而且环境温差较大,此时输出第三提示消息,建议用户可以采取一些措施进行保暖。Wherein, if the terminal device detects that the reading value of the sensor closest to the surface of the terminal device is greater than the reading value of the sensor farthest from the surface of the terminal device, and the difference between the two is greater than the second preset value, it can be explained that the user is from When the colder environment enters into the hotter environment, and the ambient temperature difference is large, the third prompt message is output at this time, suggesting that the user can take some measures to cool down; if the terminal device detects the reading of the sensor closest to the surface of the terminal device If the value is less than the reading value of the sensor farthest from the surface of the terminal device, and the difference between the two is greater than the second preset value, it means that the user enters from a hotter environment to a cooler environment, and the ambient temperature difference is large , the third prompt message is output at this time, suggesting that the user can take some measures to keep warm.

示例性的,第二预设值是根据当地的四季环境温度变化以及人体可以接受的温度变化值进行设定的,假设为8度。当距离终端设备表面距离最近的传感器A的读数值为26度,而距离终端设备表面距离最远的传感器B的读数值为36度,两者的温度差绝对值为10度,大于8度,传感器A的读数值小于传感器B的读数值,所以可以说明用户可能是从比较炎热的室外环境进入到比较凉快的空调房里,这时终端设备就会输出提示消息,提示用户当前环境温度大幅度的升高。Exemplarily, the second preset value is set according to the local four-season ambient temperature change and the acceptable temperature change value of the human body, and is assumed to be 8 degrees. When the reading value of sensor A closest to the surface of the terminal device is 26 degrees, and the reading value of sensor B farthest from the surface of the terminal device is 36 degrees, the absolute value of the temperature difference between the two is 10 degrees, greater than 8 degrees, The reading value of sensor A is smaller than the reading value of sensor B, so it can be explained that the user may enter a cooler air-conditioned room from a relatively hot outdoor environment. At this time, the terminal device will output a prompt message to remind the user that the current ambient temperature has greatly increased. increase.

308、根据M个第一温度值得到温度抛物曲线。308. Obtain a temperature parabolic curve according to the M first temperature values.

309、将温度抛物曲线的顶点温度值确定为环境温度值。309. Determine the apex temperature value of the temperature parabolic curve as the ambient temperature value.

310、输出环境温度值。310. Output the ambient temperature value.

本发明实施例中,针对步骤308~310的描述,请参照实施例一中针对步骤102~104的详细描述,本发明实施例不再赘述。In the embodiment of the present invention, for the description of steps 308-310, please refer to the detailed description of steps 102-104 in Embodiment 1, which will not be repeated in this embodiment of the present invention.

需要说明的是,本发明实施例中,303步骤和304~305步骤是针对302步骤的两种不同情况,不会同时出现。306~307步骤和308~310步骤可以是同时发生的,也可以是先进行306~307步骤再进行308~310步骤,也可以是先进行308~310步骤再进行306~307步骤的,本发明实施例不做具体限定。It should be noted that, in the embodiment of the present invention, step 303 and steps 304 to 305 are for two different situations of step 302 and will not appear at the same time. Steps 306 to 307 and steps 308 to 310 can occur simultaneously, or steps 306 to 307 can be performed first and then steps 308 to 310 can be performed, or steps 308 to 310 can be performed first and then steps 306 to 307 can be performed. The present invention Examples are not specifically limited.

类似的,针对307步骤中的输出第三提示消息以及310步骤中的输出环境温度值,可以是同时输出第三提示消息以及环境温度值,也可以是先输出第三提示消息再输出环境温度值,也可以是先输出环境温度值再输出第三提示消息,本发明实施例不做具体限定。Similarly, for the output of the third prompt message in step 307 and the output of the ambient temperature value in step 310, the third prompt message and the ambient temperature value can be output at the same time, or the third prompt message can be output first and then the ambient temperature value can be output , or output the ambient temperature value first and then output the third prompt message, which is not specifically limited in this embodiment of the present invention.

本发明实施例提供一种温度检测方法,先通过获取在恒温环境中,各个传感器的读数值,比较每相邻两个传感器之间的差值,如果差值都小于一定数值可以说明传感器都是准确的,这样可以降低传感器的灵敏度以及终端设备内部微弱的空气流动对检测到的温度值的影响,避免造成最后得到的环境温度值不准确的情况。并且比较距离终端设备表面最近和最远的两个传感器之间的温度值差,可以确定出当前环境温度变化,并直接提醒用户当前环境温度是升高还是降低。The embodiment of the present invention provides a temperature detection method. Firstly, by obtaining the reading values of each sensor in a constant temperature environment, the difference between every two adjacent sensors is compared. If the difference is less than a certain value, it can indicate that the sensors are all Accurately, this can reduce the sensitivity of the sensor and the influence of the weak air flow inside the terminal device on the detected temperature value, so as to avoid the inaccurate environment temperature value obtained finally. And by comparing the temperature difference between the two sensors closest to and farthest from the surface of the terminal device, the change of the current ambient temperature can be determined, and the user can be directly reminded whether the current ambient temperature is rising or falling.

实施例四Embodiment Four

如图4所示,本发明实施例提供一种终端设备,该终端设备包括:As shown in FIG. 4, an embodiment of the present invention provides a terminal device, and the terminal device includes:

获取模块401,用于获取M个传感器的读数值,以得到M个第一温度值,该M个传感器设置在终端设备内部,且不同传感器与终端设备表面的距离不同,其中,M为大于或等于3的整数。The acquiring module 401 is configured to acquire the reading values of M sensors to obtain M first temperature values. The M sensors are arranged inside the terminal device, and the distances between different sensors and the surface of the terminal device are different, wherein M is greater than or An integer equal to 3.

处理模块402,用于判断该M个第一温度值,以及不同传感器与终端设备表面的距离,是否存在正比例关系或反比例关系,以及用于若存在正比例关系,或,反比例关系,根据该M个第一温度值,采用最小二乘法拟合得到温度抛物曲线。The processing module 402 is configured to determine whether the M first temperature values and the distances between the different sensors and the surface of the terminal device have a proportional relationship or an inverse proportional relationship, and if there is a proportional relationship or an inverse proportional relationship, according to the M For the first temperature value, a temperature parabolic curve is obtained by fitting the least square method.

确定模块403,用于将温度抛物曲线的顶点温度值确定为环境温度值。A determination module 403, configured to determine the temperature value at the apex of the temperature parabola curve as the ambient temperature value.

输出模块404,用于输出环境温度值。An output module 404, configured to output the ambient temperature value.

可选的,上述确定模块403,还用于若存在反比例关系,则确定所述终端设备所处环境的温度升高,以及若存在正比例关系,则确定所述终端设备所处环境的温度降低。Optionally, the determination module 403 is further configured to determine that the temperature of the environment where the terminal device is located increases if there is an inverse proportional relationship, and determines that the temperature of the environment where the terminal device is located decreases if there is a direct proportional relationship.

可选的,上述输出模块404,还用于确定终端设备所处环境的温度升高之后,输出第一提示消息,该第一提示消息用于提示终端设备所处环境的温度升高。Optionally, the above-mentioned output module 404 is further configured to output a first prompt message after determining that the temperature of the environment where the terminal device is located has risen. The first prompt message is used to prompt that the temperature of the environment where the terminal device is located has increased.

上述输出模块404,还用于确定终端设备所处环境的温度降低之后,输出第二提示消息,该第二提示消息用于提示终端设备所处环境的温度降低。The above-mentioned output module 404 is further configured to output a second prompt message after determining that the temperature of the environment where the terminal device is located has decreased, and the second prompt message is used to prompt that the temperature of the environment where the terminal device is located has decreased.

可选的,上述获取模块401,还用于在恒温环境中,获取M个传感器的读数值,以得到M个第二温度值。Optionally, the acquisition module 401 is further configured to acquire reading values of M sensors in a constant temperature environment, so as to obtain M second temperature values.

上述处理模块402,还用于根据M个第二温度值,计算相邻设置的两个传感器的温度差值,以得到M-1个第一差值。The above-mentioned processing module 402 is further configured to calculate the temperature difference between two adjacent sensors according to the M second temperature values, so as to obtain M-1 first difference values.

所述获取模块401,还用于若M-1个第一差值均小于第一预设值,获取M个传感器的读数值,以得到M个第一温度值。The obtaining module 401 is further configured to obtain the reading values of M sensors if the M-1 first difference values are all smaller than the first preset value, so as to obtain M first temperature values.

所述处理模块402,还用于若M-1个第一差值中的第二差值大于或等于第一预设值,则根据第三差值所对应的任一第二温度值,校准所有传感器的温度值,第三差值为M-1个第一差值中第二差值以外的任一差值。The processing module 402 is further configured to calibrate according to any second temperature value corresponding to the third difference if the second difference among the M-1 first differences is greater than or equal to the first preset value. For the temperature values of all sensors, the third difference is any difference other than the second difference among the M-1 first differences.

可选的,上述处理模块402,还用于根据M个第一温度值,计算第一目标温度值与第二目标温度值的第四差值,第一目标温度值为与终端设备表面的距离最大的传感器所检测到的第一温度值,第二目标温度值为与终端设备表面的距离最小的传感器所检测到的第一温度值。Optionally, the above-mentioned processing module 402 is further configured to calculate a fourth difference between the first target temperature value and the second target temperature value according to the M first temperature values, where the first target temperature value is the distance from the surface of the terminal device The first temperature value detected by the largest sensor, and the second target temperature value is the first temperature value detected by the sensor with the smallest distance from the surface of the terminal device.

上述输出模块404,还用于若第四差值的绝对值大于第二预设值,则输出第三提示信息,该第三提示信息用于提示用户增减衣物。The above-mentioned output module 404 is further configured to output third prompt information if the absolute value of the fourth difference is greater than the second preset value, and the third prompt information is used to remind the user to add or remove clothes.

本发明实施例中,各模块可以实现上述方法实施例提供的温度检测方法,且能达到相同的技术效果,为避免重复,这里不再赘述。In the embodiment of the present invention, each module can realize the temperature detection method provided by the above method embodiment, and can achieve the same technical effect, so as to avoid repetition, details are not repeated here.

如图5所示,本发明实施例还提供一种终端设备,该终端设备可以包括:As shown in FIG. 5, an embodiment of the present invention also provides a terminal device, which may include:

存储有可执行程序代码的存储器501;A memory 501 storing executable program codes;

与存储器501耦合的处理器502;a processor 502 coupled to the memory 501;

其中,处理器502调用存储器501中存储的可执行程序代码,执行上述各方法实施例中终端设备执行的温度检测方法。Wherein, the processor 502 invokes the executable program code stored in the memory 501 to execute the temperature detection method performed by the terminal device in the above method embodiments.

本发明实施例涉及的终端设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载终端设备设备、可穿戴设备、超级移动个人计算机(Ultra-Mobile Personal Computer,UMPC)、上网本或者个人数字助理(Personal Digital Assistant,PDA)等终端设备。其中,可穿戴设备可以为智能手表、智能手环、电话手表、智能脚环、智能耳环、智能项链、智能耳机等,本发明实施例不作限定。The terminal device involved in the embodiment of the present invention may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle-mounted terminal device, a wearable device, an Ultra-Mobile Personal Computer (Ultra-Mobile Personal Computer, UMPC), a netbook, or a personal digital assistant ( Personal Digital Assistant, PDA) and other terminal equipment. Wherein, the wearable device may be a smart watch, a smart bracelet, a phone watch, a smart anklet, a smart earring, a smart necklace, a smart earphone, etc., which are not limited in the embodiment of the present invention.

如图6所示,本发明实施例还提供一种终端设备,该终端设备包括但不限于:射频(radio frequency,RF)电路601、存储器602、输入单元603、显示单元604、传感器605、音频电路606、WiFi(wireless fidelity,无线通信)模块607、处理器608、电源609、以及摄像头610等部件。其中,射频电路601包括接收器6011和发送器6012。本领域技术人员可以理解,图6中示出的终端设备结构并不构成对终端设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。As shown in FIG. 6, an embodiment of the present invention also provides a terminal device, which includes but is not limited to: a radio frequency (radio frequency, RF) circuit 601, a memory 602, an input unit 603, a display unit 604, a sensor 605, an audio A circuit 606 , a WiFi (wireless fidelity, wireless communication) module 607 , a processor 608 , a power supply 609 , and a camera 610 and other components. Wherein, the radio frequency circuit 601 includes a receiver 6011 and a transmitter 6012 . Those skilled in the art can understand that the structure of the terminal device shown in FIG. 6 does not constitute a limitation on the terminal device, and may include more or less components than those shown in the figure, or combine some components, or arrange different components.

RF电路601可用于收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,给处理器608处理;另外,将设计上行的数据发送给基站。通常,RF电路601包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(low noiseamplifier,LNA)、双工器等。此外,RF电路601还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(globalsystem of mobile communication,GSM)、通用分组无线服务(general packet radioservice,GPRS)、码分多址(code division multiple access,CDMA)、宽带码分多址(wideband code division multiple access,WCDMA)、长期演进(long term evolution,LTE)、电子邮件、短消息服务(short messaging service,SMS)等。The RF circuit 601 can be used for sending and receiving information or receiving and sending signals during a call. In particular, after receiving the downlink information from the base station, it is processed by the processor 608; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit 601 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (low noise amplifier, LNA), a duplexer, and the like. In addition, the RF circuit 601 can also communicate with networks and other devices through wireless communication. The above wireless communication can use any communication standard or protocol, including but not limited to global system of mobile communication (GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access) , CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), long term evolution (long term evolution, LTE), email, short message service (short messaging service, SMS), etc.

存储器602可用于存储软件程序以及模块,处理器608通过运行存储在存储器602的软件程序以及模块,从而执行终端设备的各种功能应用以及数据处理。存储器602可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据终端设备的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器602可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 602 can be used to store software programs and modules, and the processor 608 executes various functional applications and data processing of the terminal device by running the software programs and modules stored in the memory 602 . The memory 602 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playback function, an image playback function, etc.); Data created by the use of terminal equipment (such as audio data, phonebook, etc.), etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices.

输入单元603可用于接收输入的数字或字符信息,以及产生与终端设备的用户设置以及功能控制有关的键信号输入。具体地,输入单元603可包括触控面板6031以及其他输入设备6032。触控面板6031,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板6031上或在触控面板6031附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触控面板6031可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器608,并能接收处理器608发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种实现触控面板6031。除了触控面板6031,输入单元603还可以包括其他输入设备6032。具体地,其他输入设备6032可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。The input unit 603 can be used to receive input numbers or character information, and generate key signal input related to user settings and function control of the terminal device. Specifically, the input unit 603 may include a touch panel 6031 and other input devices 6032 . The touch panel 6031, also referred to as a touch screen, can collect touch operations of the user on or near it (for example, the user uses any suitable object or accessory such as a finger or a stylus on the touch panel 6031 or near the touch panel 6031). operation), and drive the corresponding connection device according to the preset program. Optionally, the touch panel 6031 may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and sends it to the to the processor 608, and can receive and execute commands sent by the processor 608. In addition, the touch panel 6031 can be realized by various methods such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 6031 , the input unit 603 may also include other input devices 6032 . Specifically, other input devices 6032 may include, but are not limited to, one or more of physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, joysticks, and the like.

显示单元604可用于显示由用户输入的信息或提供给用户的信息以及终端设备的各种菜单。显示单元604可包括显示面板6041,可选的,可以采用液晶显示器(liquidcrystal display,LCD)、有机发光二极管(organic light-Emitting diode,OLED)等形式来配置显示面板6041。进一步的,触控面板6031可覆盖显示面板6041,当触控面板6031检测到在其上或附近的触摸操作后,传送给处理器608以确定触摸事件的,随后处理器608根据触摸事件的在显示面板6041上提供相应的视觉输出。虽然在图6中,触控面板6031与显示面板6041是作为两个独立的部件来实现终端设备的输入和输入功能,但是在某些实施例中,可以将触控面板6031与显示面板6041集成而实现终端设备的输入和输出功能。The display unit 604 can be used to display information input by or provided to the user and various menus of the terminal device. The display unit 604 may include a display panel 6041. Optionally, the display panel 6041 may be configured in the form of a liquid crystal display (liquid crystal display, LCD) or an organic light-emitting diode (organic light-Emitting diode, OLED). Further, the touch panel 6031 may cover the display panel 6041, and when the touch panel 6031 detects a touch operation on or near it, it transmits to the processor 608 to determine the touch event, and then the processor 608 determines the touch event according to the touch event. A corresponding visual output is provided on the display panel 6041. Although in FIG. 6, the touch panel 6031 and the display panel 6041 are used as two independent components to realize the input and input functions of the terminal device, in some embodiments, the touch panel 6031 and the display panel 6041 can be integrated And realize the input and output functions of the terminal equipment.

终端设备还可包括至少一种传感器605,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板6041的亮度,接近传感器可在终端设备移动到耳边时,退出显示面板6041和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别终端设备姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于终端设备还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。本发明实施例中,该终端设备可以包括加速度传感器、深度传感器或者距离传感器等。The terminal device may also include at least one sensor 605, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 6041 according to the brightness of the ambient light, and the proximity sensor may exit the display panel 6041 and / or backlighting. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes), and can detect the magnitude and direction of gravity when it is stationary, and can be used for applications that recognize the posture of terminal equipment (such as horizontal and vertical screen switching, Related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tap), etc.; as for the gyroscope, barometer, hygrometer, thermometer, infrared sensor and other sensors that can be configured on the terminal device, here No longer. In this embodiment of the present invention, the terminal device may include an acceleration sensor, a depth sensor, or a distance sensor.

音频电路606、扬声器6061,传声器6062可提供用户与终端设备之间的音频接口。音频电路606可将接收到的音频数据转换后的电信号,传输到扬声器6061,由扬声器6061转换为声音信号输出;另一方面,传声器6062将收集的声音信号转换为电信号,由音频电路606接收后转换为音频数据,再将音频数据输出处理器608处理后,经RF电路601以发送给比如另一终端设备,或者将音频数据输出至存储器602以便进一步处理。The audio circuit 606, the speaker 6061, and the microphone 6062 can provide an audio interface between the user and the terminal device. The audio circuit 606 can transmit the electrical signal converted from the received audio data to the speaker 6061, and the speaker 6061 converts it into an audio signal for output; After being received, it is converted into audio data, and then the audio data is processed by the output processor 608, and then sent to another terminal device through the RF circuit 601, or the audio data is output to the memory 602 for further processing.

WiFi属于短距离无线传输技术,终端设备通过WiFi模块607可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图6示出了WiFi模块607,但是可以理解的是,其并不属于终端设备的必须构成,完全可以根据需要在不改变发明的本质的范围内而省略。WiFi is a short-distance wireless transmission technology. Through the WiFi module 607, terminal equipment can help users send and receive emails, browse web pages, and access streaming media. It provides users with wireless broadband Internet access. Although FIG. 6 shows a WiFi module 607, it can be understood that it is not a necessary component of the terminal device, and can be omitted according to needs without changing the essence of the invention.

处理器608是终端设备的控制中心,利用各种接口和线路连接整个终端设备的各个部分,通过运行或执行存储在存储器602内的软件程序和/或模块,以及调用存储在存储器602内的数据,执行终端设备的各种功能和处理数据,从而对终端设备进行整体监控。可选的,处理器608可包括一个或多个处理单元;优选的,处理器608可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器608中。The processor 608 is the control center of the terminal equipment. It uses various interfaces and lines to connect various parts of the entire terminal equipment. By running or executing software programs and/or modules stored in the memory 602, and calling data stored in the memory 602 , execute various functions of the terminal equipment and process data, so as to monitor the terminal equipment as a whole. Optionally, the processor 608 may include one or more processing units; preferably, the processor 608 may integrate an application processor and a modem processor, wherein the application processor mainly processes operating systems, user interfaces, and application programs, etc. , the modem processor mainly handles wireless communications. It can be understood that the foregoing modem processor may not be integrated into the processor 608 .

终端设备还包括给各个部件供电的电源609(比如电池),优选的,电源可以通过电源管理系统与处理器608逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。尽管未示出,终端设备还可以包括蓝牙模块等,在此不再赘述。The terminal device also includes a power supply 609 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 608 through the power management system, so that functions such as charging, discharging, and power consumption management can be implemented through the power management system. Although not shown, the terminal device may also include a Bluetooth module, etc., which will not be repeated here.

本发明实施例中,处理器608,用于获取M个传感器的读数值,以得到M个第一温度值,M个传感器设置在终端设备内部,且不同传感器与终端设备表面的距离不同,其中,M为大于或等于3的整数;In the embodiment of the present invention, the processor 608 is configured to obtain the reading values of M sensors to obtain M first temperature values, and the M sensors are arranged inside the terminal device, and the distances between different sensors and the surface of the terminal device are different, wherein , M is an integer greater than or equal to 3;

判断M个第一温度值,以及不同传感器与终端设备表面的距离,是否存在正比例关系或反比例关系;Judging whether there is a direct proportional relationship or an inverse proportional relationship between the M first temperature values and the distance between different sensors and the surface of the terminal device;

若存在正比例关系,或,反比例关系,根据M个第一温度值,采用最小二乘法拟合得到温度抛物曲线;If there is a direct proportional relationship, or an inverse proportional relationship, according to the M first temperature values, the temperature parabolic curve is obtained by fitting the least squares method;

将温度抛物曲线的顶点温度值确定为环境温度值;Determine the apex temperature value of the temperature parabolic curve as the ambient temperature value;

输出环境温度值。Output the ambient temperature value.

可选的,上述处理器608还可以用于实现上述方法实施例中终端设备所实现的其他过程。Optionally, the foregoing processor 608 may also be configured to implement other processes implemented by the terminal device in the foregoing method embodiments.

本发明实施例提供一种计算机可读存储介质,其存储计算机程序,其中,该计算机程序使得计算机执行如以上各方法实施例中的方法的部分或全部步骤。An embodiment of the present invention provides a computer-readable storage medium, which stores a computer program, wherein the computer program causes a computer to execute some or all steps of the methods in the above method embodiments.

本发明实施例还提供一种计算机程序产品,其中,当计算机程序产品在计算机上运行时,使得计算机执行如以上各方法实施例中的方法的部分或全部步骤。An embodiment of the present invention also provides a computer program product, wherein, when the computer program product is run on a computer, the computer is made to perform some or all of the steps of the methods in the above method embodiments.

本发明实施例还提供一种应用发布平台,其中,应用发布平台用于发布计算机程序产品,其中,当计算机程序产品在计算机上运行时,使得计算机执行如以上各方法实施例中的方法的部分或全部步骤。An embodiment of the present invention also provides an application distribution platform, wherein the application distribution platform is used to distribute computer program products, wherein, when the computer program products are run on the computer, the computer is made to execute the part of the method in the above method embodiments or all steps.

应理解,说明书通篇中提到的“一个实施例”或“一实施例”意味着与实施例有关的特定特征、结构或特性包括在本发明的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”未必一定指相同的实施例。此外,这些特定特征、结构或特性可以以任意适合的方式结合在一个或多个实施例中。本领域技术人员也应该知悉,说明书中所描述的实施例均属于可选实施例,所涉及的动作和模块并不一定是本发明所必须的。It should be understood that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic related to the embodiment is included in at least one embodiment of the present invention. Thus, appearances of "in one embodiment" or "in an embodiment" in various places throughout the specification are not necessarily referring to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments. Those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present invention.

本发明实施例提供的终端设备能够实现上述方法实施例中所示的各个过程,为避免重复,此处不再赘述。The terminal device provided by the embodiment of the present invention can implement each process shown in the above method embodiment, and to avoid repetition, details are not repeated here.

在本发明的各种实施例中,应理解,上述各过程的序号的大小并不意味着执行顺序的必然先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。In various embodiments of the present invention, it should be understood that the sequence numbers of the above-mentioned processes do not necessarily mean the order of execution, and the execution order of each process should be determined by its functions and internal logic, and should not be used in the implementation of the present invention. The implementation of the examples constitutes no limitation.

上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物单元,即可位于一个地方,或者也可以分布到多个网络单元上。可根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, located in one place, or distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本发明各实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

上述集成的单元若以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可获取的存储器中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或者部分,可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储器中,包括若干请求用以使得一台计算机设备(可以为个人计算机、服务器或者网络设备等,具体可以是计算机设备中的处理器)执行本发明的各个实施例上述方法的部分或全部步骤。If the above-mentioned integrated units are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-accessible memory. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a memory , including several requests to make a computer device (which may be a personal computer, server, or network device, etc., specifically, a processor in the computer device) execute some or all of the steps of the above-mentioned methods in various embodiments of the present invention.

本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质包括只读存储器(Read-Only Memory,ROM)、随机存储器(Random Access Memory,RAM)、可编程只读存储器(Programmable Read-only Memory,PROM)、可擦除可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、一次可编程只读存储器(One-time Programmable Read-Only Memory,OTPROM)、电子抹除式可复写只读存储器(Electrically-Erasable Programmable Read-Only Memory,EEPROM)、只读光盘(CompactDisc Read-Only Memory,CD-ROM)或其他光盘存储器、磁盘存储器、磁带存储器、或者能够用于携带或存储数据的计算机可读的任何其他介质。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above-mentioned embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium includes read-only Memory (Read-Only Memory, ROM), Random Access Memory (Random Access Memory, RAM), Programmable Read-Only Memory (Programmable Read-only Memory, PROM), Erasable Programmable Read-Only Memory (Erasable Programmable Read Only Memory, EPROM), One-time Programmable Read-Only Memory (OTPROM), Electronically Erasable Programmable Read-Only Memory (EEPROM), Compact Disc Read-Only Memory (CompactDisc Read -Only Memory, CD-ROM) or other optical disk storage, magnetic disk storage, tape storage, or any other computer-readable medium that can be used to carry or store data.

Claims (12)

1.一种温度检测方法,其特征在于,包括:1. A temperature detection method, characterized in that, comprising: 获取M个传感器的读数值,以得到M个第一温度值,所述M个传感器设置在终端设备内部,且不同传感器与所述终端设备表面的距离不同,其中,M为大于或等于3的整数;Obtain the reading values of M sensors to obtain M first temperature values, the M sensors are arranged inside the terminal device, and the distances between different sensors and the surface of the terminal device are different, where M is greater than or equal to 3 integer; 判断所述M个第一温度值,以及所述不同传感器与所述终端设备表面的距离,是否存在正比例关系或反比例关系;judging whether there is a direct proportional relationship or an inverse proportional relationship between the M first temperature values and the distance between the different sensors and the surface of the terminal device; 若存在正比例关系,或,反比例关系,根据所述M个第一温度值以及所述M个传感器与所述终端设备表面的距离,采用最小二乘法拟合得到温度抛物曲线;If there is a direct proportional relationship, or an inverse proportional relationship, according to the M first temperature values and the distance between the M sensors and the surface of the terminal device, a temperature parabolic curve is obtained by fitting a least squares method; 将所述温度抛物曲线的顶点温度值确定为环境温度值;determining the apex temperature value of the temperature parabolic curve as the ambient temperature value; 输出所述环境温度值。Output the ambient temperature value. 2.根据权利要求1所述的方法,其特征在于,所述判断所述M个第一温度值,以及所述不同传感器与所述终端设备表面的距离,是否存在正比例关系或反比例关系之后,所述方法还包括:2. The method according to claim 1, characterized in that, after determining whether the M first temperature values and the distances between the different sensors and the surface of the terminal device exist in a direct proportional relationship or an inverse proportional relationship, The method also includes: 若存在反比例关系,则确定所述终端设备所处环境的温度升高;If there is an inverse proportional relationship, then determine that the temperature of the environment where the terminal device is located increases; 若存在正比例关系,则确定所述终端设备所处环境的温度降低。If there is a direct proportional relationship, it is determined that the temperature of the environment where the terminal device is located decreases. 3.根据权利要求2所述的方法,其特征在于,所述确定终端设备所处环境的温度升高之后,所述方法还包括:3. The method according to claim 2, wherein after determining that the temperature of the environment where the terminal device is located rises, the method further comprises: 输出第一提示消息,所述第一提示消息用于提示所述终端设备所处环境的温度升高;Outputting a first prompt message, where the first prompt message is used to prompt that the temperature of the environment where the terminal device is located increases; 所述确定终端设备所处环境的温度降低之后,所述方法还包括:After it is determined that the temperature of the environment where the terminal device is located decreases, the method further includes: 输出第二提示消息,所述第二提示消息用于提示所述终端设备所处环境的温度降低。Outputting a second prompt message, where the second prompt message is used to prompt that the temperature of the environment where the terminal device is located drops. 4.根据权利要求1所述的方法,其特征在于,所述获取M个传感器的读数值,以得到M个第一温度值之前,还包括:4. The method according to claim 1, characterized in that, before obtaining the reading values of M sensors, to obtain M first temperature values, further comprising: 在恒温环境中,获取所述M个传感器的读数值,以得到M个第二温度值;In a constant temperature environment, acquire the reading values of the M sensors to obtain M second temperature values; 根据所述M个第二温度值,计算相邻设置的两个传感器的温度差值,以得到M-1个第一差值;Calculate the temperature difference between two adjacent sensors according to the M second temperature values to obtain M-1 first differences; 所述获取M个传感器的读数值,以得到M个第一温度值,包括:The acquisition of the reading values of M sensors to obtain M first temperature values includes: 若所述M-1个第一差值均小于第一预设值,获取所述M个传感器的读数值,以得到M个第一温度值;If the M-1 first difference values are all smaller than the first preset value, acquiring the reading values of the M sensors to obtain M first temperature values; 或者,or, 若所述M-1个第一差值中的第二差值大于或等于第一预设值,则根据第三差值所对应的任一第二温度值,校准所有传感器的温度值,所述第三差值为所述M-1个第一差值中所述第二差值以外的任一差值。If the second difference among the M-1 first differences is greater than or equal to the first preset value, the temperature values of all sensors are calibrated according to any second temperature value corresponding to the third difference, so The third difference is any difference other than the second difference among the M-1 first differences. 5.根据权利要求1所述的方法,其特征在于,所述获取M个传感器的读数值,以得到M个第一温度值之后,还包括:5. The method according to claim 1, characterized in that, after obtaining the reading values of M sensors to obtain M first temperature values, further comprising: 根据所述M个第一温度值,计算第一目标温度值与第二目标温度值的第四差值,所述第一目标温度值为与所述终端设备表面的距离最大的传感器所检测到的第一温度值,所述第二目标温度值为与所述终端设备表面的距离最小的传感器所检测到的第一温度值;Calculate a fourth difference between the first target temperature value and the second target temperature value according to the M first temperature values, where the first target temperature value is detected by the sensor with the largest distance from the surface of the terminal device the first temperature value, the second target temperature value is the first temperature value detected by the sensor with the smallest distance from the surface of the terminal device; 若所述第四差值的绝对值大于第二预设值,则输出第三提示信息,所述第三提示信息用于提示用户增减衣物。If the absolute value of the fourth difference is greater than the second preset value, output third prompt information, the third prompt information is used to prompt the user to add or remove clothes. 6.一种终端设备,其特征在于,包括:6. A terminal device, characterized in that, comprising: 获取模块,用于获取M个传感器的读数值,以得到M个第一温度值,所述M个传感器设置在终端设备内部,且不同传感器与所述终端设备表面的距离不同,其中,M为大于或等于3的整数;An acquisition module, configured to acquire readings of M sensors to obtain M first temperature values, the M sensors are arranged inside the terminal device, and the distances between different sensors and the surface of the terminal device are different, where M is an integer greater than or equal to 3; 处理模块,用于判断所述M个第一温度值,以及所述不同传感器与所述终端设备表面的距离,是否存在正比例关系或反比例关系,以及用于若存在正比例关系,或,反比例关系,根据所述M个第一温度值以及所述M个传感器与所述终端设备表面的距离,采用最小二乘法拟合得到温度抛物曲线;A processing module, configured to determine whether there is a proportional relationship or an inverse proportional relationship between the M first temperature values and the distance between the different sensors and the surface of the terminal device, and if there is a proportional relationship or an inverse proportional relationship, According to the M first temperature values and the distances between the M sensors and the surface of the terminal device, a temperature parabolic curve is obtained by fitting using a least squares method; 确定模块,用于将所述温度抛物曲线的顶点温度值确定为环境温度值;A determination module, configured to determine the temperature value at the apex of the temperature parabolic curve as the ambient temperature value; 输出模块,用于输出所述环境温度值。An output module, configured to output the ambient temperature value. 7.根据权利要求6所述的终端设备,其特征在于,7. The terminal device according to claim 6, characterized in that, 所述确定模块,还用于若存在反比例关系,则确定所述终端设备所处环境的温度升高,以及若存在正比例关系,则确定所述终端设备所处环境的温度降低。The determining module is further configured to determine that the temperature of the environment where the terminal device is located increases if there is an inverse proportional relationship, and determines that the temperature of the environment where the terminal device is located decreases if there is a direct proportional relationship. 8.根据权利要求7所述的终端设备,其特征在于,8. The terminal device according to claim 7, characterized in that, 所述输出模块,还用于确定终端设备所处环境的温度升高之后,输出第一提示消息,所述第一提示消息用于提示所述终端设备所处环境的温度升高;The output module is further configured to output a first prompt message after determining that the temperature of the environment where the terminal device is located has risen, and the first prompt message is used to prompt that the temperature of the environment where the terminal device is located has increased; 所述输出模块,还用于确定终端设备所处环境的温度降低之后,输出第二提示消息,所述第二提示消息用于提示所述终端设备所处环境的温度降低。The output module is further configured to output a second prompt message after it is determined that the temperature of the environment where the terminal device is located has decreased, and the second prompt message is used to prompt that the temperature of the environment where the terminal device is located has decreased. 9.根据权利要求6所述的终端设备,其特征在于,9. The terminal device according to claim 6, characterized in that, 所述获取模块,还用于在恒温环境中,获取所述M个传感器的读数值,以得到M个第二温度值;The acquiring module is further configured to acquire the reading values of the M sensors in a constant temperature environment, so as to obtain M second temperature values; 所述处理模块,还用于根据所述M个第二温度值,计算相邻设置的两个传感器的温度差值,以得到M-1个第一差值;The processing module is further configured to calculate the temperature difference between two adjacent sensors according to the M second temperature values, so as to obtain M-1 first differences; 所述获取模块,还用于若所述M-1个第一差值均小于第一预设值,获取所述M个传感器的读数值,以得到M个第一温度值;The obtaining module is further configured to obtain the reading values of the M sensors if the M-1 first difference values are all smaller than the first preset value, so as to obtain M first temperature values; 所述处理模块,还用于若所述M-1个第一差值中的第二差值大于或等于第一预设值,则根据第三差值所对应的任一第二温度值,校准所有传感器的温度值,所述第三差值为所述M-1个第一差值中所述第二差值以外的任一差值。The processing module is further configured to: if the second difference among the M-1 first differences is greater than or equal to the first preset value, according to any second temperature value corresponding to the third difference, The temperature values of all sensors are calibrated, and the third difference is any difference other than the second difference among the M-1 first differences. 10.根据权利要求6所述的终端设备,其特征在于,10. The terminal device according to claim 6, characterized in that, 所述处理模块,还用于根据所述M个第一温度值,计算第一目标温度值与第二目标温度值的第四差值,所述第一目标温度值为与所述终端设备表面的距离最大的传感器所检测到的第一温度值,所述第二目标温度值为与所述终端设备表面的距离最小的传感器所检测到的第一温度值;The processing module is further configured to calculate a fourth difference between a first target temperature value and a second target temperature value according to the M first temperature values, where the first target temperature value is the same as that on the surface of the terminal device The first temperature value detected by the sensor with the largest distance, the second target temperature value is the first temperature value detected by the sensor with the smallest distance from the surface of the terminal device; 所述输出模块,还用于若所述第四差值的绝对值大于第二预设值,则输出第三提示信息,所述第三提示信息用于提示用户增减衣物。The output module is further configured to output third prompt information if the absolute value of the fourth difference is greater than a second preset value, and the third prompt information is used to prompt the user to add or remove clothes. 11.一种计算机可读存储介质,其特征在于,包括:所述计算机可读存储介质上存储计算机指令,所述计算机指令被处理器执行时实现如权利要求1至5任一项所述的温度检测方法。11. A computer-readable storage medium, comprising: computer instructions are stored on the computer-readable storage medium, and when the computer instructions are executed by a processor, the method according to any one of claims 1 to 5 is realized. temperature detection method. 12.一种计算机程序产品,其特征在于,包括:所述计算机程序产品包括计算机指令,当所述计算机程序产品在处理器上运行时,使得所述处理器执行所述计算机指令,以实现如权利要求1至5任一项所述的温度检测方法。12. A computer program product, characterized in that it comprises: the computer program product includes computer instructions, and when the computer program product runs on a processor, the processor executes the computer instructions to implement the following: The temperature detection method described in any one of claims 1 to 5.
CN202011046068.5A 2020-09-28 2020-09-28 A temperature detection method and terminal equipment Active CN112414587B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011046068.5A CN112414587B (en) 2020-09-28 2020-09-28 A temperature detection method and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011046068.5A CN112414587B (en) 2020-09-28 2020-09-28 A temperature detection method and terminal equipment

Publications (2)

Publication Number Publication Date
CN112414587A CN112414587A (en) 2021-02-26
CN112414587B true CN112414587B (en) 2023-01-24

Family

ID=74855326

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011046068.5A Active CN112414587B (en) 2020-09-28 2020-09-28 A temperature detection method and terminal equipment

Country Status (1)

Country Link
CN (1) CN112414587B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113866536B (en) * 2021-09-07 2024-08-23 深圳Tcl数字技术有限公司 Temperature rise detection method, device and temperature rise detection system
CN113867460B (en) * 2021-11-10 2022-05-17 成都捷豹恒昌电气有限公司 Temperature and humidity monitoring and treatment method and system for transformer substation
CN114646405B (en) * 2022-03-18 2025-08-19 深圳市金研微科技有限公司 Device and algorithm for indirectly measuring external environment temperature
CN116045441A (en) * 2023-01-10 2023-05-02 龙岩烟草工业有限责任公司 Method and device for detecting and processing dew point temperature of air conditioner and storage medium
CN117249921B (en) * 2023-11-15 2024-04-05 宁德时代新能源科技股份有限公司 Abnormal identification method for temperature sampling, related device, vehicle and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
ITMI20050772A1 (en) * 2005-04-29 2006-10-30 Tecnimed Srl EQUIPMENT FOR TEMPERATURE MEASUREMENT IN PARTICULAR OF A PATIENT
US7556423B2 (en) * 2007-01-08 2009-07-07 Microchip Technology Incorporated Temperature sensor bow compensation
DE102009030206A1 (en) * 2009-06-22 2010-12-30 Beru Ag Method for determining the exhaust gas temperature of a vehicle engine
CN108155592A (en) * 2018-02-05 2018-06-12 杭州小橙工业设计有限公司 A kind of substation of remote monitoring
CN110501094A (en) * 2019-09-05 2019-11-26 珠海格力电器股份有限公司 Fault detection and calibration method for electric appliance temperature sensor, air conditioner and computer readable storage medium
CN111562023B (en) * 2020-05-22 2021-10-08 上海红檀智能科技有限公司 Comprehensive monitoring and early warning device and early warning method for equipment temperature in wind farm box-changing warehouse

Also Published As

Publication number Publication date
CN112414587A (en) 2021-02-26

Similar Documents

Publication Publication Date Title
CN112414587B (en) A temperature detection method and terminal equipment
US20180275716A1 (en) Wearable device, master device operating with the wearable device, and control method for wearable device
CN106412249B (en) Drop information detection method and device
CN110389640B (en) A kind of heat dissipation method and mobile terminal
CN108877741A (en) A kind of screen luminance adjustment method and terminal device
KR102304260B1 (en) Method for determining location, electronic apparatus and storage medium
CN108900714A (en) A kind of reminding method and terminal
CN112415554B (en) Positioning method and device, electronic equipment and computer readable storage medium
CN107153537B (en) Information display method and device based on multi-task interface and mobile terminal
CN106487984B (en) A kind of method and apparatus adjusting volume
CN112312308B (en) Indoor positioning method and terminal equipment
US9699595B2 (en) Method and wearable device for interworking with a portable terminal
CN112187998B (en) A drop reminder method and terminal device
CN109995933A (en) The method and terminal device of the alarm clock of controlling terminal equipment
CN107103074B (en) Processing method of shared information and mobile terminal
WO2018157519A1 (en) Message notification method and terminal
CN110767950A (en) Charging method, device, terminal device and computer-readable storage medium
WO2019061276A1 (en) Signal quality alert method, terminal and server
CN111399792B (en) A content sharing method and electronic device
CN112414370B (en) Building floor positioning method, electronic equipment and computer storage medium
CN111221602A (en) Interface display method and electronic equipment
CN112968992B (en) Dynamic distance prompting method and terminal equipment
CN110471711A (en) Application program pre-add support method and terminal device
CN111159551B (en) User-generated content display method and device and computer equipment
CN111309392A (en) Device control method and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant