WO2020093833A1 - 一种接近光传感器的控制方法及电子设备 - Google Patents

一种接近光传感器的控制方法及电子设备 Download PDF

Info

Publication number
WO2020093833A1
WO2020093833A1 PCT/CN2019/110066 CN2019110066W WO2020093833A1 WO 2020093833 A1 WO2020093833 A1 WO 2020093833A1 CN 2019110066 W CN2019110066 W CN 2019110066W WO 2020093833 A1 WO2020093833 A1 WO 2020093833A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
light
mobile phone
proximity
threshold
Prior art date
Application number
PCT/CN2019/110066
Other languages
English (en)
French (fr)
Inventor
徐杰
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2020093833A1 publication Critical patent/WO2020093833A1/zh

Links

Images

Classifications

    • 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

Definitions

  • the present application relates to the field of terminals, and in particular, to a control method of a proximity light sensor and an electronic device.
  • the proximity light sensor is commonly used in various terminals such as mobile phones and tablet computers to determine whether an object is approaching the terminal.
  • the proximity light sensor includes an infrared transmitting end 101 and an infrared receiving end 102. After the infrared emitting end 101 emits infrared rays, if an obstruction (such as a human ear) reflects the emitted infrared rays, the reflected infrared rays can be received by the infrared receiving end 102.
  • the mobile phone determines that an obstruction is approaching the mobile phone at this time. Furthermore, the mobile phone may start an anti-mistouch algorithm to avoid the obstruction approaching the mobile phone from accidentally touching the mobile phone screen 103.
  • the approach light threshold used to determine whether an obstruction approaches the mobile phone is fixed.
  • the proximity light threshold can be set to 650 units of measurement (the unit of measurement used to characterize the intensity of the received infrared light can be the unit of measurement of light intensity or the unit of measurement of electrical signals obtained by photoelectric conversion, It can be set by the mobile phone manufacturer), that is, when the intensity of the infrared light received by the infrared receiving terminal 102 exceeds 650 units, it can be determined that there is an obstruction approaching the mobile phone.
  • the actual use of mobile phones is diverse, and the fixed proximity light threshold cannot meet the needs in various situations.
  • the near-light threshold is difficult to reach, resulting in a false touch algorithm that cannot be started, making false touches easy to occur; in other cases, the near-light threshold is easy to reach, and the false touch algorithm is often started, causing users to The normal operation cannot be performed immediately. Therefore, how to set the near-light threshold to meet user needs in different use cases has become an urgent problem to be solved.
  • the present application provides a control method and electronic device for a proximity light sensor, which can adaptively adjust the proximity light threshold of the proximity light sensor under different usage conditions, thereby improving flexibility in activating and deactivating the anti-mistouch function.
  • the present application provides a method for controlling a proximity light sensor, which can be executed by an electronic device having a proximity light sensor, the method comprising: detecting that an adjustment condition is satisfied, the adjustment condition comprising: the movement posture of the electronic device is set Target motion posture; change the first proximity light threshold of the proximity light sensor to the second proximity light threshold (the first proximity light threshold is different from the second proximity light threshold); obtain the light intensity parameter reported by the proximity light sensor, and the light intensity parameter It is used to indicate the reflected light intensity of the light emitted by the proximity light sensor; according to the light intensity parameter and the second proximity light threshold, activate or deactivate the anti-mistouch function of the screen of the electronic device.
  • the electronic device can determine the corresponding proximity light threshold value in combination with the current motion posture of the mobile phone. Since the motion posture of the electronic device can reflect the specific scene where the electronic device is currently located, in this way, when the electronic device is in a different motion posture, it is generally in different usage scenarios, and the electronic device can use different proximity light thresholds to determine whether to activate the touch screen Anti-mistouch function, thereby improving the flexibility when activating and deactivating the anti-mistouch function.
  • the target motion posture specifically includes: the gravity component of the electronic device in a set direction is greater than a set value, and the set direction is a direction from the bottom of the electronic device to the top of the electronic device.
  • the component of gravity in the set direction is greater than the set value
  • the electronic device is mostly in a top-down state.
  • the electronic device is generally in a pocket scene. That is, when it is detected that the electronic device is in a top-down state, the electronic device can dynamically adjust the proximity light threshold of the proximity light sensor.
  • a person skilled in the art may also set a specific method for detecting the top-down of the electronic device according to actual application scenarios or actual experience, which is not limited in this embodiment of the present application.
  • the target motion posture includes: the gravity component of the electronic device in the set direction gradually increases to be greater than the set value, the set direction is from the bottom of the electronic device to the top of the electronic device direction.
  • the component of gravity in the above set direction gradually increases to the set value, it means that the movement posture of the electronic device gradually changes to the top-down state, which usually occurs when the user puts the electronic device in the pocket The conversion of this movement posture. Therefore, when it is detected that the component of gravity in the above-mentioned set direction gradually increases to the set value, the electronic device can dynamically adjust the approach light threshold of the proximity light sensor.
  • the above adjustment conditions further include: a screen lock event or a screen off event is detected.
  • the electronic device can set the proximity light threshold to a smaller value. In this way, if the proximity light sensor detects that the intensity of the reflected light is greater than the proximity light threshold, the electronic device can start the anti-mistouch algorithm to shield the touch operation detected by the touch screen, thereby reducing the probability of mistouching occurring in the electronic device.
  • the target motion posture includes: the rotation angle of the electronic device rotating around a set direction is greater than an angle threshold, and the set direction is a direction from the bottom of the electronic device to the top of the electronic device.
  • the angle of the electronic device rotating around the above-mentioned set direction is greater than the angle threshold, it means that the electronic device is in a flipped state.
  • the user answers the call using the handset the user usually flips the phone to his ear, causing the electronic device to rotate at a certain angle around the set direction. Therefore, when the angle of the electronic device rotating around the set direction is greater than the angle threshold, the electronic device is very It may be in the scene of ear-to-ear conversation.
  • the above target motion posture further includes: after the acceleration generated by the electronic device in at least one direction gradually increases to be greater than the first set value, then gradually decreases to be less than the second set value (the first set value is greater than the second Setting value). If the motion posture of the electronic device is detected as the above target motion posture, it means that the electronic device is both in the flipped state and at the same time in the motion gesture of raising the hand. At this time, the user is more likely to use the electronic device for on-ear conversation.
  • the electronic device can dynamically adjust the proximity light threshold of the proximity light sensor.
  • a person skilled in the art may set a specific method for detecting that the electronic device is in a flipped state and a motion gesture of raising a hand according to actual application scenarios or actual experience, and the embodiments of the present application do not make any limitation on this.
  • the above adjustment condition further includes: detecting an incoming call event or a dialing event.
  • the electronic device can set the proximity light threshold to a smaller value. In this way, if the proximity light sensor detects that the intensity of the reflected light is greater than the proximity light threshold, the electronic device can start the anti-mistouch algorithm to shield the touch operation detected by the touch screen, thereby reducing the probability of mistouching occurring in the electronic device.
  • the electronic device may use a near-light threshold value with a large value to determine whether there is an obstruction.
  • the requirement for the electronic device to determine whether there is an obstruction approaching is stricter, so that the conditions for the electronic device to start the anti-missing algorithm are stricter, so as to reduce the probability that the user's normal operation is blocked due to frequent activation of the anti-missing algorithm .
  • the light intensity parameter may refer to the reflected light intensity received by the proximity light sensor, or the ratio of the reflected light intensity to the emitted light intensity of the proximity light sensor; the first proximity light threshold is greater than the first Two approaching light thresholds; where, according to the light intensity parameter and the second approaching light threshold, the anti-mistouch function of the screen of the electronic device is activated or deactivated, including: if the light intensity parameter is greater than the second approaching light threshold, there is an obstruction Approaching the electronic device can activate the anti-mistouch function of the screen of the electronic device, or keep the anti-mistouch function of the screen of the electronic device in an activated state.
  • the electronic device may deactivate the touch screen anti-misoperation function, or keep the touch screen anti-misoperation function of the electronic device in a deactivated state .
  • the light intensity parameter may refer to the ratio of the emitted light intensity of the proximity light sensor to the reflected light intensity received by the proximity light sensor, or the light loss rate of the emitted light intensity of the proximity light sensor;
  • the first approaching light threshold is less than the second approaching light threshold; wherein, according to the light intensity parameter and the second approaching light threshold, activating or deactivating the anti-mistouch function of the screen of the electronic device includes: if the light intensity parameter is less than the second approaching The light threshold indicates that an obstruction approaching the electronic device can activate the anti-mistouch function of the screen of the electronic device, or keep the anti-mistouch function of the screen of the electronic device activated.
  • the electronic device may deactivate the touch screen anti-mistouch function or keep the touch screen anti-mistouch function of the electronic device in a deactivated state .
  • the present application provides an electronic device, including: a proximity light sensor, an acceleration sensor, a gyro sensor touch screen, one or more processors, one or more memories, and one or more computer programs; wherein, processing The device is coupled with a proximity light sensor, an acceleration sensor, a gyro sensor touch screen, and a memory.
  • the above one or more computer programs are stored in the memory.
  • the processor executes one or more computers stored in the memory
  • the present application provides a computer storage medium, including computer instructions, which, when executed on an electronic device, cause the electronic device to perform the method for controlling a proximity light sensor as described in any one of the first aspects.
  • the present application provides a computer program product that, when the computer program product runs on an electronic device, causes the electronic device to execute the method for controlling a proximity light sensor as described in any one of the first aspects.
  • the terminal described in the second aspect provided above, the computer storage medium described in the third aspect, and the computer program product described in the fourth aspect are all used to perform the corresponding methods provided above, therefore,
  • the beneficial effects that can be achieved refer to the beneficial effects in the corresponding method provided above, which will not be repeated here.
  • FIG. 1 is a schematic diagram of the working principle of a proximity light sensor in the prior art
  • FIG. 2 is a schematic structural diagram 1 of an electronic device according to an embodiment of the present application.
  • FIG. 3 is a first schematic diagram 1 of a method for controlling a proximity light sensor provided by an embodiment of the present application
  • FIG. 4 is a second schematic diagram of the principle of a method for controlling a proximity light sensor provided by an embodiment of the present application
  • FIG. 5 is a schematic structural diagram of an operating system in an electronic device according to an embodiment of the present application.
  • FIG. 6 is a schematic diagram 3 of a principle of a method for controlling a proximity light sensor provided by an embodiment of the present application
  • FIG. 7 is a schematic diagram 4 of principle of a method for controlling a proximity light sensor provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram 5 of principle of a method for controlling a proximity light sensor provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram 6 of principle of a method for controlling a proximity light sensor provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram 7 of a principle of a method for controlling a proximity light sensor provided by an embodiment of the present application;
  • FIG. 11 is a schematic diagram 8 of a method for controlling a proximity light sensor according to an embodiment of the present application.
  • FIG. 12 is a second structural diagram of an electronic device according to an embodiment of the present application.
  • a method for controlling a proximity light sensor provided by an embodiment of the present application can be applied to mobile phones, tablet computers, desktops, laptops, notebook computers, ultra-mobile personal computers (UMPC), handheld computers, and netbooks , Personal digital assistant (personal digital assistant, PDA), wearable electronic devices, virtual reality devices and other electronic devices.
  • UMPC ultra-mobile personal computers
  • PDA Personal digital assistant
  • wearable electronic devices virtual reality devices and other electronic devices.
  • FIG. 2 shows a schematic structural diagram of the mobile phone 100.
  • the mobile phone 100 may include a processor 110, an external memory interface 120, an internal memory 121, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, The sensor module 180, the camera 193 and the display screen 194, etc.
  • the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the mobile phone 100.
  • the mobile phone 100 may include more or fewer components than shown, or combine some components, or split some components, or arrange different components.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), and an image signal processor (image) signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural-network processing unit (NPU) Wait.
  • application processor application processor
  • AP application processor
  • modem processor graphics processor
  • GPU graphics processor
  • ISP image signal processor
  • controller memory
  • video codec video codec
  • DSP digital signal processor
  • NPU neural-network processing unit
  • different processing units may be independent devices, or may be integrated in one or more processors.
  • the controller may be the nerve center and command center of the mobile phone 100.
  • the controller can generate the operation control signal according to the instruction operation code and the timing signal to complete the control of fetching instructions and executing instructions.
  • the processor 110 may also be provided with a memory for storing instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory may store instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Avoid repeated access, reduce the waiting time of the processor 110, thus improving the efficiency of the system.
  • the processor 110 may include one or more interfaces.
  • Interfaces can include integrated circuit (inter-integrated circuit, I2C) interface, integrated circuit built-in audio (inter-integrated circuit, sound, I2S) interface, pulse code modulation (pulse code modulation (PCM) interface, universal asynchronous transceiver (universal asynchronous receiver / transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input / output (GPIO) interface, subscriber identity module (SIM) interface, and And / or universal serial bus (USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • MIPI mobile industry processor interface
  • GPIO general-purpose input / output
  • SIM subscriber identity module
  • USB universal serial bus
  • the I2C interface is a bidirectional synchronous serial bus, including a serial data line (serial data line, SDA) and a serial clock line (derail clock line, SCL).
  • the processor 110 may include multiple sets of I2C buses.
  • the processor 110 may respectively couple the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces.
  • the processor 110 may couple the touch sensor 180K through the I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface to realize the touch function of the mobile phone 100.
  • the I2S interface can be used for audio communication.
  • the processor 110 may include multiple sets of I2S buses.
  • the processor 110 may be coupled to the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170.
  • the audio module 170 can transfer audio signals to the wireless communication module 160 through the I2S interface, so as to realize the function of answering the call through the Bluetooth headset.
  • the PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the audio module 170 can also transmit audio signals to the wireless communication module 160 through the PCM interface to realize the function of answering the phone call through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • the UART interface is generally used to connect the processor 110 and the wireless communication module 160.
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function.
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface, so as to realize the function of playing music through the Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193.
  • MIPI interface includes camera serial interface (camera serial interface, CSI), display serial interface (display serial interface, DSI) and so on.
  • the processor 110 and the camera 193 communicate through a CSI interface to implement the shooting function of the mobile phone 100.
  • the processor 110 and the display screen 194 communicate through the DSI interface to realize the display function of the mobile phone 100.
  • the GPIO interface can be configured via software.
  • the GPIO interface can be configured as a control signal or a data signal.
  • the GPIO interface may be used to connect the processor 110 to the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like.
  • GPIO interface can also be configured as I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 130 is an interface that conforms to the USB standard, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and so on.
  • the USB interface 130 can be used to connect a charger to charge the mobile phone 100, and can also be used to transfer data between the mobile phone 100 and peripheral devices. It can also be used to connect headphones and play audio through the headphones.
  • the interface can also be used to connect other electronic devices, such as AR devices.
  • the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic description, and does not constitute a limitation on the structure of the mobile phone 100.
  • the mobile phone 100 may also use different interface connection methods in the foregoing embodiments, or a combination of multiple interface connection methods.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 140 may receive the charging input of the wired charger through the USB interface 130.
  • the charging management module 140 may receive wireless charging input through the wireless charging coil of the mobile phone 100. While the charging management module 140 charges the battery 142, it can also supply power to the electronic device through the power management module 141.
  • the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
  • the power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, internal memory 121, external memory, display screen 194, camera 193, wireless communication module 160, and the like.
  • the power management module 141 can also be used to monitor battery capacity, battery cycle times, battery health status (leakage, impedance) and other parameters.
  • the power management module 141 may also be disposed in the processor 110.
  • the power management module 141 and the charging management module 140 may also be set in the same device.
  • the wireless communication function of the mobile phone 100 can be realized by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
  • Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in the mobile phone 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 150 can provide a wireless communication solution including 2G / 3G / 4G / 5G and the like applied to the mobile phone 100.
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), and so on.
  • the mobile communication module 150 can receive electromagnetic waves from the antenna 1 and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor and convert it to electromagnetic wave radiation through the antenna 1.
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110.
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low-frequency baseband signal to be transmitted into a high-frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal.
  • the demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low-frequency baseband signal is processed by the baseband processor and then passed to the application processor.
  • the application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194.
  • the modem processor may be an independent device.
  • the modem processor may be independent of the processor 110, and may be set in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide wireless local area network (wireless local area networks, WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (bluetooth, BT), and global navigation satellite systems that are applied to the mobile phone 100 (global navigation system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency-modulates and filters electromagnetic wave signals, and transmits the processed signals to the processor 110.
  • the wireless communication module 160 may also receive the signal to be transmitted from the processor 110, frequency-modulate it, amplify it, and convert it to electromagnetic wave radiation through the antenna 2.
  • the antenna 1 of the mobile phone 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the mobile phone 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include a global mobile communication system (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), broadband Wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long-term evolution (LTE), BT, GNSS, WLAN, NFC , FM, and / or IR technology, etc.
  • the GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a beidou navigation system (BDS), and a quasi-zenith satellite system (quasi -zenith satellite system (QZSS) and / or satellite-based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS beidou navigation system
  • QZSS quasi-zenith satellite system
  • SBAS satellite-based augmentation systems
  • the mobile phone 100 realizes a display function through a GPU, a display screen 194, and an application processor.
  • the GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations, and is used for graphics rendering.
  • the processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos and the like.
  • the display screen 194 includes a display panel.
  • the display panel may use a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light-emitting diode or an active matrix organic light-emitting diode (active-matrix organic light) emitting diode, AMOLED, flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diode (QLED), etc.
  • the mobile phone 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
  • the mobile phone 100 can realize a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
  • the ISP processes the data fed back by the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, and the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, which is converted into an image visible to the naked eye.
  • ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be set in the camera 193.
  • the camera 193 is used to capture still images or video.
  • the object generates an optical image through the lens and projects it onto the photosensitive element.
  • the photosensitive element may be a charge coupled device (charge coupled device, CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CCD charge coupled device
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other image signals.
  • the mobile phone 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
  • the digital signal processor is used to process digital signals. In addition to digital image signals, it can also process other digital signals. For example, when the mobile phone 100 is selected at a frequency point, the digital signal processor is used to perform Fourier transform on the energy at the frequency point.
  • Video codec is used to compress or decompress digital video.
  • the mobile phone 100 may support one or more video codecs. In this way, the mobile phone 100 can play or record videos in various encoding formats, such as: moving picture experts group (moving picture experts, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
  • moving picture experts group moving picture experts, MPEG
  • MPEG2 moving picture experts, MPEG2, MPEG3, MPEG4, etc.
  • NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • the NPU can realize applications such as intelligent recognition of the mobile phone 100, such as image recognition, face recognition, voice recognition, and text understanding.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video and other files in an external memory card.
  • the internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions.
  • the processor 110 executes instructions stored in the internal memory 121 to execute various functional applications and data processing of the mobile phone 100.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area may store an operating system, at least one function required application programs (such as sound playback function, image playback function, etc.).
  • the storage data area may store data (such as audio data, phone book, etc.) created during the use of the mobile phone 100 and the like.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and so on.
  • a non-volatile memory such as at least one disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and so on.
  • the mobile phone 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, and an application processor. For example, music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into analog audio signal output, and also used to convert analog audio input into digital audio signal.
  • the audio module 170 can also be used to encode and decode audio signals.
  • the audio module 170 may be disposed in the processor 110, or some functional modules of the audio module 170 may be disposed in the processor 110.
  • the speaker 170A also called “speaker” is used to convert audio electrical signals into sound signals.
  • the mobile phone 100 can listen to music through the speaker 170A, or listen to a hands-free call.
  • the receiver 170B also known as "handset" is used to convert audio electrical signals into sound signals.
  • the voice can be received by holding the receiver 170B close to the ear.
  • the microphone 170C also called “microphone”, “microphone”, is used to convert sound signals into electrical signals.
  • the user can make a sound by approaching the microphone 170C through a person's mouth, and input a sound signal to the microphone 170C.
  • the mobile phone 100 may be provided with at least one microphone 170C. In other embodiments, the mobile phone 100 may be provided with two microphones 170C. In addition to collecting sound signals, it may also achieve a noise reduction function. In other embodiments, the mobile phone 100 may also be provided with three, four, or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions.
  • the headset interface 170D is used to connect wired headsets.
  • the earphone interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic device (open terminal) platform (OMTP) standard interface, and the American Telecommunications Industry Association (cellular telecommunications industry association of the United States, CTIA) standard interface.
  • OMTP open mobile electronic device
  • CTIA American Telecommunications Industry Association
  • the sensor module 180 may further include a gyro sensor 180B and / or an acceleration sensor 180E.
  • the rotation angle of the mobile phone 100 around three axes can be determined by the gyro sensor 180B.
  • the top of the phone is on top and the bottom is on the bottom.
  • a right-handed Cartesian coordinate system as shown in Fig. 3 includes x-axis, y-axis and z-axis.
  • the axis of the short side of the screen of the mobile phone 100 is the x-axis
  • the axis of the long side of the screen of the mobile phone 100 is the y-axis
  • the y-axis points from the bottom of the phone to the top of the screen, perpendicular to the plane where the x-axis and the y-axis are Is the z axis
  • the z axis points outward from the plane defined by the x and y axes.
  • the mobile phone 100 generally rotates about 90 ° around the y axis.
  • the gyro sensor 180B detects that the rotation angle of the mobile phone 100 around the y-axis is greater than a certain threshold (for example, 80 °), the movement posture of the mobile phone is generally in a flip state. If the mobile phone 100 is in a call state at this time, it means that the user is likely to use the mobile phone 100 for an on-ear call, that is, the user is in an on-ear call scenario.
  • a certain threshold for example 80 °
  • the acceleration sensor 180E can detect the magnitude of acceleration of the mobile phone 100 in various directions (generally x, y, and z axes). When the mobile phone 100 is stationary, the acceleration sensor 180E can detect the magnitude and direction of gravity. Exemplarily, as shown in FIG.
  • the acceleration sensor 180E detects that the direction of gravity points to the top of the mobile phone 100 (that is, the direction of gravity points along the y-axis toward the direction of extension), or, detects that the direction of gravity along the top of the mobile phone 100
  • the component of is greater than the set value (that is, the direction of gravity along the y-axis component is greater than the set value)
  • the mobile posture is generally top-down state, indicating that the mobile phone 100 is likely to be placed in a pocket or bag by the user at this time in.
  • the mobile phone 100 can also determine whether the mobile phone 100 is put in a pocket or bag by the user according to other information.
  • the acceleration sensor 180E detects that the direction of gravity points to the top of the mobile phone 100, and the ambient light sensor 180L detects that the intensity of the ambient light is less than the threshold, it means that the mobile phone 100 is likely to be put in a pocket or bag by the user at this time.
  • information such as the rotation angle detected by the gyro sensor 180B may be referred to as the measured value of the gyro sensor 180B, and information such as the magnitude and direction of gravity detected by the acceleration sensor 180E may be referred to as the acceleration sensor 180E.
  • Measured value information such as the rotation angle detected by the gyro sensor 180B
  • the acceleration sensor 180E information such as the magnitude and direction of gravity detected by the acceleration sensor 180E
  • Measured value The measured values of the gyro sensor 180B and the acceleration sensor 180E may reflect the movement posture of the mobile phone 100 and the application scenario where the user is using the mobile phone 100.
  • the sensor module 180 further includes a proximity light sensor 180G.
  • the proximity light sensor 180G may include a light emitting diode (LED) and a light detector.
  • the light emitting diode may be used as the emitting end of the proximity light sensor 180G.
  • the light emitting diode may be an infrared light emitting diode.
  • the mobile phone 100 emits infrared light outward through a light emitting diode.
  • a light detector for example, a photodiode
  • the mobile phone 100 uses a photodetector to detect infrared reflected light from a nearby obstruction, convert the received infrared reflected light into an electrical signal and quantize it to obtain the intensity of the infrared reflected light.
  • the measurement unit of the intensity of the infrared reflected light can be selected according to needs, which is not limited in the embodiment of the present invention, and the measurement unit is omitted when the intensity of the infrared reflected light and the light threshold value are described later.
  • the intensity of the infrared reflected light is greater than the set proximity light threshold, it may be determined that there is an obstruction near the mobile phone 100.
  • the mobile phone 100 may determine that there is no obstruction near the mobile phone 100.
  • the mobile phone 100 can select which close light threshold value to use according to the measurement value of the gyro sensor 180B or the acceleration sensor 180E to determine whether there is an obstruction near the mobile phone 100. Furthermore, when there is an obstruction near the mobile phone 100, the mobile phone 100 can activate an anti-mistouch algorithm to prevent the obstruction from accidentally touching the screen of the mobile phone 100.
  • the mobile phone 100 may set a first approaching light threshold and a second approaching light threshold (first approaching light threshold ⁇ second approaching light threshold).
  • first approaching light threshold first approaching light threshold ⁇ second approaching light threshold.
  • second approaching light threshold first approaching light threshold ⁇ second approaching light threshold.
  • the mobile phone 100 may set the proximity light threshold to the first proximity light threshold with a smaller value. In this way, if the proximity light sensor 180G detects that the intensity of the infrared reflected light is greater than the first proximity light threshold, the mobile phone 100 can start the anti-mistouch algorithm to shield the touch operation detected on the screen of the mobile phone 100, that is, the touch operation detected on the screen Not responding, thereby reducing the probability of a false touch phenomenon occurring in the mobile phone 100.
  • the measurement value of the acceleration sensor 180E reflects the state of the mobile phone in a top-down state, it means that the mobile phone is likely to be in a pocket scene. At this time, the blocking object close to the mobile phone is more likely to touch the screen of the mobile phone 100 to generate a false touch operation. If the proximity light threshold is set to the second proximity light threshold with a larger value, it is difficult for the proximity light sensor 180G to detect the intensity of infrared reflected light to reach the proximity light threshold, resulting in a false touch algorithm that cannot be started and a false touch occurs. Therefore, the mobile phone 100 may set the proximity light threshold to the first proximity light threshold with a smaller value.
  • the mobile phone 100 can start the anti-mistouch algorithm to shield the touch operation detected on the screen of the mobile phone 100, that is, the touch operation detected on the screen Not responding, thereby reducing the probability of a false touch phenomenon occurring in the mobile phone 100.
  • the mobile posture of the mobile phone in a flipped state or a top-down state may be referred to as a target sport posture.
  • a target sport posture In the target movement posture, there is a greater risk of accidental touch operation on the mobile phone screen.
  • the mobile phone screen is in a wrong touch operation relative to the mobile phone 100 in the target motion posture May be reduced. If you continue to set the proximity light threshold to the second proximity light threshold with a larger value at this time, the proximity light sensor 180G detects that the infrared reflected light intensity easily reaches the proximity light threshold, resulting in frequent activation of the false touch prevention algorithm and interference The normal operation of the user. Therefore, the mobile phone 100 may set the proximity light threshold to the second proximity light threshold with a larger value.
  • the mobile phone 100 will start the anti-mistouch algorithm to shield the touch operation detected on the screen of the mobile phone 100, thereby not affecting the normal operation of the user . Therefore, the activation of the anti-mistouch algorithm can be adapted to various scenarios.
  • the mobile phone 100 can determine the corresponding proximity light threshold in combination with the current motion posture of the mobile phone 100. Since the motion posture of the mobile phone 100 can reflect the specific scene in which the mobile phone 100 is currently located, in an application scenario where a mistouch operation is more likely to occur, the mobile phone 100 can use a near-light threshold value with a smaller value to determine whether there is an obstruction. At this time, even if a part of the infrared light emitted by the proximity light sensor 180G is absorbed, the mobile phone 100 can determine that an obstruction is approaching.
  • the requirement for the mobile phone 100 to determine whether there is an obstruction approaching is relatively relaxed, and accordingly the conditions for the mobile phone 100 to start the anti-mistouch algorithm are relatively relaxed, thereby reducing the probability of the mobile phone 100 being mis-touched as much as possible.
  • the mobile phone 100 may use a near-light threshold with a large value to determine whether there is an obstruction.
  • the requirement for the mobile phone 100 to determine whether there is an obstruction approaching is relatively strict, so that the conditions for the mobile phone 100 to start the anti-missing algorithm are relatively strict, so as to reduce the probability that the user's normal operation is blocked due to frequent activation of the anti-missing algorithm.
  • the above-mentioned sensor module 180 may further include a pressure sensor 180A, an air pressure sensor 180C, a magnetic sensor 180D, a distance sensor 180F, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc., this application
  • the touch sensor 180K also known as "touch panel”.
  • the touch sensor 180K may be provided on the display screen 194, and the touch sensor 180K and the display screen 194 constitute a touch screen, also called a "touch screen”.
  • the touch sensor 180K is used to detect a touch operation acting on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • the visual output related to the touch operation may be provided through the display screen 194.
  • the touch sensor 180K may also be disposed on the surface of the mobile phone 100, which is different from the location where the display screen 194 is located.
  • the mobile phone 100 may further include components such as a USB interface 130, a charging management module 140, a power management module 141, a battery 142, and a SIM card interface 195, which are not limited in the embodiments of the present application.
  • the software system of the mobile phone 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture.
  • the embodiment of the present application takes an Android system with a layered architecture as an example to exemplarily explain the software structure of the mobile phone 100.
  • FIG. 5 is a block diagram of the software structure of the mobile phone 100 according to an embodiment of the present invention.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through interfaces.
  • the Android system is divided into four layers, from top to bottom are the application layer, the application framework layer, the Android runtime and the system library, and the kernel layer.
  • the application layer may include a series of application packages.
  • the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.
  • System-level applications generally refer to: the application has system-level permissions and can obtain various system resources.
  • Ordinary level applications generally refer to: the application has ordinary permissions, may not be able to obtain certain system resources, or may require user authorization to obtain some system resources.
  • the system-level application can be a pre-installed application in the mobile phone.
  • the ordinary level application may be an application pre-installed in the mobile phone, or may be an application installed by subsequent users themselves.
  • the application framework layer provides an application programming interface (application programming interface) and programming framework for applications at the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer may include a window manager, a sensor manager, a state manager, a content provider, a view system, a phone manager, a notification manager, and so on.
  • the window manager (WindowManager) is used to manage window programs. For example, the window manager can load an anti-missing window on the window being displayed according to the anti-missing algorithm, thereby activating the anti-missing function of the mobile phone screen.
  • the anti-mistouch window can be transparent, translucent or opaque. After loading the anti-mistouch window, the phone will no longer respond to any operations received on the mobile phone screen until the window manager removes the anti-mistouch window.
  • the window manager can also obtain the size of the display screen, determine whether there is a status bar, lock the screen, intercept the screen, etc.
  • the sensor manager can be used to obtain sensor events reported by the sensor driver of the kernel layer.
  • the proximity light sensor may report the intensity of the detected infrared reflected light to the sensor manager through the sensor drive during operation.
  • the state manager can determine the mobile posture based on the measurement values reported by the gyro sensor and the acceleration sensor. For example, when the rotation angle of the mobile phone reported by the gyro sensor around the y-axis is greater than the set angle, the status manager may output a status signal 1 to the sensor manager to indicate that the mobile phone is in a flipped state. For another example, for example, when the direction of gravity reported by the acceleration sensor coincides with the direction of the y-axis, the status manager may output a status signal 0 to the sensor manager to indicate that the mobile phone is in a downward-facing motion posture.
  • Content providers are used to store and retrieve data, and make these data accessible to applications.
  • the data may include videos, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
  • the view system includes visual controls, such as controls for displaying text and controls for displaying pictures.
  • the view system can be used to build applications.
  • the display interface can be composed of one or more views.
  • a display interface that includes an SMS notification icon may include a view that displays text and a view that displays pictures.
  • the phone manager is used to provide the communication function of the mobile phone 100. For example, the management of call status (including connection, hang up, etc.).
  • the notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear after a short stay without user interaction.
  • the notification manager is used to notify the completion of downloading, message reminders, etc.
  • the notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window.
  • the text message is displayed in the status bar, a prompt sound is emitted, the terminal vibrates, and the indicator light flashes.
  • Android Runtime includes core library and virtual machine. Android runtime is responsible for the scheduling and management of the Android system.
  • the core library contains two parts: one part is the function function that Java language needs to call, and the other part is the core library of Android.
  • the application layer and the application framework layer run in the virtual machine.
  • the virtual machine executes the java files of the application layer and the application framework layer into binary files.
  • the virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
  • the system library may include multiple functional modules. For example: surface manager (surface manager), media library (Media library), 3D graphics processing library OpenGL ES, 2D graphics engine SGL, etc.
  • the surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
  • the media library supports a variety of commonly used audio, video format playback and recording, and still image files.
  • the media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • OpenGL ES is used to achieve 3D graphics drawing, image rendering, synthesis, and layer processing.
  • SGL is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
  • the intensity of the infrared reflected light can be reported to the sensor manager through the sensor driver of the kernel layer.
  • the gyro sensor and acceleration sensor at the hardware layer can also report the detected rotation angle, acceleration value, and gravity direction to the state manager.
  • the state manager can determine the specific movement of the mobile phone based on these measurements attitude.
  • the sensor manager can select the corresponding proximity light threshold as the criterion for judging whether an obstruction is approaching according to the movement posture of the mobile phone determined by the state manager.
  • the sensor manager can use the value
  • the smaller first approaching light threshold is used as the approaching light threshold for judging whether an obstruction is approaching the mobile phone this time.
  • the sensor manager may compare the first approaching light threshold with the intensity of the infrared reflected light. If the intensity of the infrared reflected light is greater than the first approaching light threshold, it means that an obstruction is approaching the mobile phone.
  • the sensor manager can report that the window manager has an obstruction approaching, trigger the window manager to start the anti-mistouch algorithm, and generate and load the anti-mistouch window on the currently displayed window to avoid the accidental touch of the mobile phone.
  • the sensor manager can make the condition that an obstruction is close to the mobile phone more relaxed through the first approaching light threshold with a smaller value, thereby promptly notifying the window
  • the manager generates an anti-mistouch window to reduce the chance of mis-touch on the phone.
  • a mobile phone will be taken as an example of an electronic device, and a method for controlling a proximity light sensor provided by embodiments of the present application will be explained in detail with reference to the drawings.
  • the mobile phone when the mobile phone is in a black screen (or called breathing screen) state, it generally indicates that the user does not need to use the mobile phone. Therefore, the mobile phone can turn off the proximity light sensor, or the mobile phone can operate at a lower frequency That is, low power consumption mode) turn on the proximity light sensor to work to save the power consumption of the mobile phone.
  • the mobile phone when the mobile phone is in a black screen or resting screen state, the mobile phone may also turn off other sensors such as a gyro sensor or an acceleration sensor, which is not limited in the embodiments of the present application.
  • the phone will switch from the black screen state to the bright screen state.
  • the mobile phone can turn on the proximity light sensor for normal operation. If the proximity light sensor is in a low-power mode with a lower operating frequency, the mobile phone can increase the operating frequency of the proximity light sensor, so that the proximity light sensor starts to work normally. Similarly, if the mobile phone switches from the black screen state to the bright screen state, the mobile phone can also control other sensors for determining the mobile posture of the mobile phone, such as a gyro sensor and an acceleration sensor, to start working normally.
  • the acceleration sensor can periodically detect the magnitude and direction of gravity.
  • any one of the four vertices of the mobile phone for example, the vertex in the lower left corner
  • the acceleration sensor can detect the magnitude and direction of the gravity G in the above coordinate system.
  • the direction of the gravity G coincides with the direction of the y-axis, it means that the gravity G is now pointing to the top of the mobile phone.
  • the mobile phone can determine whether the mobile posture of the mobile phone is top-down according to the component of gravity G on the y-axis. Therefore, the acceleration sensor can report the component of gravity G on the y-axis to the state manager of the frame layer. Furthermore, the state manager can determine whether the mobile posture of the mobile phone is the top-down state according to the component of gravity G on the y-axis. If the component of gravity G on the y-axis is the same as the direction of the y-axis, and the component of gravity G on the y-axis is greater than the set component, the status manager can output a status signal 0 to the sensor to indicate the location
  • the motion posture is the top-down target motion posture. When the phone is in a top-down motion posture, the phone is likely to be in a pocket scene.
  • the user generally puts the mobile phone in the pocket by first holding the mobile phone roughly horizontally to lock the screen of the mobile phone, and then putting the mobile phone with the top of the phone facing down into the pocket. Therefore, the above target motion posture can be set to refer to the posture change process of the mobile phone from top to top to top to bottom.
  • the mobile phone may use an acceleration sensor to detect and record the change process of gravity G in the above coordinate system. Still referring to the right-hand Cartesian coordinate system in the foregoing embodiment, the description is as follows (not shown in FIG. 7). As shown in (a) in FIG. 7, after the phone is locked, the user is generally still on the screen and viewing the phone normally.
  • the gravity G coincides with the z axis of the coordinate system.
  • the direction of gravity G gradually coincides with the direction of the y-axis in the coordinate system, that is, the mobile posture of the mobile phone is from the top to the top Gradually change to top down. Then, if the change process of the gravity G detected by the acceleration sensor is consistent with the change process shown in FIG. 7, the state manager may also determine that the mobile phone is in the target motion posture.
  • the gyro sensor When the gyro sensor is working, still taking the coordinate system shown in (a)-(b) in FIG. 6 as an example, the gyro sensor can periodically detect the rotation angle of the mobile phone around the y-axis Furthermore, the acceleration sensor can detect the rotation angle of the mobile phone around the y-axis Report to the state manager of the framework layer. When the phone rotates around the y-axis When the angle is greater than the set angle (for example, 80 °), the state manager outputs a state signal 1 to the sensor, which is used to indicate that the movement posture of the mobile phone is the flipping state.
  • the set angle for example 80 °
  • the embodiment of the present application does not limit the sequence of detecting whether the mobile phone is in the flip state and whether it is in the call state.
  • the user from receiving a call to using the handset on the top of the mobile phone to make a call, the user generally holds the mobile phone to check the incoming call information or dials, and then flips the mobile phone to the ear to make a call. Therefore, as shown in (a) of FIG. 8, when the mobile phone receives a new call or detects that the user clicks the dial button, the mobile phone can use the gyro sensor to record the angle of the mobile phone along the y-axis at this time, that is, the mobile phone starts to surround y The initial angle of shaft rotation Furthermore, as shown in (b)-(c) of FIG.
  • the phone can continuously record the phone from the initial angle around the y-axis using the gyro sensor Rotation angle When the rotation angle When it is greater than the angle threshold, it can be determined that the mobile phone is in the target motion posture at this time.
  • the mobile phone can also continuously record the actual angle of the mobile phone rotating around the y-axis Until the end angle when the phone stops rotating around the y axis is detected When the end angle With initial angle When the difference is greater than the angle threshold, the mobile phone can also determine that it is in the target motion posture at this time.
  • the mobile phone can also use an acceleration sensor to identify whether the mobile phone is in the motion of raising the hand. For example, when the user lifts the mobile phone, the mobile phone will generate corresponding accelerations on the x-axis, y-axis, and z-axis. This acceleration is generally within a threshold interval. After the user lifts the mobile phone, the mobile phone is generally at a standstill (or tends to stand still), and the acceleration detected at this time approaches zero.
  • the mobile phone can also determine this The time is in the target motion posture, that is, the target motion posture includes the flip state and the hand motion posture.
  • the status manager may store the status signal determined for the mobile phone and update it regularly.
  • the mobile phone may set one or more flag bits in the status manager, and the flag bit is used to store the status signal.
  • the status signal is 00, it means that the mobile phone is in a top-down motion posture, and when the status signal is 01, it means that the mobile phone is in a flip posture.
  • the state manager can save the most recently determined state signal in this flag.
  • the proximity light sensor can emit light at a certain frequency (in the following embodiments, the proximity light sensor emits infrared light as an example), if there is an obstruction near the mobile phone, the proximity light sensor will receive infrared light The reflected infrared reflected light. Then, the proximity light sensor can report the actual intensity value of the infrared reflected light received each time to the SensorManager (sensor manager) of the frame layer.
  • a storage unit can be set in the SensorManager to store the actual intensity value of the infrared reflected light reported by the nearest proximity light sensor.
  • multiple proximity light thresholds can also be pre-stored in the SensorManager. These proximity light thresholds can be used to determine whether an obstruction is approaching when the mobile phone is in different motion poses. The approaching light threshold and the third approaching light threshold, wherein the first approaching light threshold ⁇ the second approaching light threshold ⁇ the third approaching light threshold.
  • the SensorManager obtains the actual light intensity value reported by the last proximity light sensor, it can further obtain a status signal for indicating the mobile posture of the mobile phone from the status manager. If the mobile posture of the mobile phone is the set target motion posture, it means that the mobile phone is likely to be in a scene with a high risk of accidental touch (such as the above-mentioned pocket scene or on-ear talk scene).
  • the approaching light threshold (for example, the first approaching light threshold or the second approaching light threshold described above) determines whether an obstruction is approaching.
  • the value of the first approaching light threshold or the second approaching light threshold is relatively small, it is judged that there is a possibility that an obstruction is close to the mobile phone, and accordingly, the subsequent mobile phone is more likely to open the anti-mistouch algorithm Therefore, the probability of the mobile phone being mis-touched in these scenarios with high risk of mis-touch is reduced.
  • the SensorManager may use a larger approaching light threshold (for example, the above-mentioned third approaching light threshold) to determine whether an obstruction is approaching.
  • a larger approaching light threshold for example, the above-mentioned third approaching light threshold
  • the mobile phone in addition to dynamically adjusting the above-mentioned proximity light threshold according to the current movement posture, can also determine how to adjust the above-mentioned proximity light threshold in combination with other information of the mobile phone during operation.
  • the mobile phone can set an adjustment condition that triggers the adjustment to approach the light threshold
  • the adjustment condition includes at least the condition that the mobile phone is in the above-mentioned target motion posture
  • the adjustment condition can also include the status information of the mobile phone screen (eg, unlocking event, lock Screen events), call status information (such as dialing events, incoming call events), etc. meet the set conditions.
  • the mobile phone can dynamically adjust the above approach light threshold.
  • the mobile phone can also obtain screen status information of the mobile phone. For example, if it is detected that the screen of the mobile phone has been unlocked, it means that the user may be using the mobile phone normally. Therefore, in order to prevent the normal operation of the user from being blocked after the accidental touch prevention algorithm is turned on, the mobile phone may set the above-mentioned proximity light threshold to a larger value The third is close to the light threshold. Correspondingly, if it is detected that the screen of the mobile phone is not unlocked and the mobile phone is in the top-down target motion posture, the mobile phone is at a higher risk of accidental touch.
  • the mobile phone can set the above approach light threshold to the first approach with a smaller value The light threshold or the second closest to the light threshold. Or, if a lock screen event (or screen off event) for the mobile phone screen is detected, the gravity component on the y-axis is gradually increased until the gravity component on the y-axis is greater than the set value, The user is likely to put the mobile phone into the pocket after locking the screen. Therefore, the mobile phone may set the above approach light threshold to the first approach light threshold or the second approach light threshold with a smaller value.
  • the mobile phone may also obtain current call status information. For example, if it is detected that the mobile phone is not running a call application, it means that the mobile phone is not currently in a call state, and the mobile phone may set the above approach light threshold to a third approach light threshold with a larger value. If the phone detects an incoming call event or a dial-in event entered by the user, and the phone's rotation angle around the y-axis If it is greater than the angle threshold, it means that the mobile phone is in a call state, and the user is likely to talk in an ear-attached posture. Then, the mobile phone can set the above proximity light threshold to the first proximity light threshold or the second proximity light with a smaller value Threshold.
  • the mobile phone may also obtain current ambient light information. For example, a mobile phone can use an ambient light sensor to detect the current ambient light intensity. If the current ambient light intensity is less than the light intensity threshold, and the phone is in the top-down target motion posture, it means that the phone is likely to be in a pocket scene. Therefore, the mobile phone may set the above approaching light threshold to the first approaching light threshold or the second approaching light threshold with a smaller value.
  • the mobile phone generally moves with the user in the pocket scene. Then, the mobile phone can use a positioning device, a gyro sensor or an acceleration sensor to detect whether the mobile phone is in a moving state such as walking or riding. Therefore, the target motion posture set by the mobile phone may also include a moving state. If it is detected that the mobile phone is in a moving state and is in a top-down target motion posture, the mobile phone may set the proximity light threshold to the first proximity light threshold or the second proximity light threshold with a smaller value.
  • the mobile phone can determine the movement posture of the mobile phone according to the measured values of the acceleration sensor and the gyro sensor. Furthermore, the mobile phone can determine whether the mobile phone satisfies the set adjustment conditions by combining the mobile phone's motion posture, ambient light intensity, mobile phone call status, and mobile phone screen status. If the adjustment condition is satisfied, the mobile phone can dynamically adjust the proximity light threshold of the proximity light sensor. For example, when the risk of false touch is relatively large, the mobile phone can use the near-light threshold with a small value to determine whether there is an obstruction approaching the mobile phone.
  • the proximity light threshold determines whether an obstruction is close to the phone. If it is determined that an obstruction is close to the mobile phone, the mobile phone may start an anti-mistouch algorithm to activate the anti-mistouch function of the mobile phone screen. Of course, if the mobile phone has started the anti-mistouch algorithm when it is determined that an obstruction is approaching the mobile phone, the mobile phone can continue to maintain the activated state of the anti-mistouch function at this time. If it is determined that no obstruction is close to the mobile phone, the mobile phone does not need to activate the anti-mistouch algorithm, and the anti-mistouch function of the mobile phone screen is in a deactivated state.
  • the determined proximity light threshold may be used to compare with the actual intensity value of the infrared reflected light reported by the proximity light sensor. If the actual light intensity value is greater than the approaching light threshold, indicating that an obstruction is approaching the mobile phone, the SensorManager may send a proximity signal to the WindowManager (window manager) of the frame layer. For example, when the proximity signal is 1, it indicates that there is an obstruction approaching the mobile phone; when the proximity signal is 0, it indicates that there is no obstruction approaching the mobile phone. In this way, after receiving the proximity signal with a value of 1, WindowManager can start the anti-missing algorithm to generate an anti-missing window on the window that the mobile phone is displaying. The anti-missing window can block any operation received on the mobile phone screen. Thus, the effect of preventing accidental touch is achieved.
  • the actual light intensity value of the infrared reflected light reported by the proximity light sensor can be updated regularly, and the status signal stored in the status manager for indicating the mobile phone's movement posture can also be updated regularly. Then, whenever SensorManager receives a change in the actual light intensity value reported by the proximity light sensor, SensorManager can use the new actual light intensity value to compare with the proximity light threshold. When the new actual light intensity value is less than the approach light threshold, SensorManager can modify the approach signal from 1 to 0 and send it to WindowManager. At this time, WindowManager can remove the above-mentioned anti-mistouch window, that is, deactivate the anti-mistouch function of the mobile phone screen, thereby restoring the interactivity between the mobile phone screen and the user.
  • SensorManager may modify the approaching light threshold with a smaller value to the approaching light threshold with a higher value. Furthermore, SensorManager can re-compare the magnitude relationship between the near-light threshold and the actual light intensity value stored at this time. If the actual light intensity value is less than the third approaching light threshold, the SensorManager may send a windowing signal 0 to the WindowManager that no obstruction is approaching the mobile phone. In this way, in response to the proximity signal 0, WindowManager may remove the above-mentioned anti-mistouch window, that is, deactivate the anti-mistouch function of the mobile phone screen, thereby restoring the interactivity between the mobile phone screen and the user. Of course, if the last proximity signal received by WindowManager is also 0, it means that the mobile phone has loaded the anti-mistouch window, then WindowManager can continue to keep the anti-touch function of the mobile phone screen in the deactivated state.
  • proximity light thresholds may be preset in the SensorManager, namely, proximity light threshold 1, proximity light threshold 2, and proximity light threshold 3.
  • the proximity light threshold 1 is 400
  • the proximity light threshold 2 is 260
  • the proximity light threshold 3 is 120.
  • the light threshold is set to a larger value close to the light threshold 1 (ie, 400). In this way, when the obstruction is close enough to the proximity light sensor, the actual light intensity value of the infrared reflected light reported by the proximity light sensor to the SensorManager will be greater than the proximity light threshold 1, which will trigger WindowManager to start the anti-mistouch algorithm
  • the window is covered with an anti-mistouch window.
  • the mobile phone when the mobile phone receives a new call event, the risk of accidental touch in the incoming call scenario is greater than the risk of accidental touch in the bright screen unlocked state, so SensorManager can approach the light threshold It is modified from the above approach light threshold 1 to the approach light threshold 2 with a smaller value (ie, 260).
  • the mobile phone can also use the gyro sensor to detect the rotation angle of the mobile phone along the y-axis. If it is detected that the rotation angle of the mobile phone along the y-axis is greater than the angle threshold, it means that the user is likely to flip the mobile phone to the ear to make a call, and at this time, the human ear is more likely to accidentally touch the mobile phone screen.
  • SensorManager can modify the approaching light threshold from the approaching light threshold 2 to the approaching light threshold 3 with a smaller value (ie, 120).
  • a smaller value ie, 120.
  • the SensorManager will send a proximity signal to the WindowManager, so that the WindowManager starts to prevent The false touch algorithm overlays a window for preventing false touch on the window being displayed by the mobile phone.
  • the size relationship between the actual light intensity value received by the proximity light sensor and the proximity light threshold is used as an example to determine whether an obstruction is approaching the mobile phone.
  • the greater the actual intensity value of the infrared reflected light the closer the distance between the blocking object and the mobile phone; the smaller the actual intensity value of the infrared reflected light, the greater the distance between the blocking object and the mobile phone.
  • the mobile phone may also calculate the energy ratio between the infrared light intensity emitted by the proximity light sensor and the actual intensity value of the infrared reflected light after reflection. Since the infrared light emitted by the proximity light sensor will lose part of its energy after being reflected, the above energy ratio is generally a positive number less than 1. In this implementation, when the calculated energy ratio is larger, it means that the actual intensity value of the infrared reflected light is smaller, that is, the distance between the blocking object and the mobile phone is farther. Therefore, after the mobile phone uses the proximity light sensor to obtain the current energy ratio (for example, 0.4), the energy ratio can be compared with the preset energy ratio (for example, 0.5). If the energy ratio is less than the preset energy ratio, it means that an obstruction is approaching the mobile phone. Furthermore, the mobile phone can enable an anti-mistouch algorithm to prevent the blocking object from accidentally touching the screen of the mobile phone.
  • the preset energy ratio for example, 0.5
  • the mobile phone may also calculate the energy loss rate of the infrared light emitted by the proximity light sensor after being reflected.
  • the energy loss rate when the energy loss rate is larger, it means that the actual intensity value of the infrared reflected light is smaller, that is, the distance between the blocking object and the mobile phone is farther. Therefore, after the mobile phone uses the proximity light sensor to obtain the current energy loss rate, the energy loss rate can be compared with the preset loss rate. If the energy loss rate is less than the preset loss rate, it means that an obstruction is approaching the mobile phone.
  • the mobile phone can enable an anti-mistouch algorithm to prevent the blocking object from accidentally touching the screen of the mobile phone.
  • the mobile phone uses the above-mentioned preset energy ratio (or preset loss rate) to determine whether there is an obstruction approaching the mobile phone, the higher the preset energy ratio (or preset loss rate) When it is large, the mobile phone judges that there is a possibility that an obstruction is close to the mobile phone, and the possibility that the subsequent mobile phone starts the anti-mistouch algorithm is greater.
  • the mobile phone can use a higher preset energy ratio (or a preset loss rate) to determine whether an obstruction is approaching the mobile phone, thereby increasing
  • the probability of turning on the anti-mistouch algorithm reduces the chance of the mobile phone being mis-touched in these scenes that are prone to mis-touch.
  • the mobile phone can adjust the threshold used to determine whether an obstruction is close to the mobile phone in a scene that is prone to accidental touch, such as a pocket scene or an on-ear conversation scene.
  • the threshold can be the above Approaching the light threshold, the preset ratio, or the preset loss rate makes the judgment condition that the mobile phone judges that an obstruction is approaching be more relaxed, thereby increasing the chance of the mobile phone turning on the anti-mistouch algorithm, and reducing the chance of the mobile phone being touched by mistake.
  • the embodiments of the present application do not limit the specific implementation manner of the above-mentioned anti-mistouch algorithm.
  • the above-mentioned anti-mis-touch algorithm can be used to generate and load the above-mentioned anti-mis-touch window to achieve the anti-mis-touch effect.
  • the aforementioned anti-mistouch algorithm can also be used to turn off the touch function of the mobile phone screen to achieve the anti-mistouch effect.
  • the above-mentioned anti-mistouch algorithm can also be used to set the screen of the mobile phone to the lock screen state or the black screen state, so that the mobile phone screen cannot respond to any operation received, thereby achieving an anti-mistouch effect.
  • an embodiment of the present application discloses an electronic device, including: a touch screen 1201 including a touch-sensitive surface 1206 and a display screen 1207; one or more processors 1202; a memory 1203; a proximity light sensor 1208; acceleration sensor 1209; gyro sensor 1210; one or more application programs (not shown); and one or more computer programs 1204.
  • the above-mentioned devices may be connected through one or more communication buses 1205.
  • the one or more computer programs 1204 are stored in the above-mentioned memory 1203 and are configured to be executed by the one or more processors 1202.
  • the one or more computer programs 1204 include instructions, which can be used to execute the above The steps in the examples should be followed.
  • the functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
  • the above integrated unit may be implemented in the form of hardware or software functional unit.
  • the integrated unit may be stored in a computer-readable storage medium.
  • the technical solutions of the embodiments of the present application may essentially be part of or contribute to the existing technology, or all or part of the technical solutions may be embodied in the form of software products, and the computer software products are stored in a storage
  • the medium includes several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) or processor to perform all or part of the steps of the methods described in the embodiments of the present application.
  • the foregoing storage media include: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Environmental & Geological Engineering (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephone Function (AREA)

Abstract

本申请公开了一种接近光传感器的控制方法及电子设备,涉及终端领域,可在不同使用情况下适应性调整接近光传感器的接近光阈值,从而提高激活和去激活防误触功能时的灵活性。该方法包括:检测到满足调整条件,所述调整条件包括:电子设备的运动姿态为设定的目标运动姿态;将接近光传感器的第一接近光阈值改为第二接近光阈值,所述第一接近光阈值与所述第二接近光阈值不同;获取接近光传感器上报的光强参数,所述光强参数用于表示接近光传感器发射光的反射光强;根据所述光强参数和所述第二接近光阈值,激活或去激活电子设备的屏幕的防误触功能。

Description

一种接近光传感器的控制方法及电子设备
本申请要求于2018年11月07日提交中国国家知识产权局、申请号为201811318527.3、发明名称为“一种接近光传感器的控制方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及终端领域,尤其涉及一种接近光传感器的控制方法及电子设备。
背景技术
目前,手机、平板电脑等各类终端中普遍使用了接近光传感器来确定是否有物体接近终端。以红外式的接近光传感器举例,如图1所示,该接近光传感器中包括红外发射端101和红外接收端102。其中,红外发射端101发射出红外线后,如果有遮挡物(例如人耳)将发射的红外线反射回来,则反射的红外线后可被红外接收端102接收。当红外接收端102接收到的红外线的强度超过设定的接近光阈值时,手机判断此时有遮挡物接近手机。进而,手机可启动防误触算法避免接近手机的遮挡物误触手机屏幕103。
一般,用于判断是否有遮挡物接近手机的接近光阈值是固定的。例如,可设置接近光阈值为650个计量单位,(该计量单位用于表征接收到的红外线的强度的计量单位,可以为光强度的计量单位或者是经光电转换得到的电信号的计量单位,可由手机厂商自行设定),即当红外接收端102接收到的红外线的强度超过650个单位时可确定有遮挡物接近手机。
但是,手机的实际使用情况多种多样,固定的接近光阈值不能满足各种情况下的需要。例如,在一些情况下该接近光阈值很难达到,导致误触算法不能被启动,使得误触容易发生;而在另一些情况下接近光阈值很容易达到,误触算法经常被启动,导致用户的正常操作也不能被立即执行。因此,如何设置接近光阈值满足不同使用情况下的用户需求成为亟需解决的问题。
发明内容
本申请提供一种接近光传感器的控制方法及电子设备,可在不同使用情况下适应性调整接近光传感器的接近光阈值,从而提高激活和去激活防误触功能时的灵活性。
为达到上述目的,本申请采用如下技术方案:
第一方面,本申请提供一种接近光传感器的控制方法,可由具有接近光传感器的电子设备执行,该方法包括:检测到满足调整条件,该调整条件包括:电子设备的运动姿态为设定的目标运动姿态;将接近光传感器的第一接近光阈值改为第二接近光阈值(第一接近光阈值与第二接近光阈值不同);获取接近光传感器上报的光强参数,该光强参数用于表示该接近光传感器发射光的反射光强;根据该光强参数和第二接近光阈值,激活或去激活电子设备的屏幕的防误触功能。
也就是说,在本申请实施例提供的接近光传感器的控制方法中,电子设备可以结合手机当前的运动姿态确定出相应的接近光阈值。由于电子设备的运动姿态可反映出电子设备当前所处的具体场景,这样,当电子设备处于不同的运动姿态时一般处于不同的使用场景中,电子设备可使用不同的接近光阈值判断是否激活触摸屏的防误触功能,从而提高激活和去激活防误触功能时的灵活性。
在一种可能的设计方法中,上述目标运动姿态具体包括:电子设备的重力在设定方向上 的分量大于设定值,该设定方向为从电子设备底部指向电子设备顶部的方向。一般,当重力在该设定方向上的分量大于设定值时,电子设备大多处于顶部朝下的状态,此时,电子设备一般处于口袋场景中。也就是说,当检测出电子设备处于顶部朝下的状态时,电子设备可动态调整接近光传感器的接近光阈值。当然,本领域技术人员还可以根据实际应用场景或实际经验设置检测电子设备顶部朝下的具体方法,本申请实施例对此不做任何限制。
在一种可能的设计方法中,上述目标运动姿态包括:电子设备的重力在该设定方向上的分量逐渐增大至大于设定值,该设定方向为从电子设备底部指向电子设备顶部的方向。一般,当重力在上述设定方向上的分量逐渐增大至设定值时,说明电子设备的运动姿态逐渐转换为顶部朝下的状态,通常是用户将电子设备放入口袋的过程中会发生这一运动姿态的转换。因此,当检测出重力在上述设定方向上的分量逐渐增大至设定值时,电子设备可动态调整接近光传感器的接近光阈值。
在一种可能的设计方法中,上述调整条件还包括:检测到锁屏事件或灭屏事件。
一般,检测到锁屏事件或灭屏事件,如果电子设备处于头部朝下或转换为头部朝下的状态,说明电子设备很可能处于口袋场景中。此时,靠近电子设备的遮挡物更容易接触到电子设备的屏幕产生误触操作。因此,电子设备可将接近光阈值设置为取值较小。这样,如果接近光传感器检测到反射光的强度大于该接近光阈值,电子设备便可开启防误触算法屏蔽触摸屏检测到的触摸操作,从而降低电子设备发生的误触现象的几率。
在一种可能的设计方法中,上述目标运动姿态包括:电子设备围绕设定方向旋转的旋转角度大于角度阈值,该设定方向为从电子设备底部指向电子设备顶部的方向。一般,当电子设备围绕上述设定方向旋转的角度大于角度阈值时,说明电子设备处于翻转状态。由于用户使用听筒接听电话时通常会翻转手机至耳边,使电子设备围绕上述设定方向产生一定角度的旋转,因此,当电子设备围绕上述设定方向旋转的角度大于角度阈值时,电子设备很可能处于贴耳通话的场景中。
进一步地,用户使用听筒接听电话时通常需要将手机抬起至耳边,此时,电子设备处于抬手运动姿态。那么,上述目标运动姿态还包括:电子设备在至少一个方向上产生的加速度逐渐增大至大于第一设定值后,逐渐减小至小于第二设定值(第一设定值大于第二设定值)。如果检测到电子设备的运动姿态为上述目标运动姿态,说明电子设备既处于翻转状态,同时还处于抬手运动姿态,此时用户使用电子设备进行贴耳通话的可能性更大。因此,当检测出电子设备围绕上述设定方向旋转的角度大于角度阈值,且电子设备在至少一个方向上产生的加速度逐渐增大至大于第一设定值后,逐渐减小至小于第二设定值后,电子设备可动态调整接近光传感器的接近光阈值。当然,本领域技术人员可以根据实际应用场景或实际经验设置检测电子设备处于翻转状态和抬手运动姿态的具体方法,本申请实施例对此不做任何限制。
在一种可能的设计方法中,上述调整条件还包括:检测到来电事件或拨号事件。
一般,检测到来电事件或拨号事件后,如果电子设备的运动状态为上述目标运动状态,说明用户很可能在使用电子设备进行贴耳通话。此时,靠近电子设备的遮挡物(例如人耳)更容易接触到电子设备的屏幕产生误触操作。因此,电子设备可将接近光阈值设置为取值较小。这样,如果接近光传感器检测到反射光的强度大于该接近光阈值,电子设备便可开启防误触算法屏蔽触摸屏检测到的触摸操作,从而降低电子设备发生的误触现象的几率。
相应的,在发生误触操作的可能相对较低的应用场景下,电子设备可使用取值较大的接近光阈值判断是否有遮挡物。此时,电子设备判断是否有遮挡物接近的要求较为严格,相应 使得电子设备开启防误触算法的条件较为严格,从而尽可能的降低因频繁启动防误触算法导致用户正常操作被屏蔽的几率。
在一种可能的设计方法中,上述光强参数可以是指接近光传感器接收到的反射光强,或该反射光强与该接近光传感器的发射光强的比值;第一接近光阈值大于第二接近光阈值;其中,根据光强参数和第二接近光阈值,激活或去激活电子设备的屏幕的防误触功能,包括:若该光强参数大于第二接近光阈值,说明有遮挡物接近电子设备,则可激活电子设备的屏幕的防误触功能,或保持电子设备的屏幕的防误触功能为激活状态。
或者,若上述光强参数小于第二接近光阈值,说明没有遮挡物接近电子设备,则电子设备可以去激活触摸屏的防误触功能,或保持电子设备的触摸屏的防误触功能为去激活状态。
在一种可能的设计方法中,上述光强参数可以是指接近光传感器的发射光强与接近光传感器接收到的反射光强的比值,或该接近光传感器的发射光强的光损失率;第一接近光阈值小于第二接近光阈值;其中,根据光强参数和第二接近光阈值,激活或去激活电子设备的屏幕的防误触功能,包括:若该光强参数小于第二接近光阈值,说明有遮挡物接近电子设备,则可激活电子设备的屏幕的防误触功能,或保持电子设备的屏幕的防误触功能为激活状态。
或者,若上述光强参数大于第二接近光阈值,说明没有遮挡物接近电子设备,则电子设备可以去激活触摸屏的防误触功能,或保持电子设备的触摸屏的防误触功能为去激活状态。
第二方面,本申请提供一种电子设备,包括:接近光传感器、加速度传感器、陀螺仪传感器触摸屏、一个或多个处理器、一个或多个存储器、以及一个或多个计算机程序;其中,处理器与接近光传感器、加速度传感器、陀螺仪传感器触摸屏以及存储器均耦合,上述一个或多个计算机程序被存储在存储器中,当电子设备运行时,该处理器执行该存储器存储的一个或多个计算机程序,以使电子设备执行上述任一项所述的接近光传感器的控制方法。
第三方面,本申请提供一种计算机存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行如第一方面中任一项所述的接近光传感器的控制方法。
第四方面,本申请提供一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行如第一方面中任一项所述的接近光传感器的控制方法。
可以理解地,上述提供的第二方面所述的终端、第三方面所述的计算机存储介质,以及第四方面所述的计算机程序产品均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
附图说明
图1为现有技术中接近光传感器的工作原理示意图;
图2为本申请实施例提供的一种电子设备的结构示意图一;
图3为本申请实施例提供的一种接近光传感器的控制方法的原理示意图一;
图4为本申请实施例提供的一种接近光传感器的控制方法的原理示意图二;
图5为本申请实施例提供的一种电子设备中操作系统的架构示意图;
图6为本申请实施例提供的一种接近光传感器的控制方法的原理示意图三;
图7为本申请实施例提供的一种接近光传感器的控制方法的原理示意图四;
图8为本申请实施例提供的一种接近光传感器的控制方法的原理示意图五;
图9为本申请实施例提供的一种接近光传感器的控制方法的原理示意图六;
图10为本申请实施例提供的一种接近光传感器的控制方法的原理示意图七;
图11为本申请实施例提供的一种接近光传感器的控制方法的原理示意图八;
图12为本申请实施例提供的一种电子设备的结构示意图二。
具体实施方式
下面将结合附图对本实施例的实施方式进行详细描述。
本申请实施例提供的一种接近光传感器的控制方法可应用于手机、平板电脑、桌面型、膝上型、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、手持计算机、上网本、个人数字助理(personal digital assistant,PDA)、可穿戴电子设备、虚拟现实设备等电子设备。
以手机100为电子设备举例,图2示出了手机100的结构示意图。
手机100可以包括处理器110,外部存储器接口120,内部存储器121,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,摄像头193以及显示屏194等。
可以理解的是,本发明实施例示意的结构并不构成对手机100的具体限定。在本申请另一些实施例中,手机100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是手机100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现手机100的触摸功能。
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现 通过蓝牙耳机接听电话的功能。
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现手机100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现手机100的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为手机100充电,也可以用于手机100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对手机100的结构限定。在本申请另一些实施例中,手机100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过手机100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
手机100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。手机100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为 无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在手机100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在手机100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,手机100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得手机100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
手机100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode 的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,手机100可以包括1个或N个显示屏194,N为大于1的正整数。
手机100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,手机100可以包括1个或N个摄像头193,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当手机100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。手机100可以支持一种或多种视频编解码器。这样,手机100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现手机100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展手机100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行手机100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储手机100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
手机100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。手机100可以通过扬 声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当手机100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。手机100可以设置至少一个麦克风170C。在另一些实施例中,手机100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,手机100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
在本申请实施例中,上述传感器模块180还可以包括陀螺仪传感器180B和/或加速度传感器180E。
其中,通过陀螺仪传感器180B可以确定手机100围绕三个轴(即x,y和z轴)的旋转角度。一般,如图3所示放置手机时,手机的顶部在上,底部在下。如图3所示的一个右手笛卡尔坐标系包括x轴,y轴和z轴。其中,手机100的屏幕较短边所在的轴作为x轴,手机100的屏幕较长边所在的轴为y轴,y轴从手机的底部指向屏幕的顶部,垂直于x轴和y轴所在平面的轴为z轴,z轴从x轴和y轴定义的平面向外指向。示例性的,从用户查看来电信息到用户使用听筒接听电话的过程中,手机100一般会围绕y轴产生90°左右的旋转。那么,当陀螺仪传感器180B检测到手机100围绕y轴的旋转角度大于某一阈值(例如80°)时,手机的运动姿态一般为翻转状态。如果手机100此时处于通话状态,则说明用户很可能在使用手机100进行贴耳通话,即用户处于贴耳通话场景中。
加速度传感器180E可检测手机100在各个方向(一般为x,y和z轴)上加速度的大小。当手机100静止时加速度传感器180E可检测出重力的大小及方向。示例性的,如图4所示,如果加速度传感器180E检测出重力的方向指向手机100的顶部(即,重力的方向沿着y轴指向伸的方向),或者,检测出重力沿手机100顶部方向的分量大于设定值(即,重力的方向沿着y轴分量大于设定值),手机的运动姿态一般为顶部朝下的状态,说明此时手机100很有可能被用户放在口袋或包中。当然,手机100还可以根据其他信息确定手机100是否被用户放在口袋或包中。例如,如果加速度传感器180E检测出重力的方向指向手机100的顶部,且环境光传感器180L检测到环境光的强度小于阈值,则说明此时手机100很有可能被用户放在口袋或包中。
为方便描述,后续实施例中可将陀螺仪传感器180B检测到的旋转角度等信息称为陀螺仪传感器180B的测量值,将加速度传感器180E检测到的重力的大小和方向等信息称为加速度传感器180E的测量值。陀螺仪传感器180B和加速度传感器180E的测量值可反映出手机100的运动姿态以及用户在使用手机100时所处的应用场景。
在本申请实施例中,传感器模块180还包括接近光传感器180G。接近光传感器180G可以包括发光二极管(LED)和光检测器。发光二极管可作为接近光传感器180G的发射端,例如,发光二极管可以是红外发光二极管。手机100通过发光二极管向外发射红外光。光检测器(例如光电二极管)可作为接近光传感器180G的接收端。手机100使用光检测器可检测来自附 近遮挡物的红外反射光,将接收到的红外反射光转换为电信号并进行量化,得到红外反射光的强度。红外反射光的强度的计量单位可以根据需要选择,本发明实施例对此不做限定,后续描述红外反射光的强度和接近光阈值时,省略了计量单位。当检测到红外反射光的强度大于设定的接近光阈值时,可以确定手机100附近有遮挡物。当检测到红外反射光的强度小于接近光阈值时,手机100可以确定手机100附近没有遮挡物。
在本申请实施例中,上述接近光阈值可以有至少两个。在锁屏状态或通话状态下,手机100可以根据上述陀螺仪传感器180B或加速度传感器180E的测量值,选择使用哪一个接近光阈值判断手机100附近是否有遮挡物。进而,当手机100附近有遮挡物时,手机100可开启防误触算法防止遮挡物误触手机100的屏幕。
例如,手机100可设定第一接近光阈值和第二接近光阈值(第一接近光阈值<第二接近光阈值)。当陀螺仪传感器180B的测量值反映出手机的运动姿态为翻转状态时,说明用户很可能处于贴耳通话的场景中。此时,靠近手机的遮挡物(例如人耳)更容易接触到手机100的屏幕产生误触操作。如果将接近光阈值设置为取值较大的第二接近光阈值,则接近光传感器180G检测到红外反射光光强很难达到该接近光阈值,导致误触算法不能被启动从而发生误触。因此,手机100可将接近光阈值设置为取值较小的第一接近光阈值。这样一来,如果接近光传感器180G检测到红外反射光的强度大于第一接近光阈值,手机100便可开启防误触算法屏蔽手机100屏幕检测到的触摸操作,即对屏幕检测到的触摸操作不响应,从而降低手机100发生的误触现象的几率。
类似的,当加速度传感器180E的测量值反映出手机的运动姿态为顶部朝下的状态时,说明手机很可能处于口袋场景中。此时,靠近手机的遮挡物更容易接触到手机100的屏幕产生误触操作。如果将接近光阈值设置为取值较大的第二接近光阈值,则接近光传感器180G检测到红外反射光光强很难达到该接近光阈值,导致误触算法不能被启动从而发生误触。因此,手机100可将接近光阈值设置为取值较小的第一接近光阈值。这样一来,如果接近光传感器180G检测到红外反射光的强度大于第一接近光阈值,手机100便可开启防误触算法屏蔽手机100屏幕检测到的触摸操作,即对屏幕检测到的触摸操作不响应,从而降低手机100发生的误触现象的几率。
本申请实施例中可将手机处于翻转状态或顶部朝下状态等运动姿态称为目标运动姿态。在目标运动姿态下,手机屏幕发生误触操作的风险较大。
那么,如果检测到手机100的运动姿态未处于上述目标运动姿态,或者,检测到手机100从上述目标运动姿态中退出,则相对于处于目标运动姿态的手机100而言,手机屏幕发生误触操作的可能降低。如果此时继续将接近光阈值设置为取值较大的第二接近光阈值,则接近光传感器180G检测到红外反射光光强容易到该接近光阈值,导致防误触算法频繁被启动从而干扰用户的正常操作。因此,手机100可将接近光阈值设置为取值较大的第二接近光阈值。这样一来,当接近光传感器180G检测到红外反射光的强度大于第二接近光阈值时,手机100才会开启防误触算法屏蔽手机100屏幕检测到的触摸操作,从而不影响用户的正常操作。因此,防误触算法的启动能够适应各种场景。
也就是说,在本申请实施例提供的接近光传感器的控制方法中,手机100可结合手机100当前的运动姿态确定出相应的接近光阈值。由于手机100的运动姿态可反映出手机100当前所处的具体场景,在比较容易发生误触操作的应用场景下,手机100可使用取值较小的接近光阈值判断是否有遮挡物。此时,即使接近光传感器180G发出的一部分红外光被吸收了, 手机100也可判断出有遮挡物接近。这样,手机100判断是否有遮挡物接近的要求较为宽松,相应使得手机100开启防误触算法的条件较为宽松,从而尽可能的降低了手机100发生误触现象的几率。而在发生误触操作的可能相对较低的应用场景下,手机100可使用取值较大的接近光阈值判断是否有遮挡物。手机100判断是否有遮挡物接近的要求较为严格,相应使得手机100开启防误触算法的条件较为严格,从而尽可能的降低因频繁启动防误触算法导致用户正常操作被屏蔽的几率。
当然,上述传感器模块180还可以包括压力传感器180A,气压传感器180C,磁传感器180D,距离传感器180F,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等,本申请实施例对此不做任何限制。其中,触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于手机100的表面,与显示屏194所处的位置不同。
手机100还可以包括USB接口130、充电管理模块140、电源管理模块141、电池142以及SIM卡接口195等部件,本申请实施例对此不做任何限制。
手机100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明手机100的软件结构。
图5是本发明实施例的手机100的软件结构框图。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。
应用程序层可以包括一系列应用程序包。
如图5所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。
这些应用程序可以是操作系统的系统级应用(例如,桌面、短信、通话、日历、联系人等),也可以是普通级别应用(例如,微信、亚马逊等)。系统级应用一般指的是:该应用具有系统级权限,可以获取各种系统资源。普通级别应用一般指的是:该应用具有普通权限,可能无法获取某些系统资源,或者需要用户授权,才能获取一些系统资源。系统级应用可以为手机中预装的应用。普通级别应用可以为手机中预装的应用,也可以为后续用户自行安装的应用。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图5所示,应用程序框架层可以包括窗口管理器,传感器管理器,状态管理器,内容提供器,视图系统,电话管理器,通知管理器等。
窗口管理器(WindowManager)用于管理窗口程序。例如,窗口管理器可以按照防误触算法在正在显示的窗口上加载一个防误触窗口,从而激活手机屏幕的防误触功能。该防误触窗口可以是透明、半透明或不透明的。加载防误触窗口后,手机将不再响应手机屏幕上接收到的任何操作,直至窗口管理器移除该防误触窗口。当然,窗口管理器还可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
传感器管理器(SensorManager)可用于获取内核层的传感器驱动上报的传感器事件。以接近光传感器为例,接近光传感器在工作的过程中可将检测到的红外反射光的强度通过传感器驱动上报给传感器管理器。
状态管理器可根据陀螺仪传感器和加速度传感器上报的测量值确定手机的运动姿态。例如,当陀螺仪传感器上报的手机围绕y轴的旋转角度大于设定的角度时,状态管理器可向传感器管理器输出状态信号1,用于指示手机所处的运动姿态为翻转状态。又例如,例如,当加速度传感器上报的重力方向与y轴的指向重合时,状态管理器可向传感器管理器输出状态信号0,用于指示手机所处的运动姿态为顶部朝下的状态。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供手机100的通信功能。例如通话状态的管理(包括接通,挂断等)。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,终端振动,指示灯闪烁等。
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库OpenGL ES,2D图形引擎SGL等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
OpenGL ES用于实现三维图形绘图,图像渲染,合成,和图层处理等。
SGL是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
在本申请实施例中,硬件中的接近光传感器检测到红外反射光后,可通过内核层的传感器驱动将红外反射光的强度上报给传感器管理器。同样,硬件层的陀螺仪传感器和加速度传感器也可以将检测到的旋转角度、加速度值以及重力方向等测量值上报给状态管理器,状态管理器可根据这些测量值确定出手机所处的具体运动姿态。进而,传感器管理器可根据状态管理器确定出的手机所处的运动姿态,选择相应的接近光阈值作为判断是否有遮挡物接近的标准。
例如,当状态管理器确定当前手机处于顶部朝下或翻转状态等目标运动姿态时,由于此时靠近手机的遮挡物容易接触到手机的屏幕产生误触操作,因此,传感器管理器可使用取值较小的第一接近光阈值作为本次判断是否有遮挡物接近手机的接近光阈值。进而,传感器管理器可比较该第一接近光阈值与红外反射光的强度,如果红外反射光的强度大于第一接近光阈值,则说明有遮挡物接近手机。那么,传感器管理器可上报窗口管理器有遮挡物接近,触发窗口管理器开启防误触算法,在当前显示的窗口上生成并加载防误触窗口,避免手机发生误触现象。这样一来,在比较容易发生误触操作的场景下,传感器管理器通过取值较小的第一接近光阈值可以将判断出有遮挡物接近手机的条件变得更为宽松,从而及时通知窗口管理器生成防误触窗口以降低手机发生误触现象的几率。
以下将以手机作为电子设备举例,结合附图详细阐述本申请实施例提供的一种接近光传感器的控制方法。
在一些实施例中,当手机处于黑屏(或称为息屏)状态时,一般说明用户没有使用手机的需求,因此,手机可以关闭接近光传感器,或者,手机也可以以较低的工作频率(即低功耗模式)开启接近光传感器进行工作,以节省手机功耗。当然,当手机处于黑屏或息屏状态时,手机还可以关闭陀螺仪传感器或加速度传感器等其他传感器,本申请实施例对此不做任何限制。
如果手机在黑屏状态时接收到新的消息(或来电),或者,有物体触发了手机上的按键,手机会从黑屏状态切换为亮屏状态。此时,如果接近光传感器已经关闭,则手机可开启接近光传感器进行正常工作。如果接近光传感器处于工作频率较低的低功耗模式,则手机可提高接近光传感器的工作频率,使接近光传感器开始正常工作。类似的,如果手机从黑屏状态切换为亮屏状态,手机还可以控制陀螺仪传感器、加速度传感器等用于确定手机运动姿态的其他传感器开始正常工作。
当加速度传感器工作时,加速度传感器可定期检测重力的大小及方向。示例性的,如图6中的(a)所示,可将手机的四个顶点中的任意一点(例如左下角的顶点)作为前述的右手笛卡尔坐标系的原点O,其中,x轴,y轴和z轴的描述参见前述实施例的定义。那么,加速度传感器可检测出重力G在上述坐标系中的大小和方向。如图6中的(b)所示,当重力G的方向与y轴的指向重合时,说明重力G此时指向手机的顶部。也就是说,手机可根据重力G在y轴上的分量确定手机的运动姿态是否为顶部朝下。因此,加速度传感器可将重力G在y轴上的分量上报给框架层的状态管理器。进而,状态管理器可根据重力G在y轴上的分量确定手机此时的运动姿态是否为顶部朝下的状态。如果重力G在y轴上的分量与y轴的指向相同,且重力G在y轴上的分量大于设定的分量,则状态管理器可向传感器输出状态信号0,用于指示手机所处的运动姿态为顶部朝下的目标运动姿态。当手机处于顶部朝下的运动姿态时,此时手机很可能处于口袋场景中。
或者,用户将手机放入口袋的过程一般是先大致水平的握持手机将手机锁屏,进而将手机顶部朝下放入口袋。因此,可以设置上述目标运动姿态是指手机从顶部朝上转变为顶部朝下的姿态变化过程。示例性的,当手机检测到用户对手机执行锁屏操作后,手机可使用加速度传感器检测并记录重力G在上述坐标系中的变化过程。仍参考前述实施例中的右手笛卡尔坐标系说明如下(图7未示出),如图7中的(a)所示,手机刚锁屏后用户一般仍处于屏幕大致水平的正常观看手机的姿态,此时重力G与坐标系的z轴重合。在用户将手机放入口袋的过程中,如图7中的(b)-(d)所示,重力G的方向逐渐与坐标系中y轴的指向重合,即 手机的运动姿态从顶部朝上逐渐转变为顶部朝下。那么,如果加速度传感器检测到的重力G的变化过程与图7所示的变化过程相符,则状态管理器也可确定手机处于目标运动姿态。
当陀螺仪传感器工作时,仍以图6中的(a)-(b)中所示的坐标系举例,陀螺仪传感器可定期检测手机围绕y轴的旋转角度
Figure PCTCN2019110066-appb-000001
进而,加速度传感器可将检测到的手机围绕y轴的旋转角度
Figure PCTCN2019110066-appb-000002
上报给框架层的状态管理器。当手机围绕y轴的旋转角度
Figure PCTCN2019110066-appb-000003
大于设定的角度(例如80°)时,状态管理器向传感器输出状态信号1,用于指示手机所处的运动姿态为翻转状态这一目标运动姿态。当手机处于翻转状态时,如果手机此时处于通话状态,则说明此时手机很可能处于贴耳通话场景中。当然,本申请实施例对手机检测是否处于翻转状态和是否处于通话状态的先后顺序不作任何限定。
示例性的,用户从接听电话到使用手机顶部听筒进行通话时,一般是先握持手机查看来电信息或进行拨号,再翻转手机至耳边进行通话。因此,如图8中的(a)所示,当手机接收到新的来电或检测到用户点击拨号按钮时,手机可使用陀螺仪传感器记录手机此时沿y轴的角度,即手机开始围绕y轴旋转的初始角度
Figure PCTCN2019110066-appb-000004
进而,如图8中的(b)-(c)所示,用户在翻转手机的过程中,手机可使用陀螺仪传感器连续记录手机围绕y轴从初始角度
Figure PCTCN2019110066-appb-000005
开始旋转的旋转角度
Figure PCTCN2019110066-appb-000006
当旋转角度
Figure PCTCN2019110066-appb-000007
大于角度阈值时,可确定手机此时处于目标运动姿态。当然,手机也可以连续记录手机围绕y轴旋转的实际角度
Figure PCTCN2019110066-appb-000008
直至检测到手机停止围绕y轴旋转时的结束角度
Figure PCTCN2019110066-appb-000009
当结束角度
Figure PCTCN2019110066-appb-000010
与初始角度
Figure PCTCN2019110066-appb-000011
的差值大于角度阈值时,手机也可确定此时处于目标运动姿态。
另外,如图9所示,由于用户使用手机顶部听筒接听通话时一般会产生抬手的动作,因此,在检测手机围绕y轴的旋转角度
Figure PCTCN2019110066-appb-000012
的同时,手机还可以使用加速度传感器等识别手机是否处于抬手运动姿态。例如,用户举起手机的过程中手机在x轴、y轴以及z轴上会产生相应的加速度,这个加速度一般在一个阈值区间内。而用户举起手机后手机一般处于静止(或趋于静止)的状态,此时检测到的加速度趋近于0。那么,如果加测到手机在x轴、y轴以及z轴上产生的加速度落入上述阈值区间后又回到0,则可确定手机处于抬手运动姿态,即用户执行了抬手操作。因此,在一些实施例中,如果检测到手机围绕y轴的旋转角度
Figure PCTCN2019110066-appb-000013
大于角度阈值,且手机在x轴、y轴或z轴上产生的加速度逐渐增大直至落入设定的阈值区间后,该加速度又渐减小至趋近于0,则手机也可确定此时处于目标运动姿态,即目标运动姿态包括翻转状态和抬手运动姿态。
示例性的,状态管理器可以将为手机确定出的状态信号存储下来并定时更新,例如,手机可在状态管理器中设置一个或多个比特的标志位,该标志位用于存储状态信号。例如,当状态信号为00时,说明手机处于顶部朝下的运动姿态,当状态信号为01时,说明手机处于翻转姿态。状态管理器可以将最近一次确定出的状态信号保存在该标志位中。
进一步地,当接近光传感器开始工作时,接近光传感器可以一定频率发射光线(后续实施例中以接近光传感器发射红外光举例),如果手机附近有遮挡物,则接近光传感器会接收到红外光反射后的红外反射光。那么,接近光传感器可以将每次接收到的红外反射光的实际光强值上报给框架层的SensorManager(传感器管理器)。SensorManager内可设置存储单元存储最近一次接近光传感器上报的红外反射光的实际光强值。并且,SensorManager内还可以预先存储多个接近光阈值,这些接近光阈值可分别用于在手机处于不同运动姿态时判断是否有遮挡物接近,例如,SensorManager内存储有第一接近光阈值、第二接近光阈值以及第三接近光阈值,其中,第一接近光阈值<第二接近光阈值<第三接近光阈值。
那么,SensorManager获取到最近一次接近光传感器上报的实际光强值后,可以从状态管理器进一步获取用于指示手机运动姿态的状态信号。如果手机所处的手机运动姿态为设定的目标运动姿态,则说明手机很可能处于发生误触风险较高的场景(例如上述口袋场景或贴耳通话场景),则SensorManager可以使用取值较小的接近光阈值(例如上述第一接近光阈值或第二接近光阈值)判断是否有遮挡物接近。由于上述第一接近光阈值或第二接近光阈值的取值相对较小,因此判断出有遮挡物接近手机的可能性较大,相应的,后续手机开启防误触算法的可能性较大,从而降低手机在这些发生误触风险较高的场景下发生误触的几率。
当然,如果手机所处的手机运动姿态不是上述目标运动姿态,则手机屏幕发生误触操作的可能降低。此时,SensorManager可以使用取值较大的接近光阈值(例如上述第三接近光阈值)判断是否有遮挡物接近。这样一来,SensorManager判断是否有遮挡物接近的要求较为严格,相应使得手机开启防误触算法的条件较为严格,从而尽可能的降低因频繁启动防误触算法导致用户正常操作被屏蔽的几率。
需要说明的是,如图10所示,手机除了可以根据当前的运动姿态动态调整上述接近光阈值外,还可以结合手机在运行时的其他信息确定如何调整上述接近光阈值。也就是说,手机可以设定一个触发调整接近光阈值的调整条件,该调整条件至少包括手机处于上述目标运动姿态这一条件,该调整条件还可以包括手机屏幕的状态信息(例如解锁事件、锁屏事件)、通话状态信息(例如拨号事件、来电事件)等满足设定的条件。当检测到手机满足上述调整条件时,手机可动态调整上述接近光阈值。
例如,在调整上述接近光阈值之前,手机还可以获取手机的屏幕状态信息。例如,如果检测到手机屏幕已经解锁,则说明用户可能在正常使用手机,因此,为了避免经常防误触算法开启后屏蔽用户的正常操作,手机可以将上述接近光阈值设置为取值较大的第三接近光阈值。相应的,如果检测到手机屏幕没有解锁,且手机处于顶部朝下的目标运动姿态,则手机发生误触风险较高,因此,手机可以将上述接近光阈值设置为取值较小的第一接近光阈值或第二接近光阈值。或者,如果检测到针对手机屏幕的锁屏事件(或灭屏事件)后,继续检测到重力在上述y轴上的分量逐渐增大,直至重力在上述y轴上的分量大于设定值,说明用户很可能将手机锁屏后装入口袋中,因此,手机可将上述接近光阈值设置为取值较小的第一接近光阈值或第二接近光阈值。
又例如,在调整上述接近光阈值之前,手机还可以获取当前的通话状态信息。例如,如果检测到手机没有运行通话应用,则说明手机当前不在通话状态中,则手机可将上述接近光阈值设置为取值较大的第三接近光阈值。如果手机检测到来电事件或用户输入的拨号事件,且手机围绕y轴的旋转角度
Figure PCTCN2019110066-appb-000014
大于角度阈值,则说明手机处于通话状态,且用户很可能是以贴耳姿态进行通话的,那么,手机可将上述接近光阈值设置为取值较小的第一接近光阈值或第二接近光阈值。
又例如,在调整上述接近光阈值之前,手机还可以获取当前的环境光信息。例如,手机可以使用环境光传感器检测当前的环境光光强。如果当前的环境光光强小于光强阈值,且手机处于顶部朝下的目标运动姿态,则说明手机很可能处于口袋场景中。因此,手机可以将上述接近光阈值设置为取值较小的第一接近光阈值或第二接近光阈值。
另外,手机在口袋场景下一般会随用户移动,那么,手机可使用定位装置、陀螺仪传感器或加速度传感器检测手机是否处于步行、乘车等移动状态。因此,手机设定的目标运动姿态还可以包括移动状态。如果检测到手机处于移动状态,且处于顶部朝下的目标运动姿态, 则手机可以将上述接近光阈值设置为取值较小的第一接近光阈值或第二接近光阈值。
可以看出,如图10所示,在本申请实施例中手机可以根据加速度传感器和陀螺仪传感器的测量值确定手机所处的运动姿态。进而,手机可结合手机的运动姿态、环境光光强、手机的通话状态以及手机的屏幕状态等信息确定手机是否满足了设定的调整条件。如果满足该调整条件,则手机可动态调整接近光传感器的接近光阈值。例如,在误触风险相对较大的情况下,手机可使用取值较小的接近光阈值判断是否有遮挡物接近手机,在误触风险相对较小的情况下,手机可使用取值较大的接近光阈值判断是否有遮挡物接近手机。如果确定出有遮挡物接近手机,则手机可启动防误触算法使手机屏幕的防误触功能处于激活状态。当然,如果在判断出有遮挡物接近手机时手机已经启动了防误触算法,则手机此时可继续保持防误触功能的激活状态。如果确定出没有遮挡物接近手机,则手机无需启动防误触算法,此时手机屏幕的防误触功能处于去激活状态。
示例性的,SensorManager确定了当前使用的接近光阈值后,可使用确定出的接近光阈值与接近光传感器上报的红外反射光的实际光强值进行比较。如果实际光强值大于该接近光阈值,说明有遮挡物接近手机,则SensorManager可向框架层的WindowManager(窗口管理器)发送接近信号。例如,当接近信号为1时,表示有遮挡物接近手机;当接近信号为0时,表示没有遮挡物接近手机。这样,WindowManager接收到取值为1的接近信号后,可启动防误触算法在手机正在显示的窗口上生成一个防误触窗口,该防误触窗口可以屏蔽手机屏幕上接收到的任意操作,从而达到防误触的效果。
另外,接近光传感器上报的红外反射光的实际光强值可以定期更新,状态管理器中存储的用于指示手机运动姿态的状态信号也可以定期更新。那么,每当SensorManager接收到接近光传感器上报的实际光强值发生变化,SensorManager可使用新的实际光强值与接近光阈值进行比较。当新的实际光强值小于接近光阈值时,SensorManager可将接近信号从1修改为0,并发送给WindowManager。此时,WindowManager可移除上述防误触窗口,即去激活手机屏幕的防误触功能,从而恢复手机屏幕与用户的可交互性。
又或者,如果状态管理器检测到手机退出了的上述目标运动姿态,SensorManager可将原本取值较小的接近光阈值修改为取值较高的接近光阈值。进而,SensorManager可重新比较该接近光阈值与此时存储的实际光强值之间的大小关系。如果实际光强值小于上述第三接近光阈值,则SensorManager可向WindowManager发送没有遮挡物接近手机的接近信号0。这样,响应于该接近信号0,WindowManager可移除上述防误触窗口,即去激活手机屏幕的防误触功能,从而恢复手机屏幕与用户的可交互性。当然,如果WindowManager最近一次接收到的接近信号也为0,则说明手机已经加载了防误触窗口,那么WindowManager可继续保持手机屏幕的防误触功能为去激活状态。
示例性的,SensorManager中可预先设置三个接近光阈值,即接近光阈值1、接近光阈值2以及接近光阈值3。其中,接近光阈值1为400,接近光阈值2为260,接近光阈值3为120。
那么,如图11所示,如果检测到手机处于亮屏状态,且处于解锁状态,此时用户一般在正常使用手机,出现误触现象的几率相对较小,因此,SensorManager可将此时的接近光阈值设置为较大取值的接近光阈值1(即400)。这样,当遮挡物距离接近光传感器足够近时,接近光传感器向SensorManager上报的红外反射光的实际光强值才会大于上述接近光阈值1,进而触发WindowManager启动防误触算法在手机正在显示的窗口上覆盖一个防误触窗口。
后续,仍如图11所示,当手机接收到新的来电事件时,由于在来电场景下发生误触的风 险大于在亮屏解锁态下发生误触的风险,因此,SensorManager可将接近光阈值从上述接近光阈值1修改为取值较小的接近光阈值2(即260)。同时,手机还可以使用陀螺仪传感器检测手机沿y轴的旋转角度。如果检测到手机沿y轴的旋转角度大于角度阈值,则说明用户很可能将手机翻转至耳边接打电话,此时人耳更容易误触手机屏幕。因此,SensorManager可将接近光阈值从上述接近光阈值2修改为取值更小的接近光阈值3(即120)。这样,当遮挡物(例如人耳)靠近手机时,一旦接近光传感器向SensorManager上报的红外反射光的实际光强值大于上述接近光阈值3,SensorManager便会向WindowManager发送接近信号,使得WindowManager启动防误触算法在手机正在显示的窗口上覆盖一个防误触窗口。
需要说明的是,上述实施例中是通过比较接近光传感器接收到的实际光强值与接近光阈值之间的大小关系为例判断是否有遮挡物接近手机的。在这种实现方式中,红外反射光的实际光强值越大,说明遮挡物与手机的距离越近;红外反射光的实际光强值越小,说明遮挡物与手机的距离越远。
但是,在另一些实施例中,手机也可以计算接近光传感器发出的红外光光强与经反射后红外反射光的实际光强值之间的能量比值。由于接近光传感器发出的红外光经反射后会有一部分能量损失,因此,上述能量比值一般为小于1的正数。在这种实现方式中,当计算出的能量比值越大时,说明红外反射光的实际光强值越小,即遮挡物与手机的距离越远。因此,手机使用接近光传感器获取到本次的能量比值(例如0.4)后,可将该能量比值与预设能量比值(例如0.5)比较。如果该能量比值小于预设能量比值,则说明有遮挡物接近手机。进而,手机可开启防误触算法防止遮挡物误触手机屏幕。
或者,在另一些实施例中,手机也可以计算接近光传感器发出的红外光经反射后的能量损失率。例如,接近光传感器发出的红外光光强为100,如果接近光传感器接收到的红外反射光的实际光强值为60,则其能量损失率为(100-60)/100=0.4。同样,在这种实现方式中,当能量损失率越大时,说明红外反射光的实际光强值越小,即遮挡物与手机的距离越远。因此,手机使用接近光传感器获取到本次的能量损失率后,可将该能量损失率与预设损失率比较。如果该能量损失率小于预设损失率,则说明有遮挡物接近手机。进而,手机可开启防误触算法防止遮挡物误触手机屏幕。
那么,与上述实施例不同的是,如果手机使用上述预设能量比值(或预设损失率)判断是否有遮挡物接近手机,则当上述预设能量比值(或预设损失率)取值越大时,手机判断出有遮挡物接近手机的可能性较大,后续手机开启防误触算法的可能性较大。因此,手机获取到当前所处的场景为口袋场景或贴耳通话场景后,手机可使用取值较高的预设能量比值(或预设损失率)判断是否有遮挡物接近手机,从而增加手机开启防误触算法的几率,降低手机在这些容易发生误触的场景中被误触的几率。
也就是说,在本申请实施例中,手机可在口袋场景或贴耳通话场景等容易发生误触的场景中,调整用于判断是否有遮挡物接近手机时使用的阈值,该阈值可以是上述接近光阈值、预设比值或预设损失率,使得手机判断出有遮挡物接近的判断条件更加宽松,从而提高了手机开启防误触算法的几率,降低了手机发生的误触现象几率。
另外,本申请实施例中不限制上述防误触算法的具体实现方式。例如,上述防误触算法可用于生成并加载上述防误触窗口,以达到防误触的效果。或者,上述防误触算法还可用于关闭手机屏幕的触控功能,以达到防误触的效果。或者,上述防误触算法还可用于将手机屏幕设置为锁屏状态或黑屏状态,使得手机屏幕无法响应接收到的任意操作,从而达到防误触 的效果。
如图12所示,本申请实施例公开了一种电子设备,包括:触摸屏1201,所述触摸屏1201包括触敏表面1206和显示屏1207;一个或多个处理器1202;存储器1203;接近光传感器1208;加速度传感器1209;陀螺仪传感器1210;一个或多个应用程序(未示出);以及一个或多个计算机程序1204,上述各器件可以通过一个或多个通信总线1205连接。其中,该一个或多个计算机程序1204被存储在上述存储器1203中并被配置为被该一个或多个处理器1202执行,该一个或多个计算机程序1204包括指令,上述指令可以用于执行上述应实施例中的各个步骤。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请实施例各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请实施例的具体实施方式,但本申请实施例的保护范围并不局限于此,任何在本申请实施例揭露的技术范围内的变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应以所述权利要求的保护范围为准。

Claims (21)

  1. 一种接近光传感器的控制方法,由具有接近光传感器的电子设备执行,其特征在于,包括:
    检测到满足调整条件,所述调整条件包括:所述电子设备的运动姿态为设定的目标运动姿态;
    将所述接近光传感器的第一接近光阈值改为第二接近光阈值,所述第一接近光阈值与所述第二接近光阈值不同;
    获取所述接近光传感器上报的光强参数,所述光强参数用于表示所述接近光传感器发射光的反射光强;
    根据所述光强参数和所述第二接近光阈值,激活或去激活所述电子设备的屏幕的防误触功能。
  2. 如权利要求1所述的控制方法,其特征在于,所述目标运动姿态包括:所述电子设备的重力在设定方向上的分量大于设定值,所述设定方向为从所述电子设备底部指向所述电子设备顶部的方向。
  3. 如权利要求1所述的控制方法,其特征在于,所述目标运动姿态包括:所述电子设备的重力在所述设定方向上的分量逐渐增大至大于设定值,所述设定方向为从所述电子设备底部指向所述电子设备顶部的方向。
  4. 如权利要求2或3所述的控制方法,其特征在于,所述调整条件还包括:检测到锁屏事件或灭屏事件。
  5. 如权利要求1所述的控制方法,其特征在于,所述目标运动姿态包括:所述电子设备围绕设定方向旋转的旋转角度大于角度阈值,所述设定方向为从所述电子设备底部指向所述电子设备顶部的方向。
  6. 如权利要求5所述的控制方法,其特征在于,所述目标运动姿态还包括:所述电子设备在至少一个方向上产生的加速度逐渐增大至大于第一设定值后,逐渐减小至小于第二设定值,所述第一设定值大于所述第二设定值。
  7. 如权利要求5或6所述的控制方法,其特征在于,所述调整条件还包括:检测到来电事件或拨号事件。
  8. 如权利要求1-7中任一项所述的控制方法,其特征在于,所述光强参数是指所述接近光传感器接收到的反射光强,或所述反射光强与所述接近光传感器的发射光强的比值;所述第一接近光阈值大于所述第二接近光阈值;
    其中,根据所述光强参数和所述第二接近光阈值,激活或去激活所述电子设备的屏幕的防误触功能,包括:
    若所述光强参数大于所述第二接近光阈值,则激活所述电子设备的屏幕的防误触功能,或保持所述电子设备的屏幕的防误触功能为激活状态。
  9. 如权利要求8所述的控制方法,其特征在于,若所述光强参数小于所述第二接近光阈值,则
    去激活所述电子设备的屏幕的防误触功能,或保持所述电子设备的屏幕的防误触功能为去激活状态。
  10. 如权利要求1-7中任一项所述的控制方法,其特征在于,所述光强参数是指所述接 近光传感器的发射光强与所述接近光传感器接收到的反射光强的比值,或所述接近光传感器的发射光强的光损失率;所述第一接近光阈值小于所述第二接近光阈值;
    其中,根据所述光强参数和所述第二接近光阈值,激活或去激活所述电子设备的屏幕的防误触功能,包括:
    若所述光强参数小于所述第二接近光阈值,则激活所述电子设备的屏幕的防误触功能,或保持所述电子设备的屏幕的防误触功能为激活状态。
  11. 如权利要求10所述的控制方法,其特征在于,若所述光强参数大于所述第二接近光阈值,则
    去激活所述电子设备的屏幕的防误触功能,或保持所述电子设备的屏幕的防误触功能为去激活状态。
  12. 一种电子设备,其特征在于,包括:
    接近光传感器;
    触摸屏,其中,所述触摸屏包括触敏表面和显示器;
    一个或多个处理器;
    一个或多个存储器;
    以及一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述一个或多个存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述电子设备执行时,使得所述电子设备执行以下步骤:
    检测到满足调整条件,所述调整条件包括:所述电子设备的运动姿态为设定的目标运动姿态;
    将所述接近光传感器的第一接近光阈值改为第二接近光阈值,所述第一接近光阈值与所述第二接近光阈值不同;
    获取所述接近光传感器上报的光强参数,所述光强参数用于表示所述接近光传感器发射光的反射光强;
    根据所述光强参数和所述第二接近光阈值,激活或去激活所述触摸屏的防误触功能。
  13. 如权利要求12所述的电子设备,其特征在于,所述电子设备还包括加速度传感器和/或陀螺仪传感器,所述电子设备用于执行:
    使用所述加速度传感器和/或所述陀螺仪传感器确定所述电子设备的运动姿态。
  14. 如权利要求12或13所述的电子设备,其特征在于,所述目标运动姿态包括:所述电子设备的重力在设定方向上的分量大于设定值,所述设定方向为从所述电子设备底部指向所述电子设备顶部的方向。
  15. 如权利要求12或13所述的电子设备,其特征在于,所述目标运动姿态包括:所述电子设备的重力在所述设定方向上的分量逐渐增大至大于设定值,所述设定方向为从所述电子设备底部指向所述电子设备顶部的方向。
  16. 如权利要求14或15所述的电子设备,其特征在于,所述调整条件还包括:检测到锁屏事件或灭屏事件。
  17. 如权利要求12或13所述的电子设备,其特征在于,所述目标运动姿态包括:所述电子设备围绕设定方向旋转的旋转角度大于角度阈值,所述设定方向为从所述电子设备底部指向所述电子设备顶部的方向。
  18. 如权利要求17所述的电子设备,其特征在于,所述目标运动姿态还包括:所述电子 设备在至少一个方向上产生的加速度逐渐增大至大于第一设定值后,逐渐减小至小于第二设定值,所述第一设定值大于所述第二设定值。
  19. 如权利要求17或18所述的电子设备,其特征在于,所述调整条件还包括:检测到来电事件或拨号事件。
  20. 如权利要求12-19中任一项所述的电子设备,其特征在于,所述光强参数是指所述接近光传感器接收到的反射光强,或所述反射光强与所述接近光传感器的发射光强的比值;所述第一接近光阈值大于所述第二接近光阈值;
    其中,所述电子设备根据所述光强参数和所述第二接近光阈值,激活或去激活所述触摸屏的防误触功能,具体包括:
    若所述光强参数大于所述第二接近光阈值,则激活所述触摸屏的防误触功能,或保持所述触摸屏的防误触功能为激活状态;若所述光强参数小于所述第二接近光阈值,则去激活所述触摸屏的防误触功能,或保持所述触摸屏的防误触功能为去激活状态。
  21. 如权利要求12-19中任一项所述的电子设备,其特征在于,所述光强参数是指所述接近光传感器的发射光强与所述接近光传感器接收到的反射光强的比值,或所述接近光传感器的发射光强的光损失率;所述第一接近光阈值小于所述第二接近光阈值;
    其中,所述电子设备根据所述光强参数和所述第二接近光阈值,激活或去激活所述触摸屏的防误触功能,具体包括:
    若所述光强参数小于所述第二接近光阈值,则激活所述触摸屏的防误触功能,或保持所述触摸屏的防误触功能为激活状态;若所述光强参数大于所述第二接近光阈值,则去激活所述触摸屏的防误触功能,或保持所述触摸屏的防误触功能为去激活状态。。
PCT/CN2019/110066 2018-11-07 2019-10-09 一种接近光传感器的控制方法及电子设备 WO2020093833A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811318527.3 2018-11-07
CN201811318527.3A CN109547629A (zh) 2018-11-07 2018-11-07 一种接近光传感器的控制方法及电子设备

Publications (1)

Publication Number Publication Date
WO2020093833A1 true WO2020093833A1 (zh) 2020-05-14

Family

ID=65846568

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/110066 WO2020093833A1 (zh) 2018-11-07 2019-10-09 一种接近光传感器的控制方法及电子设备

Country Status (2)

Country Link
CN (1) CN109547629A (zh)
WO (1) WO2020093833A1 (zh)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109547629A (zh) * 2018-11-07 2019-03-29 华为技术有限公司 一种接近光传感器的控制方法及电子设备
CN110602588B (zh) * 2019-09-26 2021-09-03 上海摩勤智能技术有限公司 一种防误触方法
CN112698420B (zh) * 2019-10-23 2023-11-03 广州奕至家居科技有限公司 一种物体接近感应方法及装置
CN110822515B (zh) * 2019-11-06 2022-08-26 宁波方太厨具有限公司 厨房电器防误触触摸面板、吸油烟机以及触摸面板的防触摸方法
CN111327760B (zh) * 2020-01-17 2021-06-18 珠海格力电器股份有限公司 防误触模式的控制方法、装置、移动终端及存储介质
JP2021150671A (ja) * 2020-03-16 2021-09-27 ローム株式会社 受光ic、近接センサ、および電子機器
CN113497853B (zh) * 2020-04-02 2023-11-17 华为技术有限公司 电子设备、可移动组件的控制方法
CN114125144B (zh) * 2020-08-26 2023-03-31 华为技术有限公司 一种防误触的方法、终端及存储介质
CN112272255B (zh) * 2020-10-22 2021-07-20 珠海格力电器股份有限公司 一种电子设备以及自动调整信号收发装置收发角度的方法
CN115014408B (zh) * 2021-09-17 2023-08-01 荣耀终端有限公司 电子设备
CN116095228B (zh) * 2022-08-16 2023-10-20 荣耀终端有限公司 接近光发射功率处理方法、终端设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090256810A1 (en) * 2008-04-15 2009-10-15 Sony Ericsson Mobile Communications Ab Touch screen display
CN104541231A (zh) * 2014-08-29 2015-04-22 华为技术有限公司 防误触触摸屏的方法和装置
CN106911863A (zh) * 2017-04-24 2017-06-30 珠海市魅族科技有限公司 一种终端的防误触方法及装置
CN107566161A (zh) * 2017-08-08 2018-01-09 广东欧珀移动通信有限公司 参数配置方法及相关产品
CN107786743A (zh) * 2017-10-27 2018-03-09 北京小米移动软件有限公司 防止终端误触的方法及装置
CN109547629A (zh) * 2018-11-07 2019-03-29 华为技术有限公司 一种接近光传感器的控制方法及电子设备

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6478655B2 (ja) * 2015-01-26 2019-03-06 シャープ株式会社 携帯端末
CN106797416B (zh) * 2016-10-31 2020-06-19 北京小米移动软件有限公司 屏幕控制方法及装置
CN106502819B (zh) * 2016-11-08 2020-01-14 Oppo广东移动通信有限公司 一种基于接近传感器的控制方法、装置及移动终端
CN107404575B (zh) * 2017-07-18 2020-04-17 Oppo广东移动通信有限公司 一种优化屏幕控制的方法、装置、存储介质及移动终端
CN107844215A (zh) * 2017-10-17 2018-03-27 广州视源电子科技股份有限公司 防误触方法、系统及装置
CN108668015A (zh) * 2018-04-11 2018-10-16 Oppo广东移动通信有限公司 终端的屏幕控制方法和装置、可读存储介质、终端

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090256810A1 (en) * 2008-04-15 2009-10-15 Sony Ericsson Mobile Communications Ab Touch screen display
CN104541231A (zh) * 2014-08-29 2015-04-22 华为技术有限公司 防误触触摸屏的方法和装置
CN106911863A (zh) * 2017-04-24 2017-06-30 珠海市魅族科技有限公司 一种终端的防误触方法及装置
CN107566161A (zh) * 2017-08-08 2018-01-09 广东欧珀移动通信有限公司 参数配置方法及相关产品
CN107786743A (zh) * 2017-10-27 2018-03-09 北京小米移动软件有限公司 防止终端误触的方法及装置
CN109547629A (zh) * 2018-11-07 2019-03-29 华为技术有限公司 一种接近光传感器的控制方法及电子设备

Also Published As

Publication number Publication date
CN109547629A (zh) 2019-03-29

Similar Documents

Publication Publication Date Title
WO2020093833A1 (zh) 一种接近光传感器的控制方法及电子设备
US11553078B2 (en) Touchscreen response method and electronic device
WO2020259452A1 (zh) 一种移动终端的全屏显示方法及设备
WO2020134872A1 (zh) 一种消息处理的方法、相关装置及系统
WO2020134869A1 (zh) 电子设备的操作方法和电子设备
EP3787298A1 (en) Flexible screen display method and terminal
EP4131911A1 (en) Application interface interaction method, electronic device, and computer readable storage medium
WO2021052016A1 (zh) 一种人体姿态检测方法及电子设备
WO2021036770A1 (zh) 一种分屏处理方法及终端设备
CN111543042B (zh) 通知消息的处理方法及电子设备
WO2020119492A1 (zh) 消息处理方法及相关装置
WO2021147396A1 (zh) 图标管理方法及智能终端
WO2021043046A1 (zh) 一种资源管控方法及设备
WO2020056778A1 (zh) 一种屏蔽触摸事件的方法及电子设备
WO2022068483A1 (zh) 应用启动方法、装置和电子设备
WO2021078032A1 (zh) 用户界面的显示方法及电子设备
WO2021258795A1 (zh) 原子能力调用方法及终端设备
WO2022001258A1 (zh) 多屏显示方法、装置、终端设备及存储介质
WO2021190314A1 (zh) 触控屏的滑动响应控制方法及装置、电子设备
WO2022095744A1 (zh) Vr显示控制方法、电子设备及计算机可读存储介质
WO2021073183A1 (zh) 始终显示方法及移动设备
WO2022143180A1 (zh) 协同显示方法、终端设备及计算机可读存储介质
US11995317B2 (en) Method and apparatus for adjusting memory configuration parameter
WO2022048453A1 (zh) 解锁方法及电子设备
WO2023051094A1 (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: 19881727

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19881727

Country of ref document: EP

Kind code of ref document: A1