CN107942306B - Method and device for calibrating proximity sensor, storage medium and electronic equipment - Google Patents

Method and device for calibrating proximity sensor, storage medium and electronic equipment Download PDF

Info

Publication number
CN107942306B
CN107942306B CN201711176949.7A CN201711176949A CN107942306B CN 107942306 B CN107942306 B CN 107942306B CN 201711176949 A CN201711176949 A CN 201711176949A CN 107942306 B CN107942306 B CN 107942306B
Authority
CN
China
Prior art keywords
value
proximity sensor
signal
signal strength
calibration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711176949.7A
Other languages
Chinese (zh)
Other versions
CN107942306A (en
Inventor
张海平
周意保
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201711176949.7A priority Critical patent/CN107942306B/en
Publication of CN107942306A publication Critical patent/CN107942306A/en
Application granted granted Critical
Publication of CN107942306B publication Critical patent/CN107942306B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Electromagnetism (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Physics & Mathematics (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the application discloses a calibration method and device of a proximity sensor, a storage medium and electronic equipment, wherein the electronic equipment comprises the proximity sensor arranged in a screen display area; the method comprises the following steps: the method comprises the steps of obtaining a first signal intensity value of a proximity sensor, wherein the first signal intensity value is the signal intensity value of the proximity sensor when the electronic equipment is not provided with a display screen, obtaining a second signal intensity value of the proximity sensor, the second signal intensity value is the signal intensity value of the proximity sensor after the electronic equipment is provided with the display screen, calculating a calibration value according to the first signal intensity value and the second signal intensity value, and calibrating the proximity sensor according to the calibration value. The method and the device can obtain the value of the attenuation of the proximity sensor when the proximity sensor is influenced by the display screen through calculation, and determine the value as the calibration value, so that the proximity sensor is calibrated, the phenomenon that the display screen interferes with the measurement of the proximity sensor to cause the detection data of the proximity sensor to be smaller can be avoided, and the accuracy is improved.

Description

Method and device for calibrating proximity sensor, storage medium and electronic equipment
Technical Field
The present application relates to the field of electronic devices, and in particular, to a method and an apparatus for calibrating a proximity sensor, a storage medium, and an electronic device.
Background
With the development of communication technology, electronic devices such as smart phones are becoming more and more popular. In the use process of the electronic equipment, for example, in the call process, in order to avoid misoperation of the electronic equipment by a user, when the face of the user approaches the electronic equipment for a certain distance, the electronic equipment automatically turns off the screen. Generally, an electronic device detects approach and departure of a user's face by a proximity sensor, and controls the electronic device to turn off or on a screen according to the detected data.
At present, information security and identity authentication on mobile intelligent terminals are increasingly problematic, and more intelligent terminals integrate sensors of biometric identification technology for identifying biological information such as fingerprints, human faces, irises and the like, and in addition, sensors such as an ambient light sensor, a proximity sensor and the like are required, and the sensors are often arranged on a front panel of the terminal. Therefore, a scheme of placing the proximity sensor under the screen may be adopted, thereby implementing a full screen scheme. Taking an infrared proximity sensor as an example, the proximity sensor is arranged below a display area of a screen, and when infrared rays pass through the display screen, the infrared rays are attenuated due to absorption, scattering and the like of glass, so that the measurement result is inaccurate.
Disclosure of Invention
The embodiment of the application provides a calibration method and device of a proximity sensor, a storage medium and electronic equipment, which can avoid that the detection data of the proximity sensor is small and improve the accuracy.
In a first aspect, an embodiment of the present application provides a calibration method for a proximity sensor, which is applied to an electronic device, where the electronic device includes a proximity sensor disposed in a screen display area, and the calibration method for the proximity sensor includes the following steps:
acquiring a first signal intensity value of the proximity sensor, wherein the first signal intensity value is the signal intensity value of the proximity sensor when the electronic equipment is not provided with a display screen;
acquiring a second signal intensity value of the proximity sensor, wherein the second signal intensity value is the signal intensity value of the proximity sensor after the electronic equipment is provided with a display screen;
calculating a calibration value according to the first signal strength value and the second signal strength value;
and calibrating the proximity sensor according to the calibration value.
In a second aspect, an embodiment of the present application further provides a calibration apparatus for a proximity sensor, which is applied to an electronic device, where the electronic device includes the proximity sensor disposed in a screen display area, and the calibration apparatus for the proximity sensor includes: the device comprises a first acquisition module, a second acquisition module, a calculation module and a calibration module;
the first obtaining module is configured to obtain a first signal strength value of the proximity sensor, where the first signal strength value is the signal strength value of the proximity sensor when the electronic device is not equipped with a display screen;
the second obtaining module is configured to obtain a second signal intensity value of the proximity sensor, where the second signal intensity value is the signal intensity value of the proximity sensor after the electronic device is installed with the display screen;
the calculation module is used for calculating a calibration value according to the first signal strength value and the second signal strength value;
the calibration module is used for calibrating the proximity sensor according to the calibration value.
In a third aspect, embodiments of the present application further provide a storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the steps of the calibration method for a proximity sensor.
In a fourth aspect, embodiments of the present application further provide an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the calibration method for a proximity sensor when executing the program.
The calibration method for the proximity sensor can obtain a first signal intensity value of the proximity sensor, the first signal intensity value is a signal intensity value of the proximity sensor when the electronic device is not provided with the display screen, a second signal intensity value of the proximity sensor is obtained, the second signal intensity value is a signal intensity value of the proximity sensor after the electronic device is provided with the display screen, a calibration value is calculated according to the first signal intensity value and the second signal intensity value, and the proximity sensor is calibrated according to the calibration value. The method and the device can obtain the value of the attenuation of the proximity sensor when the proximity sensor is influenced by the display screen through calculation, and determine the value as the calibration value, so that the proximity sensor is calibrated, the phenomenon that the display screen interferes with the measurement of the proximity sensor to cause the detection data of the proximity sensor to be smaller can be avoided, and the accuracy is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic plan view of a display screen of an electronic device according to an embodiment of the present application.
Fig. 2 is a schematic flowchart of a calibration method for a proximity sensor according to an embodiment of the present disclosure.
Fig. 3 is another schematic flowchart of a calibration method of a proximity sensor according to an embodiment of the present disclosure.
Fig. 4 is a schematic structural diagram of a calibration apparatus for a proximity sensor according to an embodiment of the present disclosure.
Fig. 5 is a schematic structural diagram of another calibration apparatus for a proximity sensor according to an embodiment of the present disclosure.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Fig. 7 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Referring to the drawings, wherein like reference numbers refer to like elements, the principles of the present application are illustrated as being implemented in a suitable computing environment. The following description is based on illustrated embodiments of the application and should not be taken as limiting the application with respect to other embodiments that are not detailed herein.
In the description that follows, specific embodiments of the present application will be described with reference to steps and symbols executed by one or more computers, unless otherwise indicated. Accordingly, these steps and operations will be referred to, several times, as being performed by a computer, the computer performing operations involving a processing unit of the computer in electronic signals representing data in a structured form. This operation transforms the data or maintains it at locations in the computer's memory system, which may be reconfigured or otherwise altered in a manner well known to those skilled in the art. The data maintains a data structure that is a physical location of the memory that has particular characteristics defined by the data format. However, while the principles of the application have been described in language specific to above, it is not intended to be limited to the specific form set forth herein, and it will be recognized by those of ordinary skill in the art that various of the steps and operations described below may be implemented in hardware.
The principles of the present application may be employed in numerous other general-purpose or special-purpose computing, communication environments or configurations. Examples of well known computing systems, environments, and configurations that may be suitable for use with the application include, but are not limited to, hand-held telephones, personal computers, servers, multiprocessor systems, microcomputer-based systems, mainframe-based computers, and distributed computing environments that include any of the above systems or devices.
The details will be described below separately.
The present embodiment will be described in terms of a calibration apparatus for a proximity sensor, which may be specifically integrated in an electronic device, which may be an electronic device including a distance sensor (e.g., a smartphone, a tablet computer).
Referring first to fig. 1, which is a schematic plan view of a display screen according to an embodiment of the present invention, a display screen 21 includes a display area 215 and a non-display area 216. Wherein the display area 215 performs the display function of the display screen 21 for displaying information. The non-display area 216 does not display information. The display screen 21 may include a plurality of non-display regions 216 spaced apart from one another. For example, non-display regions 216 are provided at the top and bottom of the display screen 21, respectively. The non-display area 216 may be used to set up functional components such as a camera, a receiver, and a fingerprint module.
The proximity sensor 213 may be an infrared proximity sensor, and includes an infrared transmitter 2131 and an infrared receiver 2132, which are both disposed in the display area 215 of the screen 21, for example, the infrared transmitter 2131 and the infrared receiver 2132 are both disposed in an upper area of the display area 215 as shown in fig. 1.
In some embodiments, the Display 21 may be a Liquid Crystal Display (LCD) or Organic Light-Emitting Diode (OLED) Display, or the like. When the display screen 21 is a liquid crystal display screen, the display layer may include a backlight plate, a lower polarizer, an array substrate, a liquid crystal layer, a color film substrate, an upper polarizer, and the like, which are sequentially stacked. When the display panel 21 is an organic light emitting diode display panel, the display layer may include a base layer, an anode, an organic layer, a conductive layer, an emission layer, a cathode, and the like, which are sequentially stacked.
Fig. 2 is a schematic flowchart of a calibration method for a proximity sensor according to an embodiment of the present application, where the method is applied to an electronic device including a plurality of ambient light sensors disposed at different positions in a display area of a screen, and the ambient light detection includes the following steps:
step S101, obtaining a first signal intensity value of the proximity sensor, wherein the first signal intensity value is the signal intensity value of the proximity sensor when the electronic equipment is not provided with the display screen.
The proximity sensors may be of various types, and are made according to different principles and different methods, and different proximity sensors sense objects in different ways, such as inductive proximity sensors, capacitive proximity sensors, infrared proximity sensors, and the like. In the embodiment of the present invention, an Infrared proximity sensor may be used in an electronic device, and the proximity sensing of the sensor is implemented by detecting the amount of Infrared energy reflected by an external barrier from Infrared Light-Emitting Diode (ir LED) emitted by the ir LED, so as to determine whether the ir LED approaches or leaves the electronic device.
The first signal strength value in this embodiment may be measured in a laboratory environment without any interference between the proximity sensor and the obstacle. The approaching process is as follows: the signal emitter emits signals to the outside, the reflected signals are formed after the signals are reflected by the barriers, and the reflected signals are received by the signal receiver.
Step S102, obtaining a second signal intensity value of the proximity sensor, wherein the second signal intensity value is the signal intensity value of the proximity sensor after the electronic equipment is installed with the display screen.
In an embodiment of the invention, the second signal strength value is a signal strength value measured by the proximity sensor after the electronic device is installed on the display screen. In order to ensure the accuracy of the data, except for installing the display screen, the other conditions are the same as those in step S101 when measuring the second signal strength value, that is, the distance between the obstacle, the indoor ambient light, the distance between the signal transmitter and the signal receiver in the proximity sensor, and the like are the same when measuring the second signal strength value and the first signal strength value.
It should be noted that, because the signal that signal transmitter transmitted can be sent to the external world through the display screen, and the reflected signal after the barrier reflection also can be received by signal receiver after the display screen, consequently under the same condition of transmitted signal intensity, second signal strength value can be less than first signal strength value theoretically, also the display screen can cause the decay to the signal.
In addition, after the display screen is installed in step S102, the signal emitted by the signal emitter may be reflected inside the electronic device after being reflected to the display screen and finally received by the signal receiver, and the signal intensity value measured by the proximity sensor is larger than the actual value due to the partial reflected signal, which affects the accuracy of the data.
Step S103, calculating a calibration value according to the first signal strength value and the second signal strength value.
In the embodiment of the present invention, since the signal emitted by the signal emitter is attenuated during the process of passing through the display screen, the measurement result of the proximity sensor may be interfered, specifically, the result obtained by subtracting the second signal intensity value from the first signal intensity value may be an attenuation value caused by the display screen to the proximity sensor, and the attenuation value is determined as the calibration value. For example, the first signal intensity value is 1000Lux, the second signal intensity value is 800Lux, and the calculated calibration value is 200 Lux.
And step S104, calibrating the proximity sensor according to the calibration value.
In one embodiment, the measurement result may be calibrated according to the calibration value each time after the signal strength value of the proximity sensor is measured during the use of the electronic device. For example, the value can be written into a register, and the calibration value is added every time the value is sampled and read later, so that the abnormal screen-off caused by the attenuation of the display screen to the signal is avoided.
In an embodiment, to reduce power consumption of the electronic device, the switch of the proximity sensor is controlled, and before the proximity sensor is calibrated according to the calibration value, whether the electronic device is currently in a call state, where the call state includes a voice call, a network call, and the like, may be determined, and if so, the step of calibrating the proximity sensor according to the calibration value may be performed.
Further, considering that after the electronic device enters the call state, a user may possibly call through the earphone and continue to operate the electronic device, and at this time, the screen does not need to be turned off by the proximity sensor, so that after the electronic device is determined to be in the call state currently, it can be further determined whether the electronic device is connected with the earphone currently, the earphone may include a line control earphone and a bluetooth earphone, and if not, the step of calibrating the proximity sensor according to the calibration value may be continuously performed.
As can be seen from the above, the calibration method for the proximity sensor provided in the embodiment of the present application can obtain a first signal intensity value of the proximity sensor, where the first signal intensity value is a signal intensity value of the proximity sensor when the electronic device is not installed with the display screen, obtain a second signal intensity value of the proximity sensor, where the second signal intensity value is a signal intensity value of the proximity sensor after the electronic device is installed with the display screen, calculate a calibration value according to the first signal intensity value and the second signal intensity value, and calibrate the proximity sensor according to the calibration value. The value that the proximity sensor attenuates when receiving the display screen influence can be obtained through calculation to this application to confirm to the calibration value, thereby calibrate the proximity sensor, can avoid the display screen to lead to proximity sensor detection data to be littleer to proximity sensor's measurement interference, promote the accuracy.
The calibration method of the proximity sensor of the present application will be further explained below according to the description of the above embodiment.
Referring to fig. 3, fig. 3 is a schematic flowchart illustrating another method for calibrating a proximity sensor according to an embodiment of the present disclosure, including the following steps:
step S201, obtaining a first signal intensity value of the proximity sensor for a preset number of times, where the first signal intensity value is the signal intensity value of the proximity sensor when the electronic device is not installed with the display screen.
The first signal strength value in this embodiment may be measured in a laboratory environment without any interference between the proximity sensor and the obstacle.
In one embodiment, an infrared proximity sensor may be used in the electronic device, and the proximity sensor is implemented by detecting the amount of infrared energy reflected by the external barrier from the infrared emitted by the ir LED to determine the approach or departure, and generally includes an infrared emitting sensor, i.e., an LED lamp emits infrared light, and a receiving sensor, i.e., receives infrared light.
Step S202, calculating an average value of the plurality of first signal strength values, and determining the average value as a target first signal strength value.
In an embodiment, the first signal strength values detected by the proximity sensor for a preset number of times may be obtained, and then an average value of the plurality of first signal strength values is calculated to be the target first signal strength value. The preset number of times of the last attribute can be set according to the actual situation, for example, 10 times, data is collected every 1 second, so that sampling data of the environment proximity sensor in the electronic device, which is continuously 10 times in 10 seconds, is obtained, and when the environment light is relatively stable (for example, in an indoor environment), the data jitter is very small, and the data jitter is basically single-digit jitter, such as the read values of 501Lux, 505Lux, 503Lux, and the like. After obtaining the plurality of first signal strength values, all the values may be added, and then the sum is divided by the number to obtain an average value of the plurality of first signal strength values, that is, a target first signal strength value. For example, in a preset time period, the first signal intensity value of the proximity sensor is sampled n times to obtain n first signal intensity values, such as Q1, Q2, Q3 … … Qn, etc., and an average value, that is, the target first signal intensity value, is obtained by calculating Q1+ Q2+ Q3+ … … + Qn and dividing the result by n.
Step S203, obtaining a second signal intensity value of the proximity sensor for the preset times, where the second signal intensity value is the signal intensity value of the proximity sensor after the electronic device is installed on the display screen.
The second signal intensity value is a signal intensity value obtained by the electronic equipment through measurement of the proximity sensor after the electronic equipment is installed on the display screen. In order to ensure the accuracy of the data, except for installing the display screen, the other conditions are the same as those in step S101 when measuring the second signal strength value, that is, the distance between the obstacle, the indoor ambient light, the distance between the signal transmitter and the signal receiver in the proximity sensor, and the like are the same when measuring the second signal strength value and the first signal strength value.
Step S204, calculating an average value of the plurality of second signal strength values, and determining the average value as a target second signal strength value.
The step of calculating the target second signal strength value may be the same as the step of calculating the target first signal strength value in step S202, and is not described herein again.
Step S205, calculate a difference between the first signal strength value and the second signal strength value, and determine the difference as a calibration value.
Because the signal of signal transmitter transmission can be sent to the external world through the display screen, the reflection signal after the barrier reflection also can be received by signal receiver after the display screen in addition, consequently under the same condition of emission signal intensity, second signal strength value can be less than first signal strength value in theory, also the display screen can cause the decay to the signal promptly. Therefore, the result obtained by subtracting the second signal intensity value from the first signal intensity value is the attenuation value caused by the display screen to the proximity sensor, and the attenuation value is determined as the calibration value. For example, the first signal intensity value is 1000Lux, the second signal intensity value is 800Lux, and the calculated calibration value is 200 Lux.
Step S206, add the calibration value to the signal strength value received by the signal receiver, or add the calibration value to the signal strength value sent by the signal transmitter.
In one embodiment, a proximity sensor includes a signal transmitter and a signal receiver. For example, the proximity sensor is an infrared proximity sensor including an infrared LED for emitting infrared rays and an infrared receiver for receiving a reflected infrared signal by a user.
Because the display screen can attenuate the signal strength, the signal strength value received by the signal receiver can be offset with the attenuated signal strength of the display screen by adding the calibration value. Similarly, the signal strength value sent by the signal transmitter is added with the calibration value, and after the signal is attenuated and offset through the display screen, the obtained result is also the calibrated value.
And step S207, performing screen-off control on the display screen of the electronic equipment according to the calibrated signal intensity value and the screen-off threshold value.
For example, the screen-off intensity threshold is 1800, when the user receives a call, the approaching data gradually increases along with the approach of an object, the threshold is triggered to generate an interrupt to stop the screen after exceeding the 1800 threshold, when the user stops the screen, the user finishes making the call and slowly moves away, and when the approaching value is less than 1800, the screen-on threshold is triggered to generate the interrupt to start the screen-on.
In one embodiment, the screen-out threshold and the screen-up threshold may also be set differently, for example, the screen-up threshold may be set to 1700 while the screen-out threshold is set to receive 1800. After the light intensity value exceeds 1800 and the screen is extinguished, whether the current light intensity is smaller than 1700 is further judged, and if the current light intensity is smaller than 1700, the terminal screen is lightened.
As can be seen from the above, the embodiment of the application can obtain the first signal intensity value of the proximity sensor for the preset number of times, where the first signal intensity value is the signal intensity value of the proximity sensor when the electronic device is not installed with the display screen, calculate the average value of the plurality of first signal intensity values, determining the signal intensity value as a target first signal intensity value, acquiring a second signal intensity value of the proximity sensor for a preset time, wherein the second signal intensity value is the signal intensity value of the proximity sensor after the electronic equipment is installed with the display screen, calculating the average value of the second signal intensity values, and determining as a target second signal strength value, calculating a difference between the first signal strength value and the second signal strength value, and determining the difference value as a calibration value, adding the calibration value to the signal strength value received by the signal receiver, or adding the signal intensity value sent by the signal transmitter with a calibration value, and performing screen-off control on the display screen of the electronic equipment according to the calibrated signal intensity value and the screen-off threshold value. The value that the proximity sensor attenuates when receiving the display screen influence can be obtained through calculation to this application to confirm to the calibration value, thereby calibrate the proximity sensor, can avoid the display screen to lead to proximity sensor detection data to be littleer to proximity sensor's measurement interference, promote the accuracy.
In order to better implement the calibration method of the proximity sensor provided by the embodiment of the present application, the embodiment of the present application further provides a device based on the calibration method of the proximity sensor. The terms are the same as those in the above-described method for calibrating a proximity sensor, and details of implementation may refer to the description in the method embodiment.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a calibration apparatus for a proximity sensor according to an embodiment of the present disclosure, which is applied to an electronic device including the proximity sensor disposed in a screen display area, and the calibration apparatus 30 for the proximity sensor includes: a first acquisition module 301, a second acquisition module 302, a calculation module 303 and a calibration module 304;
the first obtaining module 301 is configured to obtain a first signal strength value of the proximity sensor, where the first signal strength value is the signal strength value of the proximity sensor when the electronic device is not equipped with the display screen;
the second obtaining module 302 is configured to obtain a second signal strength value of the proximity sensor, where the second signal strength value is the signal strength value of the proximity sensor after the electronic device is installed with the display screen;
the calculating module 303 is configured to calculate a calibration value according to the first signal strength value and the second signal strength value;
the calibration module 304 is configured to calibrate the proximity sensor according to the calibration value.
Continuing to refer to fig. 5, in an embodiment, the first obtaining module 301 includes: a first obtaining sub-module 3011 and a first determining sub-module 3012;
the first obtaining submodule 3011 is configured to obtain a first signal intensity value of the proximity sensor for a preset number of times;
a first determining sub-module 3012, configured to calculate an average value of the plurality of first signal strength values, and determine the average value as a target first signal strength value;
the second obtaining module 302 includes: a second acquisition submodule 3021 and a second determination submodule 3022;
the second obtaining submodule 3021 is configured to obtain a second signal intensity value of the proximity sensor for the preset number of times;
the second determining submodule 3022 is configured to calculate an average value of the plurality of second signal strength values, and determine the average value as the target second signal strength value.
In an embodiment, the calculating module 303 is specifically configured to calculate a difference between the first signal strength value and the second signal strength value, and determine the difference as a calibration value.
In one embodiment, the proximity sensor includes a signal transmitter and a signal receiver, and the calibration module 304 is specifically configured to add a calibration value to a signal strength value received by the signal receiver, or to add a calibration value to a signal strength value sent by the signal transmitter.
In an embodiment, the calibration device 30 for the proximity sensor may further include: a control module 305;
and the control module 305 is configured to perform screen-off control on the display screen of the electronic device according to the calibrated signal intensity value and the screen-off threshold.
As can be seen from the above, the calibration apparatus 30 for a proximity sensor provided in this embodiment of the application may obtain, by the first obtaining module 301, a first signal strength value of the proximity sensor, where the first signal strength value is a signal strength value of the proximity sensor when an electronic device is not installed with a display screen, the second obtaining module 302 obtains a second signal strength value of the proximity sensor, where the second signal strength value is a signal strength value of the proximity sensor after the electronic device is installed with the display screen, the calculating module 303 calculates a calibration value according to the first signal strength value and the second signal strength value, and the calibration module 304 calibrates the proximity sensor according to the calibration value. The method and the device can obtain the value of the attenuation of the proximity sensor when the proximity sensor is influenced by the display screen through calculation, and determine the value as the calibration value, so that the proximity sensor is calibrated, the phenomenon that the display screen interferes with the measurement of the proximity sensor to cause the detection data of the proximity sensor to be smaller can be avoided, and the accuracy is improved.
The present application further provides a storage medium having a computer program stored thereon, where the computer program is executed by a processor to implement the calibration method of the proximity sensor provided in the method embodiments.
The application further provides an electronic device, which includes a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the calibration method of the proximity sensor provided in the method embodiment.
In another embodiment of the present application, an electronic device is also provided, and the electronic device may be a smart phone, a tablet computer, or the like. As shown in fig. 6, the electronic device 400 includes a processor 401, a memory 402. The processor 401 is electrically connected to the memory 402.
The processor 401 is a control center of the electronic device 400, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or loading an application program stored in the memory 402 and calling data stored in the memory 402, thereby integrally monitoring the electronic device.
In this embodiment, the processor 401 in the electronic device 400 loads instructions corresponding to processes of one or more application programs into the memory 402 according to the following steps, and the processor 401 runs the application programs stored in the memory 402, thereby implementing various functions:
acquiring a first signal intensity value of the proximity sensor, wherein the first signal intensity value is the signal intensity value of the proximity sensor when the electronic equipment is not provided with a display screen;
acquiring a second signal intensity value of the proximity sensor, wherein the second signal intensity value is the signal intensity value of the proximity sensor after the electronic equipment is provided with a display screen;
calculating a calibration value according to the first signal strength value and the second signal strength value;
and calibrating the proximity sensor according to the calibration value.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. The electronic device 500 may include Radio Frequency (RF) circuitry 501, memory 502 including one or more computer-readable storage media, input unit 503, display unit 504, sensor 504, audio circuitry 506, Wireless Fidelity (WiFi) module 507, processor 508 including one or more processing cores, and power supply 509. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 7 does not constitute a limitation of the electronic device and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
The rf circuit 501 may be used for receiving and transmitting information, or receiving and transmitting signals during a call, and in particular, receives downlink information of a base station and then sends the received downlink information to one or more processors 508 for processing; in addition, data relating to uplink is transmitted to the base station. In general, radio frequency circuit 501 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, the radio frequency circuit 501 may also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to Global System for Mobile communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Message Service (SMS), and the like.
The memory 502 may be used to store applications and data. Memory 502 stores applications containing executable code. The application programs may constitute various functional modules. The processor 508 executes various functional applications and data processing by executing application programs stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the electronic device, and the like. Further, the memory 502 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 502 may also include a memory controller to provide the processor 508 and the input unit 503 access to the memory 502.
The input unit 503 may be used to receive input numbers, character information, or user characteristic information (such as a fingerprint), and generate a keyboard, mouse, joystick, optical, or trackball signal input related to user setting and function control. In particular, in one particular embodiment, the input unit 503 may include a touch-sensitive surface as well as other input devices. The touch-sensitive surface, also referred to as a touch display screen or a touch pad, may collect touch operations by a user (e.g., operations by a user on or near the touch-sensitive surface using a finger, a stylus, or any other suitable object or attachment) thereon or nearby, and drive the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface may comprise two parts, a touch detection means and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 508, and can receive and execute commands sent by the processor 508.
The display unit 504 may be used to display information input by or provided to a user and various graphical user interfaces of the electronic device, which may be made up of graphics, text, icons, video, and any combination thereof. The display unit 504 may include a display panel. Alternatively, the display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch-sensitive surface may overlay the display panel, and when a touch operation is detected on or near the touch-sensitive surface, the touch operation is transmitted to the processor 508 to determine the type of touch event, and then the processor 508 provides a corresponding visual output on the display panel according to the type of touch event. Although in FIG. 7 the touch-sensitive surface and the display panel are two separate components to implement input and output functions, in some embodiments the touch-sensitive surface may be integrated with the display panel to implement input and output functions.
The electronic device may also include at least one sensor 505, such as light sensors, motion sensors, and other sensors. In particular, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel according to the brightness of ambient light, and a proximity sensor that may turn off the display panel and/or the backlight when the electronic device is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the mobile phone is stationary, and can be used for applications of recognizing the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which may be further configured to the electronic device, detailed descriptions thereof are omitted.
The audio circuit 506 may provide an audio interface between the user and the electronic device through a speaker, microphone. The audio circuit 506 can convert the received audio data into an electrical signal, transmit the electrical signal to a speaker, and convert the electrical signal into a sound signal to output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 506 and converted into audio data, which is then processed by the audio data output processor 508 and then sent to another electronic device via the rf circuit 501, or the audio data is output to the memory 502 for further processing. The audio circuit 506 may also include an earbud jack to provide communication of a peripheral headset with the electronic device.
Wireless fidelity (WiFi) belongs to short-distance wireless transmission technology, and electronic equipment can help users to send and receive e-mails, browse webpages, access streaming media and the like through a wireless fidelity module 507, and provides wireless broadband internet access for users. Although fig. 7 shows the wireless fidelity module 507, it is understood that it does not belong to the essential constitution of the electronic device, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 508 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing an application program stored in the memory 502 and calling data stored in the memory 502, thereby integrally monitoring the electronic device. Optionally, processor 508 may include one or more processing cores; preferably, the processor 508 may integrate an application processor, which primarily handles operating systems, user interfaces, application programs, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 508.
The electronic device also includes a power supply 509 (such as a battery) to power the various components. Preferably, the power source may be logically connected to the processor 508 through a power management system, so that the power management system may manage charging, discharging, and power consumption management functions. The power supply 509 may also include any component such as one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown in fig. 7, the electronic device may further include a camera, a bluetooth module, and the like, which are not described in detail herein.
In specific implementation, the above modules may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and specific implementation of the above modules may refer to the foregoing method embodiments, which are not described herein again.
It should be noted that, as one of ordinary skill in the art would understand, all or part of the steps in the various methods of the above embodiments may be implemented by relevant hardware instructed by a program, where the program may be stored in a computer-readable storage medium, such as a memory of a terminal, and executed by at least one processor in the terminal, and during the execution, the flow of the embodiments such as the information distribution method may be included. Among others, the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
In the above, detailed descriptions are given to the calibration method, the calibration device, the storage medium, and the electronic device for a proximity sensor provided in the embodiments of the present application, each functional module may be integrated into one processing chip, or each module may exist alone physically, or two or more modules may be integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The principle and the implementation of the present application are explained herein by applying specific examples, and the above description of the embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (8)

1. A calibration method of a proximity sensor is applied to electronic equipment, and is characterized in that the electronic equipment comprises the proximity sensor which is arranged below a screen and positioned in a screen display area, the proximity sensor comprises a signal transmitter and a signal receiver, and the calibration method of the proximity sensor comprises the following steps:
acquiring a first signal intensity value of the proximity sensor, wherein the first signal intensity value is the signal intensity value of the proximity sensor when the electronic equipment is not provided with a display screen;
acquiring a second signal intensity value of the proximity sensor, wherein the second signal intensity value is the signal intensity value of the proximity sensor after the electronic equipment is provided with a display screen;
calculating the difference value between the first signal strength value and the second signal strength value, and determining the difference value as a calibration value;
adding the calibration value to the signal strength value received by the signal receiver or adding the calibration value to the signal strength value sent by the signal transmitter.
2. The method of calibrating a proximity sensor of claim 1, wherein the step of obtaining a first signal strength value for the proximity sensor comprises:
acquiring a first signal intensity value of the proximity sensor for a preset number of times;
calculating an average value of the plurality of first signal strength values, and determining the average value as a target first signal strength value;
the step of obtaining a second signal strength value for the proximity sensor comprises:
acquiring a second signal intensity value of the proximity sensor for preset times;
and calculating the average value of the plurality of second signal strength values, and determining the average value as the target second signal strength value.
3. The method of calibrating a proximity sensor of claim 1, wherein after adding the calibration value to the signal strength value received by the signal receiver or adding the calibration value to the signal strength value sent by the signal transmitter, the method further comprises:
and performing screen-off control on the display screen of the electronic equipment according to the calibrated signal intensity value and the screen-off threshold value.
4. A calibration device of a proximity sensor is applied to an electronic device, and is characterized in that the electronic device comprises the proximity sensor which is arranged below a screen and positioned in a screen display area, the proximity sensor comprises a signal transmitter and a signal receiver, and the calibration device of the proximity sensor comprises: the device comprises a first acquisition module, a second acquisition module, a calculation module and a calibration module;
the first obtaining module is configured to obtain a first signal strength value of the proximity sensor, where the first signal strength value is the signal strength value of the proximity sensor when the electronic device is not equipped with a display screen;
the second obtaining module is configured to obtain a second signal intensity value of the proximity sensor, where the second signal intensity value is the signal intensity value of the proximity sensor after the electronic device is installed with the display screen;
the calculation module is used for calculating the difference value between the first signal strength value and the second signal strength value and determining the difference value as a calibration value;
the calibration module is configured to add the calibration value to the signal strength value received by the signal receiver, or add the calibration value to the signal strength value sent by the signal transmitter.
5. The calibration apparatus for a proximity sensor of claim 4, wherein the first acquisition module comprises: a first obtaining submodule and a first determining submodule;
the first obtaining submodule is used for obtaining a first signal intensity value of the proximity sensor for a preset number of times;
the first determining submodule is used for calculating an average value of a plurality of first signal strength values and determining the average value as a target first signal strength value;
the second acquisition module includes: a second obtaining submodule and a second determining submodule;
the second obtaining submodule is used for obtaining a second signal intensity value of the proximity sensor for preset times;
and the second determining submodule is used for calculating the average value of the plurality of second signal strength values and determining the average value as the target second signal strength value.
6. The calibration device for a proximity sensor of claim 4, wherein the device further comprises: a control module;
and the control module is used for carrying out screen-off control on the display screen of the electronic equipment according to the calibrated signal intensity value and the screen-off threshold value.
7. A storage medium having a computer program stored thereon, the computer program, when being executed by a processor, performing the steps of the method according to any of the claims 1-3.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method according to any of claims 1-3 are implemented when the processor executes the program.
CN201711176949.7A 2017-11-22 2017-11-22 Method and device for calibrating proximity sensor, storage medium and electronic equipment Active CN107942306B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711176949.7A CN107942306B (en) 2017-11-22 2017-11-22 Method and device for calibrating proximity sensor, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711176949.7A CN107942306B (en) 2017-11-22 2017-11-22 Method and device for calibrating proximity sensor, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN107942306A CN107942306A (en) 2018-04-20
CN107942306B true CN107942306B (en) 2020-04-10

Family

ID=61929893

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711176949.7A Active CN107942306B (en) 2017-11-22 2017-11-22 Method and device for calibrating proximity sensor, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN107942306B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108802153B (en) * 2018-04-24 2020-07-14 深圳市晓风建筑环境科技有限公司 Calibration method for period fading, electronic device and storage medium
CN108600546B (en) * 2018-04-28 2020-04-24 维沃移动通信有限公司 Environment light detection method and mobile terminal
CN109061662B (en) * 2018-07-02 2021-01-15 Oppo(重庆)智能科技有限公司 Infrared detection method and device, computer equipment and storage medium
CN109061611B (en) * 2018-09-12 2021-04-13 Oppo广东移动通信有限公司 Proximity sensor calibration method and related device
CN110275637B (en) * 2019-06-24 2023-03-24 Oppo广东移动通信有限公司 Method and device for calibrating proximity sensor, storage medium and electronic equipment
CN110286420B (en) * 2019-06-24 2022-03-18 Oppo广东移动通信有限公司 Method and device for calibrating proximity sensor, storage medium and electronic equipment
CN113671512B (en) * 2020-05-14 2024-01-30 北京小米移动软件有限公司 Proximity sensor angle adjustment method, device and storage medium
CN112104862B (en) * 2020-08-19 2023-09-01 惠州市德赛西威汽车电子股份有限公司 Vehicle-mounted multimedia proximity induction calibration method and system
CN112584268B (en) * 2020-12-10 2024-05-03 南京天易合芯电子有限公司 Earphone light sensation calibration device and method
CN113466841B (en) * 2021-07-16 2024-05-03 Oppo广东移动通信有限公司 Distance measuring method, device, electronic equipment and storage medium
CN114650493A (en) * 2022-03-24 2022-06-21 肇庆德庆冠旭电子有限公司 Bluetooth headset sensor calibration method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN107942306A (en) 2018-04-20

Similar Documents

Publication Publication Date Title
CN107943345B (en) Method and device for calibrating proximity sensor, storage medium and electronic equipment
CN107942306B (en) Method and device for calibrating proximity sensor, storage medium and electronic equipment
US11011131B2 (en) Off-screen control method determining signal intensity calibration value for filmed display screen
CN107966209B (en) Ambient light detection method, ambient light detection device, storage medium, and electronic apparatus
CN107436685B (en) Display device, self-luminous display panel and gesture recognition method
CN107800651B (en) Application program closing method and device, storage medium and electronic equipment
CN107277912B (en) Radio frequency interference processing method, device, storage medium and terminal
US11868604B2 (en) Display processing method and apparatus
CN106993227B (en) Method and device for information display
CN106850983B (en) screen-off control method and device, terminal and storage medium
US10657347B2 (en) Method for capturing fingerprint and associated products
CN109542279B (en) Terminal device control method and terminal device
CN107450029B (en) Battery state checking method and device, computer equipment and computer readable storage medium
KR20150122476A (en) Method and apparatus for controlling gesture sensor
US20150127278A1 (en) Method and device for ascertaining required charging time
CN110753155A (en) Proximity detection method and terminal equipment
CN111654902A (en) Method and device for reducing interference to mobile terminal GPS signal and mobile terminal
CN109639370B (en) Near field communication antenna detection method and device, mobile terminal and storage medium
CN108388400B (en) Operation processing method and mobile terminal
CN110851014B (en) Touch recognition method and device, storage medium and terminal equipment
CN110830658A (en) Mobile terminal control method and device, mobile terminal and storage medium
CN106940608B (en) Display screen control method, display screen and electronic equipment
CN113821142B (en) Interface window management method and related device
CN110913040A (en) Terminal equipment
CN110286420B (en) Method and device for calibrating proximity sensor, storage medium and electronic equipment

Legal Events

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