Screen-off task processing method, electronic equipment, storage medium and chip system

By transferring the screen-off task to execution when the screen is on and utilizing the current support when the screen is on, the problem of increased CPU and DDR current when the screen is off is solved, thereby extending the battery life of electronic devices.

CN120768982APending Publication Date: 2025-10-10HONOR DEVICE CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411181251.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2025-10-10

AI Technical Summary

Technical Problem

When the screen of an electronic device is off, the base current of the CPU and DDR increases due to executing tasks, affecting the battery life.

Method used

Transfer the screen-off task to be executed when the screen is on, use the current support of the foreground task when the screen is on, and reduce the CPU and DDR current when the screen is off.

Benefits of technology

By reducing the current consumption when the screen is off, the battery life of electronic devices is extended.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120768982A_ABST
    Figure CN120768982A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a screen-off task processing method, electronic equipment, a storage medium and a chip system. The method comprises the steps that when the electronic equipment is in a screen-on state and under the condition that the electronic equipment meets a first condition, the electronic equipment can execute a target task, and the target task is configured to run when the electronic equipment is in a screen-off state. In the method, the electronic equipment can transfer the target task to run when the screen is turned on, DDR and CPU base current generated when the electronic equipment runs the target task when the screen is turned off can be saved, and the endurance time of the electronic equipment is prolonged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a method for processing a screen-off task, an electronic device, a storage medium, and a chip system. Background Art

[0002] As the functions of electronic devices become more abundant, the tasks they perform are also increasing. The increase in tasks will inevitably lead to an increase in the power consumption of electronic devices, affecting the battery life of electronic devices, and the battery life of electronic devices directly affects the user experience.

[0003] Currently, electronic devices enter a low-power mode when the screen is off. Electronic devices can set many tasks to execute when the screen is off, thinking that this would reduce the power consumption of the electronic device without affecting the performance of the electronic device. However, when the screen is off, in addition to the heartbeat task, other tasks run for a long time, resulting in a large and long-lasting base current for the central processing unit (CPU) and double data rate synchronous synamic random access memory (DDR) in the electronic device. In essence, the power consumption of the electronic device will be greater, thereby affecting the battery life of the electronic device. Summary of the Invention

[0004] The present invention provides a method for processing screen-off tasks, an electronic device, a storage medium, and a chip system for use in the field of terminal technology. The electronic device transfers tasks that are configured to be executed when the screen is off to execution when the screen is on, thereby reducing the base current of the CPU and DDR when the screen is off and increasing the battery life of the electronic device.

[0005] First, an embodiment of the present application proposes a method for processing a screen-off task. The subject executing the method may be a first electronic device or a chip in the first electronic device. The following description will be made using the first electronic device as an example. In the prior art, taking a second electronic device as an example, when the screen of the second electronic device is off, the second electronic device can execute the target task. This will increase the base current of the CPU and DDR when the screen is off, thereby reducing the battery life of the electronic device.

[0006] In the method provided in an embodiment of the present application, when the screen of the first electronic device is on and the first electronic device meets a first condition, the first electronic device may execute a target task, wherein the target task is configured to execute when the screen of the first electronic device is off.

[0007] In the embodiments of the present application, since the electronic device itself needs to perform foreground tasks or background tasks when the screen is on, the electronic device itself will provide a large base current for the DDR and the CPU, and the base current of the DDR and the CPU is sufficient to support the additional execution of the part of the screen-out tasks, so that the DDR and the CPU do not generate additional base current. Therefore, the part of the screen-out tasks is executed when the screen is on, which does not increase the power consumption of the electronic device, reduces the overall power consumption of the electronic device, and increases the endurance time of the electronic device.

[0008] The first condition and the target task will be described below. The electronic device represents the first electronic device:

[0009] The first condition is a condition for the electronic device to perform the target task. When the electronic device meets the first condition, the electronic device can perform the target task when the electronic device is in the on-screen state. When the electronic device does not meet the first condition, the electronic device does not perform the target task when the electronic device is in the on-screen state.

[0010] In a possible implementation, the first condition includes that when the electronic device is in the on-screen state, the scene category of the foreground task of the electronic device is a low-load scene, and the temperature of the electronic device is less than or equal to a first temperature threshold. The temperature of the electronic device can include the temperature of the shell of the electronic device, the temperature of the central processing unit (CPU) of the electronic device, or the temperature of the battery of the electronic device.

[0011] In some embodiments, different foreground tasks occupy different CPU resources and have different CPU loads. For example, when the scene category of the foreground task is, for example, an e-book, news information, video, or shopping, the foreground task occupies less CPU resource and has low CPU load, and the scene category of the foreground task is a low-load scene. When the scene category of the foreground task is, for example, a game or a camera, the foreground task occupies more CPU resource and has high CPU load, and the scene category of the foreground task is a high-load scene.

[0012] In some embodiments, the electronic device can take a candidate task that meets the trigger condition as the target task. The candidate task is a task (which can be referred to as a second task) configured to run when the electronic device is in the off-screen state. In some embodiments, the candidate task can include a timing task (which can be referred to as a first task) executed within a preset time at the current time.

[0013] The candidate task can not include a heartbeat task. Similarly, the target task does not include a heartbeat task.

[0014] In one possible implementation, when the electronic device is in the bright screen state, in order not to affect the execution of the foreground task, the electronic device can classify the temperature of the electronic device and accurately control the execution of the target task through the temperature classification of the electronic device. The following describes the process of controlling the execution of the target task by the temperature classification of the electronic device:

[0015] When the screen of an electronic device is on, in order not to affect the execution of the foreground task, the electronic device can use a temperature classification method to accurately control the execution of the target task. For example, taking the temperature threshold of the electronic device as 3, that is, the temperature of the electronic device is divided into 3 levels, the process of controlling the execution of the target task by the electronic device is described as follows:

[0016] When the scenario category of the foreground task of the electronic device is a low-load scenario, the electronic device determines whether the temperature of the electronic device is less than or equal to a second temperature threshold. If the temperature of the electronic device is less than or equal to the second temperature threshold, the electronic device determines whether the temperature of the electronic device is less than or equal to a first temperature threshold. If the temperature of the electronic device is greater than the second temperature threshold, the electronic device stops transferring the target task to the operation when the electronic device is in the bright screen state.

[0017] In some embodiments, the temperature of the electronic device can reflect the load of the electronic device. When the temperature of the electronic device is greater than the second temperature threshold, it can indicate that the load of the electronic device is high. At this time, if the target task is executed, the load of the electronic device will increase, affecting the operation of the foreground task. Therefore, when the temperature of the electronic device is greater than the second temperature threshold, stop transferring the target task to the electronic device when the screen is on.

[0018] When the temperature of the electronic device is less than or equal to the second temperature threshold, the electronic device determines whether the temperature of the electronic device is less than or equal to the first temperature threshold. If the temperature of the electronic device is less than or equal to the first temperature threshold, the electronic device determines the target task and determines whether the temperature of the electronic device is less than or equal to the third temperature threshold.

[0019] In some embodiments, when the temperature of the electronic device is greater than a first temperature threshold, it indicates that the load of the electronic device is high. At this time, if the target task is executed, the load of the electronic device will increase, affecting the operation of the foreground task. Therefore, when the temperature of the electronic device is less than or equal to 36°C, the electronic device determines the target task.

[0020] In some embodiments, the second temperature threshold is greater than the first temperature threshold, and the first temperature threshold is greater than the third temperature threshold.

[0021] When the temperature of the electronic device is less than or equal to the third temperature threshold, the electronic device may intermittently run the target task and control the load of the target task to be less than or equal to the first load threshold.

[0022] When the temperature of the electronic device is greater than the third temperature threshold, the electronic device intermittently runs the target task and controls the load of the target task to be less than or equal to the second load threshold.

[0023] In some embodiments, the second load threshold is less than the first load threshold.

[0024] In an embodiment of the present application, when the electronic device is in the bright screen state, the electronic device can run the target task intermittently in stages according to the temperature of different electronic devices, which can achieve precise control of the target task and the load of the target task, and ensure the smooth operation of the foreground task.

[0025] In some embodiments, after the electronic device executes the target task, if the scenario category of the foreground task of the electronic device is not a low-load scenario, that is, the scenario category of the foreground task of the electronic device is a high-load scenario, because the target task is executing in the electronic device, the electronic device may start a timer. The timer duration is a preset duration, and the electronic device may execute the target task within the preset duration.

[0026] In some embodiments, when the scenario category of the current task is not a low-load scenario, if the electronic device stops running the target task, the execution of the target task will be interrupted, affecting the progress of the target task. Therefore, the electronic device can set a timer to ensure the completion of the target task.

[0027] In some embodiments, when the scenario category of the foreground task of the electronic device is a high-load scenario, there is a target task running in the electronic device. At this time, the target task should not be stopped immediately. The operation of the target task can be ensured by reducing the load of the target task.

[0028] In some embodiments, after starting the timer, the electronic device may continue to determine the scenario category of the foreground task to determine whether the scenario category of the foreground task is the first high-load scenario. If not, the target task is intermittently run, and the load of the target task is controlled to be less than or equal to a third load threshold. If so, the target task is intermittently run, and the load of the target task is controlled to be less than or equal to a fourth load threshold. The fourth load threshold is less than the third load threshold.

