










技术领域technical field
本公开涉及检测技术领域,尤其涉及一种显示状态控制方法和装置、电子设备、存储介质。The present disclosure relates to the field of detection technology, and in particular, to a display state control method and apparatus, electronic equipment, and storage medium.
背景技术Background technique
目前,部分用户会在手机外部安装一个皮套,以防止手机被摔坏或者划伤。皮套包括一个可折叠的上盖,该上盖中设置一块磁铁,通过吸附安装在皮套上指定位置的金属,达到闭合上盖以及覆盖手机显示屏的效果。当上盖被闭合时,设置在手机中的霍尔传感器会感应到磁铁的磁场即检测到磁通量增多,此时手机确定皮套的上盖闭合,可以关闭显示屏以节省用电量。At present, some users will install a leather case on the outside of the phone to prevent the phone from being broken or scratched. The leather case includes a foldable upper cover, and a magnet is arranged in the upper cover, and the effect of closing the upper cover and covering the display screen of the mobile phone is achieved by attracting the metal installed on the designated position on the leather case. When the top cover is closed, the Hall sensor installed in the mobile phone will sense the magnetic field of the magnet and detect the increase in magnetic flux. At this time, the mobile phone determines that the top cover of the leather case is closed, and the display screen can be turned off to save power consumption.
然而,实际应用中,手机可能处于强磁场环境,导致霍尔传感器检测到磁通量增多而误关闭显示屏,影响用户使用;或者,上盖中磁铁消磁,导致霍尔传感器检测不到足够多的磁通量而保持亮屏,进而浪费电能。However, in practical applications, the mobile phone may be in a strong magnetic field environment, which may cause the Hall sensor to detect an increase in magnetic flux and turn off the display by mistake, which affects the user's use; or, the magnet in the upper cover is demagnetized, so that the Hall sensor cannot detect enough magnetic flux. And keep the screen bright, thus wasting power.
发明内容SUMMARY OF THE INVENTION
本公开提供一种显示状态控制方法和装置、电子设备、存储介质,以解决相关技术的不足。The present disclosure provides a display state control method and device, an electronic device, and a storage medium to solve the deficiencies of the related art.
根据本公开实施例的第一方面,提供一种显示状态控制方法,应用于设置有显示屏的电子设备,包括:According to a first aspect of the embodiments of the present disclosure, there is provided a display state control method, which is applied to an electronic device provided with a display screen, including:
获取霍尔传感器所采集的磁感数据;Obtain the magnetic sensing data collected by the Hall sensor;
响应于所述磁感数据超过预设的磁感应阈值,获取预设传感器所采集的传感数据;Acquiring sensing data collected by a preset sensor in response to the magnetic sensing data exceeding a preset magnetic sensing threshold;
基于所述传感数据控制所述电子设备中显示屏的显示状态。The display state of the display screen in the electronic device is controlled based on the sensing data.
可选地,基于所述传感数据控制所述电子设备中显示屏的显示状态,包括:Optionally, controlling the display state of the display screen in the electronic device based on the sensing data includes:
确定所述传感数据是否满足第一预设条件,得到确定结果;determining whether the sensing data satisfies a first preset condition, and obtaining a determination result;
当所述确定结果表征所述传感数据满足所述第一预设条件时,控制电子设备的显示屏切换到关闭状态;当所述确定结果表征所述传感数据不满足所述第一预设条件时,控制所述显示屏保持显示状态。When the determination result indicates that the sensing data meets the first preset condition, the display screen of the control electronic device is switched to an off state; when the determination result indicates that the sensing data does not meet the first preset condition When the conditions are set, the display screen is controlled to keep the display state.
可选地,所述预设传感器包括以下至少一种:距离传感器、光线传感器。Optionally, the preset sensor includes at least one of the following: a distance sensor and a light sensor.
可选地,所述第一预设条件包括以下至少一种:距离值小于或者等于预设距离值,当前光感值小于或等于预设光感值。Optionally, the first preset condition includes at least one of the following: the distance value is less than or equal to the preset distance value, and the current light sensitivity value is less than or equal to the preset light sensitivity value.
可选地,当确定结果表征所述传感数据不满足所述第一预设条件之后,所述方法还包括:Optionally, after the determination result indicates that the sensing data does not meet the first preset condition, the method further includes:
生成提醒信息,所述提醒信息用于提醒所述电子设备处于强磁场环境中。Generating reminder information, where the reminder information is used to remind the electronic device to be in a strong magnetic field environment.
可选地,所述方法还包括调整所述霍尔传感器的磁感应阈值的步骤,具体包括:Optionally, the method further includes the step of adjusting the magnetic induction threshold of the Hall sensor, specifically including:
获取所述霍尔传感器所采集的当前磁感数据;obtaining the current magnetic induction data collected by the Hall sensor;
当所述当前磁感数据满足第二预设条件时,将所述霍尔传感器的磁感应阈值调整为第一磁感应阈值。When the current magnetic induction data satisfies the second preset condition, the magnetic induction threshold of the Hall sensor is adjusted to the first magnetic induction threshold.
可选地,所述第二预设条件包括以下至少一种:当前磁感数据为霍尔传感器所采集的磁感数据的最大值且该当前磁感数据小于预设的磁感应阈值,当前磁感数据之前预设时间段内的磁感数据均小于预设的磁感应阈值。Optionally, the second preset condition includes at least one of the following: the current magnetic induction data is the maximum value of the magnetic induction data collected by the Hall sensor and the current magnetic induction data is less than a preset magnetic induction threshold, the current magnetic induction The magnetic induction data in the preset time period before the data are all smaller than the preset magnetic induction threshold.
可选地,将所述霍尔传感器的磁感应阈值调整为第一磁感应阈值,包括:Optionally, adjusting the magnetic induction threshold of the Hall sensor to the first magnetic induction threshold, including:
获取所述霍尔传感器的使用时长;Obtain the usage time of the Hall sensor;
基于预设的时长和磁感数据的对应关系表,确定所述使用时长对应的第一磁感数据,将所述第一磁感数据作为所述第一阈值;determining the first magnetic induction data corresponding to the use duration based on a preset correspondence table between the duration and the magnetic induction data, and using the first magnetic induction data as the first threshold;
将所述霍尔传感器的磁感应阈值调整为所述第一磁感应阈值。The magnetic induction threshold of the Hall sensor is adjusted to the first magnetic induction threshold.
可选地,将所述霍尔传感器的磁感应阈值调整为第一磁感应阈值,包括:Optionally, adjusting the magnetic induction threshold of the Hall sensor to the first magnetic induction threshold, including:
获取所述当前磁感数据之前预设时间段内的磁感数据的平均值,将所述平均值作为第一磁感应阈值;acquiring an average value of magnetic induction data within a preset time period before the current magnetic induction data, and using the average value as a first magnetic induction threshold;
将所述霍尔传感器的磁感应阈值调整为所述第一磁感应阈值。The magnetic induction threshold of the Hall sensor is adjusted to the first magnetic induction threshold.
根据本公开实施例的第二方面,提供一种显示状态控制装置,应用于设置有显示屏的电子设备,包括:According to a second aspect of the embodiments of the present disclosure, there is provided a display state control apparatus, which is applied to an electronic device provided with a display screen, including:
磁感数据获取模块,用于获取霍尔传感器所采集的磁感数据;The magnetic induction data acquisition module is used to obtain the magnetic induction data collected by the Hall sensor;
传感数据获取模块,用于响应于所述磁感数据超过预设的磁感应阈值,获取预设传感器所采集的传感数据;a sensing data acquisition module, configured to acquire sensing data collected by a preset sensor in response to the magnetic sensing data exceeding a preset magnetic sensing threshold;
显示状态控制模块,用于基于所述传感数据控制所述电子设备中显示屏的显示状态。The display state control module is used for controlling the display state of the display screen in the electronic device based on the sensing data.
可选地,所述显示状态控制模块包括:Optionally, the display state control module includes:
确定结果获取单元,用于确定所述传感数据是否满足第一预设条件,得到确定结果;a determination result obtaining unit, configured to determine whether the sensing data satisfies a first preset condition, and obtain a determination result;
显示状态控制单元,用于当所述确定结果表征所述传感数据满足所述第一预设条件时,控制电子设备的显示屏切换到关闭状态;当所述确定结果表征所述传感数据不满足所述第一预设条件时,控制所述显示屏保持显示状态。a display state control unit, configured to control the display screen of the electronic device to switch to an off state when the determination result represents that the sensing data meets the first preset condition; when the determination result represents the sensing data When the first preset condition is not satisfied, the display screen is controlled to maintain the display state.
可选地,所述预设传感器包括以下至少一种:距离传感器、光线传感器。Optionally, the preset sensor includes at least one of the following: a distance sensor and a light sensor.
可选地,所述第一预设条件包括以下至少一种:距离值小于或者等于预设距离值,当前光感值小于或等于预设光感值。Optionally, the first preset condition includes at least one of the following: the distance value is less than or equal to the preset distance value, and the current light sensitivity value is less than or equal to the preset light sensitivity value.
所述显示状态控制模块包括:The display state control module includes:
提醒信息生成单元,用于生成提醒信息,所述提醒信息用于提醒所述电子设备处于强磁场环境中。A reminder information generating unit, configured to generate reminder information, where the reminder information is used to remind the electronic device to be in a strong magnetic field environment.
可选地,所述装置还包括磁感阈值调整模块;所述磁感阈值调整模块包括:Optionally, the device further includes a magnetic induction threshold adjustment module; the magnetic induction threshold adjustment module includes:
当前值获取单元,用于获取所述霍尔传感器所采集的当前磁感数据;The current value acquisition unit is used to acquire the current magnetic induction data collected by the Hall sensor;
阈值调整单元,用于当所述当前磁感数据满足第二预设条件时,将所述霍尔传感器的磁感应阈值调整为第一磁感应阈值。A threshold adjustment unit, configured to adjust the magnetic induction threshold of the Hall sensor to a first magnetic induction threshold when the current magnetic induction data satisfies a second preset condition.
可选地,所述第二预设条件包括以下至少一种:当前磁感数据为霍尔传感器所采集的磁感数据的最大值且该当前磁感数据小于预设的磁感应阈值,当前磁感数据之前预设时间段内的磁感数据均小于预设的磁感应阈值。Optionally, the second preset condition includes at least one of the following: the current magnetic induction data is the maximum value of the magnetic induction data collected by the Hall sensor and the current magnetic induction data is less than a preset magnetic induction threshold, the current magnetic induction The magnetic induction data in the preset time period before the data are all smaller than the preset magnetic induction threshold.
可选地,所述阈值调整单元包括:Optionally, the threshold adjustment unit includes:
使用时长获取子单元,用于获取所述霍尔传感器的使用时长;a use duration acquisition subunit for acquiring the use duration of the Hall sensor;
第一阈值确定子单元,用于基于预设的时长和磁感数据的对应关系表,确定所述使用时长对应的第一磁感数据,将所述第一磁感数据作为所述第一阈值;a first threshold determination subunit, configured to determine the first magnetic induction data corresponding to the use duration based on a preset correspondence table of duration and magnetic induction data, and use the first magnetic induction data as the first threshold ;
阈值调整子单元,用于将所述霍尔传感器的磁感应阈值调整为所述第一磁感应阈值。The threshold adjustment subunit is used to adjust the magnetic induction threshold of the Hall sensor to the first magnetic induction threshold.
可选地,所述阈值调整单元包括:Optionally, the threshold adjustment unit includes:
平均值获取子单元,用于获取所述当前磁感数据之前预设时间段内的磁感数据的平均值,将所述平均值作为所述第一阈值;an average value acquisition subunit, configured to acquire the average value of the magnetic induction data in a preset time period before the current magnetic induction data, and use the average value as the first threshold;
阈值调整子单元,用于将所述霍尔传感器的磁感应阈值调整为所述第一磁感应阈值。The threshold adjustment subunit is used to adjust the magnetic induction threshold of the Hall sensor to the first magnetic induction threshold.
根据本公开实施例的第三方面,提供一种电子设备,包括:According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, comprising:
霍尔传感器和预设传感器;所述预设传感器包括以下至少一种:距离传感器、光线传感器;A hall sensor and a preset sensor; the preset sensor includes at least one of the following: a distance sensor, a light sensor;
处理器;processor;
用于存储所述处理器可执行的计算机程序的存储器;a memory for storing a computer program executable by the processor;
所述处理器被配置为执行所述存储器中的计算机程序以实现上述任一项所述方法的步骤。The processor is configured to execute a computer program in the memory to implement the steps of any of the methods described above.
根据本公开实施例的第四方面,提供一种可读存储介质,其上存储有可执行的计算机程序,该计算机程序被执行时实现上述所述方法的步骤。According to a fourth aspect of the embodiments of the present disclosure, there is provided a readable storage medium on which an executable computer program is stored, and when the computer program is executed, the steps of the above-described method are implemented.
本公开的实施例提供的技术方案可以包括以下有益效果:The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:
由上述实施例可知,本公开实施例中通过获取霍尔传感器所采集的磁感数据,并响应于所述磁感数据超过预设的磁感应阈值,获取预设传感器所采集的传感数据;基于所述传感数据控制所述电子设备中显示屏的显示状态。本实施例中,通过预设传感器的传感数据来辅助判断霍尔传感器控制显示屏的显示状态,使显示屏的关闭状态和亮屏状态能够与使用场景相匹配,可以提高控制的准确度,有利于提升使用体验。It can be seen from the above embodiments that in the embodiments of the present disclosure, the magnetic sensing data collected by the Hall sensor is obtained, and in response to the magnetic sensing data exceeding the preset magnetic sensing threshold, the sensing data collected by the preset sensor is obtained; based on The sensing data controls the display state of the display screen in the electronic device. In this embodiment, the sensor data of the preset sensor is used to assist in judging the display state of the display screen controlled by the Hall sensor, so that the closed state and the bright screen state of the display screen can be matched with the usage scene, which can improve the control accuracy. Conducive to improve the user experience.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description serve to explain the principles of the disclosure.
图1是根据一示例性实施例示出的一种显示状态控制方法的流程图。FIG. 1 is a flow chart of a display state control method according to an exemplary embodiment.
图2是根据一示例性实施例示出的一种控制显示状态的流程图。Fig. 2 is a flowchart showing a control display state according to an exemplary embodiment.
图3是根据一示例性实施例示出的一种调整磁感应阈值的流程图。Fig. 3 is a flow chart of adjusting a magnetic induction threshold according to an exemplary embodiment.
图4是根据一示例性实施例示出的另一种调整磁感应阈值的流程图。Fig. 4 is another flow chart of adjusting the magnetic induction threshold according to an exemplary embodiment.
图5是根据一示例性实施例示出的又一种调整磁感应阈值的流程图。Fig. 5 is another flowchart of adjusting the magnetic induction threshold according to an exemplary embodiment.
图6~图10是根据一示例性实施例示出的一种显示状态控制装置的框图。6 to 10 are block diagrams of a display state control apparatus according to an exemplary embodiment.
图11是根据一示例性实施例示出的一种电子设备的框图。Fig. 11 is a block diagram of an electronic device according to an exemplary embodiment.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性所描述的实施例并不代表与本公开相一致的所有实施例。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. Where the following description refers to the drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The illustratively described embodiments below are not intended to represent all embodiments consistent with the present disclosure. Rather, they are merely examples of apparatuses consistent with some aspects of the present disclosure, as recited in the appended claims.
考虑到用户会在手机外部安装皮套,手机中的霍尔传感器会检测磁感数据,之后根据磁感数据判断是否关闭显示屏。然而,当手机处于强磁场环境时,霍尔传感器检测到磁通量增多可能会误关闭显示屏,影响用户使用;或者,上盖中磁铁消磁,导致霍尔传感器检测不到足够多的磁通量而保持亮屏,进而浪费电能。Considering that the user will install a leather case on the outside of the mobile phone, the Hall sensor in the mobile phone will detect the magnetic induction data, and then judge whether to turn off the display screen according to the magnetic induction data. However, when the mobile phone is in a strong magnetic field environment, the Hall sensor detects an increase in magnetic flux, which may turn off the display screen by mistake, affecting the user's use; or, the magnet in the top cover is demagnetized, causing the Hall sensor to not detect enough magnetic flux and keep bright screen, thereby wasting power.
为解决上述技术问题,本公开实施例提供了一种显示状态控制方法,可以应用于设置有霍尔传感器的预设传感器的电子设备,其中预设传感器可以包括以下至少一种:距离传感器和光线传感器。当然,技术人员还可以根据具体场景,选择其他传感器,在能够检测到皮套接近或者闭合时,相应方案落入本公开的保护范围。In order to solve the above technical problems, an embodiment of the present disclosure provides a display state control method, which can be applied to an electronic device provided with a preset sensor of a Hall sensor, wherein the preset sensor can include at least one of the following: a distance sensor and a light sensor. Of course, technicians can also select other sensors according to specific scenarios, and when it is possible to detect that the holster is approaching or closing, the corresponding solution falls within the protection scope of the present disclosure.
图1是根据一示例性实施例示出的一种显示状态控制方法的流程图,参见图1,一种显示状态控制方法,包括步骤11~步骤13,其中:Fig. 1 is a flowchart showing a display state control method according to an exemplary embodiment. Referring to Fig. 1, a display state control method includes
在步骤11中,获取霍尔传感器所采集的磁感数据。In
本实施例中,电子设备内霍尔传感器会按照设定周期或者实时检测预设范围内的磁通量,并根据磁通量生成磁感数据。其中,磁感数据可以为磁感电压。可理解是的,霍尔传感器感测到的磁通量越大,则输出的磁感电压越大,即通过磁感电压可以反映霍尔传感器感测的磁通量的大小。霍尔传感器的具体结构和工作原理可以参考相关技术,在此不再详述。In this embodiment, the Hall sensor in the electronic device detects the magnetic flux within a preset range according to a set period or in real time, and generates magnetic induction data according to the magnetic flux. The magnetic induction data may be magnetic induction voltage. It can be understood that the larger the magnetic flux sensed by the Hall sensor, the larger the output magnetic induction voltage, that is, the magnitude of the magnetic flux sensed by the Hall sensor can be reflected by the magnetic induction voltage. For the specific structure and working principle of the Hall sensor, reference may be made to related technologies, which will not be described in detail here.
本实施例中,电子设备内处理器可以与霍尔传感器建立通信链接,通过该通信链接可以获取霍尔传感器输出的磁感数据。In this embodiment, the processor in the electronic device may establish a communication link with the Hall sensor, and the magnetic induction data output by the Hall sensor may be acquired through the communication link.
在步骤12中,响应于所述磁感数据超过预设的磁感应阈值,获取预设传感器所采集的传感数据。In
本实施例中,电子设备内可以预先存储一个磁感应阈值。该磁感应阈值可以是在皮套的上盖闭合后,霍尔传感器能够感测到磁感数据的最小值,或者多次测量后磁感数据的平均值,或者能够感测到磁感数据的最大值与预设比例(如90%~98%之间的一个数值)的乘积。技术人员可以根据具体场景确定磁感应阈值的大小,相应方案落入本公开的保护范围。In this embodiment, a magnetic induction threshold may be pre-stored in the electronic device. The magnetic induction threshold can be the minimum value of the magnetic induction data that can be sensed by the Hall sensor after the upper cover of the leather case is closed, or the average value of the magnetic induction data after multiple measurements, or the maximum value of the magnetic induction data that can be sensed. The product of the value and a preset ratio (such as a value between 90% and 98%). A skilled person can determine the magnitude of the magnetic induction threshold according to a specific scenario, and the corresponding solution falls within the protection scope of the present disclosure.
本实施例中,处理器获取到磁感数据后,可以对比磁感数据和磁感应阈值,得到对比结果。当对比结果表示磁感数据小于磁感应阈值时,说明皮套的上盖没有闭合到位,此时处理器无需进行后续动作,同时返回步骤11;当对比结果表示磁感数据超过(大于或者等于)磁感应阈值时,处理器可以响应于磁感数据超过预设的磁感应阈值,获取预设传感器所采集的传感数据。In this embodiment, after acquiring the magnetic induction data, the processor can compare the magnetic induction data and the magnetic induction threshold to obtain a comparison result. When the comparison result indicates that the magnetic induction data is less than the magnetic induction threshold, it means that the upper cover of the holster is not closed in place, and the processor does not need to perform subsequent actions at this time, and returns to step 11 at the same time; when the comparison result indicates that the magnetic induction data exceeds (greater than or equal to) the magnetic induction When the threshold is reached, the processor may acquire sensing data collected by the preset sensor in response to the magnetic sensing data exceeding the preset magnetic sensing threshold.
在一实施例中,预设传感器可能处于关闭状态,处理器可以向预设传感器发送启动控制指令,开启预设传感器。预设传感器在启动后,会按照设定周期或者实时检测相应的参数,得到传感数据。此时,处理器可以主动获取上述传感数据,或者接收预设传感器发送的传感数据。当然,在获取到传感数据后,处理器还可以向预设传感器发送关闭控制指令,使预设传感器恢复关闭状态。In one embodiment, the preset sensor may be in an off state, and the processor may send an activation control instruction to the preset sensor to turn on the preset sensor. After the preset sensor is started, it will detect the corresponding parameters according to the set period or in real time, and obtain the sensing data. At this time, the processor may actively acquire the above sensing data, or receive sensing data sent by a preset sensor. Of course, after acquiring the sensing data, the processor may also send a shutdown control instruction to the preset sensor, so that the preset sensor returns to a closed state.
在一实施例中,当预设传感器是距离传感器时,传感数据可以是距离值,该距离值表示距离传感器到皮套的上盖的距离,如上盖闭合后距离值为0,上盖快闭合(上盖与显示屏之间夹角为5-10度)时距离值为1cm等。当预设传感器是光线传感器时,传感数据可以是光感值,该光感值表示光线传感器所处环境下当前的光感数据,如上盖闭合后,光感值为0。In one embodiment, when the preset sensor is a distance sensor, the sensing data may be a distance value, and the distance value represents the distance from the distance sensor to the upper cover of the leather case. When closed (the angle between the upper cover and the display screen is 5-10 degrees), the distance value is 1cm, etc. When the preset sensor is a light sensor, the sensing data may be a light sensitivity value, and the light sensitivity value represents the current light sensitivity data in the environment where the light sensor is located. For example, after the upper cover is closed, the light sensitivity value is 0.
在步骤13中,基于所述传感数据控制所述电子设备中显示屏的显示状态。In
本实施例中,处理器可以基于传感数据控制电子设备中显示屏的显示状态。电子设备内可以预先存储第一预设条件,该第一预设条件可以包括以下至少一种:距离值小于或者等于预设距离值,当前光感值小于或等于预设光感值。实际应用中,该第一预设条件可以根据预设传感器的种类和数量进行调整,在此不作限定。In this embodiment, the processor may control the display state of the display screen in the electronic device based on the sensor data. A first preset condition may be pre-stored in the electronic device, and the first preset condition may include at least one of the following: the distance value is less than or equal to the preset distance value, and the current light sensitivity value is less than or equal to the preset light sensitivity value. In practical applications, the first preset condition may be adjusted according to the type and quantity of the preset sensors, which is not limited herein.
参见图2,在步骤21中,处理器可以获取第一预设条件,并确定传感数据是否满足第一预设条件,得到确定结果。以距离传感器为例,此时传感数据是距离值,若距离值小于或者等于预设距离值,处理器可以确定距离值满足第一预设条件,否则可以确定距离值不满足第一预设条件。以光线传感器为例,此时传感数据是当前光感值,若当前光感值小于或者等于预设光感值,处理器可以确定光感值满足第一预设条件,否则可以确定距离值不满足第一预设条件。以同时采用光线传感器和距离传感器为例,此时传感数据包括距离值和当前光感值,其中距离值与预设距离值对比且当前光感值与预设光感值对比。此时距离结果可以包括以下情况:第一,距离值小于或者等于预设距离值,并且当前光感值小于或者等于预设光感值,此时,传感数据满足第一预设条件。第二,距离值大于预设距离值,并且当前光感值大于预设光感值,此时,传感数据不满足第一预设条件。第三,距离值小于或者等于预设距离值,并且当前光感值大于预设光感值,此时,传感数据不满足第一预设条件。第四,距离值大于预设距离值,并且当前光感值小于或者等于预设光感值,此时,传感数据满足第一预设条件。对于第三种和第四种情况而言,考虑到光线传感器会受到外部环境光线(例如黑夜、灯光)的影响,其检测准确率会略低于距离传感器的检测准确率,因此,设置了第三种和第四种方案。实际应用中,还可以在距离值和当前光感值中的一个不满足第一预设条件时,即确定传感数据不满足第一预设条件。Referring to FIG. 2, in
在步骤22中,当确定结果表征所述传感数据满足所述第一预设条件时,控制电子设备的显示屏切换到关闭状态;当确定结果表征传感数据不满足第一预设条件时,控制所述显示屏保持显示状态。In
在一实施例中,考虑到霍尔传感器检测到磁感数据,而预设传感器采集的传感数据不满足第一预设条件,处理器可以确定电子设备处于强磁场环境中。因此,当确定结果表征传感数据不满足所述第一预设条件后,处理器可以生成提醒信息,提醒信息用于提醒电子设备处于强磁场环境中,例如,提醒信息可以是“当前处于强磁场环境中有可能会影响到电子设备使用,请注意”。本实施例中通过交互可以使用户清楚使用环境,提升使用体验。In one embodiment, considering that the Hall sensor detects magnetic sensing data and the sensing data collected by the preset sensor does not meet the first preset condition, the processor may determine that the electronic device is in a strong magnetic field environment. Therefore, when it is determined that the sensing data does not meet the first preset condition, the processor can generate reminder information, and the reminder information is used to remind the electronic device to be in a strong magnetic field environment. The magnetic field environment may affect the use of electronic equipment, please pay attention.” In this embodiment, the user can be made clear about the use environment through interaction, and the use experience can be improved.
在上述各实施例中,上述磁感应阈值可以是一个固定值,也可以是一个动态值。以动态值为例,处理器可以在执行本公开的方法之前,调整该磁感应阈值,其中电子设备内可以预先存储第二预设条件,该第二预设条件包括以下至少一种:当前磁感数据为霍尔传感器所采集的磁感数据的最大值且该当前磁感数据小于预设的磁感应阈值,当前磁感数据之前预设时间段内的磁感数据均小于预设的磁感应阈值。In the foregoing embodiments, the foregoing magnetic induction threshold may be a fixed value or a dynamic value. Taking the dynamic value as an example, the processor may adjust the magnetic induction threshold before executing the method of the present disclosure, wherein a second preset condition may be pre-stored in the electronic device, and the second preset condition includes at least one of the following: the current magnetic induction The data is the maximum value of the magnetic induction data collected by the Hall sensor and the current magnetic induction data is smaller than the preset magnetic induction threshold, and the magnetic induction data in the preset time period before the current magnetic induction data are all smaller than the preset magnetic induction threshold.
需要说明的是,关于“当前磁感数据为霍尔传感器所采集的磁感数据的最大值且该当前磁感数据小于预设的磁感应阈值”中最大值的确定,处理器在获取到当前磁感数据后,可以获取当前磁感数据之前某一段时间内的历史值,当某一段时间的历史值的磁感数据均小于或者等于该当前磁感数据,说明该当前磁感数据为最大值。这是因为,用户在使用电子设备的过程中,上述某一段时间内必然存在打开上盖和闭合上盖的过程,在上盖闭合时,霍尔传感器能够感测到最大的磁通量且能够输出最大的磁感数据。而最大值又小于磁感应阈值,则说明上盖中磁铁出现消磁。It should be noted that, regarding the determination of the maximum value in "the current magnetic induction data is the maximum value of the magnetic induction data collected by the Hall sensor and the current magnetic induction data is less than the preset magnetic induction threshold", the processor obtains the current magnetic induction data. After the sensing data is obtained, the historical value of a certain period of time before the current magnetic sensing data can be obtained. When the magnetic sensing data of the historical value of a certain period of time is less than or equal to the current magnetic sensing data, it means that the current magnetic sensing data is the maximum value. This is because, when the user is using the electronic device, there must be a process of opening the upper cover and closing the upper cover for a certain period of time. When the upper cover is closed, the Hall sensor can sense the maximum magnetic flux and can output the maximum magnetic induction data. And the maximum value is smaller than the magnetic induction threshold, which means that the magnet in the upper cover is demagnetized.
另需要说明的是,关于“当前磁感数据之前预设时间段内的磁感数据均小于预设的磁感应阈值”是指,霍尔传感器在采集到当前磁感数据之前的预设时间段内的各磁感数据均小于磁感应阈值,表明电子设备处理强磁场环境或者上盖中磁铁出现消磁。It should also be noted that "the magnetic induction data in the preset time period before the current magnetic induction data are all smaller than the preset magnetic induction threshold" means that the Hall sensor collects the current magnetic induction data in the preset time period before the current magnetic induction data is collected. The magnetic induction data of all are less than the magnetic induction threshold, indicating that the electronic device is dealing with a strong magnetic field environment or the magnet in the upper cover is demagnetized.
参见图3,在步骤31中,处理器可以获取霍尔传感器所采集的当前磁感数据。在步骤32中,处理器可以确定当前磁感数据是否满足该第二预设条件,例如,当前磁感数据(是磁感电压)等于4V,且是霍尔传感器所能采集到磁感数据的最大值,而磁感应阈值为5V,则确定当前磁感数据满足第二预设条件。当满足第二预设条件时,处理器可以将霍尔传感器的磁感应阈值调整为第一阈值。Referring to FIG. 3 , in
本实施例中,步骤32可以包括:In this embodiment, step 32 may include:
在一示例中,电子设备可以预先存储一个预设的时长和磁感数据的对应关系表,该对应关系表表示磁铁随着使用时长的增加,上盖中磁铁的磁场是慢慢衰减的,相应地,霍尔传感器所输出的磁感数据也同步减小,相应的其磁感应阈值也应慢慢变小。从而,基于使用时长和磁感应阈值可以建立上述时长和磁感数据的对应关系表。参见图4,在步骤41中,处理器可以获取霍尔传感器的使用时长。在步骤42中,基于预设的时长和磁感数据的对应关系表,处理器可以确定使用时长对应的第一磁感数据。在步骤43中,处理器可以将霍尔传感器的磁感应阈值调整为上述第一磁感应阈值。In an example, the electronic device may pre-store a preset correspondence table between the duration and the magnetic induction data. On the ground, the magnetic induction data output by the Hall sensor also decreases synchronously, and the corresponding magnetic induction threshold should also gradually decrease. Therefore, based on the usage duration and the magnetic induction threshold, the above-mentioned correspondence table of the duration and the magnetic induction data can be established. Referring to FIG. 4, in
在另一示例中,参见图5,在步骤51中,处理器在获取到当前磁感数据后,可以获取该当前磁感数据之前预设时间段内的磁感数据,且计算这些磁感数据的平均值,并将平均值作为第一磁感应阈值。在步骤52中,处理器可以将霍尔传感器的磁感应阈值调整为第一磁感应阈值。In another example, referring to FIG. 5 , in
本实施例中通过调整磁感应阈值,可以避免出现上盖中磁铁消磁而无法执行本公开的一种显示状态控制方法的问题,有利于保证控制状态的准确性。In this embodiment, by adjusting the magnetic induction threshold, the problem that the magnet in the upper cover is demagnetized and the display state control method of the present disclosure cannot be executed can be avoided, which is beneficial to ensure the accuracy of the control state.
至此,本公开实施例中通过获取霍尔传感器所采集的磁感数据,并响应于所述磁感数据超过预设的磁感应阈值,获取预设传感器所采集的传感数据;基于所述传感数据控制所述电子设备中显示屏的显示状态。本实施例中,通过预设传感器的传感数据来辅助判断霍尔传感器控制显示屏的显示状态,使显示屏的关闭状态和亮屏状态能够与使用场景相匹配,可以提高控制的准确度,有利于提升使用体验。So far, in the embodiment of the present disclosure, the magnetic sensing data collected by the Hall sensor is acquired, and in response to the magnetic sensing data exceeding the preset magnetic sensing threshold, the sensing data collected by the preset sensor is obtained; The data controls the display state of the display screen in the electronic device. In this embodiment, the sensor data of the preset sensor is used to assist in judging the display state of the display screen controlled by the Hall sensor, so that the closed state and the bright screen state of the display screen can be matched with the usage scene, which can improve the control accuracy. Conducive to improve the user experience.
图6是根据一示例性实施例示出的一种显示状态控制装置的框图,应用于设置有显示屏的电子设备,参见图6,一种显示状态控制装置,包括:FIG. 6 is a block diagram of a display state control apparatus according to an exemplary embodiment, which is applied to an electronic device provided with a display screen. Referring to FIG. 6, a display state control apparatus includes:
磁感数据获取模块61,用于获取霍尔传感器所采集的磁感数据;The magnetic induction
传感数据获取模块62,用于响应于所述磁感数据超过预设的磁感应阈值,获取预设传感器所采集的传感数据;A sensing
显示状态控制模块63,用于基于所述传感数据控制所述电子设备中显示屏的显示状态。The display
在一实施例中,参见图7,所述显示状态控制模块63包括:In one embodiment, referring to FIG. 7 , the display
确定结果获取单元71,用于确定所述传感数据是否满足第一预设条件,得到确定结果;A determination
显示状态控制单元72,用于当所述确定结果表征所述传感数据满足所述第一预设条件时,控制电子设备的显示屏切换到关闭状态;当所述确定结果表征所述传感数据不满足所述第一预设条件时,控制所述显示屏保持显示状态。The display
在一实施例中,所述预设传感器包括以下至少一种:距离传感器、光线传感器。In one embodiment, the preset sensor includes at least one of the following: a distance sensor and a light sensor.
在一实施例中,所述第一预设条件包括以下至少一种:距离值小于或者等于预设距离值,当前光感值小于或等于预设光感值。In one embodiment, the first preset condition includes at least one of the following: the distance value is less than or equal to the preset distance value, and the current light sensitivity value is less than or equal to the preset light sensitivity value.
在一实施例中,所述显示状态控制模块63包括:In one embodiment, the display
提醒信息生成单元,用于生成提醒信息,所述提醒信息用于提醒所述电子设备处于强磁场环境中。A reminder information generating unit, configured to generate reminder information, where the reminder information is used to remind the electronic device to be in a strong magnetic field environment.
在一实施例中,参见图8,所述装置还包括磁感阈值调整模块;所述磁感阈值调整模块包括:In an embodiment, referring to FIG. 8 , the apparatus further includes a magnetic induction threshold adjustment module; the magnetic induction threshold adjustment module includes:
当前值获取单元81,用于获取所述霍尔传感器所采集的当前磁感数据;The current
阈值调整单元82,用于当所述当前磁感数据满足第二预设条件时,将所述霍尔传感器的磁感应阈值调整为第一磁感应阈值。The
在一实施例中,所述第二预设条件包括以下至少一种:当前磁感数据为霍尔传感器所采集的磁感数据的最大值且该当前磁感数据小于预设的磁感应阈值,当前磁感数据之前预设时间段内的磁感数据均小于预设的磁感应阈值。In one embodiment, the second preset condition includes at least one of the following: the current magnetic induction data is the maximum value of the magnetic induction data collected by the Hall sensor and the current magnetic induction data is less than a preset magnetic induction threshold, the current magnetic induction data The magnetic induction data in the preset time period before the magnetic induction data are all smaller than the preset magnetic induction threshold.
在一实施例中,参见图9,所述阈值调整单元82包括:In one embodiment, referring to FIG. 9 , the
使用时长获取子单元91,用于获取所述霍尔传感器的使用时长;The use
第一阈值确定子单元92,用于基于预设的时长和磁感数据的对应关系表,确定所述使用时长对应的第一磁感数据,将所述第一磁感数据作为所述第一阈值;The first
阈值调整子单元93,用于将所述霍尔传感器的磁感应阈值调整为所述第一磁感应阈值。The
在一实施例中,参见图10,所述阈值调整单元82包括:In an embodiment, referring to FIG. 10 , the
平均值获取子单元101,用于获取所述当前磁感数据之前预设时间段内的磁感数据的平均值,将所述平均值作为所8596述第一阈值;The average
阈值调整子单元102,用于将所述霍尔传感器的磁感应阈值调整为所述第一磁感应阈值。The
可理解的是,本公开实施例提供的装置与上述方法相对应,具体内容可以参考方法各实施例的内容,在此不再赘述。It is understandable that the apparatuses provided by the embodiments of the present disclosure correspond to the above-mentioned methods, and the specific content may refer to the content of the various embodiments of the methods, which will not be repeated here.
图11是根据一示例性实施例示出的一种电子设备的框图。例如,电子设备1100可以是智能手机,计算机,数字广播终端,平板设备,医疗设备,健身设备,个人数字助理等。Fig. 11 is a block diagram of an electronic device according to an exemplary embodiment. For example, the
参照图11,电子设备1100可以包括以下一个或多个组件:处理组件1102,存储器1104,电源组件1106,多媒体组件1108,音频组件1110,输入/输出(I/O)的接口1112,传感器组件1114,通信组件1116,以及图像采集组件1118。11, an
处理组件1102通常电子设备1100的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件1102可以包括一个或多个处理器1120来执行计算机程序。此外,处理组件1102可以包括一个或多个模块,便于处理组件1102和其他组件之间的交互。例如,处理组件1102可以包括多媒体模块,以方便多媒体组件1108和处理组件1102之间的交互。The
存储器1104被配置为存储各种类型的数据以支持在电子设备1100的操作。这些数据的示例包括用于在电子设备1100上操作的任何应用程序或方法的计算机程序,联系人数据,电话簿数据,消息,图片,视频等。存储器1104可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。The
电源组件1106为电子设备1100的各种组件提供电力。电源组件1106可以包括电源管理系统,一个或多个电源,及其他与为电子设备1100生成、管理和分配电力相关联的组件。
多媒体组件1108包括在电子设备1100和目标对象之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示屏(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自目标对象的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与触摸或滑动操作相关的持续时间和压力。The
音频组件1110被配置为输出和/或输入音频信号。例如,音频组件1110包括一个麦克风(MIC),当电子设备1100处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器1104或经由通信组件1116发送。在一些实施例中,音频组件1110还包括一个扬声器,用于输出音频信号。
I/O接口1112为处理组件1102和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。The I/
传感器组件1114包括一个或多个传感器,用于为电子设备1100提供各个方面的状态评估。例如,传感器组件1114可以检测到电子设备1100的打开/关闭状态,组件的相对定位,例如组件为电子设备1100的显示屏和小键盘,传感器组件1114还可以检测电子设备1100或一个组件的位置改变,目标对象与电子设备1100接触的存在或不存在,电子设备1100方位或加速/减速和电子设备1100的温度变化。传感器组件1114可以包括距离传感器和/或光线传感器,用于获取传感数据,以使处理器基于传感器可以实现图1~图5所示方法的步骤。
通信组件1116被配置为便于电子设备1100和其他设备之间有线或无线方式的通信。电子设备1100可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件1116经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,通信组件1116还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
在示例性实施例中,电子设备1100可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现。In an exemplary embodiment,
在示例性实施例中,还提供了一种包括可执行的计算机程序的非临时性可读存储介质,例如包括指令的存储器1104,上述可执行的计算机程序可由处理器执行。其中,可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, there is also provided a non-transitory readable storage medium including an executable computer program, such as a
本领域技术人员在考虑说明书及实践这里公开的公开后,将容易想到本公开的其它实施方案。本公开旨在涵盖任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Other embodiments of the present disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any modifications, uses or adaptations that follow the general principles of this disclosure and include common general knowledge or techniques in the technical field not disclosed by this disclosure. The specification and examples are to be regarded as exemplary only, with the true scope and spirit of the disclosure being indicated by the following claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It is to be understood that the present disclosure is not limited to the precise structures described above and illustrated in the accompanying drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010161777.1ACN111432068B (en) | 2020-03-10 | 2020-03-10 | Display state control method and device, electronic equipment and storage medium |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010161777.1ACN111432068B (en) | 2020-03-10 | 2020-03-10 | Display state control method and device, electronic equipment and storage medium |
| Publication Number | Publication Date |
|---|---|
| CN111432068A CN111432068A (en) | 2020-07-17 |
| CN111432068Btrue CN111432068B (en) | 2022-04-08 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010161777.1AActiveCN111432068B (en) | 2020-03-10 | 2020-03-10 | Display state control method and device, electronic equipment and storage medium |
| Country | Link |
|---|---|
| CN (1) | CN111432068B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112286599B (en)* | 2020-08-20 | 2024-09-10 | 北京小米移动软件有限公司 | Control method of terminal equipment and terminal equipment |
| CN114489534B (en)* | 2021-07-23 | 2023-07-14 | 荣耀终端有限公司 | Display switching method of foldable electronic device, electronic device and medium |
| CN114935902B (en)* | 2022-05-20 | 2025-03-25 | 南昌逸勤科技有限公司 | Control method, device and equipment applied to electronic equipment |
| CN116701099B (en)* | 2022-11-08 | 2024-08-20 | 荣耀终端有限公司 | Electronic device and method for controlling working state of electronic device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104640184A (en)* | 2015-02-15 | 2015-05-20 | 广东欧珀移动通信有限公司 | A screen wake-up method and device |
| CN104834497A (en)* | 2015-05-15 | 2015-08-12 | 北京智膜科技有限公司 | On screen display control method and controller |
| CN106210336A (en)* | 2016-07-22 | 2016-12-07 | 北京小米移动软件有限公司 | Control the method and device of mobile terminal state switching |
| WO2019061177A1 (en)* | 2017-09-28 | 2019-04-04 | 华为技术有限公司 | Prompt method and portable device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP5634041B2 (en)* | 2009-02-17 | 2014-12-03 | ローム株式会社 | Magnetic sensor and electronic device equipped with the same |
| CN107197076A (en)* | 2016-03-14 | 2017-09-22 | 中兴通讯股份有限公司 | A kind of control method of terminal device, mobile terminal and system |
| CN106339168B (en)* | 2016-08-22 | 2020-10-16 | 北京小米移动软件有限公司 | Screen control method and device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104640184A (en)* | 2015-02-15 | 2015-05-20 | 广东欧珀移动通信有限公司 | A screen wake-up method and device |
| CN104834497A (en)* | 2015-05-15 | 2015-08-12 | 北京智膜科技有限公司 | On screen display control method and controller |
| CN106210336A (en)* | 2016-07-22 | 2016-12-07 | 北京小米移动软件有限公司 | Control the method and device of mobile terminal state switching |
| WO2019061177A1 (en)* | 2017-09-28 | 2019-04-04 | 华为技术有限公司 | Prompt method and portable device |
| Publication number | Publication date |
|---|---|
| CN111432068A (en) | 2020-07-17 |
| Publication | Publication Date | Title |
|---|---|---|
| CN111432068B (en) | Display state control method and device, electronic equipment and storage medium | |
| CN108040360B (en) | Method and device for screen display control | |
| CN110796988A (en) | Backlight adjusting method and device | |
| CN106375604A (en) | Method and device for controlling terminal power | |
| CN112202962B (en) | Screen brightness adjusting method and device and storage medium | |
| CN106210336B (en) | Control the method and device of mobile terminal state switching | |
| CN106550522A (en) | Illumination control method and device | |
| CN106843706B (en) | Shutdown control method and device and terminal equipment | |
| CN107197441A (en) | The operating mode control method and device of intelligent home device | |
| CN107995676A (en) | terminal control method and device | |
| CN106959807A (en) | View angle switch method and device | |
| CN106897009A (en) | Mobile device time display method and device | |
| CN108769416A (en) | It puts out screen and shows method and device | |
| CN107529699A (en) | Control method of electronic device and device | |
| CN105208510B (en) | The method and device of intelligent alarm | |
| CN106292320A (en) | Control the method and device that controlled device runs | |
| CN112148149A (en) | Touch screen control method, touch screen control device and storage medium | |
| CN108932116A (en) | The adjusting method and device of volume | |
| CN107656694B (en) | Display control method and device of user interface | |
| CN106775246B (en) | Screen brightness adjusting method and device | |
| CN108267972B (en) | Electronic equipment control method and device | |
| CN108154865A (en) | Adjust the method and device of screen color temp | |
| CN111243554A (en) | Screen brightness adjusting method, screen brightness adjusting device and storage medium | |
| CN107566626A (en) | Terminal state control method and device | |
| CN107203264A (en) | The control method of display pattern, device, electronic equipment |
| 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 |