Summary of the invention
For above-mentioned defective, the object of the present invention is to provide a kind of method and portable terminal of dynamic adjustments range sensor threshold value, it can avoid portable terminal undetected problem near state of range sensor when conversation, in order to automatically go out screen; And portable terminal automatic bright screen still behind 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 the unlatching range sensor is conversed, judges whether described range sensor detects near state;
The threshold value regulating step, if do not detect described near state, then in the screen time T is gone out in predetermined system, with close the state-detection of described range sensor apart from increasing at least predetermined value or predetermined ratio;
The second determining step, according to the described close state-detection distance after each adjusting, it is described near state to judge whether described range sensor detects;
The first screen step of going out if describedly detect after near the state-detection distance describedly near state regulating, then switches to the screen state that goes out with screen from the bright screen state;
The second screen step of going out does not detect describedly near state yet after the screen time T arrives if described system goes out, then screen is switched to the screen state that goes out from the bright screen state.
According to method of the present invention, also comprise after described the first determining step:
The 3rd screen step of going out if detect describedly near state, then switches to the screen state that goes out with screen from the bright screen state.
According to method of the present invention, described first screen that goes out also comprises after the step:
The 3rd determining step behind described talk-through, judges whether described range sensor detects away from state;
The bright screen step if detect describedly away from state, then switches to described bright screen state with 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 are 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 reduce predetermined value or predetermined ratio near state-detection apart from the upper limit light threshold value of correspondence with described;
Described the second determining step further comprises:
C, judge i<=N and regulate after the predetermined large M of lower limit light threshold value of described upper limit light threshold ratio more than whether can set up simultaneously, if set up simultaneously then execution in step D, otherwise carry out the described second screen step of going out;
D, according to the described upper limit light threshold value after regulating, it is described near state to judge whether described range sensor detects, and describedly then carries out the described first screen step of going out near state if detect, otherwise turns back to described step B.
According to method of the present invention, described first screen that goes out also comprises after the step:
Recalibrate step, cancel described timer, and call the upper limit light threshold value that the described upper limit light threshold value of range calibration interface after with current adjusting is made as acquiescence.
The present invention also provides a kind of portable terminal, includes:
The first judge module is used for when the unlatching range sensor is conversed, and judges whether described range sensor detects near state;
The threshold value adjustment module, be used for not detecting described during near state, in the screen time T is gone out in predetermined system, with close the state-detection of described range sensor apart from increasing at least predetermined value or predetermined ratio;
The second judge module is used for according to the described close state-detection distance after each the adjusting, and it is described near state to judge whether described range sensor detects;
First panel module that goes out if be used for describedly detecting after near the state-detection distance describedly during near state regulating, switches to the screen state that goes out with screen from the bright screen state;
Second panel module that goes out goes out and does not detect yet describedly during near state after the screen time T arrives if be used for described system, and screen is switched to the screen state that goes out from the bright screen state.
According to portable terminal of the present invention, also comprise:
The 3rd panel module that goes out detects describedly during near state if be used for described the first judge module, and screen is switched to the screen state that goes out from the bright screen state.
According to portable terminal of the present invention, also comprise:
The 3rd judge module is used for going out panel module switches to described go out screen state and described talk-through with described screen from described bright screen state after when described first, judges whether described range sensor detects away from state;
The bright screen module if be used for detecting described during away from state, switches to described bright screen state with described screen from the described screen state that goes out.
According to portable terminal of the present invention, described threshold value adjustment module further comprises:
Submodule is set, is divided into N grade for screen time T that predetermined system is gone out, and timer, interval threshold M and variable i are set, the initial value of described variable i is 0;
Regulate submodule, be used for when i T/N arrives constantly, triggering described timer, i=i+1 is set, and with upper limit light threshold value minimizing predetermined value or the predetermined ratio of described close state-detection apart from correspondence;
Described the second judge module further comprises:
First judges submodule, be used for judging i<=N and regulate after the large M of lower limit light threshold value that is scheduled to of described upper limit light threshold ratio more than whether can set up simultaneously, if set up simultaneously and then transfer to second and judge that submodule processes, process otherwise transfer to described second panel module that goes out;
Second judges submodule, be used for according to the described upper limit light threshold value after regulating, it is described near state to judge whether described range sensor detects, and describedly then transfers to described first panel module that goes out near state and processes if detect, and processes otherwise transfer to described adjusting submodule.
According to portable terminal of the present invention, also comprise:
Recalibrate module, be used for going out after panel module switches to the described screen state that goes out with described screen from described bright screen state when described first, cancel described timer, and call the upper limit light threshold value that the described upper limit light threshold value of range calibration interface after with current adjusting is made as acquiescence.
The present invention is by dynamic adjustments range sensor threshold value, namely in the screen time T is gone out in system, the close state-detection distance of range sensor is increased predetermined value or predetermined ratio at least, in order to be more prone to detect near state, thereby avoid portable terminal when conversation range sensor undetected near state, the automatic problem of bright screen of portable terminal behind the talk-through that causes.Whereby, portable terminal of the present invention can increase because detecting near automatically the go out possibility of screen of state in when conversation, and therefore when talk-through and portable terminal left head, portable terminal still can be realized automatic bright screen, thereby greatly facilitates user's use.
Embodiment
In order to make purpose 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 portable terminal of the present invention, described portable terminal 100 can be mobile phone, PDA (Personal Digital Assistant, personal digital assistant), panel computer etc., and described portable 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 is used for when opening range sensor and converse, and whether the judging distance transducer detects near state, whether namely detects distance between portable terminal 100 and the user's head less than the close state-detection distance of giving tacit consent to.If the first judge module 10 detects near state, then can directly screen be switched to the screen state that goes out from the bright screen state.
Described threshold value adjustment module 20, when being used for not detecting near state, in screen time T (for example 15 seconds) is gone out in predetermined system, close the state-detection distance of range sensor is increased predetermined value or predetermined ratio at least, in order to be more prone to detect close state.
Described the second judge module 30 is used for according to the close state-detection distance after each the adjusting, and whether the judging distance transducer detects near state.
Described first panel module 40 that goes out is if when being used for detecting near state, switch to the screen state that goes out with screen from the bright screen state after regulating near the state-detection distance.Like this, when talk-through and portable terminal left head, portable terminal 100 still can be realized automatic bright screen.
Described second panel module 50 that goes out goes out when not detecting yet near state after the screen time T arrives if be used for system, and screen is switched to the screen state that goes out from the bright screen state.At this moment, when conversation range sensor is described not near head, the screen time T is gone out to causing portable terminal 100 screen that automatically goes out in the system of system's setting this moment.
Fig. 2 is the structural representation of preferable mobile terminal end of the present invention, described portable 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 is used for when the unlatching range sensor is conversed, and whether the 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 that range sensor is checked through (this values of light is that the infrared light of range sensor chip internal emission is because the values of light that object reflects after blocking) produces during greater than distance upper limit light threshold value 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 is if when being used for the first judge module 10 and detecting near state, directly switch to the screen state that goes out with screen from the bright screen state.
Described threshold value adjustment module 20 further comprises:
Submodule 21 is set, does not detect describedly during near state if be used 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 the setting of submodule 21 at first acquisition systems the is set screen time T (for example 15 seconds) of going out is divided into N grade (for example N=3) with system's 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 the 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 between upper limit light threshold value and the lower limit light threshold value certain intervals threshold value M need be arranged, otherwise can near state and away from the critical point of state on stable not, to meet the purpose of range sensor operation principle.The upper limit light threshold value of adjusting is set during beginning is the upper limit threshold of acquiescence: current_hi_threshold=hi_threshold.
Regulate submodule 22, be used for (when i rank arrives) triggering timer when i T/N arrives constantly, i=i+1 is set, and will be near upper limit light threshold value minimizing predetermined value or the predetermined ratio of state-detection apart from correspondence.Current_hi_threshold=(1-X%) current_hi_threshold for example namely regulates upper limit light threshold value and makes it to reduce X% (for example 5%).
Described the second judge module 30 further comprises:
First judges submodule 31, be used for judging i<=N and regulate after the large M of lower limit light threshold value that is scheduled to of upper limit light threshold ratio more than whether can set up simultaneously i.e. (i<=n ﹠amp; ﹠amp; Whether current_hi_threshold>low_thresldhold+M) sets up simultaneously, then transfers to second and judges that submodule 32 processes if set up simultaneously, processes otherwise transfer to second panel module 50 that goes out.
Second judges submodule 32, be used for according to the upper limit light threshold value after regulating, whether the judging distance transducer detects near state, then produce near interrupting and transferring to first panel module 40 that goes out and process if detect near state, otherwise transferring to adjusting submodule 22 processes, to carry out i+1 time dynamic adjustments threshold value, until (i<=n﹠amp; ﹠amp; Current_hi_threshold>low_thresldhold+M) is the false flow process that just withdraws from.
Described second panel module 50 that goes out goes out when not detecting yet near state after the screen time T arrives if be used for system, screen is switched to the screen state that goes out saving power consumption from the bright screen state, and finish whole flow process.
Described first panel module 40 that goes out is if when being used for detecting near state, switch to the screen state that goes out with screen from the bright screen state after regulating near the state-detection distance.
Described the 3rd judge module 70 is used for going out after panel module 40 switches to go out screen state and talk-through with screen from the bright screen state when first, and whether the judging distance transducer detects away from state, can produce away from interruption if detect away from state.
Described bright screen module 80 is if when being used for detecting away from state, switch to the bright screen state with screen from the screen state that goes out, so that the user normally uses portable terminal 100.
Described recalibration module 90, be used for going out after panel module 40 switches to the screen state that goes out with screen from the bright screen state when first, the cancellation timer, and call the upper limit light threshold value that the upper limit light threshold value of range calibration interface after with current adjusting is made as acquiescence, to guarantee the reliability of range sensor.
The present invention by dynamic adjustments apart from upper limit threshold, with avoid when portable terminal 100 during near head range sensor miss near interrupting (and away from interrupt generally can not miss), the portable terminal 100 that causes talk-through still can not bright screen problem.The present invention is before portable terminal goes out screen automatically, if N level dynamic adjustments is apart from upper limit threshold, upper limit light threshold value and the close state-detection distance relation of being inversely proportional to namely reduce apart from upper limit light threshold value so that make near state-detection apart from elongated, so that be more prone to produce near interruption.
Fig. 3 is the flow chart of the method for dynamic adjustments range sensor threshold value of the present invention, and it can pass through to realize such as Fig. 1 or portable terminal 100 shown in Figure 2, comprise that step has:
Step S301, the first determining step, when the unlatching range sensor was conversed, whether the judging distance transducer detected near state.Namely detect distance between portable terminal 100 and the user's head whether less than the close state-detection distance of acquiescence.If the first judge module 10 detects near state, then can directly screen be switched to the screen state that goes out from the bright screen state.
Step S302, the threshold value regulating step if do not detect near state, then in the screen time T is gone out in predetermined system, increases predetermined value or predetermined ratio with close the state-detection distance of range sensor, in order to be more prone to detect close state at least.
Step S303, the second determining step, according to the close state-detection distance after each adjusting, whether the judging distance transducer detects near state.
Step S304, the first screen step of going out if detect near state, then switches to the screen state that goes out with screen from the bright screen state after regulating near the state-detection distance.Like this, when talk-through and portable terminal left head, portable terminal 100 still can be realized automatic bright screen.
Step S305, the second screen step of going out does not detect yet near state after the screen time T arrives if system goes out, and then screen is switched to the screen state that goes out from the bright screen state.When conversation this moment explanation, range sensor was all the time near head, when the screen time T is gone out to causing portable terminal 100 screen that automatically goes out in system.
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 portable terminal 100 as shown in Figure 2, comprise that step has:
Step S401 opens range sensor and converses.
Whether step S402, judging distance transducer detect near state, if execution in step S403 then, otherwise execution in step S404.In the present embodiment, described range sensor is that light value detects range sensor.
Step S403 if detect near state, then directly switches to screen and goes out the screen state and withdraw from flow process from the bright screen state.
Step S404, if do not detect near state, the system of at 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) with system's 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 the 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 between upper limit light threshold value and the lower limit light threshold value certain intervals threshold value M need be arranged, otherwise can near state and away from the critical point of state on stable not, to meet the purpose of range sensor operation principle.The upper limit light threshold value of adjusting is set during beginning is the upper limit threshold of acquiescence: current_hi_threshold=hi_threshold.
Step S405, (when i rank arrives) triggers timer when i T/N arrives constantly, carry out timing function, i=i+1 is set in timing function, and will be near upper limit light threshold value minimizing predetermined value or the predetermined ratio of state-detection apart from correspondence, current_hi_threshold=(1-X%) current_hi_threshold for example namely regulates upper limit light threshold value and makes it to reduce X% (for example 5%).
Step S406 judges (i<=n﹠amp; ﹠amp; Current_hi_threshold>low_thresldhold+M) whether set up simultaneously, namely judge i<=N and regulate after the predetermined large M of lower limit light threshold value of upper limit light threshold ratio more than whether can set up simultaneously, if set up simultaneously then execution in step S407, otherwise execution in step S408.
Step S407, according to the upper limit light threshold value after regulating, whether the judging distance transducer detects near state, if detect then execution in step S409 of close state, otherwise turn back to step S405, carry out i+1 time dynamic adjustments threshold value, until (i<=n﹠amp; ﹠amp; Current_hi_threshold>low_thresldhold+M) is the false flow process that just withdraws from.
Step S408 does not detect yet near state after the screen time T arrives if system goes out, and then screen is switched to the screen state that goes out with the saving power consumption from the bright screen state, and finishes whole flow process.Represent the i time (i is the last number of times of regulating threshold value) regulate threshold value after range sensor still detect away from state the not close head of range sensor when conversation be described.Automatically time is up can cause the portable terminal screen that automatically goes out for the screen that goes out of system setting this moment.
Step S409 if detect near state, then switches to the screen state that goes out with screen from the bright screen state after regulating near the state-detection distance.At this moment, the expression range sensor is the screen so that portable terminal goes out, can produce this moment near interrupting.
Step S410, the cancellation timer, thereby and call the flow process that upper limit light threshold value that the upper limit light threshold value of range calibration interface after with current adjusting be made as acquiescence is finished whole dynamic adjustments threshold value, to guarantee the reliability of range sensor, be the calibration that range sensor re-starts upper limit threshold, detect with amended upper limit light threshold value in the future.
Step S411, behind talk-through, whether the judging distance transducer detects away from state, if execution in step S412 then, otherwise continue to carry out this step S411.
Step S412 if detect away from state, then switches to the bright screen state with screen from the screen state that goes out, and the user can normally use portable terminal 100 again like this.
In sum, the present invention is by dynamic adjustments range sensor threshold value, namely in the screen time T is gone out in system, the close state-detection distance of range sensor is increased predetermined value or predetermined ratio at least, in order to be more prone to detect near state, thereby avoid portable terminal when conversation range sensor undetected near state, the automatic problem of bright screen of portable terminal behind the talk-through that causes.Whereby, portable terminal of the present invention can increase because detecting near automatically the go out possibility of screen of state in when conversation, and therefore when talk-through and portable terminal left head, portable 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 does not deviate from spirit of the present invention and essence thereof; those of ordinary skill in the art work as can make 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.