[0029] Since the target task is running when the scenario category of the foreground task is the first high load, the load of the target task is controlled to be lower than the second load threshold. Therefore, the third load threshold is lower than the second load threshold. The following uses the first load threshold as an example to describe the process of intermittently running the target task on an electronic device and controlling the load of the target task to be less than or equal to the first load threshold:

[0030] In some embodiments, the target task is executed in a first process, and the electronic device can determine the current load of the first process through the first process. The electronic device determines the running time and sleep time of the first process based on the current load and target load of the first process. The electronic device divides the running time of the first process into N time periods and determines the running time and sleep time within each time period. The electronic device can execute the target task during the running time within each time period and suspend the execution of the target task during the sleep time within each time period until the target task is completed.

[0031] In the embodiment of the present application, the electronic device can reduce the load of the target task by intermittently executing the target task to ensure the smooth execution of the foreground task.

[0032] In some embodiments, the running time and sleeping time of the first process may be referred to as the original free scheduling time, and each time period after division may be referred to as each TIME_SLOT, each TIME_SLOT including the running time and sleeping time.

[0033] In some embodiments, the electronic device may perform the following steps to determine the running time and sleep time of each TIME_SLOT:

[0034] Step A: The electronic device calculates the current target load based on the target load, the current load, and the previous target load.

[0035] In some embodiments, when the electronic device is adjusted for the first time, the last target load is the current load.

[0036] It should be understood that the target load here is the first load threshold.

[0037] Step B: The electronic device determines the running time of each TIME_SLOT according to each TIME_SLOT and the current target load.

[0038] Step C: The electronic device determines the sleep time in each TIME_SLOT according to each TIME_SLOT and the running time in each TIME_SLOT.

[0039] It should be understood that each TIME_SLOT consists of a running time and a sleeping time, and the sleeping time is equal to the difference between the TIME_SLOT and the running time in the TIME_SLOT.

[0040] Step D: The electronic device uses the current target load as the previous target load and repeats steps A-D until the current target load is less than or equal to the target load, i.e., the first load threshold. If the current target load is less than or equal to the target load, the scheduling task module may use the final determined run time and sleep time in each TIME_SLOT as the final run time and sleep time in each TIME_SLOT.

[0041] In some embodiments, the target task already running in the electronic device may be referred to as a third task.

[0042] In a second aspect, an embodiment of the present application provides a device for processing a screen-off task. The device for processing the screen-off task may be an electronic device, or a chip or chip system within an electronic device. The device for processing the screen-off task may include a display unit and a processing unit. When the device for processing the screen-off task is an electronic device, the display unit may be a display screen. The display unit is used to perform the display step so that the electronic device implements a method for processing a screen-off task described in the first aspect or any possible implementation of the first aspect. When the device for processing the screen-off task is an electronic device, the processing unit may be a processor. The device for processing the screen-off task may also include a storage unit, which may be a memory. The storage unit is used to store instructions, and the processing unit executes the instructions stored in the storage unit so that the electronic device implements a method for processing a screen-off task described in the first aspect or any possible implementation of the first aspect. When the device for processing the screen-off task is a chip or chip system within an electronic device, the processing unit may be a processor. The processing unit executes the instructions stored in the storage unit so that the electronic device implements a method for processing a screen-off task described in the first aspect or any possible implementation of the first aspect. The storage unit may be a storage unit within the chip (eg, a register, a cache, etc.), or a storage unit within the electronic device that is located outside the chip (eg, a read-only memory, a random access memory, etc.).

[0043] Exemplarily, the display unit is used to present the interface of the application program for the foreground task performed by the electronic device, and to display the progress of the foreground task. For example, when the screen of the electronic device is on, the user downloads a video, and the display unit presents a page for downloading the video of the video application, and a progress bar can also be presented on the page, which is used to indicate the progress of downloading the video.

[0044] The processing unit is used to transfer the target task when the electronic device is in the off-screen state to be executed when the screen is on. For details, please refer to the relevant description in the following embodiments.

[0045] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory is used to store code instructions, and the processor is used to run the code instructions to execute the method described in the first aspect or any possible implementation of the first aspect.

[0046] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is run on a computer, the computer executes the method described in the first aspect or any possible implementation of the first aspect.

[0047] In a fifth aspect, an embodiment of the present application provides a computer program product comprising a computer program, which, when the computer program runs on a computer, enables the computer to execute the method described in the first aspect or any possible implementation of the first aspect.

[0048] In a sixth aspect, the present application provides a chip or chip system, comprising at least one processor and a communication interface, wherein the communication interface and the at least one processor are interconnected via a line, and the at least one processor is configured to execute a computer program or instruction to perform the method described in the first aspect or any possible implementation of the first aspect. The communication interface in the chip may be an input / output interface, a pin, or a circuit.

[0049] In one possible implementation, the chip or chip system described above in this application further includes at least one memory, in which instructions are stored. The memory may be a storage unit within the chip, such as a register, a cache, etc., or a storage unit of the chip (e.g., a read-only memory, a random access memory, etc.).

[0050] It should be understood that the second to sixth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 A schematic diagram of an electronic device performing a screen-off task when the screen is off, provided in an embodiment of the present application;

[0052] Figure 2 A schematic diagram of substrate current in an electronic device when the screen is off, provided in an embodiment of the present application;

[0053] Figure 3 A schematic diagram comparing substrate currents of an electronic device before and after optimization provided by an embodiment of the present application;

[0054] Figure 4A schematic diagram of the structure of an electronic device provided in this application;

[0055] Figure 5 A software structure block diagram of an electronic device provided in an embodiment of the present application;

[0056] Figure 6A A structural block diagram of another electronic device provided in an embodiment of the present application;

[0057] Figure 6B A schematic diagram of a processing flow of a task scheduling engine provided in an embodiment of the present application;

[0058] Figure 7 A flowchart of a method for processing a screen-off task provided in an embodiment of the present application;

[0059] Figure 8 A flowchart of another method for processing a screen-off task provided in an embodiment of the present application;

[0060] Figure 9 A schematic diagram of an intermittently running target task provided in an embodiment of the present application;

[0061] Figure 10 A flowchart of another method for processing a screen-off task provided in an embodiment of the present application;

[0062] Figure 11 A flowchart of another method for processing a screen-off task provided in an embodiment of the present application. DETAILED DESCRIPTION

[0063] To facilitate a clear description of the technical solutions of the embodiments of the present application, some of the terms and technologies involved in the embodiments of the present application are briefly introduced below:

[0064] 1. Task: refers to a function completed by an electronic device using an application in the electronic device or a service by performing a series of operations. Tasks can be initiated by the user, such as making a call, sending text messages, browsing the web, downloading tasks, etc. A download task can be, for example, downloading an upgrade package, which is used to update the operating system or application of the electronic device. Tasks can also be automatically executed by electronic devices, such as background data synchronization, operating system updates, application updates, scheduled tasks, etc. Scheduled tasks can be scheduled upload tasks, scheduled download tasks, etc. Upload tasks, for example, synchronize pictures and videos in the gallery to the cloud, or synchronize the user's sports health data to the cloud.

[0065] In some embodiments, tasks may also include artificial intelligence (AI) operations. For example, AI operations can optimize images or combine images in a gallery into a video (one-click creation). Image optimization can include improving image clarity or blurring the background.

[0066] The embodiments of the present application do not exhaustively list the tasks performed by the electronic device.

[0067] 2. Foreground Task: This refers to the task that the user is currently interacting with on the electronic device. The electronic device's interface can display the foreground task's page, and the user can operate the foreground task's page. For example, if the electronic device is a mobile phone and the foreground task is web browsing, the mobile phone's interface can display the web page, and the user can browse and operate the web page.

[0068] 3. Background tasks: In contrast to foreground tasks, background tasks refer to tasks that the user is not currently interacting with but are still running in the background of the electronic device.

[0069] For example, if a mobile phone displays a music app's page and plays a song, playing the song can be considered a foreground task. If the user switches the music app to the background, the phone no longer displays the music app's page, but the music app continues to play the song. Playing the song can also be considered a background task.

[0070] 4. Double data rate synchronous synamic random access memory (DDR SDRAM): Also known as DDR, this is a high-speed memory technology that doubles the data transfer rate. DDR can exchange data with the central processing unit (CPU).

[0071] In some embodiments, DDR is a type of memory storage. In the embodiments of the present application, the memory storage may also be other types of memory. The following embodiments are described using DDR as an example.

[0072] 5. Screen-off standby: When an electronic device's screen is off but the device is not shut down, it can enter low-power mode. In low-power mode, the device can still receive some basic notifications, such as incoming calls, text messages, and email reminders, but the screen will no longer light up, which can save the device's battery.

[0073] In some embodiments, screen-off standby can be understood as screen-off, and the following embodiments are explained using screen-off as an example.

[0074] 6. Base Current: In the embodiments of this application, this refers to the current consumed by the electronic device when the screen is off. In some embodiments, the base current is primarily used to support the most basic operating tasks of the electronic device and is the minimum current of the electronic device in low-power mode.

[0075] 7. Electronic equipment:

[0076] The electronic device of the embodiment of the present application may include a handheld device, a vehicle-mounted device, etc. having the function of performing tasks. For example, some electronic devices include: mobile phones, tablet computers, PDAs, laptop computers, mobile internet devices (MIDs), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self-driving cars, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), handheld devices with wireless communication capabilities, computing devices or other processing devices connected to wireless modems, in-vehicle devices, wearable devices, terminal devices in 5G networks or future evolved public land mobile communication networks. The terminal equipment in the network (PLMN), etc., is not limited to this in the embodiments of the present application.

