Movatterモバイル変換


[0]ホーム

URL:


CN106101402B - Method and system for adjusting sensing threshold of proximity sensor - Google Patents

Method and system for adjusting sensing threshold of proximity sensor
Download PDF

Info

Publication number
CN106101402B
CN106101402BCN201610389214.1ACN201610389214ACN106101402BCN 106101402 BCN106101402 BCN 106101402BCN 201610389214 ACN201610389214 ACN 201610389214ACN 106101402 BCN106101402 BCN 106101402B
Authority
CN
China
Prior art keywords
proximity sensor
reflected infrared
intensity value
infrared intensity
sensing threshold
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.)
Expired - Fee Related
Application number
CN201610389214.1A
Other languages
Chinese (zh)
Other versions
CN106101402A (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 CN201610389214.1ApriorityCriticalpatent/CN106101402B/en
Publication of CN106101402ApublicationCriticalpatent/CN106101402A/en
Application grantedgrantedCritical
Publication of CN106101402BpublicationCriticalpatent/CN106101402B/en
Expired - Fee Relatedlegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The invention relates to a method and a system for adjusting a sensing threshold value of a proximity sensor, wherein the method comprises the following steps: acquiring a reflected infrared ray intensity value measured by a proximity sensor; judging the state of the proximity sensor according to the reflected infrared ray intensity value and the perception threshold value of the proximity sensor; if the proximity sensor is judged to be in a far state, calculating a change value of the reflected infrared ray intensity value; and when the change value is larger than a set value, executing an algorithm for adjusting the sensing threshold value of the proximity sensor, and adjusting the sensing threshold value of the proximity sensor according to the reflected infrared ray intensity value. The invention can improve the sensitivity of the proximity sensor by adjusting the sensing threshold value, and can not write data into the sensing threshold value register frequently, thereby reducing the system load and reducing the chip loss.

Description

Translated fromChinese
调整接近传感器感知阈值的方法和系统Method and system for adjusting the sensing threshold of a proximity sensor

技术领域technical field

本发明涉及电子技术领域,特别是涉及一种调整接近传感器感知阈值的方法和系统。The present invention relates to the field of electronic technology, in particular to a method and a system for adjusting the sensing threshold of a proximity sensor.

背景技术Background technique

触摸式的手机凭借其日益强大的功能,在日常生活中得到了广泛的应用。当用户通话时,脸部贴近手机的触摸屏会因误触发而导致挂断电话,因此通常会在手机上安装接近传感器,通过接近传感器可以判断用户脸部是否靠近手机,并在脸部靠近手机时关闭手机的触摸屏以防止误触发。With its increasingly powerful functions, touch-type mobile phones have been widely used in daily life. When the user is on a call, the touch screen with the face close to the mobile phone will cause the call to hang up due to false triggering, so a proximity sensor is usually installed on the mobile phone. Turn off your phone's touchscreen to prevent false triggers.

目前,接近传感器已经大量地应用在手机的各种应用程序中,比如通话、自动背光、触摸屏黑屏手势、指纹控制等等。接近传感器可以测量反射红外线强度值,一般都会为接近传感器设置感知阈值,通过感知阈值以及接近传感器测量得到的反射红外线强度值来判断接近传感器发出的红外线是否被遮挡,从而判断物体是否接近或远离接近传感器。但是接近传感器容易受到环境因素、用户运动状态以及手机本身性能退化的影响,造成灵敏度下降,因此为了提高接近传感器的灵敏度,目前的手机会在接近传感器开启后,通过特定的算法对接近传感器的感知阈值进行动态调整,以消除环境因素或手机本身性能退化对接近传感器灵敏度的影响。但是快速地往手机芯片中的感知阈值寄存器里面写数据,不仅仅会增加系统的负担,而且会增加手机芯片的损耗,长此以往,将会严重影响手机的性能。At present, proximity sensors have been widely used in various applications of mobile phones, such as calls, automatic backlighting, touch screen black screen gestures, fingerprint control and so on. The proximity sensor can measure the reflected infrared intensity value. Generally, a sensing threshold is set for the proximity sensor. Through the sensing threshold and the reflected infrared intensity value measured by the proximity sensor, it is judged whether the infrared light emitted by the proximity sensor is blocked or not, so as to judge whether the object is approaching or far away. sensor. However, the proximity sensor is easily affected by environmental factors, the user's movement state and the performance degradation of the mobile phone itself, resulting in a decrease in sensitivity. Therefore, in order to improve the sensitivity of the proximity sensor, the current mobile phone will detect the proximity sensor through a specific algorithm after the proximity sensor is turned on. Thresholds are dynamically adjusted to eliminate the effects of environmental factors or performance degradation of the phone itself on the sensitivity of the proximity sensor. However, quickly writing data to the sensing threshold register in the mobile phone chip will not only increase the burden on the system, but also increase the loss of the mobile phone chip. If things go on like this, it will seriously affect the performance of the mobile phone.

发明内容SUMMARY OF THE INVENTION

基于此,为解决现有技术中的问题,本发明提供一种调整接近传感器感知阈值的方法和系统,既能提高接近传感器的灵敏度,又不会增加系统负担及芯片损耗。Based on this, in order to solve the problems in the prior art, the present invention provides a method and system for adjusting the sensing threshold of a proximity sensor, which can improve the sensitivity of the proximity sensor without increasing system burden and chip loss.

为实现上述目的,本发明实施例采用以下技术方案:To achieve the above object, the embodiment of the present invention adopts the following technical solutions:

一种调整接近传感器感知阈值的方法,包括如下步骤:A method for adjusting the sensing threshold of a proximity sensor, comprising the following steps:

获取接近传感器测量得到的反射红外线强度值;Obtain the reflected infrared intensity value measured by the proximity sensor;

通过所述反射红外线强度值和所述接近传感器的感知阈值判断所述接近传感器的状态;Judging the state of the proximity sensor according to the reflected infrared intensity value and the sensing threshold of the proximity sensor;

若判定所述接近传感器处于远离状态,则计算所述反射红外线强度值的变化值;If it is determined that the proximity sensor is in a distant state, calculating the change value of the reflected infrared intensity value;

当所述变化值大于设定值时,执行调整接近传感器感知阈值的算法,根据所述反射红外线强度值对所述接近传感器的感知阈值进行调整。When the change value is greater than the set value, an algorithm for adjusting the sensing threshold of the proximity sensor is executed, and the sensing threshold of the proximity sensor is adjusted according to the reflected infrared intensity value.

本发明还提供一种调整接近传感器感知阈值的系统,包括:The present invention also provides a system for adjusting the sensing threshold of the proximity sensor, including:

获取模块,用于获取接近传感器测量得到的反射红外线强度值;The acquisition module is used to acquire the reflected infrared intensity value measured by the proximity sensor;

第一判断模块,用于通过所述反射红外线强度值和所述接近传感器的感知阈值判断所述接近传感器的状态;a first judging module, configured to judge the state of the proximity sensor according to the reflected infrared intensity value and the sensing threshold of the proximity sensor;

计算模块,用于在判定所述接近传感器处于远离状态时,计算所述反射红外线强度值的变化值;a calculation module, configured to calculate the change value of the reflected infrared intensity value when it is determined that the proximity sensor is in a remote state;

第二判断模块,用于判断所述变化值是否大于设定值;a second judgment module, configured to judge whether the change value is greater than the set value;

调整模块,用于在所述变化值大于所述设定值时,执行调整接近传感器感知阈值的算法,根据所述反射红外线强度值对所述接近传感器的感知阈值进行调整。An adjustment module, configured to execute an algorithm for adjusting the sensing threshold of the proximity sensor when the change value is greater than the set value, and adjust the sensing threshold of the proximity sensor according to the reflected infrared intensity value.

基于本发明的上述技术方案,在接近传感器被使能后,仅在获取的反射红外线强度值的变化值小于设定值时,才启动执行调整接近传感器感知阈值的算法,对接近传感器的感知阈值进行调整,这样既可提高接近传感器的灵敏度,又可以有效避免频繁地往感知阈值寄存器里写入数据,从而降低系统的负担,也降低了芯片的损耗。Based on the above technical solution of the present invention, after the proximity sensor is enabled, the algorithm for adjusting the sensing threshold of the proximity sensor is started only when the change value of the acquired reflected infrared intensity value is less than the set value. Adjustment can not only improve the sensitivity of the proximity sensor, but also effectively avoid frequently writing data to the sensing threshold register, thereby reducing the burden on the system and reducing the loss of the chip.

附图说明Description of drawings

图1是本发明的调整接近传感器感知阈值的方法在一个实施例中的流程示意图;1 is a schematic flowchart of a method for adjusting the sensing threshold of a proximity sensor in one embodiment of the present invention;

图2是本发明的调整接近传感器感知阈值的系统在一个实施例中的结构示 意图。Fig. 2 is a schematic structural diagram of a system for adjusting the sensing threshold of a proximity sensor in one embodiment of the present invention.

具体实施方式Detailed ways

下面将结合较佳实施例及附图对本发明的内容作进一步详细描述。显然,下文所描述的实施例仅用于解释本发明,而非对本发明的限定。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。应当理解的是,尽管在下文中采用术语“第一”、“第二”等来描述各种信息,但这些信息不应限于这些术语,这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本发明范围的情况下,“第一”信息也可以被称为“第二”信息,类似的,“第二”信息也可以被称为“第一”信息。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部内容。The content of the present invention will be described in further detail below with reference to the preferred embodiments and the accompanying drawings. Obviously, the embodiments described below are only used to explain the present invention, but not to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention. It should be understood that although the terms "first", "second", etc. are used hereinafter to describe various pieces of information, these pieces of information should not be limited to these terms, which are only used to distinguish the same type of information from each other. For example, "first" information may also be referred to as "second" information, and similarly, "second" information may also be referred to as "first" information, without departing from the scope of the present invention. In addition, it should be noted that, for the convenience of description, the drawings only show some but not all of the contents related to the present invention.

图1是本发明的调整接近传感器感知阈值的方法在一个实施例中的流程示意图,本实施例中的调整接近传感器感知阈值的方法可由配置有接近传感器的终端设备(例如手机、平板等终端设备)的控制系统来执行,为便于描述,下面仅以配置有接近传感器的手机为例,来说明本实施例中的调整接近传感器感知阈值的方法,但不能以此来限制本发明的保护范围,本发明的保护范围应当以权利要求书限定的保护范围为准。如图1所示,本实施例中的调整接近传感器感知阈值的方法包括以下步骤:FIG. 1 is a schematic flowchart of a method for adjusting the sensing threshold of a proximity sensor in one embodiment of the present invention. The method for adjusting the sensing threshold of a proximity sensor in this embodiment can be configured by a terminal device (such as a mobile phone, tablet, etc.) equipped with a proximity sensor. ) control system to execute, for ease of description, the following only takes the mobile phone configured with the proximity sensor as an example to illustrate the method for adjusting the sensing threshold of the proximity sensor in the present embodiment, but the protection scope of the present invention cannot be limited with this, The protection scope of the present invention shall be subject to the protection scope defined by the claims. As shown in FIG. 1 , the method for adjusting the sensing threshold of the proximity sensor in this embodiment includes the following steps:

