CN110377140B - Method, device, terminal and storage medium for awakening operating system - Google Patents
Method, device, terminal and storage medium for awakening operating system Download PDFInfo
- Publication number
- CN110377140B CN110377140B CN201910639177.9A CN201910639177A CN110377140B CN 110377140 B CN110377140 B CN 110377140B CN 201910639177 A CN201910639177 A CN 201910639177A CN 110377140 B CN110377140 B CN 110377140B
- Authority
- CN
- China
- Prior art keywords
- time
- starting time
- task
- operating system
- batch
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/26—Power supply means, e.g. regulation thereof
- G06F1/32—Means for saving power
- G06F1/3203—Power management, i.e. event-based initiation of a power-saving mode
- G06F1/3206—Monitoring of events, devices or parameters that trigger a change in power modality
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/26—Power supply means, e.g. regulation thereof
- G06F1/32—Means for saving power
- G06F1/3203—Power management, i.e. event-based initiation of a power-saving mode
- G06F1/3234—Power saving characterised by the action undertaken
- G06F1/3287—Power saving characterised by the action undertaken by switching off individual functional units in the computer system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
- G06F9/4418—Suspend and resume; Hibernate and awake
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- Computer Security & Cryptography (AREA)
- Electric Clocks (AREA)
Abstract
The embodiment of the application discloses a method, a device, a terminal and a storage medium for awakening an operating system, and belongs to the technical field of computers. Because this application embodiment can adjust the starting time of the first batch of alarm clock to the starting time of accurate alarm clock, consequently, under the prerequisite of the starting time of guaranteeing accurate alarm clock, can reduce operating system's the number of times of awakening, reduce operating system burden and reduce operating system's energy consumption.
Description
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method, a device, a terminal and a storage medium for waking up an operating system.
Background
With the increasing demand for endurance of mobile terminals, the mobile terminals put higher demands on the task of operating system management itself.
In the related art, a mobile terminal manages tasks that need to be periodically executed through an operating system. When the tasks needing to be executed do not exist in the operating system, the operating system enters a dormant state, and the consumption of electric energy is reduced. When the task needing to be executed exists in the operating system, the operating system is awakened at the starting moment of the alarm clock, and the task corresponding to the alarm clock is executed.
Disclosure of Invention
The embodiment of the application provides a method, a device, a terminal and a storage medium for awakening an operating system. The technical scheme is as follows:
according to an aspect of the present application, there is provided a method of waking up an operating system, the method comprising:
acquiring a first starting time, wherein the first starting time is the starting time of the accurate alarm clock;
when a second starting time and the first starting time meet a preset relation, adjusting the second starting time to the first starting time, wherein the second starting time is the starting time of the first batch of alarm clocks;
and when the system time reaches the first starting time, waking up an operating system and executing a first task and a second task through the operating system, wherein the first task is a task corresponding to the accurate alarm clock, and the second task is a task corresponding to the first batch of alarm clocks.
According to another aspect of the present application, there is provided an apparatus for waking up an operating system, the apparatus comprising:
the time acquisition module is used for acquiring a first starting time, wherein the first starting time is the starting time of the accurate alarm clock;
the time adjusting module is used for adjusting a second starting time to the first starting time when the second starting time and the first starting time meet a preset relation, wherein the second starting time is the starting time of a first batch of alarm clocks;
and the system awakening module is used for awakening an operating system and executing a first task and a second task through the operating system when the system time reaches the first starting time, wherein the first task is a task corresponding to the accurate alarm clock, and the second task is a task corresponding to the first batch of alarm clocks.
According to another aspect of the present application, there is provided a terminal comprising a processor and a memory, wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the method for waking up an operating system as provided in the embodiments of the present application.
According to another aspect of the present application, there is provided a computer-readable storage medium having at least one instruction stored therein, the instruction being loaded and executed by a processor to implement a method of waking an operating system as provided in the implementations of the present application.
The beneficial effects brought by the technical scheme provided by the embodiment of the application can include:
the method and the device for the alarm clock starting can obtain a first starting time, the first starting time is the starting time of the accurate alarm clock, when a preset relation is met between a second starting time and the first starting time, the second starting time is adjusted to the first starting time, the second starting time is the starting time of a first batch of alarm clocks, when the system time reaches the first starting time, an operating system is awakened, and tasks corresponding to the accurate alarm clock and tasks corresponding to the first batch of alarm clocks are executed through the operating system. Because this application embodiment can adjust the starting time of the first batch of alarm clock to the starting time of accurate alarm clock, consequently, under the prerequisite of the starting time of guaranteeing accurate alarm clock, can reduce operating system's the number of times of awakening, reduce operating system burden and reduce operating system's energy consumption.
Drawings
In order to more clearly describe the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 and fig. 2 respectively show a block diagram of a terminal 100 according to an exemplary embodiment of the present application;
FIG. 3 is a flowchart of a method for waking up an operating system according to an exemplary embodiment of the present application;
FIG. 4 is a flowchart of a method for waking up an operating system according to another exemplary embodiment of the present application;
FIG. 5 is a flow chart of some of the steps provided based on the method of waking up an operating system shown in FIG. 4;
FIG. 6 is a flowchart of a method for setting an alarm clock according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a scheme for adding a precise alarm clock according to the embodiment shown in FIG. 6;
fig. 8 is a block diagram illustrating an apparatus for waking up an operating system according to an exemplary embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
In the description of the present application, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In the description of the present application, it is to be noted that, unless otherwise explicitly specified or limited, the terms "connected" and "connected" are to be interpreted broadly, e.g., as being fixed or detachable or integrally connected; can be mechanically or electrically connected; may be directly connected or indirectly connected through an intermediate. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art. Further, in the description of the present application, "a plurality" means two or more unless otherwise specified. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
In order to make the solution shown in the embodiments of the present application easy to understand, several terms appearing in the embodiments of the present application will be described below.
A first start time; refers to the start time of the precise alarm clock (english). In the operation system, the task corresponding to the precise alarm clock accurately wakes up the operation system at the starting moment of the precise alarm clock, and the task corresponding to the precise alarm clock is executed through the operation system.
Accurate alarm clock: in some possible implementations, the operating system provides a mechanism to wake the operating system. In this mechanism, the operating system can have some tasks that need to be performed at a given time execute on time. If the task cannot be executed in advance or executed in a delayed mode, the operating system sets an alarm clock corresponding to the task as an accurate alarm clock when setting the alarm clock for the task, so that the task can be executed at the appointed moment.
The second start time: refers to the starting time of the first group of alarm clocks. Wherein the first batch of alarms are batch alarms that are not marked as accurate alarms.
Batch alarm clock: in some possible implementations, the batch alarm clock includes a start time and an end time (English). The start time of the batch alarm clock is earlier than the end time. The operating system may set a batch alarm clock for the task. In one possible implementation, there is at least one task in the batch alarm clock.
Optionally, when the batch alarm clock is not marked as an accurate alarm clock, the task corresponding to the batch alarm clock wakes up the operating system at the starting time of the batch alarm clock, so that the task corresponding to the batch alarm clock is executed through the operating system.
Optionally, in a real-time manner provided by the application, when the batch alarm clock is a batch alarm clock marked as an accurate alarm clock, corresponding tasks in the batch alarm clock are all to be at the start time of the batch alarm clock, and the operating system is awakened, so that the operating system is instructed to execute the tasks.
It should be noted that, in the batch alarm clock in the related art, the start time and the end time are both fixed and unchangeable. In the scene, the task corresponding to the batch alarm clock wakes up the operating system at the starting moment corresponding to the batch alarm clock, so that the operating system is instructed to execute the task.
Referring to fig. 1 and 2, fig. 1 and 2 respectively show a block diagram of a terminal 100 according to an exemplary embodiment of the present application. The terminal 100 may be a smart phone, a tablet computer, an e-book, and the like. The terminal 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and a bus 130.
The Memory 120 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). Optionally, the memory 120 includes a non-transitory computer-readable medium. The memory 120 may be used to store instructions, programs, code sets, or instruction sets. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like; the storage data area may store data (such as audio data, a phonebook) created according to the use of the terminal 100, and the like.
Taking an operating system as an Android (Android) system as an example, programs and data stored in the memory 120 are shown in fig. 1, and a Linux kernel layer 220, a system runtime layer 240, an application framework layer 260, and an application layer 280 are stored in the memory 120. The Linux kernel layer 220 provides underlying drivers for various hardware of the terminal 100, such as a display driver, an audio driver, a camera driver, a bluetooth driver, a Wi-Fi driver, power management, and the like. The system runtime library layer 240 provides the main feature support for the Android system through some C/C + + libraries. For example, the SQLite library provides support for a database, the OpenGL/ES library provides support for 3D drawing, the Webkit library provides support for a browser kernel, and the like. Also provided in the system Runtime layer 240 is an Android Runtime library (Android Runtime), which mainly provides some core libraries that can allow developers to write Android applications using the Java language. The application framework layer 260 provides various APIs that may be used in building applications, and developers may build their own applications by using these APIs, such as activity management, window management, view management, notification management, content provider, package management, session management, resource management, and location management. At least one application program runs in the application layer 280, and the application programs may be a contact program, a short message program, a clock program, a camera application, etc. of the operating system; or an application program developed by a third-party developer, such as an instant messaging program, a photo beautification program, and the like.
Taking an operating system as an IOS system as an example, programs and data stored in the memory 120 are shown in fig. 2, and the IOS system includes: a Core operating system Layer 320(Core OS Layer), a Core Services Layer 340(Core Services Layer), a Media Layer 360(Media Layer), and a touchable Layer 380(Cocoa Touch Layer). The kernel operating system layer 320 includes an operating system kernel, drivers, and underlying program frameworks that provide functionality closer to hardware for use by program frameworks located in the kernel services layer 340. The core services layer 340 provides system services and/or program frameworks, such as a Foundation framework, an account framework, an advertisement framework, a data storage framework, a network connection framework, a geographic location framework, a motion framework, and so forth, that are needed by the application. The media layer 360 provides audiovisual interfaces for applications, such as graphics-related interfaces, audio-related interfaces, video-related interfaces, and audio/video transmission technology wireless broadcast (AirPlay) interfaces. The touchable layer 380 provides various common interface-related frameworks for application development, and the touchable layer 380 is responsible for user touch interaction operations on the terminal 100. Such as a local notification service, a remote push service, an advertising framework, a game tool framework, a messaging User Interface (UI) framework, a User Interface UIKit framework, a map framework, and so forth.
In the framework shown in FIG. 2, the framework associated with most applications includes, but is not limited to: a base framework in the core services layer 340 and a UIKit framework in the touchable layer 380. The base framework provides many basic object classes and data types, provides the most basic system services for all applications, and is UI independent. While the class provided by the UIKit framework is a basic library of UI classes for creating touch-based user interfaces, iOS applications can provide UIs based on the UIKit framework, so it provides an infrastructure for applications for building user interfaces, drawing, processing and user interaction events, responding to gestures, and the like.
Referring to fig. 3, fig. 3 is a flowchart of a method for waking up an operating system according to an exemplary embodiment of the present application. The method of waking up the operating system can be applied to the terminal 100 shown above. In fig. 3, the method of waking up the operating system includes:
In this embodiment, it should be noted that the terminal can obtain a first start time, where the first start time is a start time of the accurate alarm clock.
In one possible implementation, the precision alarm corresponds to a first task, which may be at least one of a system application, a third party application, a service, a process, or a thread.
Optionally, after the operating system sets up the precise alarm for the first task, the terminal can accordingly obtain a first start time of the precise alarm. In the implementation process of the embodiment of the present application, the step of obtaining the first start time indicated in step 410 may be a step that the operating system actively calls a function or issues a control instruction, or may be a step that the operating system reads the first start time from a storage location where the first start time is specified to be stored, which is not limited in this embodiment of the present application.
And step 420, when the second starting time and the first starting time meet the preset relation, adjusting the second starting time to the first starting time, wherein the second starting time is the starting time of the first batch of alarm clocks.
In this embodiment of the application, the terminal can adjust the second starting time to the first starting time when the second starting time and the first starting time satisfy the preset relationship. And the second starting moment is the starting moment of the first batch of alarm clocks.
Alternatively, the terminal can design a preset relationship for the preset, the preset relationship being used to define the relationship between the two moments. Alternatively, the preset relationship may be used to indicate the length of the duration between two times, or the early-late relationship between two times.
In the application, the terminal can change the starting time of the first batch of alarm clocks.
In one possible implementation, when the first start time is earlier than the second start time, the terminal advances the second start time to the first start time.
In another possible implementation manner, when the first start time is not earlier than the second start time, the terminal delays the second start time to the first start time.
And 430, when the system time reaches the first starting time, waking up the operating system and executing a first task and a second task through the operating system, wherein the first task is a task corresponding to the accurate alarm clock, and the second task is a task corresponding to the first batch of alarm clocks.
In the embodiment of the application, in order that the task can be executed at the specified time, the terminal can monitor the batch alarm clock of the adjusted starting time. When the system time of the terminal reaches the first starting time, the terminal wakes up the operating system and executes a first task and a second task through the operating system, wherein the first task is a task corresponding to the accurate alarm clock, and the second alarm clock is a task corresponding to the first group of alarm clocks.
For example, in one possible implementation, if the first task is running process a, the second task is starting application B, ending thread C, and calling process D. The first start time is 15:24:13, the second start time is 15:24:11, and the preset condition is that the second start time is within 5 seconds before the first start time. In this scenario, the terminal acquires a first start time 15:24:13, since the relationship between the second start time and the first start time satisfies the preset condition. The terminal thus adjusts the second start time to the first start time 15:24: 13. When the system time reaches the first starting time 15:24:13 along with the change of the system time, the terminal wakes up the operating system so as to enable the operating system to run the process A, start the application B, end the thread C and call the process D. Optionally, in order to ensure that the task corresponding to the accurate alarm clock can be accurately executed at the first starting time, the terminal may execute the first task first and then execute the second task. Alternatively, the operating system may be capable of performing the first task and the second task simultaneously when the operating system has sufficient resources to perform the first task and the second task simultaneously.
In summary, the method for waking up the operating system provided in this embodiment can adjust the start time of the first batch of alarm clocks to the start time of the precise alarm clocks when the start time of the precise alarm clocks and the start time of the first batch of alarm clocks meet a preset relationship, so that when the system time reaches the first start time, the terminal can wake up the operating system, execute the first task corresponding to the precise alarm clocks through the operating system, and execute the second task corresponding to the first batch of alarm clocks, thereby achieving an effect of reducing frequent waking up of the operating system, so that the operating system can reduce the waking up times of the operating system on the premise of ensuring that the task corresponding to the precise alarm clocks is accurately started, reduce the burden of the operating system, and reduce the energy consumption of the operating system.
Referring to fig. 4, fig. 4 is a flowchart of a method for waking up an operating system according to another exemplary embodiment of the present application. The method for waking up the operating system can be applied to the terminal shown above. In fig. 4, the method for waking up the operating system includes:
In the embodiment of the present application, the execution process of step 510 is the same as the execution process of step 410, and is not described herein again.
In the embodiment of the present application, after the terminal performs step 510, the terminal may perform step 521, step 522 and step 523, or perform step 550 and step 560. The embodiments of the present application do not limit this. It should be noted that, in another possible implementation manner, the terminal can simultaneously perform step 521, step 522 and step 523. In this scenario, the execution timings of step 521, step 522, and step 523 are not limited.
And step 521, when the second starting time and the first starting time meet a preset relationship, adjusting the second starting time to the first starting time.
In the embodiment of the present application, the execution process of step 521 may refer to the execution process of step 420.
In a possible implementation manner, the preset relationship may include that a duration between the first start time and the second start time is less than a preset threshold, and a length of the preset threshold is a duration between the second start time and an end time of the first group of alarm clocks.
It should be noted that the first batch of alarm clocks has a start time (i.e. the second start time) and an end time. Therefore, the first group of alarm clocks has a corresponding validation time period, the starting time of the validation time period is the second starting time, and the ending time of the validation time period is the technical time of the first group of alarm clocks. In one possible implementation, when a task that does not require accurate time start is executed and the time at which the task is expected to be executed falls within the validation period, the terminal sets the start time of the task to the second start time.
Optionally, the duration between the first starting time and the second starting time is less than the preset threshold. Therefore, the terminal can intensively adjust the starting time of the batch alarm clocks near the starting time of the accurate alarm clocks to the starting time of the accurate alarm clocks, so that the operating system reduces the awakened times on the premise that the triggering time of the accurate alarm clocks is kept unchanged, and the energy consumption of the terminal is reduced on the premise that the same task is executed. Meanwhile, the time length between the first starting time and the second starting time is less than the preset time length. Therefore, the influence of the change of the starting time of the first group of alarm clocks on the execution time of the tasks in the first group of alarm clocks is limited, and therefore, the number of times of awakening the operating system can be reduced on the premise that the starting time of each task is within a controllable range, so that the energy consumption of the terminal is reduced, and the service life of the terminal is prolonged.
Further, when the duration between the first start time and the second start time is less than the preset threshold, the terminal may further control the preset relationship to be not earlier than the second start time at the first start time. It should be noted that, because the duration between the first start time and the second start time is less than the preset threshold, and the length of the preset threshold is the duration between the second start time and the end time of the first batch of alarm clocks. Thus, the second starting moment substantially falls in the period between the first starting moment and the end moment of the first batch of alarms, in which scenario the terminal will consider that the preset relationship is satisfied between the first and second starting moments.
And 522, delaying the end time of the first batch of alarm clocks backwards for a target time length.
In the embodiment of the present application, the target duration is a length of time between the first start time and the second start time. Because the first starting time is earlier than the second starting time, the terminal can correspondingly delay the ending time of the first group of alarm clocks backwards for the target time length, so that the time length between the starting time and the ending time of the adjusted first group of alarm clocks is unchanged, the capacity of the batch alarm clocks for receiving the corresponding tasks to be executed is ensured, and the possibility of errors of the operating system is reduced.
In this embodiment, the terminal delays the second start time back to the first start time. In conjunction with step 522, the terminal can postpone the start time and end time of the first group of alarms back by the target duration as a whole.
In the embodiment of the application, the terminal can mark the first batch of alarm clocks as the accurate alarm clocks after the second starting time of the first batch of alarm clocks is adjusted to the first starting time, so that the first batch of alarm clocks are not adjusted by the starting times of other accurate alarm clocks any more, and on-time triggering of corresponding tasks in the current first batch of alarm clocks is guaranteed.
And 540, when the system time reaches the first starting time, waking up the operating system and executing the first task and the second task through the operating system.
In the embodiment of the present application, the execution process of step 540 is the same as the execution process of step 430, and is not described herein again.
And step 550, newly building the accurate alarm clock as a second batch of alarm clocks when the first starting time is earlier than the second starting time.
In an embodiment of the application, the second set of alarms are set alarms marked as accurate alarms.
It should be noted that when the first start time is earlier than the second start time, the terminal determines that the accurate alarm clock does not fall into the effective time period of the existing batch alarm clocks. In this scenario, the terminal will not adjust the starting time of the existing batch of alarm clocks, but newly create the accurate alarm clocks as a second batch of alarm clocks, and the second batch of alarm clocks are labeled as the accurate alarm clocks.
And step 560, when the system time reaches the starting time of the second batch of alarm clocks, waking up the operating system and enabling the operating system to execute the first task.
In the embodiment of the application, the terminal can wake up the operating system when the system time reaches the starting time of the second batch of alarm clocks, and execute the first task through the operating system. Through the steps, the terminal can ensure that the first task corresponding to the accurate alarm clock is executed by awakening the operating system at the appointed starting moment.
In summary, the embodiment can determine whether to adjust the second starting time according to whether the preset relationship between the second starting time and the first starting time is satisfied. In a possible scenario, when the duration between the second starting time and the first starting time is less than a preset threshold and the first starting time is not earlier than the second starting time, the terminal adjusts the second starting time to the first starting time, so that the operating system completes the effect of executing the first task and the second task under the condition of being awakened once, and the awakening times of the operating system are reduced on the premise of ensuring that the first task and the second task are executed as required, thereby realizing the effect of saving the energy consumption of the terminal.
Based on the method shown in the embodiment, the embodiment of the application also provides a method for waking up the operating system, and the starting time of the batch alarm clock can be adjusted when the starting time of the accurate alarm clock is outside the effective time period of the existing batch alarm clock, so that the effect of reducing the energy consumption of the terminal is achieved. Please refer to the following examples.
Referring to fig. 5, fig. 5 is a flowchart of a part of steps provided based on the method for waking up the operating system shown in fig. 4, and in fig. 5, after performing the completion step 510, the terminal may perform steps including step 570 and step 540. The execution process of step 570 is described as follows:
In the embodiment of the application, the preset relationship can simultaneously define the time length relationship and the sequence relationship between the first starting time and the second starting time. Because the length of the preset threshold is the duration between the second starting time and the ending time of the first batch of alarm clocks, the duration between the first starting time and the second starting time is less than the preset threshold, and the first starting time is earlier than the second starting time.
It can be seen that, in the relationship of the time axis, the starting time of the precise alarm clock is outside the effective time period of the first batch of alarm clocks, and the starting time of the precise alarm clock does not exceed the second starting time by too long a period (preset threshold). In this scenario, the terminal verifies the second task according to the first start time.
In one possible scenario, there are several second tasks, each of which has different requirements at the time of triggering. In one time requirement, see the table below.
Watch 1
In table one, the required triggering time of four second tasks included in the first group of alarm clocks is shown, and since the starting time (i.e. the second starting time) of the first group of alarm clocks is 14:23:04, the required triggering time of the tasks is within the triggering time requirement of the first group of alarm clocks. Therefore, the triggering time of the task one, the task two, the task three and the task four are all unified at 14:23: 04.
When the first starting time is 14:23:01, the terminal verifies the trigger time requirement of the second task according to the first starting time. From the data shown in table two, it can be seen that the first start time can satisfy the trigger time requirements of the tasks shown in table two. Thus, the second task passes the verification.
In a possible implementation manner, the second tasks corresponding to the first group of alarms need to pass verification, so that each task in the operating system can be triggered according to the requirement of the task.
It should be noted that the start time requirement may further include requiring that the second task be a periodic task, and a time interval between the first start time and the start time of the second task requirement is not greater than a target period, which is a period of the second task. In the embodiment of the application, since the alarm clock mechanism is a task designed to be implemented in the future, the terminal can perform a periodic task by using the mechanism. In this scenario, when the second task is a periodic task and the time interval between the first start time and the start time required by the task is small, the terminal is smaller than the current target period, that is, the first start time can be considered to meet the start time requirement of the second task.
In summary, the method for waking up the operating system provided in this embodiment can adjust the second start time of the first group of alarms to the first start time when the first start time meets the start time requirement of the second task corresponding to the first group of alarms, so that the number of times of waking up is reduced when the operating system executes the same number of tasks, thereby prolonging the service life of the terminal.
Referring to fig. 6, fig. 6 is a flowchart of a method for setting an alarm clock according to an embodiment of the present application. The method shown in fig. 6 can be applied to the terminal shown in fig. 1 or fig. 2, and in fig. 6, the method for setting an alarm clock includes:
and step 710, adding an accurate alarm clock to the terminal.
And 720, the terminal detects whether the effective time period of the first batch of alarm clocks in the operating system meets the starting time of the accurate alarm clock.
And step 732, when the effective time period of the first batch of alarm clocks does not meet the starting time of the accurate alarm clocks, the terminal creates the accurate alarm clocks as a second batch of alarm clocks, and the second batch of alarm clocks is marked as the accurate alarm clocks.
And step 740, when the first batch of alarm clocks are not marked as accurate alarm clocks, the terminal adjusts the starting time of the first batch of alarm clocks to the starting time of the accurate alarm clocks.
And step 750, the terminal marks the first batch of alarm clocks as accurate batch of alarm clocks (English) and inserts the accurate alarm clocks into the accurate batch of alarm clocks.
Referring to fig. 7, fig. 7 is a schematic diagram of a scheme for adding a precise alarm clock according to the embodiment shown in fig. 6. In fig. 7, a first batch of alarm clocks 811, 812 and 813 are included, and a precise alarm clock 821, 822 and 823 are included.
Wherein the second starting moment 811a of the first batch of alarm clocks 811 is adjusted to the first starting moment 821a of the precision alarm clock 821. The second start time 812a of the first batch of alarms 812 is adjusted to the first start time 822a of the precision alarm 822. The second start time 813a of the first plurality of alarms 813 remains unchanged. The precision alarm 823 is newly created as a second set of alarms 831.
In fig. 7, the stage before adding the accurate alarm clock is 8A, the stage after adding the accurate alarm clock is 8B, and the stage after adding the accurate alarm clock is 8C. It is apparent that prior to adjustment, the operating system needs to wake up 6 times at time 811a, time 821a, time 812a, time 822a, time 813a and the start of the precision alarm 823. After adjustment, the terminal wakes up 4 times at the starting time of the time 821a, the time 822a, the time 813a and the accurate alarm clock 823, so that the terminal can reduce the waking up times when finishing the same task, and the purpose of saving energy consumption is achieved.
It should be noted that the adjusted first batch of alarm clocks 811 and the adjusted first batch of alarm clocks 812 are both labeled as accurate batch alarm clocks.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 8, fig. 8 is a block diagram illustrating a structure of an apparatus for waking up an operating system according to an exemplary embodiment of the present application. The means for waking up the operating system may be implemented as all or part of the terminal in software, hardware or a combination of both. The device includes:
a time obtaining module 910, configured to obtain a first starting time, where the first starting time is a starting time of an accurate alarm clock;
a time adjusting module 920, configured to adjust a second starting time to the first starting time when the second starting time and the first starting time satisfy a preset relationship, where the second starting time is a starting time of a first batch of alarm clocks;
a system waking module 930, configured to wake up an operating system and execute a first task and a second task through the operating system when the system time reaches the first starting time, where the first task is a task corresponding to the accurate alarm clock, and the second task is a task corresponding to the first batch of alarm clocks.
In an alternative embodiment, the preset relationships involved in the apparatus include: and the time length between the first starting time and the second starting time is less than a preset threshold, and the length of the preset threshold is the time length between the second starting time and the ending time of the first batch of alarm clocks.
In an optional embodiment, the preset relationship referred to in the apparatus further comprises: the first start time is no earlier than the second start time.
In an optional embodiment, the apparatus further comprises an alarm clock marking module, and the alarm clock marking module is configured to mark the first batch of alarm clocks as the precise alarm clocks.
In an optional embodiment, the time adjustment module 920 is configured to delay the ending time of the first group of alarms backward by a target time length, where the target time length is a time length between the first starting time and the second starting time; and the second starting time is delayed backwards to the first starting time.
In an optional embodiment, the apparatus further includes an alarm clock newly-creating module, where the alarm clock newly-creating module is configured to newly create the accurate alarm clocks as a second batch of alarm clocks when the first start time is earlier than the second start time, where the second batch of alarm clocks are batch alarm clocks marked as the accurate alarm clocks. .
In an optional embodiment, the preset relationship related to the apparatus further includes: the first start time is earlier than the second start time, and the first start time meets the start time requirement of the second task.
In an alternative embodiment, the start time requirement comprises: the second task is a periodic task, the time interval between the first starting time and the starting time required by the second task is not greater than a target period, and the target period is the period of the second task.
The present application further provides a computer-readable medium, which stores at least one instruction, where the at least one instruction is loaded and executed by the processor to implement the method for waking up an operating system according to the above embodiments.
It should be noted that: in the method for waking up an operating system according to the foregoing embodiment, only the division of the functional modules is used for illustration, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the above described functions. In addition, the apparatus for waking up an operating system and the method for waking up an operating system provided in the foregoing embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the implementation of the present application and is not intended to limit the present application, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims (10)
1. A method of waking an operating system, the method comprising:
acquiring a first starting time, wherein the first starting time is the starting time of the accurate alarm clock;
when a second starting time and the first starting time meet a preset relation, adjusting the second starting time to the first starting time, wherein the second starting time is the starting time of a first batch of alarm clocks, and the preset relation is at least one of a time length relation between the first starting time and the second starting time and a sequence relation between the first starting time and the second starting time;
delaying the ending time of the first batch of alarm clocks backwards by a target time length, wherein the target time length is the time length between the first starting time and the second starting time;
and when the system time reaches the first starting time, waking up an operating system and executing a first task and a second task through the operating system, wherein the first task is a task corresponding to the accurate alarm clock, and the second task is a task corresponding to the first batch of alarm clocks.
2. The method of claim 1, wherein the preset relationship comprises: and the time length between the first starting time and the second starting time is less than a preset threshold, and the length of the preset threshold is the time length between the second starting time and the ending time of the first batch of alarm clocks.
3. The method of claim 2, wherein the pre-set relationship further comprises: the first start time is no earlier than the second start time.
4. The method of claim 3, wherein after the adjusting the second start time to the first start time, the method further comprises:
and marking the first batch of alarm clocks as the accurate alarm clocks.
5. The method of claim 3, further comprising:
and when the first starting time is earlier than the second starting time, newly building the accurate alarm clock into a second batch of alarm clocks, wherein the second batch of alarm clocks are batch alarm clocks marked as the accurate alarm clocks.
6. The method of claim 2, wherein the pre-set relationship further comprises: the first start time is earlier than the second start time, and the first start time meets the start time requirement of the second task.
7. The method of claim 6, wherein the start time requirement comprises: the second task is a periodic task, the time interval between the first starting time and the starting time required by the second task is not greater than a target period, and the target period is the period of the second task.
8. An apparatus for waking an operating system, the apparatus comprising:
the time acquisition module is used for acquiring a first starting time, wherein the first starting time is the starting time of the accurate alarm clock;
the time adjusting module is used for adjusting a second starting time to the first starting time when the second starting time and the first starting time meet a preset relation, wherein the second starting time is the starting time of a first batch of alarm clocks;
the time adjusting module is further configured to delay the ending time of the first group of alarm clocks backwards by a target time length, where the target time length is a time length between the first starting time and the second starting time;
and the system awakening module is used for awakening an operating system and executing a first task and a second task through the operating system when the system time reaches the first starting time, wherein the first task is a task corresponding to the accurate alarm clock, and the second task is a task corresponding to the first batch of alarm clocks.
9. A terminal, characterized in that the terminal comprises a processor, a memory connected to the processor, and program instructions stored on the memory, which when executed by the processor implement a method of waking up an operating system as claimed in any one of claims 1 to 7.
10. A computer readable storage medium having stored thereon program instructions which, when executed by a processor, implement a method of waking an operating system as claimed in any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910639177.9A CN110377140B (en) | 2019-07-16 | 2019-07-16 | Method, device, terminal and storage medium for awakening operating system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910639177.9A CN110377140B (en) | 2019-07-16 | 2019-07-16 | Method, device, terminal and storage medium for awakening operating system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110377140A CN110377140A (en) | 2019-10-25 |
CN110377140B true CN110377140B (en) | 2021-04-20 |
Family
ID=68253277
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910639177.9A Active CN110377140B (en) | 2019-07-16 | 2019-07-16 | Method, device, terminal and storage medium for awakening operating system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110377140B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113626778B (en) * | 2020-05-08 | 2024-04-02 | 百度在线网络技术(北京)有限公司 | Method, apparatus, electronic device and computer storage medium for waking up device |
CN112463242A (en) * | 2020-12-17 | 2021-03-09 | 南方电网电力科技股份有限公司 | Starting method and device for electric energy meter operating system, electric energy meter and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105354044A (en) * | 2014-08-21 | 2016-02-24 | 阿里巴巴集团控股有限公司 | Application awakening method and apparatus |
CN106793030A (en) * | 2016-12-01 | 2017-05-31 | 北京奇虎科技有限公司 | application management method, device and mobile terminal |
CN106959857A (en) * | 2017-03-29 | 2017-07-18 | 联想(北京)有限公司 | The application control method and apparatus of a kind of electronic equipment |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107211465A (en) * | 2015-01-30 | 2017-09-26 | 瑞典爱立信有限公司 | The method and apparatus of uplink radio access is enabled under cluster alarm scene |
CN106791215B (en) * | 2017-03-28 | 2020-06-12 | Oppo广东移动通信有限公司 | Alarm clock setting method and mobile terminal with alarm clock function |
-
2019
- 2019-07-16 CN CN201910639177.9A patent/CN110377140B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105354044A (en) * | 2014-08-21 | 2016-02-24 | 阿里巴巴集团控股有限公司 | Application awakening method and apparatus |
CN105354044B (en) * | 2014-08-21 | 2018-11-13 | 阿里巴巴集团控股有限公司 | A kind of application awakening method and device |
CN106793030A (en) * | 2016-12-01 | 2017-05-31 | 北京奇虎科技有限公司 | application management method, device and mobile terminal |
CN106959857A (en) * | 2017-03-29 | 2017-07-18 | 联想(北京)有限公司 | The application control method and apparatus of a kind of electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN110377140A (en) | 2019-10-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019174474A1 (en) | Lag information acquisition method and device and terminal | |
CN109542614B (en) | Resource allocation method, device, terminal and storage medium | |
CN109343902B (en) | Audio processing assembly operation method and device, terminal and storage medium | |
CN110955499B (en) | Processor core configuration method, device, terminal and storage medium | |
CN110968415B (en) | Scheduling method and device of multi-core processor and terminal | |
US10564708B2 (en) | Opportunistic waking of an application processor | |
CN110377140B (en) | Method, device, terminal and storage medium for awakening operating system | |
CN107765773B (en) | Method, device, terminal and storage medium for displaying information | |
WO2019201340A1 (en) | Processor core scheduling method and apparatus, terminal, and storage medium | |
WO2020082471A1 (en) | Lamp effect control method, control unit, intelligent terminal, and computer readable storage medium | |
CN117319376A (en) | File downloading control method and device, electronic equipment and storage medium | |
CN112135056A (en) | Shooting method, shooting device, electronic equipment and storage medium | |
CN113568748B (en) | Application process processing method and device, storage medium and electronic equipment | |
CN114237851A (en) | Timed task execution method, timed task execution device, timed task execution equipment and timed task execution storage medium | |
CN113114849A (en) | Alarm clock reminding method and device, storage medium and terminal | |
JP5505517B2 (en) | Information processing apparatus, power control method, and power control program | |
CN111556194B (en) | Brightness adjusting method and device, storage medium and terminal | |
CN115080158B (en) | Interface display method, device, terminal equipment and computer readable storage medium | |
WO2022218191A1 (en) | Method and apparatus for displaying amount of charge, storage medium, and terminal device | |
CN113691676B (en) | Equipment state prompting method and device, storage medium and electronic equipment | |
WO2023138235A1 (en) | Theme switching method and apparatus, and device, storage medium and program product | |
CN110278331B (en) | System attribute feedback method, device, terminal and storage medium | |
CN114896428A (en) | Data management method and device, storage medium and electronic equipment | |
CN115080158A (en) | Interface display method and device, terminal equipment and computer readable storage medium | |
CN116801354A (en) | Resource allocation method and device, terminal, server and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |