WO2019024644A1 - 接近检测方法、装置、存储介质及电子设备 - Google Patents

接近检测方法、装置、存储介质及电子设备 Download PDF

Info

Publication number
WO2019024644A1
WO2019024644A1 PCT/CN2018/094448 CN2018094448W WO2019024644A1 WO 2019024644 A1 WO2019024644 A1 WO 2019024644A1 CN 2018094448 W CN2018094448 W CN 2018094448W WO 2019024644 A1 WO2019024644 A1 WO 2019024644A1
Authority
WO
WIPO (PCT)
Prior art keywords
value
proximity
detection signal
terminal
preset
Prior art date
Application number
PCT/CN2018/094448
Other languages
English (en)
French (fr)
Inventor
周意保
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to EP18842120.0A priority Critical patent/EP3627810B1/en
Publication of WO2019024644A1 publication Critical patent/WO2019024644A1/zh
Priority to US16/723,533 priority patent/US11094267B2/en

Links

Images

Classifications

    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G3/00Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes
    • G09G3/20Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters
    • G09G3/34Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters by control of light from an independent source
    • G09G3/3406Control of illumination source
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72454User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to context-related or environment-related conditions
    • 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
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3206Monitoring of events, devices or parameters that trigger a change in power modality
    • G06F1/3215Monitoring of peripheral devices
    • G06F1/3218Monitoring of peripheral devices of display devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3206Monitoring of events, devices or parameters that trigger a change in power modality
    • G06F1/3231Monitoring the presence, absence or movement of users
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/325Power saving in peripheral device
    • G06F1/3265Power saving in display device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/041Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means
    • G06F3/0416Control or interface arrangements specially adapted for digitisers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/041Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means
    • G06F3/042Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means by opto-electronic means
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0251Power saving arrangements in terminal devices using monitoring of local events, e.g. events related to user activity
    • H04W52/0254Power saving arrangements in terminal devices using monitoring of local events, e.g. events related to user activity detecting a user operation or a tactile contact or a motion of the device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2203/00Indexing scheme relating to G06F3/00 - G06F3/048
    • G06F2203/041Indexing scheme relating to G06F3/041 - G06F3/045
    • G06F2203/041012.5D-digitiser, i.e. digitiser detecting the X/Y position of the input means, finger or stylus, also when it does not touch, but is proximate to the digitiser's interaction surface and also measures the distance of the input means within a short range in the Z direction, possibly with a separate measurement setup
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2330/00Aspects of power supply; Aspects of display protection and defect management
    • G09G2330/02Details of power systems and of start or stop of display operation
    • G09G2330/021Power management, e.g. power saving
    • G09G2330/023Power management, e.g. power saving using energy recovery or conservation
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2360/00Aspects of the architecture of display systems
    • G09G2360/14Detecting light within display terminals, e.g. using a single or a plurality of photosensors
    • G09G2360/144Detecting light within display terminals, e.g. using a single or a plurality of photosensors the light being ambient light

