Infrared proximity sensor dynamic threshold adjustment method and mobile device

The dynamic threshold adjustment method for infrared proximity sensors addresses performance inconsistencies by dynamically setting thresholds based on real-time readings, enhancing accuracy and consistency across varied devices.

CN113514902BActive Publication Date: 2024-12-03TCL COMM (NINGBO) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110694350.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-22
Publication Date
2024-12-03
Estimated Expiration
2041-06-22

AI Technical Summary

Technical Problem

Infrared proximity sensors in mobile devices exhibit performance consistency differences due to variations in sensitivity, glass transmittance, ink transmittance, and assembly tolerances, leading to inconsistent judgment results when using a fixed reference threshold.

Method used

A dynamic threshold adjustment method for infrared proximity sensors that involves continuously reading infrared energy values, comparing them with pre-recorded maximum and minimum values, calculating differences, and adjusting the threshold based on these values to ensure consistency.

Benefits of technology

The method significantly improves performance consistency by reducing the difference between maximum and minimum readings from 0.5 cm to 0.2 cm, ensuring accurate distance judgments across different devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113514902B_ABST
    Figure CN113514902B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for adjusting a dynamic threshold of an infrared proximity sensor and a mobile device, the method comprising: the infrared proximity sensor reads the received infrared energy value; the infrared proximity sensor compares the received infrared energy value with the pre-recorded maximum and minimum values ​​to obtain a new maximum and minimum value; the infrared proximity sensor calculates the difference between the new maximum and minimum values ​​to determine whether the difference is greater than the approach threshold; if the difference is greater than the approach threshold, the infrared proximity sensor adjusts the distance threshold according to the difference between the new maximum and minimum values. The present invention realizes a dynamic threshold adjustment method for dynamically setting a threshold by recording the maximum and minimum values ​​of the reading of the infrared proximity sensor at that time, and can optimize the consistency difference of the infrared proximity sensor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent push technology, and in particular to a method for adjusting a dynamic threshold of an infrared proximity sensor, a mobile device and a computer-readable storage medium. Background Art

[0002] Infrared technology has been widely used in speed measurement systems, and many products have used infrared technology to achieve vehicle speed measurement, detection and other research. When infrared is used in the field of speed measurement, the most difficult thing to overcome is the interference of various infrared light sources such as strong sunlight. The interference of external light sources has become a bottleneck for the application of infrared in the field. In response to this problem, a design scheme of infrared speed measurement sensor is proposed here, which can provide technical support for multi-point measurement of instant speed and stage acceleration, and can be applied to highway speed measurement and speed weighing of unloading materials on production lines and other industrial production links that require speed measurement. Infrared proximity sensor (IR Proximity Sensor) is a sensor that determines the distance of the obstruction by emitting infrared light and receiving the intensity of infrared light reflected by the obstruction.

[0003] like Figure 1 As shown, the infrared proximity sensor consists of an infrared light-emitting diode (an infrared light-emitting diode is a diode that can emit infrared rays, and is usually used in remote controls and other occasions. The commonly used infrared light-emitting diode is similar in appearance to a light-emitting diode LED and emits infrared light) and a photodiode (a photodiode, like an ordinary diode, is also a semiconductor device composed of a PN junction and also has a unidirectional conductive characteristic. However, in the circuit, it is not a rectifying element, but a photoelectric sensor device that converts optical signals into electrical signals). The light emitted by the infrared light-emitting diode is reflected by the obstruction and then received by the photodiode. The dark current generated by the photodiode is placed in the register after signal conditioning, signal amplifier, and analog-to-digital converter. The driver reads the register regularly and judges the distance of the obstruction from the infrared proximity sensor by comparing it with the reference threshold.

