A kind of shutdown alarm clock trigger system of mobile terminal and triggering method thereof
Technical field
The present invention relates to electronic equipment, particularly relate to a kind of shutdown alarm clock trigger system and triggering method thereof of mobile terminal.
Background technology
Social development is rapid, especially in the development of electronic applications.In recent years, the renewal speed of mobile terminal is between every minute, and various intelligent system joins in daily life.For mobile phone, the mobile phone carrying the intelligent operations such as Android, IOS, windowsphone is of common occurrence, but, compared to original non intelligent mobile phone, it is particularly evident that the large defect of smart mobile phone one is also given prominence to, as, generally by external special clock chip or band RTC(RealTimeClock when smart mobile phone starts alarm clock in the power-offstate, real-time clock) power management chip realize, but the cost of above-mentioned two kinds of modes is higher, thus uses not extensive in mobile phone industry.
Thus prior art need to improve.
Summary of the invention
In view of above-mentioned the deficiencies in the prior art part, the object of the present invention is to provide a kind of shutdown alarm clock trigger system and triggering method thereof of mobile terminal, alarm clock can be started under mobile terminal off-mode, and reduce costs.
In order to achieve the above object, this invention takes following technical scheme:
A kind of shutdown alarm clock trigger system of mobile terminal, it comprises clock source, counter, central processing unit, numerical value comparison module and start control module: described clock source is connected with start control module by counter, numerical value comparison module successively, and described counter is connected with central processing unit with numerical value comparison module;
Described clock source, for generation of the clock pulse signal of fixed frequency;
Described counter, the number for the clock pulse signal produced described clock source counts, and exports corresponding count value;
Described central processing unit, alarm time is next time obtained during for detecting mobile terminal shutdown, according to the available machine time of the mobile terminal of alarm time calculating next time, and calculate in time that mobile terminal starts shooting from shutting down to, described clock source produces the number of clock pulse signal, and is arranged in numerical value comparison module by its numerical value;
Described numerical value comparison module, when the count value for comparing counter output is equal with the individual numerical value of the clock pulse signal that central processing unit is arranged in numerical value comparison module, triggers described start control module;
Described start control module controls mobile terminal-opening when receiving the triggering signal of numerical value comparison module, and starts alarm clock.
In the shutdown alarm clock trigger system of described mobile terminal, described central processing unit comprises:
Counter control unit, for the keying of control counter and the output of clearing counter;
Numerical calculation unit, for calculating the available machine time according to unused time calculating mobile terminal, and calculate mobile terminal from shutdown to performing in the time of start next time, described clock source produces the number of clock pulse signal;
Numerical value setting unit, the numerical value for being calculated by numerical calculation unit is arranged in numerical value comparison module;
Described counter control unit linkage counter, described numerical calculation unit connects numerical value comparison module by numerical value setting unit.
In the shutdown alarm clock trigger system of described mobile terminal, described counter comprises CLKIN end, CLR end, EN end and Q0 end and holds to Q20; Described numerical value comparison module comprises multi input or door and 21 XOR gate;
Described CLKIN end connects clock source, and CLR end and EN hold linkage counter control unit; The Q0 end of the described counter of the corresponding connection of first input end of 21 XOR gate is held to Q20, second input of described 21 XOR gate all connects numerical value setting unit, the output of described 21 XOR gate connects the input of described multi input or door, and described multi input or gate output terminal connect described start control module.
In the shutdown alarm clock trigger system of described mobile terminal, described start control module comprise key detecting unit, power management chip and with door; Describedly be connected numerical value comparison module with the first input end of door, be connected described key detecting unit with the second input of door, be connected power management chip with the output of door.
In the shutdown alarm clock trigger system of described mobile terminal, described key detecting unit comprises pull-up resistor and key, one end of described pull-up resistor connects VDD feeder ear, and the other end of pull-up resistor connects with the second input of door, also by key ground connection.
In the shutdown alarm clock trigger system of described mobile terminal, described central processing unit calculates mobile terminal from shutdown in the time of starting shooting, and the number that described clock source produces clock pulse signal is:
Wherein, t2 is alarm time next time, and t1 is current time, and t0 has power-on command to the time completed needed for start from detection for central processing unit, and f is the frequency that clock source produces clock pulse signal.
A triggering method for above-mentioned shutdown alarm clock trigger system, it comprises:
During the shutdown of A, mobile terminal, obtained current time and the alarm time next time of mobile terminal by central processing unit;
B, central processing unit calculate the available machine time of mobile terminal according to the unused time, and calculate mobile terminal from shutdown in the time of starting shooting, and described clock source produces the number of clock pulse signal, and is arranged in numerical value comparison module by its numerical value; Reset counter simultaneously, make counter start counting;
C, when numerical value comparison module compare count value that counter exports equal with the individual numerical value of the clock pulse signal that central processing unit is arranged in numerical value comparison module time, trigger described start control module control mobile terminal-opening, and start alarm clock.
In described triggering method, described step B specifically comprises:
B1, numerical calculation unit calculate the available machine time of mobile terminal according to the unused time of mobile terminal, and calculate mobile terminal from shutdown to performing in the time of start next time, and described clock source produces the number of clock pulse signal;
The numerical value that numerical calculation unit calculates is arranged on numerical value comparison module by B2, numerical value setting unit; Reset counter by counter control unit simultaneously, make counter start counting.
In described triggering method, described central processing unit calculates mobile terminal from shutdown in the time of starting shooting, and the number that described clock source produces clock pulse signal is:
Wherein, t2 is alarm time next time, and t1 is current time, and t0 is for central processing unit is from detection power-on command to the time completed needed for start, and f is the frequency that clock source produces clock pulse signal.
Compared to prior art, the shutdown alarm clock trigger system of a kind of mobile terminal provided by the invention and triggering method thereof, when mobile terminal shuts down, the unused time of mobile terminal and next alarm time is detected by central processing unit, according to the unused time and next time alarm time calculate available machine time of mobile terminal, and calculate mobile terminal from shutdown in the time of starting shooting, described clock source produces the number of clock pulse signal, and its numerical value is arranged in numerical value comparison module, and by counter within the mobile terminal unused time, the number calculating the clock pulse signal that clock source produces counts, export corresponding count value, when the count value of counter is identical with the individual numerical value of the clock pulse signal arranged in numerical value comparison module, triggers described start control module and control mobile terminal-opening, and start alarm clock.The present invention is without the need to using special chip to realize the shutdown alarm clock function of movement, and its development cost is low.
Accompanying drawing explanation
Fig. 1 is the structured flowchart of the shutdown alarm clock trigger system of mobile terminal provided by the invention.
Fig. 2 is the structural representation of the shutdown alarm clock trigger system Counter of mobile terminal provided by the invention.
Fig. 3 is the structural representation of numerical value comparison module in the shutdown alarm clock trigger system of mobile terminal provided by the invention.
Fig. 4 is the structural representation of control module of starting shooting in the shutdown alarm clock trigger system of mobile terminal provided by the invention.
Fig. 5 is the flow chart of the triggering method of shutdown alarm clock trigger system provided by the invention.
Embodiment
The invention provides a kind of shutdown alarm clock trigger system and triggering method thereof of mobile terminal, for making object of the present invention, technical scheme and effect clearly, clearly, developing simultaneously referring to accompanying drawing, the present invention is described in more detail for embodiment.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
Refer to Fig. 1, Fig. 1 is the structured flowchart of the shutdown alarm clock trigger system of mobile terminal provided by the invention.As shown in Figure 1, the shutdown alarm clock trigger system of mobile terminal is the smart machine such as smart mobile phone, panel computer, and it comprises: clock source 100, counter 200, central processing unit 300, numerical value comparison module 400 and start control module 500.Described clock source 100 is connected with start control module 500 by counter 200, numerical value comparison module 400 successively, and described counter 200 is connected with central processing unit 300 with numerical value comparison module 400.
Wherein, described clock source 100, for generation of the clock pulse signal of fixed frequency, clock source 100 produces the clock pulse signal that fixed frequency is 1Hz in the present embodiment.Described clock source is external clock reference, and the positive feedback oscillating circuit be usually made up of quartz, crystal oscillator and NAND gate forms, and its clock pulse signal inputs in counter 200.
Described counter 200, the number for the clock pulse signal produced described clock source counts, and exports corresponding count value.Wherein, the number of clock pulse signal can be mobile terminal from shutdown in the available machine time, the number of the clock pulse signal that clock source 100 produces, as being a clock pulse signal between two of clock pulse signal adjacent rising edges.
Central processing unit 300 for the operating state of control counter 200, as control counter 200 reset, enable, forbidden energy counter 200.
During concrete enforcement, described central processing unit 300 is also for when detecting mobile terminal shutdown, obtain alarm time (namely next time starting the time of alarm clock) next time, the available machine time of mobile terminal is calculated according to the unused time, and calculate mobile terminal from shutdown in the time of starting shooting, described clock source 100 produces the number of clock pulse signal, and is arranged in numerical value comparison module 400 by its numerical value.In this practical example, due to mobile terminal could start alarm clock under open state time, so 200, counter need calculate mobile terminal from shutdown in the available machine time, clock source 100 produces the number of clock pulse signal, and have power-on command to completing in start required time without record move terminal from detection, the clock pulse signal number that clock source 100 produces.
Described numerical value comparison module 400 for compare counter 200 export count value equal with the individual numerical value of the clock pulse signal that central processing unit 300 is arranged in numerical value comparison module 400 time, trigger described start control module 500.Described start control module 500 controls mobile terminal-opening when receiving the triggering signal of numerical value comparison module 400, and starts alarm clock, thus achieves mobile terminal and start alarm clock in the power-offstate.
Concrete, central processing unit 300 calculates mobile terminal from shutdown in the time of starting shooting, and the number that described clock source produces clock pulse signal is:
Wherein, t2 is alarm time next time, and t1 is current time, and t0 has power-on command to the time completed needed for start from detection for central processing unit 300, and f is the frequency that clock source produces clock pulse signal.
Again consult Fig. 1, described central processing unit 300 comprises: for linkage counter 200 and control its open and close and reset counter control unit 310, for calculating the available machine time of mobile terminal according to the unused time, and calculating the numerical calculation unit 320 that mobile terminal produces clock pulse signal number within its time period, the numerical value for being calculated by numerical calculation unit 320 outputs to the numerical value setting unit 330 of numerical value comparison module 400.
Wherein, numerical calculation unit 320 is connected with numerical value setting unit 330, when detecting that mobile terminal shuts down, obtain alarm time next time, and by it compared with the unused time, obtain the number of the clock pulse signal that described clock source 100 produces, and numerical value is outputted to numerical value setting unit 330.
See also Fig. 2, Fig. 2 is the structural representation of the shutdown alarm clock trigger system Counter of mobile terminal provided by the invention.Counter 200 as shown in Figure 2 comprises: CLKIN holds (i.e. input end of clock), and it connects clock source 100 and inputs for clock pulse signal; CLR end (i.e. clear terminal) and EN end (i.e. Enable Pin), all connect the counter control unit 310 in central processing unit 300, be respectively used to reset counter 200 and enable counter 200, the Q0 end of counter 200, Q1 hold ..., Q19 end, Q20 end, all connect numerical value comparison module 400, after exporting clearing for counter 200, the clock pulse signal number of record CLKIN end input.
During concrete enforcement, for smart mobile phone, when central processing unit 300 detects intelligent mobile phone shutdown, counter 200 activates by the EN end input enable signal first to counter 200, then input reset signal is held by CLR, by counter 200 state initialization, the clock pulse signal holding input clock source 100 to export by CLKIN again, and the number of clock pulse signal is held by Q0 end, Q1 in binary mode ..., Q19 end, Q20 end output to numerical value comparison module 400, wherein, Q0 end is lowest order, and Q20 end is highest order.Such as, represent high level with 1, represent low level with 0, central processing unit 300 by counter activate and under initialized state, when holding the clock number of input to be 12345 by CLKIN, then the Q0 of its correspondence holds, Q1 holds ..., Q19 end, Q20 hold output level as shown in the table:
Q0 |
1 |
Q1 |
0 |
Q2 |
0 |
Q3 |
1 |
Q4 |
1 |
Q5 |
1 |
Q6 |
0 |
Q7 |
0 |
Q8 |
0 |
Q9 |
0 |
Q10 |
0 |
Q11 |
0 |
Q12 |
1 |
Q13 |
1 |
Q14 |
0 |
Q15 |
0 |
Q16 |
0 |
Q17 |
0 |
Q18 |
0 |
Q19 |
0 |
Q20 |
0 |
For smart mobile phone, when central processing unit 300 detects intelligent mobile phone shutdown, numerical calculation unit 320 obtains unused time and alarm time next time, and calculating once performed in available machine time section to execution in the unused time, the clock pulse signal number that clock source 100 produces, and numerical value is outputted in numerical value setting unit 330.Meanwhile counter control unit 310 is to the EN end input enable signal of counter 200, with activate counter 200; To CLR end input reset signal, with initialization counter 200.Such as, high level is represented with 1, low level is represented with 0, numerical calculation unit 320 obtains after clock source 100 produces 12345 clock pulse signals, numerical value is stored in numerical value setting unit 330 in binary mode, the binary number obtained as shown above, when its high position does not have a respective value, mend 0, namely numerical value setting unit 330 stores from low level to a high position is 100111000000110000000.
See also Fig. 3, Fig. 3 is the structural representation of numerical value comparison module in the shutdown alarm clock trigger system of mobile terminal provided by the invention.Numerical value comparison module 400 as shown in Figure 3 comprises: multi input or a door U21 and 21 XOR gate U0, U1 ..., U19, U20,21 XOR gate U0, U1 ..., U19, U20 the described counter 200 of the corresponding connection of first input end Q0 end, Q1 end ..., Q19 end, Q20 end, namely the first input end linkage counter 200 of first XOR gate U0 Q0 end, second XOR gate U1 first input end linkage counter 200 Q1 end ..., by that analogy.
Described 21 XOR gate U0, U1 ..., U19, U20 the second input all connect numerical value setting unit 330, described 21 XOR gate U0, U1 ..., U19, U20 output connect the input of described multi input or door U21, described multi input or door U21 output connect described start control module 500.
In the specific implementation, the numerical value that numerical calculation unit 320 calculates by the numerical value setting unit 330 in central processing unit 300 with binary form from low level to a high position by 21 of numerical value comparison module 400 XOR gate U0, U1 ..., U19, U20 the second input be arranged on 21 XOR gate U0 of numerical value comparison module 400, U1 ..., in U19, U20; Counter 200 count each time all by numerical value by 21 XOR gate U0 of numerical value comparison module 400, U1 ..., U19, U20 first input end be input in XOR gate, the two is compared, then comparative result is outputted in multi input or door U21, numerical value comparison module 400 is linked to start control module 500, in order to realize the unlatching of terminal to mobile terminal by the output of multi input or door U21.
Wherein, represent high level with 1, represent low level with 0, when the first input end in XOR gate is equal with the numerical value of the second input, the output of XOR gate is to the input input 0 of multi input or door U21; When numerical value is unequal, input 1 to multi input or door U21.When 21 XOR gate U0, U1 ..., U19, U20 be when being 0 to the numerical value that multi input or door U21 input, then the output of multi input or door U21 inputs 0 to start control module 500, therefore when the value that data device 200 exports is equal with the value that numerical value setting unit 330 is arranged, all XOR gate export 0, it is also 0 that multi input or door U21 export, if otherwise have an XOR gate to export 1, it is 1 that multi input or door U21 export; It is whether 0 or 1 just can to know that value that counter 200 exports and numerical value arrange the value that module 330 arranges equal that start control module 500 need detect that multi input or door U21 export, when both are equal, start control module 500 triggers, and realizes the start of mobile terminal; Otherwise mobile terminal is not started shooting, keep shutdown.
See also Fig. 4, Fig. 4 is the structural representation of control module of starting shooting in the shutdown alarm clock trigger system of mobile terminal provided by the invention.As shown in Figure 4, start control module 500 comprise: power management chip 510, start detecting unit 520 and with door U22.Wherein, be describedly connected numerical value comparison module 400 with the first input end of door U23, be connected described key detecting unit 520 with second input of door U22, be connected power management chip 510 with the output of door U22.
Described key detecting unit 520 comprises pull-up resistor R1 and key K1, and one end of described pull-up resistor R1 connects VDD feeder ear, and the other end of pull-up resistor R1 connects with second input of door U22, also by key K1 ground connection.
During concrete enforcement, when the key K1 of detecting unit 510 of starting shooting is pressed, key K1 is low level with being conducting to, then export 0 to door U22, when having an input to be 0 with door U22, exporting with door U22 is 0, when power management chip 510 detects and exports 0 with door U22, realizes the unlatching of mobile terminal; When key K1 is not pressed, key K1 is pulled up resistance R1 and draws high as high level, then export 1 to door U22, and power management chip 510 detects and exports 1 with door U22, not triggering mobile terminals start.Meanwhile, also receive with door U22 the signal that numerical value comparison module 400 exports, when numerical value comparison module 400 is to when being 0 with door U22 input signal, exporting with door U22 is 0, then power management chip 510 receives 0 signal inputted with door U22, realizes mobile terminal and opens; If numerical value comparison module 400 to when being 1 with door U22 input signal, then exports 1 with door U22, when power management chip 510 detects that a U22 exports 1, not triggering mobile terminals start.
For a better understanding of the present invention, below in conjunction with Fig. 1 to Fig. 4, for smart mobile phone, the working method of the shutdown alarm clock trigger system of mobile terminal provided by the invention is described in detail.
User arranges alarm clock in smart mobile phone, but by intelligent mobile phone shutdown before alarm clock starts.While intelligent mobile phone shutdown, central processing unit 300 detects shutdown command, then obtain unused time and alarm time next time by numerical calculation unit 320, and calculate and perform to open and once open in the time of intelligent mobile phone system from shutdown to needing to start alarm clock at smart mobile phone, the clock pulse signal number that clock source 100 need produce, and institute's value is input in numerical value setting unit 330, institute's value is input to 21 XOR gate U0 in numerical value comparison module 400 successively by numerical value setting unit 330 from low level to a high position with binary form, U1, U19, second input of U20.Meanwhile, the EN end to counter 200 in central processing unit 300 sends enable signal, in order to enable counter 200, and inputs reset signal to the CLR end of counter 200, in order to the counter value of counter 200 is reset, and initialization counter 200.Meanwhile, numerical calculation unit 320 also should obtain the essential information of clock source 100, as the frequency etc. of clock source 100.
When counter control unit 310 is after the EN end input enable signal of counter 200, counter 200 activates and receive counter control unit 310 holds the reset signal of input at CLR, carry out initialization, then the clock pulse signal in receive clock source 100 is held by the CLKIN of counter 200, CLKIN end often receives a clock pulse signal, then count once, and the Q0 end value of counting is input to from low level to a high position in order in binary mode in counter 200, Q1 holds, Q19 holds, on Q20 end, held by Q0, Q1 holds, Q19 holds, numerical value is transferred to 21 XOR gate U0 in numerical value comparison module 400 by Q20 end in order, U1, U19, in the first input end of U20.
The output of each XOR gate in numerical value comparison module 400 is connected on multi input or door U21 input.In unused time section, each XOR gate will compare the numerical value of first input end and the input of the second input, if identical, exports 0 signal, otherwise exports 1 signal.Multi input or door U21 receive 21 XOR gate U0 in this module, U1 ..., U19, U20 signal, if all signals are all identical, then export 0 signal, otherwise export 1 signal.
When multi input or door U21 are 0 to the signal inputted with door U22 of start control module 500,0 signal is inputted to power management chip 510, smart mobile phone start up system, when after smart mobile phone start with door U22, counter control unit 310 makes counter 200 forbidden energy, to save battery electric quantity; When signal is 1, intelligent mobile phone system does not start.
Further, described shutdown alarm clock trigger system also comprises shutdown alarm clock and arranges module, for when user arranges alarm clock, arranges the function of opening shutdown alarm clock, shifts to an earlier date the options such as reminding alarm clock.Wherein, the time acquiescence of described reminding alarm clock in advance 2 minutes in advance, after 2 minutes, again starts alarm clock, only need once arrange the object reaching and repeatedly remind.
The corresponding triggering method that a kind of shutdown alarm clock trigger system of mobile terminal is provided of the present invention, refer to Fig. 5, it comprises following step:
During the shutdown of S100, mobile terminal, obtained current time and the alarm time next time of mobile terminal by central processing unit;
S200, central processing unit calculate the available machine time of mobile terminal according to the unused time, and calculate mobile terminal from shutdown in the time of starting shooting, and described clock source produces the number of clock pulse signal, and is arranged in numerical value comparison module by its numerical value; Reset counter simultaneously, make counter start counting;
S300, when numerical value comparison module compare count value that counter exports equal with the individual numerical value of the clock pulse signal that central processing unit is arranged in numerical value comparison module time, trigger described start control module control mobile terminal-opening, and start alarm clock.
Mobile terminal described herein is carry the mobile terminal as intelligent systems such as Android, OS, windowsphone, below for smart mobile phone.
In step S100, when the central processing unit in mobile phone detects handset starting shutdown programm, numerical calculation unit wherein can be started, obtain unused time and the alarm time next time of mobile phone.Meanwhile, also need to obtain the frequency that clock source produces clock pulse signal, in order to calculate the clock pulse signal that clock source produces within the unused time to next alarm time.Specifically refer to above-described embodiment.
In step S200, central processing unit by calculate clock source the unused time on once perform start time in produce the number of clock pulse signal.And it is arranged in numerical value comparison module by numerical value setting unit, it specifically comprises:
The first step, numerical calculation unit calculate the available machine time of mobile terminal according to the unused time of mobile terminal, and calculate mobile terminal from shutdown to performing in the time of start next time, and described clock source produces the number of clock pulse signal;
The numerical value that numerical calculation unit calculates is arranged on numerical value comparison module by second step, numerical value setting unit; Reset counter by counter control unit simultaneously, make counter start counting.
Wherein, central processing unit calculates mobile terminal from shutdown to performing in the time of start next time, and the computing formula that described clock source produces the number of clock pulse signal is:
Wherein, t2 is alarm time next time, and t1 is current time, and t0 is for central processing unit is from detection power-on command to the time completed needed for start, and f is the frequency that clock source produces clock pulse signal.
In step S300, the numerical value of numerical value comparison module in native system to input compares, when the numerical value that counter is passed in numerical value comparison module is equal with the numerical value that central processing unit calculates, then power management chip is triggered, start the boot system of smart mobile phone, and start alarm clock, realize shutdown alarm clock prompting function.
Further, before step S100, described triggering method also comprises: when arranging shutdown and opening the function of alarm clock, arranges reminding alarm clock function in advance.
If be provided with reminding alarm clock function in advance, user can also arrange the time of reminding in advance.After being provided with reminder time in advance, when user shuts down, central processing unit arranges mobile terminal and from shutdown to the computing formula performing start is next time:
Wherein, t2 is alarm time next time, and t1 is current time, and t0 is for central processing unit is from detection power-on command to the time completed needed for start, and t00 is the pre-set time that user is arranged, and f is the frequency that clock source produces clock pulse signal.
The shutdown alarm clock trigger system of a kind of mobile terminal provided by the invention and triggering method thereof, realize starting alarm clock in the power-offstate at mobile terminal, the element adopted is conventional electronic component, its circuit structure is simple, development cost is low, for product adds new user's health check-up, improve the competitiveness of product in market.
Be understandable that, for those of ordinary skills, can be equal to according to technical scheme of the present invention and inventive concept thereof and replace or change, and all these change or replace the protection range that all should belong to the claim appended by the present invention.