Movatterモバイル変換


[0]ホーム

URL:


CN106385486A - A control method, device and mobile terminal of a proximity sensor - Google Patents

A control method, device and mobile terminal of a proximity sensor
Download PDF

Info

Publication number
CN106385486A
CN106385486ACN201610750698.8ACN201610750698ACN106385486ACN 106385486 ACN106385486 ACN 106385486ACN 201610750698 ACN201610750698 ACN 201610750698ACN 106385486 ACN106385486 ACN 106385486A
Authority
CN
China
Prior art keywords
state
proximity
proximity transducer
away
module
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.)
Granted
Application number
CN201610750698.8A
Other languages
Chinese (zh)
Other versions
CN106385486B (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 Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Oppo Mobile Telecommunications Corp LtdfiledCriticalGuangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201610750698.8ApriorityCriticalpatent/CN106385486B/en
Publication of CN106385486ApublicationCriticalpatent/CN106385486A/en
Application grantedgrantedCritical
Publication of CN106385486BpublicationCriticalpatent/CN106385486B/en
Expired - Fee Relatedlegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本发明提供一种接近传感器的控制方法、装置及移动终端,通过判定当前的接近传感器是否受到了较严重的红外线干扰,如果是,那么设置新的中断触发机制,即只有连续若干次处于接近状态或者远离状态,那么才上报接近事件或远离事件。即本发明通过调整接近传感器的中断上报控制逻辑,以减少强光对接近传感器的影响,从而避免不断上报接近或远离的事件的问题。因此,本发明有效避免了在A光环境下打电话,手机屏幕出现较高概率的闪烁的问题。

The present invention provides a control method, device and mobile terminal for a proximity sensor, which determines whether the current proximity sensor is subject to relatively serious infrared interference. If so, a new interrupt trigger mechanism is set, that is, only when the proximity sensor is in a close state or a far state for several consecutive times, the close event or the far event is reported. That is, the present invention adjusts the interrupt reporting control logic of the proximity sensor to reduce the influence of strong light on the proximity sensor, thereby avoiding the problem of continuously reporting the close or far events. Therefore, the present invention effectively avoids the problem of a high probability of flickering on the mobile phone screen when making a call in an A light environment.

Description

Translated fromChinese
一种接近传感器的控制方法、装置及移动终端A control method, device and mobile terminal of a proximity sensor

技术领域technical field

本发明涉及接近传感器技术领域,尤其涉及一种接近传感器的控制方法、装置及移动终端。The present invention relates to the technical field of proximity sensors, in particular to a control method, device and mobile terminal of a proximity sensor.

背景技术Background technique

在现有技术中,由于接近传感器是通过红外感应的方式工作的,而A光环境中(A光:如钨丝光,其比较昏黄,很多室内的灯光都是A光),红外线往往也比较强烈,当接近传感器采用现有的中断控制机制,即接近值大于高阀值,那么上报接近,当接近值小于低阀值,那么上报远离。那么就会导致接近传感器的数值很容易受到A光的红外干扰。而且由于市电是220v,50hz的工作参数,就会导致接近传感器收到周期性的红外干扰,其接近值跳变的很频繁,不断上报接近、远离的事件。如果用户在A光环境下打电话,那么手机屏幕就会较高概率的闪烁。In the prior art, since the proximity sensor works by means of infrared sensing, and in an A-light environment (A-light: such as tungsten filament light, which is relatively dim, and many indoor lights are A-light), the infrared rays are often relatively strong. , when the proximity sensor adopts the existing interrupt control mechanism, that is, the proximity value is greater than the high threshold, then report proximity, and when the proximity value is smaller than the low threshold, then report far away. Then it will cause the value of the proximity sensor to be easily affected by the infrared interference of the A light. And because the mains power is 220v, 50hz working parameters, it will cause the proximity sensor to receive periodic infrared interference, its proximity value jumps very frequently, and the events of approaching and leaving are constantly reported. If the user makes a call in a light environment, the screen of the mobile phone will flicker with a high probability.

故,有必要提出一种新的技术方案,以解决上述技术问题。Therefore, it is necessary to propose a new technical solution to solve the above technical problems.

发明内容Contents of the invention

有鉴于此,本发明的目的在于提供一种接近传感器的控制方法、装置及移动终端,旨在解决现有技术存在的接近传感器采用现有的中断控制机制,那么就会导致接近传感器的数值很容易受到A光的红外干扰,其接近值跳变的很频繁,不断上报接近、远离的事件的问题。In view of this, the object of the present invention is to provide a control method, device and mobile terminal of a proximity sensor, aiming to solve the problem that the existing interrupt control mechanism of the proximity sensor in the prior art will cause the value of the proximity sensor to be very large. Susceptible to the infrared interference of A light, its proximity value jumps very frequently, and the problem of approaching and faring events is constantly reported.

为解决上述技术问题,本发明实施例提供了以下技术方案:In order to solve the above technical problems, the embodiments of the present invention provide the following technical solutions:

本发明实施例提供了一种接近传感器的控制方法,所述接近传感器的控制方法,包括以下步骤:An embodiment of the present invention provides a control method of a proximity sensor, the control method of the proximity sensor includes the following steps:

获取接近传感器在接近状态与远离状态之间的间隔时间;Obtain the interval time between the approaching state and the faring state of the proximity sensor;

判断所述间隔时间是否小于设定间隔值;judging whether the interval time is less than a set interval value;

如果判断出所述间隔时间小于设定间隔值,则设置新的中断触发机制;其中,所述新的中断触发机制为连续预设次数处于相同状态,则控制所述接近传感器执行上报所述相同状态对应的事件;If it is judged that the interval time is less than the set interval value, a new interrupt trigger mechanism is set; wherein, the new interrupt trigger mechanism is in the same state for a preset number of consecutive times, and the proximity sensor is controlled to report the same The event corresponding to the state;

判断所述接近传感器是否在连续预设次数均处于相同状态;judging whether the proximity sensor is in the same state for a preset number of consecutive times;

如果判断出在连续预设次数均处于相同状态,则控制所述接近传感器执行上报所述相同状态对应的事件。If it is determined that they are all in the same state for a predetermined number of consecutive times, the proximity sensor is controlled to report an event corresponding to the same state.

为解决上述技术问题,本发明实施例还提供了以下技术方案:In order to solve the above technical problems, the embodiment of the present invention also provides the following technical solutions:

本发明实施例还提供了一种接近传感器的控制装置,所述接近传感器的控制装置,包括:An embodiment of the present invention also provides a control device for a proximity sensor, the control device for the proximity sensor includes:

间隔时间获取模块,用于获取接近传感器在接近状态与远离状态之间的间隔时间;Interval time obtaining module, is used for obtaining the interval time between proximity sensor in close state and far away state;

间隔时间判断模块,用于判断所述间隔时间是否小于设定间隔值;Interval time judging module, for judging whether described interval time is less than setting interval value;

触发机制设置模块,用于如果判断出所述间隔时间小于设定间隔值,则设置新的中断触发机制;其中,所述新的中断触发机制为连续预设次数处于相同状态,则控制所述接近传感器执行上报所述相同状态对应的事件;The trigger mechanism setting module is used to set a new interrupt trigger mechanism if it is judged that the interval time is less than the set interval value; wherein, the new interrupt trigger mechanism is in the same state for consecutive preset times, then controls the The proximity sensor reports an event corresponding to the same state;

状态判断模块,用于判断所述接近传感器是否在连续预设次数均处于相同状态;A state judging module, configured to judge whether the proximity sensor is in the same state for a preset number of consecutive times;

上报控制模块,用于如果判断出在连续预设次数均处于相同状态,则控制所述接近传感器执行上报所述相同状态对应的事件。The reporting control module is configured to control the proximity sensor to report an event corresponding to the same state if it is determined that they are in the same state for a predetermined number of consecutive times.

为解决上述技术问题,本发明实施例还提供了以下技术方案:In order to solve the above technical problems, the embodiment of the present invention also provides the following technical solutions:

本发明实施例还提供了一种包括上面所述的接近传感器的控制装置的移动终端。An embodiment of the present invention also provides a mobile terminal including the above-mentioned control device for a proximity sensor.

相对于现有技术,本发明提供的接近传感器的控制方法、装置及移动终端,通过获取接近传感器在接近状态与远离状态之间的间隔时间;判断所述间隔时间是否小于设定间隔值;如果判断出所述间隔时间小于设定间隔值,那么判定当前的接近传感器受到了较严重的红外线干扰,此时设置新的中断触发机制;即只有所述接近传感器在连续预设次数均处于相同状态;才控制所述接近传感器执行上报所述相同状态对应的事件。本发明通过判定当前的接近传感器是否受到了较严重的红外线干扰,如果是,那么设置新的中断触发机制,即只有连续若干次处于接近状态或者远离状态,那么才上报接近事件或远离事件。即本发明通过调整接近传感器的中断上报控制逻辑,以减少强光对接近传感器的影响,从而避免不断上报接近或远离的事件的问题。因此,本发明有效避免了在A光环境下打电话,手机屏幕出现较高概率的闪烁的问题。Compared with the prior art, the control method, device and mobile terminal of the proximity sensor provided by the present invention obtain the interval time between the proximity sensor and the distance state; judge whether the interval time is less than the set interval value; if If it is judged that the interval time is less than the set interval value, then it is determined that the current proximity sensor is subject to relatively serious infrared interference, and a new interrupt trigger mechanism is set at this time; that is, only the proximity sensor is in the same state for consecutive preset times ; to control the proximity sensor to report the event corresponding to the same state. The present invention determines whether the current proximity sensor has been subjected to serious infrared interference, and if so, sets a new interrupt trigger mechanism, that is, only reports a proximity event or a distance event only if it is in the approaching state or the faring state several times in a row. That is, the present invention adjusts the interrupt reporting control logic of the proximity sensor to reduce the impact of strong light on the proximity sensor, thereby avoiding the problem of continuously reporting approaching or faring events. Therefore, the present invention effectively avoids the problem of high probability flickering on the mobile phone screen when making a call under the A light environment.

附图说明Description of drawings

图1是本发明实施例一提供的接近传感器的控制方法的实现流程示意图;Fig. 1 is a schematic flow diagram of the realization of the control method of the proximity sensor provided by Embodiment 1 of the present invention;

图2是本发明实施例二提供的接近传感器的控制装置的模块示意图;2 is a block diagram of a control device for a proximity sensor provided in Embodiment 2 of the present invention;

图3是本发明实施例提供的接近传感器的控制装置的详细模块示意图;Fig. 3 is a detailed module schematic diagram of a control device for a proximity sensor provided by an embodiment of the present invention;

图4是本发明实施例三提供的移动终端的结构示意图。FIG. 4 is a schematic structural diagram of a mobile terminal provided by Embodiment 3 of the present invention.

具体实施方式detailed description

请参照附图中的图式,其中相同的组件符号代表相同的组件,本发明的原理是以实施在一适当的运算环境中来举例说明。以下的说明是基于所示例的本发明的具体实施例,其不应被视为限制本发明未在此详述的其它具体实施例。Referring to the drawings in the accompanying drawings, where like reference numerals represent like components, the principles of the present invention are exemplified when implemented in a suitable computing environment. The following description is based on illustrated specific embodiments of the invention and should not be construed as limiting the invention to other specific embodiments not described in detail herein.

本发明原理以上述文字来说明,其并不代表为一种限制,本领域技术人员将可了解到以下所述的多种步骤及操作亦可实施在硬件当中。本发明的原理使用许多其它泛用性或特定目的运算、通信环境或组态来进行操作。The principles of the present invention are described in the above words, which are not meant to be a limitation. Those skilled in the art will understand that the various steps and operations described below can also be implemented in hardware. The principles of the invention operate with numerous other general purpose or special purpose computing, communication environments or configurations.

实施例一Embodiment one

请参阅图1,所示为本发明实施例提供的接近传感器的控制方法。Please refer to FIG. 1 , which shows a control method of a proximity sensor provided by an embodiment of the present invention.

所述接近传感器的控制方法,应用于移动终端中,具体包括如下步骤:The control method of the proximity sensor is applied in a mobile terminal, and specifically includes the following steps:

在步骤S101中,获取接近传感器在接近状态与远离状态之间的间隔时间。In step S101, the interval time between the approaching state and the faring state of the proximity sensor is acquired.

作为本发明一实施例,首先检测移动终端当前是否处于通话状态;如果检测到处于通话状态,则获取接近传感器在接近状态与远离状态之间的间隔时间。As an embodiment of the present invention, firstly, it is detected whether the mobile terminal is currently in a call state; if it is detected that the mobile terminal is in a call state, then the interval time between the approaching state and the faring state of the proximity sensor is obtained.

具体的,移动终端获取SIM卡的状态,如果SIM卡处于非空闲状态,那么可以判定出移动终端当前处于通话状态;此时,开启接近传感器以进行工作,接近传感器读取接近值,将接近值与标准接近阈值和标准远离阈值进行比较;如果所述接近值大于标准接近阈值,则判定处于接近状态;如果所述接近值小于标准远离阈值,则判定处于远离状态;接近传感器会记录在接近状态与远离状态之间的间隔时间,这时,执行步骤S102的判断所述间隔时间是否小于设定间隔值。Specifically, the mobile terminal acquires the state of the SIM card, and if the SIM card is in a non-idle state, it can be determined that the mobile terminal is currently in a call state; at this time, the proximity sensor is turned on to work, the proximity sensor reads the proximity value, and the proximity value Compare with the standard proximity threshold and the standard distance threshold; if the proximity value is greater than the standard proximity threshold, it is judged to be in the proximity state; if the proximity value is smaller than the standard distance threshold, it is judged to be in the far state; the proximity sensor will record The interval time between the far away state, at this time, step S102 is performed to determine whether the interval time is less than the set interval value.

在步骤S102中,判断所述间隔时间是否小于设定间隔值。In step S102, it is judged whether the interval time is less than a set interval value.

在步骤S103中,如果判断出所述间隔时间小于设定间隔值,则设置新的中断触发机制;其中,所述新的中断触发机制为连续预设次数处于相同状态,则控制所述接近传感器执行上报所述相同状态对应的事件。In step S103, if it is determined that the interval time is less than the set interval value, a new interrupt trigger mechanism is set; wherein, the new interrupt trigger mechanism is in the same state for a preset number of consecutive times, then the proximity sensor is controlled Execution reports the event corresponding to the same state.

在本发明实施例中,如果判断出所述间隔时间小于设定间隔值(例如,接近状态到远离状态的时间间隔小于设定值(比如说100ms),那么认定当前的接近传感器受到了较严重的红外线干扰,接近值发生了跳变,那么设置新的中断触发机制,即只有连续预设次数处于相同状态,则控制所述接近传感器执行上报所述相同状态对应的事件。In the embodiment of the present invention, if it is judged that the interval time is less than the set interval value (for example, the time interval from the close state to the far state is less than the set value (for example, 100ms), then it is determined that the current proximity sensor has been severely damaged. Infrared interference, the proximity value jumps, then a new interrupt trigger mechanism is set, that is, only the continuous preset number of times is in the same state, and then the proximity sensor is controlled to report the event corresponding to the same state.

然而,可以理解的是,如果判断出所述间隔时间大于设定间隔值,那么接近传感器没有受到红外线干扰,此时,按照标准的中断触发机制,即如果接近值大于标准接近阈值,则判定处于接近状态,那么上报接近事件;如果所述接近值小于标准远离阈值,则判定处于远离状态,那么上报远离事件。However, it can be understood that if it is determined that the interval time is greater than the set interval value, then the proximity sensor is not subject to infrared interference. At this time, according to the standard interrupt trigger mechanism, that is, if the proximity value is greater than the standard proximity threshold, it is determined that the proximity sensor is in If the proximity value is smaller than the standard distance threshold, it is determined to be in the distance state, and the distance event is reported.

在本发明实施例中,所述设置新的中断触发机制的步骤,具体包括:将所述接近传感器的接近阈值设置为预设最大值,以及将远离阈值设置为预设最小值,以使得在所述最大值与最小值范围内不产生中断操作;以及设置只有当接近传感器在连续预设次数均处于相同状态时,则控制所述接近传感器执行上报所述相同状态对应的事件。In the embodiment of the present invention, the step of setting a new interrupt trigger mechanism specifically includes: setting the proximity threshold of the proximity sensor to a preset maximum value, and setting the distance threshold to a preset minimum value, so that in No interrupt operation is generated within the range of the maximum value and the minimum value; and only when the proximity sensor is in the same state for a predetermined number of consecutive times, the proximity sensor is controlled to report an event corresponding to the same state.

在步骤S104中,判断所述接近传感器是否在连续预设次数均处于相同状态。In step S104, it is determined whether the proximity sensors are in the same state for a preset number of consecutive times.

在步骤S105中,如果判断出在连续预设次数均处于相同状态,则控制所述接近传感器执行上报所述相同状态对应的事件。In step S105, if it is determined that they are all in the same state for a predetermined number of consecutive times, the proximity sensor is controlled to report an event corresponding to the same state.

作为本发明一实施例,所述判断所述接近传感器是否在连续预设次数均处于相同状态;如果判断出在连续预设次数均处于相同状态,则控制所述接近传感器执行上报所述相同状态对应的事件的步骤,具体包括:As an embodiment of the present invention, the judging whether the proximity sensor is in the same state for the consecutive preset times; if it is judged that the proximity sensor is in the same state for the consecutive preset times, then control the proximity sensor to report the same state The steps of the corresponding event include:

当每个积分周期完成之后,读取一次当前的接近值;其中,所述积分周期为接近状态与远离状态之间的间隔时间;将所述当前的接近值与标准接近阈值进行比较;如果所述当前的接近值大于标准接近阈值,则判定处于接近状态;当在连续预设次数均处于接近状态时,则控制所述接近传感器执行上报接近事件。如果在连续预设次数处于不同状态,那么认定处于红外干扰强烈的环境中,此时不上报接近事件。After each integration cycle is completed, read the current approach value once; wherein, the integration cycle is the interval between the approach state and the far state; compare the current approach value with the standard approach threshold; if the If the current proximity value is greater than the standard proximity threshold, it is determined to be in the proximity state; when the proximity sensor is in the proximity state for a predetermined number of consecutive times, the proximity sensor is controlled to report a proximity event. If it is in different states for a predetermined number of consecutive times, it is determined to be in an environment with strong infrared interference, and no approach event is reported at this time.

作为本发明另一实施例,所述判断所述接近传感器是否在连续预设次数均处于相同状态;如果判断出在连续预设次数均处于相同状态,则控制所述接近传感器执行上报所述相同状态对应的事件的步骤,具体包括:As another embodiment of the present invention, the judging whether the proximity sensor is in the same state for the consecutive preset times; The steps of the event corresponding to the status include:

当每个积分周期完成之后,读取一次当前的接近值;其中,所述积分周期为接近状态与远离状态之间的间隔时间;将所述当前的接近值与标准远离阈值进行比较;如果所述当前的接近值小于标准远离阈值,则判定处于远离状态;当在连续预设次数均处于远离状态时,则控制所述接近传感器执行上报远离事件。如果在连续预设次数处于不同状态,那么认定处于红外干扰强烈的环境中,此时不上报远离事件。After each integration period is completed, read the current approach value once; wherein, the integration period is the interval between the approach state and the far state; the current approach value is compared with the standard far away from the threshold; if the If the current proximity value is less than the standard distance threshold, it is determined to be in the distance state; when the distance is in the state for a predetermined number of consecutive times, the proximity sensor is controlled to report a distance event. If it is in a different state for a predetermined number of consecutive times, it is considered to be in an environment with strong infrared interference, and the far away event is not reported at this time.

可以理解的是,在通话环境下,在所述控制所述接近传感器执行上报接近事件的步骤之后,还包括:根据上报的所述接近事件,控制所述移动终端熄屏。It can be understood that, in a call environment, after the step of controlling the proximity sensor to report a proximity event, the method further includes: controlling the mobile terminal to turn off the screen according to the reported proximity event.

在所述控制所述接近传感器执行上报远离事件的步骤之后,还包括:根据上报的所述远离事件,控制移动终端亮屏。After the step of controlling the proximity sensor to report the away event, the method further includes: controlling the mobile terminal to turn on the screen according to the reported away event.

作为本发明一优选实施例,在所述控制所述接近传感器执行上报所述相同状态对应的事件的步骤之后,还包括:将所述接近传感器的接近阈值从预设最大值设置为标准接近阈值;以及将所述接近传感器的远离阈值从预设最小值设置为标准远离阈值。As a preferred embodiment of the present invention, after the step of controlling the proximity sensor to report the event corresponding to the same state, it further includes: setting the proximity threshold of the proximity sensor from a preset maximum value to a standard proximity threshold ; and setting the away threshold of the proximity sensor from a preset minimum value to a standard away threshold.

由上可知,本实施例一提供的接近传感器的控制方法,通过获取接近传感器在接近状态与远离状态之间的间隔时间;判断所述间隔时间是否小于设定间隔值;如果判断出所述间隔时间小于设定间隔值,那么判定当前的接近传感器受到了较严重的红外线干扰,此时设置新的中断触发机制;即只有所述接近传感器在连续预设次数均处于相同状态;才控制所述接近传感器执行上报所述相同状态对应的事件。本发明通过判定当前的接近传感器是否受到了较严重的红外线干扰,如果是,那么设置新的中断触发机制,即只有连续若干次处于接近状态或者远离状态,那么才上报接近事件或远离事件。即本发明通过调整接近传感器的中断上报控制逻辑,以减少强光对接近传感器的影响,从而避免不断上报接近或远离的事件的问题。因此,本发明有效避免了在A光环境下打电话,手机屏幕出现较高概率的闪烁的问题。It can be seen from the above that the control method of the proximity sensor provided by the first embodiment obtains the interval time between the proximity sensor and the far state; judges whether the interval time is less than the set interval value; if it is determined that the interval If the time is less than the set interval value, then it is determined that the current proximity sensor has received more serious infrared interference, and a new interrupt trigger mechanism is set at this time; that is, only if the proximity sensor is in the same state for the consecutive preset times; The proximity sensor reports an event corresponding to the same state. The present invention determines whether the current proximity sensor has been subjected to serious infrared interference, and if so, sets a new interrupt trigger mechanism, that is, only reports a proximity event or a distance event only if it is in the approaching state or the faring state several times in a row. That is, the present invention adjusts the interrupt reporting control logic of the proximity sensor to reduce the impact of strong light on the proximity sensor, thereby avoiding the problem of continuously reporting approaching or faring events. Therefore, the present invention effectively avoids the problem of high probability flickering on the mobile phone screen when making a call under the A light environment.

下面以在A光环境中打电话为例进行详细说明本发明提供的接近传感器的控制方法。The method for controlling the proximity sensor provided by the present invention will be described in detail below by taking making a phone call in the light environment A as an example.

在A光环境中(A光:如钨丝光,其比较昏黄,很多室内的灯光都是A光),红外线往往也比较强烈,由于接近传感器是通过红外感应的方式工作的,因此当红外线对接近传感器的影响比较大的时候,接近传感器的值就会发生跳变,如每个积分周期(比如说50ms)完成之后,值差异很大(比如说从20跳到120,然后再跳到30等)。如果接近值变为120,大于高阀值,那么上报接近事件,下一个时刻变为30,小于低阀值,上报远离事件。这两次中断状态的事件间隔只有50ms,而用户在平常的使用过程中,接近和远离的动作是不可能有如此之快的,也就是说刚才的接近和远离状态一定是由于红外干扰导致的。因此,判断接近传感器的中断产生周期,即如果接近、远离状态的时间间隔小于设定值(比如说100ms),那么认定当前的接近传感器受到了较严重的红外线干扰,接近值发生了跳变,那么设置新的中断触发机制,即只有连续若干次(比如说3次)处于接近或者远离状态,那么才上报接近或远离事件。判断的方式如下:如果接近传感器当前处于接近状态,首先不上报该接近事件,而是将接近传感器的接近阀值设置为最大(比如说0xffff),远离阀值设置为最小(比如说0),也就是保证芯片无法再次产生中断事件。然后每个积分周期完成之后,读取一次接近值,并将该接近值与标准的正常阀值进行比对,即将该接近值与标准接近阈值进行比较;如果该接近值大于标准接近阈值,则判定处于接近状态;将该接近值与标准远离阈值进行比较;如果该接近值小于标准远离阈值,则判定处于远离状态。如果连续三次都处于接近或者远离状态,那么上报一次接近事件或者远离事件。然后将最大的接近阀值和最小的远离阀值重新设置为标准的正常阀值(即标准接近阈值和标准接近阈值)。如果连续三次不是处于同一状态,那么认定是处于红外干扰强烈的环境中,则不上报接近、远离事件。本方案能上报准确的状态。In the A light environment (A light: such as tungsten filament light, which is relatively dim, and many indoor lights are A light), the infrared rays are often relatively strong. Since the proximity sensor works through infrared sensing, when the infrared rays approach When the influence of the sensor is relatively large, the value of the proximity sensor will jump. For example, after each integration period (for example, 50ms) is completed, the value varies greatly (for example, jumping from 20 to 120, and then jumping to 30, etc. ). If the proximity value becomes 120, which is greater than the high threshold, then the proximity event is reported, and at the next moment it becomes 30, which is less than the low threshold, and the distance event is reported. The event interval between these two interrupt states is only 50ms, and the user’s approach and distance actions cannot be so fast during normal use, that is to say, the approach and distance states just now must be caused by infrared interference . Therefore, judge the interrupt generation period of the proximity sensor, that is, if the time interval between the proximity and the distance is less than the set value (for example, 100ms), then it is determined that the current proximity sensor has been subjected to serious infrared interference, and the proximity value has jumped. Then set a new interrupt trigger mechanism, that is, only when the approach or distance event is reported several times (for example, 3 times) in a row, the approach or distance event is reported. The way of judging is as follows: if the proximity sensor is currently in the proximity state, the proximity event is not reported at first, but the proximity threshold of the proximity sensor is set to the maximum (such as 0xffff), and the distance threshold is set to the minimum (such as 0), That is to ensure that the chip cannot generate interrupt events again. Then after each integration cycle is completed, read the proximity value once, and compare the proximity value with the standard normal threshold, that is, compare the proximity value with the standard proximity threshold; if the proximity value is greater than the standard proximity threshold, then It is judged to be in the close state; the close value is compared with the standard far away threshold; if the close value is smaller than the standard far away threshold, it is determined to be in the far away state. If it is in the close or far away state for three consecutive times, then report a close event or a far away event. Then the maximum approach threshold and the minimum distance threshold are reset as standard normal thresholds (ie standard approach threshold and standard approach threshold). If it is not in the same state for three consecutive times, it is considered to be in an environment with strong infrared interference, and the approach and distance events will not be reported. This program can report accurate status.

实施例二Embodiment two

请一并参阅图2及图3,为本发明实施例二提供的接近传感器的控制装置的模块示意图;为了便于说明,仅示出了与本发明实施例相关的部分。所述接近传感器的控制装置包括:间隔时间获取模块101、间隔时间判断模块102、触发机制设置模块103、状态判断模块104、上报控制模块105。所述接近传感器的控制装置可以是内置于移动终端中的软件单元、硬件单元或者是软硬件结合的单元。Please refer to FIG. 2 and FIG. 3 together, which are block diagrams of the proximity sensor control device provided by Embodiment 2 of the present invention; for convenience of description, only the parts related to the embodiment of the present invention are shown. The control device of the proximity sensor includes: an interval time acquiring module 101 , an interval time judging module 102 , a trigger mechanism setting module 103 , a state judging module 104 , and a reporting control module 105 . The control device for the proximity sensor may be a software unit, a hardware unit or a combination of software and hardware built in the mobile terminal.

间隔时间获取模块101,用于获取接近传感器在接近状态与远离状态之间的间隔时间;Interval time acquiring module 101, for acquiring the interval time between proximity sensor in close state and far away state;

间隔时间判断模块102,用于判断所述间隔时间是否小于设定间隔值;Interval time judging module 102, for judging whether described interval time is less than setting interval value;

触发机制设置模块103,用于如果判断出所述间隔时间小于设定间隔值,则设置新的中断触发机制;其中,所述新的中断触发机制为连续预设次数处于相同状态,则控制所述接近传感器执行上报所述相同状态对应的事件;The trigger mechanism setting module 103 is used to set a new interrupt trigger mechanism if it is determined that the interval time is less than the set interval value; wherein, the new interrupt trigger mechanism is in the same state for a predetermined number of consecutive times, and the control The proximity sensor reports an event corresponding to the same state;

状态判断模块104,用于判断所述接近传感器是否在连续预设次数均处于相同状态;A state judging module 104, configured to judge whether the proximity sensor is in the same state for consecutive preset times;

上报控制模块105,用于如果判断出在连续预设次数均处于相同状态,则控制所述接近传感器执行上报所述相同状态对应的事件。The reporting control module 105 is configured to control the proximity sensor to report an event corresponding to the same state if it is determined that they are in the same state for a predetermined number of consecutive times.

在本发明实施例中,所述触发机制设置模块103,具体用于:将所述接近传感器的接近阈值设置为预设最大值,以及将远离阈值设置为预设最小值,以使得在所述最大值与最小值范围内不产生中断操作;以及设置只有当接近传感器在连续预设次数均处于相同状态时,则控制所述接近传感器执行上报所述相同状态对应的事件。In the embodiment of the present invention, the trigger mechanism setting module 103 is specifically configured to: set the proximity threshold of the proximity sensor to a preset maximum value, and set the distance threshold to a preset minimum value, so that in the No interrupt operation is generated within the range of the maximum value and the minimum value; and only when the proximity sensor is in the same state for a predetermined number of consecutive times, the proximity sensor is controlled to report an event corresponding to the same state.

作为本发明一实施例,所述接近传感器的控制装置还包括:接近值读取模块106;所述状态判断模块104包括:接近比较模块1041、接近判定模块1042;所述上报控制模块105包括:上报接近控制模块1051。As an embodiment of the present invention, the control device of the proximity sensor further includes: a proximity value reading module 106; the state judgment module 104 includes: a proximity comparison module 1041, a proximity judgment module 1042; the reporting control module 105 includes: Report to the approach control module 1051.

所述接近值读取模块106,用于当每个积分周期完成之后,读取一次当前的接近值;其中,所述积分周期为接近状态与远离状态之间的间隔时间;The proximity value reading module 106 is used to read the current proximity value once after each integration cycle is completed; wherein, the integration cycle is the interval between the proximity state and the far state;

所述接近比较模块1041,用于将所述当前的接近值与标准接近阈值进行比较;The proximity comparison module 1041 is configured to compare the current proximity value with a standard proximity threshold;

所述接近判定模块1042,用于如果所述当前的接近值大于标准接近阈值,则判定处于接近状态;The proximity judging module 1042 is configured to determine that it is in a proximity state if the current proximity value is greater than a standard proximity threshold;

所述上报接近控制模块1051,用于当在连续预设次数均处于接近状态时,则控制所述接近传感器执行上报接近事件。The reporting proximity control module 1051 is configured to control the proximity sensor to report a proximity event when it is in the proximity state for a preset number of consecutive times.

作为本发明另一实施例,所述状态判断模块104包括:远离比较模块1043、远离判定模块1044;所述上报控制模块105包括:上报远离控制模块1052;As another embodiment of the present invention, the state judging module 104 includes: a distance comparison module 1043 and a distance judgment module 1044; the reporting control module 105 includes: a reporting distance control module 1052;

所述接近值读取模块106在当每个积分周期完成之后,读取一次当前的接近值;其中,所述积分周期为接近状态与远离状态之间的间隔时间;The proximity value reading module 106 reads the current proximity value once after each integration period is completed; wherein, the integration period is the interval between the approach state and the far state;

所述远离比较模块1043,用于将所述当前的接近值与标准远离阈值进行比较;The distance comparison module 1043 is configured to compare the current proximity value with a standard distance threshold;

所述远离判定模块1044,用于如果所述当前的接近值小于标准远离阈值,则判定处于远离状态;The distance judging module 1044 is configured to determine that the distance is in the state of distance if the current proximity value is less than the standard distance threshold;

所述上报远离控制模块1052,用于当在连续预设次数均处于远离状态时,则控制所述接近传感器执行上报远离事件。The reporting away control module 1052 is configured to control the proximity sensor to report the away event when it is in the away state for a preset number of consecutive times.

作为本发明另一实施例,所述接近传感器的控制装置还包括:通话状态检测模块107、熄屏控制模块108;As another embodiment of the present invention, the control device of the proximity sensor further includes: a call state detection module 107, a screen off control module 108;

所述通话状态检测模块107,用于检测移动终端当前是否处于通话状态;The call state detection module 107 is used to detect whether the mobile terminal is currently in a call state;

所述间隔时间获取模块102,具体用于如果检测到处于通话状态,则获取接近传感器在接近状态与远离状态之间的间隔时间;The interval time acquisition module 102 is specifically used to acquire the interval time between the approaching state and the faring state of the proximity sensor if it is detected that it is in a talking state;

所述熄屏控制模块108,用于在控制所述接近传感器执行上报接近事件之后,根据上报的所述接近事件,控制所述移动终端熄屏。The screen-off control module 108 is configured to control the mobile terminal to turn off the screen according to the reported proximity event after controlling the proximity sensor to report a proximity event.

作为本发明另一实施例,所述接近传感器的控制装置还包括:亮屏控制模块109。As another embodiment of the present invention, the control device for the proximity sensor further includes: a bright screen control module 109 .

所述亮屏控制模块109,用于在控制所述接近传感器执行上报远离事件之后,根据上报的所述远离事件,控制移动终端亮屏。The screen brightening control module 109 is configured to control the mobile terminal to turn on the screen according to the reported distance away event after controlling the proximity sensor to report the distance away event.

在本发明实施例中,所述接近传感器的控制装置还包括:阈值设置模块111。In the embodiment of the present invention, the control device for the proximity sensor further includes: a threshold setting module 111 .

阈值设置模块111,用于在控制所述接近传感器执行上报所述相同状态对应的事件之后,将所述接近传感器的接近阈值从预设最大值设置为标准接近阈值;以及将所述接近传感器的远离阈值从预设最小值设置为标准远离阈值。The threshold setting module 111 is configured to set the proximity threshold of the proximity sensor from a preset maximum value to a standard proximity threshold after controlling the proximity sensor to report an event corresponding to the same state; The away threshold is set from a preset minimum to a standard away threshold.

由上可知,本实施例二提供的接近传感器的控制装置,通过获取接近传感器在接近状态与远离状态之间的间隔时间;判断所述间隔时间是否小于设定间隔值;如果判断出所述间隔时间小于设定间隔值,那么判定当前的接近传感器受到了较严重的红外线干扰,此时设置新的中断触发机制;即只有所述接近传感器在连续预设次数均处于相同状态;才控制所述接近传感器执行上报所述相同状态对应的事件。本发明通过判定当前的接近传感器是否受到了较严重的红外线干扰,如果是,那么设置新的中断触发机制,即只有连续若干次处于接近状态或者远离状态,那么才上报接近事件或远离事件。即本发明通过调整接近传感器的中断上报控制逻辑,以减少强光对接近传感器的影响,从而避免不断上报接近或远离的事件的问题。因此,本发明有效避免了在A光环境下打电话,手机屏幕出现较高概率的闪烁的问题。As can be seen from the above, the control device for the proximity sensor provided in the second embodiment obtains the interval time between the approaching state and the far-away state of the proximity sensor; judges whether the interval time is less than the set interval value; if it is determined that the interval If the time is less than the set interval value, then it is determined that the current proximity sensor has received more serious infrared interference, and a new interrupt trigger mechanism is set at this time; that is, only if the proximity sensor is in the same state for the consecutive preset times; The proximity sensor reports an event corresponding to the same state. The present invention determines whether the current proximity sensor has been subjected to serious infrared interference, and if so, sets a new interrupt trigger mechanism, that is, only reports a proximity event or a distance event only if it is in the approaching state or the faring state several times in a row. That is, the present invention adjusts the interrupt reporting control logic of the proximity sensor to reduce the impact of strong light on the proximity sensor, thereby avoiding the problem of continuously reporting approaching or faring events. Therefore, the present invention effectively avoids the problem of high probability flickering on the mobile phone screen when making a call under the A light environment.

本发明实施例提供的接近传感器的控制方法及装置属于同一构思,其具体实现过程详见说明书全文,此处不再赘述。The method and device for controlling the proximity sensor provided by the embodiments of the present invention belong to the same idea, and its specific implementation process can be found in the full text of the specification, and will not be repeated here.

实施例三Embodiment three

图4示出了本发明实施例三提供的移动终端的具体结构框图,该移动终端可以用于实施上述实施例中提供的接近传感器的控制方法/装置。该移动终端1200可以为智能手机或平板电脑。FIG. 4 shows a specific structural block diagram of a mobile terminal provided in Embodiment 3 of the present invention, and the mobile terminal may be used to implement the method/apparatus for controlling a proximity sensor provided in the foregoing embodiments. The mobile terminal 1200 can be a smart phone or a tablet computer.

如图4所示,移动终端1200可以包括RF(Radio Frequency,射频)电路110、包括有一个或一个以上(图中仅示出一个)计算机可读存储介质的存储器120、输入单元130、显示单元140、传感器150、音频电路160、传输模块170、包括有一个或者一个以上(图中仅示出一个)处理核心的处理器180以及电源190等部件。本领域技术人员可以理解,图4中示出的移动终端1200结构并不构成对移动终端1200的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。其中:As shown in FIG. 4, a mobile terminal 1200 may include an RF (Radio Frequency, radio frequency) circuit 110, a memory 120 including one or more (only one shown in the figure) computer-readable storage media, an input unit 130, and a display unit. 140, a sensor 150, an audio circuit 160, a transmission module 170, a processor 180 including one or more (only one is shown in the figure) processing cores, a power supply 190 and other components. Those skilled in the art can understand that the structure of the mobile terminal 1200 shown in FIG. 4 does not constitute a limitation to the mobile terminal 1200, and may include more or less components than those shown in the illustration, or combine certain components, or different components. layout. in:

RF电路110用于接收以及发送电磁波,实现电磁波与电信号的相互转换,从而与通讯网络或者其他设备进行通讯。RF电路110可包括各种现有的用于执行这些功能的电路元件,例如,天线、射频收发器、数字信号处理器、加密/解密芯片、用户身份模块(SIM)卡、存储器等等。RF电路110可与各种网络如互联网、企业内部网、无线网络进行通讯或者通过无线网络与其他设备进行通讯。上述的无线网络可包括蜂窝式电话网、无线局域网或者城域网。上述的无线网络可以使用各种通信标准、协议及技术,包括但并不限于全球移动通信系统(Global System for Mobile Communication,GSM)、增强型移动通信技术(Enhanced DataGSM Environment,EDGE),宽带码分多址技术(Wideband Code Division MultipleAccess,WCDMA),码分多址技术(Code Division Access,CDMA)、时分多址技术(TimeDivision Multiple Access,TDMA),无线保真技术(Wireless Fidelity,Wi-Fi)(如美国电气和电子工程师协会标准IEEE 802.11a,IEEE 802.11b,IEEE802.11g和/或IEEE802.11n)、网络电话(Voice over Internet Protocol,VoIP)、全球微波互联接入(Worldwide Interoperability for Microwave Access,Wi-Max)、其他用于邮件、即时通讯及短消息的协议,以及任何其他合适的通讯协议,甚至可包括那些当前仍未被开发出来的协议。The RF circuit 110 is used to receive and send electromagnetic waves, realize mutual conversion between electromagnetic waves and electrical signals, and communicate with communication networks or other devices. The RF circuit 110 may include various existing circuit elements for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption/decryption chips, Subscriber Identity Module (SIM) cards, memory, and the like. The RF circuit 110 can communicate with various networks such as the Internet, intranet, wireless network, or communicate with other devices through the wireless network. The wireless network mentioned above may include a cellular telephone network, a wireless local area network or a metropolitan area network. The wireless network mentioned above can use various communication standards, protocols and technologies, including but not limited to Global System for Mobile Communication (GSM), Enhanced DataGSM Environment (EDGE), broadband code division Multiple Access (WCDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Wireless Fidelity (Wi-Fi) ( Such as IEEE 802.11a, IEEE 802.11b, IEEE802.11g and/or IEEE802.11n), VoIP (Voice over Internet Protocol, VoIP), Worldwide Interoperability for Microwave Access, Wi-Max), other protocols for email, instant messaging, and short messaging, and any other suitable communication protocol, even those that have not yet been developed.

存储器120可用于存储软件程序以及模块,如上述实施例中接近传感器的控制方法/装置对应的程序指令/模块,处理器180通过运行存储在存储器120内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现接近传感器的控制的功能。存储器120可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器120可进一步包括相对于处理器180远程设置的存储器,这些远程存储器可以通过网络连接至移动终端1200。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 120 can be used to store software programs and modules, such as the program instructions/modules corresponding to the control method/device of the proximity sensor in the above-mentioned embodiments, and the processor 180 executes various functions by running the software programs and modules stored in the memory 120 Application and data processing, that is, the function of realizing the control of the proximity sensor. The memory 120 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 120 may further include a memory that is remotely located relative to the processor 180, and these remote memories may be connected to the mobile terminal 1200 through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

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

显示单元140可用于显示由用户输入的信息或提供给用户的信息以及移动终端1200的各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。显示单元140可包括显示面板141,可选的,可以采用LCD(Liquid CrystalDisplay,液晶显示器)、OLED(Organic Light-Emitting Diode,有机发光二极管)等形式来配置显示面板141。进一步的,触敏表面131可覆盖显示面板141,当触敏表面131检测到在其上或附近的触摸操作后,传送给处理器180以确定触摸事件的类型,随后处理器180根据触摸事件的类型在显示面板141上提供相应的视觉输出。虽然在图4中,触敏表面131与显示面板141是作为两个独立的部件来实现输入和输入功能,但是在某些实施例中,可以将触敏表面131与显示面板141集成而实现输入和输出功能。The display unit 140 can be used to display information input by or provided to the user and various graphical user interfaces of the mobile terminal 1200, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 140 may include a display panel 141. Optionally, the display panel 141 may be configured in the form of LCD (Liquid Crystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode, organic light-emitting diode), and the like. Further, the touch-sensitive surface 131 may cover the display panel 141, and when the touch-sensitive surface 131 detects a touch operation on or near it, the touch operation is sent to the processor 180 to determine the type of the touch event, and then the processor 180 determines the type of the touch event according to the type of the touch event. The type provides a corresponding visual output on the display panel 141 . Although in FIG. 4, the touch-sensitive surface 131 and the display panel 141 are used as two independent components to realize input and input functions, in some embodiments, the touch-sensitive surface 131 and the display panel 141 can be integrated to realize input. and output functions.

移动终端1200还可包括至少一种传感器150,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板141的亮度,接近传感器可在移动终端1200移动到耳边时,关闭显示面板141和/或背光。作为运动传感器的一种,重力加速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于移动终端1200还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。The mobile terminal 1200 may also include at least one sensor 150, 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 141 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 141 when the mobile terminal 1200 moves to the ear. and/or backlighting. As a kind of motion sensor, the gravitational acceleration 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 attitude of mobile phones (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition-related functions (such as pedometer, tap), etc.; as for other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc. that can be configured on the mobile terminal 1200, here No longer.

音频电路160、扬声器161,传声器162可提供用户与移动终端1200之间的音频接口。音频电路160可将接收到的音频数据转换后的电信号,传输到扬声器161,由扬声器161转换为声音信号输出;另一方面,传声器162将收集的声音信号转换为电信号,由音频电路160接收后转换为音频数据,再将音频数据输出处理器180处理后,经RF电路110以发送给比如另一终端,或者将音频数据输出至存储器120以便进一步处理。音频电路160还可能包括耳塞插孔,以提供外设耳机与移动终端1200的通信。The audio circuit 160 , the speaker 161 and the microphone 162 can provide an audio interface between the user and the mobile terminal 1200 . The audio circuit 160 can transmit the electrical signal converted from the received audio data to the loudspeaker 161, and the loudspeaker 161 converts it into an audio signal output; After being received, it is converted into audio data, and then the audio data is processed by the output processor 180, and then sent to another terminal through the RF circuit 110, or the audio data is output to the memory 120 for further processing. The audio circuit 160 may also include an earphone jack to provide communication between an external earphone and the mobile terminal 1200 .

移动终端1200通过传输模块170(例如Wi-Fi模块)可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图4示出了传输模块170,但是可以理解的是,其并不属于移动终端1200的必须构成,完全可以根据需要在不改变发明的本质的范围内而省略。The mobile terminal 1200 can help users send and receive e-mails, browse web pages, and access streaming media through the transmission module 170 (eg, Wi-Fi module), which provides users with wireless broadband Internet access. Although FIG. 4 shows the transmission module 170, it can be understood that it is not an essential component of the mobile terminal 1200, and can be completely omitted as required without changing the essence of the invention.

处理器180是移动终端1200的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器120内的软件程序和/或模块,以及调用存储在存储器120内的数据,执行移动终端1200的各种功能和处理数据,从而对手机进行整体监控。可选的,处理器180可包括一个或多个处理核心;优选的,处理器180可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器180中。The processor 180 is the control center of the mobile terminal 1200, and uses various interfaces and lines to connect various parts of the entire mobile phone, by running or executing software programs and/or modules stored in the memory 120, and calling data stored in the memory 120 , execute various functions and process data of the mobile terminal 1200, so as to monitor the mobile phone as a whole. Optionally, the processor 180 may include one or more processing cores; preferably, the processor 180 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 180 .

移动终端1200还包括给各个部件供电的电源190(比如电池),优选的,电源可以通过电源管理系统与处理器180逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源190还可以包括一个或一个以上的直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。The mobile terminal 1200 also includes a power supply 190 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 180 through the power management system, so that functions such as charging, discharging, and power consumption management can be realized through the power management system. . The power supply 190 may also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

尽管未示出,移动终端1200还可以包括摄像头、蓝牙模块等,在此不再赘述。具体在本实施例中,移动终端的显示单元是触摸屏显示器,移动终端还包括有存储器,以及一个或者一个以上的程序,其中一个或者一个以上程序存储于存储器中,且经配置以由一个或者一个以上处理器执行述一个或者一个以上程序包含用于进行以下操作的指令:Although not shown, the mobile terminal 1200 may also include a camera, a Bluetooth module, etc., which will not be repeated here. Specifically in this embodiment, the display unit of the mobile terminal is a touch screen display, and the mobile terminal also includes a memory, and one or more programs, wherein one or more programs are stored in the memory, and are configured to be controlled by one or one The above processor executes the one or more programs including instructions for performing the following operations:

获取接近传感器在接近状态与远离状态之间的间隔时间;Obtain the interval time between the approaching state and the faring state of the proximity sensor;

判断所述间隔时间是否小于设定间隔值;judging whether the interval time is less than a set interval value;

如果判断出所述间隔时间小于设定间隔值,则设置新的中断触发机制;其中,所述新的中断触发机制为连续预设次数处于相同状态,则控制所述接近传感器执行上报所述相同状态对应的事件;If it is judged that the interval time is less than the set interval value, a new interrupt trigger mechanism is set; wherein, the new interrupt trigger mechanism is in the same state for a preset number of consecutive times, and the proximity sensor is controlled to report the same The event corresponding to the state;

判断所述接近传感器是否在连续预设次数均处于相同状态;judging whether the proximity sensor is in the same state for a preset number of consecutive times;

如果判断出在连续预设次数均处于相同状态,则控制所述接近传感器执行上报所述相同状态对应的事件。If it is determined that they are all in the same state for a predetermined number of consecutive times, the proximity sensor is controlled to report an event corresponding to the same state.

本发明实施例提供的移动终端可以应用在前述对应的方法实施例一中,详情参见上述实施例一的描述,在此不再赘述。The mobile terminal provided by the embodiment of the present invention can be applied in the foregoing first corresponding method embodiment. For details, refer to the description of the foregoing first embodiment, which will not be repeated here.

本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,RandomAccess Memory)、磁盘或光盘等。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 can include: Read Only Memory (ROM, Read Only Memory), Random Access Memory (RAM, Random Access Memory), disk or CD, etc.

综上所述,虽然本发明已以优选实施例揭露如上,但上述优选实施例并非用以限制本发明,本领域的普通技术人员,在不脱离本发明的精神和范围内,均可作各种更动与润饰,因此本发明的保护范围以权利要求界定的范围为准。In summary, although the present invention has been disclosed above with preferred embodiments, the above preferred embodiments are not intended to limit the present invention, and those of ordinary skill in the art can make various modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the scope defined in the claims.

Claims (15)

CN201610750698.8A2016-08-292016-08-29 A control method, device and mobile terminal of a proximity sensorExpired - Fee RelatedCN106385486B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201610750698.8ACN106385486B (en)2016-08-292016-08-29 A control method, device and mobile terminal of a proximity sensor

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201610750698.8ACN106385486B (en)2016-08-292016-08-29 A control method, device and mobile terminal of a proximity sensor

Publications (2)

Publication NumberPublication Date
CN106385486Atrue CN106385486A (en)2017-02-08
CN106385486B CN106385486B (en)2019-05-24

Family

ID=57916234

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201610750698.8AExpired - Fee RelatedCN106385486B (en)2016-08-292016-08-29 A control method, device and mobile terminal of a proximity sensor

Country Status (1)

CountryLink
CN (1)CN106385486B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107290802A (en)*2017-07-182017-10-24广东欧珀移动通信有限公司 Proximity sensor calibration method, proximity sensor calibration device and intelligent terminal
CN107817747A (en)*2017-11-082018-03-20唐迪Cable car tele-control system
CN108076220A (en)*2017-11-292018-05-25广东欧珀移动通信有限公司Anti-jamming method, electronic device, and computer-readable storage medium
WO2019056214A1 (en)*2017-09-202019-03-28深圳市云中飞网络科技有限公司 Call processing method and related products

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103369142A (en)*2013-07-092013-10-23广东欧珀移动通信有限公司Method and system for avoiding call-up malfunction
CN103391365A (en)*2013-07-162013-11-13广东欧珀移动通信有限公司Mobile terminal backlight intensity accurately adjusted method, system and mobile terminal
CN104007882A (en)*2014-05-272014-08-27广东欧珀移动通信有限公司High-accuracy screen touch response method and device
CN105162948A (en)*2015-06-302015-12-16广东欧珀移动通信有限公司Mobile terminal and processing method and system for proximity sensor thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103369142A (en)*2013-07-092013-10-23广东欧珀移动通信有限公司Method and system for avoiding call-up malfunction
CN103391365A (en)*2013-07-162013-11-13广东欧珀移动通信有限公司Mobile terminal backlight intensity accurately adjusted method, system and mobile terminal
CN104007882A (en)*2014-05-272014-08-27广东欧珀移动通信有限公司High-accuracy screen touch response method and device
CN105162948A (en)*2015-06-302015-12-16广东欧珀移动通信有限公司Mobile terminal and processing method and system for proximity sensor thereof

Cited By (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107290802A (en)*2017-07-182017-10-24广东欧珀移动通信有限公司 Proximity sensor calibration method, proximity sensor calibration device and intelligent terminal
CN107290802B (en)*2017-07-182019-03-01Oppo广东移动通信有限公司Proximity sensor calibration method, proximity sensor calibration device and intelligent terminal
WO2019056214A1 (en)*2017-09-202019-03-28深圳市云中飞网络科技有限公司 Call processing method and related products
CN107817747A (en)*2017-11-082018-03-20唐迪Cable car tele-control system
CN107817747B (en)*2017-11-082019-11-26唐迪Cable car tele-control system
CN108076220A (en)*2017-11-292018-05-25广东欧珀移动通信有限公司Anti-jamming method, electronic device, and computer-readable storage medium
CN108076220B (en)*2017-11-292020-07-07Oppo广东移动通信有限公司Anti-jamming method, electronic device, and computer-readable storage medium

Also Published As

Publication numberPublication date
CN106385486B (en)2019-05-24

Similar Documents

PublicationPublication DateTitle
CN106131345B (en)Control method and device of proximity sensor and mobile terminal
CN104243671B (en)Volume adjusting method, device and electronic equipment
CN112415367B (en)Drive chip abnormality detection method, drive chip abnormality detection device, electronic device and readable storage medium
US11138041B2 (en)Method for automatically releasing resource occupied by process in background of terminal, storage medium and terminal
CN106340925A (en) A charging control method, device and terminal
CN106373531A (en) Display brightness adjustment method and electronic device
CN105141854A (en) Flash control method, device and terminal equipment
CN107172671A (en)A kind of channel switching method, device, storage medium and terminal
CN106453908A (en) A method, device, and mobile terminal for switching between dual-card networks based on calls
CN106385486A (en) A control method, device and mobile terminal of a proximity sensor
CN105933944A (en) Optimized use method, device and mobile terminal of 4G network
CN105792299A (en) Optimal use method, device and mobile terminal of 3G network
US11556158B2 (en)On-the-go (OTG) control and configuration method, mobile terminal, and storage medium
CN111432387B (en)Many-to-many switching module, multi-machine wireless communication system and communication method thereof
CN106255146B (en)A kind of electricity-saving control method of terminal, device and terminal
CN105282330B (en)The method and device of automatic connection network
CN106484141A (en) Threshold setting method and mobile terminal
CN110022600A (en)Adjusting method, device, storage medium and the mobile terminal of driving current
CN109661022A (en)Network control method, system, storage medium and mobile terminal
CN112286849A (en)Wireless charging base data switching method and system, storage medium and terminal equipment
CN106506821B (en)Data reading method and mobile terminal
CN106896896B (en) Power saving method, device and electronic device
CN106354250B (en)A kind of method, apparatus and terminal that meter step parameter is set
CN109995441B (en)Communication information processing method, device and storage medium
CN111262636B (en)Method and device for enhancing network data transmission speed, storage medium and mobile terminal

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
CB02Change of applicant information
CB02Change of applicant information

Address after:523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong

Applicant after:GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before:523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong

Applicant before:GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

GR01Patent grant
GR01Patent grant
CF01Termination of patent right due to non-payment of annual fee

Granted publication date:20190524


[8]ページ先頭

©2009-2025 Movatter.jp