CN108873005B - Proximity detection method and apparatus, electronic apparatus, storage medium, and device - Google Patents

Proximity detection method and apparatus, electronic apparatus, storage medium, and device Download PDF

Info

Publication number
CN108873005B
CN108873005B CN201810554869.9A CN201810554869A CN108873005B CN 108873005 B CN108873005 B CN 108873005B CN 201810554869 A CN201810554869 A CN 201810554869A CN 108873005 B CN108873005 B CN 108873005B
Authority
CN
China
Prior art keywords
electronic device
intensity value
sub
proximity sensor
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810554869.9A
Other languages
Chinese (zh)
Other versions
CN108873005A (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 Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810554869.9A priority Critical patent/CN108873005B/en
Publication of CN108873005A publication Critical patent/CN108873005A/en
Application granted granted Critical
Publication of CN108873005B publication Critical patent/CN108873005B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S17/00Systems using the reflection or reradiation of electromagnetic waves other than radio waves, e.g. lidar systems
    • G01S17/02Systems using the reflection of electromagnetic waves other than radio waves
    • G01S17/06Systems determining position data of a target
    • G01S17/08Systems determining position data of a target for measuring distance only
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S7/00Details of systems according to groups G01S13/00, G01S15/00, G01S17/00
    • G01S7/02Details of systems according to groups G01S13/00, G01S15/00, G01S17/00 of systems according to group G01S13/00
    • G01S7/36Means for anti-jamming, e.g. ECCM, i.e. electronic counter-counter measures

Abstract

The invention discloses a proximity detection method for an electronic device. The electronic device includes a proximity sensor for emitting an infrared pulse signal, one pulse period of which includes a plurality of sub-pulse periods, each sub-pulse period including a peak and a trough. The control method comprises the following steps: acquiring a first intensity value acquired by a proximity sensor when the wave trough of any sub-pulse period is reached; acquiring a second intensity value acquired by the proximity sensor when the peak of the sub-pulse period is the same as the wave trough; and judging whether the object is close to or far away from the electronic device according to the difference value of the first intensity value and the second intensity value. Therefore, whether the object is close to or far away from the electronic device is judged according to the difference value of the first intensity value collected at the wave trough and the second intensity value collected at the wave crest, and the interference of the ambient light on the detection of the proximity sensor can be reduced. The invention also discloses a proximity detection device, an electronic device, a computer readable storage medium and computer equipment.

Description

Proximity detection method and apparatus, electronic apparatus, storage medium, and device
Technical Field
The present invention relates to the field of electronic technologies, and in particular, to a proximity detection method, a proximity detection apparatus, an electronic apparatus, a computer-readable storage medium, and a computer device.
Background
The proximity sensor detects a distance between an object and the mobile terminal by using the emitted infrared light to determine whether the object is far away from or close to the mobile terminal. In some use scenes, the proximity sensor is interfered by infrared rays in sunlight, so that judgment errors occur.
Disclosure of Invention
To solve the above technical problem, the present invention provides a control method, a proximity detection device, an electronic device, a computer-readable storage medium, and a computer apparatus.
The invention provides a proximity detection method for an electronic device, wherein the electronic device comprises a proximity sensor, the proximity sensor is used for emitting an infrared pulse signal, one pulse period of the infrared pulse signal comprises a plurality of sub-pulse periods, and each sub-pulse period comprises a wave crest and a wave trough, and the control method comprises the following steps:
acquiring a first intensity value acquired by the proximity sensor when the wave trough of any sub-pulse period exists;
acquiring a second intensity value acquired by the proximity sensor when the wave crest of the sub-pulse period is the same as the wave trough; and
and judging whether the object is close to or far away from the electronic device according to the difference value of the first intensity value and the second intensity value.
In some embodiments, the proximity detection method comprises the steps of:
detecting the brightness value of the current environment light; and
and when the brightness value is greater than or equal to a preset brightness threshold value, acquiring a first intensity value acquired by the proximity sensor at the trough of any sub-pulse period.
In some embodiments, the proximity detection method comprises the steps of:
and when the brightness value is smaller than the preset brightness threshold, judging whether the object is close to or far away from the electronic device according to the second intensity value.
In some embodiments, the step of detecting the brightness value of the current ambient light includes:
acquiring a multi-frame image of a current environment; and
and calculating the brightness value of the current environment according to the multi-frame image.
In some embodiments, the step of acquiring a first intensity value acquired by the proximity sensor at a trough of any one of the sub-pulse periods when the brightness value is greater than or equal to a predetermined threshold brightness value comprises:
detecting the inclination angle of the electronic device; and
and when the inclination angle is smaller than a preset angle threshold, acquiring a first intensity value acquired by the proximity sensor when the trough of any sub-pulse period exists.
In some embodiments, the proximity detection method comprises the steps of:
and when the inclination angle is larger than or equal to a preset angle threshold, judging whether the object is close to or far away from the electronic device according to the second intensity value.
The present invention provides a proximity detection apparatus for an electronic apparatus including a proximity sensor for emitting an infrared pulse signal, one pulse period of the infrared pulse signal including a plurality of sub-pulse periods, each sub-pulse period including a peak and a trough, the proximity detection apparatus including:
the acquisition module is used for acquiring a first intensity value acquired by the proximity sensor when the wave trough of any sub-pulse period exists;
the acquisition module is further used for acquiring a second intensity value acquired by the proximity sensor when the peak of the sub-pulse period is the same as the wave trough; and
and the judging module is used for judging whether the object is close to or far away from the electronic device according to the difference value of the first intensity value and the second intensity value.
The present invention provides an electronic device, comprising:
a proximity sensor for emitting an infrared pulse signal, one pulse period of the infrared pulse signal comprising a plurality of sub-pulse periods, each sub-pulse period comprising a peak and a trough; and
a processor to:
acquiring a first intensity value acquired by the proximity sensor when the wave trough of any sub-pulse period exists;
acquiring a second intensity value acquired by the proximity sensor when the wave crest of the sub-pulse period is the same as the wave trough; and
and judging whether the object is close to or far away from the electronic device according to the difference value of the first intensity value and the second intensity value.
In some embodiments, the electronic device further comprises an ambient light sensor configured to detect a brightness value of the current ambient light, and the processor is further configured to obtain a first intensity value collected by the proximity sensor at a trough of any one of the sub-pulse periods when the brightness value is greater than or equal to a predetermined threshold brightness value.
In some embodiments, the processor is further configured to:
and when the brightness value is smaller than the preset brightness threshold, judging whether the object is close to or far away from the electronic device according to the second intensity value.
In some embodiments, the electronic device includes a camera configured to obtain a plurality of frames of images of a current environment, and the processor is configured to calculate the brightness value of the current environment according to the plurality of frames of images.
In some embodiments, the electronic device includes an acceleration sensor configured to detect a tilt angle of the electronic device, and the processor is configured to obtain a first intensity value collected by the proximity sensor at a trough of any one of the sub-pulse periods when the tilt angle is less than an angle predetermined threshold.
In some embodiments, the processor is configured to determine whether the object is approaching or departing from the electronic device according to the second intensity value when the tilt angle is greater than or equal to the angle predetermined threshold.
One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the proximity detection method are provided.
The invention provides a computer device comprising a memory and a processor, wherein the memory stores computer readable instructions, and the instructions, when executed by the processor, cause the processor to execute the proximity detection method.
According to the approach detection method, the approach detection device, the electronic device, the computer-readable storage medium and the computer apparatus of the embodiments of the present invention, a first intensity value when the infrared pulse signal is at a valley and a second intensity value when the infrared pulse signal is at a peak are respectively collected, and then whether an object is approaching to or away from the electronic device is determined according to a difference between the first intensity value and the second intensity value. In this way, the interference of the infrared light in the ambient light to the detection of the proximity sensor can be reduced.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a block diagram of an electronic device according to an embodiment of the invention;
FIG. 2 is a schematic diagram of a pulse signal for a proximity detection method according to an embodiment of the present invention;
FIG. 3 is a schematic flow diagram of a proximity detection method in accordance with an embodiment of the present invention;
FIG. 4 is a block schematic diagram of a proximity detection device in accordance with an embodiment of the present invention;
FIG. 5 is a block schematic diagram of a computer device of an embodiment of the present invention;
FIG. 6 is a schematic diagram of an application scenario of an electronic device according to an embodiment of the present invention;
FIG. 7 is a schematic view of another application scenario of the electronic device according to the embodiment of the present invention;
FIG. 8 is another schematic flow chart of a proximity detection method in accordance with an embodiment of the present invention;
FIG. 9 is a schematic view of another application scenario of the electronic device according to the embodiment of the present invention;
FIG. 10 is a schematic flow chart of a proximity detection method according to an embodiment of the present invention;
FIG. 11 is a schematic flow chart of a proximity detection method according to an embodiment of the present invention;
FIG. 12 is a diagram illustrating a further application scenario of the electronic device according to the embodiment of the present invention;
FIG. 13 is a diagram illustrating a further application scenario of the electronic device according to the embodiment of the present invention;
fig. 14 is a schematic view of another application scenario of the electronic device according to the embodiment of the invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
A proximity detection method, a proximity detection apparatus 200, an electronic apparatus 100, a computer-readable storage medium, and a computer device 300 according to embodiments of the present invention are described in detail below with reference to fig. 1 to 14.
Referring to fig. 1 to 5, an embodiment of the invention provides a proximity detection method for an electronic device 100. The electronic device 100 comprises a proximity sensor 162, the proximity sensor 162 being configured to emit an infrared pulse signal, a pulse period (T) of the infrared pulse signal comprising a plurality of sub-pulse periods (T), each sub-pulse period (T) comprising a peak and a trough. The approach detection method includes the steps of:
s10: acquiring a first intensity value acquired by the proximity sensor 162 at the trough of any sub-pulse period;
s20: acquiring a second intensity value acquired by the proximity sensor 162 at a peak of the same sub-pulse period as the trough; and
s30: and judging whether the object is close to or far away from the electronic device 100 according to the difference value of the first intensity value and the second intensity value.
The embodiment of the invention also provides a proximity detection device 200 for the electronic device 100. The proximity detection method according to the embodiment of the present invention can be realized by the proximity detection device 200 according to the embodiment of the present invention. The proximity detection device 200 includes an acquisition module 21 and a determination module 22, and steps S10 and S20 may be implemented by the acquisition module 21, and step S30 may be implemented by the determination module 22. That is, the obtaining module 21 may be configured to obtain a first intensity value collected by the proximity sensor 162 at a trough of any one sub-pulse period and obtain a second intensity value collected by the proximity sensor 162 at a peak of the same sub-pulse period as the trough. The determining module 22 may be configured to determine whether the object is close to or far away from the electronic device 100 according to a difference between the first intensity value and the second intensity value.
The embodiment of the invention also provides an electronic device 100. The electronic device 100 includes a proximity sensor 162 and a processor 24. Step S10, step S20, and step S30 may be implemented by the processor 24. That is, the processor 24 may be configured to obtain a first intensity value collected by the proximity sensor 162 at a trough of any one sub-pulse period and obtain a second intensity value collected by the proximity sensor 162 at a peak of the same sub-pulse period as the trough, and determine whether the object is close to or far from the electronic device 100 according to a difference between the first intensity value and the second intensity value.
The embodiment of the invention also provides computer equipment 300. In an embodiment of the present invention, the proximity detection apparatus 200 may be employed in a computer device 300. The computer device 300 may be a mobile phone, a tablet computer, a notebook computer, an intelligent bracelet, an intelligent watch, an intelligent helmet, an intelligent glasses, a game console, and the like, and the electronic apparatus 100 according to the embodiment of the present invention may also be one of the computer devices 300.
The embodiment of the present invention is described by taking the electronic device 100 as a mobile phone as an example. The proximity sensor 162 in the cell phone detects the distance between the electronic device 100 and the user to control the display to go off or light up. Referring to fig. 6 and 7, when performing distance detection, for example, when a user is receiving or making a call and brings a mobile phone close to the head, the proximity sensor 162 generates distance detection information by calculating the intensity of infrared light emitted by the emitter and the intensity of infrared light reflected by the receiver, the processor 24 sends a corresponding instruction to the controller according to the distance detection information, and the controller turns off the screen according to the instruction. When the mobile phone is far away from the head, the processor calculates and sends an instruction according to the detection information fed back by the proximity sensor 162 again, and the controller lights the screen again according to the instruction.
However, in the practical application process of the proximity sensor, the proximity sensor is sometimes in a strong light environment, for example, in an environment where sunlight is directly radiated outdoors, the sunlight contains infrared light, which will cause certain interference to data collected by the proximity sensor, and particularly, when the electronic device is at different receiving angles, the proximity sensor will fluctuate due to the intensity of the received infrared light, so that the proximity sensor cannot accurately determine whether an object is sheltered from or close to the electronic device.
The proximity detection method, the proximity detection apparatus 200, the electronic apparatus 100, the computer-readable storage medium, and the computer device 300 according to the embodiments of the present invention respectively collect a first intensity value when the infrared pulse signal is at a valley and a second intensity value when the infrared pulse signal is at a peak, and then determine whether the object is close to or far from the electronic apparatus 100 according to a difference between the first intensity value and the second intensity value. In this way, the interference of the infrared light in the ambient light with the detection of the proximity sensor 162 can be reduced.
Specifically, when the pulse signal is at a trough (low level), the proximity sensor 162 does not emit infrared rays. At this time, the infrared ray intensity value collected by the proximity sensor 162 is the ambient infrared ray intensity value. When the pulse signal is at a peak (high level), the proximity sensor 162 emits infrared rays. At this time, the infrared intensity collected by the proximity sensor 162 is the sum of the infrared intensity in the ambient light and the infrared intensity emitted and reflected back by the object. The intensity value of the infrared ray reflected by the object can be obtained by subtracting the data acquired at the peak and the data acquired at the trough, and the difference is used as data for judging whether the object is close to the electronic device 100. In this way, interference of infrared light in the ambient light with detection data of the proximity sensor 162 can be reduced.
It should be noted that, referring to fig. 2, in the embodiment of the present invention, one pulse period (T) includes a plurality of sub-pulse periods (T), which can be understood as that a plurality of peaks and a plurality of troughs exist in one pulse period (T). One sub-pulse period (t) comprises one peak and one valley. The following embodiments, while similarly illustrated and described, may also be understood by reference to the explanations herein.
In the embodiment of the present invention, the approach sensor 162 transmits the infrared light pulse signal in a multi-pulse transmission manner. The multi-pulse transmission is understood to mean that a plurality of peaks and troughs (as shown in fig. 2) exist in one pulse period (T), that is, a plurality of pulse durations and a plurality of pulse intervals exist in one pulse period (T), that is, a plurality of peaks and troughs exist. Compared with the single pulse mode, the multi-pulse mode can transmit multiple pulses in the same period, and the duration and the interval time of each pulse are shortened. The effect of infrared light in the ambient light on the proximity sensor 162 remains substantially constant during each pulse duration and pulse interval. Thus, the accuracy of the detected information can be improved.
It can be understood that, by calculating the distance information between the object and the electronic device 100 by subtracting the first intensity value from the second intensity value, the interference of the infrared light in the environment to the detection of the proximity sensor 162 can be effectively reduced. Specifically, for example, in a normal state, when the intensity of the infrared light received by the proximity sensor 162 is below 50lm (lumen), it indicates that the distance between the object or the face and the electronic apparatus 100 is above 90mm, which indicates that the object or the face is far away from the electronic apparatus 100. When the intensity of the infrared light received by the proximity sensor 162 is above 200lm, it indicates that the distance between the object or the human face and the electronic device 100 is below 50mm, which indicates that the object or the human face approaches the electronic device 100. When the first intensity value of infrared light in the ambient light detected by the ambient light sensor 161 is 70lm, and the second intensity value of infrared light detected by the proximity sensor 162 is 85lm, subtracting the first intensity value from the second intensity value of 85lm to be 15lm (15lm is less than 50lm), which indicates that the object or the human face is far away from the electronic device 100. When the first intensity value of infrared light in the ambient light detected by the ambient light sensor 161 is 70lm, and the second intensity value of infrared light detected by the proximity sensor 162 is 350lm, subtracting the first intensity value from the second intensity value of 350lm to obtain 280lm (280lm is greater than 200lm), it indicates that an object or a human face approaches the electronic device 100. It is understood that these intensity values and distance values are exemplary only and are not limiting to the present invention, and that specific intensity values and distance values may be set as appropriate.
Referring to fig. 8, in some embodiments, a proximity detection method includes the steps of:
s101: detecting the brightness value of the current environment light; and
s102: when the brightness value is greater than or equal to the brightness predetermined threshold, a first intensity value collected by the proximity sensor 162 at the trough of any one sub-pulse period is acquired.
Referring to fig. 4, in some embodiments, step S101 and step S102 may be implemented by the obtaining module 21. That is, the obtaining module 21 may detect the brightness value of the current ambient light, and trigger the step S10 when the brightness value is greater than or equal to the brightness predetermined threshold.
Referring to fig. 1, in some embodiments, the electronic device 100 includes an ambient light sensor 161, and step S101 and step S102 may be implemented by the processor 24. That is, the processor 24 may acquire the brightness value of the current ambient light detected by the ambient light sensor 161, and trigger step S10 when the brightness value is greater than or equal to the brightness predetermined threshold.
Specifically, referring to fig. 9, when the user is in a strong light environment, such as under the sun, the proximity sensor 162 is greatly affected by infrared rays in the ambient light during the distance detection process, and a detection error of the proximity sensor 162 is more easily caused. Whether the electronic device 100 is in a strong light environment or not can be determined by the environment sensor 161, for example, the predetermined brightness threshold is 5000 lux, and when the current light intensity value acquired by the environment light sensor 161 exceeds 5000 lux, it is determined that the electronic device 100 is currently in the strong light environment, and at this time, the proximity sensor 162 may be interfered by the strong light to cause an abnormal collected value. It should be noted that the above-mentioned numerical value of the predetermined brightness threshold is merely an exemplary description, and the specific size may be set according to specific situations. Further, the brightness value of the ambient light may be calculated by an image sensor in the electronic device 100.
Referring to fig. 8, in some embodiments, a proximity detection method includes the steps of:
s103: when the brightness value is less than the brightness predetermined threshold, the object is close to or far away from the electronic device 100 according to the second intensity value.
Referring to fig. 4, in some embodiments, step S103 may be implemented by the determining module 22. That is, the determining module 22 may determine whether the object is close to or far from the electronic device 100 according to the second intensity value when the brightness value is smaller than the predetermined brightness threshold.
Referring to fig. 1, in some embodiments, step S103 may be implemented by the processor 24. That is, the processor 24 may determine whether the object is close to or far from the electronic device 100 according to the second intensity value when the brightness value is smaller than the predetermined threshold value of brightness.
Specifically, when the brightness value is smaller than the predetermined brightness threshold, it indicates that the electronic device 100 is not in a strong light environment, and the infrared light in the current environment has less influence on the proximity sensor 162. For example, when the user is in a low-light environment such as indoors, the infrared light in the ambient light is small, and the influence on the proximity sensor 162 is negligible, so that it is possible to determine whether the object is approaching or moving away from the electronic apparatus 100 by directly using the second intensity value detected by the proximity sensor 162 as the detection information.
Referring to fig. 10, in some embodiments, the step S101 of detecting the brightness value of the current ambient light includes:
s1011: acquiring a multi-frame image of a current environment; and
s1012: and calculating the brightness value of the current environment according to the multi-frame images.
Referring to fig. 4, in some embodiments, the proximity detection apparatus 200 includes a calculation module 23. Step S1011 may be implemented by the obtaining module 21, and step S1012 may be implemented by the calculating module 23. That is, the obtaining module 21 may obtain a multi-frame image of the current environment, and the calculating module 23 may calculate the brightness value of the current environment according to the multi-frame image.
Referring to fig. 1, in some embodiments, the electronic device 100 includes the camera 163, and steps S1011 and S1012 can be implemented by the processor 24. That is, the processor 24 may acquire a plurality of frame images of the current environment by using the camera 163, and calculate the brightness value of the current environment from the plurality of frame images.
Specifically, the brightness value of the current environment may also be obtained by detecting the image captured by the camera 163. For example, the luminance value of the current environment may be calculated from the luminance of RGB pixels of the captured image. It is understood that these ways of detecting the ambient light are only exemplary, and do not limit the present invention, and that the ways of detecting the ambient light may be other forms.
Referring to fig. 11, in some embodiments, step S102 includes:
s104: detecting the tilt angle of the electronic device 100; and
s105: when the inclination angle is smaller than the predetermined angle threshold, a first intensity value collected by the proximity sensor 162 at the trough of any one sub-pulse period is acquired.
Referring to fig. 4, in some embodiments, step S104 and step S105 may be implemented by the obtaining module 21. That is, the obtaining module 21 may detect the tilt angle of the electronic device 100 and trigger the step S10 when the tilt angle is greater than or equal to the predetermined angle threshold.
Referring to fig. 1, in some embodiments, the electronic device 100 includes an acceleration sensor 164, and step S104 and step S105 can be implemented by the processor 24. That is, the processor 24 may detect the tilt angle of the electronic device 100 by using the acceleration sensor 164, and trigger step S10 when the tilt angle is greater than or equal to the predetermined angle threshold.
Specifically, please refer to fig. 12, at this time, the tilt angle of the electronic device 100 is 0 degree (the electronic device 100 is parallel to the horizontal direction). Referring to fig. 13, the tilt angle of the electronic device 100 is 30 degrees (the included angle between the electronic device 100 and the horizontal direction is 30 degrees). The proximity sensor 162 can more easily receive the infrared light in the ambient light, and the influence on the proximity sensor 162 is large, so when the tilt angle of the electronic device 100 is smaller than the predetermined angle threshold, the distance between the object and the electronic device 100 can be determined by detecting the intensity of the infrared light received by the proximity sensor 162 and the intensity of the infrared light in the ambient light, and the interference caused by the detection of the proximity sensor 162 by the ambient light can be reduced. In addition, the tilt angle of the electronic device 100 may also include a tilt angle of the electronic device 100 from a vertical direction. The tilt angle of the electronic device 100 may be detected by a gravity sensor or a gyro sensor. It is understood that the specific data of the predetermined angle threshold can be set according to actual conditions.
Referring to fig. 11, in some embodiments, a proximity detection method includes the steps of:
s106: when the inclination angle is greater than or equal to the predetermined angle threshold, whether the object is close to or far away from the electronic device 100 is judged according to the second intensity value.
Referring to fig. 4, in some embodiments, step S106 may be implemented by the determining module 22. That is, the determining module 22 may determine whether the object is close to or far from the electronic device 100 according to the second intensity value when the tilt angle is greater than or equal to the predetermined angle threshold.
Referring to fig. 1, in some embodiments, step S106 may be implemented by the processor 24. That is, the processor 24 may determine whether the object is close to or far from the electronic device 100 according to the second intensity value when the tilt angle is greater than or equal to the predetermined angle threshold.
Specifically, please refer to fig. 14, in which the tilt angle of the electronic device 100 is 120 degrees. The proximity sensor 162 receives less infrared light in the ambient light, and the influence on the proximity sensor 162 is negligible, so that the second intensity value detected by the proximity sensor 162 can be directly used as the detection information to determine whether the object is approaching or departing from the electronic apparatus 100.
The embodiment of the invention also provides a computer readable storage medium. One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by the one or more processors 24, cause the processors 24 to perform the proximity detection method of any of the embodiments described above. For example, step S10 is executed: a first intensity value collected by the proximity sensor 162 at the trough of any sub-pulse period is acquired. Step S20: a second intensity value collected by the proximity sensor 162 at a peak of the same sub-pulse period as the trough is obtained. And step S30: and judging whether the object is close to or far away from the electronic device 100 according to the difference value of the first intensity value and the second intensity value.
Referring to fig. 5, the embodiment of the invention further provides a computer device 300. The computer device includes a memory 32 and a processor 24, wherein the memory 32 stores computer readable instructions, and when the instructions are executed by the processor 24, the processor 24 executes the proximity detection method according to any of the embodiments. For example, step S10 is executed: a first intensity value collected by the proximity sensor 162 at the trough of any sub-pulse period is acquired. Step S20: a second intensity value collected by the proximity sensor 162 at a peak of the same sub-pulse period as the trough is obtained. And step S30: and judging whether the object is close to or far away from the electronic device 100 according to the difference value of the first intensity value and the second intensity value.
FIG. 5 is a schematic diagram of internal modules of computer device 300, under an embodiment. The computer apparatus 300 includes a processor 24, a memory 32 (e.g., a nonvolatile storage medium), an internal memory 33, an input device 34, an ambient light sensor 161, a proximity sensor 162, a camera 163, and an acceleration sensor 164, which are connected by a system bus 31. The memory 32 of the computer device 300 has stored therein an operating system and computer readable instructions. The computer readable instructions are executable by the processor 24 to implement the proximity detection method of any of the above embodiments. Processor 24 may be used to provide computing and control capabilities that support the operation of the overall computer device 300. The internal memory 33 of the computer device 300 provides an environment for the execution of computer readable instructions in the memory 32. The input device 34 of the computer device 300 may be a touch panel on a display screen, a button, a track ball or a touch pad arranged on a housing of the computer device 300, or an external keyboard, a touch pad or a mouse. The computer device 300 may be a mobile phone, a tablet computer, a notebook computer, a personal digital assistant, or a wearable device (e.g., a smart bracelet, a smart watch, a smart helmet, smart glasses), etc. It will be appreciated by those skilled in the art that the configurations shown in the figures are merely schematic representations of portions of configurations relevant to the present inventive arrangements and are not intended to limit the computing device 300 to which the present inventive arrangements may be applied, and that a particular computing device 300 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
It will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by a computer program, which can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above embodiments of the methods. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), or the like.
The above disclosure provides many different embodiments, or examples, for implementing different features of the invention. The components and arrangements of the specific examples are described above to simplify the present disclosure. Of course, they are merely examples and are not intended to limit the present invention. Furthermore, the present invention may repeat reference numerals and/or letters in the various examples, such repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed. In addition, the present invention provides examples of various specific processes and materials, but one of ordinary skill in the art may recognize applications of other processes and/or uses of other materials.
In the description of the present specification, reference to the description of the terms "one embodiment", "some embodiments", "an illustrative embodiment", "an example", "a specific example", or "some examples", etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims (11)

