Disclosure of Invention
The technical problem to be solved by the present invention is to provide a method and an apparatus for controlling a mobile terminal, and a mobile terminal, which can solve the problems that in the prior art, the power saving effect is not obvious or the user requirement cannot be met in the power saving process of the mobile terminal.
In a first aspect, an embodiment of the present invention provides a method for controlling a mobile terminal, where the method includes:
when the mobile terminal is in a screen-off state, acquiring a first timer needing to be executed, wherein the mobile terminal executes an operation corresponding to the timer when the timer is triggered;
judging whether the first timer is a preset important timer or not;
and when the first timer is not the preset important timer, forbidding to execute the operation corresponding to the first timer, and adding the first timer into a blocking queue.
After the step of judging whether the first timer is a preset important timer, the method further comprises the following steps:
when the first timer is a preset important timer and the first timer is triggered, the central processing unit CPU of the mobile terminal is awakened and the operation corresponding to the first timer is executed.
When the mobile terminal is in the screen-off state, the step of acquiring the first timer to be executed comprises the following steps:
acquiring a starting instruction of a preset power saving mode, and starting the preset power saving mode according to the starting instruction;
when the mobile terminal is in a screen-off state in a preset power-saving mode, a first timer needing to be executed is acquired.
When the mobile terminal is in the screen-off state, the step of acquiring the first timer to be executed comprises the following steps:
when the battery electric quantity of the mobile terminal is smaller than a preset value, starting a preset power saving mode;
when the mobile terminal is in a screen-off state in a preset power-saving mode, a first timer needing to be executed is acquired.
Wherein, the step of judging whether the first timer is a preset important timer comprises the following steps:
judging whether the operation corresponding to the first timer is an operation for awakening the CPU to execute based on natural time or not and whether the trigger time condition of the first timer is accurate time trigger or not;
and when the operation corresponding to the first timer needs to wake up the CPU, and the triggering time condition of the first timer is natural time and is triggered by accurate time, judging that the first timer is a preset important timer, otherwise, judging that the first timer is not the preset important timer.
When the first timer is not the preset important timer, prohibiting executing the operation corresponding to the first timer, and adding the first timer into a blocking queue, the method further comprises:
and when the screen of the mobile terminal is lightened, executing the operation corresponding to the timer in the blocking queue.
In a second aspect, an embodiment of the present invention provides a control apparatus for a mobile terminal, where the apparatus includes:
the mobile terminal comprises an acquisition module, a display module and a control module, wherein the acquisition module is used for acquiring a first timer needing to be executed when the mobile terminal is in a screen-off state, and the mobile terminal executes the operation corresponding to the timer when the timer is triggered;
the judging module is used for judging whether the first timer is a preset important timer or not;
and the first processing module is used for forbidding to execute the operation corresponding to the first timer and adding the first timer into a blocking queue when the first timer is not the preset important timer.
Wherein, the device still includes:
and the second processing module is used for awakening a Central Processing Unit (CPU) of the mobile terminal and executing the operation corresponding to the first timer when the first timer is a preset important timer and the first timer is triggered.
Wherein, in the device, the acquisition module includes:
the first starting unit is used for acquiring a starting instruction of a preset power saving mode and starting the preset power saving mode according to the starting instruction;
the first acquisition unit is used for acquiring a first timer which needs to be executed in a preset power saving mode when the mobile terminal is in a screen-off state.
Wherein, in the device, the acquisition module includes:
the second starting unit is used for starting a preset power saving mode when the battery electric quantity of the mobile terminal is smaller than a preset value;
the second acquisition unit is used for acquiring a first timer needing to be executed in a preset power saving mode when the mobile terminal is in a screen-off state.
Wherein, the judging module includes:
the judging unit is used for judging whether the operation corresponding to the first timer is an operation for awakening the CPU to execute based on natural time or not and whether the trigger time condition of the first timer is accurate time trigger or not;
and when the operation corresponding to the first timer needs to wake up the CPU, and the triggering time condition of the first timer is natural time and is triggered by accurate time, judging that the first timer is a preset important timer, otherwise, judging that the first timer is not the preset important timer.
Wherein, the device still includes:
and the third processing module is used for executing the operation corresponding to the timer in the blocking queue when the screen of the mobile terminal is lightened.
In a third aspect, an embodiment of the present invention provides a mobile terminal, where the mobile terminal includes the control device of the mobile terminal.
Compared with the prior art, the control method and the control device for the mobile terminal and the mobile terminal provided by the embodiment of the invention have the advantages that the first timer which needs to be executed is obtained when the mobile terminal is in the screen-off state, wherein the mobile terminal executes the operation corresponding to the timer when the timer is triggered; judging whether the first timer is a preset important timer or not; when the first timer is not the preset important timer, the operation corresponding to the first timer is forbidden to be executed, and the first timer is added into a blocking queue, so that the mobile terminal can reduce power consumption and prolong standby time, and meanwhile, user using requirements can be taken into consideration, and user experience is improved.
Detailed Description
In order to make the technical problems, technical solutions and advantages of the present invention more apparent, the following detailed description is given with reference to the accompanying drawings and specific embodiments.
When the mobile phone is in power-saving and standby time is ensured, the important functions of the mobile phone, such as answering a call, receiving a short message and the like, are mainly ensured, and other functions can be reduced as much as possible. In specific use, under the condition that the screen of the mobile phone is turned off (screen-off), the mobile phone needs to communicate with a base station except for a wireless network, and most functions of the mobile phone are mainly to wake up the mobile phone through a timer set by an application program, so that power consumption of the mobile phone is caused. Based on this, the embodiments of the present invention provide a control method and apparatus for a mobile terminal, and the mobile terminal, which start with a timer when the mobile terminal turns off a screen, so as to achieve the purposes of reducing standby power consumption of the mobile terminal, prolonging standby time, and meeting user requirements.
Referring to fig. 1, a flowchart of a control method of a mobile terminal according to an embodiment of the present invention is shown, where the control method of the mobile terminal may include a terminal device such as a mobile phone, a tablet computer, an e-book reader, a wearable device, a notebook computer, and the method may include:
step 101, when the mobile terminal is in a screen-off state, acquiring a first timer to be executed, wherein the mobile terminal executes an operation corresponding to the timer when the timer is triggered.
Here, when the mobile terminal is in the screen-off state, a first timer set by an application program (including a system application program and a third-party application program) on the mobile terminal, which needs to be executed, is acquired, and preparation is made for a subsequent step.
Step 102, judging whether the first timer is a preset important timer.
Here, whether the acquired first timer is a preset important timer is judged according to a preset condition, and preparation is made for a subsequent step. When the timer is a preset important timer, the operation corresponding to the timer can be considered as an important function on the mobile terminal.
Step 103, when the first timer is not the preset important timer, prohibiting executing the operation corresponding to the first timer, and adding the first timer into a blocking queue.
When the first timer is judged to be not the preset important timer, the operation corresponding to the first timer is forbidden to be executed, and the first timer is added into the blocking queue, so that the standby power consumption of the mobile terminal is reduced, the standby time is prolonged, and the use requirements of users can be met.
In addition, in an embodiment, after the step of determining whether the first timer is the preset important timer in step 102, the method may further include: when the first timer is a preset important timer, when the first timer is triggered, waking up a Central Processing Unit (CPU) of the mobile terminal and executing an operation corresponding to the first timer.
Here, when it is determined that the first timer meets the preset condition and is a preset important timer, the CPU of the mobile terminal is awakened and the operation corresponding to the first timer is executed at the trigger time of the first timer, so that when the mobile terminal is in the screen-off state in the preset power saving mode, the important function on the mobile terminal can normally operate, and the important function of the mobile terminal is not affected, thereby achieving the purpose of reducing the standby power consumption of the mobile terminal, prolonging the standby time, and simultaneously meeting the user use requirements.
In a preferred embodiment, a preset power saving mode may be preset, where the preset power saving mode is a preset operation mode for reducing the power consumption of the mobile terminal and increasing the standby duration, such as a limited power saving mode or an ultra-long standby mode. When the mobile terminal is in the preset power saving mode, the control method provided by the embodiment of the invention is executed.
In an embodiment, in order to meet the actual use requirements of the user in the actual application scenario, the user may select whether to start the preset power saving mode according to the actual use requirements of the user to save power for the mobile terminal. For this, in step 101, when the mobile terminal is in the screen-off state, the step of acquiring the first timer that needs to be executed may include: acquiring a starting instruction of a preset power saving mode, and starting the preset power saving mode according to the starting instruction; when the mobile terminal is in a screen-off state in a preset power-saving mode, a first timer needing to be executed is acquired. Here, the obtaining of the start instruction may be obtained according to a user operation on a preset start key, that is, when it is detected that the preset start key is triggered, the start instruction of the preset power saving mode is obtained. The preset starting key may be an entity key or a virtual key, and may be specifically set according to an actual design requirement or a user use requirement, which is not limited in this embodiment.
In another embodiment, the preset power saving mode may be started when the battery power of the mobile terminal is lower than a certain power level, so as to prolong the standby time of the mobile terminal and ensure the user experience. For this, in step 101, when the mobile terminal is in the screen-off state, the step of acquiring the first timer that needs to be executed may include: when the battery electric quantity of the mobile terminal is smaller than a preset value, starting a preset power saving mode; when the mobile terminal is in a screen-off state in a preset power-saving mode, a first timer needing to be executed is acquired. Here, the preset value may be set according to an actual design requirement or a use requirement, and the present embodiment does not limit this.
In an embodiment, in step 102, the step of determining whether the first timer is the preset important timer may include the following steps: judging whether the operation corresponding to the first timer is an operation for awakening the CPU to execute based on natural time or not and whether the trigger time condition of the first timer is accurate time trigger or not; and when the operation corresponding to the first timer needs to wake up the CPU, and the triggering time condition of the first timer is natural time and is triggered by accurate time, judging that the first timer is a preset important timer, otherwise, judging that the first timer is not the preset important timer.
Here, in an example, taking a mobile phone of an Android system as an example, by calling a setalarm system interface, several main parameters are obtained to determine whether a timer is a preset important timer. The main parameters of the setalarm system interface may include (for example only): timer type (type), trigger time (triggerTime), and whether it is an accurate time trigger (isExactTime). In this example, whether the timer is the preset important timer is mainly determined by the timer type and whether the two parameters are triggered for the precise time. The timer types include the following five: a timer of type RTC _ WAKEUP, a timer of type RTC _ POWER _ WAKEUP, a timer of type ELAPSED _ READTIME _ WAKEUP, and a timer of type ELAPSED _ READTIME. The timer of the RTC _ wake type indicates that an operation corresponding to the timer is based on natural time (which can be understood as time-minutes and seconds of the human world) and can wake up the CPU, the timer of the RTC type indicates that an operation corresponding to the timer is based on natural time but cannot wake up the CPU, the timer of the RTC _ power _ wake type indicates that an operation corresponding to the timer is based on natural time and can wake up the CPU in a power-off state, the timer of the elapseed _ ready _ wake type indicates that an operation corresponding to the timer is relative to power-on time and can wake up the CPU, and the timer of the elapseed _ ready type indicates that an operation corresponding to the timer is relative to power-on time and cannot wake up the CPU. Therefore, if the timer is a preset important timer, the timer needs to meet the timer with the type of RTC _ wake or the type of RTC _ power _ wake; in addition, it is also required to satisfy the condition that the trigger time is accurate time trigger, that is, isexact time is true, and at this time, the timer can only be triggered according to the set time, and cannot be triggered after a period of time.
In addition, in an embodiment, to ensure comfort of the user during the use experience, in step 103, after the steps of prohibiting execution of the operation corresponding to the first timer and adding the first timer to a congestion queue when the first timer is not a preset important timer, the method may further include the steps of: and when the screen of the mobile terminal is lightened, executing the operation corresponding to the timer in the blocking queue. Here, when the screen of the mobile terminal is lighted, indicating that the user needs to operate and use the mobile terminal, the operation corresponding to the timer in the blocking queue is executed, so as to ensure that the function of the mobile terminal is not affected. In addition, as a preferred implementation of this embodiment, in order to avoid the screen lighting operation caused by the user misoperation, the operation corresponding to the timer in the blocking queue may be executed when the screen of the mobile terminal is lit and the mobile terminal is in the unlocked state.
In addition, when the mobile terminal exits the preset power saving mode, it indicates that the power saving operation of the mobile terminal is not required currently, and at this time, the operation corresponding to the timer in the blocking queue may be executed.
According to the control method of the mobile terminal provided by the embodiment of the invention, when the mobile terminal is in a screen-off state, a first timer needing to be executed is obtained, wherein when the timer is triggered, the mobile terminal executes the operation corresponding to the timer; judging whether the first timer is a preset important timer or not; when the first timer is not the preset important timer, the operation corresponding to the first timer is forbidden to be executed, and the first timer is added into a blocking queue, so that the mobile terminal can reduce power consumption and prolong standby time, and meanwhile, user using requirements can be taken into consideration, and user experience is improved.
In addition, based on the method, the embodiment of the invention also provides a device for implementing the method. Referring to fig. 2, a block diagram of a control apparatus of a mobile terminal according to an embodiment of the present invention is shown, where the control apparatus of the mobile terminal according to an embodiment of the present invention may include a terminal device such as a mobile phone, a tablet computer, an e-book reader, a wearable device, a notebook computer, and the apparatus may include: an obtaining module 210, a determining module 220 and a first processing module 230.
An obtaining module 210, configured to obtain a first timer that needs to be executed when the mobile terminal is in a screen-off state, where the mobile terminal executes an operation corresponding to the timer when the timer is triggered;
the judging module 220 is configured to judge whether the first timer is a preset important timer;
the first processing module 230 is configured to prohibit execution of an operation corresponding to the first timer when the first timer is not the preset important timer, and add the first timer to a congestion queue.
In an embodiment, the apparatus may further include: and a second processing module.
And the second processing module is used for awakening a Central Processing Unit (CPU) of the mobile terminal and executing the operation corresponding to the first timer when the first timer is a preset important timer and the first timer is triggered.
In an embodiment, in the apparatus, the obtaining module 210 may include: the device comprises a first starting unit and a first acquiring unit.
The first starting unit is used for acquiring a starting instruction of a preset power saving mode and starting the preset power saving mode according to the starting instruction;
the first acquisition unit is used for acquiring a first timer which needs to be executed in a preset power saving mode when the mobile terminal is in a screen-off state.
In an embodiment, in the apparatus, the obtaining module 210 may include: a second starting unit and a second obtaining unit.
The second starting unit is used for starting a preset power saving mode when the battery electric quantity of the mobile terminal is smaller than a preset value;
the second acquisition unit is used for acquiring a first timer needing to be executed in a preset power saving mode when the mobile terminal is in a screen-off state.
In one embodiment, the determining module may include: and a judging unit.
The judging unit is used for judging whether the operation corresponding to the first timer is an operation for awakening the CPU to execute based on natural time or not and whether the trigger time condition of the first timer is accurate time trigger or not;
and when the operation corresponding to the first timer needs to wake up the CPU, and the triggering time condition of the first timer is natural time and is triggered by accurate time, judging that the first timer is a preset important timer, otherwise, judging that the first timer is not the preset important timer.
In an embodiment, the apparatus may further include: and a third processing module.
And the third processing module is used for executing the operation corresponding to the timer in the blocking queue when the screen of the mobile terminal is lightened.
The control device of the mobile terminal provided in the above embodiment and the control method of the mobile terminal provided in the above embodiment belong to the same concept, and the specific implementation process thereof is described in detail in the above embodiment of the method, and is not described again here in order to avoid repetition.
In addition, an embodiment of the present invention provides a mobile terminal, which includes the control device of the mobile terminal. The mobile terminal may include terminal devices such as a cell phone, a tablet computer, an e-book reader, a wearable device, a notebook computer, and the like.
Since any of the above-mentioned control devices of the mobile terminal has the above-mentioned technical effects, the mobile terminal having the control device of the mobile terminal should also have corresponding technical effects, and the specific implementation process thereof is similar to that in the above-mentioned embodiment, and will not be described again.
According to the control device of the mobile terminal and the mobile terminal provided by the embodiment of the invention, when the mobile terminal is in a screen-off state, a first timer which needs to be executed is obtained, wherein when the timer is triggered, the mobile terminal executes the operation corresponding to the timer; judging whether the first timer is a preset important timer or not; when the first timer is not the preset important timer, the operation corresponding to the first timer is forbidden to be executed, and the first timer is added into a blocking queue, so that the mobile terminal can reduce power consumption and prolong standby time, and meanwhile, user using requirements can be taken into consideration, and user experience is improved.
Finally, the invention will be described in more detail by way of a specific example, with reference to fig. 3.
In this specific example, taking a mobile phone of an Android system as an example, a preset power saving mode is preset on the mobile phone, and the preset power saving mode is a limit power saving mode. Referring to fig. 3, a flowchart of a control method according to a specific example of the present invention is shown, where the control method according to the specific example includes the following steps:
step 301, judging whether the mobile phone is in the limit power saving mode and in the screen-off state. Here, when it is determined that the mobile phone is in the extreme power saving mode and the screen is turned off (i.e. the screen is turned off), step 302 is executed; otherwise, step 304 is performed.
Step 302, determine whether the timer to be executed is a preset important timer. Here, it is determined whether a timer (including a timer preset by a system application or a third party application or a currently set timer) to be executed is a preset important timer according to a timer type and whether a trigger time condition of the timer is an accurate time trigger. When the type of the timer is a timer of an RTC _ wake type or a timer of an RTC _ power _ wake type and the trigger time condition is accurate time trigger (that is, isexact time is true), it is determined that the timer is a preset important timer, for example, a timer corresponding to functions such as an alarm clock, timed power on, timed power off, and the like, and at this time, step 304 is executed; otherwise, step 303 is performed.
Step 303, add a timer to the congestion queue. Here, when the timer is not the preset important timer, the timer is added into the blocking queue, the operation corresponding to the timer is prohibited from being executed, the subsequent resetting is waited, and the flow is ended. And the subsequent resetting step refers to taking out the timer in the blocking queue and immediately setting the timer to be effective when the screen of the mobile phone is lightened or the limit power saving mode is closed.
At step 304, a timer is set immediately. Here, when the timer is a preset important timer, the timer is immediately set, so that the timer can wake up the CPU and execute the operation corresponding to the timer when triggered, and the process ends.
In addition, in some test experiments, under the condition that the mobile phone shuts down data service, when 10% of electricity remains in the mobile phone, and under the condition that the existing mobile phone is in intelligent standby for 25 hours, if the control method provided by the specific example of the invention is adopted, the number of times of waking up the CPU of the mobile phone in the limit power saving mode can be greatly reduced while important functions such as conversation, short messages, alarm clock and the like are kept, and the standby time of the mobile phone can be increased to 38 hours and is increased by 52%.
For simplicity of explanation, the foregoing method embodiments are described as a series of acts or combinations, but it should be understood by those skilled in the art that the present invention is not limited by the order of acts or acts described, as some steps may occur in other orders or concurrently with other steps in accordance with the invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
It should be appreciated that reference throughout this specification to "one embodiment," "an embodiment," or "some embodiments" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment or example of the present invention. Thus, the appearances of the phrases "in one embodiment," "in one embodiment," or "in some embodiments" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
It is noted that, in the embodiments of the present invention, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the appended claims.