步骤S100,获取接近传感器测量得到的反射红外线强度值;Step S100, acquiring the reflected infrared intensity value measured by the proximity sensor;

手机的接近传感器工作后,可以测量反射红外线强度值。在本实施例中,手机的控制系统可获取接近传感器测量得到的反射红外线强度值。After the proximity sensor of the mobile phone works, the reflected infrared intensity value can be measured. In this embodiment, the control system of the mobile phone can acquire the reflected infrared intensity value measured by the proximity sensor.

在本实施例中,若手机的应用程序(例如通话应用程序)需要启动接近传感器时,手机的控制系统可通过使能信号使接近传感器开启并进入工作状态,然后手机的控制系统获取接近传感器测量得到的反射红外线强度值。In this embodiment, if an application of the mobile phone (such as a calling application) needs to activate the proximity sensor, the control system of the mobile phone can turn on the proximity sensor and enter the working state through the enable signal, and then the control system of the mobile phone obtains the measurement of the proximity sensor. The resulting reflected infrared intensity value.

步骤S200,通过所述反射红外线强度值和所述接近传感器的感知阈值判断所述接近传感器的状态;若判定所述接近传感器处于远离状态,则进入步骤S300;Step S200, judge the state of the proximity sensor according to the reflected infrared intensity value and the sensing threshold of the proximity sensor; if it is determined that the proximity sensor is in a far-away state, go to step S300;