[0077] As an example and not a limitation, in the embodiments of the present application, the electronic device may also be a wearable device. Wearable devices may also be referred to as wearable smart devices, which are a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those that are fully functional, large in size, and can achieve complete or partial functions without relying on smartphones, such as smart watches or smart glasses, as well as those that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.

[0078] In addition, in the embodiments of the present application, the electronic device can also be a terminal device in the Internet of Things (IoT) system. IoT is an important part of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, thereby realizing an intelligent network of human-machine interconnection and object-to-object interconnection.

[0079] The electronic devices in the embodiments of the present application may also be referred to as: terminal equipment, user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device, etc.

[0080] When an electronic device is in the off state, it enters a low-power mode. When an electronic device is in low-power mode, the hardware in the electronic device, such as DDR and CPU, will have a base current when running. The base current is mainly used to support the most basic working tasks of DDR and CPU, and is the minimum current of the electronic device in low-power mode. At this time, the base current of DDR and CPU is small, and the power consumption of the electronic device is small. Among them, when the electronic device is in the off state, the base current of DDR and CPU can be called the off-screen base current of the electronic device.

[0081] Because the electronic device is in low-power mode, the base current of the DDR and CPU in the electronic device is relatively low. In some embodiments, in order to reduce the power consumption of the electronic device without affecting the performance of the electronic device, the electronic device can set many tasks to be executed when the electronic device is in the screen-off state. Among them, the tasks executed when the electronic device is in the screen-off state can be referred to as "screen-off tasks." Figure 1A schematic diagram of an electronic device performing a screen-off task when the screen is off is provided in an embodiment of the present application. Figure 1 , screen-off tasks may include, for example: heartbeat tasks, download tasks, upload tasks, AI computing tasks, etc.

[0082] When an electronic device performs a screen-off task, in order to support the operation of the screen-off task, the electronic device will increase the base current of the DDR and CPU. Among them, the base current of the DDR and CPU is positively correlated with the number of screen-off tasks and the running time. At present, electronic devices set many tasks to be executed when the screen is off. The number of tasks is large and the running time is long. This will cause the base current of the DDR and CPU of the electronic device to be large when the screen is off, and the existence time is long. In fact, the power consumption of the electronic device will be greater, thereby reducing the battery life of the electronic device.

[0083] Figure 2 A schematic diagram of the substrate current in an electronic device when the screen is off provided in an embodiment of the present application. Figure 2 When the electronic device is in the screen-off state and the electronic device is not performing the screen-off task, the electronic device is in low-power mode, and the screen-off base current of the electronic device is 6mA. When the electronic device is in the screen-off state and the electronic device is performing the screen-off task, in addition to the 6mA screen-off base current, in order to support the operation of the screen-off task, the electronic device will increase the base current of the DDR and CPU, such as 8mA. At this time, the base current of the electronic device is large, and this large current exists during the entire period of execution of the screen-off task.

[0084] Reference Figure 2 In this embodiment, the screen-off task includes a heartbeat task, Task A, and Task B. For example, Task A can be a download task, and Task B can be an upload task. The base current of the DDR and CPU is equal to the sum of the current required to execute the heartbeat task, the current required to execute Task A, and the current required to execute Task B.

[0085] Among them, the heartbeat task in the screen-off task is mainly a periodic detection task, which is used to keep the electronic device active in connection with other devices (such as servers or other electronic devices). The heartbeat task requires a small current when executing, occupies a small base current of the CPU and DDR, and has little impact on the power consumption of the electronic device. However, other screen-off tasks, such as download tasks, upload tasks, AI calculations, etc., require a large current when executing, occupy a large base current of the CPU and DDR, and generate large power consumption.

[0086] Accordingly, the present application provides a method for processing screen-off tasks, in which, in addition to heartbeat tasks, electronic devices can transfer other screen-off tasks to run when the screen is on, thereby reducing the current demand of these screen-off tasks on the electronic device when the screen is off, and reducing the power consumption of the electronic device when the screen is off. In addition, since the electronic device itself also needs to perform foreground tasks or background tasks when the screen is on, the electronic device itself will provide a larger base current for the DDR and CPU. The base current of the DDR and CPU is sufficient to support the additional execution of this part of the screen-off tasks, so the operation of the DDR and CPU will not generate additional base current. Therefore, executing this part of the screen-off tasks when the screen is on will not increase the power consumption of the electronic device. Accordingly, the overall power consumption of the electronic device can be reduced and the battery life of the electronic device can be increased.

[0087] Figure 3 a in the figure is a schematic diagram of executing the screen-off task when the electronic device is in the screen-off state. Figure 3 Figure b is a schematic diagram of an electronic device performing a screen-off task (except for the heartbeat task) when the screen is on. Figure 3 The a in can refer to Figure 2 In the description Figure 3 In a, when the electronic device is in the off state, executing the off-screen task will increase the base current of the CPU and DDR, resulting in greater power consumption. For example, the current required for the heartbeat task, task A, and task B is 8mA. Figure 3 In b, when the electronic device is in the screen-on state, the electronic device can perform foreground tasks. Taking the foreground task as an e-book task as an example, the electronic device can provide a larger base current for the DDR and CPU, and the base current is used to support the operation of the e-book task. In the process of the electronic device performing the e-book task, the electronic device can also perform screen-off tasks (such as task A and task B). At this time, the DDR and CPU are sufficient to support the operation of the screen-off tasks. For example, if the current required for the electronic device to perform the heartbeat task when the screen is off is 2mA, then the current required for task A and task B is 6mA. Figure 3 In a, in the embodiment of the present application, the electronic device executes tasks A and B when the screen is on, and does not execute tasks A and B when the screen is off. This can save 6mA of current when the screen is off, reduce the power consumption of the electronic device, and thereby increase the battery life of the electronic device.

[0088] Before introducing the method for processing the screen-off task provided in the embodiment of the present application, the structure of the electronic device provided in the embodiment of the present application is first introduced:

[0089] Figure 4 This is a schematic diagram of the structure of an electronic device provided by this application. Figure 4The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195. It will be understood that the structure shown in this embodiment does not constitute a specific limitation on the electronic device 100.

[0090] In some embodiments, the processor 110 can be understood as the CPU in the above embodiments. In the embodiments of the present application, the processor 110 can be used to transfer the screen-off task to the electronic device to run when the screen is on. The specific process can refer to the description in the following embodiments. Among them, the steps performed by the electronic device in the following embodiments can be regarded as the steps performed by the processor 110.

[0091] In some embodiments, the internal memory 121 may include DDR. The internal memory 121 may be used to store one or more computer programs, each of which includes instructions. The processor 110 may execute the instructions stored in the internal memory 121, thereby enabling the electronic device 100 to implement the method for processing the screen-off task provided in the embodiments of the present application.

[0092] In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0093] The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a microservice architecture, or a cloud architecture. The embodiment of the present application takes the layered architecture as an example to illustrate the software structure of the electronic device. Figure 5 A software structure diagram of an electronic device provided in an embodiment of the present application. The layered architecture divides the software system of the electronic device into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, refer to Figure 5 , an electronic device may include: an application layer (applications), an application framework layer (applicationframework), and a kernel layer (kernel).

[0094] It is understood that the division of the software structure of the electronic device in the embodiment of the present application is an example. The embodiment of the present application does not limit the hierarchical division method in the software system of the electronic device. The modules in each level in the following embodiment are the modules involved in the embodiment of the present application. Each level may also include more or fewer modules than shown in the figure, or combine or split certain modules.

[0095] The application layer can include a series of application packages, and the application layer runs applications by calling the application programming interface (API) provided by the application framework layer. Figure 5 ,The application layer can include system applications and third-party applications.

[0096] Exemplary system applications include: a camera application, a calendar application, a gallery application, and a settings application. In some embodiments, users can download third-party applications from the electronic device's application store based on their needs and preferences. Exemplary third-party applications include: navigation applications, music applications, video applications, e-book applications, and game applications.

[0097] The application framework layer provides application program interface API and programming framework for the application layer. The application framework layer can include some predefined functions. Figure 5 The application framework layer can include: battery management service (BMS), power management service (PMS), alarm management service (AMS), task scheduling service (JSS), scene recognition module, resource management module, and task scheduling engine.

[0098] The battery management service is responsible for detecting and managing the batteries in electronic devices. It provides a set of APIs that allow other modules (such as the task scheduling engine) to obtain battery-related information. Battery-related information may include: battery charge, voltage, current, etc.

[0099] The power management service is responsible for managing the power supply in electronic devices. Exemplarily, the power management service is used to handle events such as user activities (such as clicking the screen, pressing the power button, etc.), power changes, user settings (such as setting power saving mode and flight mode in the settings), plugging and unplugging chargers (wireless charging, wired charging), etc. When these events occur, the power management service will update various states to ensure that the system's power management policy is correctly executed. For example, manage the switching and brightness of the display to save power. Control the wake-up and sleep states of the CPU to optimize system performance and battery life. Respond to the user's power management settings, such as power saving mode and flight mode. In this way, the power management service can store the on and off status of the electronic device.

[0100] In some embodiments, the power management service may provide a set of APIs to allow other modules (such as a task scheduling engine) to obtain the screen on / off status of the electronic device.

