Summary of the invention
In view of this; the embodiment of the invention has proposed a kind of device management method and device that interrupts based on the RTC clock; by obtaining the equipment current state information; and obtain operational order and incident command information; and, utilize the interrupt function of RTC clock chip according to operational order that obtains and incident command information adjustment equipment state, the time that is allowed to condition at appointment produces interrupts waken system; between awake period, switch displayed map such as static screen protection, thus the function that reaches economize on electricity and screen protection and deposit.
For solving the problems of the technologies described above, the purpose of the embodiment of the invention is achieved through the following technical solutions:
A kind of device management method that interrupts based on the RTC clock comprises:
Step 1, obtain the equipment current state information;
Step 2, obtain operational order and incident command information;
Operational order and incident command information that step 3, foundation are obtained are adjusted equipment state.
Preferably, in the above-mentioned steps one, current state includes but not limited to status informations such as normal mode of operation, dormant state, pre-sleep state, sleep state.
Preferably, in the above-mentioned steps two, operational order that obtains and incident command information include but not limited to information such as user's operational order, the instruction of RTC Alarm incident.
Preferably, in the above-mentioned steps three, further comprise, trigger as RTC Alarm and interrupt waking up, then wake and be provided with system up and enter pre-sleep pattern when under dormant state.
Preferably, in the above-mentioned steps three, further comprise, interrupt, return normal mode of operation, and remove the setting that last RTC Alarm wakes up as button when under dormant state.
Preferably, in the above-mentioned steps three, further be included under the pre-sleep state, after power management services broadcasting and waiting system dispose, then enter sleep state.
Preferably, in power management services, can carry out system-level broadcasting, notify all application programs to allow its execution enter sleep state preliminary work before as broadcasting ACTION_SYSTEM_SLEEP.
Preferably, in the above-mentioned steps three, further be included under the pre-sleep state, can prepare enters sleep state preliminary work before, includes but not limited to show static screen protection etc.
Preferably, in the above-mentioned steps three, further be included under the sleep state, can before entering sleep state, also the mechanism that RTC Alarm wakes up can be set.
Preferably, wakeup time can be provided with more longerly than advancing dormant state, and application program can utilize this regular arouse machine processed to switch static screen protection picture.
A kind of equipment management device that interrupts based on the RTC clock, comprise state information acquisition module, command information acquisition module and adjusting module, by obtaining the equipment current state information, and obtain operational order and incident command information, and adjust equipment state according to operational order that obtains and incident command information.
Preferably, above-mentioned state information acquisition module is used to obtain the equipment current state information.
Preferably, above-mentioned command information acquisition module is used to obtain operational order and incident command information.
Preferably, above-mentioned adjusting module is used for adjusting equipment state according to operational order that obtains and incident command information.
In sum; the invention provides a kind of device management method and device that interrupts based on the RTC clock; by obtaining the equipment current state information; and obtain operational order and incident command information; and, utilize the interrupt function of RTC clock chip according to operational order that obtains and incident command information adjustment equipment state, the time that is allowed to condition at appointment produces interrupts waken system; between awake period, switch displayed map such as static screen protection, thus the function that reaches economize on electricity and screen protection and deposit.
Embodiment
A kind of device management method and device that interrupts based on the RTC clock that the embodiment of the invention provides; by obtaining the equipment current state information; and obtain operational order and incident command information; and according to operational order that obtains and incident command information adjustment equipment state; utilize the interrupt function of RTC clock chip; the time that is allowed to condition at appointment produce to be interrupted waken system, switches displayed map such as static screen protection between awake period, thus the function that reaches economize on electricity and screen protection and deposit.For making purpose of the present invention, technical scheme and advantage clearer, the embodiment that develops simultaneously with reference to the accompanying drawings, the present invention is described in more detail.
The power management services module (PowerManagerService) of Android operating system has realized the switching of normal mode of operation (Run) with dormant state (Standby).Wherein dormant state (Standby) state corresponds to dormant state (Standby) duty of CPU, and under this state, CPU enters low-power consumption mode and operation suspension, and the peripheral hardware power supply is Close All also, can only be waken up by button interruption or clock interruption etc.Wake the power supply of back recovery peripheral hardware up and enter normal mode of operation (Run).The switching of these two kinds of patterns is fairly simple, is widely used on handheld device.
The embodiment of the invention is at the ARM platform, and the power management services module of Android operating system is transformed, and has increased pre-sleep (Pre-Sleep) and sleep (Sleep) two states.And using the Alarm quarter-bell that has encapsulated RTC timing interrupt function to serve between state switches switches.
The embodiment of the invention provides a kind of device management method that interrupts based on the RTC clock, and as shown in Figure 1, concrete steps comprise: (synoptic diagram of the present invention's one specific embodiment, as shown in Figure 2)
Step 1, obtain the equipment current state information.
Particularly, in embodiments of the present invention, the residing current state of equipment includes but not limited to normal mode of operation (Run); Dormant state (Standby); Pre-sleep (Pre-Sleep) state; Status informations such as sleep (Sleep) state.
Wherein, in embodiments of the present invention, normal mode of operation (Run): under the normal mode of operation (Run), certain hour does not have operation, enter dormant state (Standby), enter dormant state (Standby) before, use the set time of RTC Alarm after the current time to wake up.
And dormant state (Standby): under dormant state (Standby) state, triggering interruption as RTC Alarm wakes up, then wake up and the system that is provided with enters pre-sleep (Pre-Sleep) pattern, this pattern is equal to normal mode of operation (Run) on the CPU state.
And pre-sleep (Pre-Sleep) state: the interim state of just individual short time after power management services broadcasting and waiting system dispose, then enters sleep (Sleep) state.This kind state can correspond to the pattern (need CPU self to support, as not supporting, can use and the identical pattern of dormant state (Standby)) of the more profound sleep of CPU.Under pre-sleep (Pre-Sleep) state, can prepare enters sleep (Sleep) state preliminary work before, as showing static screen protection etc.In power management services, can carry out system-level broadcasting, notify all application programs to allow its execution enter sleep (Sleep) state preliminary work before as broadcasting ACTION_SYSTEM_SLEEP.
And sleep (Sleep) state: also the mechanism that RTC Alarm wakes up can be set before entering sleep (Sleep) state; the wakeup time here can be divided into more longerly than advancing dormant state (Standby), and application program can utilize this regular arouse machine processed to switch static screen protection picture.After entering sleep (Sleep) state, can think that the user does not operate for a long time, the therefore more sleep power saving more of deep layer.
Step 2, obtain operational order and incident command information.
Particularly, in embodiments of the present invention, operational order that obtains and incident command information include but not limited to information such as user's operational order, the instruction of RTC Alarm incident.
Particularly, in embodiments of the present invention, under the normal mode of operation (Run), the certain hour no-operation instruction, then enter dormant state (Standby), enter dormant state (Standby) before, use the set time of RTC Alarm after the current time to wake up, after being provided with 2 minutes, wake up.
Under dormant state (Standby) state, trigger interruption as RTC Alarm and wake up, then wake and be provided with system up and enter pre-sleep (Pre-Sleep) pattern, this pattern is equal to normal mode of operation (Run) on the CPU state.Under the Standby state, interrupt, return the Run state, and remove the setting that last RTC Alarm wakes up as button.
Under pre-sleep (Pre-Sleep) state, because its interim state of a short time just, after power management services broadcasting and waiting system dispose, then enter sleep (Sleep) state.This kind state can correspond to the pattern (need CPU self to support, as not supporting, can use and the identical pattern of dormant state (Standby)) of the more profound sleep of CPU.Under pre-sleep (Pre-Sleep) state, can prepare enters sleep (Sleep) state preliminary work before, as showing static screen protection etc.In power management services, can carry out system-level broadcasting, notify all application programs to allow its execution enter sleep (Sleep) state preliminary work before as broadcasting ACTION_SYSTEM_SLEEP.
Under sleep (Sleep) state; before entering sleep (Sleep) state, also the mechanism that RTC Alarm wakes up can be set; the wakeup time here can be divided into more longerly than advancing dormant state (Standby), and application program can utilize this regular arouse machine processed to switch static screen protection picture.After entering sleep (Sleep) state, can think that the user does not operate for a long time, the therefore more sleep power saving more of deep layer.
Operational order and incident command information that step 3, foundation are obtained are adjusted equipment state.
Particularly, in embodiments of the present invention, under the normal mode of operation (Run), the certain hour no-operation instruction, then enter dormant state (Standby), enter dormant state (Standby) before, use the set time of RTC Alarm after the current time to wake up, after being provided with 2 minutes, wake up.
Under dormant state (Standby) state, trigger interruption as RTC Alarm and wake up, then to wake and be provided with system up and enter pre-sleep (Pre-Sleep) pattern, this pattern is equal to normal mode of operation (Run) on the CPU state.Under the Standby state, interrupt, return the Run state, and remove the setting that last RTC Alarm wakes up as button.As receive user's operation instruction information, then enter normal mode of operation (Run).
Under pre-sleep (Pre-Sleep) state, because its interim state of a short time just, after power management services broadcasting and waiting system dispose, then enter sleep (Sleep) state.This kind state can correspond to the pattern (need CPU self to support, as not supporting, can use and the identical pattern of dormant state (Standby)) of the more profound sleep of CPU.Under pre-sleep (Pre-Sleep) state, can prepare enters sleep (Sleep) state preliminary work before, as showing static screen protection etc.In power management services, can carry out system-level broadcasting, notify all application programs to allow its execution enter sleep (Sleep) state preliminary work before as broadcasting ACTION_SYSTEM_SLEEP.As receive user's operation instruction information, then enter normal mode of operation (Run).
Under sleep (Sleep) state; can before entering sleep (Sleep) state, also the mechanism that RTC Alarm wakes up can be set; the wakeup time here can be divided into more longerly than advancing dormant state (Standby), and application program can utilize this regular arouse machine processed to switch static screen protection picture.After entering sleep (Sleep) state, can think that the user does not operate for a long time, the therefore more sleep power saving more of deep layer.As receive user's operation instruction information, then enter normal mode of operation (Run).
In addition, in embodiments of the present invention, the time that RTC Alarm wakes up all can be self-defined to satisfy different user's needs.On the handheld device of electric ink screen; generally can be set to 10 minutes to guarantee that pop screen protection in time is unlikely to again to cause interference to user's reading from Standby state to Pre-Sleep state; whether the Sleep state is next is set to wake up in per 3 hours once to switch static screen protection picture, can also make low electric weight simultaneously and detect with decision and point out or mechanism such as shutdown.And at limber up period, in order to save time the raising debugging efficiency, Wakeup interval all can be arranged to 2 minutes.
CPU also has a kind of mode of operation (being called Core Idle) of automatic frequency reducing in addition, is used for reducing frequency of operation automatically to reduce power consumption when load is light.But this mode of operation is transparent to user and operating system, does not generally use as independent powder source management mode.
In addition, the embodiment of the invention also provides a kind of equipment management device that interrupts based on the RTC clock.As shown in Figure 3, a kind of equipment management device synoptic diagram that interrupts based on the RTC clock that provides for the embodiment of the invention.
A kind of equipment management device that interrupts based on the RTC clock comprises state information acquisition module 11, command information acquisition module 22 and adjusting module 33.
State information acquisition module 11 is used to obtain the equipment current state information.
Particularly, in embodiments of the present invention, the residing current state of equipment includes but not limited to normal mode of operation (Run); Dormant state (Standby); Pre-sleep (Pre-Sleep) state; Status informations such as sleep (Sleep) state.
Wherein, in embodiments of the present invention, normal mode of operation (Run): under the normal mode of operation (Run), certain hour does not have operation, enter dormant state (Standby), enter dormant state (Standby) before, use the set time of RTC Alarm after the current time to wake up.
And dormant state (Standby): under dormant state (Standby) state, triggering interruption as RTC Alarm wakes up, then wake up and the system that is provided with enters pre-sleep (Pre-Sleep) pattern, this pattern is equal to normal mode of operation (Run) on the CPU state.
And pre-sleep (Pre-Sleep) state: the interim state of just individual short time after power management services broadcasting and waiting system dispose, then enters sleep (Sleep) state.This kind state can correspond to the pattern (need CPU self to support, as not supporting, can use and the identical pattern of dormant state (Standby)) of the more profound sleep of CPU.Under pre-sleep (Pre-Sleep) state, can prepare enters sleep (Sleep) state preliminary work before, as showing static screen protection etc.In power management services, can carry out system-level broadcasting, notify all application programs to allow its execution enter sleep (Sleep) state preliminary work before as broadcasting ACTION_SYSTEM_SLEEP.
And sleep (Sleep) state: also the mechanism that RTC Alarm wakes up can be set before entering sleep (Sleep) state; the wakeup time here can be divided into more longerly than advancing dormant state (Standby), and application program can utilize this regular arouse machine processed to switch static screen protection picture.After entering sleep (Sleep) state, can think that the user does not operate for a long time, the therefore more sleep power saving more of deep layer.
Command information acquisition module 22 is used to obtain operational order and incident command information.
Particularly, in embodiments of the present invention, operational order that obtains and incident command information include but not limited to information such as user's operational order, the instruction of RTC Alarm incident.
Particularly, in embodiments of the present invention, under the normal mode of operation (Run), the certain hour no-operation instruction, then enter dormant state (Standby), enter dormant state (Standby) before, use the set time of RTC Alarm after the current time to wake up, after being provided with 2 minutes, wake up.
Under dormant state (Standby) state, trigger interruption as RTC Alarm and wake up, then wake and be provided with system up and enter pre-sleep (Pre-Sleep) pattern, this pattern is equal to normal mode of operation (Run) on the CPU state.Under the Standby state, interrupt, return the Run state, and remove the setting that last RTC Alarm wakes up as button.
Under pre-sleep (Pre-Sleep) state, because its interim state of a short time just, after power management services broadcasting and waiting system dispose, then enter sleep (Sleep) state.This kind state can correspond to the pattern (need CPU self to support, as not supporting, can use and the identical pattern of dormant state (Standby)) of the more profound sleep of CPU.Under pre-sleep (Pre-Sleep) state, can prepare enters sleep (Sleep) state preliminary work before, as showing static screen protection etc.In power management services, can carry out system-level broadcasting, notify all application programs to allow its execution enter sleep (Sleep) state preliminary work before as broadcasting ACTION_SYSTEM_SLEEP.
Under sleep (Sleep) state; before entering sleep (Sleep) state, also the mechanism that RTC Alarm wakes up can be set; the wakeup time here can be divided into more longerly than advancing dormant state (Standby), and application program can utilize this regular arouse machine processed to switch static screen protection picture.After entering sleep (Sleep) state, can think that the user does not operate for a long time, the therefore more sleep power saving more of deep layer.
Adjusting module 33 is used for adjusting equipment state according to operational order that obtains and incident command information.
Particularly, in embodiments of the present invention, under the normal mode of operation (Run), the certain hour no-operation instruction, then enter dormant state (Standby), enter dormant state (Standby) before, use the set time of RTC Alarm after the current time to wake up, after being provided with 2 minutes, wake up.
Under dormant state (Standby) state, trigger interruption as RTC Alarm and wake up, then to wake and be provided with system up and enter pre-sleep (Pre-Sleep) pattern, this pattern is equal to normal mode of operation (Run) on the CPU state.Under the Standby state, interrupt, return the Run state, and remove the setting that last RTC Alarm wakes up as button.As receive user's operation instruction information, then enter normal mode of operation (Run).
Under pre-sleep (Pre-Sleep) state, because its interim state of a short time just, after power management services broadcasting and waiting system dispose, then enter sleep (Sleep) state.This kind state can correspond to the pattern (need CPU self to support, as not supporting, can use and the identical pattern of dormant state (Standby)) of the more profound sleep of CPU.Under pre-sleep (Pre-Sleep) state, can prepare enters sleep (Sleep) state preliminary work before, as showing static screen protection etc.In power management services, can carry out system-level broadcasting, notify all application programs to allow its execution enter sleep (Sleep) state preliminary work before as broadcasting ACTION_SYSTEM_SLEEP.As receive user's operation instruction information, then enter normal mode of operation (Run).
Under sleep (Sleep) state; can before entering sleep (Sleep) state, also the mechanism that RTC Alarm wakes up can be set; the wakeup time here can be divided into more longerly than advancing dormant state (Standby), and application program can utilize this regular arouse machine processed to switch static screen protection picture.After entering sleep (Sleep) state, can think that the user does not operate for a long time, the therefore more sleep power saving more of deep layer.As receive user's operation instruction information, then enter normal mode of operation (Run).
In addition, in embodiments of the present invention, the time that RTC Alarm wakes up all can be self-defined to satisfy different user's needs.On the handheld device of electric ink screen; generally can be set to 10 minutes to guarantee that pop screen protection in time is unlikely to again to cause interference to user's reading from Standby state to Pre-Sleep state; whether the Sleep state is next is set to wake up in per 3 hours once to switch static screen protection picture, can also make low electric weight simultaneously and detect with decision and point out or mechanism such as shutdown.And at limber up period, in order to save time the raising debugging efficiency, Wakeup interval all can be arranged to 2 minutes.
CPU also has a kind of mode of operation (being called Core Idle) of automatic frequency reducing in addition, is used for reducing frequency of operation automatically to reduce power consumption when load is light.But this mode of operation is transparent to user and operating system, does not generally use as independent powder source management mode.
In addition; on the Android platform,, interrupt and according to turnover economize on electricity notification message constantly the RTC clock is set at application program one deck if do not revise the power management services module of Framework layer; and the pop screen protection also is feasible basically when receive clock interrupts.But in this case, can't be from two kinds of patterns of economizing on electricity after the CPU layer is distinguished common economize on electricity and screen protection, and the application programs authority require high, so underaction, applicable surface is wideless, can only be as a kind of alternatives.
One of ordinary skill in the art will appreciate that and realize that all or part of step that the foregoing description method is carried is to instruct relevant hardware to finish by program, described program can be stored in a kind of computer-readable recording medium, this program comprises one of step or its combination of method embodiment when carrying out.
In addition, each functional unit in each embodiment of the present invention can be integrated in the processing module, also can be that the independent physics in each unit exists, and also can be integrated in the module two or more unit.Above-mentioned integrated module both can adopt the form of hardware to realize, also can adopt the form of software function module to realize.If described integrated module realizes with the form of software function module and during as independently production marketing or use, also can be stored in the computer read/write memory medium.
In sum; this paper provides a kind of device management method and device that interrupts based on the RTC clock; by obtaining the equipment current state information; and obtain operational order and incident command information; and, utilize the interrupt function of RTC clock chip according to operational order that obtains and incident command information adjustment equipment state, the time that is allowed to condition at appointment produces interrupts waken system; between awake period, switch displayed map such as static screen protection, thus the function that reaches economize on electricity and screen protection and deposit.
More than a kind of device management method and device that interrupts based on the RTC clock provided by the present invention is described in detail, used specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand the solution of the present invention; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.