Definitions

  • the present application belongs to the field of sensor technologies, and in particular, to a proximity detection method, device, storage medium, and electronic device.
  • the proximity sensor can detect whether the user is bringing the terminal close to the face. If it is detected that the user closes the terminal display to the face, the terminal can turn off the backlight of the display, thereby saving power and preventing accidental touch. If it is detected that the user is moving the terminal display away from the face, the terminal can illuminate the display.
  • the embodiments of the present application provide a proximity detection method, device, storage medium, and electronic device, which can improve the diversity of proximity detection of a terminal in a strong light environment.
  • the embodiment of the present application provides a proximity detection method, including:
  • At least one set of proximity values of the proximity sensor output is read, and each set of proximity values sequentially controls the transmitting end of the proximity sensor to not transmit the detection signal, transmit the detection signal, transmit the detection signal, and not transmit.
  • a target approach value is calculated based on the at least one set of proximity values, and proximity detection is performed based on the target proximity value.
  • the embodiment of the present application provides a proximity detecting device, including:
  • a detecting module configured to detect, according to the ambient light intensity value, whether the terminal is in a strong light environment
  • a reading module configured to read at least one set of proximity values of the proximity sensor output if the terminal is detected to be in a strong light environment, and each set of proximity values sequentially controls the transmitting end of the proximity sensor to not transmit the detection signal, transmit the detection signal, The proximity value of the proximity sensor output when the detection signal is transmitted and the detection signal is not transmitted;
  • a calculating module configured to calculate a target approach value according to the at least one set of proximity values, and perform proximity detection according to the target proximity value.
  • the embodiment of the present application provides a storage medium on which a computer program is stored.
  • the computer program is executed on a computer, the computer is caused to perform the proximity detection method provided by the embodiment of the present application.
  • the embodiment of the present application further provides an electronic device, including a memory, a processor, by using a computer program stored in the memory, to perform the following steps:
  • At least one set of proximity values of the proximity sensor output is read, and each set of proximity values sequentially controls the transmitting end of the proximity sensor to not transmit the detection signal, transmit the detection signal, transmit the detection signal, and not transmit.
  • a target approach value is calculated and proximity detection is performed based on the target approach value.
  • FIG. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • FIG. 2 is a schematic diagram of the operation of the proximity sensor provided by the embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a proximity detecting method provided by an embodiment of the present application.
  • FIG. 4 is another schematic flowchart of a proximity detecting method provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of the influence of infrared light on the oblique value of the proximity value in the ambient light provided by the embodiment of the present application.
  • FIG. 6 is a schematic diagram of comparison of four collected values provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a proximity detecting apparatus according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a mobile terminal according to an embodiment of the present application.
  • FIG. 9 is another schematic structural diagram of a mobile terminal according to an embodiment of the present application.
  • first and second are used for descriptive purposes only, and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated.
  • features defining “first” or “second” may include one or more of the described features either explicitly or implicitly.
  • the meaning of "a plurality" is two or more unless specifically and specifically defined otherwise.
  • the electronic device 100 may include a cover 10 , a display screen 20 , a circuit board 30 , and a housing 40 .
  • the cover 10 is mounted to the display screen 20 to cover the display screen 20.
  • the cover 10 can be a clear glass cover.
  • the cover 10 can be a cover glass made of a material such as sapphire.
  • the display screen 20 is mounted on the housing 40 to form a display surface of the electronic device 100.
  • the display screen 20 may include a display area 20A and a non-display area 20B.
  • the display area 20A is for displaying information such as images, texts, and the like.
  • the non-display area 20B does not display information.
  • Functional components such as a fingerprint module and a touch circuit may be disposed at the bottom of the non-display area 20B.
  • a proximity sensor and an ambient light sensor may be disposed at the top of the non-display area 20B.
  • the proximity sensor can detect if the user is holding the device close to the face during a call. If it is detected that the user is close to the face, the device can turn off the backlight of the display. If it is detected that the user is away from the face, the device can illuminate the display.
  • the ambient light sensor can automatically adjust the brightness of the display screen to detect the intensity of ambient light, or control the lighting and turning off of the button light.
  • the proximity sensor and the ambient light sensor may be disposed at the opening 21 of the non-display area 20B.
  • FIG. 2 shows the working diagram of the proximity sensor.
  • the proximity sensor 50 can include a transmitting end 51 and a receiving end 52.
  • the transmitting end 51 can emit an infrared (IR) detecting signal, and the infrared detecting signal can pass through the glass cover 60.
  • IR infrared
  • the receiving end 52 can output a close value according to the intensity of the received infrared detecting signal. If the proximity value is greater than a predetermined threshold, the device determines that it is in a proximity state. If the proximity value is less than a predetermined threshold, the device determines that it is in a remote state.
  • the circuit board 30 is mounted inside the housing 40. Proximity sensors and ambient light sensors can be coupled to circuit board 30 to transfer the output values of the sensors to a processor of the electronic device for processing.
  • the executive body of the embodiment of the present application may be an electronic terminal device such as a smart phone or a tablet computer.
  • This embodiment provides a proximity detection method, and the method may include the following steps:
  • At least one set of proximity values of the proximity sensor output is read, and each set of proximity values sequentially controls the transmitting end of the proximity sensor to not transmit the detection signal, transmit the detection signal, transmit the detection signal, and not transmit.
  • a target approach value is calculated based on the at least one set of proximity values, and proximity detection is performed based on the target proximity value.
  • the step of calculating a target proximity value according to the at least one set of proximity values may include:
  • the proximity value of the proximity sensor is determined as the first proximity value, the second proximity value, and the third proximity value, respectively, when the transmitting end of the proximity sensor sequentially transmits the detection signal, transmits the detection signal, transmits the detection signal, and does not emit the detection signal.
  • Fourth approach value when the transmitting end of the proximity sensor sequentially transmits the detection signal, transmits the detection signal, transmits the detection signal, and does not emit the detection signal.
  • a difference between the first sum value and the second sum value is calculated, and one-half of the difference is determined as a target approach value.
  • the step of calculating a target proximity value according to the at least one set of proximity values may include:
  • the proximity value of the proximity sensor is determined as the first proximity value, the second proximity value, and the third proximity value, respectively, when the transmitting end of the proximity sensor sequentially transmits the detection signal, transmits the detection signal, transmits the detection signal, and does not emit the detection signal.
  • Fourth approach value when the transmitting end of the proximity sensor sequentially transmits the detection signal, transmits the detection signal, transmits the detection signal, and does not emit the detection signal.
  • An average of the first difference value and the second difference value is calculated, and the average value is determined as a target approach value.
  • the step of performing proximity detection according to the target proximity value may include: determining that the terminal is in a proximity state if the target proximity value is detected to be greater than a preset first threshold.
  • the method may further include: if it is detected that the target proximity value is less than a preset second threshold, determining that the terminal is in a remote state, and the preset second threshold is smaller than the preset The first threshold.
  • the step of detecting whether the terminal is in a strong light environment according to the ambient light intensity value may include the following steps: detecting whether the ambient light intensity value is greater than a preset light intensity threshold; If the ambient light intensity value is greater than the preset light intensity threshold, the terminal is determined to be in a strong light environment; and if the ambient light intensity value is not greater than the preset light intensity threshold, it is determined that the terminal is not in a strong light environment.
  • the method may further include the following steps: when receiving the instruction carrying the change amount, the value of the preset first threshold and the preset second threshold according to the change amount Make adjustments.
  • FIG. 3 is a schematic flowchart of a proximity detecting method according to an embodiment of the present application, where the process may include:
  • 101 and 102 can include:
  • the terminal When the terminal is in a call, the terminal can first obtain the ambient light intensity value in the current environment through the ambient light sensor. Then, the terminal can detect whether the terminal is in a strong light environment according to the ambient light intensity value.
  • the terminal can directly read the proximity value of the proximity sensor output and perform proximity detection based on the proximity value.
  • the terminal If it is detected that the terminal is in a strong light environment, then it can enter 103.
  • At least one set of proximity values of the proximity sensor output is read, and each set of proximity values sequentially controls the transmitting end of the proximity sensor to not transmit the detection signal, transmit the detection signal, and transmit the detection. Proximity value close to the sensor output when the signal is not transmitted.
  • the terminal when detecting that the terminal is in a strong light environment, the terminal can read at least one set of proximity values of the proximity sensor output, and each set of proximity values sequentially transmits a detection signal, a detection signal, and a detection signal at a transmitting end of the proximity sensor, The proximity value of the proximity sensor output when the detection signal is transmitted and the detection signal is not transmitted.
  • the terminal can read a set of proximity values that are output from the proximity sensor.
  • the set of proximity values is a close-up obtained by sequentially controlling the transmitting end of the proximity sensor to emit an infrared detecting signal, an infrared detecting signal, an infrared detecting signal, and an infrared detecting signal. The approximate value of the sensor output.
  • the terminal can perform four samples.
  • the terminal can control the transmitting end of the proximity sensor to not emit the infrared detecting signal outward.
  • the proximity value of the proximity sensor output is the infrared light in the ambient light entering the receiving end of the proximity sensor, and the receiving end is according to the outside world.
  • the terminal can control the transmitting end of the proximity sensor to emit an infrared detecting signal outward.
  • the proximity value of the proximity sensor output is the infrared ray emitted by the transmitting end after being reflected by the obstacle and the infrared light in the ambient light.
  • the receiving end calculates the approximate value based on the received infrared intensity.
  • the terminal can also control the transmitting end of the proximity sensor to emit an infrared detecting signal outward, thereby obtaining an approximate value.
  • the terminal can control the transmitting end of the proximity sensor to not emit an infrared detecting signal outward, thereby obtaining an approximate value.
  • a target approach value is calculated based on the at least one set of proximity values, and proximity detection is performed based on the target proximity value.
  • the terminal can calculate a target close value based on the set of proximity values.
  • the terminal can then perform proximity detection based on the target proximity value.
  • the embodiment of the present application can collect a set of proximity values of the proximity sensor output when the terminal is in a strong light environment.
  • the set of proximity values is obtained in the case where the transmitting end of the proximity sensor is sequentially controlled not to emit the detecting signal outward, the detecting signal is transmitted outward, the detecting signal is transmitted outward, and the detecting signal is not transmitted outward.
  • the terminal can calculate the target approach value according to the set of proximity values, and perform proximity detection according to the target approach value. Therefore, the embodiment of the present application can improve the diversity of proximity detection performed by the terminal in a strong light environment.
  • FIG. 4 is another schematic flowchart of a proximity detecting method according to an embodiment of the present disclosure, where the process may include:
  • the terminal acquires an ambient light intensity value when making a call.
  • the terminal detects whether the ambient light intensity value is greater than a preset light intensity threshold.
  • the terminal determines to be in a strong light environment.
  • the terminal may first obtain an ambient light intensity value of the current environment through an ambient light sensor. Then, the terminal can detect whether the acquired ambient light intensity value is greater than a preset light intensity threshold.
  • the preset light intensity threshold may be 6000 lux, or 7000 lux, etc., and the examples herein do not constitute a limitation of the present application.
  • the terminal may determine that the light environment is not in a strong light environment at this time. In this case, the terminal can directly read the proximity value of the proximity sensor output, and judge whether the terminal is in a distant state or a close state based on the proximity value.
  • the terminal may determine that the current light environment is in a strong light environment.
  • a strong light environment for example, when the terminal is in an outdoor environment with strong sunlight
  • the receiving end of the proximity sensor receives strong infrared rays from the outside. That is, when the terminal is in a strong light environment, infrared rays from the external environment may cause interference to the proximity sensor.
  • the terminal reads a set of proximity values of the proximity sensor output, and the set of proximity values sequentially controls the proximity of the proximity sensor to transmit the detection signal, transmit the detection signal, transmit the detection signal, and transmit the detection signal without approaching the sensor output. Close to the value.
  • the terminal can acquire the proximity value by the proximity sensor four times.
  • the four acquisition processes are performed in the case where the emission end of the proximity sensor is sequentially controlled to emit an infrared detection signal, an infrared detection signal is emitted outward, an infrared detection signal is emitted outward, and an infrared detection signal is not emitted outward.
  • the proximity value of the proximity sensor output.
  • the terminal can control the transmitting end of the proximity sensor to not emit the infrared detecting signal outward.
  • the proximity value of the proximity sensor output is after the infrared light in the ambient light enters the receiving end of the proximity sensor.
  • the receiving end calculates the approximate value according to the infrared intensity in the ambient light.
  • the terminal can control the transmitting end of the proximity sensor to emit an infrared detecting signal outward.
  • the close value of the proximity sensor output is the infrared light emitted by the transmitting end after being reflected by the obstacle and the infrared light in the ambient light. After the two enter the receiving end of the proximity sensor, the receiving end calculates the approximate value based on the received infrared intensity.
  • the terminal can also control the transmitting end of the proximity sensor to emit an infrared detecting signal outward, thereby obtaining an approximate value.
  • the terminal can control the transmitting end of the proximity sensor to not emit the infrared detecting signal outward, thereby obtaining a close value.
  • the terminal determines, according to the transmitting end of the proximity sensor, the proximity value of the proximity sensor output when not transmitting the detection signal, transmitting the detection signal, transmitting the detection signal, and not transmitting the detection signal, respectively, as the first proximity value, the second proximity value, The third proximity value and the fourth proximity value.
  • the terminal calculates a sum of the second proximity value and the third proximity value to obtain a first sum value, and calculates a sum of the first proximity value and the fourth proximity value to obtain a second sum value.
  • the terminal calculates a difference between the first sum value and the second sum value, and determines one-half of the difference value as the target approach value.
  • 205, 206, 207 can include:
  • the terminal may sequentially transmit the proximity sensor to the infrared detection signal, the infrared detection signal, the infrared detection signal, and the infrared detection signal.
  • the approaching values obtained are determined as the first proximity value, the second proximity value, the third proximity value, and the fourth proximity value, respectively.
  • the terminal can calculate a sum of the second proximity value and the third proximity value to obtain a first sum value.
  • the terminal can calculate the sum of the first proximity value and the fourth proximity value to obtain a second sum value.
  • the terminal may calculate a difference between the first sum value and the second sum value, and determine one-half of the difference as the target approach value.
  • the terminal performs proximity detection based on the target proximity value.
  • the terminal can perform proximity detection based on the target proximity value.
  • the terminal collects two close values through the proximity sensor when performing proximity detection.
  • the proximity value collected for the first time is the proximity value of the proximity sensor output read by the terminal, for example, a in the case where the infrared detecting signal is not emitted outward from the transmitting end of the proximity sensor.
  • the value a is the close value obtained by the receiving end based on the infrared intensity in the ambient light after the infrared light in the ambient light enters the receiving end of the proximity sensor.
  • the second acquired value is the proximity value of the proximity sensor output read by the terminal, for example, b, in the case where the infrared detection signal is emitted outward from the transmitting end of the proximity sensor.
  • the value b is a close value calculated by the receiving end based on the received infrared intensity after the infrared ray emitted from the transmitting end is reflected by the obstacle and the infrared ray in the ambient light enters the receiving end of the proximity sensor.
  • the difference between the values b and a ie, b-a is the close value obtained by the infrared light emitted from the emitting end of the sensor being reflected by the obstacle and entering the receiving end. That is, the terminal performs proximity detection based on the difference between the values b and a.
  • the shaded portion A represents that when the infrared detecting signal is not emitted outward from the transmitting end of the proximity sensor, the infrared light in the ambient light enters the receiving end of the proximity sensor, and the receiving end is in accordance with the ambient light.
  • the infrared intensity is calculated to approximate the value.
  • the shaded portion B represents that in the case where the infrared detecting signal is emitted outward from the transmitting end of the proximity sensor, the infrared light in the ambient light enters the close value portion corresponding to the receiving end of the proximity sensor.
  • the areas of the shaded portion A and the shaded portion B are different. Therefore, in a strong light environment, there is an error between the above calculated approximate value b-a and the true proximity value.
  • the terminal collects the proximity value by the proximity sensor four times.
  • the four acquisition processes are performed in the case where the emission end of the proximity sensor is sequentially controlled to emit an infrared detection signal, an infrared detection signal is emitted outward, an infrared detection signal is emitted outward, and an infrared detection signal is not emitted outward.
  • the proximity value of the proximity sensor output.
  • the interference from the infrared light in the external environment to the receiving end of the proximity sensor is obliquely affected. Therefore, for the four close values collected by the terminal, the amount of change in the near value after the infrared rays in the ambient light enter the receiving end are the same in the order of the acquisition time.
  • the second acquisition proximity value is performed when the infrared detection signal is emitted from the emission end of the proximity sensor.
  • the infrared detection signal emitted from the emission end is reflected by the external obstacle and enters the receiving end, and the reflected infrared detection is performed.
  • the approximate value of the signal corresponds to s1.
  • the corresponding near-value value of the infrared light in the ambient light entering the receiving end is a+x, where x is the amount of change in the near-value after the infrared light in the ambient light enters the receiving end. It can be understood that in the actual application scenario, the value of x can be positive or negative.
  • the third acquisition proximity value is also performed when the infrared detection signal is emitted from the emission end of the proximity sensor.
  • the infrared detection signal emitted from the emission end is reflected by the external obstacle and enters the receiving end, and the reflected infrared detection is performed.
  • the approximate value of the signal corresponds to s2.
  • the corresponding near-value of the infrared rays in the ambient light entering the receiving end is a+2x.
  • the close value of the fourth acquisition is the close value obtained in the case where the infrared detecting signal is not emitted outward from the transmitting end of the proximity sensor.
  • PS_code represents the true value of the close value of the corresponding part of the infrared detection signal emitted from the transmitting end after the obstacle is reflected into the receiving end
  • PS_on represents the close value of the proximity sensor output when the transmitting end emits the infrared detecting signal
  • PS_off represents the proximity value of the proximity sensor output in the case where the transmitting end does not emit the infrared detecting signal outward.
  • the terminal can calculate the average of s1+x and s2-x to obtain (s1+s2)/2.
  • the terminal can determine the average value (s1+s2)/2 as the target approach value of the proximity sensor, and perform the proximity judgment based on the target approach value. It is known from the average value (s1+s2)/2 that a and x are not included in the average value, that is, the average value has removed the infrared interference in the ambient light.
  • the terminal may calculate a target proximity value by the following steps, wherein the group proximity value sequentially controls the transmitting end of the proximity sensor not to transmit the detection signal.
  • the proximity value of the proximity sensor is determined as the first proximity value, the second proximity value, and the third proximity value, respectively, when the transmitting end of the proximity sensor sequentially transmits the detection signal, transmits the detection signal, transmits the detection signal, and does not emit the detection signal.
  • Fourth approach value when the transmitting end of the proximity sensor sequentially transmits the detection signal, transmits the detection signal, transmits the detection signal, and does not emit the detection signal.
  • An average of the first difference value and the second difference value is calculated, and the average value is determined as a target approach value.
  • the terminal may determine one-half of the difference between the first sum value and the second sum value as the target proximity value of the proximity sensor, ie, (s1+s2)/2.
  • the step of performing proximity detection according to the target proximity value may include:
  • the terminal is in a close state, thereby triggering the terminal to perform operations such as turning off the backlight of the display.
  • the embodiment of the present application may further include the following steps:
  • the target proximity value is less than a preset second threshold
  • the preset second threshold is less than a preset first threshold
  • the value of the preset second threshold may be 300, and when the calculated target approach value is less than 300, it may be determined that the terminal is in a remote state, thereby triggering the terminal to perform a screen illumination operation or the like.
  • the terminal may further adjust the preset first threshold and the preset second threshold according to actual usage requirements. For example, when receiving an instruction for instructing to adjust the preset first threshold and the preset second threshold, the terminal may adjust the preset first threshold and the preset second threshold according to the instruction, where the instruction may Carrying the adjusted preset first threshold and the preset second threshold, or the command may carry a change, and instruct the terminal to preset the first threshold and the preset second threshold according to the change amount. Size adjustments, and more.
  • the embodiment may further include the following steps:
  • the embodiment provides a proximity detecting device, and the proximity detecting device may include:
  • a detecting module configured to detect, according to the ambient light intensity value, whether the terminal is in a strong light environment
  • a reading module configured to read at least one set of proximity values of the proximity sensor output if the terminal is detected to be in a strong light environment, and each set of proximity values sequentially controls the transmitting end of the proximity sensor to not transmit the detection signal, transmit the detection signal, The proximity value of the proximity sensor output when the detection signal is transmitted and the detection signal is not transmitted;
  • a calculating module configured to calculate a target approach value according to the at least one set of proximity values, and perform proximity detection according to the target proximity value.
  • the computing module can be used to:
  • the proximity value of the proximity sensor is determined as the first proximity value, the second proximity value, and the third proximity value, respectively, when the transmitting end of the proximity sensor sequentially transmits the detection signal, transmits the detection signal, transmits the detection signal, and does not emit the detection signal.
  • Fourth approach value when the transmitting end of the proximity sensor sequentially transmits the detection signal, transmits the detection signal, transmits the detection signal, and does not emit the detection signal.
  • a difference between the first sum value and the second sum value is calculated, and one-half of the difference is determined as a target approach value.
  • the computing module can be used to:
  • the proximity value of the proximity sensor is determined as the first proximity value, the second proximity value, and the third proximity value, respectively, when the transmitting end of the proximity sensor sequentially transmits the detection signal, transmits the detection signal, transmits the detection signal, and does not emit the detection signal.
  • Fourth approach value when the transmitting end of the proximity sensor sequentially transmits the detection signal, transmits the detection signal, transmits the detection signal, and does not emit the detection signal.
  • An average of the first difference value and the second difference value is calculated, and the average value is determined as a target approach value.
  • the calculating module may be further configured to: if it is detected that the target proximity value is greater than a preset first threshold, determine that the terminal is in a proximity state; if the target proximity value is detected to be less than a preset number
  • the second threshold determines that the terminal is in a remote state, and the preset second threshold is smaller than the preset first threshold.
  • the detecting module may be configured to: detect whether the ambient light intensity value is greater than a preset light intensity threshold; and if the ambient light intensity value is greater than a preset light intensity threshold, determine that the terminal is A strong light environment; if it is detected that the ambient light intensity value is not greater than a preset light intensity threshold, it is determined that the terminal is not in a strong light environment.
  • the calculating module may be further configured to: when receiving the instruction carrying the change amount, the value of the preset first threshold and the preset second threshold according to the change amount Make adjustments.
  • FIG. 7 is a schematic structural diagram of a proximity detecting apparatus according to an embodiment of the present application.
  • the proximity detecting device 300 may include an acquisition module 301, a detection module 302, a reading module 303, and a calculation module 304.
  • the obtaining module 301 is configured to obtain an ambient light intensity value.
  • the detecting module 302 is configured to detect, according to the ambient light intensity value, whether the terminal is in a strong light environment.
  • the acquiring module 301 may first obtain an ambient light intensity value in the current environment by using an ambient light sensor. Then, the detecting module 302 can detect whether the terminal is in a strong light environment according to the ambient light intensity value.
  • the terminal can directly read the proximity value of the proximity sensor output and perform proximity detection based on the proximity value.
  • the reading module 303 is configured to: when detecting that the terminal is in a strong light environment, read at least one set of proximity values of the proximity sensor output, and each set of proximity values sequentially controls the transmitting end of the proximity sensor to not transmit the detection signal and transmit the detection signal.
  • the reading module 303 can acquire the proximity value by the proximity sensor four times.
  • the four acquisition processes are performed in the case where the emission end of the proximity sensor is sequentially controlled to emit an infrared detection signal, an infrared detection signal is emitted outward, an infrared detection signal is emitted outward, and an infrared detection signal is not emitted outward.
  • the proximity value of the proximity sensor output is performed in the case where the emission end of the proximity sensor is sequentially controlled to emit an infrared detection signal, an infrared detection signal is emitted outward, an infrared detection signal is emitted outward, and an infrared detection signal is not emitted outward.
  • the reading module 303 can control the transmitting end of the proximity sensor not to emit the infrared detecting signal outward, and the proximity value of the proximity sensor output is the infrared light in the ambient light entering the proximity sensor. After the receiving end, the receiving end calculates the approximate value according to the infrared intensity in the ambient light.
  • the reading module 303 can control the transmitting end of the proximity sensor to emit an infrared detecting signal outward. At this time, the proximity value of the proximity sensor output is reflected by the infrared light emitted by the transmitting end and the ambient light. After the infrared rays enter the proximity end of the sensor, the receiving end calculates the approximate value based on the received infrared intensity.
  • the reading module 303 can also control the transmitting end of the proximity sensor to emit an infrared detecting signal outward, thereby obtaining an approximate value.
  • the reading module 303 can control the transmitting end of the proximity sensor not to emit the infrared detecting signal outward, thereby obtaining a close value.
  • the calculating module 304 is configured to calculate a target approach value according to the at least one set of proximity values, and perform proximity detection according to the target proximity value.
  • the calculation module 304 can calculate a target proximity value based on the set of proximity values. The calculation module 304 can then perform proximity detection based on the target proximity value.
  • the embodiment of the present application can collect a set of proximity values of the proximity sensor output when the terminal is in a strong light environment.
  • the set of proximity values is obtained in the case where the transmitting end of the proximity sensor is sequentially controlled not to emit the detecting signal outward, the detecting signal is transmitted outward, the detecting signal is transmitted outward, and the detecting signal is not transmitted outward.
  • the terminal can calculate the target approach value according to the set of proximity values, and perform proximity detection according to the target approach value. Therefore, the embodiment of the present application can improve the diversity of proximity detection performed by the terminal in a strong light environment.
  • the calculation module 304 can be used to:
  • the proximity value of the proximity sensor is determined as the first proximity value, the second proximity value, and the third proximity value, respectively, when the transmitting end of the proximity sensor sequentially transmits the detection signal, transmits the detection signal, transmits the detection signal, and does not emit the detection signal.
  • Fourth approach value when the transmitting end of the proximity sensor sequentially transmits the detection signal, transmits the detection signal, transmits the detection signal, and does not emit the detection signal.
  • a difference between the first sum value and the second sum value is calculated, and one-half of the difference is determined as a target approach value.
  • the calculation module 304 may sequentially emit the infrared detection signal, emit the infrared detection signal outward, emit the infrared detection signal, and not emit the infrared light outwardly.
  • the proximity values collected when the signals are detected are respectively determined as a first proximity value, a second proximity value, a third proximity value, and a fourth proximity value.
  • the calculation module 304 can then calculate the sum of the second proximity value and the third proximity value to obtain a first sum value. At the same time, the calculation module 304 can calculate the sum of the first proximity value and the fourth proximity value to obtain a second sum value.
  • the calculation module 304 can calculate a difference between the first sum value and the second sum value and determine one-half of the difference as the target approach value.
  • a is the proximity value of the proximity sensor output when the transmitting end of the proximity sensor does not emit the infrared detecting signal outward
  • a is the approximate value corresponding to the infrared light of the ambient light in the first acquisition process
  • x is the amount of change in the near-value after the infrared rays in the ambient light enter the receiving end compared to the last close value acquisition each time the proximity value is acquired.
  • the calculation module 304 can determine one-half of s1+s2 as the target approach value, ie, (s1+s2)/2.
  • the calculation module 304 can be used to:
  • the preset second threshold is less than the preset first threshold.
  • the calculation module 304 may determine that the terminal is in the proximity state. If the target proximity value is detected to be less than the preset second threshold, the calculation module 304 may determine that the terminal is in a remote state, wherein the preset second threshold is less than the preset first threshold.
  • the calculation module 304 can determine that the terminal is in a close state, and then trigger the terminal to perform operations such as turning off the backlight of the display.
  • the value of the preset second threshold may be 300.
  • the calculation module 304 may determine that the terminal is in a remote state, thereby triggering the terminal to perform a screen illumination operation or the like.
  • the detection module 302 can be used to:
  • the terminal is not in a strong light environment.
  • the detecting module 302 can detect whether the acquired ambient light intensity value is greater than a preset light intensity threshold when detecting whether the terminal is in a strong light environment according to the obtained ambient light intensity value.
  • the preset light intensity threshold can be 6000 lux.
  • the detection module 302 can determine that the terminal is in a strong light environment. When it is detected that the ambient light intensity value is not greater than 6000 lux, the detection module 302 can determine that the terminal is not in a strong light environment.
  • the embodiment of the present application provides a storage medium on which a computer program is stored.
  • the computer program is executed on a computer, the computer is caused to perform the proximity detection method provided by the embodiment of the present application.
  • the embodiment of the present application further provides an electronic device, including a memory, and a processor, by using a computer program stored in the memory, to perform the proximity detection method provided by the embodiment of the present application.
  • the above electronic device may be a mobile terminal such as a tablet or a smart phone.
  • a mobile terminal such as a tablet or a smart phone.
  • FIG. 8 is a schematic structural diagram of a mobile terminal according to an embodiment of the present disclosure.
  • the mobile terminal 400 can include components such as a sensor 401, a memory 402, a processor 403, and the like. It will be understood by those skilled in the art that the mobile terminal structure shown in FIG. 8 does not constitute a limitation of the mobile terminal, and may include more or less components than those illustrated, or some components may be combined, or different component arrangements.
  • the sensor 401 can include at least an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel according to the brightness of the ambient light, and the proximity sensor can close the display panel and/or the backlight when the mobile terminal moves to the ear.
  • Memory 402 can be used to store applications and data.
  • the application stored in the memory 402 contains executable code.
  • Applications can form various functional modules.
  • the processor 403 executes various functional applications and data processing by running an application stored in the memory 402.
  • the processor 403 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, executes the mobile terminal by running or executing an application stored in the memory 402, and calling data stored in the memory 402. The various functions and processing data to monitor the mobile terminal as a whole.
  • the processor 403 in the mobile terminal loads the executable code corresponding to the process of one or more applications into the memory 402 according to the following instructions, and is stored in the memory by the processor 403.
  • the application in 402 performs the following steps:
  • the sensor 401 obtains an ambient light intensity value
  • the processor 403 detects whether the terminal is in a strong light environment according to the ambient light intensity value
  • the processor 403 reads at least one set of proximity values of the proximity sensor output, and each set of proximity values sequentially controls the transmitting end of the proximity sensor to not transmit the detection signal, transmit the detection signal, and transmit the detection signal. Proximity value close to the sensor output when the detection signal is not transmitted;
  • the processor 403 calculates a target proximity value and performs proximity detection based on the target proximity value.
  • the mobile terminal 400 may further include an input unit 404 and an output unit 405 .
  • the input unit 404 can be configured to receive input digits, character information, or user characteristic information (such as fingerprints), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function controls.
  • input unit 404 can include a touch-sensitive surface as well as other input devices. Touch-sensitive surfaces, also known as touch screens or trackpads.
  • the output unit 405 can be used to display information input by the user or information provided to the user as well as various graphical user interfaces of the mobile terminal, which can be composed of graphics, text, icons, video, and any combination thereof.
  • the output unit may include a display panel.
  • the transmitting end of the proximity sensor is sequentially not transmitting the detection signal, and transmitting
  • the proximity values of the proximity sensor outputs when the detection signal, the emission detection signal, and the non-detection signal are not transmitted are respectively determined as a first proximity value, a second proximity value, a third proximity value, and a fourth proximity value.
  • a sum of the second proximity value and the third proximity value is calculated to obtain a first sum value.
  • a sum of the first proximity value and the fourth proximity value is calculated to obtain a second sum value.
  • a difference between the first sum value and the second sum value is calculated, and one-half of the difference is determined as a target approach value.
  • the processor 403 when the processor 403 performs the step of performing proximity detection according to the target proximity value, the following steps may be performed: if it is detected that the target proximity value is greater than a preset first threshold, determining the terminal In a close state.
  • the processor 403 may further perform the following steps: if it is detected that the target proximity value is less than a preset second threshold, determining that the terminal is in a remote state, the preset second threshold is less than the preset The first threshold.
  • the processor 403 when the processor 403 performs the step of detecting whether the terminal is in a strong light environment according to the ambient light intensity value, the following steps may be performed: detecting whether the ambient light intensity value is greater than a preset light intensity Threshold. If it is detected that the ambient light intensity value is greater than a preset light intensity threshold, it is determined that the terminal is in a strong light environment. If it is detected that the ambient light intensity value is not greater than a preset light intensity threshold, it is determined that the terminal is not in a strong light environment.
  • the proximity detecting device provided by the embodiment of the present application belongs to the same concept as the proximity detecting method in the above embodiment, and any method provided in the embodiment of the proximity detecting method may be run on the proximity detecting device, and the specific The implementation process is described in the embodiment of the proximity detection method, and details are not described herein again.
  • the proximity detection method in the embodiment of the present application can understand all or part of the process of implementing the proximity detection method in the embodiment of the present application, and the related hardware can be controlled by a computer program.
  • the computer program can be stored in a computer readable storage medium, such as in a memory, and executed by at least one processor, and can include a flow of an embodiment of the proximity detection method as described during execution.
  • the storage medium may be a magnetic disk, an optical disk, a read only memory (ROM), a random access memory (RAM), or the like.
  • each functional module may be integrated into one processing chip, or each module may exist physically separately, or two or more modules may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
  • the integrated module if implemented in the form of a software functional module and sold or used as a standalone product, may also be stored in a computer readable storage medium, such as a read only memory, a magnetic disk or an optical disk, etc. .