[0004] like Figure 2 As shown, in mobile devices, infrared proximity sensors are generally protected by a glass cover in the structural design (e.g. Figure 2The infrared proximity sensor is usually made of a protective glass (such as a protective glass in the case of infrared proximity sensors) to prevent water and dust from entering the sensor and affecting the performance of the infrared proximity sensor. A layer of ink is sometimes printed on the glass cover, and the transmittance of the ink is low in the visible light spectrum, but high in the infrared light spectrum. In some mobile devices with limited space, the infrared proximity sensor may even be hidden behind some components, leaving only some channels for infrared light transmission and reception. In such mobile devices, due to differences in the sensitivity of the infrared proximity sensor itself, differences in glass transmittance, differences in ink transmittance, and different infrared light channel widths caused by assembly tolerances, when a fixed reference threshold is used to determine the distance of the obstruction, different infrared proximity sensors have different judgment results for the same test distance, resulting in performance consistency differences.

[0005] In order to solve this problem of performance consistency differences, relevant practitioners generally control the performance consistency of infrared proximity sensors in two ways: the first is to calibrate the entire production line. This method increases the time required for the production process, but the performance of all infrared proximity sensors is basically consistent; the second is to detect individual devices with extremely large performance deviations in infrared proximity sensors through simple test scenarios. The advantage of this method is that it improves production efficiency, but the performance of different infrared proximity sensors still has consistency differences, and can only ensure that the performance difference is within a certain range. In the second method, although the tolerances in all aspects are within a reasonable range, due to process reasons, the cumulative tolerances in all aspects are too large, and it is difficult to simultaneously ensure that the production efficiency and the performance difference range are at a high level. Whether the performance difference range can be relaxed requires a lot of testing and is difficult to quantify.

[0006] Therefore, the prior art still needs to be improved and developed. Summary of the invention

[0007] The main purpose of the present invention is to provide a method for dynamic threshold adjustment of an infrared proximity sensor, a mobile device and a computer-readable storage medium, aiming to solve the problem that the performance consistency of the infrared proximity sensor cannot be effectively controlled in the prior art.

[0008] To achieve the above object, the present invention provides a method for adjusting a dynamic threshold of an infrared proximity sensor, the method comprising the following steps:

[0009] The infrared proximity sensor reads the received infrared energy value;

[0010] The infrared proximity sensor compares the received infrared energy value with the pre-recorded maximum and minimum values ​​to obtain new maximum and minimum values;

[0011] The infrared proximity sensor calculates the difference between the new maximum value and the minimum value, and determines whether the difference is greater than the proximity threshold;

[0012] If the difference is greater than the proximity threshold, the infrared proximity sensor adjusts the distance threshold according to the difference between the new maximum and minimum values.

[0013] Optionally, the infrared proximity sensor dynamic threshold adjustment method, wherein the infrared proximity sensor reads the received infrared energy value, is specifically:

[0014] The infrared proximity sensor continuously reads a plurality of received infrared energy values.

[0015] Optionally, the infrared proximity sensor dynamic threshold adjustment method, wherein the infrared proximity sensor compares the received infrared energy value with a pre-recorded maximum value and a pre-recorded minimum value to obtain a new maximum value and a new minimum value, specifically includes:

[0016] The infrared proximity sensor reads the pre-recorded maximum and minimum values;

[0017] The infrared proximity sensor compares the received multiple infrared energy values ​​with the pre-recorded maximum value and minimum value respectively;

[0018] After the comparison, the infrared proximity sensor updates the maximum value and the minimum value according to the comparison result to obtain a new maximum value and a new minimum value.

[0019] Optionally, in the infrared proximity sensor dynamic threshold adjustment method, the proximity threshold represents a reading of the infrared proximity sensor when the distance between the obstruction and the infrared proximity sensor is less than a first preset value.

[0020] Optionally, in the infrared proximity sensor dynamic threshold adjustment method, when the change amount of the infrared proximity sensor is greater than the proximity threshold, the software program of the infrared proximity sensor reports an interrupt event.

[0021] Optionally, in the infrared proximity sensor dynamic threshold adjustment method, the distance threshold represents the infrared proximity sensor reading when the distance between the obstruction and the infrared proximity sensor is greater than a second preset value.

[0022] Optionally, in the infrared proximity sensor dynamic threshold adjustment method, when the change amount of the infrared proximity sensor is less than the distance threshold, the software program of the infrared proximity sensor reports an interrupt event.

[0023] Optionally, in the infrared proximity sensor dynamic threshold adjustment method, the infrared proximity sensor reading first increases and then decreases as the distance to the obstacle increases.

[0024] In addition, to achieve the above-mentioned purpose, the present invention also provides a mobile device, wherein the mobile device includes: a memory, a processor, and an infrared proximity sensor dynamic threshold adjustment program stored in the memory and executable on the processor, wherein the infrared proximity sensor dynamic threshold adjustment program implements the steps of the infrared proximity sensor dynamic threshold adjustment method as described above when executed by the processor.

[0025] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores an infrared proximity sensor dynamic threshold adjustment program, and when the infrared proximity sensor dynamic threshold adjustment program is executed by a processor, the steps of the infrared proximity sensor dynamic threshold adjustment method as described above are implemented.

[0026] The present invention reads the received infrared energy value through an infrared proximity sensor; the infrared proximity sensor compares the received infrared energy value with the pre-recorded maximum and minimum values ​​to obtain a new maximum and minimum value; the infrared proximity sensor calculates the difference between the new maximum and minimum values ​​to determine whether the difference is greater than the proximity threshold; if the difference is greater than the proximity threshold, the infrared proximity sensor adjusts the distance threshold according to the difference between the new maximum and minimum values. The present invention realizes a dynamic threshold adjustment method for dynamically setting the threshold by recording the maximum and minimum values ​​of the reading of the infrared proximity sensor at that time, and can optimize the consistency difference of the infrared proximity sensor. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 It is a schematic diagram of the structure of the infrared proximity sensor;

[0028] Figure 2 It is a schematic diagram of the structure of the infrared proximity sensor in the mobile device;

[0029] Figure 3 It is a flow chart of a preferred embodiment of the method for adjusting the dynamic threshold of an infrared proximity sensor of the present invention;

[0030] Figure 4 It is a schematic diagram of the entire execution process of a preferred embodiment of the method for adjusting the dynamic threshold of an infrared proximity sensor of the present invention;

[0031] Figure 5 It is a schematic diagram of the relationship between the reading of the infrared proximity sensor and the distance from the obstacle in a preferred embodiment of the method for adjusting the dynamic threshold of the infrared proximity sensor of the present invention;

[0032] Figure 6 Schematic diagram of the operating environment of a preferred embodiment of the mobile device of the present invention. DETAILED DESCRIPTION

[0033] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0034] In the prior art, the infrared proximity sensor is composed of an infrared light emitting diode (an infrared light emitting diode is a diode that can emit infrared rays, and is usually used in remote controls and other occasions. The commonly used infrared light emitting diode is similar in appearance to a light emitting diode LED and emits infrared light) and a photodiode (a photodiode, like an ordinary diode, is also a semiconductor device composed of a PN junction and also has a unidirectional conductive characteristic. However, in the circuit, it is not a rectifying element, but a photoelectric sensor device that converts optical signals into electrical signals). The light emitted by the infrared light emitting diode is reflected by the obstruction and then received by the photodiode. The dark current generated by the photodiode is processed by signal conditioning, signal amplifier, and analog-to-digital converter, and the digital signal is placed in the register. The driver reads the register regularly and judges the distance of the obstruction from the infrared proximity sensor by comparing it with the reference threshold.