1. A proximity detection method for an electronic device, the electronic device including a proximity sensor for emitting a multi-pulse infrared pulse signal, one pulse period of the infrared pulse signal including a plurality of sub-pulse periods, each sub-pulse period including a peak and a valley, the proximity detection method comprising the steps of:
acquiring a first intensity value acquired by the proximity sensor when the wave trough of any sub-pulse period exists;
acquiring a second intensity value acquired by the proximity sensor when the wave crest of the sub-pulse period is the same as the wave trough;
detecting the brightness value of the current environment light;
when the brightness value is larger than or equal to a preset brightness threshold value, judging whether the object is close to or far away from the electronic device according to the difference value of the first intensity value and the second intensity value;
and when the brightness value is smaller than the preset brightness threshold, judging whether the object is close to or far away from the electronic device according to the second intensity value.
2. The proximity detection method according to claim 1, wherein the step of detecting the brightness value of the current ambient light includes:
acquiring a multi-frame image of a current environment; and
and calculating the brightness value of the current environment according to the multi-frame image.
3. The proximity detection method of claim 1, wherein the step of acquiring a first intensity value acquired by the proximity sensor at a trough of any one of the sub-pulse periods when the brightness value is greater than or equal to a brightness predetermined threshold value comprises:
detecting the inclination angle of the electronic device; and
and when the inclination angle is smaller than a preset angle threshold, acquiring a first intensity value acquired by the proximity sensor when the trough of any sub-pulse period exists.
4. The proximity detection method according to claim 3, wherein the proximity detection method comprises the steps of:
and when the inclination angle is larger than or equal to a preset angle threshold, judging whether the object is close to or far away from the electronic device according to the second intensity value.
5. A proximity detection apparatus for an electronic device, the electronic device including a proximity sensor for emitting a multi-pulse infrared pulse signal, one pulse period of the infrared pulse signal including a plurality of sub-pulse periods, each sub-pulse period including a peak and a valley, the proximity detection apparatus comprising:
the acquisition module is used for acquiring a first intensity value acquired by the proximity sensor when the wave trough of any sub-pulse period exists;
the acquisition module is further used for acquiring a second intensity value acquired by the proximity sensor when the peak of the sub-pulse period is the same as the wave trough, and detecting the brightness value of the current ambient light; and
and the judging module is used for judging whether the object is close to or far away from the electronic device according to the difference value of the first intensity value and the second intensity value when the brightness value is greater than or equal to a preset brightness threshold value, and is used for judging whether the object is close to or far away from the electronic device according to the second intensity value when the brightness value is less than the preset brightness threshold value.
6. An electronic device, comprising:
a proximity sensor for emitting a multi-pulse infrared pulse signal, one pulse period of the infrared pulse signal comprising a plurality of sub-pulse periods, each sub-pulse period comprising a peak and a trough;
an ambient light sensor for detecting brightness value of current ambient light
A processor to:
acquiring a first intensity value acquired by the proximity sensor when the wave trough of any sub-pulse period exists;
acquiring a second intensity value acquired by the proximity sensor when the wave crest of the sub-pulse period is the same as the wave trough;
when the brightness value is larger than or equal to a preset brightness threshold value, judging whether the object is close to or far away from the electronic device according to the difference value of the first intensity value and the second intensity value;
and when the brightness value is smaller than the preset brightness threshold, judging whether the object is close to or far away from the electronic device according to the second intensity value.
7. The electronic device of claim 6, wherein the electronic device comprises a camera configured to obtain a plurality of frame images of a current environment, and wherein the processor is configured to calculate the brightness value of the current environment from the plurality of frame images.
8. The electronic device of claim 6, wherein the electronic device includes an acceleration sensor configured to detect a tilt angle of the electronic device, and wherein the processor is configured to obtain a first intensity value collected by the proximity sensor at a trough of any sub-pulse period when the tilt angle is less than an angle predetermined threshold.
9. The electronic device of claim 8, wherein the processor is configured to determine whether the object is approaching or departing from the electronic device according to the second intensity value when the tilt angle is greater than or equal to the predetermined angle threshold.
10. One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the proximity detection method of any of claims 1 to 4.
11. A computer device comprising a memory and a processor, the memory having stored therein computer readable instructions that, when executed by the processor, cause the processor to perform the proximity detection method of any of claims 1 to 4.
CN201810554869.9A 2018-06-01 2018-06-01 Proximity detection method and apparatus, electronic apparatus, storage medium, and device Active CN108873005B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810554869.9A CN108873005B (en) 2018-06-01 2018-06-01 Proximity detection method and apparatus, electronic apparatus, storage medium, and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810554869.9A CN108873005B (en) 2018-06-01 2018-06-01 Proximity detection method and apparatus, electronic apparatus, storage medium, and device