[0101] The alarm management service is responsible for managing tasks that are executed at specific times. In some embodiments, the task executed at a specific time can be a screen-off task. For example, a user can set the electronic device to execute an upload task or a download task at midnight. In some embodiments, a screen-off task executed at a specific time can be considered a screen-off task.

[0102] In some embodiments, the screen-off task executed at a specific time may be referred to as an alarm task. In some embodiments, the alarm task may be referred to as a first task.

[0103] In some embodiments, the first task may be called a timed task. In some embodiments, the first task may be a first task that runs within a preset time period.

[0104] In some embodiments, the alarm management module may provide a set of APIs to allow other modules (e.g., a task scheduling engine) to obtain information related to the first task within a period of time. The information related to the first task may include: the task name of the first task, the identity document (ID) of the first task, and the triggering condition of the first task.

[0105] The task scheduling service is responsible for managing tasks in the electronic device, which may include screen-on tasks and screen-off tasks. A screen-on task is a task that is configured to be executed when the electronic device is in the screen-on state, and a screen-off task is a task that is configured to be executed when the electronic device is in the screen-off state. In some embodiments, the task scheduling service may be pre-configured with a screen-on task and / or a screen-off task.

[0106] In some embodiments, the screen-off task configured in the task scheduling service may be referred to as a second task.

[0107] In some embodiments, the task scheduling service may provide a set of APIs to allow other modules (such as the task scheduling engine) to obtain relevant information about the second task. The relevant information about the second task may include: the task name of the second task, the ID of the second task, the triggering condition of the second task, etc.

[0108] Here is an explanation of the triggering conditions of a task: The triggering conditions of a task refer to the conditions that an electronic device must meet to execute the task. In some embodiments, the triggering conditions of a task may include, for example, whether the task is connected to the Internet, whether it is executed in collaboration with other devices, whether it is executed at a specific time, etc.

[0109] The resource management module is responsible for managing processor resources and memory resources in the electronic device. Exemplary processors include, but are not limited to, a CPU, a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a video codec, a digital signal processor (DSP), a baseband processor, a display processing unit (DPU), and / or a neural-network processing unit (NPU).

[0110] The following embodiments use CPU resources as an example. In some embodiments, the resource management module can provide a set of APIs that allow other modules (such as the task scheduling engine) to obtain information about the resources of the electronic device. The resource-related information may include: CPU resources. CPU resources may include: total CPU resources, used CPU resources, and available CPU resources.

[0111] In some embodiments, the task scheduling engine can determine the CPU load based on the used CPU resources and the total CPU resources, or based on the available CPU resources and the total CPU resources. For example, when the used CPU resources exceed a certain percentage, the CPU load can be said to be high, or when the available CPU resources are less than a certain percentage, the CPU load can also be said to be high.

[0112] The scene recognition module is used to identify the scene category of the foreground task. The scene category of the foreground task can be, for example, e-books, news information, videos, shopping, games, and cameras.

[0113] In some embodiments, the scene recognition module may provide a set of APIs to allow other modules (such as the task scheduling engine) to obtain the scene category of the foreground task.

[0114] In some embodiments, different scene categories occupy different CPU resources and have different CPU loads. For example, when the scene category of the foreground task is, for example, e-books, news information, videos, and shopping, the electronic device can determine the scene category as a low-load scene category. When the scene category of the foreground task is, for example, games and cameras, the electronic device can determine the scene category as a high-load scene category. In some embodiments, the low-load scene category can be referred to as a low-load scene, and the high-load scene category can be referred to as a high-load scene.

[0115] In an embodiment of the present application, the task scheduling engine may determine whether the scenario category is a high-load scenario or a low-load scenario based on the scenario category of the foreground task.

[0116] The task scheduling engine is used to obtain the screen on / off status of the electronic device from the power management service, obtain relevant information of the first task from the alarm management service, obtain relevant information of the second task from the task scheduling service, obtain relevant information of resources from the resource management module, and obtain the scene category of the foreground task from the scene recognition module.

[0117] In addition, after obtaining the above information (such as the screen on / off status of the electronic device, relevant information of the first task, relevant information of the second task, relevant information of resources, and the scene category of the foreground task), the task scheduling engine can transfer the screen-off task to the screen-on execution according to the above information.

[0118] The kernel layer is the layer between hardware and software. The kernel layer is used to drive the hardware to make it work. The kernel layer at least includes display driver, camera driver, audio driver, sensor driver, motor driver, etc., which are not limited in this embodiment of the application. Figure 5 ,The kernel layer can include: real-time clock driver, sensor driver, etc.

[0119] A real-time clock (RTC) driver can provide accurate time for electronic devices. Even if the electronic device loses power, the battery in the electronic device can still power the RTC, allowing the RTC to continue running. In some embodiments, the hardware of the electronic device may include an RTC chip. The RTC can read the time from the RTC chip, set the time, and interrupt the time.

[0120] In some embodiments, the RTC can be used as a timer, for example, the RTC can set a timer.

[0121] Sensor drivers can read data from sensors and convert the read data into a format that can be processed by electronic devices. These data can be analog signals or digital signals.

[0122] In some embodiments, the hardware of the electronic device may include sensors, such as temperature sensors. In some embodiments, a first temperature sensor may be provided on the housing of the electronic device. The first temperature sensor is configured to detect the temperature of the housing of the electronic device. In some embodiments, a second temperature sensor may also be provided on the CPU of the electronic device. The second temperature sensor is configured to detect the temperature of the CPU. In some embodiments, a third temperature sensor may be provided on the battery of the electronic device. The third temperature sensor is configured to detect the temperature of the battery.

[0123] In some embodiments, the temperature of the electronic device housing may be simply referred to as the housing temperature.

[0124] In an embodiment of the present application, the task scheduling engine is further configured to obtain the temperature of the electronic device from a sensor driver. The temperature of the electronic device may be, for example, the case temperature, the CPU temperature, or the battery temperature. The task scheduling engine may combine the above information with the temperature of the electronic device to transfer the screen-off task to be executed when the electronic device is in the screen-on state.

[0125] Among them, the functions of the battery management service, power management service, alarm management service, task scheduling service, scene recognition module, resource management module, and task scheduling engine can be specifically described in the following embodiments.

[0126] Figure 6A This is a structural block diagram of another electronic device provided in an embodiment of the present application. Figure 6A In some embodiments, the task scheduling engine may include: a task running information acquisition module, a system status acquisition module, and a scheduling running task module.

[0127] The task running information acquisition module is used to obtain the relevant information of the first task from the alarm management service and the relevant information of the second task from the task scheduling service. For example, the task running information acquisition module obtains the relevant information of the first task and the relevant information of the second task, which can be referred to Figure 6B Step 1 in , where step 1 is represented by number 1.

[0128] In some embodiments, the task execution information acquisition module may acquire information related to the first task within a preset time at the current moment. In some embodiments, the first task within the preset time at the current moment may be referred to as the first task within a batch window. For example, if the current moment is T1 and the preset time is 10 minutes, the task execution information acquisition module may acquire information related to the first task within 10 minutes starting from T1.

[0129] In some embodiments, the task execution information acquisition module may also acquire information about the process in which each task resides. The process information may include: the proportion of CPU resources occupied by each process. In some embodiments, the proportion of CPU resources occupied by each process may be referred to as the load of each process.

[0130] The system status acquisition module can obtain the screen status of the electronic device from the power management service, the scene category of the foreground task from the scene recognition module, and the temperature of the electronic device from the sensor driver. For example, the system status acquisition module obtains the screen status, the scene category of the foreground task, and the temperature of the electronic device, which can be referred to Figure 6B Step 2 in , where step 2 is represented by number 2.

[0131] The scheduling and running task module can transfer the first task and / or the second task within the preset time at the current moment to be executed when the screen is on, based on the screen on / off status of the electronic device from the system status acquisition module, the scene category of the foreground task, and the temperature of the electronic device.

[0132] In some embodiments, reference Figure 6B The scheduling and running task module may include a running time selection unit, a task selection unit, and a task running unit.

[0133] The runtime selection unit is used to determine whether the electronic device is suitable for executing the first task and / or the second task within the preset time at the current moment based on the scene category of the foreground task and the temperature of the electronic device when the electronic device is in the bright screen state.

[0134] The task selection unit is configured to select a target task from a first task and / or a second task within a preset time at a current moment. Exemplarily, the task selection unit is configured to select the first task within a preset time at the current moment that meets the trigger condition, and / or the second task that meets the trigger condition, as the target task.

[0135] The task running unit is used to run the target task and control the load when the target task is running.

[0136] Among them, the steps for scheduling the execution of the task module can be referred to Figure 6B Step 3 in , wherein step 3 is represented by the number 3.

[0137] The following describes the method for processing the screen-off task provided by the embodiment of the present application in conjunction with specific embodiments. The following embodiments can be combined with each other, and the same or similar conceptual processes may not be repeated in some embodiments.

[0138] The following combination Figure 5 、 Figure 6A and Figure 6B The structure of the electronic device shown introduces the method for processing the screen off task provided in an embodiment of the present application. Figure 7 This is a flowchart of a method for processing a screen-off task provided in an embodiment of the present application. Figure 7 The method for processing the screen-off task provided in the embodiment of the present application may include:

[0139] S701: When the electronic device is in the screen-on state, the task execution information acquisition module detects whether there are candidate tasks to be executed from the alarm management service and the task scheduling service. If so, execute S702; if not, return to execute S701.