[0035] In mobile devices, infrared proximity sensors are generally protected by a glass cover in the structural design to prevent water and dust from entering and affecting the performance of the infrared proximity sensor. A layer of ink is sometimes printed on the glass cover, and the ink has a low transmittance in the visible light spectrum, but a high transmittance in the infrared light spectrum. In some mobile devices with limited space, infrared proximity sensors are even hidden behind some components, leaving only some channels for infrared light transmission and reception. In such mobile devices, due to differences in the sensitivity of the infrared proximity sensor itself, differences in glass transmittance, differences in ink transmittance, and different infrared light channel widths caused by assembly tolerances, when a fixed reference threshold is used to determine the distance of the obstruction, different infrared proximity sensors have different judgment results for the same test distance, so there are differences in performance consistency.

[0036] In order to solve this problem of performance consistency differences, relevant practitioners generally control the performance consistency of infrared proximity sensors in two ways: the first is to calibrate the entire production line. This method increases the time required for the production process, but the performance of all infrared proximity sensors is basically consistent; the second is to detect individual devices with extremely large performance deviations in infrared proximity sensors through simple test scenarios. The advantage of this method is that it improves production efficiency, but the performance of different infrared proximity sensors still has consistency differences, and can only ensure that the performance difference is within a certain range. In the second method, although the tolerances in all aspects are within a reasonable range, due to process reasons, the cumulative tolerances in all aspects are too large, and it is difficult to simultaneously ensure that the production efficiency and the performance difference range are at a high level. Whether the performance difference range can be relaxed requires a lot of testing and is difficult to quantify.