Abstract

本实施例公开了一种接近检测方法,包括:获取环境光强度值;检测是否处于强光环境;若是,则读取接近传感器输出的至少一组接近值,每一组接近值为依次控制接近传感器不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时的接近值;根据该至少一组接近值,计算得到目标接近值,并进行接近检测。

Description

接近检测方法、装置、存储介质及电子设备
本申请要求于2017年07月31日提交中国专利局、申请号为201710644147.8、发明名称为“接近检测方法、装置、存储介质及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请属于传感器技术领域,尤其涉及一种接近检测方法、装置、存储介质及电子设备。
背景技术
在用户使用终端进行通话时,接近传感器可以检测用户是否将终端贴近脸部。如果检测到用户将终端显示屏贴近脸部,那么终端可以关闭显示屏的背光,从而起到省电及防误触的效果。如果检测到用户将终端显示屏远离脸部,那么终端可以点亮显示屏。
发明内容
本申请实施例提供一种接近检测方法、装置、存储介质及电子设备,能提高强光环境下终端进行接近检测的多样性。
本申请实施例提供一种接近检测方法,包括:
获取环境光强度值;
根据所述环境光强度值,检测终端是否处于强光环境;
若检测到终端处于强光环境,则读取接近传感器输出的至少一组接近值,每一组接近值为依次控制接近传感器的发射端不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值;
根据所述至少一组接近值,计算得到目标接近值,并根据所述目标接近值进行接近检测。
本申请实施例提供一种接近检测装置,包括:
获取模块,用于获取环境光强度值;
检测模块,用于根据所述环境光强度值,检测终端是否处于强光环境;
读取模块,用于若检测到终端处于强光环境,则读取接近传感器输出的至少一组接近值,每一组接近值为依次控制接近传感器的发射端不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值;
计算模块,用于根据所述至少一组接近值,计算得到目标接近值,并根据所述目标接近值进行接近检测。
本申请实施例提供一种存储介质,其上存储有计算机程序,当所述计算机程序在计算机上执行时,使得所述计算机执行本申请实施例提供的接近检测方法。
本申请实施例还提供一种电子设备,包括存储器,处理器,所述处理器通过调用所述存储器中存储的计算机程序,用于执行如下步骤:
获取环境光强度值;
根据所述环境光强度值,检测终端是否处于强光环境;
若检测到终端处于强光环境,则读取接近传感器输出的至少一组接近值,每一组接近值为依次控制接近传感器的发射端不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值;
根据所述至少一组接近值,计算得到目标接近值,并根据所述目标接近值 进行接近检测。
附图说明
下面结合附图,通过对本申请的具体实施方式详细描述,将使本申请的技术方案及其有益效果显而易见。
图1是本申请实施例提供的电子设备的结构示意图。
图2是本申请实施例提供的接近传感器的工作示意图。
图3是本申请实施例提供的接近检测方法的流程示意图。
图4是本申请实施例提供的接近检测方法的另一流程示意图。
图5是本申请实施例提供的环境光中的红外光对接近值的斜线影响示意图。
图6是本申请实施例提供的采集到的四个接近值的比较示意图。
图7是本申请实施例提供的接近检测装置的结构示意图。
图8是本申请实施例提供的移动终端的结构示意图。
图9是本申请实施例提供的移动终端的另一结构示意图。
具体实施方式
请参照图式,其中相同的组件符号代表相同的组件,本申请的原理是以实施在一适当的运算环境中来举例说明。以下的说明是基于所例示的本申请具体实施例,其不应被视为限制本申请未在此详述的其它具体实施例。
在本申请实施例的描述中,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个所述特征。在本申请实施例的描述中,“多个”的含义是两个或两个以上,除非另有明确具体的限定。
以下将详细说明。
请参阅图1,电子设备100可以包括盖板10、显示屏20、电路板30以及壳体40。
其中,盖板10安装到显示屏20上,以覆盖显示屏20。盖板10可以为透明玻璃盖板。在一些实施例中,盖板10可以是用诸如蓝宝石等材料制成的玻璃盖板。
显示屏20安装在壳体40上,以形成电子设备100的显示面。显示屏20可以包括显示区域20A和非显示区域20B。显示区域20A用于显示图像、文本等信息。非显示区域20B不显示信息。非显示区域20B的底部可以设置指纹模组、触控电路等功能组件。
在非显示区域20B的顶部可以设置有接近传感器和环境光传感器。接近传感器可以在通话时,检测用户是否将设备贴近脸部。若检测到用户将设备贴近脸部,那么设备可以关闭显示屏的背光。若检测到用户将设备远离脸部,那么设备可以点亮显示屏。环境光传感器可以检测环境光的强弱而自动调节显示屏的亮度,或者控制按键灯的点亮和关闭。在一种实施方式中,接近传感器和环境光传感器可以设置于非显示区域20B的开孔21处。
如图2所示为接近传感器的工作示意图。接近传感器50可以包括发射端51和接收端52。发射端51可以向外发射红外线(IR)探测信号,红外线探测信号可以穿过玻璃盖板60。当接近传感器50前方有障碍物时,红外线探测信号经障碍物反射后进入接收端52。接收端52在接收到红外线探测信号后,可以根据接 收到的红外线探测信号的强度输出一个接近值。若该接近值大于一预定的阈值,则设备会判断出处于接近状态。若该接近值小于一预定的阈值,则设备会判断出处于远离状态。
电路板30安装在壳体40内部。接近传感器和环境光传感器可以连接至电路板30,从而将传感器的输出值传输到电子设备的处理器中进行处理。
可以理解的是,本申请实施例的执行主体可以是诸如智能手机或平板电脑等的电子终端设备。
本实施例提供一种接近检测方法,所述方法可以包括如下步骤:
获取环境光强度值;
根据所述环境光强度值,检测终端是否处于强光环境;
若检测到终端处于强光环境,则读取接近传感器输出的至少一组接近值,每一组接近值为依次控制接近传感器的发射端不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值;
根据所述至少一组接近值,计算得到目标接近值,并根据所述目标接近值进行接近检测。
在一种实施方式中,所述根据所述至少一组接近值,计算得到目标接近值的步骤,可以包括:
将接近传感器的发射端依次在不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值分别确定为第一接近值、第二接近值、第三接近值及第四接近值;
计算所述第二接近值和所述第三接近值的和,得到第一和值;
计算所述第一接近值和所述第四接近值的和,得到第二和值;
计算所述第一和值和所述第二和值的差值,并将所述差值的二分之一确定为目标接近值。
在一种实施方式中,所述根据所述至少一组接近值,计算得到目标接近值的步骤,可以包括:
将接近传感器的发射端依次在不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值分别确定为第一接近值、第二接近值、第三接近值及第四接近值;
计算所述第二接近值和所述第一接近值的差,得到第一差值;
计算所述第三接近值和所述第四接近值的差,得到第二差值;
计算所述第一差值和所述第二差值的平均值,并将所述平均值确定为目标接近值。
在一种实施方式中,所述根据所述目标接近值进行接近检测的步骤,可以包括:若检测到所述目标接近值大于预设第一阈值,则确定终端处于接近状态。
在一种实施方式中,所述方法还可以包括如下步骤:若检测到所述目标接近值小于预设第二阈值,则确定终端处于远离状态,所述预设第二阈值小于所述预设第一阈值。
在一种实施方式中,所述根据所述环境光强度值,检测终端是否处于强光环境的步骤,可以包括如下步骤:检测所述环境光强度值是否大于预设光强阈值;若检测出所述环境光强度值大于预设光强阈值,则确定终端处于强光环境;若检测出所述环境光强度值不大于预设光强阈值,则确定终端不处于强光环境。
在一种实施方式中,所述方法还可以包括如下步骤:当接收到携带有变化量的指令时,按照所述变化量对所述预设第一阈值和所述预设第二阈值的数值进 行调整。
请参阅图3,图3是本申请实施例提供的接近检测方法的流程示意图,流程可以包括:
在101中,获取环境光强度值。
在102中,根据该环境光强度值,检测终端是否处于强光环境。
比如,101和102可以包括:
在终端进行通话时,终端可以先通过环境光传感器获取当前环境下的环境光强度值。然后,终端可以根据该环境光强度值,检测终端是否处于强光环境。
如果检测出终端不处于强光环境,那么终端可以直接读取接近传感器输出的接近值,并根据该接近值进行接近检测。
如果检测出终端处于强光环境,那么可以进入103。
在103中,若检测到终端处于强光环境,则读取接近传感器输出的至少一组接近值,每一组接近值为依次控制接近传感器的发射端不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值。
比如,在检测出终端处于强光环境的情况下,终端可以读取接近传感器输出的至少一组接近值,每一组接近值为依次在接近传感器的发射端未发射探测信号、发射探测信号、发射探测信号、未发射探测信号时接近传感器输出的接近值。
例如,在检测出终端处于强光环境的情况下,终端可以读取接近传感器输出的一组接近值。这组接近值是依次控制接近传感器的发射端在不向外发射红外线探测信号、向外发射红外线探测信号、向外发射红外线探测信号、不向外发射红外线探测信号的情况下所采集到的接近传感器输出的接近值。
也即,终端可以进行四次采样。在第一次采样时,终端可以控制接近传感器的发射端不向外发射红外线探测信号,此时接近传感器输出的接近值为外界环境光中的红外线进入接近传感器的接收端后,接收端根据外界环境光中的红外线强度计算得到的接近值。在第二次采样时,终端可以控制接近传感器的发射端向外发射红外线探测信号,此时接近传感器输出的接近值为发射端发出的红外线经障碍物反射后以及外界环境光中的红外线这两者进入接近传感器的接收端后,接收端根据接收到的红外线强度计算得到的接近值。
在第三次采样时,终端同样可以控制接近传感器的发射端向外发射红外线探测信号,从而得到一个接近值。在第四次采样时,终端则可以控制接近传感器的发射端不向外发射红外线探测信号,从而得到一个接近值。
在104中,根据该至少一组接近值,计算得到目标接近值,并根据该目标接近值进行接近检测。
比如,在获取到接近传感器输出的一组接近值之后,终端可以根据这组接近值计算得到一个目标接近值。然后,终端就可以根据该目标接近值进行接近检测。
可以理解的是,本申请实施例可以在终端处于强光环境时,采集接近传感器输出的一组接近值。这组接近值是在依次控制接近传感器的发射端不向外发射探测信号、向外发射探测信号、向外发射探测信号、不向外发射探测信号的情况下得到接近值。然后,终端可以根据这组接近值计算得到目标接近值,并根据该目标接近值进行接近检测。因此,本申请实施例可以提高强光环境下终端进行接近检测的多样性。
请参阅图4,图4为本申请实施例提供的接近检测方法的另一流程示意图,流程可以包括:
在201中,在进行通话时,终端获取环境光强度值。
在202中,终端检测该环境光强度值是否大于预设光强阈值。
在203中,若检测出该环境光强度值大于预设光强阈值,则终端确定处于强光环境。
比如,在进行通话时,终端可以先通过环境光传感器获取当前环境的环境光强度值。然后,终端可以检测该获取到的环境光强度值是否大于预设光强阈值。例如,该预设光强阈值可以为6000勒克斯(lux),或者7000勒克斯,等等,此处举例不构成对本申请的限定。
如果检测出该环境光强度值不大于预设光强阈值,那么终端可以确定出此时不处于强光环境。在这种情况下,终端可以直接读取接近传感器输出的接近值,并根据该接近值判断终端处于远离状态或者接近状态。
如果检测出该环境光强度值大于预设光强阈值,那么终端可以确定当前处于强光环境。在终端处于强光环境,例如终端处于太阳光强烈的室外环境时,接近传感器的接收端会接收到来自外界的很强的红外线。也即,当终端处于强光环境时,来自外界环境的红外线会对接近传感器造成干扰。
在204中,终端读取接近传感器输出的一组接近值,该组接近值为依次控制接近传感器的发射端不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值。
比如,在确定出自身处于强光环境的情况下,终端可以通过接近传感器四次采集接近值。这四次采集过程是在依次控制接近传感器的发射端不向外发射红外线探测信号、向外发射红外线探测信号、向外发射红外线探测信号、不向外发射红外线探测信号的情况下,终端读取到的接近传感器输出的接近值。
也即,在第一次采集接近值时,终端可以控制接近传感器的发射端不向外发射红外线探测信号,此时接近传感器输出的接近值为外界环境光中的红外线进入接近传感器的接收端后,接收端根据外界环境光中的红外线强度计算得到的接近值。在第二次采集接近值时,终端可以控制接近传感器的发射端向外发射红外线探测信号,此时接近传感器输出的接近值为发射端发出的红外线经障碍物反射后以及外界环境光中的红外线这两者进入接近传感器的接收端后,接收端根据接收到的红外线强度计算得到的接近值。
在第三次采集接近值时,终端同样可以控制接近传感器的发射端向外发射红外线探测信号,从而得到一个接近值。在第四次采集接近值时,终端可以控制接近传感器的发射端不向外发射红外线探测信号,从而得到一个接近值。
在205中,终端将接近传感器的发射端依次在不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值分别确定为第一接近值、第二接近值、第三接近值及第四接近值。
在206中,终端计算该第二接近值和该第三接近值的和,得到第一和值,并计算该第一接近值和该第四接近值的和,得到第二和值。
在207中,终端计算该第一和值和该第二和值的差值,并将该差值的二分之一确定为目标接近值。
比如,205、206、207可以包括:
在采集到四个接近值之后,终端可以将接近传感器的发射端依次在不向外发射红外线探测信号、向外发射红外线探测信号、向外发射红外线探测信号、不向外发射红外线探测信号时采集到的接近值分别确定为第一接近值、第二接近值、第三接近值及第四接近值。
然后,终端可以计算第二接近值和第三接近值的和,得到第一和值。同时,终端可以计算第一接近值和第四接近值的和,得到第二和值。
接着,终端可以计算该第一和值和第二和值的差值,并将该差值的二分之一确定为目标接近值。
在208中,终端根据该目标接近值进行接近检测。
比如,在计算得到目标接近值之后,终端就可以根据该目标接近值进行接近检测。
需要说明的是,相关技术中,在强光环境下,终端在进行接近检测时通过接近传感器采集两个接近值。第一次所采集的接近值是在接近传感器的发射端不向外发射红外线探测信号的情况下,终端读取到的接近传感器输出的接近值,例如为a。数值a为外界环境光中的红外线进入接近传感器的接收端后,接收端根据外界环境光中的红外线强度计算得到的接近值。第二次所采集的接近值是在接近传感器的发射端向外发射红外线探测信号的情况下,终端读取到的接近传感器输出的接近值,例如为b。数值b为为发射端发出的红外线经障碍物反射后以及外界环境光中的红外线这两者进入接近传感器的接收端后,接收端根据接收到的红外线强度计算得到的接近值。可以理解的是,数值b与a的差值(即b-a)即为接近传感器的发射端向外发射的红外线经障碍物反射后进入接收端而得到的接近值。也即,终端是根据数值b与a的差值来进行接近检测的。
然而,实际上外界环境中的红外光线对接近传感器的接收端的干扰是呈斜线影响的。比如,如图5所示,阴影部分A代表在接近传感器的发射端不向外发射红外线探测信号的情况下,外界环境光中的红外线进入接近传感器的接收端后,接收端根据外界环境光中的红外线强度计算得到的接近值。阴影部分B代表在接近传感器的发射端向外发射红外线探测信号的情况下,环境光中的红外线进入接近传感器的接收端所对应的接近值部分。由图可知,阴影部分A和阴影部分B的面积不同。因此,强光环境下,上述计算得到的接近值b-a与真实的接近值之间存在误差。
在本申请实施例中,终端通过接近传感器四次采集接近值。这四次采集过程是在依次控制接近传感器的发射端不向外发射红外线探测信号、向外发射红外线探测信号、向外发射红外线探测信号、不向外发射红外线探测信号的情况下,终端读取到的接近传感器输出的接近值。由于外界环境中的红外光线对接近传感器的接收端的干扰是呈斜线影响的。因此,对于终端所采集到的四个接近值,按照采集时间先后的顺序,外界环境光中的红外线进入接收端后在接近值上的变化量是相同的。
如图6所示,比如第一次采集的接近值为P1=a。由于第一次采集的接近值是在接近传感器的发射端未向外发射红外线探测信号的情况下所得到的接近值,因此a为外界环境光中的红外线所对应的接近值大小。
第二次采集接近值是在接近传感器的发射端向外发射红外线探测信号的情况下进行的,例如发射端向外发射的红外线探测信号经外界障碍物反射后进入接收端,该反射的红外线探测信号对应的接近值大小为s1。而外界环境光中的红外线进入接收端后对应的接近值大小为a+x,其中x为外界环境光中的红外线进入接收端后在接近值上的变化量。可以理解的是,在实际应用场景下,x的数值可以为正数或者负数。例如,第二次采集的接近值为P2=s1+a+x。
第三次采集接近值也是在接近传感器的发射端向外发射红外线探测信号的情况下进行的,例如发射端向外发射的红外线探测信号经外界障碍物反射后进入 接收端,该反射的红外线探测信号对应的接近值大小为s2。而外界环境光中的红外线进入接收端后对应的接近值大小为a+2x。例如,第三次采集的接近值为P3=s2+a+2x。
第四次采集的接近值是在接近传感器的发射端未向外发射红外线探测信号的情况下所得到的接近值。例如,第四次采集的接近值为P4=a+3x。
在采集到P1、P2、P3、P4之后,终端可以根据PS_code=PS_on-PS_off进行接近值的计算。其中,PS_code代表发射端向外发射的红外线探测信号经障碍物反射进入接收端后所对应部分的接近值的真实值,PS_on代表发射端向外发射红外线探测信号的情况下接近传感器输出的接近值,PS_off代表发射端未向外发射红外线探测信号的情况下接近传感器输出的接近值。
也即,P2-P1=(s1+a+x)-a=s1+x。P3-P4=(s2+a+2x)-(a+3x)=s2-x。然后,终端可以计算s1+x和s2-x的平均值,得到(s1+s2)/2。然后,终端可以将该平均值(s1+s2)/2确定为接近传感器的目标接近值,并根据该目标接近值进行接近判断。由平均值(s1+s2)/2可知,该平均值中已经不包含a和x,也即该平均值已经将外界环境光中的红外线干扰去除了。
即,在一种实施方式中,在获取到接近传感器输出的一组接近值之后,终端可以通过如下步骤来计算目标接近值,其中该组接近值为依次控制接近传感器的发射端不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值。:
将接近传感器的发射端依次在不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值分别确定为第一接近值、第二接近值、第三接近值及第四接近值;
计算所述第二接近值和所述第一接近值的差,得到第一差值;
计算所述第三接近值和所述第四接近值的差,得到第二差值;
计算所述第一差值和所述第二差值的平均值,并将所述平均值确定为目标接近值。
当然,也可以先计算P2和P3的和(第一和值),以及P1和P4的和(第二和值),即P2+P3=s1+a+x+s2+a+2x=s1+s2+2a+3x,P1+P4=a+a+3x=2a+3x。然后,终端再计算第一和值和第二和值的差值,即(s1+s2+2a+3x)-(2a+3x)=s1+s2。接着,终端可以将第一和值和第二和值的差值的二分之一确定为接近传感器的目标接近值,即(s1+s2)/2。
在一种实施方式中,根据目标接近值进行接近检测的步骤,可以包括:
若检测到该目标接近值大于预设第一阈值,则确定终端处于接近状态。
比如,预设第一阈值的数值大小为400,那么当计算得到的目标接近值大于400时,就可以确定出终端处于接近状态,进而触发终端执行关闭显示屏背光等操作。
在一种实施方式中,本申请实施例还可以包括如下步骤:
若检测到该目标接近值小于预设第二阈值,则确定终端处于远离状态,预设第二阈值小于预设第一阈值。
例如,预设第二阈值的数值大小可以为300,那么当计算得到的目标接近值小于300时,可以确定出终端处于远离状态,进而触发终端执行显示屏亮屏操作等。
在其它实施方式中,终端还可以根据实际使用需要,对预设第一阈值和预设第二阈值的大小进行调整。比如,当接收到用于指示对预设第一阈值和预设第 二阈值进行调整的指令时,终端可以按照该指令对预设第一阈值和预设第二阈值进行调整,该指令中可以携带有调整后的预设第一阈值和预设第二阈值的数值大小,或者该指令中可以携带有变化量,并指示终端按照该变化量对预设第一阈值和预设第二阈值的大小进行调整,等等。
即,在一种实施方式中,本实施例还可以包括如下步骤:
当接收到携带有变化量的指令时,按照所述变化量对所述预设第一阈值和所述预设第二阈值的数值进行调整。
本实施例提供一种接近检测装置,该接近检测装置可以包括:
获取模块,用于获取环境光强度值;
检测模块,用于根据所述环境光强度值,检测终端是否处于强光环境;
读取模块,用于若检测到终端处于强光环境,则读取接近传感器输出的至少一组接近值,每一组接近值为依次控制接近传感器的发射端不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值;
计算模块,用于根据所述至少一组接近值,计算得到目标接近值,并根据所述目标接近值进行接近检测。
在一种实施方式中,所述计算模块可以用于:
将接近传感器的发射端依次在不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值分别确定为第一接近值、第二接近值、第三接近值及第四接近值;
计算所述第二接近值和所述第三接近值的和,得到第一和值;
计算所述第一接近值和所述第四接近值的和,得到第二和值;
计算所述第一和值和所述第二和值的差值,并将所述差值的二分之一确定为目标接近值。
在一种实施方式中,所述计算模块可以用于:
将接近传感器的发射端依次在不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值分别确定为第一接近值、第二接近值、第三接近值及第四接近值;
计算所述第二接近值和所述第一接近值的差,得到第一差值;
计算所述第三接近值和所述第四接近值的差,得到第二差值;
计算所述第一差值和所述第二差值的平均值,并将所述平均值确定为目标接近值。
在一种实施方式中,所述计算模块还可以用于:若检测到所述目标接近值大于预设第一阈值,则确定终端处于接近状态;若检测到所述目标接近值小于预设第二阈值,则确定终端处于远离状态,所述预设第二阈值小于所述预设第一阈值。
在一种实施方式中,所述检测模块可以用于:检测所述环境光强度值是否大于预设光强阈值;若检测出所述环境光强度值大于预设光强阈值,则确定终端处于强光环境;若检测出所述环境光强度值不大于预设光强阈值,则确定终端不处于强光环境。
在一种实施方式中,所述计算模块还可以用于:当接收到携带有变化量的指令时,按照所述变化量对所述预设第一阈值和所述预设第二阈值的数值进行调整。
请参阅图7,图7为本申请实施例提供的接近检测装置的结构示意图。接近检测装置300可以包括:获取模块301,检测模块302,读取模块303,以及 计算模块304。
获取模块301,用于获取环境光强度值。
检测模块302,用于根据所述环境光强度值,检测终端是否处于强光环境。
比如,在终端进行通话时,获取模块301可以先通过环境光传感器获取当前环境下的环境光强度值。然后,检测模块302可以根据该环境光强度值,检测终端是否处于强光环境。
如果检测出终端不处于强光环境,那么终端可以直接读取接近传感器输出的接近值,并根据该接近值进行接近检测。
读取模块303,用于若检测到终端处于强光环境,则读取接近传感器输出的至少一组接近值,每一组接近值为依次控制接近传感器的发射端不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值。
比如,在检测模块302确定出自身处于强光环境的情况下,读取模块303可以通过接近传感器四次采集接近值。这四次采集过程是在依次控制接近传感器的发射端不向外发射红外线探测信号、向外发射红外线探测信号、向外发射红外线探测信号、不向外发射红外线探测信号的情况下,终端读取到的接近传感器输出的接近值。
也即,在第一次采集接近值时,读取模块303可以控制接近传感器的发射端不向外发射红外线探测信号,此时接近传感器输出的接近值为外界环境光中的红外线进入接近传感器的接收端后,接收端根据外界环境光中的红外线强度计算得到的接近值。在第二次采集接近值时,读取模块303可以控制接近传感器的发射端向外发射红外线探测信号,此时接近传感器输出的接近值为发射端发出的红外线经障碍物反射后以及外界环境光中的红外线这两者进入接近传感器的接收端后,接收端根据接收到的红外线强度计算得到的接近值。
在第三次采集接近值时,读取模块303同样可以控制接近传感器的发射端向外发射红外线探测信号,从而得到一个接近值。在第四次采集接近值时,读取模块303可以控制接近传感器的发射端不向外发射红外线探测信号,从而得到一个接近值。
计算模块304,用于根据所述至少一组接近值,计算得到目标接近值,并根据所述目标接近值进行接近检测。
比如,在读取模块303获取到接近传感器输出的一组接近值之后,计算模块304可以根据这组接近值计算得到一个目标接近值。然后,计算模块304就可以根据该目标接近值进行接近检测。
可以理解的是,本申请实施例可以在终端处于强光环境时,采集接近传感器输出的一组接近值。这组接近值是在依次控制接近传感器的发射端不向外发射探测信号、向外发射探测信号、向外发射探测信号、不向外发射探测信号的情况下得到接近值。然后,终端可以根据这组接近值计算得到目标接近值,并根据该目标接近值进行接近检测。因此,本申请实施例可以提高强光环境下终端进行接近检测的多样性。
在一种实施方式中,计算模块304可以用于:
将接近传感器的发射端依次在不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值分别确定为第一接近值、第二接近值、第三接近值及第四接近值;
计算所述第二接近值和所述第三接近值的和,得到第一和值;
计算所述第一接近值和所述第四接近值的和,得到第二和值;
计算所述第一和值和所述第二和值的差值,并将所述差值的二分之一确定为目标接近值。
比如,在采集到四个接近值之后,计算模块304可以将接近传感器的发射端依次在不向外发射红外线探测信号、向外发射红外线探测信号、向外发射红外线探测信号、不向外发射红外线探测信号时采集到的接近值分别确定为第一接近值、第二接近值、第三接近值及第四接近值。
然后,计算模块304可以计算第二接近值和第三接近值的和,得到第一和值。同时,计算模块304可以计算第一接近值和第四接近值的和,得到第二和值。
接着,计算模块304可以计算该第一和值和第二和值的差值,并将该差值的二分之一确定为目标接近值。
比如,第一次采集的接近值为P1=a,第二次采集的接近值为P2=s1+a+x,第三次采集的接近值为P3=s2+a+2x,第四次采集的接近值为P4=a+3x。其中,a为接近传感器的发射端未向外发射红外线探测信号的情况下接近传感器输出的接近值,因此a为第一次采集过程中外界环境光的红外线所对应的接近值大小。x为每次进行接近值采集时,相比于上一次接近值采集时,外界环境光中的红外线进入接收端后在接近值上的变化量。
那么,P2+P3=s1+a+x+s2+a+2x=s1+s2+2a+3x,P1+P4=a+a+3x=2a+3x。(P2+P3)-(P1+P4)=(s1+s2+2a+3x)-(2a+3x)=s1+s2。那么,计算模块304可以将s1+s2的二分之一确定为目标接近值,即(s1+s2)/2。
由平均值(s1+s2)/2可知,该平均值中已经不包含a和x,也即该平均值已经将外界环境光中的红外线干扰去除了。
在一种实施方式中,计算模块304可以用于:
若检测到所述目标接近值大于预设第一阈值,则确定终端处于接近状态;
若检测到所述目标接近值小于预设第二阈值,则确定终端处于远离状态,所述预设第二阈值小于所述预设第一阈值。
比如,计算模块304在根据目标接近值进行接近检测时,若检测到该目标接近值大于预设第一阈值,则计算模块304可以确定终端处于接近状态。若检测到该目标接近值小于预设第二阈值,则计算模块304可以确定终端处于远离状态,其中预设第二阈值小于预设第一阈值。
例如,预设第一阈值的数值大小为400,那么当计算得到的目标接近值大于400时,计算模块304就可以确定出终端处于接近状态,进而触发终端执行关闭显示屏背光等操作。预设第二阈值的数值大小可以为300,那么当计算得到的目标接近值小于300时,计算模块304可以确定出终端处于远离状态,进而触发终端执行显示屏亮屏操作等。
在一种实施方式中,检测模块302可以用于:
检测所述环境光强度值是否大于预设光强阈值;
若检测出所述环境光强度值大于预设光强阈值,则确定终端处于强光环境;
若检测出所述环境光强度值不大于预设光强阈值,则确定终端不处于强光环境。
比如,检测模块302在根据获取到的环境光强度值,检测终端是否处于强光环境时,可以检测获取到的环境光强度值是否大于预设光强阈值。例如预设光强阈值可以为6000勒克斯(lux)。
那么,当检测到环境光强度值大于6000勒克斯时,检测模块302可以确定终端处于强光环境。当检测到环境光强度值不大于6000勒克斯时,检测模块302 可以确定终端不处于强光环境。
本申请实施例提供一种存储介质,其上存储有计算机程序,当所述计算机程序在计算机上执行时,使得所述计算机执行本申请实施例提供的接近检测方法。
本申请实施例还提供一种电子设备,包括存储器,处理器,所述处理器通过调用所述存储器中存储的计算机程序,用于执行本申请实施例提供的接近检测方法。
例如,上述电子设备可以是诸如平板电脑或者智能手机等移动终端。请参阅图8,图8为本申请实施例提供的移动终端的结构示意图。
该移动终端400可以包括传感器401、存储器402、处理器403等部件。本领域技术人员可以理解,图8中示出的移动终端结构并不构成对移动终端的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
传感器401可以至少包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板的亮度,接近传感器可在移动终端移动到耳边时,关闭显示面板和/或背光。
存储器402可用于存储应用程序和数据。存储器402存储的应用程序中包含有可执行代码。应用程序可以组成各种功能模块。处理器403通过运行存储在存储器402的应用程序,从而执行各种功能应用以及数据处理。
处理器403是移动终端的控制中心,利用各种接口和线路连接整个移动终端的各个部分,通过运行或执行存储在存储器402内的应用程序,以及调用存储在存储器402内的数据,执行移动终端的各种功能和处理数据,从而对移动终端进行整体监控。
在本实施例中,移动终端中的处理器403会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行代码加载到存储器402中,并由处理器403来运行存储在存储器402中的应用程序,执行如下步骤:
传感器401获取环境光强度值;
根据所述环境光强度值,处理器403检测终端是否处于强光环境;
若检测到终端处于强光环境,则处理器403读取接近传感器输出的至少一组接近值,每一组接近值为依次控制接近传感器的发射端不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值;
根据所述至少一组接近值,处理器403计算得到目标接近值,并根据所述目标接近值进行接近检测。
此外,请参阅图9,移动终端400还可以包括输入单元404和输出单元405。
输入单元404可用于接收输入的数字、字符信息或用户特征信息(比如指纹),以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。在一实施例中,输入单元404可包括触敏表面以及其他输入设备。触敏表面,也称为触摸显示屏或者触控板。
输出单元405可用于显示由用户输入的信息或提供给用户的信息以及移动终端的各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。输出单元可包括显示面板。
在一种实施方式中,处理器403执行所述根据所述至少一组接近值,计算得到目标接近值的步骤时,可以执行如下步骤:将接近传感器的发射端依次在未发射探测信号、发射探测信号、发射探测信号、未发射探测信号时接近传感器输出的接近值分别确定为第一接近值、第二接近值、第三接近值及第四接近值。计算所述第二接近值和所述第三接近值的和,得到第一和值。计算所述第一接近值 和所述第四接近值的和,得到第二和值。计算所述第一和值和所述第二和值的差值,并将所述差值的二分之一确定为目标接近值。
在另一种实施方式中,处理器403执行所述根据所述目标接近值进行接近检测的步骤时,可以执行如下步骤:若检测到所述目标接近值大于预设第一阈值,则确定终端处于接近状态。
在一种实施方式中,处理器403还可以执行如下步骤:若检测到所述目标接近值小于预设第二阈值,则确定终端处于远离状态,所述预设第二阈值小于所述预设第一阈值。
在一种实施方式中,处理器403执行所述根据所述环境光强度值,检测终端是否处于强光环境的步骤时,可以执行如下步骤:检测所述环境光强度值是否大于预设光强阈值。若检测出所述环境光强度值大于预设光强阈值,则确定终端处于强光环境。若检测出所述环境光强度值不大于预设光强阈值,则确定终端不处于强光环境。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见上文针对接近检测方法的详细描述,此处不再赘述。
本申请实施例提供的所述接近检测装置与上文实施例中的接近检测方法属于同一构思,在所述接近检测装置上可以运行所述接近检测方法实施例中提供的任一方法,其具体实现过程详见所述接近检测方法实施例,此处不再赘述。
需要说明的是,对本申请实施例所述接近检测方法而言,本领域普通技术人员可以理解实现本申请实施例所述接近检测方法的全部或部分流程,是可以通过计算机程序来控制相关的硬件来完成,所述计算机程序可存储于一计算机可读取存储介质中,如存储在存储器中,并被至少一个处理器执行,在执行过程中可包括如所述接近检测方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)等。
对本申请实施例的所述接近检测装置而言,其各功能模块可以集成在一个处理芯片中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中,所述存储介质譬如为只读存储器,磁盘或光盘等。
以上对本申请实施例所提供的一种接近检测方法、装置、存储介质以及电子设备进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (20)

  1. 一种接近检测方法,其中,所述方法包括:
    获取环境光强度值;
    根据所述环境光强度值,检测终端是否处于强光环境;
    若检测到终端处于强光环境,则读取接近传感器输出的至少一组接近值,每一组接近值为依次控制接近传感器的发射端不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值;
    根据所述至少一组接近值,计算得到目标接近值,并根据所述目标接近值进行接近检测。
  2. 根据权利要求1所述的接近检测方法,其中,所述根据所述至少一组接近值,计算得到目标接近值,包括:
    将接近传感器的发射端依次在不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值分别确定为第一接近值、第二接近值、第三接近值及第四接近值;
    计算所述第二接近值和所述第三接近值的和,得到第一和值;
    计算所述第一接近值和所述第四接近值的和,得到第二和值;
    计算所述第一和值和所述第二和值的差值,并将所述差值的二分之一确定为目标接近值。
  3. 根据权利要求1所述的接近检测方法,其中,所述根据所述至少一组接近值,计算得到目标接近值,包括:
    将接近传感器的发射端依次在不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值分别确定为第一接近值、第二接近值、第三接近值及第四接近值;
    计算所述第二接近值和所述第一接近值的差,得到第一差值;
    计算所述第三接近值和所述第四接近值的差,得到第二差值;
    计算所述第一差值和所述第二差值的平均值,并将所述平均值确定为目标接近值。
  4. 根据权利要求2所述的接近检测方法,其中,所述根据所述目标接近值进行接近检测,包括:
    若检测到所述目标接近值大于预设第一阈值,则确定终端处于接近状态。
  5. 根据权利要求4所述的接近检测方法,其中,所述方法还包括:
    若检测到所述目标接近值小于预设第二阈值,则确定终端处于远离状态,所述预设第二阈值小于所述预设第一阈值。
  6. 根据权利要求1所述的接近检测方法,其中,所述根据所述环境光强度值,检测终端是否处于强光环境,包括:
    检测所述环境光强度值是否大于预设光强阈值;
    若检测出所述环境光强度值大于预设光强阈值,则确定终端处于强光环境;
    若检测出所述环境光强度值不大于预设光强阈值,则确定终端不处于强光环境。
  7. 根据权利要求5所述的接近检测方法,其中,所述方法还包括:
    当接收到携带有变化量的指令时,按照所述变化量对所述预设第一阈值和所述预设第二阈值的数值进行调整。
  8. 一种接近检测装置,其中,所述装置包括:
    获取模块,用于获取环境光强度值;
    检测模块,用于根据所述环境光强度值,检测终端是否处于强光环境;
    读取模块,用于若检测到终端处于强光环境,则读取接近传感器输出的至少一组接近值,每一组接近值为依次控制接近传感器的发射端不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值;
    计算模块,用于根据所述至少一组接近值,计算得到目标接近值,并根据所述目标接近值进行接近检测。
  9. 根据权利要求8所述的接近检测装置,其中,所述计算模块用于:
    将接近传感器的发射端依次在不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值分别确定为第一接近值、第二接近值、第三接近值及第四接近值;
    计算所述第二接近值和所述第三接近值的和,得到第一和值;
    计算所述第一接近值和所述第四接近值的和,得到第二和值;
    计算所述第一和值和所述第二和值的差值,并将所述差值的二分之一确定为目标接近值。
  10. 根据权利要求8所述的接近检测装置,其中,所述计算模块用于:
    将接近传感器的发射端依次在不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值分别确定为第一接近值、第二接近值、第三接近值及第四接近值;
    计算所述第二接近值和所述第一接近值的差,得到第一差值;
    计算所述第三接近值和所述第四接近值的差,得到第二差值;
    计算所述第一差值和所述第二差值的平均值,并将所述平均值确定为目标接近值。
  11. 根据权利要求9所述的接近检测装置,其中,所述计算模块用于:
    若检测到所述目标接近值大于预设第一阈值,则确定终端处于接近状态;
    若检测到所述目标接近值小于预设第二阈值,则确定终端处于远离状态,所述预设第二阈值小于所述预设第一阈值。
  12. 根据权利要求8所述的接近检测装置,其中,所述检测模块用于:
    检测所述环境光强度值是否大于预设光强阈值;
    若检测出所述环境光强度值大于预设光强阈值,则确定终端处于强光环境;
    若检测出所述环境光强度值不大于预设光强阈值,则确定终端不处于强光环境。
  13. 一种存储介质,其上存储有计算机程序,其中,当所述计算机程序在计算机上执行时,使得所述计算机执行如权利要求1至7中任一项所述的接近检测方法。
  14. 一种电子设备,包括存储器,处理器,其中,所述处理器通过调用所述存储器中存储的计算机程序,用于执行如下步骤:
    获取环境光强度值;
    根据所述环境光强度值,检测终端是否处于强光环境;
    若检测到终端处于强光环境,则读取接近传感器输出的至少一组接近值,每一组接近值为依次控制接近传感器的发射端不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值;
    根据所述至少一组接近值,计算得到目标接近值,并根据所述目标接近值进行接近检测。
  15. 根据权利要求14所述的电子设备,其中,所述处理器用于执行如下步骤:
    将接近传感器的发射端依次在不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值分别确定为第一接近值、第二接近值、第三接近值及第四接近值;
    计算所述第二接近值和所述第三接近值的和,得到第一和值;
    计算所述第一接近值和所述第四接近值的和,得到第二和值;
    计算所述第一和值和所述第二和值的差值,并将所述差值的二分之一确定为目标接近值。
  16. 根据权利要求14所述的电子设备,其中,所述处理器用于执行如下步骤:
    将接近传感器的发射端依次在不发射探测信号、发射探测信号、发射探测信号、不发射探测信号时接近传感器输出的接近值分别确定为第一接近值、第二接近值、第三接近值及第四接近值;
    计算所述第二接近值和所述第一接近值的差,得到第一差值;
    计算所述第三接近值和所述第四接近值的差,得到第二差值;
    计算所述第一差值和所述第二差值的平均值,并将所述平均值确定为目标接近值。
  17. 根据权利要求15所述的电子设备,其中,所述处理器用于执行如下步骤:
    若检测到所述目标接近值大于预设第一阈值,则确定终端处于接近状态。
  18. 根据权利要求17所述的电子设备,其中,所述处理器用于执行如下步骤:
    若检测到所述目标接近值小于预设第二阈值,则确定终端处于远离状态,所述预设第二阈值小于所述预设第一阈值。
  19. 根据权利要求14所述的电子设备,其中,所述处理器用于执行如下步骤:
    检测所述环境光强度值是否大于预设光强阈值;
    若检测出所述环境光强度值大于预设光强阈值,则确定终端处于强光环境;
    若检测出所述环境光强度值不大于预设光强阈值,则确定终端不处于强光环境。
  20. 根据权利要求18所述的电子设备,其中,所述处理器用于执行如下步骤:
    当接收到携带有变化量的指令时,按照所述变化量对所述预设第一阈值和所述预设第二阈值的数值进行调整。
