CN109724640A - Proximity sensor calibration method, electronic device and computer readable storage medium - Google Patents

Proximity sensor calibration method, electronic device and computer readable storage medium Download PDF

Info

Publication number
CN109724640A
CN109724640A CN201910029135.3A CN201910029135A CN109724640A CN 109724640 A CN109724640 A CN 109724640A CN 201910029135 A CN201910029135 A CN 201910029135A CN 109724640 A CN109724640 A CN 109724640A
Authority
CN
China
Prior art keywords
proximity sensor
value
calibration
multiple continuous
reference value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910029135.3A
Other languages
Chinese (zh)
Other versions
CN109724640B (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 CN201910029135.3A priority Critical patent/CN109724640B/en
Publication of CN109724640A publication Critical patent/CN109724640A/en
Application granted granted Critical
Publication of CN109724640B publication Critical patent/CN109724640B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The embodiment of the present application provides a kind of proximity sensor calibration method, electronic device and computer readable storage medium, it is related to technical field of mobile terminals, wherein method includes: when the infrared lamp of proximity sensor is closed, obtain multiple continuous proximity sensor values, according to multiple continuous proximity sensor value, calculate the calibration reference value of the proximity sensor, if the calibration reference value is greater than the first numerical value, then confirm whether the calibration reference value and multiple continuous proximity sensor value meet calibration trigger condition, if meeting the calibration trigger condition, the proximity sensor is then improved into second value close to threshold value.The accuracy of proximity sensor induction can be improved in the application.

Description

Proximity sensor calibration method, electronic device and computer readable storage medium
Technical field
This application involves technical field of mobile terminals more particularly to a kind of proximity sensor calibration method, electronic device and Computer readable storage medium.
Background technique
Proximity sensor (PS, Proximity sensor) carries out distance by the way of transmitting and reception infrared light and sentences It is disconnected, according to judged by the variation of the reflected infrared energy of shelter shelter closer and farther from.But it is easy by too Infrared jamming in sunlight and indoor various lamp sources, causes the numerical value of proximity sensor to be beated, there are erroneous judgement risks.
In the prior art, general on chip for cell phone that the infrared mechanism filtered out of environment is all set, but such filter out mechanism Only Infrared jamming stable in environment can be accomplished to filter out, it is infrared to filter out if the infrared light in environment is changing, it fails, So that proximity sensor measurement causes mobile phone to be lighted extremely, extinguishes and form splashette closer and farther from state inaccuracy.
Summary of the invention
The embodiment of the present application provides a kind of proximity sensor calibration method, electronic device and computer readable storage medium, The proximity sensor numerical value that can be obtained by obtaining proximity sensor when infrared lamp is closed, calibrates proximity sensor, Solve the problem of proximity sensor detection leads to electronic device splashette closer and farther from inaccuracy.
On the one hand the embodiment of the present application provides a kind of proximity sensor calibration method, comprising:
When the infrared lamp of proximity sensor is closed, multiple continuous proximity sensor values are obtained;
According to the multiple continuous proximity sensor value, the calibration reference value of the proximity sensor is calculated;
If the calibration reference value be greater than the first numerical value, confirm the calibration reference value and it is the multiple continuously approach Whether sensor values meets calibration trigger condition;
If meeting the calibration trigger condition, the proximity sensor is improved into second value close to threshold value.
On the one hand the embodiment of the present application additionally provides a kind of electronic device, comprising:
Module is obtained, for obtaining multiple continuous proximity sensor values in the infrared lamp closing of proximity sensor;
Computing module, for calculating the calibration of the proximity sensor according to the multiple continuous proximity sensor value Reference value;
Confirmation module, if confirming the calibration reference value and described for the calibration reference value greater than the first numerical value Whether multiple continuous proximity sensor values meet calibration trigger condition;
Calibration module, if for meeting the calibration trigger condition, by being improved close to threshold value for the proximity sensor Second value.
On the one hand the embodiment of the present application additionally provides a kind of electronic device, comprising: memory, processor and be stored in described It is real when the processor executes the computer program on memory and the computer program that can run on the processor Now foregoing proximity sensor calibration method.
On the one hand the embodiment of the present application additionally provides a kind of computer readable storage medium, be stored thereon with computer journey Sequence when the computer program is executed by processor, realizes foregoing proximity sensor calibration method.
The various embodiments described above, by obtaining multiple continuous proximity sensors in the infrared lamp closing of proximity sensor Value, and according to this multiple continuous proximity sensor value, the calibration reference value of proximity sensor is calculated, if the calibration reference value is big In the first numerical value, then further confirm that whether the calibration reference value and this multiple continuous proximity sensor value meet calibration triggering Proximity sensor is improved second value close to threshold value, is eliminated with this and passed when close by condition if meeting calibration trigger condition A possibility that proximity state error in judgement when sensor is influenced by frequency conversion infrared light light source, it is close to improve proximity sensor detection The problem of accuracy of state, electronic device splashette caused by eliminating therefore.
Detailed description of the invention
Fig. 1 is the flow diagram for the proximity sensor calibration method that one embodiment of the application provides;
Fig. 2 is the flow diagram for the proximity sensor calibration method that another embodiment of the application provides;
Fig. 3 is the structural schematic diagram for the electronic device that one embodiment of the application provides;
Fig. 4 is the structural schematic diagram for the electronic device that another embodiment of the application provides;
Fig. 5 is the hardware structural diagram of electronic device provided by the embodiments of the present application.
Specific embodiment
To enable present invention purpose, feature, advantage more obvious and understandable, below in conjunction with the application Attached drawing in embodiment, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described reality Applying example is only some embodiments of the present application, and not all embodiments.Based on the embodiment in the application, those skilled in the art Member's every other embodiment obtained without making creative work, shall fall in the protection scope of this application.
Referring to Fig. 1, the proximity sensor calibration method flow diagram provided for one embodiment of the application.This method can In an electronic with application, which specifically can be the mobile phone for being provided with proximity sensor, tablet computer, wearable The mobile terminals such as equipment.This method comprises the following steps:
101, when the infrared lamp of proximity sensor is closed, multiple continuous proximity sensor values are obtained;
When the infrared lamp of proximity sensor closes (LED (Light Emitting Diode)-OFF), proximity sensor Do not launch outward infrared light, then received infrared light is unrelated with the light source of proximity sensor itself, only with electronic device peripheral ring The infrared light in border is related.
Processor controls infrared lamp and closes, and when the infrared lamp is closed, obtains and cache multiple continuous PS values.
PS value is to close the proximity sensor value that duration inner product is got in infrared lamp.
102, according to multiple continuous proximity sensor value, the calibration reference value of the proximity sensor is calculated;
The calibration reference value is the reference value as PS value, if the calibration reference value shows that ambient enviroment is high IR energy Scene is measured, then can further determine whether to need to trigger the calibration to proximity sensor.
If 103, the calibration reference value is greater than the first numerical value, the calibration reference value and multiple continuous close biography are confirmed Whether sensor value meets calibration trigger condition;
The calibration reference value is if more than the first numerical value, then it represents that ambient enviroment is high IR energy scene, then according to the school Standard further confirms that whether meet calibration trigger condition from multiple continuous PS values of reference value and caching.
If 104, meeting the calibration trigger condition, which is improved into second value close to threshold value.
If meeting the calibration trigger condition, then it represents that obtained in ambient enviroment there are jamming light source, the proximity sensor PS value is less than normal than true value, then the proximity sensor is improved second value close to threshold value, the interference being subject to is offset, so that connecing Nearly sensor judge close to or away from result it is more acurrate.
In the present embodiment, by obtaining multiple continuous proximity sensor values in the infrared lamp closing of proximity sensor, And according to this multiple continuous proximity sensor value, the calibration reference value of proximity sensor is calculated, if the calibration reference value is greater than First numerical value, then further confirm that whether the calibration reference value and this multiple continuous proximity sensor value meet calibration triggering item Proximity sensor is improved second value close to threshold value, is eliminated with this when close sensing by part if meeting calibration trigger condition A possibility that proximity state error in judgement when device is influenced by frequency conversion infrared light light source, improves proximity sensor detection close to shape The problem of accuracy of state, electronic device splashette caused by eliminating therefore.
Referring to Fig. 2, the proximity sensor calibration method flow diagram provided for another embodiment of the application.This method Can be using in an electronic, which specifically can be the mobile phone for being provided with proximity sensor, tablet computer, can wear Wear the mobile terminals such as equipment.This method comprises the following steps:
201, confirm the light source that whether there is preset kind in the external environment of proximity sensor;
The infrared light of the light source tranmitting frequency variation of the preset kind, such as A light source, A light source are Alternating Current Power Supplies (50/ 60HZ), the infrared light frequency acquisition of the luminous frequency of A light source and proximity sensor has intersection, can have an impact to collection result.
The light source of the preset kind if it exists, thens follow the steps 202.
202, when the infrared lamp of proximity sensor is closed, multiple continuous proximity sensor values are obtained;
Generally, at least 20 continuous PS values can be obtained.
203, the average value for calculating multiple continuous proximity sensor value, by multiple continuous proximity sensor value Calibration reference value of the average value as the proximity sensor;
Further, in another embodiment, invalid value first can be weeded out from multiple continuous PS values of caching, Calculating the calibration reference value then more has reference significance.
Specifically, the median of multiple continuous proximity sensor values of caching is obtained, multiple by caching continuously connect The PS value for being greater than third value with the difference of the median in nearly sensor values is rejected, and multiple effective PS values are obtained.The third Numerical value can be customized, can reach and remove invalid PS value, such as 200.Calculate multiple effective proximity sensor value Average value, using the average value as the calibration reference value of the proximity sensor.
If 204, the calibration reference value is greater than the first numerical value, in multiple continuous proximity sensor value, inquiry is No there are two neighboring proximity sensor values to meet preset relation, if meeting the preset relation, confirmation meets calibration triggering item Part;
The preset relation is that the difference of two neighboring proximity sensor value is greater than the 4th numerical value, and this is two neighboring close to biography A proximity sensor value in sensor value is greater than the calibration reference value, another proximity sensor value is referred to less than the calibration Value.
Specifically, the average value of multiple continuous proximity sensor value is indicated with PS_AVG;
As PS_AVGD > 700, in multiple continuous proximity sensor value, inquiry connects with the presence or absence of two neighboring Nearly sensor values meets the preset relation.
The difference calculated with the presence or absence of two neighboring PS value is greater than the 4th numerical value, and a PS in the two neighboring PS value Value is greater than the PS_AVGD value, another PS value is less than the PS_AVGD value, and specifically, the difference of two neighboring PS value is PSOFF_ DELTA, when two PS value variable quantities when continuous acquisition end are larger, for example, PSOFF_DELTA > 100, and two PS values one A to be greater than 100, one less than 100, then confirms that there are two neighboring PS values to meet the preset relation.
Further, if meeting the preset relation, or repeatedly meet the preset relation, such as inquire three groups of two phases Adjacent PS value all meets the above-mentioned preset relation, then confirmation meets calibration trigger condition.
If 205, meeting the calibration trigger condition, which is improved into second value close to threshold value.
If meeting the calibration trigger condition, then it represents that obtained in ambient enviroment there are jamming light source, the proximity sensor PS value is less than normal than true value, then the proximity sensor is improved second value close to threshold value, which is specifically as follows 100, offset the interference being subject to so that proximity sensor judge close to or away from result it is more acurrate.
In the present embodiment, by obtaining multiple continuous proximity sensor values in the infrared lamp closing of proximity sensor, And according to this multiple continuous proximity sensor value, the calibration reference value of proximity sensor is calculated, if the calibration reference value is greater than First numerical value, then further confirm that whether the calibration reference value and this multiple continuous proximity sensor value meet calibration triggering item Proximity sensor is improved second value close to threshold value, is eliminated with this when close sensing by part if meeting calibration trigger condition A possibility that proximity state error in judgement when device is influenced by frequency conversion infrared light light source, improves proximity sensor detection close to shape The problem of accuracy of state, electronic device splashette caused by eliminating therefore.
The embodiment of the present application also protects a kind of electronic device, and referring to Fig. 3, which specifically can be built-in close to biography The mobile terminals such as mobile phone, tablet computer, the wearable device of sensor.The electronic device includes:
Module 301 is obtained, for obtaining multiple continuous proximity sensors in the infrared lamp closing of proximity sensor Value;
Processor controls infrared lamp and closes, and when the infrared lamp is closed, and obtains module 301 and obtains and cache multiple continuous PS value.
PS value is to close the proximity sensor value that duration inner product is got in infrared lamp.
Computing module 302, for calculating the calibration ginseng of the proximity sensor according to multiple continuous proximity sensor value Examine value;
The calibration reference value is the reference value as PS value, if the calibration reference value shows that ambient enviroment is high IR energy Scene is measured, then can further determine whether to need to trigger the calibration to proximity sensor.
Confirmation module 303 confirms the calibration reference value and multiple if being greater than the first numerical value for the calibration reference value Whether continuous proximity sensor value meets calibration trigger condition;
The calibration reference value is if more than the first numerical value, then it represents that ambient enviroment is high IR energy scene, then according to the school Standard further confirms that whether meet calibration trigger condition from multiple continuous PS values of reference value and caching.
Calibration module 304, if the proximity sensor is improved the close to threshold value for meeting the calibration trigger condition Two numerical value.
If meeting the calibration trigger condition, then it represents that obtained in ambient enviroment there are jamming light source, the proximity sensor PS value is less than normal than true value, then the proximity sensor is improved second value close to threshold value, the interference being subject to is offset, so that connecing Nearly sensor judge close to or away from result it is more acurrate.
Its correlation specifically describes, referring to the description of aforementioned embodiment illustrated in fig. 1.
In the present embodiment, by obtaining multiple continuous proximity sensor values in the infrared lamp closing of proximity sensor, And according to this multiple continuous proximity sensor value, the calibration reference value of proximity sensor is calculated, if the calibration reference value is greater than First numerical value, then further confirm that whether the calibration reference value and this multiple continuous proximity sensor value meet calibration triggering item Proximity sensor is improved second value close to threshold value, is eliminated with this when close sensing by part if meeting calibration trigger condition A possibility that proximity state error in judgement when device is influenced by frequency conversion infrared light light source, improves proximity sensor detection close to shape The problem of accuracy of state, electronic device splashette caused by eliminating therefore.
Referring to fig. 4, the electronic device that another embodiment of the application provides, specifically can be the hand for being provided with proximity sensor The mobile terminals such as machine, tablet computer, wearable device.With embodiment illustrated in fig. 3 the difference is that:
Computing module 302 is also used to calculate the average value of multiple continuous proximity sensor value, will be multiple continuous Calibration reference value of the average value of proximity sensor value as the proximity sensor.
The electronic device, which may further comprise:, rejects module 401 and enquiry module 402.
Module 401 is rejected continuously to connect for obtaining the median of multiple continuous proximity sensor value by multiple Be greater than in nearly sensor values with the difference of the median third value proximity sensor value reject after obtain multiple effectively connecing Nearly sensor values;
Computing module 302 is also used to calculate the average value of multiple effective proximity sensor value, using the average value as The calibration reference value of the proximity sensor.
Enquiry module 402, in multiple continuous proximity sensor value, inquiry to be with the presence or absence of two neighboring close Sensor values meets preset relation, which is that the difference of two neighboring proximity sensor value is greater than the 4th numerical value, and is somebody's turn to do A proximity sensor value in two neighboring proximity sensor value is greater than the calibration reference value, another proximity sensor value is small In the calibration reference value.
Confirmation module 303 is also used to the preset relation if it exists, then confirms the calibration reference value and multiple continuously connect Nearly sensor values meets the calibration trigger condition;
Confirmation module 303 confirms the calibration reference value and multiple continuous if being also used to repeatedly have the preset relation Proximity sensor value meet the calibration trigger condition;
Confirmation module 303 is also used to confirm the light source that whether there is preset kind in the external environment of the proximity sensor, The infrared light of the light source tranmitting frequency variation of the preset kind, the light source of the preset kind, then trigger and obtain module 301 if it exists When executing the infrared lamp closing in proximity sensor, multiple continuous proximity sensor values are obtained.
Specifically, specifically, the average value of multiple continuous proximity sensor value is indicated with PS_AVG;
As PS_AVGD > 700, in multiple continuous proximity sensor value, inquiry connects with the presence or absence of two neighboring Nearly sensor values meets the preset relation.
The difference calculated with the presence or absence of two neighboring PS value is greater than the 4th numerical value, and a PS in the two neighboring PS value Value is greater than the PS_AVGD value, another PS value is less than the PS_AVGD value, and specifically, the difference of two neighboring PS value is PSOFF_ DELTA, when two PS value variable quantities when continuous acquisition end are larger, for example, PSOFF_DELTA > 100, and two PS values one A to be greater than 100, one less than 100, then confirms that there are two neighboring PS values to meet the preset relation.
Further, if meeting the preset relation, or repeatedly meet the preset relation, such as inquire three groups of two phases Adjacent PS value all meets the above-mentioned preset relation, then confirmation meets calibration trigger condition.
Its correlation specifically describes, referring to the description of earlier figures 1, Fig. 2 and embodiment illustrated in fig. 3.
In the present embodiment, by obtaining multiple continuous proximity sensor values in the infrared lamp closing of proximity sensor, And according to this multiple continuous proximity sensor value, the calibration reference value of proximity sensor is calculated, if the calibration reference value is greater than First numerical value, then further confirm that whether the calibration reference value and this multiple continuous proximity sensor value meet calibration triggering item Proximity sensor is improved second value close to threshold value, is eliminated with this when close sensing by part if meeting calibration trigger condition A possibility that proximity state error in judgement when device is influenced by frequency conversion infrared light light source, improves proximity sensor detection close to shape The problem of accuracy of state, electronic device splashette caused by eliminating therefore.
Further, which includes: memory, processor and is stored on institute's memory and can be in the processing The computer program run on device when the processor executes the computer program, realizes such as earlier figures 1 to reality shown in Fig. 2 Apply proximity sensor calibration method described in example.
The embodiment of the present application also provides a kind of computer readable storage medium, which be can be It is set in the electronic device in the various embodiments described above, which, which can be in the various embodiments described above, is arranged Storage unit in main control chip and data acquisition chip.It is stored with computer program on the computer readable storage medium, Realize earlier figures 1 to proximity sensor calibration method described in embodiment illustrated in fig. 2 when the program is executed by processor.
Illustratively, electronic device can be various types of departments of computer science that are mobile or portable and executing wireless communication Any one of equipment of uniting.Specifically, electronic device can be mobile phone or smart phone (for example, being based on iPhone TM, the phone based on Android TM), portable gaming device (such as Nintendo DS TM, PlayStation Portable TM, Gameboy Advance TM, iPhone TM), laptop computer, PDA, portable Internet appliance, sound Happy player and data storage device, other handheld devices and wrist-watch, earphone, pendant, earphone etc., electronic device is also Can for other wearable devices (for example, such as electronic glasses, electronics clothes, electronics bracelet, electronics necklace, electronics tatoo, The headset equipment (HMD) of electronic equipment or smartwatch).
Electronic device can also be that any one of multiple electronic equipments, multiple electronic equipments include but is not limited to honeycomb Phone, smart phone, other wireless telecom equipments, personal digital assistant, audio player, other media players, music note It records device, video recorder, camera, other medium recorders, radio, Medical Devices, vehicle transport instrument, calculator, may be programmed Remote controler, pager, laptop computer, desktop computer, printer, netbook computer, personal digital assistant (PDA), just Formula multimedia player (PMP), Motion Picture Experts Group (MPEG-1 or MPEG-2) audio layer 3 (MP3) player are taken, it is portable Medical Devices and digital camera and combinations thereof.
In some cases, electronic device can execute multiple functions and (for example, playing music, show video, store picture And send and receive call).If desired, electronic device can be such as cellular phone, media player, other hands The portable device of holding equipment, watch equipment, pendant equipment, receiver device or other compact portable equipment.
As shown in figure 5, electronic equipment 10 may include control circuit, which may include storage and processing circuit 30.The storage and processing circuit 30 may include memory, such as hard drive memory, nonvolatile memory (such as dodge Deposit or be used to form the memory etc. of other electronic programmable limit deletings of solid state drive), volatile memory (such as it is quiet State or dynamic random access memory etc.) etc., the embodiment of the present application is with no restriction.Store and process the processing circuit in circuit 30 It can be used for the operating of controlling electronic devices 10.The processing circuit microprocessor, microcontroller can count based on one or more Word signal processor, baseband processor, power management unit, audio codec chip, specific integrated circuit, display driver Integrated circuit etc. is realized.
Storage and processing circuit 30 can be used for running the software in electronic equipment 10, such as the Internet browser application program, Voice over internet protocol (Voice over Internet Protocol, VOIP) call application program, Email are answered With program, media play-back application, operation system function etc..These softwares can be used for executing some control operations, for example, Image Acquisition based on camera, the ambient light measurement based on ambient light sensor, the proximity sensor based on proximity sensor Measurement, the information display function that the positioning indicators such as status indicator lamp based on light emitting diode are realized are passed based on touching The touch event of sensor detects, function associated with information show on multiple (such as layering) displays, with execution nothing The associated operation of line communication function, operation associated with collecting and generating audio signal, presses with collection and treatment button Other functions etc. in the associated control operation of event data and electronic equipment 10, the embodiment of the present application is with no restriction.
Electronic equipment 10 can also include input-output circuit 42.Input-output circuit 42 can be used for making electronic equipment 10 Realize outputting and inputting for data, i.e. permission electronic equipment 10 allows electronic equipment 10 that will count from outer equipment receiving data and also According to from the output of electronic equipment 10 to external equipment.Input-output circuit 42 may further include sensor 32.Sensor 32 can To include ambient light sensor, the proximity sensor based on light and capacitor, touch sensor is (for example, be based on light touch sensor And/or capacitive touch sensors, wherein touch sensor can be a part of touching display screen, can also be used as one Touch sensor arrangement independently uses), acceleration transducer and other sensors etc..
Input-output circuit 42 can also include one or more displays, such as display 14.Display 14 can wrap Include liquid crystal display, organic light emitting diode display, electronic ink display, plasma display uses other display skills One or several kinds of combination in the display of art.Display 14 may include touch sensor array (that is, display 14 can be with It is touching display screen).Touch sensor can be by transparent touch sensor electrode (such as tin indium oxide (ITO) electrode) battle array The capacitive touch sensors formed are arranged, or can be the touch sensor formed using other touching techniques, such as sound wave Touch-control, pressure sensible touch, resistive touch, optical touch etc., the embodiment of the present application is with no restriction.
Electronic equipment 10 can also include audio component 36.Audio component 36 can be used for providing audio for electronic equipment 10 Output and input function.Audio component 36 in electronic equipment 10 may include loudspeaker, microphone, buzzer, tone generation Device and other components for being used to generate and detect sound.
Telecommunication circuit 38 can be used for providing the ability with external device communication for electronic equipment 10.Telecommunication circuit 38 can be with Radio communication circuit including analog- and digital- input-output interface circuit, and based on radiofrequency signal and/or optical signal.Communication Radio communication circuit in circuit 38 may include radio-frequency transceiver circuitry, power amplifier circuit, low-noise amplifier, open Pass, filter and antenna.For example, the radio communication circuit in telecommunication circuit 38 may include for by transmitting and reception Near-field coupling electromagnetic signal supports the circuit of near-field communication (Near Field Communication, NFC).For example, communication Circuit 38 may include near-field communication aerial and near-field communication transceiver.Telecommunication circuit 38 can also include cellular telephone transceiver And antenna, wireless lan transceiver circuit and antenna etc..
Electronic equipment 10 can further include battery, power management circuitry and other input-output units 40.It is defeated Enter-output unit 40 may include button, control stick, click wheel, scroll wheel, touch tablet, keypad, keyboard, camera shines Diode and other positioning indicators etc..
User can input a command for the operation of controlling electronic devices 10 by input-output circuit 42, and can make Status information and other outputs from electronic equipment 10 are received with the output data of input-output circuit 42 to realize.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment Point, it may refer to the associated description of other embodiments.
The above are the descriptions to proximity sensor calibration method and electronic device provided herein, for this field Technical staff, according to the thought of the embodiment of the present application, there will be changes in the specific implementation manner and application range, comprehensive On, the contents of this specification should not be construed as limiting the present application.

Claims (10)

1. a kind of proximity sensor calibration method characterized by comprising
When the infrared lamp of proximity sensor is closed, multiple continuous proximity sensor values are obtained;
According to the multiple continuous proximity sensor value, the calibration reference value of the proximity sensor is calculated;
If the calibration reference value is greater than the first numerical value, the calibration reference value and the multiple continuous close sensing are confirmed Whether device value meets calibration trigger condition;
If meeting the calibration trigger condition, the proximity sensor is improved into second value close to threshold value.
2. the method according to claim 1, wherein described according to the multiple continuous proximity sensor value, The calibration reference value for calculating the proximity sensor includes:
The average value for calculating the multiple continuous proximity sensor value, by being averaged for the multiple continuous proximity sensor value It is worth the calibration reference value as the proximity sensor.
3. the method according to claim 1, wherein described according to the multiple continuous proximity sensor value, Calculate the calibration reference value of the proximity sensor further include:
The median for obtaining the multiple continuous proximity sensor value, by the multiple continuous proximity sensor value with institute State median difference be greater than third value proximity sensor value reject after obtain multiple effective proximity sensor values;
The average value for calculating the multiple effective proximity sensor value, using the average value as the school of the proximity sensor Quasi- reference value.
4. according to the method in claim 2 or 3, which is characterized in that the confirmation calibration reference value and the multiple Whether continuous proximity sensor value meets calibration trigger condition
In the multiple continuous proximity sensor value, inquiry meets default close with the presence or absence of two neighboring proximity sensor value System, the preset relation are that the difference of two neighboring proximity sensor value is greater than the 4th numerical value, and the two neighboring close biography A proximity sensor value in sensor value is greater than the calibration reference value, another proximity sensor value is joined less than the calibration Examine value;
The preset relation if it exists then confirms that the calibration reference value and the multiple continuous proximity sensor value meet institute State calibration trigger condition.
5. according to the method in claim 2 or 3, which is characterized in that the confirmation calibration reference value and described Whether multiple continuous proximity sensor values meet calibration trigger condition further include:
In the multiple continuous proximity sensor value, inquiry meets default close with the presence or absence of two neighboring proximity sensor value System, the preset relation are that the difference of two neighboring proximity sensor value is greater than the 4th numerical value, and the two neighboring close biography A proximity sensor value in sensor value is greater than the calibration reference value, another proximity sensor value is joined less than the calibration Examine value;
If repeatedly there is the preset relation, the calibration reference value and the multiple continuous proximity sensor value symbol are confirmed Close the calibration trigger condition.
6. the method according to claim 1, wherein being obtained when the infrared lamp in proximity sensor is closed Include: before multiple continuous proximity sensor values
Confirm the light source that whether there is preset kind in the external environment of the proximity sensor, the light source hair of the preset kind The infrared light of radio frequency rate variation;
The light source of the preset kind if it exists obtains multiple companies when then the execution infrared lamp in proximity sensor is closed Continuous proximity sensor value.
7. a kind of electronic device characterized by comprising
Module is obtained, for obtaining multiple continuous proximity sensor values in the infrared lamp closing of proximity sensor;
Computing module, for calculating the calibration reference of the proximity sensor according to the multiple continuous proximity sensor value Value;
Confirmation module, if confirming the calibration reference value and the multiple for the calibration reference value greater than the first numerical value Whether continuous proximity sensor value meets calibration trigger condition;
Calibration module, if the proximity sensor is improved second close to threshold value for meeting the calibration trigger condition Numerical value.
8. electronic device according to claim 7, which is characterized in that the electronic device includes:
Module is rejected, it, will be the multiple continuous close for obtaining the median of the multiple continuous proximity sensor value Be greater than in sensor values with the difference of the median third value proximity sensor value reject after obtain multiple effectively connecing Nearly sensor values;
The computing module is also used to calculate the average value of the multiple effective proximity sensor value, the average value is made For the calibration reference value of the proximity sensor;
Enquiry module, in the multiple continuous proximity sensor value, inquiry to be with the presence or absence of two neighboring close to sensing Device value meets preset relation, and the preset relation is greater than the 4th numerical value for the difference of two neighboring proximity sensor value, and described A proximity sensor value in two neighboring proximity sensor value is greater than the calibration reference value, another proximity sensor value Less than the calibration reference value;
The confirmation module confirms the calibration reference value and the multiple if being also used to repeatedly have the preset relation Continuous proximity sensor value meets the calibration trigger condition.
9. a kind of electronic device, comprising: memory, processor and be stored on the memory and can transport on the processor Capable computer program, which is characterized in that when the processor executes the computer program, realize as in claim 1 to 6 Any one described in proximity sensor calibration method.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program When being executed by processor, the proximity sensor calibration method as described in any one in claim 1 to 6 is realized.
CN201910029135.3A 2019-01-12 2019-01-12 Proximity sensor calibration method, electronic device, and computer-readable storage medium Active CN109724640B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910029135.3A CN109724640B (en) 2019-01-12 2019-01-12 Proximity sensor calibration method, electronic device, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910029135.3A CN109724640B (en) 2019-01-12 2019-01-12 Proximity sensor calibration method, electronic device, and computer-readable storage medium

Publications (2)

Publication Number Publication Date
CN109724640A true CN109724640A (en) 2019-05-07
CN109724640B CN109724640B (en) 2021-04-06

Family

ID=66299014

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910029135.3A Active CN109724640B (en) 2019-01-12 2019-01-12 Proximity sensor calibration method, electronic device, and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN109724640B (en)

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102265252A (en) * 2011-06-24 2011-11-30 华为终端有限公司 A method and a device for adjusting a sensing threshold value of an infrared proximity sensor
JP2013253935A (en) * 2012-06-08 2013-12-19 Aisin Aw Co Ltd Object detection device, object detection method, and computer program
CN104105952A (en) * 2012-02-08 2014-10-15 Vega格里沙贝两合公司 Apparatus and method for correcting offset
CN106850983A (en) * 2017-01-20 2017-06-13 广东欧珀移动通信有限公司 One kind puts out screen control method, device and terminal
CN107102864A (en) * 2017-05-16 2017-08-29 广东欧珀移动通信有限公司 One kind puts out screen control method, device, storage medium and terminal
CN107290802A (en) * 2017-07-18 2017-10-24 广东欧珀移动通信有限公司 Proximity transducer calibration method, proximity transducer calibrating installation and intelligent terminal
CN107504994A (en) * 2017-08-08 2017-12-22 广东欧珀移动通信有限公司 Calibration method, device, mobile terminal and the readable storage medium storing program for executing of proximity transducer
CN108279408A (en) * 2018-01-24 2018-07-13 广东欧珀移动通信有限公司 proximity sensor calibration method, device, mobile terminal and computer-readable medium
CN108415024A (en) * 2018-01-24 2018-08-17 广东欧珀移动通信有限公司 proximity sensor calibration method, device, mobile terminal and computer-readable medium
CN108496148A (en) * 2015-11-12 2018-09-04 剑桥触控科技有限公司 Handle the signal from touch screen panel
CN108759892A (en) * 2018-06-08 2018-11-06 Oppo(重庆)智能科技有限公司 Sensor calibrating method, electronic device and computer readable storage medium
CN108801321A (en) * 2018-06-08 2018-11-13 Oppo(重庆)智能科技有限公司 Sensor calibrating method, electronic device and computer readable storage medium
CN108924358A (en) * 2018-07-03 2018-11-30 Oppo广东移动通信有限公司 proximity sensor control method, electronic device and computer readable storage medium
CN108983211A (en) * 2018-07-02 2018-12-11 Oppo广东移动通信有限公司 Proximity sensor and its control method, electronic device and computer readable storage medium
CN109061611A (en) * 2018-09-12 2018-12-21 Oppo广东移动通信有限公司 Proximity sensor calibration method and relevant apparatus
CN109167857A (en) * 2018-09-30 2019-01-08 Oppo广东移动通信有限公司 Calibration method, electronic device, storage medium and computer equipment

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2713586A2 (en) * 2011-06-24 2014-04-02 Huawei Device Co., Ltd. Method and device for adjusting detecting threshold of infrared proximity sensor
CN102265252A (en) * 2011-06-24 2011-11-30 华为终端有限公司 A method and a device for adjusting a sensing threshold value of an infrared proximity sensor
CN104105952A (en) * 2012-02-08 2014-10-15 Vega格里沙贝两合公司 Apparatus and method for correcting offset
JP2013253935A (en) * 2012-06-08 2013-12-19 Aisin Aw Co Ltd Object detection device, object detection method, and computer program
CN108496148A (en) * 2015-11-12 2018-09-04 剑桥触控科技有限公司 Handle the signal from touch screen panel
CN106850983A (en) * 2017-01-20 2017-06-13 广东欧珀移动通信有限公司 One kind puts out screen control method, device and terminal
CN107102864A (en) * 2017-05-16 2017-08-29 广东欧珀移动通信有限公司 One kind puts out screen control method, device, storage medium and terminal
CN107290802A (en) * 2017-07-18 2017-10-24 广东欧珀移动通信有限公司 Proximity transducer calibration method, proximity transducer calibrating installation and intelligent terminal
CN107504994A (en) * 2017-08-08 2017-12-22 广东欧珀移动通信有限公司 Calibration method, device, mobile terminal and the readable storage medium storing program for executing of proximity transducer
CN108279408A (en) * 2018-01-24 2018-07-13 广东欧珀移动通信有限公司 proximity sensor calibration method, device, mobile terminal and computer-readable medium
CN108415024A (en) * 2018-01-24 2018-08-17 广东欧珀移动通信有限公司 proximity sensor calibration method, device, mobile terminal and computer-readable medium
CN108759892A (en) * 2018-06-08 2018-11-06 Oppo(重庆)智能科技有限公司 Sensor calibrating method, electronic device and computer readable storage medium
CN108801321A (en) * 2018-06-08 2018-11-13 Oppo(重庆)智能科技有限公司 Sensor calibrating method, electronic device and computer readable storage medium
CN108983211A (en) * 2018-07-02 2018-12-11 Oppo广东移动通信有限公司 Proximity sensor and its control method, electronic device and computer readable storage medium
CN108924358A (en) * 2018-07-03 2018-11-30 Oppo广东移动通信有限公司 proximity sensor control method, electronic device and computer readable storage medium
CN109061611A (en) * 2018-09-12 2018-12-21 Oppo广东移动通信有限公司 Proximity sensor calibration method and relevant apparatus
CN109167857A (en) * 2018-09-30 2019-01-08 Oppo广东移动通信有限公司 Calibration method, electronic device, storage medium and computer equipment

Also Published As

Publication number Publication date
CN109724640B (en) 2021-04-06

Similar Documents

Publication Publication Date Title
CN101681185B (en) Methods and systems for providing sensory information to devices and peripherals
CN104104769B (en) Dynamic routing of audio among multiple audio devices
CN103795866B (en) In a portable device to the sensing of user behavior with from dynamic response
US20160299570A1 (en) Wristband device input using wrist movement
CN108924358A (en) proximity sensor control method, electronic device and computer readable storage medium
CN109407833A (en) Manipulate method, apparatus, electronic equipment and the storage medium of electronic equipment
CN109150326A (en) Antenna impedance adjustment method, electronic device and computer readable storage medium
CN107436763A (en) A kind of method and wearable device for switching wearable device interface subject
CN109389564A (en) Display methods and electronic device
CN108983211A (en) Proximity sensor and its control method, electronic device and computer readable storage medium
CN109144454A (en) double-sided screen display control method and related product
CN109950701A (en) Antenna module and mobile terminal
CN108777741A (en) antenna switching control method and related product
CN110210395A (en) Vein image acquisition method and Related product
CN109067978A (en) Button operation processing method, device, storage medium and electronic equipment
CN108769401A (en) Signal detecting method and related product
CN108989546A (en) The proximity test method and Related product of electronic device
CN111613246A (en) Audio classification prompting method and related equipment
CN107231461A (en) The acquisition method and Related product of fingerprint
CN109724640A (en) Proximity sensor calibration method, electronic device and computer readable storage medium
CN109739577A (en) Using exempting from freezing method, electronic device and computer readable storage medium
CN108680181A (en) Wireless headset, step-recording method and Related product based on headset detection
CN110099169A (en) Instant message processing method, electronic device and computer readable storage medium
CN114153334A (en) Electronic device, control method and control device thereof
CN109740538A (en) Fingerprint collecting method, electronic device and computer readable storage medium

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