[0037] Therefore, in order to overcome the above-mentioned defects of the prior art, the dynamic threshold adjustment method of the infrared proximity sensor described in the preferred embodiment of the present invention is as follows: Figure 3 and Figure 4 As shown, the infrared proximity sensor dynamic threshold adjustment method includes the following steps:

[0038] Step S10: The infrared proximity sensor reads the received infrared energy value.

[0039] Specifically, the infrared proximity sensor continuously reads a plurality of received infrared energy values, for example, the infrared proximity sensor reads a plurality of received infrared energy values ​​within one cycle.

[0040] Step S20: The infrared proximity sensor compares the received infrared energy value with the pre-recorded maximum and minimum values ​​to obtain new maximum and minimum values.

[0041] Specifically, the infrared proximity sensor reads a pre-recorded maximum value and a pre-recorded minimum value; the infrared proximity sensor compares the received multiple infrared energy values ​​with the pre-recorded maximum value and the pre-recorded minimum value respectively, for example, compares all the latest read values ​​with the pre-recorded maximum value, and then compares all the latest read values ​​with the pre-recorded minimum value; after the comparison, a size comparison result is obtained, for example, if all the latest read values ​​have an infrared energy value greater than the pre-recorded maximum value, then a new maximum value is updated, or if all the latest read values ​​do not have an infrared energy value greater than the pre-recorded maximum value, then the pre-stored maximum value remains unchanged and is still the maximum value; for example, if all the latest read values ​​have an infrared energy value smaller than the pre-recorded minimum value, then a new minimum value is updated, or if all the latest read values ​​do not have an infrared energy value smaller than the pre-recorded minimum value, then the pre-stored minimum value remains unchanged and is still the minimum value; the infrared proximity sensor updates the maximum value and the minimum value according to the size comparison result to obtain a new maximum value and a new minimum value.

[0042] Step S30: The infrared proximity sensor calculates the difference between the new maximum value and the new minimum value, and determines whether the difference is greater than the proximity threshold.

[0043] Specifically, the infrared proximity sensor calculates the difference between the new maximum and minimum values, that is, calculates the difference between the updated maximum and minimum values, obtains a difference calculation result, and then compares the calculated difference result with the proximity threshold to determine whether the difference is greater than the proximity threshold.

[0044] The Near Threshold represents the infrared proximity sensor reading when the distance between the obstruction and the infrared proximity sensor is less than a first preset value; when the change of the infrared proximity sensor is greater than the Near Threshold, the software program of the infrared proximity sensor reports an interrupt event. The Far Threshold represents the infrared proximity sensor reading when the distance between the obstruction and the infrared proximity sensor is greater than a second preset value; when the change of the infrared proximity sensor is less than the Far Threshold, the software program of the infrared proximity sensor reports an interrupt event.

[0045] Step S40: If the difference is greater than the proximity threshold, the infrared proximity sensor adjusts the distance threshold according to the difference between the new maximum value and the new minimum value.

[0046] Furthermore, if the difference is not greater than the proximity threshold, the process returns to continue executing the infrared proximity sensor to read the received infrared energy value. The infrared proximity sensor compares the received infrared energy value with the pre-recorded maximum and minimum values ​​to obtain new maximum and minimum values. The infrared proximity sensor calculates the difference between the new maximum and minimum values, and then continues to determine whether the difference is greater than the proximity threshold.