接近传感器有两种状态,分别是远离状态和接近状态,通过接近传感器测 量得到的反射红外线强度值以及接近传感器的感知阈值便可以判断接近传感器的状态。Proximity sensor has two states, namely away state and approach state. The state of the proximity sensor can be judged by the reflected infrared intensity value measured by the proximity sensor and the sensing threshold of the proximity sensor.

在一种可选的实施方式中,接近传感器的感知阈值可设置为单一阈值H,若获取的反射红外线强度值大于此单一阈值H,说明接近传感器与外界物体接近,发射的红外线被外界物体所遮挡,故判定接近传感器处于接近状态,即接近传感器发生接近事件;若获取的反射红外线强度值小于此单一阈值H,说明接近传感器与外界物体远离,发射的红外线未被外界物体所遮挡或者遮挡不足,故判定接近传感器处于远离状态,即接近传感器发生远离事件;若获取的反射红外线强度值等于此单一阈值H,既可以判定接近传感器处于远离状态,又可以判定接近传感器处于接近状态,具体依据实际需求进行设置。In an optional embodiment, the sensing threshold of the proximity sensor can be set to a single threshold H, if the acquired reflected infrared intensity value is greater than the single threshold H, it means that the proximity sensor is close to an external object, and the emitted infrared rays are radiated by the external object. If the reflected infrared intensity value obtained is less than the single threshold H, it means that the proximity sensor is far away from external objects, and the emitted infrared rays are not blocked or insufficiently blocked by external objects. , so it is determined that the proximity sensor is in the away state, that is, the proximity sensor has a remote event; if the acquired reflected infrared intensity value is equal to the single threshold H, it can be determined that the proximity sensor is in the away state and the proximity sensor is in the proximity state, depending on the actual situation. needs to be set.

当接近传感器的感知阈值为单一阈值H时,若获取的反射红外线强度值在单一阈值H附近波动,将会使得极短时间内接近传感器的状态在远离和接近之间来回变化,即产生抖动,这对于利用接近传感器的状态进行控制的应用程序将会产生大大不利,因此,为了防止上述抖动,在另一种可选的实施方式中,接近传感器的感知阈值包括接近阈值N和远离阈值M,接近阈值N为判定接近传感器处于接近状态的下限值,远离阈值M为判定接近传感器处于远离状态的上限值,其中接近阈值N大于远离阈值M。当获取的反射红外线强度值大于接近阈值N时,判定接近传感器处于接近状态;当获取的反射红外线强度值小于远离阈值M时,判定接近传感器处于远离状态。此处给出一个具体实例,假设远离阈值M为100,接近阈值N为200,假设t时刻获取的反射红外线强度值为d1为50,d1<M,故接近传感器处于远离状态。假设t+Δt时刻获取的反射红外线强度值d2为150,由于d2仍然不大于接近阈值N,所以此时仍然判定接近传感器处于远离状态。若t+2Δt时刻获取的反射红外线强度值d3为220,由于d3>N,故判定接近传感器处于为接近状态。再若t+3Δt时刻获取的反射红外线强度值d4为140,由于d4仍不小于远离阈值M,故仍将判定接近传感器处于接近状态。因此,通过设置接近阈值N和远离阈值M,可以有效防止接近传感器的状态在远离和接近之间抖动。When the sensing threshold of the proximity sensor is a single threshold H, if the acquired reflected infrared intensity value fluctuates near the single threshold H, the state of the proximity sensor will change back and forth between the distance and the proximity in a very short time, that is, jitter is generated. This will be very disadvantageous to the application program controlled by the state of the proximity sensor. Therefore, in order to prevent the above jitter, in another optional implementation manner, the sensing threshold of the proximity sensor includes a proximity threshold N and a distance threshold M, The proximity threshold N is the lower limit value for determining that the proximity sensor is in the proximity state, and the distance threshold value M is the upper limit value for determining that the proximity sensor is in the remote state. When the acquired reflected infrared intensity value is greater than the proximity threshold N, it is determined that the proximity sensor is in a proximity state; when the acquired reflected infrared intensity value is less than the distance threshold M, it is determined that the proximity sensor is in a remote state. A specific example is given here, assuming that the distance threshold M is 100, the proximity threshold N is 200, and the reflected infrared intensity value d1 obtained at time t is 50, d1 <M, so the proximity sensor is in the far state. Assuming that the reflected infrared intensity value d2 obtained at time t+Δt is 150, since d2 is still not greater than the proximity threshold N, it is still determined that the proximity sensor is in a distant state at this time. If the reflected infrared intensity value d3 obtained at time t+2Δt is 220, since d3 >N, it is determined that the proximity sensor is in the proximity state. Furthermore, if the reflected infrared intensity value d4 obtained at time t+3Δt is 140, since d4 is still not less than the distance threshold M, it will still be determined that the proximity sensor is in the proximity state. Therefore, by setting the approach threshold N and the distance threshold M, the state of the proximity sensor can be effectively prevented from shaking between the distance and the approach.

