Summary of the invention
For above-mentioned defect, the object of the present invention is to provide a kind of method and mobile terminal of dynamic adjustments range sensor threshold value, it can avoid mobile terminal undetected problem near state of range sensor when call, to automatically go out screen; And mobile terminal bright screen automatically still after talk-through, thereby convenient for users.
To achieve these goals, the invention provides a kind of method of dynamic adjustments range sensor threshold value, comprise that step has:
The first determining step, when unlatching range sensor is conversed, judges whether described range sensor detects near state;
Threshold value regulating step, if do not detect described near state, in predetermined system is gone out screen time T, by close the state-detection of described range sensor apart from least increasing predetermined value or predetermined ratio;
The second determining step, according to the described close state-detection distance after each adjusting, judges whether described range sensor detects described near state;
The first screen step of going out, if describedly detect after near state-detection distance describedly near state regulating, switches to from bright screen state the screen state that goes out by screen;
The second screen step of going out, if described system is gone out, screen time T does not detect describedly near state yet after arriving, and screen is switched to the screen state that goes out from bright screen state.
According to method of the present invention, after described the first determining step, also comprise:
The 3rd screen step of going out, if detect describedly near state, switches to from bright screen state the screen state that goes out by screen.
According to method of the present invention, described first screen that goes out also comprises after step:
The 3rd determining step, after described talk-through, judges whether described range sensor detects away from state;
Bright screen step, if detect describedly away from state, switches to described bright screen state by described screen from the described screen state that goes out.
According to method of the present invention, described threshold value regulating step further comprises:
A, the predetermined system screen time T of going out is divided into N grade, and timer, interval threshold M and variable i is set, the initial value of described variable i is 0;
B, when i T/N arrives constantly, trigger described timer, i=i+1 is set, and near state-detection, apart from corresponding upper limit light threshold value, reduce predetermined value or predetermined ratio by described;
Described the second determining step further comprises:
C, judge i <=N and regulate after described upper limit light threshold value than the predetermined large M of lower limit light threshold value, whether can set up above simultaneously, if set up and perform step D simultaneously, otherwise carry out the described second screen step of going out;
D, according to the described upper limit light threshold value after regulating, judge whether described range sensor detects described near state, if detect, describedly near state, carry out the described first screen step of going out, otherwise turn back to described step B.
According to method of the present invention, described first screen that goes out also comprises after step:
Recalibrate step, cancel described timer, and call range calibration interface and the described upper limit light threshold value after current adjusting is made as to the upper limit light threshold value of acquiescence.
The present invention also provides a kind of mobile terminal, includes:
The first judge module, for when unlatching range sensor is conversed, judges whether described range sensor detects near state;
Threshold value adjustment module, described when the state for not detecting, in predetermined system is gone out screen time T, by close the state-detection of described range sensor apart from least increasing predetermined value or predetermined ratio;
The second judge module, for according to the described close state-detection distance after each adjusting, judges whether described range sensor detects described near state;
First panel module that goes out, if for describedly detecting after near state-detection distance describedly during near state regulating, switch to from bright screen state the screen state that goes out by screen;
Second panel module that goes out, if go out and do not detect yet describedly during near state after screen time T arrives for described system, switches to from bright screen state the screen state that goes out by screen.
According to mobile terminal of the present invention, also comprise:
The 3rd panel module that goes out, if detect describedly during near state for described the first judge module, switches to from bright screen state the screen state that goes out by screen.
According to mobile terminal of the present invention, also comprise:
The 3rd judge module, for when described first panel module that goes out, described screen being gone out screen state and described talk-through described in described bright screen state switches to, judges whether described range sensor detects away from state;
Bright screen module, if described during away from state for detecting, switches to described bright screen state by described screen from the described screen state that goes out.
According to mobile terminal of the present invention, described threshold value adjustment module further comprises:
Submodule is set, is divided into N grade, and timer, interval threshold M and variable i are set for screen time T that predetermined system is gone out, the initial value of described variable i is 0;
Regulate submodule, for trigger described timer when i T/N arrives constantly, i=i+1 is set, and near state-detection, apart from corresponding upper limit light threshold value, reduce predetermined value or predetermined ratio by described;
Described the second judge module further comprises:
The first judgement submodule, for judging the described upper limit light threshold value after i <=N and adjusting, than the predetermined large M of lower limit light threshold value, whether can set up above simultaneously, if set up simultaneously, transfer to the second judgement submodule to process, otherwise to transfer to described second panel module that goes out to process;
The second judgement submodule, be used for according to the described upper limit light threshold value after regulating, judge whether described range sensor detects described near state, if detect, describedly near state, transfer to described first panel module that goes out to process, otherwise transfer to described adjusting submodule to process.
According to mobile terminal of the present invention, also comprise:
Recalibrate module, for described screen being gone out screen state described in described bright screen state switches to when described first panel module that goes out, cancel described timer, and call range calibration interface and the described upper limit light threshold value after current adjusting is made as to the upper limit light threshold value of acquiescence.
The present invention is by dynamic adjustments range sensor threshold value, in system is gone out screen time T, the close state-detection distance of range sensor is at least increased to predetermined value or predetermined ratio, to be more prone to detect near state, thereby avoid mobile terminal when call range sensor undetected near state, the mobile terminal problem of bright screen automatically after the talk-through causing.Whereby, mobile terminal of the present invention can increase because detecting near automatically the go out possibility of screen of state in when call, and therefore, when talk-through and mobile terminal leave head, mobile terminal still can be realized automatic bright screen, thereby greatly facilitates user's use.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
Fig. 1 is the structural representation of mobile terminal of the present invention, described mobile terminal 100 can be mobile phone, PDA (Personal Digital Assistant, personal digital assistant), panel computer etc., and described mobile terminal 100 comprises the first judge module 10, threshold value adjustment module 20, the second judge module 30, first panel module 40 and second panel module 50 that goes out that goes out, wherein:
Described the first judge module 10, for when opening range sensor and converse, whether judging distance transducer detects near state, detects the close state-detection distance whether distance between mobile terminal 100 and user's head is less than acquiescence.If the first judge module 10 detects near state, can directly screen be switched to the screen state that goes out from bright screen state.
Described threshold value adjustment module 20, while being used for not detecting near state, for example, in predetermined system is gone out screen time T (15 seconds), close the state-detection distance of range sensor is at least increased to predetermined value or predetermined ratio, to be more prone to detect close state.
Described the second judge module 30, the close state-detection distance after regulating for basis is each, whether judging distance transducer detects near state.
Described first panel module 40 that goes out, if when detecting near state after regulating near state-detection distance, switches to from bright screen state the screen state that goes out by screen.Like this, when talk-through and mobile terminal leave head, mobile terminal 100 still can be realized automatic bright screen.
Described second panel module 50 that goes out, if go out while not detecting yet near state after screen time T arrives for system, switches to from bright screen state the screen state that goes out by screen.Now, illustrate that when call range sensor is not near head, the system of now system setting is gone out screen time T to causing mobile terminal 100 screen that automatically goes out.
Fig. 2 is the structural representation of preferable mobile terminal end of the present invention, described mobile terminal 100 comprises the first judge module 10, threshold value adjustment module 20, the second judge module 30, first go out panel module 40, second go out panel module 50, the 3rd go out panel module 60, the 3rd judge module 70, bright screen module 80 and/or recalibrate module 90, wherein:
Described the first judge module 10, for when unlatching range sensor is conversed, whether judging distance transducer detects near state.In the present embodiment, described range sensor is that light value detects range sensor, the principle that light value detects range sensor is: when values of light (this values of light is the values of light reflecting after the infrared light of range sensor chip internal transmitting blocks due to object) that range sensor is checked through is greater than apart from upper limit light threshold value, produce near interrupting, its middle distance upper limit light threshold value determines the length of the distance that detects.
The described the 3rd panel module 60 that goes out, if while detecting near state for the first judge module 10, directly switch to from bright screen state the screen state that goes out by screen.
Described threshold value adjustment module 20 further comprises:
Submodule 21 is set, if do not detect describedly when the state for the first judge module 10, the predetermined system screen time T of going out is divided into N grade, and timer, interval threshold M and variable i are set, the initial value of variable i is.Preferably, the system that submodule 21 first acquisition system settings the are set screen time T (for example 15 seconds) of going out, is divided into N grade (for example N=3) by the system screen time T of going out, and increase timer, and setting timer when T/N is triggered; Variable i is set to judge whether to reach automatic adjusting threshold number, the initial value of variable i is 0; Interval threshold M (for example M=50) is set, to guarantee that the upper limit light threshold value after adjusting must be greater than M values of light of lower limit light threshold value, described upper limit light threshold value is corresponding to state, described lower limit light threshold value correspondence is away from state, but need there is certain intervals threshold value M between upper limit light threshold value and lower limit light threshold value, otherwise can near state and away from the critical point of state on stable not, to meet the object of range sensor operation principle.The upper limit threshold that the upper limit light threshold value of adjusting is acquiescence: current_hi_threshold=hi_threshold is set during beginning.
Regulate submodule 22, for (when i rank arrives) triggering timer when i T/N arrives constantly, i=i+1 is set, and will apart from corresponding upper limit light threshold value, reduces predetermined value or predetermined ratio near state-detection.Current_hi_threshold=(1-X%) current_hi_threshold for example, regulates upper limit light threshold value to make it to reduce X% (for example 5%).
Described the second judge module 30 further comprises:
The first judgement submodule 31, for judging the upper limit light threshold value after i <=N and adjusting, than the predetermined large M of lower limit light threshold value, whether can set up above simultaneously, whether (i <=n & & current_hi_threshold > low_thresldhold+M) sets up simultaneously, if set up simultaneously, transfer to the second judgement submodule 32 to process, otherwise to transfer to second panel module 50 that goes out to process.
The second judgement submodule 32, be used for according to the upper limit light threshold value after regulating, whether judging distance transducer detects near state, if detect near state, produce near interrupting and transferring to first panel module 40 that goes out to process, otherwise transfer to regulate submodule 22 to process, to carry out the dynamic adjustments threshold value of i+1 time, until (i <=n & & current_hi_threshold > low_thresldhold+M) is the false flow process that just exits.
Described second panel module 50 that goes out, if go out while not detecting yet near state after screen time T arrives for system, switches to the screen state that goes out to save power consumption by screen from bright screen state, and finishes whole flow process.
Described first panel module 40 that goes out, if when detecting near state after regulating near state-detection distance, switches to from bright screen state the screen state that goes out by screen.
Described the 3rd judge module 70, for screen being switched to and gone out screen state and talk-through from bright screen state when first panel module 40 that goes out, whether judging distance transducer detects away from state, if detect away from state, can produce away from interruption.
Described bright screen module 80, if when detecting away from state, switches to bright screen state by screen from the screen state that goes out, so that user normally uses mobile terminal 100.
Described recalibration module 90, for screen being switched to and is gone out screen state from bright screen state when first panel module 40 that goes out, cancel timer, and call range calibration interface and the upper limit light threshold value after current adjusting is made as to the upper limit light threshold value of acquiescence, to guarantee the reliability of range sensor.
The present invention by dynamic adjustments apart from upper limit threshold, with avoid when mobile terminal 100 during near head range sensor miss near interrupting (and away from interrupt generally can not miss), the problem that the mobile terminal 100 causing still can not bright screen at talk-through.The present invention is before mobile terminal goes out screen automatically, if N level dynamic adjustments is apart from upper limit threshold, upper limit light threshold value and the relation that is inversely proportional near state-detection distance, reduce to make close state-detection distance elongated apart from upper limit light threshold value, makes to be more prone to produce near interrupting.
Fig. 3 is the flow chart of the method for dynamic adjustments range sensor threshold value of the present invention, and it can be realized by mobile terminal 100 as shown in Figure 1 or 2, comprises that step has:
Step S301, the first determining step, when unlatching range sensor is conversed, whether judging distance transducer detects near state.Detect the close state-detection distance whether distance between mobile terminal 100 and user's head is less than acquiescence.If the first judge module 10 detects near state, can directly screen be switched to the screen state that goes out from bright screen state.
Step S302, threshold value regulating step, if do not detect near state, in predetermined system is gone out screen time T, at least increases predetermined value or predetermined ratio by close the state-detection distance of range sensor, to be more prone to detect close state.
Step S303, the second determining step, according to the close state-detection distance after each adjusting, whether judging distance transducer detects near state.
Step S304, the first screen step of going out, if detect near state after regulating near state-detection distance, switches to from bright screen state the screen state that goes out by screen.Like this, when talk-through and mobile terminal leave head, mobile terminal 100 still can be realized automatic bright screen.
Step S305, the second screen step of going out, if system is gone out, screen time T does not detect yet near state after arriving, and screen is switched to the screen state that goes out from bright screen state.Now range sensor is not all the time near head when call explanation, when system is gone out screen time T to causing mobile terminal 100 screen that automatically goes out.
Fig. 4 is the preferred flow charts of the method for dynamic adjustments range sensor threshold value of the present invention, and it can be realized by mobile terminal 100 as shown in Figure 2, comprises that step has:
Step S401, opens range sensor and converses.
Step S402, whether judging distance transducer detects near state, if perform step S403, otherwise execution step S404.In the present embodiment, described range sensor is that light value detects range sensor.
Step S403, if detect near state, directly switches to screen to go out screen state and exit flow process from bright screen state.
Step S404, if do not detect near state, the system of first acquisition system of the system setting screen time T (for example 15 seconds) of going out, is divided into N grade (for example N=3) by the system screen time T of going out, increase timer, and setting timer when T/N is triggered; Variable i is set to judge whether to reach automatic adjusting threshold number, the initial value of variable i is 0; Interval threshold M (for example M=50) is set, to guarantee that the upper limit light threshold value after adjusting must be greater than M values of light of lower limit light threshold value, described upper limit light threshold value is corresponding to state, described lower limit light threshold value correspondence is away from state, but need there is certain intervals threshold value M between upper limit light threshold value and lower limit light threshold value, otherwise can near state and away from the critical point of state on stable not, to meet the object of range sensor operation principle.The upper limit threshold that the upper limit light threshold value of adjusting is acquiescence: current_hi_threshold=hi_threshold is set during beginning.
Step S405, when i T/N arrives constantly, (when i rank arrives) triggers timer, carry out timing function, i=i+1 is set in timing function, and will apart from corresponding upper limit light threshold value, reduce predetermined value or predetermined ratio near state-detection, current_hi_threshold=(1-X%) current_hi_threshold for example, regulates upper limit light threshold value to make it to reduce X% (for example 5%).
Step S406, whether judgement (i <=n & & current_hi_threshold > low_thresldhold+M) sets up simultaneously, judge whether the upper limit light threshold value after i <=N and adjusting can be set up above than the predetermined large M of lower limit light threshold value simultaneously, if set up and perform step S407 simultaneously, otherwise execution step S408.
Step S407, according to the upper limit light threshold value after regulating, whether judging distance transducer detects near state, if detect near state and perform step S409, otherwise turn back to step S405, carry out the dynamic adjustments threshold value of i+1 time, until (i <=n & & current_hi_threshold > low_thresldhold+M) is the false flow process that just exits.
Step S408, if system is gone out, screen time T does not detect yet near state after arriving, and screen is switched to the screen state that goes out to save power consumption from bright screen state, and finishes whole flow process.After representing the i time (i is the last number of times that regulates threshold value) adjusting threshold value, range sensor still detects away from state, and when call is described, range sensor is not near head.Automatically time is up can cause the mobile terminal screen that automatically goes out for the screen that goes out of now system setting.
Step S409, if detect near state after regulating near state-detection distance, switches to from bright screen state the screen state that goes out by screen.Now, represent that range sensor has made the mobile terminal screen that goes out, and now can produce near interruption.
Step S410, cancel timer, thereby and call the flow process that upper limit light threshold value that range calibration interface is made as acquiescence by the upper limit light threshold value after current adjusting completes whole dynamic adjustments threshold value, to guarantee the reliability of range sensor, be the calibration that range sensor re-starts upper limit threshold, with amended upper limit light threshold value, detect in the future.
Step S411, after talk-through, whether judging distance transducer detects away from state, if perform step S412, otherwise continues to carry out this step S411.
Step S412, if detect away from state, switches to bright screen state by screen from the screen state that goes out, and user can normally use mobile terminal 100 again like this.
In sum, the present invention is by dynamic adjustments range sensor threshold value, in system is gone out screen time T, the close state-detection distance of range sensor is at least increased to predetermined value or predetermined ratio, to be more prone to detect near state, thereby avoid mobile terminal when call range sensor undetected near state, the mobile terminal problem of bright screen automatically after the talk-through causing.Whereby, mobile terminal of the present invention can increase because detecting near automatically the go out possibility of screen of state in when call, and therefore, when talk-through and mobile terminal leave head, mobile terminal still can be realized automatic bright screen, thereby greatly facilitates user's use.
Certainly; the present invention also can have other various embodiments; in the situation that not deviating from spirit of the present invention and essence thereof; those of ordinary skill in the art are when making according to the present invention various corresponding changes and distortion, but these corresponding changes and distortion all should belong to the protection range of the appended claim of the present invention.