[0140] In some embodiments, when the electronic device switches from screen off to screen on, the task running information acquisition module can execute S701, or, while the electronic device is in the process of screen on, the task running information acquisition module can execute S701. The embodiments of the present application do not limit this.

[0141] The candidate tasks to be executed may include: a first task within a preset time at the current moment, and / or a second task. For example, the first task within the preset time at the current moment may include: a scheduled upload task, a scheduled download task, etc. The second task may include: an upload task, a download task, an AI computing task, etc.

[0142] In some embodiments, the first task may not include an alarm task.

[0143] In some embodiments, the task execution information acquisition module may call an API provided by the alarm management service to detect whether there is a first task within a preset time at the current moment. The first task within the preset time at the current moment may be user-defined. For example, the first task within the preset time at the current moment may be a scheduled system update or a scheduled image upload to the cloud.

[0144] In some embodiments, the task execution information acquisition module may call a provided API interface to detect whether a second task is pre-configured in the task scheduling service. When the second task is pre-configured in the task scheduling service, the task execution information acquisition module may acquire relevant information of the second task.

[0145] In some embodiments, the second task executed by the electronic device when the screen is on does not include a heartbeat task. Specifically, when the second task only includes a heartbeat task, the task execution information acquisition module determines that the second task is not executed when the screen is on. Specifically, when the second task includes a screen-off task in addition to the heartbeat task, the task execution information acquisition module determines that there is a second task to be executed, and the second task to be executed is the screen-off task in addition to the heartbeat task.

[0146] When the first task within the preset time at the current time is configured in the alarm management service, and / or, the second task other than the heartbeat task is configured in the task scheduling service, the task running information obtaining module can determine that the candidate task to be executed is configured. The candidate task to be executed can include the first task, and / or the second task other than the heartbeat task. When the first task within the preset time at the current time is not configured in the alarm management service, and the second task is not configured in the task scheduling service, and only the heartbeat task is configured in the task scheduling service, the task running information obtaining module can determine that the candidate task to be executed is not configured.

[0147] In some embodiments, in the case that the task running information obtaining module determines that the candidate task to be executed is not configured, the execution of the steps in the following embodiments can be stopped.

[0148] In some embodiments, there can be other first tasks over time, and because the second task can be updated with system updates, in the case that the task running information obtaining module determines that the candidate task to be executed is not configured, the task running information obtaining module can return to execute S701 to detect the candidate task to be executed in time.

[0149] S702, the system state acquisition module acquires state data of the electronic device.

[0150] In some embodiments, the state data of the electronic device can include the screen on / off state of the electronic device, the scene category of the foreground task, and the temperature of the electronic device. The method for the system state acquisition module to acquire the state data of the electronic device can refer to the description in the above Figure 6A .

[0151] In some embodiments, when the task running information obtaining module detects the candidate task to be executed, the task running information obtaining module can send a first instruction to the system state acquisition module. The first instruction is used to instruct the system state acquisition module to acquire the state data of the electronic device. Correspondingly, in response to the first instruction, the system state acquisition module can acquire the state data of the electronic device.

[0152] In some embodiments, the system state acquisition module can acquire the state data of the electronic device in real time.

[0153] In some embodiments, in order to reduce the power consumption of the electronic device, the system status acquisition module may collect the status data of the electronic device when the status data changes. For example, in response to the electronic device switching from a bright screen to an off screen, or in response to the electronic device switching from an off screen to a bright screen, the system status acquisition module may collect the on / off screen status of the electronic device. For example, in response to the scene category switching of the foreground task of the electronic device, the system status acquisition module may collect the scene category of the foreground task. Exemplarily, when the scene category of the foreground task switches from an e-book to a video, the system status acquisition module may collect the scene category of the foreground task as a video. For example, the electronic device may periodically collect the temperature of the electronic device.

[0154] S703: The scheduling and running task module detects whether the status data of the electronic device meets the first condition. If so, execute S704; if not, return to execute S702.

[0155] The first condition is a condition for triggering the electronic device to execute the candidate task when the screen is on. For example, when the status data of the electronic device meets the first condition, the scheduling and running task module can execute the candidate task; when the status data of the electronic device does not meet the first condition, the scheduling and running task module does not execute the candidate task.

[0156] In some embodiments, the status data of the electronic device meeting the first condition can also be regarded as the electronic device meeting the first condition.

[0157] In some embodiments, the first electronic device satisfies the first condition including: the scenario category of the foreground task and the temperature of the first electronic device satisfying the first condition. Exemplarily, the first condition may include: the electronic device is under low load and the temperature of the electronic device is not high. The following describes the scenarios of the electronic device being under low load and the electronic device being under high temperature:

[0158] In some embodiments, the scheduling and running task module can determine whether the electronic device is underloaded based on CPU resources. When the proportion of used CPU resources is less than the first proportion, or the proportion of available CPU resources is greater than the second proportion, the scheduling and running task module can determine that the electronic device is underloaded.

[0159] In some embodiments, the scheduling and running task module can determine whether the electronic device is low-loaded based on the scene category of the foreground task. In some embodiments, the mapping relationship between the scene category of the foreground task and the load can be pre-configured in the electronic device. For example, when the scene category of the foreground task is e-books, news information, videos, and shopping, the scene category of the foreground task can be a low-load scene, and the electronic device is low-loaded. When the scene category of the foreground task is games, cameras, etc., the scene category of the foreground task can be a high-load scene, and the electronic device is high-loaded. In this way, in this example, the scheduling and running task module can determine whether the electronic device is low-loaded based on the scene category of the foreground task and the mapping relationship between the scene category of the foreground task and the load.

[0160] The electronic device is not at a high temperature, which means that the temperature of the electronic device is less than or equal to a temperature threshold. The temperature threshold is predefined, and for example, the temperature threshold may be 36°C.

[0161] Among them, when the scheduling and operation task module determines that the status data of the electronic device meets the first condition, that is, the electronic device is under low load and the electronic device is not at a high temperature, the scheduling and operation task module can continue to execute the steps in the following embodiment. When the scheduling and operation task module determines that the status data of the electronic device does not meet the first condition, that is, the electronic device is under high load or the electronic device is at a high temperature, it can return to execution S702 so that the candidate task is executed in a timely manner when the status data of the electronic device meets the first condition.

[0162] In some embodiments, the execution timing selection unit in the scheduling execution task module may execute S703 .

[0163] S704: The scheduling and running task module determines a first target task from the candidate tasks.

[0164] The first target task is the task to be executed.

[0165] In some embodiments, the first target task may include: a first task within a preset time at the current moment that meets the trigger condition among the candidate tasks, and / or a second task that meets the trigger condition. Exemplarily, taking the second task as an example, the trigger condition of the second task is: the need to be connected to the Internet. When the electronic device is connected to the Internet, the scheduling and running task module can determine that the second task is the first target task. Exemplarily, taking the second task as an example, the trigger condition of the second task is: the task is performed collaboratively through a watch. When the electronic device is connected to the watch, the scheduling and running task module can determine that the second task is the first target task.

[0166] In some embodiments, the task selection unit in the scheduling and running task module may execute S704 .

[0167] S705: Schedule the task execution module to execute the first target task.

[0168] In some embodiments, after the task scheduling module determines the first target task among the candidate tasks, it may directly execute the first target task.

[0169] In some embodiments, S705 may be replaced by S705A: the scheduling and running task module determines the second target task from the first target task according to the available CPU resources, and runs the second target task. Figure 7 S705A is not shown.

[0170] Running the first target task requires sufficient CPU resources to support it. In an embodiment of the present application, the scheduling and running task module selects all or part of the tasks in the first target task to run based on the available CPU resources. In some embodiments, when the available CPU resources are sufficient to support the running of the first target task, the second target task is equal to the first target task. Among them, when the available CPU resources are insufficient to support the running of the first target task, the scheduling and running task module can determine the second target task in the first target task based on the priority of the first target task. The second target task is at least one target task with a high priority in the first target task, and the available CPU resources are sufficient to support the running of the second target task.

[0171] In some embodiments, the priority of the first task is higher than the priority of the second task. When the available CPU resources are insufficient to support the execution of the first target task, the scheduling and running task module determines the first task as the second target task. The scheduling and running task module can also determine other second target tasks in the second task based on the available CPU resources after the first task occupies the CPU resources.

[0172] In some embodiments, the task execution unit in the scheduling and execution task module may execute S705 or S705A.

[0173] In an embodiment of the present application, when the electronic device is in the screen-on state, the scheduling and running task module can determine whether the screen-off task can be transferred to the screen-on state for execution based on the status data of the electronic device. If it is determined that the screen-off task should be transferred to the screen-on state for execution, the scheduling and running task module can select a specific target task to run. This can minimize the impact of the screen-off task on the foreground task, reduce the power consumption of the electronic device when the screen is off, and increase the battery life of the electronic device.

[0174] When the electronic device is in the bright screen state, because the scheduling and running task module is executing the target task (such as the first target task or the second target task), the scheduling and running task module will also execute the foreground task, and the foreground task and the target task will occupy CPU resources. To ensure the smooth execution of the foreground task, in some embodiments, the scheduling and running task module can intermittently run the target task to reduce the load on the electronic device and ensure the smooth execution of the foreground task.

[0175] In this embodiment, after S705 or S705A, refer to Figure 8 , and may also include:

[0176] S706: The scheduling and running task module detects whether the target task is high-load. If so, execute S707.

[0177] The target task is the first target task or the second target task.

