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

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

Info

Publication number
CN109738004B
CN109738004B CN201910068695.XA CN201910068695A CN109738004B CN 109738004 B CN109738004 B CN 109738004B CN 201910068695 A CN201910068695 A CN 201910068695A CN 109738004 B CN109738004 B CN 109738004B
Authority
CN
China
Prior art keywords
value
light intensity
display screen
touch display
proximity sensor
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
CN201910068695.XA
Other languages
Chinese (zh)
Other versions
CN109738004A (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 CN201910068695.XA priority Critical patent/CN109738004B/en
Publication of CN109738004A publication Critical patent/CN109738004A/en
Application granted granted Critical
Publication of CN109738004B publication Critical patent/CN109738004B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Position Input By Displaying (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The embodiment of the application provides a calibration method and device for a proximity sensor, an electronic device and a readable storage medium, wherein the method is applied to the electronic device with the proximity sensor and an ambient light sensor arranged below a touch display screen, and specifically comprises the following steps: when the electronic equipment is in a screen resting state, a light intensity value detected by the ambient light sensor is obtained, whether a shielding object exists above the touch display screen or not is determined according to the light intensity value, and when the shielding object does not exist, a proximity threshold value of the proximity sensor is calibrated. According to the embodiment of the application, in the breath screen state, whether a shielding object exists above the touch display screen can be judged by using the ambient light sensor, and under the condition that no shielding object exists above the touch display screen, accurate calibration of the proximity sensor is realized, and the problem of abnormal proximity function of the proximity sensor can be effectively solved.

Description

Method and device for calibrating proximity sensor, electronic equipment and storage medium
Technical Field
The present application relates to the field of electronic device technologies, and in particular, to a method and an apparatus for calibrating a proximity sensor, an electronic device, and a storage medium.
Background
With the screen occupation ratio of electronic equipment becoming higher and higher, a full screen era is coming, and with the development of a full screen technology, an approach scheme under a screen is bound to become a main reference scheme.
The under-screen proximity scheme still presents problems that need to be overcome, for example, proximity sensors within electronic devices present a proximity dysfunction.
Disclosure of Invention
The embodiment of the application provides a calibration triggering method and device of a proximity sensor, electronic equipment and a storage medium, which can solve the problem of proximity function abnormity of the proximity sensor in the prior art.
In a first aspect, an embodiment of the present application provides a method for calibrating a proximity sensor, where the method is applied to an electronic device, and a proximity sensor and an ambient light sensor are disposed below a touch display screen of the electronic device, and the method includes:
when the electronic equipment is in a screen-turning state, acquiring a light intensity value detected by the ambient light sensor;
determining whether a shelter exists above the touch display screen according to the light intensity value;
and when no shielding object exists above the touch display screen, calibrating the approach threshold value of the approach sensor.
In a second aspect, an embodiment of the present application further provides a calibration apparatus for a proximity sensor, where the apparatus is applied to an electronic device, a proximity sensor and an ambient light sensor are disposed below a touch display screen of the electronic device, and the apparatus includes:
the acquisition module is used for acquiring the light intensity value detected by the ambient light sensor when the electronic equipment is in a screen-turning state;
the determining module is used for determining whether a shelter exists above the touch display screen according to the light intensity value;
and the calibration module is used for calibrating the approach threshold value of the proximity sensor when no shielding object exists above the touch display screen.
In a third aspect, an embodiment of the present application further provides an electronic device, a proximity sensor disposed below a touch display screen, and an ambient light sensor, a memory, a processor, and a computer program stored in the memory and running on the processor, where the processor implements the steps in the calibration method for a proximity sensor according to the first aspect when executing the computer program.
In a fourth aspect, the present application further provides a readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps in the calibration method of the proximity sensor according to the first aspect.
The calibration method of the proximity sensor provided by the embodiment of the application is applied to an electronic device with the proximity sensor and an ambient light sensor arranged below a touch display screen, and comprises the following steps: when the electronic equipment is in a screen resting state, a light intensity value detected by the ambient light sensor is obtained, whether a shielding object exists above the touch display screen or not is determined according to the light intensity value, and when the shielding object does not exist, a proximity threshold value of the proximity sensor is calibrated. Under the state of the screen, the light intensity values in all the areas on the touch display screen, which are detected by the ambient light sensor, can be used for effectively judging whether a shelter exists above the touch display screen, so that whether the electronic equipment meets the calibration condition of the proximity sensor or not can be effectively determined. And under the condition that the electronic equipment is in a breath screen state and no shielding object is arranged above the touch display screen, the accurate calibration of the proximity sensor is realized, and the problem of abnormal proximity function of the proximity sensor can be effectively solved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a block diagram of an electronic device according to an embodiment of the present application;
FIG. 2 is a schematic flow chart illustrating a method for calibrating a proximity sensor according to an embodiment of the present disclosure;
FIG. 3 is a sub-flow diagram illustrating a method for calibrating a proximity sensor according to an embodiment of the present disclosure;
FIG. 4 is a schematic view of another sub-flow chart of a calibration method for a proximity sensor according to an embodiment of the present application;
FIG. 5 is a schematic view of another sub-flow chart of a calibration method for a proximity sensor according to an embodiment of the present application;
FIG. 6 is a schematic diagram of program modules of a calibration device for a proximity sensor according to an embodiment of the present application;
FIG. 7 is a block diagram of a subroutine of the calibration apparatus for a proximity sensor according to an embodiment of the present invention
FIG. 8 is a schematic diagram of another subroutine module of the calibration apparatus for a proximity sensor in the embodiment of the present application;
fig. 9 is a schematic diagram of another subroutine module of the calibration apparatus for a proximity sensor in the embodiment of the present application.
Detailed Description
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, and not all the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 shows a block diagram of an electronic device. The calibration method of the proximity sensor provided by the embodiment of the present application can be applied to the electronic device 10 shown in fig. 1, where the electronic device 10 may include, but is not limited to: the system is a smart phone, a tablet computer and the like which need to maintain normal operation by depending on a battery and support network and downloading functions.
As shown in fig. 1, the electronic device 10 includes a memory 101, a memory controller 102, one or more processors 103 (only one shown), a peripheral interface 104, a radio frequency module 105, a touch screen 106, a proximity sensor 107, and an ambient light sensor 108. These components communicate with each other via one or more communication buses/signal lines 109.
It is to be understood that the structure shown in fig. 1 is merely an illustration and is not intended to limit the structure of the electronic device. Electronic device 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
The memory 101 may be used to store software programs and modules, such as program instructions/modules corresponding to the calibration method and apparatus for a proximity sensor in the embodiment of the present application, and the processor 103 executes various functional applications and data processing by running the software programs and modules stored in the memory 101, so as to implement the calibration method and apparatus for a proximity sensor.
Memory 101 may include high speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 101 may further include memory located remotely from the processor 103, which may be connected to the electronic device 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. Access to the memory 101 by the processor 103 and possibly other components may be under the control of the memory controller 102.
The peripheral interface 104 couples various input/output devices to the CPU and to the memory 101. The processor 103 executes various software, instructions within the memory 101 to perform various functions of the electronic device 10 and to perform data processing.
In some embodiments, the peripheral interface 104, the processor 103, and the memory controller 102 may be implemented in a single chip. In other examples, they may be implemented separately from the individual chips.
The rf module 105 is used for receiving and transmitting electromagnetic waves, and implementing interconversion between the electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices. The rf module 105 may include various existing circuit elements for performing these functions, such as an antenna, an rf transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and so forth. The rf module 105 may communicate with various networks such as the internet, an intranet, a preset type of wireless network, or other devices through a preset type of wireless network. The preset types of wireless networks described above may include cellular telephone networks, wireless local area networks, or metropolitan area networks. The Wireless network of the above-mentioned preset type may use various Communication standards, protocols and technologies, including but not limited to Global System for Mobile Communication (GSM), Enhanced Data GSM Environment (EDGE), Wideband Code Division Multiple Access (W-CDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), bluetooth, Wireless Fidelity (WiFi) (e.g., IEEE802.11 a, IEEE802.11 b, IEEE802.1 g and/or IEEE802.11 n), Voice over Internet protocol (VoIP), world wide web for Wireless Access (Wi-Max), other protocols for email, instant messaging, and short messaging, and any other suitable messaging protocol.
The touch screen 106 provides both an output and an input interface between the electronic device and the user. In particular, the touch screen 106 displays video output to the user, the content of which may include text, graphics, video, and any combination thereof. Some of the output results are for some of the user interface objects. The touch screen 106 also receives user inputs, such as user clicks, swipes, and other gesture operations, so that the user interface objects respond to these user inputs. The technique of detecting user input may be based on resistive, capacitive, or any other possible touch detection technique. Specific examples of touch screen 106 display units include, but are not limited to, liquid crystal displays or light emitting polymer displays.
The proximity sensor 107 and the ambient light sensor 108 are disposed below the touch screen 106 of the electronic device 10, wherein the proximity sensor 107 is a device capable of sensing the proximity of an object, and recognizes the proximity of the object by using the sensitivity of the displacement sensor to the approaching object, and outputs a corresponding proximity value, such as an infrared proximity sensor. The ambient light sensor 108 may sense ambient light conditions and output a light intensity value.
A method of calibrating a proximity sensor in the embodiment of the present application is described based on the electronic apparatus 10 described above.
Referring to fig. 2, fig. 2 is a schematic flowchart illustrating a calibration method of a proximity sensor according to an embodiment of the present disclosure, in which the calibration method of the proximity sensor includes:
step 201, when the electronic device is in a screen-turning state, obtaining a light intensity value detected by the ambient light sensor.
The proximity sensor can be a plurality of different types of proximity sensors, and a common proximity sensor can be an infrared proximity sensor, taking the infrared proximity sensor as an example, the infrared proximity sensor can emit infrared rays to the touch screen, and then measure the intensity of the infrared rays reflected by the object to determine the distance between the object and the infrared proximity sensor, and the stronger the received infrared ray intensity, the smaller the distance between the object and the infrared proximity sensor is. The infrared proximity sensor converts the measured infrared intensity into a measurement value in a proportional relationship with the infrared intensity, the measurement value can be called a proximity value, and the larger the proximity value obtained by the infrared proximity sensor, the smaller the distance between the infrared proximity sensor and the object.
In general, the proximity value measured by the proximity sensor may determine whether the proximity sensor is in a proximity state or a distant state with respect to the object, and the determination of the state is based on a proximity threshold value, and when the proximity value is greater than the proximity threshold value, the proximity sensor may determine that the proximity sensor is in a proximity state with respect to the object, and when the proximity value is less than the proximity threshold value, the proximity sensor may determine that the proximity sensor is in a distant state with respect to the object.
When the proximity sensor is arranged below a touch screen of the mobile terminal, a background noise value is generated, wherein the background noise value is a signal value which is obtained by light diffracting inside the mobile terminal and being detected by the proximity sensor when no object exists above the touch screen, and is called the background noise value of the proximity sensor.
At present, after two sides of a screen of an electronic device are pressed or the electronic device falls down, the position of a proximity sensor under the screen may change, so that a background noise value of the proximity sensor changes, and a proximity function is abnormal, and therefore, a proximity threshold value of the proximity sensor needs to be calibrated.
If the proximity sensor needs to be calibrated, the calibration needs to be performed under the condition that the touch screen is in a screen resting state and no shielding object is arranged above the touch screen. The touch screen flickering phenomenon can occur when the proximity sensor is started in a bright screen state, the screen flickering can affect the brightness of the touch screen, and the change of the brightness can affect the proximity value acquired by the proximity sensor, so that the calibration error is caused. There is no obstruction above the touch screen, because the variation of the background noise value causes the proximity function abnormality of the proximity sensor, and therefore, if the proximity threshold value needs to be calibrated, the real background noise value needs to be measured.
The method includes the steps that a calibration period can be preset in the electronic device, namely whether the proximity sensor needs to be calibrated or not is judged at intervals, and if the proximity sensor needs to be calibrated, the light intensity value above the touch display screen is detected through the ambient light sensor.
Step 202, determining whether a barrier exists above the touch display screen according to the light intensity value.
It can be understood that, when the electronic device is in the state of the information screen and no shielding object exists above the electronic device, under natural light, the light intensity received by the ambient light sensor is stronger, or the light intensity of each area above the touch display screen is more uniform; if the electronic device is in the breath screen state and a shielding object is arranged above the electronic device, the intensity of light received by the ambient light sensor is different from that of light received by the ambient light sensor or the intensity of light received by each area above the touch display screen. Therefore, in this embodiment, after the light intensity value detected by the ambient light sensor is obtained, whether a blocking object exists above the touch display screen can be determined according to the light intensity value.
And 203, calibrating the proximity threshold value of the proximity sensor when no shielding object exists above the touch display screen.
In this embodiment, when it is determined that there is no blocking object above the touch display screen, that is, the proximity sensor satisfies the calibration condition, the proximity threshold value of the proximity sensor may be calibrated at this time; when the fact that the shielding object exists above the touch display screen is determined, that is, the proximity sensor does not meet the calibration condition is indicated, the proximity threshold value of the proximity sensor is not calibrated temporarily, the preset time duration can be waited, or when the next calibration period comes, whether the shielding object exists above the touch display screen is determined again, if the shielding object does not exist, the proximity threshold value of the proximity sensor is calibrated, if the shielding object exists, the preset time duration is waited again, or the next calibration period is waited, and the like.
According to the calibration method of the proximity sensor, which is provided by the embodiment of the application, the method is applied to the electronic equipment with the proximity sensor and the ambient light sensor arranged below the touch display screen, and in the state of the information screen, whether a shelter exists above the touch display screen can be effectively judged by using the light intensity value detected by the ambient light sensor, so that whether the electronic equipment meets the calibration condition of the proximity sensor or not can be effectively determined. And under the condition that the electronic equipment is in a breath screen state and no shielding object is arranged above the touch display screen, the accurate calibration of the proximity sensor is realized, and the problem of abnormal proximity function of the proximity sensor can be effectively solved.
Based on the above embodiments, the embodiments of the present application provide the following ways to determine whether there is a blocking object above the touch display screen according to the light intensity values in the respective areas.
Specifically, referring to fig. 3, fig. 3 is a schematic sub-flow chart of a calibration method of a proximity sensor in the embodiment of the present application, determining whether a blocking object exists above a touch display screen according to the light intensity value in step 202 specifically includes:
step 301, calculating a first average value by using the light intensity values in each region divided by the touch display screen, and obtaining a second average value of the proximity sensor in a preset time period.
In this embodiment, in order to determine whether the proximity threshold of the proximity sensor needs to be calibrated when the electronic device is in the screen-off state, the touch display screen of the electronic device may be first divided into a plurality of regions, an ambient light sensor is disposed in each region, and then the light intensity values in the regions are respectively detected by the ambient light sensors.
Specifically, the light intensity values detected by the ambient light sensor in each of the divided areas of the touch display screen may be obtained within the same time period (e.g., 1 second), and the proximity value of the proximity sensor may be obtained once at preset time intervals (e.g., 0.1 second), and then the first average value of the light intensity values in each of the divided areas may be calculated, and the second average value of the proximity sensor in the time period may be calculated.
And step 302, determining whether an obstruction exists above the touch display screen according to the first average value and the second average value.
It can be understood that, when the electronic device is in the state of the information screen and no shielding object exists above the electronic device, under natural light, the light intensity received by each region divided by the touch display screen is the same, that is, the light intensity values in each region are consistent; if the electronic device is in a screen-saving state and a shielding object is arranged above the electronic device, the light intensity received by each region divided by the touch display screen is different, or the light intensity value in each region is obviously different from that of the ambient light. Therefore, in this embodiment, after the obtained light intensity values in the respective areas of the touch display screen, whether a blocking object exists above the touch display screen can be determined according to the light intensity values in the respective areas.
Specifically, determining an upper limit value of the background noise by using a first average value; when the first average value is greater than or equal to the preset light intensity threshold value, the upper limit value of the background noise is a first upper limit value, and when the first average value is smaller than the light intensity threshold value, the upper limit value of the background noise is a second upper limit value, wherein the first upper limit value is greater than the second upper limit value.
It will be appreciated that the proximity sensor outputs a proximity value that is influenced by ambient light, and that the proximity sensor outputs a proximity value that is greater when the ambient light has a greater light intensity value.
In this embodiment, when the first average value is greater than or equal to the preset light intensity threshold, the upper noise floor is set to a larger value, for example, determined as the first upper threshold; and when the first average value is smaller than the light intensity threshold value, setting the upper limit value of the background noise to a smaller value, if the upper limit value is determined to be a second upper limit value, wherein the first upper limit value is larger than the second upper limit value.
When determining whether a shielding object exists above the touch display screen, if the second average value is greater than or equal to the upper limit value of the background noise, determining that the shielding object exists above the touch display screen; and if the second average value is smaller than the upper limit value of the background noise, determining that no shielding object exists above the touch display screen.
The calibration method for the proximity sensor provided by the embodiment of the application provides a way for determining whether a barrier exists above the touch display screen, and specifically includes: calculating a first average value by using the light intensity values in each region divided by the touch display screen, and acquiring a second average value of the proximity sensor in a preset time period; according to the first average value and the second average value, whether a blocking object exists above the touch display screen is determined, that is, whether the blocking object exists above the touch display screen can be determined according to the average light intensity value in each area of the touch display screen and the approximate average value of the proximity sensor in the preset time period.
Further, referring to fig. 4, fig. 4 is another sub-flow diagram of the calibration method of the proximity sensor in the embodiment of the present application, the determining whether there is a blocking object above the touch display screen according to the light intensity value in step 202 specifically includes:
step 401, selecting a maximum light intensity value and a minimum light intensity value from the light intensity values in each region divided by the touch display screen.
It can be understood that when the volume of the blocking object is small, or the blocking area of the blocking object above the touch display screen is small, only the light intensity value in a partial area of the touch display screen is affected, that is, there may be a blocked area and an unblocked area above the touch display screen at the same time, and since there is a significant difference between the light intensity values in the blocked area and the unblocked area, the maximum light intensity value and the minimum light intensity value can be selected from the light intensity values in each area to determine whether the blocking object exists above the touch display screen.
Step 402, when the difference between the maximum light intensity value and the minimum light intensity value is greater than or equal to a preset first threshold value, determining that a barrier exists above the touch display screen.
It can be understood that, when a shielding object exists above the touch display screen and only a partial region of the touch display screen is shielded by the shielding object, the light intensity values in the shielded region and the non-shielded region are obviously different, that is, the light intensity value of the shielded region is obviously smaller than the light intensity value in the non-shielded region.
Therefore, the embodiment can determine that the obstruction exists above the touch display screen when the difference between the maximum light intensity value and the minimum light intensity value is greater than or equal to the preset first threshold. Wherein, the preset first preset can be obtained by a plurality of tests.
And step 403, when the difference between the maximum light intensity value and the minimum light intensity value is smaller than a preset first threshold, determining that no blocking object exists above the touch display screen.
When no shielding object exists above the touch display screen, the light intensity values in the regions are substantially consistent, that is, the maximum light intensity value and the minimum light intensity value in the light intensity values in the regions are the same or have a small difference.
Therefore, the embodiment can determine that no blocking object exists above the touch display screen when the difference between the maximum light intensity value and the minimum light intensity value is smaller than the preset first threshold.
The calibration method for the proximity sensor provided by the embodiment of the application provides another way for determining whether a barrier exists above the touch display screen, and specifically includes: selecting a maximum light intensity value and a minimum light intensity value from the light intensity values in all areas of the touch display screen; when the difference between the maximum light intensity value and the minimum light intensity value is larger than or equal to a preset first threshold value, determining that a shielding object exists above the touch display screen; when the difference between the maximum light intensity value and the minimum light intensity value is smaller than a preset first threshold, it is determined that no blocking object exists above the touch display screen, that is, in this embodiment, it may be determined whether a blocking object exists above the touch display screen through the difference between the maximum light intensity value and the minimum light intensity value in the light intensity values in each region of the touch display screen.
Further, referring to fig. 5, fig. 5 is a schematic sub-flow chart of a calibration method of a proximity sensor in the embodiment of the present application, the determining whether there is a blocking object above the touch display screen according to the light intensity values in the respective areas in the step 202 specifically includes:
and step 501, calculating the variance value of the light intensity by using the light intensity values in the regions.
It can be understood that when the volume of the blocking object is small, or the blocking area of the blocking object above the touch display screen is small, only the light intensity value in a partial area of the touch display screen is affected, that is, there may be a blocked area and an unblocked area above the touch display screen at the same time, and since there may be a significant difference between the light intensity values in the blocked area and the unblocked area, it may be determined whether the blocking object exists above the touch display screen by calculating the variance value of the light intensity values in each area.
Step 502, when the variance value is greater than or equal to a preset second threshold value, determining that a barrier exists above the touch display screen.
It can be understood that, when there is a shielding object above the touch display screen, and the shielding object only shields a partial region of the touch display screen, the light intensity values in the shielded region and the non-shielded region are obviously different, that is, there is an obvious change or difference between the light intensity values in the respective regions of the touch display screen.
Therefore, in this embodiment, when the variance value is greater than or equal to the preset second threshold, it may be determined that a blocking object exists above the touch display screen. Wherein the preset second preset may be obtained by a plurality of tests.
Step 503, when the variance value is smaller than a preset second threshold, determining that no blocking object exists above the touch display screen.
When no shielding object exists above the touch display screen, the light intensity in each area is basically consistent, that is, the difference between the light intensity values in each area is small.
Therefore, in this embodiment, when the variance value is smaller than the preset second threshold, it may be determined that no blocking object exists above the touch display screen.
The calibration method for the proximity sensor provided by the embodiment of the application further provides a method for determining whether a shielding object exists above the touch display screen, and the method specifically comprises the following steps: calculating the variance value of the light intensity by using the light intensity values in the regions; when the variance value is larger than or equal to a preset second threshold value, determining that a shelter exists above the touch display screen; when the variance value is smaller than a preset second threshold value, it is determined that no shielding object exists above the touch display screen, that is, in the embodiment, whether a shielding object exists above the touch display screen can be determined by the variance value of the light intensity values in each region of the touch display screen.
It should be noted that, in the present application, whether a blocking object exists above the touch display screen may be determined in any one of the above three manners. In addition, in order to improve the accuracy of the determination, a combined determination method, that is, any two or more of the above three methods may be used to determine whether or not a blocking object is present above the touch display screen.
In addition, whether a shielding object exists above the touch display screen can be determined in other manners, for example, whether the shielding object exists above the touch display screen is determined by transmitting ultrasonic waves to the upper side of the touch display screen through an ultrasonic wave sensor preset in the electronic device or transmitting millimeter waves to the upper side of the touch display screen through a millimeter wave sensor preset in the electronic device.
That is, in the embodiment of the present application, the determination method for determining whether a blocking object exists above the touch display screen is very flexible, and any determination method capable of determining whether a blocking object exists above the touch display screen can be applied to the present application.
Further, based on the foregoing embodiment, in this embodiment of the application, the calibrating the approach threshold value of the approach sensor in step 203 specifically includes:
the method comprises the steps of firstly, searching a corresponding relation between a preset light intensity value and a preset correction value by using a first average value, correcting a second average value by using the correction value which has the corresponding relation with the first average value, and taking the corrected value as a background noise value, wherein the first average value is an average value of the light intensity values in all areas, and the second average value is an average value of approximate values in a preset time period.
In this embodiment, the correspondence between the light intensity value and the correction value is determined and stored in advance through a plurality of experiments. When the proximity sensor needs to be calibrated, the correction value corresponding to the average value of the light intensity values in each area of the touch display screen is searched in the corresponding relation between the prestored light intensity value and the preset correction value, then the average value of the proximity value in the preset time period is corrected by using the correction value, and the corrected value is used as a new background noise value of the proximity sensor.
And secondly, calibrating the approach threshold value of the proximity sensor according to the background noise value.
After obtaining a new bottom noise value of the proximity sensor, the method can calibrate the proximity threshold value of the proximity sensor by using the bottom noise value. Specifically, obtain proximity sensor's the setting parameter that dispatches from the factory, this setting parameter that dispatches from the factory includes: an initial background noise value and an initial approach threshold value. And then determining an increase value or a decrease value of the background noise value relative to the initial background noise value, and calibrating the initial approach threshold value according to the increase value or the decrease value to obtain a calibrated approach threshold value.
After determining an increase value of the background noise value relative to the initial background noise value, calculating a sum of the initial approach threshold value and the increase value, and taking the calculated sum as a calibrated approach threshold value; or after determining a reduction in the background noise value relative to the initial background noise value, a difference between the initial approach threshold value and the reduction may be calculated, and the calculated difference may be used as the calibrated approach threshold value.
The calibration method of the proximity sensor provided by the embodiment of the application comprises the following steps: searching a corresponding relation between a preset light intensity value and a preset correction value by using a first average value, correcting a second average value by using the correction value having the corresponding relation with the first average value, and taking the corrected value as a background noise value, wherein the first average value is an average value of the light intensity values in each area of the touch display screen, and the second average value is an average value of approximate values in a preset time period; and then calibrating the approach threshold value of the proximity sensor according to the background noise value. This application can realize the accurate calibration to proximity sensor under the condition that electronic equipment is in the screen state of breathing out and touch display screen top does not have the shelter promptly, can effectively solve proximity sensor's the unusual problem of function.
Further, an embodiment of the present invention further provides a calibration apparatus 200 for a proximity sensor, referring to fig. 6, fig. 6 is a schematic diagram of program modules of the calibration apparatus for a proximity sensor in the embodiment of the present invention, in which the calibration apparatus 200 for a proximity sensor includes:
the obtaining module 601 is configured to obtain a light intensity value detected by the ambient light sensor when the electronic device is in a screen-turning state.
The determining module 602 is configured to determine whether there is a blocking object above the touch display screen according to the light intensity value.
The calibration module 603 is configured to calibrate the proximity threshold of the proximity sensor when no obstruction exists above the touch screen.
The calibration device 200 for the proximity sensor provided by the embodiment of the application is applied to the electronic device provided with the proximity sensor and the ambient light sensor below the touch display screen, and can realize that: under the screen state of breathing out, through utilizing the light intensity value that ambient light sensor detected, whether the top that can effectual judgement touch display screen exists the shelter for whether can effectual definite electronic equipment satisfies the calibration condition to proximity sensor. And under the condition that the electronic equipment is in a breath screen state and no shielding object is arranged above the touch display screen, the accurate calibration of the proximity sensor is realized, and the problem of abnormal proximity function of the proximity sensor can be effectively solved.
Specifically, referring to fig. 7, fig. 7 is a schematic diagram of a subroutine module of a calibration apparatus of a proximity sensor in the embodiment of the present application, in which the determining module 602 specifically includes:
the first calculating module 701 is configured to calculate a first average value by using the light intensity values in each region divided by the touch display screen, and obtain a second average value of the proximity values of the proximity sensor in a preset time period.
A first determining module 702, configured to determine whether there is an obstruction above the touch display screen according to the first average value and the second average value.
The calibration device 200 for the proximity sensor provided by the embodiment of the application can realize that: calculating a first average value by using the light intensity values in each region divided by the touch display screen, and acquiring a second average value of the proximity sensor in a preset time period; according to the first average value and the second average value, whether a blocking object exists above the touch display screen is determined, that is, whether the blocking object exists above the touch display screen can be determined according to the average light intensity value in each area of the touch display screen and the approximate average value of the proximity sensor in the preset time period.
Further, referring to fig. 8, fig. 8 is a schematic diagram of another subroutine module of the calibration apparatus for a proximity sensor in the embodiment of the present application, in which the determining module 602 specifically includes:
the selecting module 801 is configured to select a maximum light intensity value and a minimum light intensity value from the light intensity values in the respective regions.
The second determining module 802 is configured to determine that a blocking object exists above the touch display screen when a difference between the maximum light intensity value and the minimum light intensity value is greater than or equal to a preset first threshold.
The third determining module 803 is configured to determine that no blocking object exists above the touch display screen when a difference between the maximum light intensity value and the minimum light intensity value is smaller than a preset first threshold.
The calibration device 200 for the proximity sensor provided by the embodiment of the application can realize that: selecting a maximum light intensity value and a minimum light intensity value from the light intensity values in all areas of the touch display screen; when the difference between the maximum light intensity value and the minimum light intensity value is larger than or equal to a preset first threshold value, determining that a shielding object exists above the touch display screen; when the difference between the maximum light intensity value and the minimum light intensity value is smaller than a preset first threshold, it is determined that no blocking object exists above the touch display screen, that is, in this embodiment, it may be determined whether a blocking object exists above the touch display screen through the difference between the maximum light intensity value and the minimum light intensity value in the light intensity values in each region of the touch display screen.
Further, referring to fig. 9, fig. 9 is a schematic diagram of another subroutine module of the calibration apparatus for a proximity sensor in the embodiment of the present application, in which the determining module 602 specifically includes:
the second calculating module 901 is configured to calculate a variance value of the light intensity by using the light intensity values in the respective regions.
A fourth determining module 902, configured to determine that a blocking object exists above the touch display screen when the variance value is greater than or equal to a preset second threshold.
A fifth determining module 903, configured to determine that there is no blocking object above the touch display screen when the variance value is smaller than a preset second threshold.
The calibration device 200 for the proximity sensor provided by the embodiment of the application can realize that: calculating the variance value of the light intensity by using the light intensity values in the regions; when the variance value is larger than or equal to a preset second threshold value, determining that a shelter exists above the touch display screen; when the variance value is smaller than a preset second threshold value, it is determined that no shielding object exists above the touch display screen, that is, in the embodiment, whether a shielding object exists above the touch display screen can be determined by the variance value of the light intensity values in each region of the touch display screen.
Further, the present application also 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 steps of the embodiments provided in the calibration method for a proximity sensor.
Further, the present application also provides a storage medium having a computer program stored thereon, which when executed by a processor implements the steps of the embodiments provided in the calibration method of a proximity sensor described above.
Each functional module in the embodiments of the present invention may be integrated into one processing module, or each module may exist alone physically, or two or more modules are 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 integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be noted that, for the sake of simplicity, the above-mentioned method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present invention is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no acts or modules are necessarily required of the invention.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In view of the above description of the calibration method and apparatus for a proximity sensor, the electronic device and the readable storage medium provided by the present invention, those skilled in the art will recognize that changes may be made in the embodiments and applications of the invention in light of the above description, and therefore the disclosure should not be construed as limiting the invention.

Claims (8)

1. A calibration method of a proximity sensor is applied to an electronic device, wherein the proximity sensor and an ambient light sensor are arranged below a touch display screen of the electronic device, and the method comprises the following steps:
when the electronic equipment is in a screen-turning state, acquiring a light intensity value detected by the ambient light sensor;
calculating a first average value by using the light intensity values in each area divided by the touch display screen, and acquiring a second average value of the proximity sensor in a preset time period; determining whether a blocking object exists above the touch display screen according to the first average value and the second average value;
when no blocking object exists above the touch display screen, searching a corresponding relation between a preset light intensity value and a preset correction value by using a first average value, correcting a second average value by using the correction value which has the corresponding relation with the first average value, and taking the corrected value as a background noise value, wherein the first average value is an average value of the light intensity values in each area, and the second average value is an average value of approximate values in a preset time period; and calibrating the approach threshold value of the proximity sensor according to the bottom noise value.
2. The method of claim 1, wherein determining whether an obstruction is present above the touch display screen based on the first average and the second average comprises:
determining an upper limit value of the background noise by using the first average value; when the first average value is greater than or equal to a preset light intensity threshold value, the upper limit value of the background noise is a first upper limit value, and when the first average value is smaller than the light intensity threshold value, the upper limit value of the background noise is a second upper limit value, and the first upper limit value is greater than the second upper limit value;
when the second average value is larger than or equal to the upper limit value of the background noise, determining that a shelter exists above the touch display screen;
and when the second average value is smaller than the upper limit value of the background noise, determining that no shielding object exists above the touch display screen.
3. The method of claim 1, wherein determining whether an obstruction exists above the touch display screen based on the light intensity values in the respective regions comprises:
selecting a maximum light intensity value and a minimum light intensity value from the light intensity values in each region;
when the difference between the maximum light intensity value and the minimum light intensity value is larger than or equal to a preset first threshold value, determining that a barrier exists above the touch display screen;
and when the difference between the maximum light intensity value and the minimum light intensity value is smaller than a preset first threshold value, determining that no blocking object exists above the touch display screen.
4. The method of claim 1, wherein determining whether an obstruction exists above the touch display screen based on the light intensity values in the respective regions comprises:
calculating the variance value of the light intensity by using the light intensity values in the regions;
when the variance value is larger than or equal to a preset second threshold value, determining that a shelter exists above the touch display screen;
and when the variance value is smaller than a preset second threshold value, determining that no shielding object exists above the touch display screen.
5. The method of claim 1, wherein calibrating the proximity sensor proximity threshold value based on the noise floor comprises:
acquiring factory setting parameters of the proximity sensor, wherein the factory setting parameters comprise: an initial background noise value and an initial approach threshold value;
and determining an increase value or a decrease value of the background noise value relative to the initial background noise value, and calibrating the initial approach threshold value according to the increase value or the decrease value to obtain a calibrated approach threshold value.
6. A calibration device of a proximity sensor is applied to an electronic device, wherein the proximity sensor and an ambient light sensor are arranged below a touch display screen of the electronic device, and the calibration device comprises:
the acquisition module is used for acquiring the light intensity value detected by the ambient light sensor when the electronic equipment is in a screen-turning state;
the determining module is used for calculating a first average value by using the light intensity values in each area divided by the touch display screen and acquiring a second average value of the proximity sensor in a preset time period; determining whether a blocking object exists above the touch display screen according to the first average value and the second average value;
the calibration module is used for searching a corresponding relation between a preset light intensity value and a preset correction value by using a first average value when no shielding object exists above the touch display screen, correcting a second average value by using the correction value which has the corresponding relation with the first average value, and taking the corrected value as a background noise value, wherein the first average value is an average value of the light intensity values in all the areas, and the second average value is an average value of approximate values in a preset time period; and calibrating the approach threshold value of the proximity sensor according to the bottom noise value.
7. An electronic device comprising a proximity sensor arranged below a touch display screen, as well as an ambient light sensor, a memory, a processor and a computer program stored on the memory and running on the processor, characterized in that the processor, when executing the computer program, carries out the steps of the method of calibrating a proximity sensor according to any of claims 1 to 5.
8. A storage medium having stored thereon a computer program for implementing the steps of the method of calibrating a proximity sensor according to any of claims 1 to 5 when executed by a processor.
CN201910068695.XA 2019-01-24 2019-01-24 Method and device for calibrating proximity sensor, electronic equipment and storage medium Active CN109738004B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910068695.XA CN109738004B (en) 2019-01-24 2019-01-24 Method and device for calibrating proximity sensor, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910068695.XA CN109738004B (en) 2019-01-24 2019-01-24 Method and device for calibrating proximity sensor, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109738004A CN109738004A (en) 2019-05-10
CN109738004B true CN109738004B (en) 2021-02-26

Family

ID=66366007

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910068695.XA Active CN109738004B (en) 2019-01-24 2019-01-24 Method and device for calibrating proximity sensor, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109738004B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110471068B (en) * 2019-07-23 2021-09-14 维沃移动通信有限公司 Proximity detection method and mobile terminal
CN110609977B (en) * 2019-08-06 2023-08-11 深圳市万普拉斯科技有限公司 Bottom noise adjusting and processing method and device based on proximity sensor and computer equipment
CN113267785B (en) * 2020-02-17 2023-10-13 北京小米移动软件有限公司 Distance detection method and device and electronic equipment
CN111366939B (en) * 2020-02-20 2022-07-15 Oppo(重庆)智能科技有限公司 Calibration method and device of distance sensor, terminal and storage medium
CN113447064A (en) * 2021-06-30 2021-09-28 东莞市小精灵教育软件有限公司 Calibration method and electronic equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4254331A (en) * 1979-01-26 1981-03-03 Mechanical Technology Incorporated Calibration circuit for fiber optic proximity instrument
US5300787A (en) * 1992-02-11 1994-04-05 Bst Servo-Technik Gmbh Method for setting a sensor which detects the edge of a moving web of material in a contact-free manner
US7623230B2 (en) * 2007-10-23 2009-11-24 Nokia Corporation Optical sensor calibration
CN102319056A (en) * 2011-07-22 2012-01-18 深圳市理邦精密仪器股份有限公司 Automatic calibration method and device for printing of patient monitor
CN102440063A (en) * 2008-12-29 2012-05-02 摩托罗拉移动公司 Portable electronic device having self-calibrating proximity sensors
CN103353621A (en) * 2013-06-14 2013-10-16 广东欧珀移动通信有限公司 Method for calibrating proximity sensor of mobile terminal, and mobile terminal
CN103685661A (en) * 2013-12-20 2014-03-26 上海斐讯数据通信技术有限公司 Automatic calibration system and automatic calibration method for range sensor in mobile terminal product production line
CN104407399A (en) * 2014-12-02 2015-03-11 三星半导体(中国)研究开发有限公司 Method for calibrating proximity sensor in portable terminal
CN106210227A (en) * 2016-07-06 2016-12-07 广东欧珀移动通信有限公司 The calibration steps of a kind of infrared proximity transducer, device and mobile terminal
CN109101099A (en) * 2018-07-17 2018-12-28 Oppo广东移动通信有限公司 Prevent method, storage medium and the electronic equipment of proximity state exception

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4254331A (en) * 1979-01-26 1981-03-03 Mechanical Technology Incorporated Calibration circuit for fiber optic proximity instrument
US5300787A (en) * 1992-02-11 1994-04-05 Bst Servo-Technik Gmbh Method for setting a sensor which detects the edge of a moving web of material in a contact-free manner
US7623230B2 (en) * 2007-10-23 2009-11-24 Nokia Corporation Optical sensor calibration
CN102440063A (en) * 2008-12-29 2012-05-02 摩托罗拉移动公司 Portable electronic device having self-calibrating proximity sensors
CN102319056A (en) * 2011-07-22 2012-01-18 深圳市理邦精密仪器股份有限公司 Automatic calibration method and device for printing of patient monitor
CN103353621A (en) * 2013-06-14 2013-10-16 广东欧珀移动通信有限公司 Method for calibrating proximity sensor of mobile terminal, and mobile terminal
CN103685661A (en) * 2013-12-20 2014-03-26 上海斐讯数据通信技术有限公司 Automatic calibration system and automatic calibration method for range sensor in mobile terminal product production line
CN104407399A (en) * 2014-12-02 2015-03-11 三星半导体(中国)研究开发有限公司 Method for calibrating proximity sensor in portable terminal
CN106210227A (en) * 2016-07-06 2016-12-07 广东欧珀移动通信有限公司 The calibration steps of a kind of infrared proximity transducer, device and mobile terminal
CN109101099A (en) * 2018-07-17 2018-12-28 Oppo广东移动通信有限公司 Prevent method, storage medium and the electronic equipment of proximity state exception

Also Published As

Publication number Publication date
CN109738004A (en) 2019-05-10

Similar Documents

Publication Publication Date Title
CN109738004B (en) Method and device for calibrating proximity sensor, electronic equipment and storage medium
CN109840032B (en) Method and device for calibrating proximity sensor, electronic equipment and storage medium
US10657241B2 (en) Mobile authentication using a wearable device
CN105900498B (en) Antenna coupling for sensing and dynamic transmission
US8416216B2 (en) Method and system for touch sensor interface fault detection
KR102411755B1 (en) Proximity sensor with nonlinear filter and method
KR101952798B1 (en) Detection distance calibration method, apparatus, and device
CN108279408B (en) Proximity sensor calibration method and device, mobile terminal and computer readable medium
US8780828B2 (en) Cognitive radio device and method for determining channel occupancy
CN105866781B (en) Data processing method and electronic equipment
KR20170036750A (en) Body presence sensor calibration
CN108759892B (en) Sensor calibration method, electronic device and computer-readable storage medium
CN106131334B (en) Method and device for controlling screen state of mobile terminal
CN105571722A (en) Temperature measuring method and terminal
CN106101402B (en) Method and system for adjusting sensing threshold of proximity sensor
CN106768311A (en) A kind of environment light detection method, device and terminal
CN108801321B (en) Sensor calibration method, electronic device and computer-readable storage medium
US20210330210A1 (en) Pulse measurement apparatus, a method therefor, and a vehicle system therefor
CN113411448B (en) Infrared signal processing method and device, electronic equipment and readable storage medium
KR101244274B1 (en) Display devices of radio field intensity for mobile phone and method of the same as
CN106341547B (en) Display method and device of radio frequency point of mobile terminal and radio frequency communication system
KR100886679B1 (en) Data processing system and method in wireless broadband internet
CN103941921A (en) Processing device of optical touch system and operation method thereof
CN115343769A (en) Liquid detection method and device and liquid detection equipment
CN115580373A (en) Interference processing method 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