[0047] That is to say, Figure 4 As shown, the infrared proximity sensor reads the received infrared energy value, compares the received infrared energy value with the pre-recorded maximum and minimum values, obtains a new maximum and minimum value, calculates the difference between the new maximum and minimum values, and determines whether the difference is greater than the proximity threshold. When the difference is not greater than the proximity threshold (wherein the proximity threshold represents the infrared proximity sensor reading when the distance between the obstruction and the infrared proximity sensor is less than a first preset value, and when the change of the infrared proximity sensor is greater than the proximity threshold, the software program of the infrared proximity sensor reports an interrupt event), returns to continue reading the received infrared energy value through the infrared proximity sensor. When the difference is greater than the proximity threshold, the infrared proximity sensor adjusts the distance threshold according to the difference between the new maximum and minimum values ​​(wherein the distance threshold represents the infrared proximity sensor reading when the distance between the obstruction and the infrared proximity sensor is greater than a second preset value, and when the change of the infrared proximity sensor is less than the distance threshold, the software program of the infrared proximity sensor reports an interrupt event), and then continues to return to read the received infrared energy value through the infrared proximity sensor.

[0048] For example, the present invention uses the experimental data of three different devices using a standard black card test (reflectivity is 6%) as an example:

[0049]

[0050] As shown in the table above, as the distance between the obstacle (standard black card) and the infrared proximity sensor surface increases, the readings of the infrared proximity sensors (3 devices) gradually decrease. At the same time, the maximum readings of different infrared proximity sensors are different, and there are consistency differences in the readings at the same distance.

[0051] like Figure 5 As shown, it is assumed that Figure 5 The natural logarithm of the distance in is taken as the X-axis, and the natural logarithm of the change in the reading of the infrared proximity sensor is taken as the Y-axis, and the relationship between the reading of the infrared proximity sensor and the obstacle distance can be obtained. Figure 5 In the figure, Series1 indicates 1# infrared proximity sensor, Series2 indicates 2# infrared proximity sensor, and Series3 indicates 3# infrared proximity sensor; Figure 5 It can be seen that the readings of different infrared proximity sensors first increase and then decrease as the distance to the obstacle increases.

[0052] The test results of the traditional solution with fixed threshold setting are as follows:

[0053]

[0054] It can be seen from the above table that when the same threshold is set, the response distances of different infrared proximity sensors are different.

[0055] The threshold is dynamically adjusted using the solution of the present invention. When the threshold of the infrared proximity sensor is greater than the proximity threshold (for example, the proximity threshold is 120), the distance threshold is adjusted in real time according to the difference between the maximum value and the minimum value. As the distance between the test standard black card and the infrared proximity sensor gradually approaches 0cm, the distance threshold is set as shown in the following table:

[0056]

[0057] The results of the solution of the present invention and the traditional solution are compared as follows:

[0058]

[0059]

[0060] From the comparison in the above table, it can be seen that after using the solution of the present invention, on different terminal devices, the difference between the maximum and minimum values ​​of the actual distance of the infrared sensor when the reading is equal to the distance from the threshold is reduced from 0.5 cm to 0.2 cm, and the performance consistency of the infrared proximity sensor is significantly improved.

[0061] In order to overcome the technical problem that the same fixed threshold is affected by tolerance on different devices and the performance consistency of the proximity sensor is poor, the present invention provides a dynamic threshold adjustment method for dynamically setting the threshold by recording the maximum value of the proximity sensor reading at that time, which can optimize the consistency difference of the proximity sensor. The proximity sensor continuously reads the received readings; the proximity sensor calculates the maximum and minimum values ​​according to the read values; the proximity sensor calculates the difference between the maximum and minimum values; when the difference recorded by the proximity sensor is greater than the proximity threshold, the proximity sensor calculates and adjusts the distance threshold in a certain way according to the difference. The proximity sensor always makes judgments based on the proximity threshold and the distance threshold, so that the terminal device turns on or off the display screen and touch sensor. This technical solution is mainly applied to mobile devices equipped with proximity sensors, and is implemented in the software driver of the mobile device.

[0062] Furthermore, the present invention can also modify the maximum value to the median or quartile, etc.; modify the difference between the maximum value and the minimum value to the difference between the maximum value and a preset threshold, etc.

[0063] Furthermore, if Figure 6 As shown, based on the above-mentioned infrared proximity sensor dynamic threshold adjustment method, the present invention also provides a mobile device accordingly, and the mobile device includes an infrared proximity sensor 50, a processor 10, a memory 20 and a display 30. Figure 6 Only some of the components of the mobile device are shown, but it should be understood that implementing all of the components shown is not a requirement, and more or fewer components may be implemented instead.