步骤S300,计算所述反射红外线强度值的变化值;Step S300, calculating the change value of the reflected infrared intensity value;

在手机的控制系统判定接近传感器处于远离状态时,计算反射红外线强度值的变化值。该变化值即为手机的控制系统本次获取的反射红外线强度值与上一次获取的反射红外线强度值的差值。When the control system of the mobile phone determines that the proximity sensor is in a far away state, the change value of the reflected infrared intensity value is calculated. The change value is the difference between the reflected infrared intensity value obtained by the control system of the mobile phone this time and the reflected infrared intensity value obtained last time.

步骤S400,判断所述变化值是否大于设定值,若是,则进入步骤S500;Step S400, judging whether the change value is greater than the set value, if so, go to step S500;

在本实施例中,该设定值可预先存储在手机中,手机的控制系统读取该设定值,然后判断反射红外线强度值的变化值是否大于该设定值。In this embodiment, the set value can be stored in the mobile phone in advance, and the control system of the mobile phone reads the set value, and then judges whether the change value of the reflected infrared intensity value is greater than the set value.

步骤S500,执行调整接近传感器感知阈值的算法,根据所述反射红外线强度值对所述接近传感器的感知阈值进行调整。Step S500: Execute an algorithm for adjusting the sensing threshold of the proximity sensor, and adjust the sensing threshold of the proximity sensor according to the reflected infrared intensity value.

当反射红外线强度值的变化值小于设定值时,说明反射红外强度值的变化幅度较小,接近传感器的状态比较稳定,因此不用执行调整接近传感器感知阈值的算法去调整接近传感器的感知阈值,这样可有效避免频繁地往感知阈值寄存器里写入数据,降低控制系统的负担,也降低了手机芯片的损耗。而当反射红外线强度值的变化值大于设定值时,说明反射红外强度值的变化幅度较大,接近传感器的状态随时可能发生变化,因此,手机的控制系统执行调整接近传感器感知阈值的算法,根据获取的反射红外线强度值调整接近传感器的感知阈值,例如手机控制系统启动一个进程,该进程可执行调整接近传感器感知阈值的算法,根据获取的反射红外线强度值调整感知阈值,并将调整后得到的新的感知阈值写入感知阈值寄存器,从而提高接近传感器的灵敏度,防止其受到环境因素以及手机本身性能退化的影响。其中,根据获取的反射红外线强度值来调整接近传感器的感知阈值的方法可参照现有技术,此处不予赘述。When the change value of the reflected infrared intensity value is less than the set value, it means that the change range of the reflected infrared intensity value is small, and the state of the proximity sensor is relatively stable. This can effectively avoid frequently writing data to the sensing threshold register, reduce the burden on the control system, and also reduce the loss of mobile phone chips. When the change value of the reflected infrared intensity value is greater than the set value, it means that the reflected infrared intensity value changes greatly, and the state of the proximity sensor may change at any time. Adjust the sensing threshold of the proximity sensor according to the acquired reflected infrared intensity value. For example, the mobile phone control system starts a process, which can execute the algorithm for adjusting the sensing threshold of the proximity sensor, adjust the sensing threshold according to the acquired reflected infrared intensity value, and will obtain the result after adjustment. The new sense threshold of the sensor is written into the sense threshold register, thereby increasing the sensitivity of the proximity sensor, preventing it from being affected by environmental factors and the performance degradation of the phone itself. The method for adjusting the sensing threshold of the proximity sensor according to the acquired reflected infrared intensity value may refer to the prior art, which will not be repeated here.

在一种可选的实施方式中,参照图1所示,当反射红外线强度值的变化值小于或等于设定值时,以第一轮询速率继续获取反射红外线强度值。手机的控制系统重复执行上述的步骤S100至步骤S400,直至反射红外线强度值的变化值大于设定值时,再执行步骤S500,调整接近传感器的感知阈值。In an optional implementation manner, as shown in FIG. 1 , when the change value of the reflected infrared intensity value is less than or equal to the set value, the reflected infrared intensity value is continued to be acquired at the first polling rate. The control system of the mobile phone repeatedly executes the above steps S100 to S400 until the change value of the reflected infrared intensity value is greater than the set value, and then executes the step S500 to adjust the sensing threshold of the proximity sensor.

在一种可选的实施方式中,仍参照图1所示,在根据获取的反射红外线强度值对接近传感器的感知阈值进行调整之后,以第二轮询速率继续获取所述反射红外线强度值。In an optional implementation manner, still referring to FIG. 1 , after the sensing threshold of the proximity sensor is adjusted according to the acquired reflected infrared intensity value, the reflected infrared intensity value is continued to be acquired at the second polling rate.

考虑到当反射红外线强度值的变化值小于或等于设定值时,接近传感器的 状态较为稳定,而当反射红外线强度值的变化值大于设定值时,接近传感器的状态随时可能发生变化,因此可设置第二轮询速率大于第一轮询速率,以便快速响应接近传感器的接近、远离事件。Considering that when the change value of the reflected infrared intensity value is less than or equal to the set value, the state of the proximity sensor is relatively stable, and when the change value of the reflected infrared intensity value is greater than the set value, the state of the proximity sensor may change at any time, so The second polling rate can be set to be greater than the first polling rate, so as to quickly respond to the proximity sensor's approaching and moving away events.