PCT/CN2018/094448 2017-07-31 2018-07-04 接近检测方法、装置、存储介质及电子设备 WO2019024644A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP18842120.0A EP3627810B1 (en) 2017-07-31 2018-07-04 Proximity detection method and apparatus, storage medium, and electronic device
US16/723,533 US11094267B2 (en) 2017-07-31 2019-12-20 Proximity detection method, storage medium, and electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710644147.8 2017-07-31
CN201710644147.8A CN107450817B (zh) 2017-07-31 2017-07-31 接近检测方法、装置、存储介质及电子设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/723,533 Continuation US11094267B2 (en) 2017-07-31 2019-12-20 Proximity detection method, storage medium, and electronic device

Publications (1)

Publication Number Publication Date
WO2019024644A1 true WO2019024644A1 (zh) 2019-02-07

Family

ID=60490069

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/094448 WO2019024644A1 (zh) 2017-07-31 2018-07-04 接近检测方法、装置、存储介质及电子设备

Country Status (4)

Country Link
US (1) US11094267B2 (zh)
EP (1) EP3627810B1 (zh)
CN (1) CN107450817B (zh)
WO (1) WO2019024644A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI825694B (zh) * 2021-10-05 2023-12-11 義明科技股份有限公司 近接感測器及其控制方法

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107450817B (zh) 2017-07-31 2019-12-31 Oppo广东移动通信有限公司 接近检测方法、装置、存储介质及电子设备
CN108874128B (zh) * 2018-06-01 2021-07-23 Oppo广东移动通信有限公司 接近检测方法及装置、电子装置、存储介质和设备
CN109061662B (zh) * 2018-07-02 2021-01-15 Oppo(重庆)智能科技有限公司 红外检测方法、装置、计算机设备和存储介质
CN108923865B (zh) * 2018-07-06 2021-06-11 Oppo(重庆)智能科技有限公司 红外距离传感器的校准方法、装置、移动终端及存储介质
CN109510896B (zh) * 2018-10-24 2020-12-01 Oppo广东移动通信有限公司 接近传感器的选择方法、装置、存储介质及电子设备
CN109743451B (zh) * 2018-12-28 2020-08-28 Oppo广东移动通信有限公司 控制方法、电子装置、计算机设备和存储介质
US11430407B2 (en) * 2019-09-25 2022-08-30 Vishay Semiconductor Gmbh Under display sensors, systems and methods
CN113497853B (zh) * 2020-04-02 2023-11-17 华为技术有限公司 电子设备、可移动组件的控制方法
US20230266464A1 (en) * 2020-07-15 2023-08-24 Ams International Ag Adaptive proximity detection system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130043486A (ko) * 2011-10-20 2013-04-30 어보브반도체 주식회사 근접센싱 방법 및 그 장치
CN106357922A (zh) * 2016-10-12 2017-01-25 广东欧珀移动通信有限公司 终端设备的状态监测方法、装置及终端设备
CN106506794A (zh) * 2016-09-05 2017-03-15 广东欧珀移动通信有限公司 终端设备的状态监测方法、装置及终端设备
CN107450817A (zh) * 2017-07-31 2017-12-08 广东欧珀移动通信有限公司 接近检测方法、装置、存储介质及电子设备

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2713586B1 (en) * 2011-06-24 2017-05-03 Huawei Device Co., Ltd. Method and device for adjusting detecting threshold of infrared proximity sensor
JP6659237B2 (ja) * 2015-03-30 2020-03-04 京セラ株式会社 表示装置
US10217439B2 (en) * 2016-02-04 2019-02-26 Apple Inc. Electronic device with ambient light sensor system
KR102493607B1 (ko) * 2016-06-15 2023-02-01 삼성전자주식회사 지문 인식 기능을 지원하는 전자 장치 및 이의 운용 방법
CN106303021A (zh) * 2016-08-12 2017-01-04 广东欧珀移动通信有限公司 屏幕工作状态控制方法及装置
CN106131345B (zh) * 2016-08-29 2020-01-10 Oppo广东移动通信有限公司 一种接近传感器的控制方法、装置及移动终端
CN107436685B (zh) * 2017-07-31 2020-07-07 京东方科技集团股份有限公司 显示装置、自发光的显示面板及手势识别方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130043486A (ko) * 2011-10-20 2013-04-30 어보브반도체 주식회사 근접센싱 방법 및 그 장치
CN106506794A (zh) * 2016-09-05 2017-03-15 广东欧珀移动通信有限公司 终端设备的状态监测方法、装置及终端设备
CN106357922A (zh) * 2016-10-12 2017-01-25 广东欧珀移动通信有限公司 终端设备的状态监测方法、装置及终端设备
CN107450817A (zh) * 2017-07-31 2017-12-08 广东欧珀移动通信有限公司 接近检测方法、装置、存储介质及电子设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3627810A4

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI825694B (zh) * 2021-10-05 2023-12-11 義明科技股份有限公司 近接感測器及其控制方法