[0064] In some embodiments, the memory 20 may be an internal storage unit of the mobile device, such as a hard disk or memory of the mobile device. In other embodiments, the memory 20 may also be an external storage device of the mobile device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the mobile device. Further, the memory 20 may also include both an internal storage unit of the mobile device and an external storage device. The memory 20 is used to store application software and various types of data installed on the mobile device, such as the program code of the mobile device installed. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, the memory 20 stores an infrared proximity sensor dynamic threshold adjustment program 40, which can be executed by the processor 10, thereby realizing the infrared proximity sensor dynamic threshold adjustment method in the present application.

[0065] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing the infrared proximity sensor dynamic threshold adjustment method.

[0066] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the mobile device and to display a visual user interface. The components 10-30 of the mobile device communicate with each other via a system bus.

[0067] In one embodiment, when the processor 10 executes the infrared proximity sensor dynamic threshold adjustment program 40 in the memory 20, the following steps are implemented:

[0068] The infrared proximity sensor reads the received infrared energy value;

[0069] The infrared proximity sensor compares the received infrared energy value with the pre-recorded maximum and minimum values ​​to obtain new maximum and minimum values;

[0070] The infrared proximity sensor calculates the difference between the new maximum value and the minimum value, and determines whether the difference is greater than the proximity threshold;

[0071] If the difference is greater than the proximity threshold, the infrared proximity sensor adjusts the distance threshold according to the difference between the new maximum and minimum values.

[0072] The infrared proximity sensor reads the received infrared energy value, specifically:

[0073] The infrared proximity sensor continuously reads a plurality of received infrared energy values.

[0074] The infrared proximity sensor compares the received infrared energy value with the pre-recorded maximum and minimum values ​​to obtain new maximum and minimum values, specifically including:

[0075] The infrared proximity sensor reads the pre-recorded maximum and minimum values;

[0076] The infrared proximity sensor compares the received multiple infrared energy values ​​with the pre-recorded maximum value and minimum value respectively;

[0077] After the comparison, the infrared proximity sensor updates the maximum value and the minimum value according to the comparison result to obtain a new maximum value and a new minimum value.

[0078] The proximity threshold represents a reading of the infrared proximity sensor when the distance between the blocking object and the infrared proximity sensor is less than a first preset value.

[0079] When the change amount of the infrared proximity sensor is greater than the proximity threshold, the software program of the infrared proximity sensor reports an interrupt event.

[0080] The distance threshold represents the infrared proximity sensor reading when the distance between the blocking object and the infrared proximity sensor is greater than a second preset value.

[0081] When the change amount of the infrared proximity sensor is less than the distance threshold, the software program of the infrared proximity sensor reports an interrupt event.

[0082] The reading of the infrared proximity sensor increases first and then decreases as the distance from the obstacle increases.

[0083] That is to say, in order to overcome the technical problem of poor performance consistency of proximity sensors due to tolerances on different devices caused by the same fixed threshold, the present invention provides a dynamic threshold adjustment method for dynamically setting the threshold by recording the maximum value of the proximity sensor reading at that time, which can optimize the consistency difference of the proximity sensor. The proximity sensor continuously reads the received readings; the proximity sensor calculates the maximum and minimum values ​​based on the read values; the proximity sensor calculates the difference between the maximum and minimum values; when the difference recorded by the proximity sensor is greater than the proximity threshold, the proximity sensor calculates and adjusts the distance threshold in a certain way based on the difference. The proximity sensor always makes judgments based on the proximity threshold and the distance threshold, so that the terminal device turns on or off the display screen and touch sensor. This technical solution is mainly applied to mobile devices equipped with proximity sensors, and is implemented in the software driver of the mobile device.

[0084] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores an infrared proximity sensor dynamic threshold adjustment program, and when the infrared proximity sensor dynamic threshold adjustment program is executed by a processor, the steps of the infrared proximity sensor dynamic threshold adjustment method as described above are implemented.