[0178] In some embodiments, the target task is high-loaded when: the CPU resources occupied by the scheduling and running task module when running the target task exceed a preset ratio. The scheduling and running task module can detect whether the target task is high-loaded based on the ratio of CPU resources occupied by the target task. The ratio of CPU resources occupied by the target task refers to the ratio of the CPU resources occupied by the target task to the total CPU resources.

[0179] In some embodiments, the system status acquisition module may determine the CPU resources and total CPU resources occupied by the target task, and determine whether the target task is under high load.

[0180] S707, the scheduling operation task module intermittently runs the target task and controls the load of the target task.

[0181] Intermittently running a target task means running the target task for part of a period of time and pausing the target task for the rest of the period. The purpose of intermittently running a target task is to reduce the CPU load generated by the target task. In some embodiments, the CPU load generated by the target task can be referred to as the target task's load.

[0182] It should be understood that the period of time here may refer to the time required to complete the target task.

[0183] In some embodiments, an algorithm for intermittently running the target task can be preset in the scheduling and running task module, and the scheduling and running task module can intermittently run the target task according to the algorithm. For example, the target task is running in process A, and the scheduling and running task module can calculate the running time and sleep time of process A based on the current load of process A and the target load. In some embodiments, the target load of the target task can be preset in the scheduling and running task module, and the target load refers to the expected load when running the target task. This process is not described in detail in the embodiments of the present application, and reference can be made to the description of determining the running time and sleep time of process A in the prior art.

[0184] In some embodiments, the running time and sleeping time of process A can be referred to as the original free scheduling time, referring to Figure 9 , R is the running time of process A, and S is the sleeping time of process A.

[0185] After determining the running time of process A, the scheduling task module can divide the running time of process A into several time slots (TIME_SLOTs), and allocate running time and sleep time for each time slot. For example, the scheduling task module can use system processing energy awareness rescheduling (SPEAR) technology to allocate running time and sleep time for each time slot.

[0186] In some embodiments, the scheduling operation task module can calculate the running time and sleeping time in each time period according to the target load. Figure 9 The scheduling task module can divide the running time of process A into four time periods. In each time period, tR represents the running time and tS represents the sleeping time. tR and tS together constitute TIME_SLOT. After determining the running time and sleeping time in each time period, the scheduling task module can run the target task during the running time of each time period and suspend the running of the target task during the sleeping time of each time period, thereby achieving the purpose of intermittent running of the target task and reducing the load of the target task.

[0187] In some embodiments, process A may be referred to as a first process.

[0188] In some embodiments, since the time interval for the scheduling and running task module to collect the current load is extremely short, assuming that the scheduling and running task module collects the load of the target task once every original free scheduling running time, when the target task runs within the original free scheduling time, the load of the target task collected by the scheduling and running task module may be load 1. When the target task runs in TIME_SLOT, the running time of the target task is reduced compared to the running time of the original free scheduling time, so the load of the target task is reduced, and at this time the load of the target task is lower than load 1. Therefore, by dividing the original free scheduling time, the load of the target task can be reduced.

[0189] In some embodiments, the scheduling and running task module may adjust the intermittent execution of the target task multiple times so that the load when the scheduling and running task module runs the target task is close to the target load. During the process of the scheduling and running task module adjusting the load of the target task, the load of the target task after the last adjustment may be referred to as the last target load, and the load of the target task after the current adjustment may be referred to as the current target load.

[0190] The following describes the process of the scheduling task module to determine the running time and sleeping time in each TIME_SLOT:

[0191] Step A: The scheduling operation task module can use Formula 1 to determine the current target load based on the target load, the current load, and the previous target load.

[0192]

[0193] Among them, cur_targ_et loa is the current target load, last_target_load is the previous target load, current_load is the current load, target_load is the target load, MIN is the minimum value, and * is the multiplication operation.

[0194] In some embodiments, when the scheduling execution task module is adjusted for the first time, the last target load can be regarded as the current load of the target task.

[0195] Step B: The scheduling operation task module can use Formula 2 to determine the running time in each time period based on each time period TIME_SLOT and the current target load.

[0196] tRunning=TIME_SLOT*cur_target_load Formula 2

[0197] Where tRunning is the running time of each TIME_SLOT.

[0198] Step C: The scheduling task module determines the sleep time in each TIME_SLOT based on each TIME_SLOT and the running time in each TIME_SLOT. The scheduling task module can use Formula 3 to determine the sleep time in each TIME_SLOT:

[0199] tSleeping=TIME_SLOT-tRunning Formula 3

[0200] Among them, tSleeping is the sleep time of each TIME_SLOT.

[0201] It should be understood that each TIME_SLOT consists of a running time and a sleeping time, and the sleeping time is equal to the difference between the TIME_SLOT and the running time in the TIME_SLOT.

[0202] Step D: As shown in Formula 4, the scheduling and running task module can use the current target load as the previous target load and repeat steps A to D until the current target load is less than or equal to the target load. The scheduling and running task module can use the current target load as the load of the target task.

[0203] last_target_load=cur_target_load Formula 4

[0204] When the current target load is less than or equal to the target load, the scheduling task module can use the final determined running time and sleep time in each TIME_SLOT as the final running time and sleep time in each TIME_SLOT

[0205] In an embodiment of the present application, the scheduling and running task module determines whether the target task is high-loaded. If the target task is high-loaded, the scheduling and running task module can intermittently execute the target task and reduce the load of the target task to ensure the smooth execution of the foreground task.

[0206] The above embodiment introduces an example of executing the screen-off task when the electronic device is in the screen-on state. Figure 10 , introduces another method for processing the screen off task provided in an embodiment of the present application. Figure 10 This is a flowchart of another method for processing a screen-off task provided in an embodiment of the present application. Figure 10 The method for processing the screen-off task provided in the embodiment of the present application may include:

[0207] S1001: When the electronic device is in the screen-on state, the task execution information acquisition module detects whether there are candidate tasks to be executed from the alarm management service and the task scheduling service. If so, execute S1002; if not, return to execute S1001.

[0208] S1002: The system status collection module collects status data of the electronic device.

[0209] For S1001-S1002, reference may be made to the description in S701-S702.

[0210] S1003: The scheduling and running task module detects whether the scene category of the foreground task is a low-load scene based on the status data of the electronic device. If so, execute S1004; if not, execute S1011.

[0211] In some embodiments, the scheduling and running task module may determine whether the scenario category of the foreground task is a low-load scenario based on the scenario category of the foreground task, and reference may be made to the description in S703 .

[0212] When the scheduling and running task module determines that the scene category of the foreground task is a low-load scene, the scheduling and running task module can continue the steps in the following embodiment. When the scheduling and running task module determines that the scene category of the foreground task is not a low-load scene, that is, it is in a high-load scene, S1009 can be executed.

[0213] In some embodiments, when the electronic device's screen is on, to avoid affecting the execution of the foreground task, the scheduling and running task module can use a temperature classification method to precisely control the execution of candidate tasks. In other words, at different electronic device temperatures, the scheduling and running task module can use different methods to execute candidate tasks, achieving precise control of the tasks.

[0214] In the embodiment of the present application, the temperature of the electronic device is taken as the shell temperature. For example, the shell temperature can be divided into three levels to achieve accurate control of the execution of the candidate task, and the specific description is referred to in the following embodiment.

[0215] S1004: The scheduling operation task module detects whether the shell temperature is less than or equal to the second temperature threshold. If not, execute S1005; if so, execute S1006.

[0216] Exemplarily, the second temperature threshold may be 38°C.

[0217] In some embodiments, the scheduling operation task module can compare the shell temperature with a second temperature threshold. When the scheduling operation task module detects that the shell temperature is greater than the second temperature threshold, the scheduling operation task module executes S1005. When the scheduling operation task module detects that the shell temperature is less than or equal to the second temperature threshold, the scheduling operation task module executes S1006.

[0218] In some embodiments, the temperature of an electronic device can reflect the load of the electronic device. For example, taking the shell temperature of the electronic device as an example, when the shell temperature of the electronic device is greater than 38°C, it can indicate that the load of the electronic device is high. At this time, if the candidate task is executed, the load of the electronic device will increase, affecting the operation of the foreground task. Therefore, when the shell temperature is greater than 38°C, the candidate task is stopped from being transferred to the electronic device when the screen is on. In some embodiments, the high load of the electronic device can be understood as the high load of the CPU in the electronic device.

[0219] S1005: The scheduling task execution module stops transferring the candidate tasks to be executed when the screen is on.

[0220] S1006: The scheduling operation task module detects whether the shell temperature is less than or equal to the first temperature threshold. If so, execute S1007. If not, do nothing.

[0221] In some embodiments, the second temperature threshold is greater than the first temperature threshold. For example, the first temperature threshold may be 36° C. In some embodiments, the scheduling operation task module may compare the shell temperature with the first temperature threshold. When the scheduling operation task module detects that the shell temperature is less than or equal to the first temperature threshold, the scheduling operation task module executes S1007.

[0222] In some embodiments, when the temperature of the electronic device is greater than a first temperature threshold, that is, when the shell temperature is greater than 36°C, it indicates that the load of the electronic device is high. At this time, if the scheduling and running task module executes the candidate task, it will cause the load of the electronic device to increase, affecting the operation of the foreground task. Therefore, when the shell temperature is greater than 36°C, the scheduling and running task module may not perform any processing, such as the scheduling and running task module may not execute the candidate task. When the shell temperature is less than or equal to 36°C, the scheduling and running task module may execute S1007.