在一种可选的实施方式中,若通过步骤S200判定接近传感器处于接近状态,则停止执行调整接近传感器感知阈值的算法,并以第三轮询速率继续获取反射红外线强度值。由于此时接近传感器已处于接近状态,可设置第三轮询速率大于第一轮询速率,这样可以快速响应接近传感器的远离事件。In an optional embodiment, if it is determined that the proximity sensor is in the proximity state through step S200, the algorithm for adjusting the sensing threshold of the proximity sensor is stopped, and the reflected infrared intensity value is continued to be acquired at the third polling rate. Since the proximity sensor is already in the proximity state at this time, the third polling rate can be set to be greater than the first polling rate, so that the proximity sensor can quickly respond to the remote event.

另外,针对于接近传感器的感知阈值包括接近阈值和远离阈值的情形,本实施例中也给出了一种较为简单的调整接近传感器感知阈值的算法,即将获取的反射红外线强度值设置为新的远离阈值,这样就可以快速响应接近传感器的远离事件。例如参照上文给出的具体实例,假设远离阈值M为100,接近阈值N为200,假设设定值Δd为20,若t时刻获取的反射红外线强度值为d1为50,由于d1<M,故接近传感器处于远离状态,假设d1与上一时刻获取的反射红外线强度值d0的差值大于设定值Δd,则执行调整接近传感器感知阈值的算法,将当前获取的反射红外线强度值d1设置为新的远离阈值M,即令M=d1,故此时的远离阈值M为50,接近阈值N为200。假设t+Δt时刻获取的反射红外线强度值d2为150,由于d2仍然不大于接近阈值N,所以此时仍然判定接近传感器处于远离状态,由于d2-d1>Δd,故执行调整接近传感器感知阈值的算法,将当前获取的反射红外线强度值d2设置为新的远离阈值M,即令M=d2,故此时的远离阈值M为150,接近阈值N为200。若t+2Δt时刻获取的反射红外线强度值d3为220,由于d3>N,故判定接近传感器处于为接近状态,此时不再执行调整接近传感器感知阈值的算法,故此时的远离阈值M仍为150,接近阈值N为200。再若t+3Δt时刻获取的反射红外线强度值d4为140,由于d4已小于新的远离阈值M,故将判定接近传感器处于远离状态。对比上文给出的具体实例,不难发现,通过执行本实施例中给出的调整接近传感器感知阈值的算法,可以快速响应接近传感器的远离事件,提高接近传感器的灵敏度。In addition, for the situation that the sensing threshold of the proximity sensor includes the proximity threshold and the distance threshold, a relatively simple algorithm for adjusting the sensing threshold of the proximity sensor is also provided in this embodiment, that is, the acquired reflected infrared intensity value is set to a new value. Away threshold, so that a rapid response to a proximity sensor's away event is possible. For example, referring to the specific example given above, assuming that the distance threshold M is 100, the approaching threshold N is 200, and the set value Δd is 20, if the reflected infrared intensity value obtained at time t is d1 is 50, because d1 < M, so the proximity sensor is in a far away state. Assuming that the difference between d1 and the reflected infrared intensity value d0 obtained at the previous moment is greater than the set value Δd, the algorithm for adjusting the sensing threshold of the proximity sensor is executed, and the currently obtained reflected infrared intensity The value d1 is set as the new distance threshold M, that is, M=d1 , so the distance threshold M at this time is 50, and the approach threshold N is 200. Assuming that the reflected infrared intensity value d2 obtained at timet+ Δt is 150, since d2 is still not greater than the proximity threshold N, it is still determined that the proximity sensor is in a far-away state. The algorithm of the sensor perception threshold sets the currently obtained reflected infrared intensity value d2 as a new distance threshold M, that is, M=d2 , so the distance threshold M at this time is 150, and the approach threshold N is 200. If the reflected infrared intensity value d3 obtained at time t+2Δt is 220, since d3 >N, it is determined that the proximity sensor is in the proximity state, and the algorithm for adjusting the sensing threshold of the proximity sensor is no longer executed. Still 150, near threshold N is 200. Furthermore, if the reflected infrared intensity value d4 obtained at time t+3Δt is 140, since d4 is already smaller than the new distance threshold M, it will be determined that the proximity sensor is in a distance state. Compared with the specific examples given above, it is not difficult to find that, by executing the algorithm for adjusting the sensing threshold of the proximity sensor given in this embodiment, it is possible to quickly respond to the distance event of the proximity sensor and improve the sensitivity of the proximity sensor.

通过本实施例中提供的调整接近传感器感知阈值的方法,在接近传感器被使能后,当获取的反射红外线强度值的变化值小于设定值时,启动执行调整接 近传感器感知阈值的算法,对接近传感器的感知阈值进行调整,可防止接近传感器的灵敏度受到环境因素、用户运动状态以及终端设备本身性能退化的影响,而在其他情况下停止执行调整接近传感器感知阈值的算法,这样可有效避免频繁地往感知阈值寄存器里写入数据,从而降低控制系统的负担,也降低了芯片的损耗。With the method for adjusting the sensing threshold of the proximity sensor provided in this embodiment, after the proximity sensor is enabled, when the change value of the acquired reflected infrared intensity value is less than the set value, the algorithm for adjusting the sensing threshold of the proximity sensor is started to execute the algorithm for adjusting the sensing threshold of the proximity sensor. Adjusting the sensing threshold of the proximity sensor can prevent the sensitivity of the proximity sensor from being affected by environmental factors, user motion status, and performance degradation of the terminal device itself, and stop executing the algorithm for adjusting the sensing threshold of the proximity sensor in other cases, which can effectively avoid frequent Write data into the sensing threshold register, thereby reducing the burden of the control system and reducing the loss of the chip.

需要说明的是,对于前述的各方法实施例,为了简便描述,将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其它顺序或者同时进行。It should be noted that, for the convenience of description, the foregoing method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because Certain steps may be performed in other orders or simultaneously in accordance with the present invention.