[0085] In summary, the present invention provides a method for adjusting the dynamic threshold of an infrared proximity sensor, a mobile device, and a computer-readable storage medium, the method comprising: the infrared proximity sensor reads the received infrared energy value; the infrared proximity sensor compares the received infrared energy value with the pre-recorded maximum and minimum values ​​to obtain a new maximum and minimum value; the infrared proximity sensor calculates the difference between the new maximum and minimum values, and determines whether the difference is greater than the approach threshold; if the difference is greater than the approach threshold, the infrared proximity sensor adjusts the distance threshold according to the difference between the new maximum and minimum values. The present invention realizes a dynamic threshold adjustment method for dynamically setting the threshold by recording the maximum and minimum values ​​of the reading of the infrared proximity sensor at that time, and can optimize the consistency difference of the infrared proximity sensor.

[0086] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0087] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the program can be stored in a computer-readable storage medium that can be read by a computer, and the program can include the processes of the above-mentioned method embodiments when executed. The computer-readable storage medium can be a memory, a disk, an optical disk, etc.

[0088] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A method for adjusting a dynamic threshold of an infrared proximity sensor, characterized in that: The infrared proximity sensor dynamic threshold adjustment method comprises: The infrared proximity sensor reads the received infrared energy value; The infrared proximity sensor reads the received infrared energy value, specifically: The infrared proximity sensor continuously reads a plurality of received infrared energy values; The infrared proximity sensor compares the received infrared energy value with the pre-recorded maximum and minimum values ​​to obtain new maximum and minimum values; The infrared proximity sensor compares the received infrared energy value with the pre-recorded maximum and minimum values ​​to obtain new maximum and minimum values, specifically including: The infrared proximity sensor reads the pre-recorded maximum and minimum values; The infrared proximity sensor compares the received multiple infrared energy values ​​with the pre-recorded maximum value and minimum value respectively; After the comparison, the infrared proximity sensor updates the infrared energy value to the maximum value when the infrared energy value is greater than the pre-recorded maximum value, and updates the infrared energy value to the minimum value when the infrared energy value is less than the pre-recorded minimum value, thereby obtaining new maximum and minimum values. The infrared proximity sensor calculates the difference between the new maximum value and the minimum value, and determines whether the difference is greater than the proximity threshold; The proximity threshold represents the infrared proximity sensor reading when the distance between the obstruction and the infrared proximity sensor is less than a first preset value; If the difference is not greater than the proximity threshold, return to continue reading the received infrared energy value through the infrared proximity sensor; If the difference is greater than the proximity threshold, the infrared proximity sensor adjusts the distance threshold according to the difference between the new maximum and minimum values; The distance threshold represents a reading of the infrared proximity sensor when the distance between the blocking object and the infrared proximity sensor is greater than a second preset value.

2. The method for adjusting the dynamic threshold of an infrared proximity sensor according to claim 1, characterized in that: When the difference of the infrared proximity sensor is greater than the proximity threshold, the software program of the infrared proximity sensor reports an interrupt event.

3. The method for adjusting the dynamic threshold of an infrared proximity sensor according to claim 1, characterized in that: When the difference of the infrared proximity sensor is less than the distance threshold, the software program of the infrared proximity sensor reports an interrupt event.

4. The method for adjusting the dynamic threshold of an infrared proximity sensor according to claim 1, characterized in that: The reading of the infrared proximity sensor increases first and then decreases as the distance to the obstacle increases.

5. A mobile device, characterized in that: The mobile device is equipped with an infrared proximity sensor, and the mobile device also includes: a memory, a processor, and an infrared proximity sensor dynamic threshold adjustment program stored in the memory and executable on the processor, wherein the infrared proximity sensor dynamic threshold adjustment program, when executed by the processor, implements the steps of the infrared proximity sensor dynamic threshold adjustment method as described in any one of claims 1 to 4.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an infrared proximity sensor dynamic threshold adjustment program, and when the infrared proximity sensor dynamic threshold adjustment program is executed by a processor, the steps of the infrared proximity sensor dynamic threshold adjustment method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • A method and apparatus for adjusting the sensing threshold of an infrared proximity sensor

    CN102265252A

  • Self-adaptive induction threshold adjusting system and method for proximity sensor

    CN104570144A