Publications (2)

Publication Number Publication Date
CN108873005A CN108873005A (en) 2018-11-23
CN108873005B true CN108873005B (en) 2021-11-02

Family

ID=64336146

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810554869.9A Active CN108873005B (en) 2018-06-01 2018-06-01 Proximity detection method and apparatus, electronic apparatus, storage medium, and device

Country Status (1)

Country Link
CN (1) CN108873005B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112698420B (en) * 2019-10-23 2023-11-03 广州奕至家居科技有限公司 Object proximity sensing method and device
CN111310627B (en) * 2020-02-07 2024-01-30 广州视源电子科技股份有限公司 Detection method and device of sensing device and electronic equipment
JP2021150671A (en) * 2020-03-16 2021-09-27 ローム株式会社 Light receiving ic, proximity sensor, and electronic apparatus
CN112260672B (en) * 2020-10-19 2024-02-06 深圳市太美亚电子科技有限公司 Method for adjusting induction distance of infrared device
CN112399012B (en) * 2020-11-17 2022-03-25 惠州Tcl移动通信有限公司 Proximity sensor setting method, device and storage medium
CN115529382B (en) * 2022-02-28 2023-06-16 荣耀终端有限公司 Approach light parameter calculation method and related electronic equipment
CN116662789B (en) * 2023-07-31 2023-10-27 杭州泽天春来科技有限公司 Signal processing method and system of Fourier infrared spectrometer and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102883061A (en) * 2012-09-26 2013-01-16 广东欧珀移动通信有限公司 Method and system for controlling working state of touch screen of mobile terminal
CN106506794A (en) * 2016-09-05 2017-03-15 广东欧珀移动通信有限公司 The state monitoring method of terminal unit, device and terminal unit
CN107506757A (en) * 2017-09-30 2017-12-22 努比亚技术有限公司 A kind of lateral fingerprint module and the mobile terminal with lateral fingerprint module
CN107884764A (en) * 2017-11-22 2018-04-06 广东欧珀移动通信有限公司 Detection method, device, storage medium and the electronic equipment of proximity state

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009097516A1 (en) * 2008-01-30 2009-08-06 Mesa Imaging Ag Adaptive neighborhood filtering (anf) system and method for 3d time of flight cameras
JP4706733B2 (en) * 2008-08-07 2011-06-22 株式会社日本自動車部品総合研究所 Engine start control device
CN101719387B (en) * 2009-12-10 2012-02-08 清华大学 External ball passage detecting method and device for ball-bed high temperature gas cooled reactor
US10117598B1 (en) * 2015-11-08 2018-11-06 Sensogram Technologies, Inc. Non-invasive wearable respiration rate monitoring system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102883061A (en) * 2012-09-26 2013-01-16 广东欧珀移动通信有限公司 Method and system for controlling working state of touch screen of mobile terminal
CN106506794A (en) * 2016-09-05 2017-03-15 广东欧珀移动通信有限公司 The state monitoring method of terminal unit, device and terminal unit
CN107506757A (en) * 2017-09-30 2017-12-22 努比亚技术有限公司 A kind of lateral fingerprint module and the mobile terminal with lateral fingerprint module
CN107884764A (en) * 2017-11-22 2018-04-06 广东欧珀移动通信有限公司 Detection method, device, storage medium and the electronic equipment of proximity state