[0223] S1007: The scheduling and running task module determines a target task from the candidate tasks.

[0224] S1007 may refer to the description in S704. The target task may be the first target task or the second target task.

[0225] S1008: The scheduling operation task module detects whether the shell temperature is less than or equal to a third temperature threshold. If so, execute S1009; if not, execute S1010.

[0226] In some embodiments, the third temperature threshold is lower than the first temperature threshold. For example, the third temperature threshold may be 33°C.

[0227] In some embodiments, the scheduling and operation task module may compare the shell temperature with a third temperature threshold. When the scheduling and operation task module detects that the shell temperature is less than or equal to the third temperature threshold, the scheduling and operation task module executes S1009. When the scheduling and operation task module detects that the shell temperature is greater than the third temperature threshold, the scheduling and operation task module continues to execute S1010.

[0228] S1009: The scheduling task module runs the target task intermittently, and controls the load of the target task to be less than or equal to a first load threshold.

[0229] In some embodiments, the first load threshold can be determined based on available CPU resources. When the available CPU resources are insufficient to support the target task, the scheduling task module can intermittently run the target task to reduce the load of the target task. Exemplarily, the first load threshold can be 30%.

[0230] The process of scheduling the task module to intermittently run the target task and controlling the load of the target task can refer to the description in steps A to D. In this example, the target load of the target task can be 30%.

[0231] S1010 , scheduling the task execution module to intermittently execute the target task, and controlling the load of the target task to be less than or equal to a second load threshold.

[0232] In some embodiments, the second load threshold can be determined according to available CPU resources. When the available CPU resources are insufficient to support the execution of the target task, the scheduling execution task module can intermittently execute the target task to reduce the load of the target task.

[0233] In some embodiments, the second load threshold is less than the first load threshold. For example, the second load threshold can be 15%. The process of scheduling the task module to intermittently run the target task and controlling the load of the target task can refer to the description of steps A to D. In this example, the target load of the target task can be 15%.

[0234] In the embodiment of the present application, the order in which the scheduling task module detects the temperature of the electronic device and detects the scene category of the foreground task is not restricted. Figure 10 An example is shown in FIG.

[0235] In the embodiments of the present application, when the electronic device is in the screen-on state, the scheduling running task module can run the target task intermittently according to the temperature of different electronic devices, so as to accurately control the target task and the load of the target task, and ensure the smooth running of the foreground task.

[0236] In the embodiments of the present application, because the task running information acquisition can repeatedly acquire the to-be-executed task, and the scheduling running task module is also constantly executing the target task, in the case where the scheduling running task module determines that the scene category of the foreground task is not the low-load scene, the scheduling running task module can further perform the following steps in S1003:

[0237] In S1011, the scheduling running task module detects whether there is a third task that has been running. If yes, S1012 is performed, and if no, no processing is performed.

[0238] The third task that has been running can include the first task that has been running, and / or the second task that has been running except the heartbeat task. In some embodiments, the third task that has been running can be referred to as a third task.

[0239] In some embodiments, in the case where the scheduling running task module determines that the scene category of the foreground task is not the low-load scene, the scheduling running task module can detect whether there is a third task that has been running. In the embodiments of the present application, the purpose of the scheduling running task module detecting whether there is a third task that has been running is that, in the case where there is a third task that has been running, the scene category of the foreground task is not the low-load scene, and if the electronic device stops running the third task, the execution of the third task will be interrupted, which affects the proceeding of the third task.

[0240] In some embodiments, in the case where the scene category of the foreground task is the high-load scene and there is a third task, the scheduling running task module can perform S1012 to continue executing the third task.

[0241] In S1012, a timer is started, and the duration of the timer is a preset duration.

[0242] In some embodiments, the scheduling running task module can send a timer request to the RTC. In response to the timer request from the scheduling running task module, the RTC can set a timer, and the duration of the timer is a preset duration.

[0243] In some embodiments, the duration of the timer is greater than or equal to the duration of the third task. The duration of the third task can be understood as the duration required to complete the third task. For example, the third task still needs 6 minutes to be completed, and the RTC can set a timer of 10 minutes to ensure the smooth completion of the third task.

[0244] S1013, the scheduling running task module continues to detect whether the scene category of the foreground task is the first high-load scene. If yes, S1014 is executed, and if no, S1015 is executed.

[0245] The high-load scene can include a first high-load scene, a second high-load scene, and a third high-load scene, etc. The first high-load scene, the second high-load scene, and the third high-load scene respectively represent different levels of high-load scenes, and the tasks corresponding to each different level of high-load scene are different. The CPU load required for executing the task corresponding to the first high-load scene is the largest, the CPU load required for executing the task corresponding to the second high-load scene is the second largest, and the CPU load required for executing the task corresponding to the third high-load scene is the smallest. In the embodiments of the present application, the first high-load scene is taken as an example for description.

[0246] In some embodiments, under each different level of high-load scene, the scheduling running task module can adjust the load of the third task to ensure the smooth running of the foreground task. For example, under the first high-load scene, the scheduling running task module can control the load of the running third task to be less than or equal to load 1, under the second high-load scene, the scheduling running task module can control the load of the running third task to be less than or equal to load 2, and under the third high-load scene, the scheduling running task module can control the load of the running third task to be less than or equal to load 3. The load 1 is less than the load 2, and the load 2 is less than the load 3.

[0247] S1014, the scheduling running task module intermittently executes the third task, and controls the load of the running third task to be less than or equal to a third load threshold.

[0248] In some embodiments, the third load threshold can be determined according to the available CPU resources. In the case where the available CPU resources are insufficient to support the continuous running of the third task, the scheduling running task module can intermittently run the third task to reduce the load of running the third task.

[0249] It should be understood that, in the case where the scene category of the foreground task is a high-load scene, the load of the third task needs to be lower than the load of the target task in the case where the scene category of the foreground task is a low-load scene. Therefore, in some embodiments, the third load threshold is less than the second load threshold. For example, the third load threshold can be 3%.

[0250] S1015, the scheduling running task module intermittently executes the third task, and controls the load of the running third task to be less than or equal to a fourth load threshold.

[0251] In some embodiments, the fourth load threshold can be determined based on available CPU resources. If the available CPU resources are insufficient to support continued execution of the third task, the scheduling task module can intermittently execute the third task to reduce the load of executing the third task. In some embodiments, the fourth load threshold is greater than the third load threshold. Exemplarily, the fourth load threshold is 8%.

[0252] In an embodiment of the present application, when the scenario category of the foreground task is a high-load scenario and there is a third task already running, the scheduling and running task module can ensure the completion of the third task without affecting the foreground task by setting a timer and controlling the load of the target task.

[0253] After S1014 and S1015, the following steps may be performed:

[0254] S1016: The scheduling and running task module detects whether the electronic device meets the second condition. If so, the execution of the third task is stopped; if not, the process returns to S1013.

[0255] The second condition is a condition for triggering the electronic device to continue to execute the third task when the screen is on. Exemplarily, when the second condition is met, the scheduling and running task module can continue to execute the third task, and when the third condition is not met, the scheduling and running task module no longer executes the third task.

[0256] In some embodiments, the second condition may include: a timer reaches a preset duration, or the temperature of the electronic device is greater than a second temperature threshold. Exemplarily, when the timer reaches the preset duration, or the temperature of the electronic device is greater than the second temperature threshold, the scheduling and operation task module may stop executing the third task. When the timer does not reach the preset duration, or the temperature of the electronic device is less than or equal to the second temperature threshold, the scheduling and operation task module may return to executing S1013.

[0257] The second temperature threshold may refer to the description in S1004. For example, taking the temperature of the electronic device as the case temperature, the second temperature threshold is 38°C.

[0258] In an embodiment of the present application, when the electronic device is in the bright screen state and the foreground task of the electronic device is in a low-load scenario, the scheduling and running task module can select the target task that meets the trigger condition according to the different temperatures of different electronic devices, and run the target task intermittently to control the load of the target task, thereby ensuring the smooth operation of the foreground task. In addition, when the scenario category of the foreground task is a high-load scenario and there is a third task that has been run, the scheduling and running task module can ensure the completion of the third task by setting a timer and controlling the load of the target task. In addition, the embodiment of the present application also has Figure 7 The technical effects of the embodiments shown can be referred to the related description in Figure 7 .

[0259] The above embodiments take the internal module in the electronic device as the execution subject, and describe the processing method of the screen-out task provided by the embodiments of the present application from the perspective of the module. Next, taking the electronic device as an example, the processing method of the screen-out task provided by the embodiments of the present application is described. Figure 11

[0260] Figure 11 The flowchart of another processing method of the screen-out task provided by the embodiments of the present application is shown. Referring to Figure 11 , the processing method of the screen-out task provided by the embodiments of the present application can include:

[0261] S1101, obtaining a target task when the electronic device is in a bright screen.

[0262] The target task can be a first target task or a second target task, which can be referred to the description in the above embodiments.

[0263] S1102, obtaining the screen-on / off state of the electronic device, the scene category of the foreground task of the electronic device, and the temperature of the electronic device.

[0264] S1102 can be referred to the description in S1002.

[0265] S1103, the electronic device detects whether the scene category of the foreground task and the temperature of the electronic device satisfy a first condition. If yes, S1104 is executed.