根据上述本发明的方法,本发明还提供一种调整接近传感器感知阈值的系统,下面结合附图及较佳实施例对本发明的调整接近传感器感知阈值的系统进行详细说明。According to the method of the present invention, the present invention also provides a system for adjusting the sensing threshold of a proximity sensor. The following describes the system for adjusting the sensing threshold of a proximity sensor in detail with reference to the accompanying drawings and preferred embodiments.

图2为本发明的调整接近传感器感知阈值的系统在一个实施例中的结构示意图。如图2所示,该实施例中的调整接近传感器感知阈值的系统包括:FIG. 2 is a schematic structural diagram of a system for adjusting the sensing threshold of a proximity sensor according to an embodiment of the present invention. As shown in FIG. 2 , the system for adjusting the sensing threshold of the proximity sensor in this embodiment includes:

获取模块1,用于获取接近传感器测量得到的反射红外线强度值;The acquisition module 1 is used to acquire the reflected infrared intensity value measured by the proximity sensor;

第一判断模块2,用于通过所述反射红外线强度值和所述接近传感器的感知阈值判断所述接近传感器的状态;a first judging module 2, configured to judge the state of the proximity sensor through the reflected infrared intensity value and the sensing threshold of the proximity sensor;

计算模块3,用于在判定所述接近传感器处于远离状态时,计算所述反射红外线强度值的变化值;Acalculation module 3, configured to calculate the change value of the reflected infrared intensity value when it is determined that the proximity sensor is in a remote state;

第二判断模块4,用于判断所述变化值是否大于设定值;The second judgment module 4 is used for judging whether the change value is greater than the set value;

调整模块5,用于在所述变化值大于所述设定值时,执行调整接近传感器感知阈值的算法,根据所述反射红外线强度值对所述接近传感器的感知阈值进行调整。Theadjustment module 5 is configured to execute an algorithm for adjusting the sensing threshold of the proximity sensor when the change value is greater than the set value, and adjust the sensing threshold of the proximity sensor according to the reflected infrared intensity value.

在一种可选的实施方式中,当所述变化值小于或等于所述设定值时,获取模块1以第一轮询速率继续获取所述反射红外线强度值;在调整模块5根据当前获取的反射红外线强度值对接近传感器的感知阈值进行调整之后,获取模块1以第二轮询速率继续获取反射红外线强度值。In an optional implementation manner, when the change value is less than or equal to the set value, the acquisition module 1 continues to acquire the reflected infrared intensity value at the first polling rate; After adjusting the sensing threshold of the proximity sensor with the reflected infrared intensity value of , the acquisition module 1 continues to acquire the reflected infrared intensity value at the second polling rate.

在一种可选的实施方式中,参照图2所示,本实施例中的调整接近传感器 感知阈值的系统还包括:In an optional implementation manner, referring to Fig. 2, the system for adjusting the sensing threshold of the proximity sensor in this embodiment also includes:

停止模块6,用于在调整模块5根据反射红外线强度值对接近传感器的感知阈值进行调整之后,若第一判断模块2判定接近传感器处于接近状态,则停止执行调整接近传感器感知阈值的算法。The stoppingmodule 6 is configured to stop executing the algorithm for adjusting the sensing threshold of the proximity sensor if the first judging module 2 determines that the proximity sensor is in a proximity state after theadjusting module 5 adjusts the sensing threshold of the proximity sensor according to the reflected infrared intensity value.

在停止模块6停止执行调整接近传感器感知阈值的算法之后,获取模块1以第三轮询速率继续获取反射红外线强度值。After the stoppingmodule 6 stops executing the algorithm for adjusting the sensing threshold of the proximity sensor, the obtaining module 1 continues to obtain the reflected infrared intensity value at the third polling rate.

较佳的,可设置第二轮询速率和第三轮询速率均大于第一轮询速率。Preferably, both the second polling rate and the third polling rate may be set to be greater than the first polling rate.

在一种可选的实施方式中,针对于接近传感器的感知阈值包括接近阈值和远离阈值的情形,调整模块5在根据反射红外线强度值对接近传感器的感知阈值进行调整时,将获取的反射红外线强度值设置为新的感知阈值。In an optional implementation manner, for a situation where the sensing threshold of the proximity sensor includes a proximity threshold and a distance threshold, when adjusting the sensing threshold of the proximity sensor according to the reflected infrared intensity value, theadjustment module 5 adjusts the acquired reflected infrared The intensity value is set to the new perception threshold.

上述调整接近传感器感知阈值的系统可执行本发明实施例所提供的调整接近传感器感知阈值的方法,具备执行方法相应的功能模块和有益效果。The system for adjusting the sensing threshold of the proximity sensor can execute the method for adjusting the sensing threshold of the proximity sensor provided by the embodiments of the present invention, and has corresponding functional modules and beneficial effects for executing the method.

以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above-described embodiments can be combined arbitrarily. For the sake of brevity, all possible combinations of the technical features in the above-described embodiments are not described. However, as long as there is no contradiction between the combinations of these technical features, All should be regarded as the scope described in this specification.

以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only represent several embodiments of the present invention, and the descriptions thereof are specific and detailed, but should not be construed as a limitation on the scope of the invention patent. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can also be made, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention should be subject to the appended claims.

Claims (8)