Also Published As

Publication number Publication date
CN108873005A (en) 2018-11-23

Similar Documents

Publication Publication Date Title
CN108873005B (en) Proximity detection method and apparatus, electronic apparatus, storage medium, and device
CN108874128B (en) Proximity detection method and apparatus, electronic apparatus, storage medium, and device
US11705039B2 (en) Ambient light and proximity detection method, photographing method, and terminal
CN108983250B (en) Proximity detection method and apparatus, electronic apparatus, storage medium, and device
US11770619B2 (en) Generating static images with an event camera
US10506372B2 (en) Indoor/outdoor coverage detection based on sensor inputs
CN111486950A (en) Ambient light detection method, ambient light detection device, electronic apparatus, and storage medium
WO2019024644A1 (en) Proximity detection method and apparatus, storage medium, and electronic device
KR102113668B1 (en) Power control method, distance measuring module and electronic device
CN104780320B (en) Ambient light detection method and electronic device
CN109218598B (en) Camera switching method and device and unmanned aerial vehicle
KR20180102331A (en) Electronic device including camera module and method for controlling thereof
CN112672069B (en) Exposure method and apparatus
CN113140194B (en) Brightness adjusting method, device and storage medium
US20140306943A1 (en) Electronic device and method for adjusting backlight of electronic device
CN109697422B (en) Optical motion capture method and optical motion capture camera
CN107004132B (en) Eyeball tracking device, auxiliary light source control method thereof and related device
US10348983B2 (en) Non-transitory storage medium encoded with computer readable image processing program, information processing system, information processing apparatus, and image processing method for determining a position of a subject in an obtained infrared image
KR102659504B1 (en) Electronic device for capturing image based on difference between a plurality of images and method thereof
CN112995502B (en) Image processing method and device and electronic equipment
CN112383715B (en) Image acquisition device, terminal and image acquisition method
KR20180090695A (en) Electronic device for capturing image based on difference between a plurality of images and method thereof
JP2022188988A (en) Information processing device, information processing method, and program
US20190162830A1 (en) Anti-interference ranging method and apparatus
US20160202775A1 (en) Relative location determining method, display controlling method and system applying the method

Legal Events

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