Method for awakening terminal system and terminalTechnical Field
The invention belongs to the field of terminal power saving, and particularly relates to a method for waking up a terminal system and a terminal.
Background
The current intelligent terminal has the functions of a large display screen, communication network standby (2G/3G), Wifi, Bluetooth and the like, so that the electric quantity of the battery is consumed very quickly, and after the screen-off standby is carried out, a terminal system is frequently awakened, and the electric quantity consumption of the battery of the terminal is accelerated.
Taking a mobile phone as an example, in general, after the mobile phone is turned off, the system can be in a dormant state after a period of time for saving power, taking an Android system as an example, after the mobile phone with the Android system is turned off, and after detecting that no application program needs to occupy a CPU, the Android system can save various application program states currently running in the system and then enter a dormant mode; and when the system is awakened, reloading and recovering the state of each application program before dormancy. Each time the system wakes up, it needs to reload and resume the state before hibernation. After the mobile phone is dormant, the frequent awakening of the system can cause large power consumption of the mobile phone and shorten the endurance time of the mobile phone.
The first mode is a hardware wake-up mode, namely, an Interrupt Request (IRQ) is initiated to a CPU (central processing unit) to wake up the CPU through a power management chip by pressing a power key, plugging a USB (universal serial bus) and the like; and the second mode is a mode of periodically waking up by a wake-up timer, a general terminal system is provided with the wake-up timer, when the system is in a dormant state, the system can be waken up if the wake-up timer reaches a preset time, and some applications needing data exchange with the network server, such as QQ, WeChat, weather clock, New wave microblog, fox searching news and the like, can realize periodic communication with the network server by calling the wake-up timer provided by the terminal system so as to provide timely service. At present, in order to provide better service, a system timer is frequently started by a plurality of application programs, and in the actual use process, when the terminal is in a sleep mode, most of the application programs do not need to be frequently awakened to provide timely messages, such as a weather clock, fox searching news and the like. Therefore, when the terminal is in the sleep mode, the standby time of the mobile phone can be greatly shortened by frequently waking up the system by various application programs.
The method comprises the steps that a general terminal such as a mobile phone can perform power consumption testing when the mobile phone leaves a factory, a mobile phone manufacturer can perform dormancy awakening testing when the mobile phone is in a dormant mode for various preset application programs, and when the fact that the system power consumption is large due to frequent awakening of the preset application programs is found, the mobile phone manufacturer can contact a developer corresponding to the application programs, the developer is required to modify the time length of a timer set by the application programs, the times of awakening the system by the application programs in the dormant mode are reduced, and therefore the original system power consumption meets certain index requirements when the mobile phone leaves the factory.
However, the method can only limit the times and duration of waking up the system by various application programs preset by the mobile phone system, however, the terminal user can also download various installed application programs by himself, and the problem that the system is frequently woken up by downloading the installed application programs by the user may also exist, so that the standby power consumption of the terminal may be obviously increased, thereby accelerating the consumption of the electric quantity of the terminal.
Disclosure of Invention
An object of the embodiments of the present invention is to provide a method for waking up a terminal system and a terminal, so as to solve the problem that power consumption of the terminal is accelerated due to frequent waking up of the terminal system in a sleep mode.
In a first aspect, an embodiment of the present invention provides a method for waking up a terminal system, where the method includes:
after detecting that a display screen of a terminal where a terminal system is located is closed, loading a preset blacklist into an internal memory of the terminal, wherein the blacklist records an application program which forbids to awaken the terminal system when the terminal system is in a sleep mode;
after the terminal system enters a sleep mode, determining whether an application program needs to wake up the terminal system;
if the application program is determined to need to wake up the terminal system, determining whether the application program which needs to wake up the terminal system is in the blacklist;
and if the application program needing to wake up the terminal system is in the blacklist, the terminal system is prohibited from being woken up.
In a first implementation manner of the first aspect, after detecting that a display screen of a terminal where a terminal system is located is closed, a preset white list is also loaded into an internal memory of the terminal, where the white list records an application program that allows a system to be woken up when the terminal system is in a sleep mode, if the application program corresponding to the system wake-up time is determined not to be in the black list, it is continuously determined whether the application program corresponding to the system wake-up time is in the white list, if so, the application program is allowed to wake up the terminal system, if not, a wake-up record is generated, the number of times that the application program wakes up the terminal system within a preset time after the terminal system enters the sleep mode is recorded, if the number of times recorded by the wake-up record is greater than a preset value, the application program is added into the black list, and if the number of times recorded by the wake-up record is not greater than the preset value, the application is allowed to wake up the end system.
In the first aspect and the method for waking up a terminal system provided by the first implementation manner of the first aspect, the internal memory of the terminal further stores a block list, and if an application program that needs to wake up the terminal system is in the black list, the method further includes a step of recording the application program to the block list, and after the terminal system is woken up, the method further includes: and triggering the application programs in the blocking list one by one when the blocking list is not empty.
Preferably, in the method for waking up a terminal system, after a display screen of a terminal where the terminal system is located is turned on, it is first determined whether the block list is empty, if so, the black list, the white list and the block list in the internal memory are deleted, and if not, the application programs in the block list are triggered one by one, and then the black list, the white list and the block list in the internal memory are deleted.
In a second aspect, an embodiment of the present invention provides a wake-up terminal of a terminal system, where the terminal includes:
the loading module is used for loading a preset blacklist into an internal memory of the terminal after detecting that a display screen of the terminal where the terminal system is located is closed; the judging module is used for determining whether an application program needs to wake up the terminal system after the terminal system enters the sleep mode, and determining whether the application program corresponding to the system wake-up time is in the blacklist when the application program needs to wake up the terminal system;
and the wake-up forbidding module is used for forbidding to wake up the terminal system when the application program corresponding to the system wake-up time is in the blacklist.
In a first implementation manner of the second aspect, the loading module further loads a preset white list into an internal memory of the terminal after detecting that a display screen of the terminal where the terminal system is located is closed, the white list records an application program that allows the terminal system to be woken up when the terminal system is in a sleep mode, the terminal system further includes a wake-up module and a frequent wake-up processing module, the judging module judges whether the application program corresponding to the system wake-up time is in the white list if the application program corresponding to the system wake-up time is not in the black list, if so, the wake-up module wakes up the terminal system, if not, the frequent wake-up processing module generates a wake-up record, records the number of times that the application program wakes up the terminal system within a preset time after the terminal system enters the sleep mode, and if the number of times recorded by the wake-up record is greater than a preset value, and the frequent awakening processing module adds the application program into the blacklist, and if the times recorded by the awakening record are not more than the preset value, the awakening module awakens the terminal system.
In the terminal for waking up the terminal system provided in the first implementation manner of the second aspect, the internal memory of the terminal further stores a block list, if the determining module determines that the application program corresponding to the system wake-up time is in the blacklist, the wake-up prohibition module further records the application program into a block list, and after the terminal system is woken up, the wake-up module triggers the application programs in the block list one by one when determining that the block list is not empty.
Preferably, the terminal of the wake-up terminal system further includes a bright screen recovery module, after the display screen of the terminal is turned on, the bright screen recovery module determines whether the block list is empty, if so, deletes the blacklist, the white list and the block list in the internal memory, if not, triggers the application programs in the block list one by one, and then deletes the blacklist, the white list and the block list in the internal memory.
The embodiment of the invention adds the blacklist into the internal memory of the terminal before the terminal system enters the sleep mode by setting the blacklist, and when the terminal system is in the sleep mode, if an application program needs to wake up the terminal system, whether the application program is in the blacklist is firstly confirmed, and if the application program is in the blacklist, the application program is forbidden to wake up the terminal system, so that the times of waking up the terminal system in the sleep state are reduced, the electric quantity consumption of the terminal system in the sleep state is reduced, and the aim of saving electricity is fulfilled.
Drawings
Fig. 1 is a flowchart of a method for waking up a terminal system according to an embodiment of the present invention.
Fig. 2 is a flowchart of a method for recovering a terminal system after a screen of a terminal is opened according to an embodiment of the present invention.
Fig. 3 is a functional block diagram of a terminal of the wake-up terminal system according to a second embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The following detailed description of specific implementations of the present invention is provided in conjunction with specific embodiments:
the first embodiment is as follows:
fig. 1 is a flowchart of a method for waking up a terminal system according to an embodiment of the present invention. The method comprises the following steps:
step S101, detecting whether a display screen of a terminal where the terminal system is located is closed;
step S102, if the display screen is closed, loading a preset blacklist and a preset white list into an internal memory of the terminal, wherein the preset blacklist is a preset application program which forbids to awaken the terminal system, and the preset white list is a preset record which allows to awaken the system when the terminal system is in a sleep mode;
step S103, making the terminal system enter a sleep mode;
step S104, determining whether an application program needs to wake up the terminal system;
the specific method for determining whether the application program needs to wake up the terminal system comprises the following steps: and generating a wake-up time record, wherein the wake-up time record is used for recording the system wake-up time of each application program, the system wake-up time is the time for the application program to wake up the system when the terminal system is in a sleep mode, the wake-up time record is loaded to an internal memory of the terminal after the terminal system enters the sleep mode, and after the terminal system enters the sleep mode, if the time counted by a system timer reaches the system wake-up time recorded in the wake-up time record, the terminal system can be determined to be woken up by the application program.
Step S105, when determining that the application program needs to wake up the terminal system, further determining whether the application program needing to wake up the terminal system is in the blacklist;
step S106, if the application program corresponding to the system awakening time is in the blacklist, the terminal system is forbidden to be awakened, and the application program is added into a block list;
step S107, if the application program corresponding to the system wake-up time is not in the blacklist, continuing to judge whether the application program corresponding to the system wake-up time is in the whitelist, if so, executing step S108, and if not, executing step S110;
step S108, waking up the system;
step S109, after waking up the system, the applications in the blocking list are triggered one by one when the blocking list is not empty.
Step S110, generating a wake-up record, and recording the times of the application program for waking up the terminal system within a preset time after the terminal system enters the sleep mode;
step S111, determining whether the number of times recorded by the wakeup record is greater than a preset value, if yes, performing step S112, and if not, returning to step S108;
step S112, add the application program into the blacklist.
In addition, a white list is set, so that part of applications appointed by a user can acquire timely information and services, a block list is set, the terminal can be ensured to be not responded due to the prohibition of awakening the system in the dormant mode, the application program can be notified to process after the system is awakened, in addition, an awakening record is set, and the application program can be notified to execute the event before the terminal system enters the dormant mode after the terminal system is closed, and the awakening system is prohibited after the terminal system enters the dormant mode.
As shown in fig. 2, it is a flowchart of a method for recovering a terminal system after a screen of the terminal is opened. Step S201, after the terminal display screen is opened, firstly judging whether the block list is empty, if not, executing step S202, and if so, executing step S203;
step S202, triggering the application programs in the blocking list one by one, and then executing step 203;
step S203, delete the black list, white list and block list in the internal memory.
Therefore, after the display screen of the terminal is opened, the corresponding application program can be informed to execute the corresponding event by triggering the application program in the blocking list, so that the information and the service provided by the application program can be acquired in time for the user.
In another embodiment of the present invention, after the terminal display is turned on, the set blacklist is updated by using the blacklist in the internal memory, and then step S201 is executed.
Example two:
fig. 3 is a functional block diagram of aterminal 3 for waking up a terminal system according to a second embodiment of the present invention. Theterminal loading module 301, the determiningmodule 302, the wake-up forbidding module 303, the wake-up module 304, the frequent wake-up processing module 305, and the brightscreen restoring module 306.
Theloading module 301 is configured to detect whether a display screen of a terminal where the terminal system is located is closed, and if the display screen is closed, load a preset blacklist and a whitelist into an internal memory of the terminal, and enable the terminal system to enter a sleep mode, where the blacklist records an application program that prohibits waking up the terminal system when the terminal system is in the sleep mode, and the whitelist records an application program that allows waking up the system when the terminal system is in the sleep mode; .
The determiningmodule 302 determines whether there is an application program that needs to wake up the terminal system after the terminal system enters the sleep mode, determines whether the application program corresponding to the system wake-up time is in the blacklist when it is determined that there is an application program that needs to wake up the terminal system, and notifies the wake-upprohibition module 303 to prohibit the terminal system from being woken up and add the application program to a block list if the application program corresponding to the system wake-up time is in the blacklist.
If the application program that needs to wake up the terminal system is not in the black list, the determiningmodule 302 continues to determine whether the application program corresponding to the system wake-up time is in the white list, and if so, the wakingmodule 304 wakes up the terminal system and triggers the application programs in the blocking list one by one when the blocking list is not empty. If not, the frequent wake-upprocessing module 305 generates a wake-up record, records the number of times that the application wakes up the terminal system within a predetermined time after the terminal system enters the sleep mode, determines whether the number of times recorded by the wake-up record is greater than a predetermined value, if so, the application is added to the blacklist, and if not, the wake-upmodule 304 is executed.
The brightscreen recovery module 306 first determines whether the blocking list is empty after the terminal display screen is turned on, if not, triggers the applications in the blocking list one by one, and if so, deletes the black list, the white list and the blocking list in the internal memory.
In other embodiments, the brightscreen recovery module 306 updates the predetermined black list with the black list in the internal memory before determining that the blocked list is empty.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.