Translated fromChinese
1.一种调整接近传感器感知阈值的方法,其特征在于,包括如下步骤:1. a method for adjusting proximity sensor perception threshold, is characterized in that, comprises the steps:获取接近传感器测量得到的反射红外线强度值;Obtain the reflected infrared intensity value measured by the proximity sensor;通过所述反射红外线强度值和所述接近传感器的感知阈值判断所述接近传感器的状态;Judging the state of the proximity sensor according to the reflected infrared intensity value and the sensing threshold of the proximity sensor;若判定所述接近传感器处于远离状态,则计算所述反射红外线强度值的变化值;所述变化值为本次获取的反射红外线强度值与前次获取的反射红外线强度值的差值;If it is determined that the proximity sensor is in a far away state, the change value of the reflected infrared intensity value is calculated; the change value is the difference between the reflected infrared intensity value obtained this time and the reflected infrared intensity value obtained last time;当所述变化值大于设定值时,执行调整接近传感器感知阈值的算法,根据所述本次获取的反射红外线强度值对所述接近传感器的感知阈值进行调整;When the change value is greater than the set value, execute an algorithm for adjusting the sensing threshold of the proximity sensor, and adjust the sensing threshold of the proximity sensor according to the reflected infrared intensity value obtained this time;还包括:Also includes:当所述变化值小于或等于所述设定值时,以第一轮询速率继续获取所述反射红外线强度值;When the change value is less than or equal to the set value, continue to acquire the reflected infrared intensity value at the first polling rate;在根据所述反射红外线强度值对所述接近传感器的感知阈值进行调整之后,以第二轮询速率继续获取所述反射红外线强度值;After adjusting the sensing threshold of the proximity sensor according to the reflected infrared intensity value, continue to acquire the reflected infrared intensity value at a second polling rate;所述第二轮询速率大于所述第一轮询速率。The second polling rate is greater than the first polling rate.2.根据权利要求1所述的调整接近传感器感知阈值的方法,其特征在于,在根据所述反射红外线强度值对所述接近传感器的感知阈值进行调整之后,还包括如下步骤:2. The method for adjusting the sensing threshold of a proximity sensor according to claim 1, wherein after adjusting the sensing threshold of the proximity sensor according to the reflected infrared intensity value, the method further comprises the following steps:若判定所述接近传感器处于接近状态,则停止执行所述调整接近传感器感知阈值的算法,并以第三轮询速率继续获取所述反射红外线强度值。If it is determined that the proximity sensor is in a proximity state, the algorithm for adjusting the sensing threshold of the proximity sensor is stopped, and the reflected infrared intensity value is continued to be acquired at a third polling rate.3.根据权利要求2所述的调整接近传感器感知阈值的方法,其特征在于,所述第三轮询速率大于所述第一轮询速率。3 . The method for adjusting the sensing threshold of a proximity sensor according to claim 2 , wherein the third polling rate is greater than the first polling rate. 4 .4.根据权利要求2所述的调整接近传感器感知阈值的方法,其特征在于,所述感知阈值包括接近阈值和远离阈值,所述接近阈值大于所述远离阈值;通过所述反射红外线强度值和所述接近传感器的感知阈值判断所述接近传感器的状态的过程包括:4. The method for adjusting the sensing threshold of a proximity sensor according to claim 2, wherein the sensing threshold comprises a proximity threshold and a distance threshold, and the proximity threshold is greater than the distance threshold; The process of judging the state of the proximity sensor by the sensing threshold of the proximity sensor includes:当所述本次获取的反射红外线强度值大于所述接近阈值时,判定所述接近传感器处于接近状态;When the reflected infrared intensity value obtained this time is greater than the proximity threshold, it is determined that the proximity sensor is in a proximity state;当所述本次获取的反射红外线强度值小于所述远离阈值时,判定所述接近传感器处于远离状态。When the reflected infrared intensity value acquired this time is less than the distance threshold, it is determined that the proximity sensor is in a distance state.5.根据权利要求4所述的调整接近传感器感知阈值的方法,其特征在于,根据所述反射红外线强度值对所述接近传感器的感知阈值进行调整的过程包括:5. The method for adjusting the sensing threshold of a proximity sensor according to claim 4, wherein the process of adjusting the sensing threshold of the proximity sensor according to the reflected infrared intensity value comprises:将所述本次获取的反射红外线强度值设置为新的远离阈值。The reflected infrared intensity value obtained this time is set as a new distance threshold value.6.一种调整接近传感器感知阈值的系统,其特征在于,包括:6. A system for adjusting the sensing threshold of a proximity sensor, comprising:获取模块,用于获取接近传感器测量得到的反射红外线强度值;The acquisition module is used to acquire the reflected infrared intensity value measured by the proximity sensor;第一判断模块,用于通过所述反射红外线强度值和所述接近传感器的感知阈值判断所述接近传感器的状态;a first judging module, configured to judge the state of the proximity sensor according to the reflected infrared intensity value and the sensing threshold of the proximity sensor;计算模块,用于在判定所述接近传感器处于远离状态时,计算所述反射红外线强度值的变化值;所述变化值为本次获取的反射红外线强度值与前次获取的反射红外线强度值的差值;The calculation module is used to calculate the change value of the reflected infrared intensity value when it is determined that the proximity sensor is in a far away state; the change value is the difference between the reflected infrared intensity value obtained this time and the reflected infrared intensity value obtained last time difference;第二判断模块,用于判断所述变化值是否大于设定值;a second judgment module, configured to judge whether the change value is greater than the set value;调整模块,用于在所述变化值大于所述设定值时,执行调整接近传感器感知阈值的算法,根据所述本次获取的反射红外线强度值对所述接近传感器的感知阈值进行调整;an adjustment module, configured to execute an algorithm for adjusting the sensing threshold of the proximity sensor when the change value is greater than the set value, and adjust the sensing threshold of the proximity sensor according to the reflected infrared intensity value obtained this time;当所述变化值小于或等于所述设定值时,所述获取模块以第一轮询速率继续获取所述反射红外线强度值;When the change value is less than or equal to the set value, the acquisition module continues to acquire the reflected infrared intensity value at a first polling rate;在所述调整模块根据当前获取的所述反射红外线强度值对所述接近传感器的感知阈值进行调整之后,所述获取模块以第二轮询速率继续获取所述反射红外线强度值;After the adjustment module adjusts the sensing threshold of the proximity sensor according to the currently acquired reflected infrared intensity value, the acquisition module continues to acquire the reflected infrared intensity value at a second polling rate;所述第二轮询速率大于所述第一轮询速率。The second polling rate is greater than the first polling rate.7.根据权利要求6所述的调整接近传感器感知阈值的系统,其特征在于,还包括:7. The system for adjusting the sensing threshold of a proximity sensor according to claim 6, further comprising:停止模块,用于在所述调整模块根据所述反射红外线强度值对所述接近传感器的感知阈值进行调整之后,若所述第一判断模块判定所述接近传感器处于接近状态,则停止执行所述调整接近传感器感知阈值的算法;a stop module, configured to stop executing the proximity sensor if the first judgment module determines that the proximity sensor is in a proximity state after the adjustment module adjusts the sensing threshold of the proximity sensor according to the reflected infrared intensity value Algorithms to adjust the proximity sensor perception threshold;在所述停止模块停止执行所述调整接近传感器感知阈值的算法之后,所述获取模块以第三轮询速率继续获取所述反射红外线强度值。After the stopping module stops executing the algorithm for adjusting the sensing threshold of the proximity sensor, the obtaining module continues to obtain the reflected infrared intensity value at a third polling rate.8.根据权利要求7所述的调整接近传感器感知阈值的系统,其特征在于,所述第三轮询速率大于所述第一轮询速率。8. The system of claim 7, wherein the third polling rate is greater than the first polling rate.
CN201610389214.1A2016-06-012016-06-01Method and system for adjusting sensing threshold of proximity sensorExpired - Fee RelatedCN106101402B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201610389214.1ACN106101402B (en)2016-06-012016-06-01Method and system for adjusting sensing threshold of proximity sensor

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201610389214.1ACN106101402B (en)2016-06-012016-06-01Method and system for adjusting sensing threshold of proximity sensor