Also Published As

Publication number Publication date
EP3627810A4 (en) 2020-05-27
US20200126495A1 (en) 2020-04-23
EP3627810A1 (en) 2020-03-25
EP3627810B1 (en) 2021-05-12
US11094267B2 (en) 2021-08-17
CN107450817A (zh) 2017-12-08
CN107450817B (zh) 2019-12-31

Similar Documents

Publication Publication Date Title
WO2019024644A1 (zh) 接近检测方法、装置、存储介质及电子设备
CN107943345B (zh) 接近传感器的校准方法、装置、存储介质和电子设备
CN107436685B (zh) 显示装置、自发光的显示面板及手势识别方法
US11175824B2 (en) Method for detecting ambient light intensity, storage medium and electronic device
US8610670B2 (en) Imaging and display apparatus, information input apparatus, object detection medium, and object detection method
CN107942306B (zh) 接近传感器的校准方法、装置、存储介质和电子设备
EP3435199A2 (en) Method, mobile terminal and non-transitory computer-readable storage medium for adjusting scanning frequency of touch screen
US9723181B2 (en) Gesture recognition apparatus and complex optical apparatus
US20090262070A1 (en) Method and System for Reducing Effects of Undesired Signals in an Infrared Imaging System
US20200092016A1 (en) Method for processing radio frequency interference, and electronic device
JP4690473B2 (ja) 画像解析装置、画像解析方法、撮像装置、画像解析プログラムおよび記録媒体
CN108881875B (zh) 图像白平衡处理方法、装置、存储介质及终端
US8188987B2 (en) Display and imaging apparatus and object detecting method
CN105593786A (zh) 对象位置确定
JPWO2008102767A1 (ja) 撮像装置、表示撮像装置および撮像処理装置
WO2015104884A1 (ja) 情報処理システム、情報処理方法およびプログラム
CN105807989A (zh) 一种手势触控方法和系统
US20150070266A1 (en) Gesture determination method and electronic device thereof
CN106954022B (zh) 图像处理方法、装置及终端
US9310903B2 (en) Displacement detection device with no hovering function and computer system including the same
CN109164917B (zh) 电子设备控制方法、存储介质及电子设备
TW201800901A (zh) 偵測動作資訊的方法及感光陣列
JP2008059253A (ja) 表示撮像装置、物体検出プログラムおよび物体の検出方法
CN107563259B (zh) 检测动作信息的方法、感光数组及影像传感器
CN109510896B (zh) 接近传感器的选择方法、装置、存储介质及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18842120

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2018842120

Country of ref document: EP

Effective date: 20191217

NENP Non-entry into the national phase

Ref country code: DE