[0266] S1103 can be referred to the description in S703. The first condition can include that the scene category of the foreground scene is a low-load scene, and the temperature of the first electronic device is less than or equal to a first temperature threshold.

[0267] S1104, the electronic device executes the target task.

[0268] In the embodiments of the present application, when the electronic device is in a bright screen, the electronic device can execute the target task according to the scene category of the foreground scene and the temperature of the electronic device, which saves the base current generated by running the target task when the electronic device is in a screen-out, and increases the endurance time of the electronic device.

[0269] In this embodiment, in order to control the execution of the target task in stages, the electronic device can divide the temperature of the electronic device into three levels to realize accurate control of the execution of the candidate task, which can be referred to the description in S1004-S1010 in the above embodiments.

[0270] In the embodiments of the present application, Figure 7 ,​ Figure 8 、 Figure 10 as well as Figure 11 The electronic device in the example can be regarded as the first electronic device. When the screen of the first electronic device is on and the first electronic device meets the first condition, the first electronic device can run the target task. In some embodiments, the target task can be configured to run when the screen of the first electronic device is off.

[0271] Exemplarily, the target task may be the first target task or the second target task, wherein the target task may include the first task and / or the second task in the above embodiment.

[0272] In this embodiment, when the scenario category of the foreground task is not a low-load scenario (i.e., a high-load scenario), if there is a third task already running, in order to ensure the smooth running of the third task, the electronic device can set a timer and control the load of the target task to ensure the completion of the third task without affecting the foreground task. Please refer to the description in S1011-S1016 in the above embodiment.

[0273] In the prior art, when the screen of the second electronic device is off, the second electronic device can run the target task, which will cause the base current of the DDR and CPU in the electronic device to increase and last for a long time, thereby reducing the battery life of the electronic device.

[0274] It should be noted that the information and data involved in this application (including but not limited to data used for analysis, stored data, displayed data, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0275] The method for processing the screen-off task in the embodiment of the present application has been described above. The device for executing the method for processing the screen-off task provided in the embodiment of the present application is described below. Those skilled in the art will understand that the method and the device can be combined and referenced with each other, and the relevant device provided in the embodiment of the present application can execute the steps in the method for processing the screen-off task.

[0276] The method for processing the screen-off task provided in the embodiment of the present application can be applied to electronic devices with communication functions. The electronic devices include terminal devices. The specific device form of the terminal device can refer to the above-mentioned relevant descriptions and will not be repeated here.

[0277] The embodiment of the present application provides a terminal device, which comprises a processor and a memory; the memory stores computer-executed instructions; and the processor executes the computer-executed instructions stored in the memory, so that the terminal device executes the method.

[0278] The embodiment of the present application provides a chip. The chip comprises a processor configured to invoke a computer program in a memory to execute the technical solutions in the above-described embodiments. The implementation principle and technical effects are similar to those of the above-described related embodiments, which will not be described herein again.

[0279] The embodiment of the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. The computer program is executed by a processor to implement the above-described method. The method described in the above-described embodiments can be implemented by software, hardware, firmware or any combination thereof in whole or in part. If implemented in software, the functions can be stored in or transmitted as one or more instructions or codes on a computer-readable medium. The computer-readable medium can include a computer storage medium and a communication medium, and can further include any medium that can carry computer programs from one place to another. The storage medium can be any target medium that can be accessed by a computer.

[0280] In a possible implementation, the computer-readable medium can include a RAM, a ROM, a compact disc read-only memory (CD-ROM) or other optical disk storage, a magnetic disk storage or other magnetic storage device, or any other medium that is targeted to carry or store desired program codes in the form of instructions or data structures and can be accessed by a computer. Moreover, any connection is appropriately referred to as a computer-readable medium. For example, if software is transmitted from a website, a server or other remote source using a coaxial cable, an optical fiber cable, a twisted pair, a digital subscriber line (DSL) or wireless technology (such as infrared, radio and microwave), the coaxial cable, the optical fiber cable, the twisted pair, the DSL or the wireless technology (such as infrared, radio and microwave) is included in the definition of the medium. As used herein, a disk and a disc include a compact disc, a laser disc, an optical disc, a digital versatile disc (DVD), a floppy disk and a Blu-ray disc, wherein the disk usually magnetically reproduces data, and the disc optically reproduces data with a laser. The above combinations should also be included in the scope of the computer-readable medium.

[0281] The embodiment of the present application provides a computer program product, which comprises a computer program. When the computer program is executed, the computer program causes a computer to execute the above-described method.

[0282] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to produce a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0283] The above specific implementation methods further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for processing a screen-off task, characterized in that: Applied to a first electronic device, the method includes: When the screen of the first electronic device is on and the first electronic device meets a first condition, executing a target task, wherein the target task is configured to be executed when the screen of the first electronic device is off; The target task is executed by the second electronic device when the screen of the second electronic device is off, and the target task is configured to be executed when the screen of the second electronic device is off.

2. The method according to claim 1, characterized in that The method further comprises: When the screen of the first electronic device is on, obtaining a scene category of a foreground task of the first electronic device and a temperature of the first electronic device, where the temperature of the first electronic device may be any one of the following: a temperature of a housing of the first electronic device, a temperature of a central processing unit (CPU) of the first electronic device, or a temperature of a battery of the first electronic device; The first electronic device meeting the first condition includes: the scene category of the foreground task and the temperature of the first electronic device meeting the first condition.

3. The method according to claim 2, characterized in that The first condition is that the scenario category of the foreground task is a low-load scenario, and the temperature of the first electronic device is less than or equal to a first temperature threshold.

4. The method according to claim 3, characterized in that After the target task is executed, the following steps are further included: Obtaining the load occupied by the target task; When the load is greater than or equal to a load threshold, the target task is executed intermittently.

5. The method according to claim 3, characterized in that The method further comprises: When the scenario category of the foreground task is a low-load scenario, determining whether the temperature of the first electronic device is less than or equal to a second temperature threshold, and the second temperature threshold is greater than the first temperature threshold; If so, it is determined whether the temperature of the first electronic device is less than or equal to the first temperature threshold.

6. The method according to claim 5, characterized in that The method further comprises: When the temperature of the first electronic device is less than or equal to the first temperature threshold, acquiring the target task; determining whether the temperature of the first electronic device is less than or equal to a third temperature threshold, the third temperature threshold being less than the first temperature threshold; The running of the target task includes: When the temperature of the first electronic device is less than or equal to the third temperature threshold, intermittently running the target task and controlling the load of the target task to be less than or equal to the first load threshold; When the temperature of the first electronic device is greater than the third temperature threshold, the target task is run intermittently, and the load of the target task is controlled to be less than or equal to a second load threshold, and the second load threshold is less than the first load threshold.

7. The method according to any one of claims 1 to 6, characterized in that After the target task is executed, the following steps are further included: When the scenario category of the foreground task of the first electronic device is a high-load scenario, starting a timer, the duration of the timer being a preset duration; Determining whether the scenario category of the foreground task is still the high-load scenario; If not, discontinuously run the target task, and control the load of the target task to be less than or equal to a third load threshold, wherein the third load threshold is less than the second load threshold; If so, the target task is run intermittently, and the load is controlled to be less than or equal to a fourth load threshold, and the fourth load threshold is less than the third load threshold.

8. The method according to claim 7, characterized in that The method further comprises: When the timer reaches the preset time or the temperature of the first electronic device is greater than a second temperature threshold, the target task is stopped.

9. The method according to claim 6, characterized in that The obtaining of the target task includes: Acquire candidate tasks, where the candidate tasks include: tasks configured to be executed when the screen of the first electronic device is off; The task that meets the trigger condition among the candidate tasks is used as the target task.

10. The method according to claim 9, characterized in that The candidate tasks also include: scheduled tasks that run within a preset time period, the target task includes the scheduled tasks that run within the preset time period, and the trigger condition does not include the time when the scheduled tasks run.

11. The method according to any one of claims 1 to 10, characterized in that The target task does not include a heartbeat task.

12. The method according to claim 6, characterized in that The target task is run in a first process; and the intermittently running the target task and controlling the load of the target task to be less than or equal to a first load threshold includes: determining a running time and a sleeping time of the first process according to a current load of the first process and the first load threshold; Divide the running time of the first process into N time periods, where N is an integer greater than or equal to 1; In each time period, determining the running time and the sleeping time in each time period according to the first load threshold; The target task is run during the running time in each time period, and the running of the target task is suspended during the sleeping time in each time period.

13. An electronic device, characterized in that: The electronic device includes: one or more processors and memory; The memory is coupled to the one or more processors, and is configured to store computer program codes, where the computer program codes include computer instructions. The one or more processors call the computer instructions to enable the electronic device to execute the method according to any one of claims 1 to 12.

14. A chip system, characterized in that: The chip system is applied to an electronic device, and the chip system includes one or more processors, and the one or more processors are used to call computer instructions so that the electronic device executes the method as described in any one of claims 1-12.

15. A computer-readable storage medium, characterized in that The computer-readable storage medium includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device is caused to perform the method according to any one of claims 1 to 12.

16. A computer program product, characterized in that The computer program product comprises a computer program code, and when the computer program code is run on an electronic device, the electronic device is caused to perform the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Download control method and system of mobile terminal

    CN105933957A

  • Resource scheduling method and device

    CN106156115A

  • Application program control method and electronic device

    CN112424725A

  • Resource downloading method, device and equipment and readable storage medium

    CN116684407A