The content of the invention
It is an object of the invention to provide a kind of threshold calibration method of range sensor so that terminal can with currently away fromOn the basis of the light leak value of sensor, the high and low threshold value of real time calibration current distance sensor, so as to improve the performance of mobile phone,Preferably experience is brought to user.
To solve above-mentioned technical problem, embodiments of the present invention provide a kind of threshold calibration side of range sensorMethod, comprises the steps of:
When the range sensor of terminal is started working, the terminal obtains the light leak value of presently described range sensor;
The terminal is according to the light leak value of the presently described range sensor for obtaining, and the be preset in the terminalOne deviation and the second deviation, first deviation is updated to current institute by the Low threshold of presently described range sensorThe light leak value sum of range sensor is stated, the high threshold of presently described range sensor is updated to second deviation and is worked asThe light leak value sum of the front range sensor;
Wherein, the readings of range sensor when the first deviation is the first predeterminable range for the screen distance reflecting surface of terminalWith the difference of the light leak value of the range sensor;When second deviation is the second predeterminable range for the screen distance reflecting surface of terminalThe difference of the readings of range sensor and the light leak value of the range sensor;First predeterminable range is less than the second predeterminable range.
Embodiments of the present invention additionally provide a kind of mobile terminal, and the mobile terminal includes:Acquisition module, reading mouldBlock, threshold value update module;
The acquisition module is used for when the range sensor of mobile terminal is started working, and obtains presently described Distance-sensingThe light leak value of device;
The read module is used for when the range sensor of mobile terminal is started working, and reading is preset in described mobile wholeThe first deviation and the second deviation in end;
The threshold value update module is used to for the Low threshold of presently described range sensor to be updated to first deviationWith the light leak value sum of presently described range sensor, the high threshold of presently described range sensor is updated to into described second inclinedThe light leak value sum of difference and presently described range sensor;
Wherein, range sensor when the first deviation is the first predeterminable range for the screen distance reflecting surface of mobile terminalThe difference of the light leak value of readings and the range sensor;Second deviation is second pre- for the screen distance reflecting surface of mobile terminalIf apart from when range sensor readings and the range sensor light leak value difference;First predeterminable range is default less than secondDistance.
Embodiment of the present invention in terms of existing technologies, when range sensor is started working, is obtained in real time currentThe light leak value of range sensor, and the high and low threshold value of current distance sensor is updated according to the light leak value of current distance sensor,The accuracy of the high and low threshold value of current distance sensor is not only increased, the performance of mobile phone is also improved, so as to bring to userPreferably experience.
Further, first deviation and the second deviation are set in the following manner:
N number of test terminal is placed in into flat condition;Wherein, N number of test terminal screen be located surface not byBlock, the N is the natural number more than or equal to 1;
The readings of range sensor when the screen distance reflecting surface for obtaining each test terminal respectively is the first predeterminable rangeWith the difference of the light leak value of range sensor, and the screen distance reflecting surface of each test terminal be the second predeterminable range when distanceThe difference of the readings of sensor and the light leak value of range sensor;
When by the screen distance reflecting surface of each test terminal being the first predeterminable range the readings of range sensor withThe difference of the light leak value of range sensor as each test terminal first threshold, and by the screen of each test terminalWhen apart from reflecting surface being the second predeterminable range the readings of range sensor with the difference of the light leak value of range sensor as eachThe Second Threshold of test terminal;
By the mean value of the first threshold of N number of test terminal, first deviation is set to;By N number of surveyThe mean value of the Second Threshold of examination terminal, is set to first deviation.First deviation is conducive to protecting with the second deviationCard terminal is in height, for there is a buffering area between threshold value, so as to avoid terminal from making because only existing a threshold value (critical point)Terminal the Near Threshold it is frequently bright, go out frequency, is conducive to improving the performance of mobile phone, and to user preferably experience is brought.
Further, the N is 10.Be conducive to improving the accuracy of the first deviation and the second deviation.
Further, in the step of terminal obtains the light leak value of presently described range sensor, including following sonStep:
Initial value of the maximum displacement value that the terminal can read range sensor as the range sensor;
Whether the readings of the presently described range sensor of the terminal judges is less than the initial value, and it is presently described away fromWhen being less than the initial value from the readings of sensor, the initial value is updated to into the readings of presently described range sensor;
The terminal using renewal after the initial value as presently described range sensor light leak value.Advantageously ensure thatTerminal gets the light leak value of current distance sensor.
Further, whether the readings in the presently described range sensor of the terminal judges is less than the step of the initial valueIn rapid,
Whether the terminal judges the readings of presently described range sensor less than the initial value every the default time.Periodically judge the readings of displacement sensing, the light leak value of the current distance sensor that is conducive to upgrading in time, so as to upgrade in timeThe high and low threshold value of current distance sensor.
Further, the default time is 30ms.Be conducive to improving the light leak of the range sensor for currently gettingThe accuracy of value.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with each reality of the accompanying drawing to the present inventionThe mode of applying is explained in detail.However, it will be understood by those skilled in the art that in each embodiment of the invention,In order that reader more fully understands the application and proposes many ins and outs.But, even if without these ins and outs and baseMany variations and modification in following embodiment, it is also possible to realize each claim of the application technical side required for protectionCase.
The first embodiment of the present invention is related to a kind of threshold calibration method of range sensor.In actual applications, originallyThe inventor of invention has found, because the spot on touch-screen understands light leak of reflecting part infrared ray and internal structure of mobile phone etc., makesThe readings for obtaining range sensor is made up of two parts, i.e. the infrared ray value and light leak value of reflective surface.The mobile phone of different structureLight leak value is different, mobile phone in use because of falling physically, rub and the reason such as spot will also result in the light leak of mobile phoneValue changes, and the difference of light leak value necessarily causes the change of high and low threshold value, therefore, high and low threshold value is consolidated in prior artFixed constant way, when the readings that can cause range sensor is high and low threshold value, the actual position of reflecting surface should with setting at that timeThere is deviation position during value, it is possible to cause mobile phone cannot normal light on and off screen bust.Based on this discovery, this enforcementMode, when range sensor is started working, by the light leak value for obtaining current distance sensor in real time, and according to current distanceThe light leak value of sensor updates the high and low threshold value of current distance sensor, not only increases the high and low threshold of current distance sensorThe accuracy of value, also improves the performance of mobile phone, so as to bring preferably experience to user.
The idiographic flow of present embodiment is as shown in Figure 2.
In step 201, whether terminal judges are being dialed or are being received calls.If so, step 202 is then entered, if it is not, thenReturn this step.
In step 202., the range sensor of terminal is started working, and terminal obtains the light leak value of current distance sensor.
Below the process that the light leak value of current distance sensor how is obtained to terminal is done into specific elaboration.
As shown in figure 3, in step 301, the terminal maximum displacement value to be read range sensor is used as distanceThe initial value of sensor, and into step 302.
In step 302, whether the readings of terminal judges current distance sensor is less than initial value, if so, then enters stepRapid 303, if it is not, then returning this step.
In step 303, the initial value of displacement sensor is updated to terminal the readings of current distance sensor, and will be updatedLight leak value of the initial value afterwards as current distance sensor.
It should be noted that the range sensor of terminal starts dialing in user, or when beginning to turn on phone, that is, start workMake, now terminal has one from (carrying out to close head away from head (user just starts to dial or when just starting to answer the call)The process of call) process, when terminal is away from head, due to the presence without reflecting surface, it is seen that, now Distance-sensingThe readings of device is the light leak value of current distance sensor, meanwhile, it is the infrared of reflective surface by the readings of range sensorLine value and light leak value two parts sum understand that now the readings of range sensor is minimum, therefore, in general, terminal away fromDuring head, it is possible to obtain the light leak value of current distance sensor.
In step 202., after getting the light leak value of current distance sensor, then into step 203.
In step 203, terminal is according to the light leak value of the current distance sensor for getting, and it is default in the terminalFirst deviation and the second deviation, are updated to the Low threshold of current distance sensor the first deviation and sense with current distanceThe light leak value sum of device, by the high threshold of current distance sensor the light leak of the second deviation and current distance sensor is updated toValue sum.
Wherein, the readings of range sensor when the first deviation is the first predeterminable range for the screen distance reflecting surface of terminalWith the difference of the light leak value of the range sensor;When second deviation is the second predeterminable range for the screen distance reflecting surface of terminalThe difference of the readings of range sensor and the light leak value of the range sensor;Also, the first predeterminable range it is default less than second away fromFrom.
The set-up mode of the first deviation and the second deviation will be specifically addressed below.
As shown in figure 4, in step 401, N number of test terminal (such as mobile phone) is placed in into flat condition;Wherein, N number of testThe surface that the screen of terminal is located is not blocked, and N is the natural number more than or equal to 1;Present embodiment will be equal to 10 with NExample is specifically addressed to the set-up mode of the first deviation and the second deviation, at the same time, manages for convenience, this embodiment party10 test terminal number consecutivelies are 0 to 9 by formula.
In step 402, the readings of 10 test terminal current distance sensors is obtained, it is seen that, due to current 10The surface that individual test terminal screen is located is not blocked, i.e., now 10 test terminals do not have a reflecting surface, therefore currentlyThe readings of the range sensor of each test terminal is the light leak value of the range sensor.
As described in step 401, for the ease of management, the light leak value of get 10 test terminals is used in this stepMIN_VALxRepresent, wherein, x represents the numbering of each test terminal, can use 0 to 9, for example, when x takes 0, MIN_VALxRepresentNumbering is the light leak value of 0 test terminal;When x takes 5, MIN_VALxThen represent the light leak value of the test terminal that numbering is 5.
In step 403, Distance-sensing when the screen distance reflecting surface for obtaining each test terminal is the first predeterminable rangeReadings LOW_VAL of devicex(this place and the x for hereinafter mentioning are identical with the x meanings mentioned in step 402).This enforcement is withOne predeterminable range is illustrated as a example by being equal to 3 centimeters.
For above-mentioned case, when x takes 0, LOW_VALxRepresent that the screen distance reflecting surface for numbering the test terminal for being 0 isThe readings of the range sensor of test terminal when 3 centimeters;When x takes 5, LOW_VALxRepresent the test terminal that numbering is 5The readings of the range sensor of test terminal when screen distance reflecting surface is 3 centimeters.
In step 404, Distance-sensing when the screen distance reflecting surface for obtaining each test terminal is the second predeterminable rangeReadings HIGH_VAL of devicex.Present embodiment is illustrated so that the second predeterminable range is equal to 5 centimeters as an example.
Similar, for above-mentioned case, when x takes 0, HIGH_VALxRepresent the screen distance of the test terminal that numbering is 0The readings of the range sensor of test terminal when reflecting surface is 5 centimeters;When x takes 5, HIGH_VALxRepresent the survey that numbering is 5The readings of the range sensor of the test terminal when screen distance reflecting surface of examination terminal is 5 centimeters.
It is noted that present embodiment is to preset the screen distance reflecting surface for obtaining each test terminal for firstApart from when range sensor readings LOW_VALx, be placed on obtain each test terminal screen distance reflecting surface be second presetApart from when range sensor readings HIGH_VALxThe step of before as a example by illustrate, but in actual applications, it is also possible toFirst carry out step 404, then execution step 403.
In step 405, according to the MIN_VAL of each the test terminal range sensor for gettingx、LOW_VALxAndHIGH_VALx, the LOW_VAL of each test terminal range sensor is obtained respectivelyxWith MIN_VALxDifference LOW_OFFSETx(the i.e. readings of range sensor and range sensor when the screen distance reflecting surface of each test terminal is the first predeterminable rangeThe difference of light leak value), and the HIGH_VAL of each test terminalxWith MIN_VALxDifference HIGH_OFFSETx(i.e. each testThe difference of the light leak value of the readings of range sensor and range sensor when the screen distance reflecting surface of terminal is the second predeterminable rangeValue).
Manage for convenience, in present embodiment by the screen distance reflecting surface of each test terminal be the first predeterminable rangeWhen range sensor readings and range sensor light leak value difference LOW_OFFSETxAs the first of each test terminalThreshold value, and the readings of range sensor is passed with distance when being the second predeterminable range by the screen distance reflecting surface of each test terminalDifference HIGH_OFFSET of the light leak value of sensorxAs the Second Threshold of each test terminal.
In a step 406, the mean value of 10 test terminal first thresholds, and mean value (the i.e. root of Second Threshold are obtainedAccording to the LOW_OFFSET of each test terminal for gettingxAnd HIGH_OFFSETx, obtain the LOW_ of 10 test terminalsOFFSETxMean value, and the HIGH_OFFSET of 10 test terminalsxMean value).
In step 407, using the mean value of first threshold as terminal (terminal being previously mentioned in step 201) screen away fromThe difference of the readings of range sensor and the light leak value of range sensor when from reflecting surface being the first predeterminable range, by the second thresholdThe readings of range sensor is passed with the distance when mean value of value is the second predeterminable range as the screen distance reflecting surface of terminalThe light leak value of sensor difference (will 10 test terminals LOW_OFFSETxMean value as the first deviation, by 10The HIGH_OFFSET of test terminalxMean value as the second deviation).
It is noted that the structure of 10 test terminals mentioned into step 407 of step 401 and institute in step 203The structure of the terminal (such as mobile phone) mentioned is identical.
The acquisition of the first deviation and the second deviation is carried out in the development of terminal, gets the first deviationAfter the second deviation, present embodiment is preset in the terminal, and for terminal high and low threshold is used for during the use in later stageThe dynamic calibration of value.
After the high and low threshold value of current distance sensor is updated successfully, then into step 204.
In step 204, whether the readings of terminal judges current distance sensor is more than the high threshold of current distance sensorValue, if so, then enters step 205, and in step 205, (readings of current distance sensor is more than the background light of extinguishing screenDuring high threshold, it is prior art that how terminal extinguishes the process of the background light of screen, and present embodiment is repeated no more);If it is not,Then enter step 206.
In step 206, whether the readings of terminal judges current distance sensor is less than the low threshold of current distance sensorValue, if so, then enters step 207, and in step 207, (readings of current distance sensor is less than to light the background light of screenDuring Low threshold, it is prior art that how terminal lights the process of the background light of screen, and present embodiment is repeated no more), if it is not,Then return to step 204.
Above the step of various methods divide, be intended merely to description it is clear, can merge into when realizing a step orSome steps are split, multiple steps are decomposed into, as long as comprising identical logical relation, all in the protection domain of this patentIt is interior;To either adding inessential modification in algorithm in flow process or introducing inessential design, but its algorithm is not changedWith the core design of flow process all in the protection domain of the patent.
Second embodiment of the invention is related to a kind of threshold calibration method of range sensor.3rd embodiment isThe further improvement done on the basis of two embodiments, it is theed improvement is that:In second embodiment of the invention, terminal existsDuring obtaining the light leak value of current distance sensor, can judge that the readings of current distance sensor is every the default timeIt is no less than initial value.
Present embodiment is explained so that the default time is as 30ms as an example.That is, in the present embodiment,Whether the readings of current distance sensor will be judged less than initial value, every 30ms terminals if the readings of current distance sensorLess than initial value, the initial value of range sensor will be updated to terminal the readings of current distance sensor, and after updatingInitial value as current distance sensor light leak value.
On the one hand after obtaining the light leak value of current distance sensor, terminal is according to the light leak value of current distance sensor and pre-If the first deviation in the terminal and the second deviation, update current distance sensor high and low threshold value, and according to renewal afterHigh and low threshold decision whether need to light or extinguish the background light of screen;Another aspect terminal is continued executing with to be sentenced every 30msWhether the readings of disconnected current distance sensor is less than initial value, and when the readings of current distance sensor is less than initial value, willThe initial value of range sensor is updated to the readings of current distance sensor, while using the initial value after renewal as current distanceThe step of light leak value of sensor, till end of conversation.
Third embodiment of the invention is related to a kind of mobile terminal, as shown in figure 5, including:Acquisition module, read module,Threshold value update module;
Wherein, acquisition module is used for when the range sensor of mobile terminal is started working, and obtains current distance sensorLight leak value;
Read module is used for when the range sensor of mobile terminal is started working, read it is default in the terminal theOne deviation and the second deviation;
Threshold value update module is used to for the Low threshold of current distance sensor to be updated to the first deviation with current distance biographyThe light leak value sum of sensor, by the high threshold of current distance sensor the leakage of the second deviation and current distance sensor is updated toLight value sum;
Wherein, range sensor when the first deviation is the first predeterminable range for the screen distance reflecting surface of mobile terminalThe difference of the light leak value of readings and the range sensor;Second deviation is second pre- for the screen distance reflecting surface of mobile terminalIf apart from when range sensor readings and the range sensor light leak value difference;First predeterminable range is default less than secondDistance.
Specifically, acquisition module also include initial value setting submodule, judging submodule, initial value update submodule,Light leak value sets submodule;
Wherein, initial value setting submodule is used for the maximum displacement value that can read range sensor as Distance-sensingThe initial value of device;
Whether judging submodule is used to judge the readings of current distance sensor less than initial value, and in current distance sensingWhen the readings of device is less than the initial value, triggers initial value and update the reading that initial value is updated to submodule current distance sensorValue;
Light leak value setting submodule be used for using the initial value after renewal as current distance sensor light leak value.
It is seen that, present embodiment is the system embodiment corresponding with first embodiment, and present embodiment can be withFirst embodiment is worked in coordination enforcement.The relevant technical details mentioned in first embodiment still have in the present embodimentEffect, in order to reduce repetition, repeats no more here.Correspondingly, the relevant technical details mentioned in present embodiment are also applicable inIn first embodiment.
It is noted that each module involved in present embodiment is logic module, in actual applications, oneIndividual logical block can be a part for a physical location, or a physical location, can be with multiple physics listsThe combination of unit is realized.Additionally, the innovative part in order to project the present invention, will not be with solution institute of the present invention in present embodimentThe unit that the technical problem relation of proposition is less close is introduced, but this is not intended that in present embodiment there are no other listsUnit.
It will be understood by those skilled in the art that the respective embodiments described above are to realize the specific embodiment of the present invention,And in actual applications, can in the form and details to it, various changes can be made, without departing from the spirit and scope of the present invention.