Publications (2)

Publication NumberPublication Date
CN106101402A CN106101402A (en)2016-11-09
CN106101402Btrue CN106101402B (en)2020-01-10

Family

ID=57448265

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201610389214.1AExpired - Fee RelatedCN106101402B (en)2016-06-012016-06-01Method and system for adjusting sensing threshold of proximity sensor

Country Status (1)

CountryLink
CN (1)CN106101402B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106791120B (en)*2016-12-272020-05-12Oppo广东移动通信有限公司Control method and device for screen-off of mobile terminal
CN107991664A (en)*2017-11-302018-05-04努比亚技术有限公司Calibration method, device and the computer-readable recording medium of ultrasonic wave threshold value
CN110865710B (en)*2019-11-192023-08-18Oppo(重庆)智能科技有限公司Terminal control method and device, mobile terminal and storage medium
CN112162329B (en)*2020-10-122022-08-05深圳市锐尔觅移动通信有限公司 Proximity sensing detection method, device, storage medium and electronic device
CN113514902B (en)*2021-06-222024-12-03Tcl通讯(宁波)有限公司 Infrared proximity sensor dynamic threshold adjustment method and mobile device
CN116007667B (en)*2022-12-222025-09-05长春莫尔电子有限公司 A method for correcting encoder data

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102265252A (en)*2011-06-242011-11-30华为终端有限公司 A method and device for adjusting the perception threshold of an infrared proximity sensor
CN102609082A (en)*2010-12-012012-07-25宏达国际电子股份有限公司Adjusting method of electronic device and related electronic device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US9689810B2 (en)*2013-10-082017-06-27Htc CorporationElectronic apparatus with proximity sensor and automatic calibration method thereof

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102609082A (en)*2010-12-012012-07-25宏达国际电子股份有限公司Adjusting method of electronic device and related electronic device
CN102265252A (en)*2011-06-242011-11-30华为终端有限公司 A method and device for adjusting the perception threshold of an infrared proximity sensor

Also Published As

Publication numberPublication date
CN106101402A (en)2016-11-09

Similar Documents

PublicationPublication DateTitle
CN106101402B (en)Method and system for adjusting sensing threshold of proximity sensor
CN105025159B (en)proximity sensor adjusting method and device
US9459723B2 (en)Detection algorithm for an infrared proximity sensor of a touch screen mobile phone
CN106055097B (en)Bright screen control method and device and electronic equipment
US10678376B2 (en)Data processing method, and apparatus
WO2019024642A1 (en)Process control method and apparatus, storage medium, and electronic device
US20130050133A1 (en)Method and apparatus for precluding operations associated with accidental touch inputs
CN106464754B (en) A method, device and equipment for calibrating detection distance
CN108759892B (en) Sensor calibration method, electronic device, and computer-readable storage medium
CN106657806B (en) A kind of exposure method and mobile terminal
KR20140140891A (en)Apparatus and Method for operating a proximity sensor function in an electronic device having touch screen
CN107463290B (en)Response control method and device for touch operation, storage medium and mobile terminal
US20160363465A1 (en)Proximity sensor and detection method thereof
CN105959461A (en) Screen sensing control method, device and terminal equipment
CN104750421A (en)Touch screen operation method and device for mobile terminal
CN109343066B (en)Control method and device of proximity sensor, storage medium and mobile terminal
WO2019024641A1 (en)Data synchronization method and apparatus, storage medium and electronic device
US9671895B2 (en)Method and system for turning off an alarm of a mobile terminal
WO2021129147A1 (en)Proximity sensor anomaly detection method and apparatus and mobile terminal
CN111104001B (en) A method, device, mobile terminal and storage medium for preventing accidental touch of screen
CN106020447B (en)Method and system for adjusting parameters of proximity sensor of touch electronic equipment
CN109510896B (en) Proximity sensor selection method, device, storage medium and electronic device
US20120068958A1 (en)Portable electronic device and control method thereof
CN108801321B (en) Sensor calibration method, electronic device, and computer-readable storage medium
WO2021213263A1 (en)Call window control method and apparatus, mobile terminal, and readable storage medium

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:Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

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

Address before:Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

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

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

Granted publication date:20200110


[8]ページ先頭

©2009-2025 Movatter.jp