Dormancy control method and terminal
Technical field
The present invention relates to areas of information technology, particularly to a kind of dormancy control method and terminal.
Background technology
Along with popularizing of big screen intelligent terminal, system auto sleep function becomes more and more important.How to enter
Row dormancy control is reduction intelligent terminal's power consumption, extend intelligent terminal uses the effective ways of time.
At present, dormancy control method includes the most several: first method, is determined by intelligent terminal one
It is not received by user within fixing time the mode of auto sleep after any operation of this intelligent terminal is controlled not
Sleep.Second method, utilizes the photographic head of intelligent terminal to catch human eye before performing sleep operation by system
Image, according to identifying the presence or absence of human eye, opening or Guan Bi situation automatically controls dormancy.
For first method, if system performs such as video playback, lantern slide and browses, sees that novel etc. is appointed
Business, operating time interval often exceedes the dormancy time of default, both when dormancy time arrives, and
This system is not carried out any operation.Now, if system is set to forbid dormancy, when temporarily away from time must
Pause key must be pressed or closing key forces the system into dormancy, otherwise cannot automatic pause, and electricity can be wasted
Amount;If provided as allowing auto sleep, then it is necessary for constantly touching when screen is dimmed seeing
Screen or operation, in order to reawake system, it is to avoid system enters resting state, thus adds extra behaviour
Make, affect Consumer's Experience.
For second method, owing to can compare through normally open photographic head and analyze face and eye image
Relatively take electricity.If ambient light is very dark, or human eye is not at screen dead ahead, or during photographic head detection just
Fortunately close one's eyes, can cause cannot correctly controlling dormancy.
Summary of the invention
In order to solve the problem of background technology, embodiments provide a kind of dormancy control method and terminal.
Described technical scheme is as follows:
First aspect, it is provided that a kind of dormancy control method, described method includes:
Every the distance of Preset Time detection terminal with objects in front within the time period of dormancy countdown, and obtain
Take the range difference between the distance that twice detection obtains;
Judge whether the range difference between the distance that described twice detection obtains reaches predetermined threshold value;
If the range difference between the distance that described twice detection obtains reaches described predetermined threshold value, then control institute
State terminal and do not carry out dormancy;
Before described dormancy, it is gradually lowered the screen intensity of described terminal, dormancy shape will be entered with prompting
State;
If the range difference between the distance that described twice detection obtains is not up to described predetermined threshold value, then in institute
State after dormancy countdown terminates, control described terminal and carry out dormancy.
Preferably, whether the described range difference judged between the distance that described twice detection obtains reaches to preset threshold
Before value, also include:
Sensitivity adjusting parameter is set, and regulates described predetermined threshold value according to described sensitivity adjusting parameter.
Preferably, after the described terminal of described control does not carries out dormancy, also include:
Time period length according to described dormancy countdown arranges the waiting time segment length of dormancy next time, described
The waiting time segment length of dormancy next time is more than this dormancy waiting time segment length.
Preferably, the range difference between the distance that twice detection of described acquisition obtains, including:
The distance obtained will be detected for the first time as initial distance within the time period of described dormancy countdown, and
The range difference every time detected between the distance obtained and described initial distance afterwards is detected as described twice
Range difference between the distance arrived;
Or, obtain the range difference between the distance that adjacent twice detection obtains, and adjacent twice detected
To distance between the distance that obtains as described twice detection of range difference between range difference.
On the other hand, it is provided that a kind of terminal, described terminal includes:
Detection module, for detecting terminal and front square object every Preset Time within the time period of dormancy countdown
The distance of body;
Acquisition module, for obtaining the range difference between the distance that twice detection obtains;
Judge module, for judging whether the range difference between the distance that described twice detection obtains reaches default
Threshold value;
Control module, reaches described default threshold for the range difference between the distance that described twice detection obtains
During value, then control described terminal and do not carry out dormancy;
Reminding module, for before described dormancy, is gradually lowered the screen intensity of described terminal, with prompting
Resting state will be entered;
Described control module, the range difference being additionally operable between the distance that described twice detection obtains is not up to institute
When stating predetermined threshold value, then after described dormancy countdown terminates, control described terminal and carry out dormancy.
Preferably, described terminal, also include:
Module is set, is used for arranging sensitivity adjusting parameter;
Adjustment module, for regulating described predetermined threshold value according to described sensitivity adjusting parameter.
Preferably, described terminal, also include:
Reset module, during for arranging the wait of dormancy next time according to the time period length of described dormancy countdown
Between segment length, the described waiting time segment length of dormancy next time be more than this dormancy waiting time segment length.
Preferably, described acquisition module, including:
First acquiring unit, for for the first time detection within the time period of described dormancy countdown is obtained away from
From as initial distance, and the range difference between the distance obtained and described initial distance will be detected afterwards every time
As the range difference between the distance that described twice detection obtains;
Or, second acquisition unit, for obtaining the range difference between the distance that adjacent twice detection obtains,
And the range difference between the distance adjacent twice detection obtained is as between the distance that described twice detection obtains
Range difference.
The technical scheme that the embodiment of the present invention provides has the benefit that
By between difference and the predetermined threshold value of the distance detected according to twice in dormancy countdown period
Relation, controls whether this terminal carries out dormancy, it is achieved thereby that user does action before terminal, and can be to end
End dormancy is controlled, the most simple to operate, it is also possible to avoid dormancy by mistake.
Accompanying drawing explanation
For the technical scheme being illustrated more clearly that in the embodiment of the present invention, institute in embodiment being described below
The accompanying drawing used is needed to be briefly described, it should be apparent that, the accompanying drawing in describing below is only the present invention
Some embodiments, for those of ordinary skill in the art, on the premise of not paying creative work,
Other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the flow chart of a kind of dormancy control method that the embodiment of the present invention one provides;
Fig. 2 is the flow chart of a kind of dormancy control method that the embodiment of the present invention two provides;
Fig. 3 is the structural representation of the first terminal that the embodiment of the present invention three provides;
Fig. 4 is the structural representation of the second terminal that the embodiment of the present invention three provides;
Fig. 5 is the structural representation of the third terminal that the embodiment of the present invention three provides;
Fig. 6 is the structural representation of the 4th kind of terminal that the embodiment of the present invention three provides;
Fig. 7 is the structural representation of a kind of acquisition module that the embodiment of the present invention three provides.
Detailed description of the invention
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to the present invention
Embodiment is described in further detail.
Embodiment one
Present embodiments provide a kind of dormancy control method, see Fig. 1, the method flow tool that the present embodiment provides
Body is as follows:
101: every the distance of Preset Time detection terminal with objects in front within the time period of dormancy countdown,
And obtain the range difference between the distance that twice detection obtains;
102: judge whether the range difference between the distance that twice detection obtains reaches predetermined threshold value;
103: if the range difference between the distance that obtains of twice detection reaches predetermined threshold value, then control terminal not
Carry out dormancy.
Preferably, it is judged that before whether the range difference between the distance that twice detection obtains reaches predetermined threshold value,
Also include:
Sensitivity adjusting parameter is set, and regulates predetermined threshold value according to sensitivity adjusting parameter.
Preferably, it is judged that after whether the range difference between the distance that twice detection obtains reaches predetermined threshold value,
Also include:
If the range difference between the distance that twice detection obtains is not up to predetermined threshold value, then in dormancy countdown
After end, control terminal and carry out dormancy.
Preferably, before control terminal carries out dormancy, also include:
Before dormancy, it is gradually lowered the screen intensity of terminal, resting state will be entered with prompting.
Preferably, after control terminal does not carries out dormancy, also include:
Time period length according to dormancy countdown resets the waiting time segment length of dormancy next time, until it reaches
Predetermined time period.
Preferably, obtain the range difference between the distance that twice detection obtains, including:
The distance obtained will be detected for the first time as initial distance within the time period of dormancy countdown, and by it
Between the distance that the rear range difference every time detected between distance and the initial distance obtained obtains as twice detection
Range difference;
Or, obtain the range difference between the distance that adjacent twice detection obtains, and adjacent twice detected
To distance between the distance that obtains as twice detection of range difference between range difference.
The method that the present embodiment provides, by dormancy countdown period according to the distance detected for twice
Difference and predetermined threshold value between relation, control whether this terminal carries out dormancy, it is achieved thereby that user is at end
Do action before end, terminal sleeping can be controlled, the most simple to operate, it is also possible to avoid dormancy by mistake.
In order to clearly illustrate a kind of dormancy control method that above-described embodiment provides, in conjunction with above-mentioned enforcement
The content of example, as a example by below embodiment two, is described in detail to a kind of dormancy control method, refer to as
Lower embodiment two.
Embodiment two
Present embodiments providing a kind of dormancy control method, for convenience of description, the dormancy of the present embodiment controls
Terminal is mobile phone, and sets in the system of this mobile phone and center the shortest dormancy time and fall as 15s (second), dormancy
Timing is 5s, and is the distance that 1s detects a mobile phone and objects in front every Preset Time, and predetermined threshold value sets
As a example by being 120s for 10cm (centimetre), the longest dormancy time, the method providing the present embodiment is carried out in detail
Ground illustrates.Seeing Fig. 2, the method flow that the present embodiment provides is specific as follows:
201: every the distance of Preset Time detection mobile phone with objects in front within the time period of dormancy countdown,
And obtain the range difference between the distance that twice detection obtains;
For this step, the shortest dormancy time is 15s, and dormancy countdown is 5s, and Preset Time is 1s, then
In this step last 5s within the shortest dormancy time 15s every 1s detection mobile phone and objects in front away from
From, i.e. after 10s, every the distance of 1s detection mobile phone with objects in front in ensuing 5s.Its
In, the present embodiment not concrete establishing method and numerical value to Preset Time is defined.For example, it is possible at hands
The system of machine sets the concrete numerical value centering the shortest dormancy time, the longest dormancy time and dormancy countdown.
It addition, the detection equipment of detection mobile phone with the distance of objects in front is not specifically limited by the present embodiment, bag
Include but be not limited by the distance-sensor that reflecting interrupter realizes.Additionally, the present embodiment is the most not
The concrete mode of the range difference obtained between the distance that twice detection obtains is defined, includes but not limited to
The following two kinds mode:
First kind of way: the distance obtained will be detected within the time period of dormancy countdown for the first time as initially
Distance, and the range difference every time detected between distance and the initial distance obtained afterwards is detected as twice
Range difference between the distance arrived;
Such as, by mobile phone distance-sensor, when distance dormancy also has 5s, (5s is setting of dormancy countdown
Definite value) distance that detects for the first time this mobile phone and objects in front is 5cm (centimetre), and using 5cm as initially
Distance, detects this mobile phone and objects in front when distance dormancy also has 4s again by mobile phone distance-sensor
Distance is 16cm (centimetre).The difference of 16cm second time detected and initial distance 5cm is as twice inspection
Range difference between the distance recorded.Certainly, mobile phone can also is that other numerical value with the distance of objects in front,
The concrete distance of mobile phone with objects in front is not defined by the present embodiment.
The second way: obtain the range difference between the distance that adjacent twice detection obtains, and by adjacent twice
Range difference between the distance that range difference between the distance that obtains of detection obtains as twice detection.
Such as, this mobile phone and front are detected when distance dormancy also has 2s by mobile phone distance-sensor second time
The distance of object is 5cm.This hands is detected by mobile phone distance-sensor third time when distance dormancy also has 1s
Machine is 16cm with the distance of objects in front.Owing to second time detection is detected as adjacent twice detection with third time,
Then will detect what the 16cm obtained and the difference detecting the 5cm obtained for the second time obtained as twice detection for the third time
Range difference between Ju Li.
What deserves to be explained is, in the present embodiment, timing time each operation of control execution of time set pressed by mobile phone,
The time set carrying out timing can be the system timer in mobile phone, it is also possible to for the dormancy in sleep mode
Timer, or other time set, concrete time set is not defined by the present embodiment.
202: judge whether the range difference between the distance that twice detection obtains reaches predetermined threshold value, if twice
Range difference between the distance that detection obtains is not up to predetermined threshold value, then perform step 203, if twice detection
Range difference between the distance obtained reaches predetermined threshold value, then perform step 204;
For this step, in step 201 as a example by first kind of way, between the distance that twice detection obtains
Range difference is 11cm, and predetermined threshold value is 10cm, and 11cm is more than 10cm, and therefore, twice detection obtains
Range difference between Ju Li reaches predetermined threshold value, performs step 204.
Wherein, the present embodiment not concrete set-up mode and numerical value to predetermined threshold value is defined, including but not
It is limited to arrange sensitivity adjusting parameter, and regulates predetermined threshold value according to sensitivity adjusting parameter, to meet
The different customs of different user and use scene.When being embodied as, user can be according to use habit or use
Scene selects corresponding sensitivity adjusting parameter, to regulate predetermined threshold value.
203: after dormancy countdown terminates, control mobile phone and carry out dormancy, this dormancy control flow terminates.
For this step, in order to play the effect of prompting user, the method that the present embodiment provides also includes
Before dormancy, it is gradually lowered the step of the screen intensity of terminal, resting state will be entered, directly with prompting
After terminating to dormancy countdown, control mobile phone and carry out dormancy.
Wherein, the concrete time starting to be gradually lowered the screen intensity of mobile phone is not defined by the present embodiment,
Before dormancy, such as can during 10s, start to be gradually lowered the screen intensity of mobile phone.It addition, the present embodiment is also
The mode of the screen intensity being gradually lowered mobile phone is not specifically limited.For example, it is possible to reduce by one every 1s
Secondary screen intensity, it is of course also possible to reduce a screen intensity every 500ms, the present embodiment is not to reduction
The concrete interval time of screen intensity is defined.It addition, the present embodiment does not the most carry out the tool of dormancy to mobile phone
Body mode is defined, and such as, it is closing hand phone screen that mobile phone carries out the mode of dormancy.
Concrete, the range difference between the distance that twice detection of mobile phone obtains is as 5cm, less than predetermined threshold value
As a example by 10cm, mobile phone started to be gradually lowered every 400ms the screen intensity of mobile phone before dormancy during 5s, directly
This screen is closed, so that mobile phone enters resting state to controlling mobile phone.
204: after dormancy countdown terminates, control mobile phone and do not carry out dormancy.
For this step, while control mobile phone does not carries out dormancy, the waiting time segment length of dormancy next time is set
Degree, until it reaches or exceed the longest dormancy time.
Wherein, the concrete time period length that the dormancy next time reset is not waited by the present embodiment is defined,
Such as, the concrete time period length that dormancy next time waits resets to the time period length of this dormancy wait
Twice, until it reaches or exceed the longest default dormancy time.
Concrete, the range difference between the distance that twice detection of mobile phone obtains is as 15cm, more than predetermined threshold value
As a example by 10cm, determine that when control mobile phone does not cut out this screen, mobile phone dormancy waiting time segment length 15s is less than
The longest dormancy time length 120s, the concrete time period length that dormancy the most next time waits is set to the two of 15s
Times or twice more than, i.e. 30s or more than 30s.
It should be noted that the present embodiment is only as a example by terminal is as mobile phone, the dormancy control that the present embodiment is provided
Method processed is illustrated.When being embodied as, dormancy controls terminal in addition to mobile phone, it is also possible to for flat board
Computer, or miscellaneous equipment, the specific product form that the present embodiment does not controls terminal to dormancy is defined.
The method that the present embodiment provides, by dormancy countdown period according to the distance detected for twice
Difference and predetermined threshold value between relation, control whether this terminal carries out dormancy, it is achieved thereby that user is at end
Do action before end, terminal sleeping can be controlled, the most simple to operate, it is also possible to avoid dormancy by mistake.
Embodiment three
Present embodiments providing a kind of terminal, this terminal is used for performing above-described embodiment one or embodiment two is carried
The dormancy control method of confession.Seeing Fig. 3, this terminal includes:
Detection module 301, for detecting terminal and front every Preset Time within the time period of dormancy countdown
The distance of object;
Acquisition module 302, for obtaining the range difference between the distance that twice detection obtains;
Judge module 303, for judging whether the range difference between the distance that twice detection obtains reaches to preset threshold
Value;
Control module 304, when the range difference between the distance that twice detection obtains reaches predetermined threshold value,
Then control terminal and do not carry out dormancy.
See Fig. 4, this terminal, also include:
Module 305 is set, is used for arranging sensitivity adjusting parameter;
Adjustment module 306, for regulating predetermined threshold value according to sensitivity adjusting parameter.
Preferably, control module 304, it is additionally operable to the range difference between the distance that twice detection obtains not up to
During predetermined threshold value, then after dormancy countdown terminates, control terminal and carry out dormancy.
See Fig. 5, this terminal, also include:
Reminding module 307, for before dormancy, is gradually lowered the screen intensity of terminal, will enter with prompting
Enter resting state.
See Fig. 6, this terminal, also include:
Reset module 308, for resetting dormancy countdown next time according to the time period length of dormancy countdown
Time period length, until it reaches predetermined time period.
See Fig. 7, acquisition module 302, including:
First acquiring unit 3021, for for the first time detection within the time period of dormancy countdown is obtained away from
From as initial distance, and using the range difference that every time detects afterwards between distance and the initial distance obtained as
Range difference between the distance that twice detection obtains;
Or, second acquisition unit 3022, for obtaining the distance between the distance that adjacent twice detection obtains
Difference, and the range difference between the distance adjacent twice detection obtained is as between the distance that twice detection obtains
Range difference.
The terminal that the present embodiment provides, by dormancy countdown period according to the distance detected for twice
Difference and predetermined threshold value between relation, control whether this terminal carries out dormancy, it is achieved thereby that user is at end
Do action before end, terminal sleeping can be controlled, the most easy and simple to handle, it is also possible to avoid dormancy by mistake.
It should be understood that the terminal that above-described embodiment provides is when realizing dormancy and controlling, only with above-mentioned each merit
Can the division of module be illustrated, in actual application, can as desired by above-mentioned functions distribution by
Different functional modules completes, and the internal structure of terminal will be divided into different functional modules, with complete with
The all or part of function of upper description.It addition, the terminal that above-described embodiment provides is real with dormancy control method
Executing example and belong to same design, it implements process and refers to embodiment of the method, repeats no more here.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that all or part of step realizing above-described embodiment can be passed through
Hardware completes, it is also possible to instructing relevant hardware by program and complete, described program can be stored in
In a kind of computer-readable recording medium, storage medium mentioned above can be read only memory, disk or
CD etc..
The foregoing is only presently preferred embodiments of the present invention, not in order to limit the present invention, all the present invention's
Within spirit and principle, any modification, equivalent substitution and improvement etc. made, should be included in the present invention's
Within protection domain.