Task processing method and electronic equipment
By dynamically adjusting the power consumption configuration information of electronic devices, the problem of task pause in the wake-up state is solved, enabling continuous task execution and optimizing battery power consumption, thereby improving user experience and battery life.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-03-10
AI Technical Summary
When an electronic device is in a wake-up state, some tasks are paused. Users want these tasks to continue without waiting. In existing technologies, continuing to execute tasks increases battery consumption and reduces battery life.
By dynamically adjusting the power consumption configuration information of electronic devices, the system determines whether to continue or pause task execution based on the option status of the target task and the current device configuration. The first configuration information supports task execution, while the second configuration information reduces power consumption.
It enables continuous execution of tasks in the wake-up state, reducing battery power consumption, extending device battery life, and improving user experience.
Smart Images

Figure CN121645430A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and particularly relates to a task processing method and an electronic device. BACKGROUND
[0002] In some scenarios, a user makes an electronic device set in a standby wake-up state, which causes some tasks in the electronic device to be suspended. However, some tasks in the execution process may not need human intervention, for example, data backup and log cleaning, large file transmission and compression, etc. From the perspective of the user, it is more desirable that the electronic device can continue to perform these tasks in the standby wake-up state, and the user does not need to wait again or the waiting time is shortened when the electronic device is in a wake-up state. SUMMARY
[0003] Therefore, the present disclosure provides a task processing method and an electronic device.
[0004] According to a first aspect of the present disclosure, a task processing method is provided, including: in response to a target operation, if an option about a target task is in an open state, setting power consumption configuration information of an electronic device as first configuration information to continue to execute a current target task, and setting the power consumption configuration information of the electronic device as second configuration information after the target task is executed; if the option about the target task is in a closed state, setting the power consumption configuration information of the electronic device as the second configuration information to suspend the execution of the current target task; wherein the target operation is used to make the electronic device in a standby wake-up state, and power consumption of the electronic device in a case where the electronic device is configured with the first configuration information is greater than power consumption of the electronic device in a case where the electronic device is configured with the second configuration information.
[0005] According to an embodiment of the present disclosure, if the option about the target task is in the open state, setting the power consumption configuration information of the electronic device as the first configuration information to continue to execute the current target task includes: if the electronic device has the second configuration information, changing the second configuration information of the electronic device to the first configuration information to continue to execute the current target task; and if the electronic device has the first configuration information, continuing to execute the current target task.
[0006] According to an embodiment of the present disclosure, if the option about the target task is in the closed state, setting the power consumption configuration information of the electronic device as the second configuration information to suspend the execution of the current target task includes: if the electronic device has the second configuration information, making the electronic device enter the standby wake-up state and suspending the execution of the current target task.
[0007] According to an embodiment of the present disclosure, if the option about the target task is in the closed state, the method further includes: if the electronic device has the first configuration information, continuing to execute the current target task.
[0008] According to an embodiment of the present disclosure, the method further includes: determining the task as the target task if the attribute information of the task satisfies a first condition; and / or determining the task as the target task if a running parameter of the task satisfies a second condition.
[0009] According to an embodiment of the present disclosure, the method further includes: in response to the target operation, generating a selection window for the target task, the selection window containing an option for determining whether to execute the current target task; in response to the selection option being in an open state, determining to continue executing the current target task; and in response to the selection option being in a closed state, determining to suspend executing the current target task.
[0010] According to an embodiment of the present disclosure, if the second configuration information of the electronic device is changed to the first configuration information, the method further includes: in response to the current target task being executed, applying the second configuration information; and if the first configuration information of the electronic device is changed to the second configuration information, the method further includes: in response to the current target task being executed, applying the first configuration information.
[0011] According to an embodiment of the present disclosure, the method further includes: determining a target strategy according to type information of the current target task, to determine whether the current target task is executed; and if the type information is a first type, the first type indicating that the target task executes the task by using a model, the method further includes: in response to receiving a signal from the model that the target task is completed, determining that the current target task is executed.
[0012] According to an embodiment of the present disclosure, when the electronic device has the first configuration information and the current target task is executed, the method further includes: if a first device parameter of the electronic device satisfies a third condition, setting power consumption configuration information of the electronic device as second configuration information, and executing a first strategy corresponding to the first device parameter, the first device parameter indicating that the power of the electronic device is less than a first target threshold; and / or if a second device parameter of the electronic device satisfies a fourth condition, setting the power consumption configuration information of the electronic device as the second configuration information, and executing a second strategy corresponding to the second device parameter, the second device parameter indicating that the temperature of the electronic device is greater than a second target threshold.
[0013] The second aspect of the present disclosure provides a task processing apparatus, comprising: a judging module configured to judge whether an option related to a target task is in an open state in response to a target operation; a first setting module configured to set power consumption configuration information of an electronic device to first configuration information to continue executing a current target task if the option related to the target task is in the open state, and set the power consumption configuration information of the electronic device to second configuration information after the target task is executed; and a second setting module configured to set the power consumption configuration information of the electronic device to the second configuration information to suspend executing the current target task if the option related to the target task is in a close state; wherein the target operation is used to make the electronic device in a standby wake-up state, and power consumption of the electronic device in the case of the first configuration information is greater than power consumption of the electronic device in the case of the second configuration information.
[0014] The third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the task processing method.
[0015] The fourth aspect of the present disclosure further provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the task processing method.
[0016] The fifth aspect of the present disclosure further provides a computer program product comprising a computer program, which, when executed by a processor, implements the task processing method.
[0017] It should be understood that the content described in this section is not intended to identify key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0018] The above and other objects, features and advantages of the present disclosure will become more apparent from the following description when taken in conjunction with the accompanying drawings, in which:
[0019] Figure 1 A schematic diagram of a task processing method in the related art is illustratively shown;
[0020] Figure 2 One of flowcharts of a task processing method according to an embodiment of the present disclosure is illustratively shown;
[0021] Figure 3 A schematic diagram of a task processing method according to an embodiment of the present disclosure is illustratively shown;
[0022] Figure 4Fig. 2 schematically illustrates a flowchart of a task processing method according to an embodiment of the present disclosure;
[0023] Figure 5 Fig. 3 schematically illustrates a structural block diagram of a task processing apparatus according to an embodiment of the present disclosure; and
[0024] Figure 6 Fig. 4 schematically illustrates a block diagram of an electronic device suitable for implementing the task processing method according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It is to be understood, however, the description is merely exemplary and is intended to provide a thorough understanding of the present disclosure. The following detailed description and examples are provided as an exemplary basis for the embodiments of the present disclosure. Accordingly, the description is not intended to limit the present disclosure. In the following detailed description of embodiments of the present disclosure, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure. However, it will be apparent to one skilled in the art that one or more embodiments of the present disclosure can be practiced without these specific details. In other instances, well-known structures and functions have not been described in detail in order to avoid obscuring aspects of the present disclosure.
[0026] The terms used herein are merely used to describe specific embodiments and are not intended to limit the present disclosure. The terms "include", "comprise" and the like used herein indicate the presence of the features, steps, operations and / or components, but do not exclude the presence or addition of one or more other features, steps, operations or components.
[0027] All terms used herein, including technical and scientific terms, have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of the specification, and should not be interpreted in an idealized or overly formal manner.
[0028] In the case of using expressions similar to "at least one of A, B, and C, etc.", it should be generally interpreted as having the meaning of including at least one of the items listed, but not limited to the items listed (e.g., "a system having at least one of A, B, and C" should include a system having A alone, a system having B alone, a system having C alone, a system having A and B together, a system having A and C together, a system having B and C together, and / or a system having A, B, and C together, etc.).
[0029] Embodiments of the present disclosure provide a task processing method and an electronic device. Before introducing the technical solutions provided by the embodiments of the present disclosure, the related technologies involved in the present disclosure are described.
[0030] In certain scenarios, users may put their electronic devices in a "wait-to-wake" state, causing some tasks to pause. However, some of these tasks, such as data backup and log cleanup, and large file transfers and compressions, may not require human intervention. From the user's perspective, it would be preferable for these tasks to continue while the device is in a wait-to-wake state, eliminating the need for further waiting or reducing the waiting time when the device is awake.
[0031] In some cases, when users leave their workstations after work or get off a vehicle while traveling, they typically need to close and put away their laptops, forcing them to pause ongoing tasks. However, some tasks can be performed without human intervention, such as data backup and log cleanup, video transcoding and rendering, program compilation and batch calculations, and large file transfers and compressions. From the user's perspective, it would be preferable for these tasks to continue even after the laptop is closed, so that they don't have to wait the next time they open the lid, or at least have a shorter waiting time.
[0032] To solve the above-mentioned technical problems, in related technologies, refer to Figure 1 To allow certain tasks to continue running on a computer when the lid is closed, you can configure the computer's power and battery management module to prevent the device from entering sleep mode for a specified period and set the option for "no operation when the lid is closed" to prevent the computer from entering sleep mode and thus stopping tasks. However, while this setting allows tasks to continue, it also disables related battery power-saving strategies, increasing battery consumption and reducing battery life. The default settings for these two options are generally as follows:
[0033] Settings > System > Power and Battery > Screen, Sleep and Hibernation Timeout Settings > When using battery > Time to put the device to sleep = 3 minutes.
[0034] Settings > System > Power and Battery > Lid Open, Power Button and Sleep Button Settings > When using battery > Let my PC sleep when the lid is closed.
[0035] Users need to manually set the above options, and if battery life is a factor to consider after completing the task, they need to manually change them back.
[0036] The following will be through Figures 2-4 The task processing method of the present disclosure embodiments will be described in detail.
[0037] Figure 2 One of the flowcharts of a task processing method according to an embodiment of the present disclosure is illustrated schematically.
[0038] like Figure 2As shown, the task processing method of this embodiment includes operations S210 to S230.
[0039] In operation S210, in response to the target operation, it is determined whether the option of the target task is enabled.
[0040] When operating S220, if the option regarding the target task is enabled, the power consumption configuration information of the electronic device is set to the first configuration information to continue executing the current target task.
[0041] In operation S220', if the option regarding the target task is off, the power consumption configuration information of the electronic device is set to the second configuration information to suspend the execution of the current target task.
[0042] In operation S230, after the target task is completed, the power consumption configuration information of the electronic device is set to the second configuration information.
[0043] The target operation is used to put the electronic device into a wake-up state, and the power consumption of the electronic device configured with the first configuration information is greater than the power consumption of the electronic device configured with the second configuration information.
[0044] For example, a target operation can refer to an operation used to put an electronic device into a wake-up state. A wake-up state can refer to a state where the electronic device's display is off, but the device can still respond to specific events (such as incoming calls, message notifications, etc.). For instance, a target operation could be a user pressing the power button to turn off the screen, a user closing the flip phone, the device automatically turning off its screen due to prolonged inactivity, or a user using a gesture (such as double-tapping the screen) to put the device into a wake-up state. For example, in a specific scenario, a user is watching an online video on their phone; when the user presses the power button to turn off the screen, the target operation is triggered.
[0045] The target task can be one or more specific tasks currently being executed by the electronic device. For example, the target task can be a task that requires the electronic device to exceed a certain power consumption threshold to run. The target task can also be a task that requires the electronic device to execute for a duration exceeding a certain time threshold. Target tasks can include, but are not limited to: data backup and log cleanup, video transcoding and rendering, program compilation and batch computing, large file transfer and compression, etc. For example, the target task could be a log cleanup task being performed by the user, or a code testing task running in the background. It should be noted that this disclosure does not specifically limit the type of target task, and the type of target task can be adjusted according to the user's needs.
[0046] The options for a target task refer to user-configurable controls regarding whether the target task should continue execution after the electronic device enters a wake-up state. An "on" option indicates that the user wants the task to continue after the device enters a wake-up state, while a "off" option indicates that the user wants the task to pause after the device enters a wake-up state.
[0047] Target options can be configuration items independent of the system's power and battery. Target options can be configured in the Control Panel, or they can be pop-up windows that appear when a target action is triggered. For example, on a laptop, a user initiates a long video transcoding task in video editing software. When the user closes the laptop lid, a "Allow video transcoding to continue while the lid is closed—On / Off" option pops up on the screen. Clicking "On" enables the target task option, while clicking "Off" disables it.
[0048] Power consumption configuration information refers to configuration data used to control the operating status and performance parameters of various hardware modules in electronic devices. These configurations directly affect the power consumption level of the device. Power consumption configuration information may include, but is not limited to: processor operating frequency, number of processor cores, display brightness, operating status of network modules (such as WiFi, Bluetooth, and mobile data), sensor sampling frequency, and memory operating frequency.
[0049] The first configuration information refers to the power consumption configuration required to support the normal execution of the target task. Under the first configuration information, the electronic device maintains a relatively high performance state to ensure that the target task can be completed smoothly. For example, for a video transcoding task, the first configuration information may include: keeping the WiFi or mobile data network active, the processor running at a medium frequency (e.g., 1.5 GHz), allowing an appropriate number of processor cores to work (e.g., 4 cores), and keeping the memory at a normal operating frequency. For a large file transfer task, the first configuration information may include: keeping the WiFi or mobile data network active, the processor running at a medium frequency (e.g., 1.5 GHz), allowing an appropriate number of processor cores to work (e.g., 4 cores), and keeping the memory at a normal operating frequency.
[0050] It should be noted that the first configuration information can be the minimum performance parameters that the electronic device needs to be configured to perform the target task. When performing a target task, the required first configuration information will be different for different target tasks. Although the first configuration information is different, the power consumption of the corresponding electronic device may be the same or different. When performing multiple target tasks simultaneously, the first configuration information of the electronic device needs to be able to meet the requirements of multiple target tasks being executed at the same time.
[0051] Setting the power consumption configuration information of an electronic device as the primary configuration information can be achieved by sending configuration commands to the hardware driver or system power management module to adjust the operating parameters of each hardware module. For example, the power state of each hardware component can be set by calling the power management API provided by the operating system. This could involve calling the WiFi driver interface to keep the WiFi module active, or calling the processor frequency adjustment interface to set the CPU frequency.
[0052] Continuing the current target task means that after the electronic device enters a wake-up state, the target task will not be paused or terminated, but will continue to run according to the predetermined execution flow. For example, if the target task is to download a 1GB file, when the user presses the power button to turn off the screen, the download process will not stop, and the file will continue to be transferred from the server to local storage until the download is complete.
[0053] The second configuration information can be a more energy-efficient and lower-power configuration compared to the first configuration information. Under the second configuration information, the electronic device reduces performance parameters or shuts down some hardware modules to reduce power consumption. The power consumption of the electronic device with the first configuration information is greater than the power consumption of the electronic device with the second configuration information. For example, the second configuration information may include: turning off WiFi or mobile data networks, reducing the processor operating frequency (e.g., reducing it to a minimum frequency of 0.8GHz), reducing the number of active processor cores (e.g., keeping only 1 core active), reducing memory operating frequency, turning off unnecessary sensors, and allowing the system to enter a deep sleep state, etc.
[0054] Here, the second configuration information can be the default power consumption configuration set by the electronic device system after the computer enters the wake-up state. Alternatively, the second configuration information may not be the default power consumption configuration set by the electronic device system after the computer enters the wake-up state, but rather a power consumption configuration somewhere between the power consumption configuration of the first configuration information and the default power consumption configuration.
[0055] Setting the power consumption configuration information of electronic devices to the second configuration information is similar to setting the first configuration information, but the configuration parameters are different. The system sends instructions to each hardware module to reduce performance or enter a low-power mode. For example, it may call the network driver interface to turn off WiFi and mobile data connections, call the processor frequency adjustment interface to reduce the CPU frequency to the minimum, or release the wake-up lock to allow the system to enter a hibernation state.
[0056] Pausing the execution of a current task halts its execution flow and saves its current state, allowing for resumption from the paused point later. Pausing differs from terminating; terminating loses the task state, while pausing preserves its progress information. For example, if the target task is downloading a file, pausing stops data transmission but records the number of bytes downloaded, allowing the download to resume from the breakpoint when the task resumes.
[0057] The completion of a target task can be defined as the completion of all pre-defined operations, reaching the task's termination conditions. For example, for a file download task, completion means the file has been fully downloaded to local storage and passed integrity verification. When the completion of a target task is detected, even if the target task option is currently enabled, the system will switch the power consumption configuration information from the first configuration information to the second configuration information. This is because the task is complete and no longer requires maintaining a high performance state, allowing the device to enter a low-power mode to save power. For example, after a file download is complete, the system may turn off Wi-Fi or mobile data connections, reduce processor frequency, etc., thereby significantly reducing power consumption.
[0058] In the case of multiple target tasks, the first configuration information is updated in response to the completion of one target task until all target tasks are completed. The power consumption of the updated configuration information decreases as the number of completed target tasks increases. For example, when three target tasks are executed simultaneously, the first configuration information for all three is first configuration information 1. Since the completion times of the different target tasks are different, if the completion time of the first target task > the completion time of the second target task > the completion time of the third target task, then when the first target task is completed, the first configuration information can be changed to first configuration information 2. First configuration information 2 can be a power consumption configuration information that meets the requirements of the second and third target tasks. When the second target task is completed, first configuration information 2 can be changed to first configuration information 3. First configuration information 3 can be a power consumption configuration information that meets the requirements of the third target task. When the third target task is completed, first configuration information 3 can be changed to second configuration information. Therefore, the power consumption of first configuration information 1 > first configuration information 2 > first configuration information 3 > second configuration information.
[0059] Methods for detecting whether a target task has been completed can include: listening for task completion events, periodically checking task status, and receiving completion notifications from the task execution module. For example, a download manager might send a broadcast message indicating task completion after a file download is finished; upon receiving this message, the system determines that the target task has been completed. Alternatively, the system could periodically check the task's execution progress, and determine that the task is complete when the progress reaches 100%.
[0060] Understandably, this method dynamically adjusts power consumption configuration information based on the user's configuration options for the target task and the task's execution status. When the user wants to continue executing the task after the device enters a wake-up state, the device will maintain the necessary power consumption configuration information to ensure the task completes smoothly; when the user no longer needs to continue executing the task or the task has been completed, the device will switch to a low-power configuration to minimize energy consumption. This intelligent power management approach not only meets the user's need for continuous execution of specific tasks but also effectively extends battery life, improves the user experience, and achieves the optimal balance between task execution requirements and power consumption control.
[0061] As described above, in operation S220, if the option regarding the target task is enabled, the power consumption configuration information of the electronic device is set to the first configuration information to continue executing the current target task. In one possible implementation, this operation may further include: if the electronic device has second configuration information, changing the second configuration information of the electronic device to the first configuration information to continue executing the current target task. If the electronic device has the first configuration information, the current target task continues to be executed.
[0062] For example, having second configuration information in an electronic device can mean that, in response to a target operation, the electronic device has already applied the second configuration information, i.e., the device is already in a low-power state or is preparing to enter a low-power state. For instance, when a user closes the lid of a laptop, the system may have already applied the second configuration information according to the user's original power settings (e.g., entering sleep mode after closing the lid), at which point the processor frequency has been reduced to its minimum, the network connection is off, and the display is off. In this case, if the system detects that the option for the target task is enabled, it needs to change the second configuration information to the first configuration information to ensure that the target task can continue to execute.
[0063] Having first configuration information in an electronic device means that, in response to a target operation, the electronic device has already applied the first configuration information, meaning the device is already in a performance state capable of supporting the execution of the target task. For example, when a user closes the lid of a laptop, the device may have already maintained the first configuration information state because other target tasks were already being executed, or because the user hasn't set a policy to put the device to sleep after closing the lid. In this case, the processor is running at a medium frequency, the network connection remains active, and the necessary hardware modules are operational. Since the device's current power consumption configuration already meets the execution requirements of the target task, the system does not need to make configuration adjustments and can directly continue executing the current target task.
[0064] It should be noted that methods for determining whether an electronic device possesses first or second configuration information can include: querying the current power configuration status of the system, detecting the operating parameters of each hardware module, and reading configuration information records maintained by the power management module. For example, the system can determine the configuration status by querying the processor's current operating frequency. If the processor frequency is higher than a preset threshold (e.g., higher than 1.0 GHz), it is determined to possess first configuration information; if the processor frequency is lower than the threshold, it is determined to possess second configuration information. The system can combine the status information of multiple hardware modules for a comprehensive judgment to improve the accuracy of the determination.
[0065] In one example, a user starts a large program compilation task on a laptop, which is expected to take 30 minutes to complete. After starting the compilation task, the user sets the target task option to "on," indicating that they want the compilation task to continue even after closing the laptop lid. Ten minutes into the compilation, the user closes the laptop lid to leave their workstation. At this point, the system detects the target operation (lid closing) and determines that the target task option is "on." The system further checks the current power consumption configuration of the electronic device and finds that the device has applied the second configuration information according to the user's original lid-close sleep policy: the processor frequency has dropped to 0.8GHz, and the network connection is about to be shut down. The system immediately changes the second configuration information to the first configuration information: calling the processor frequency adjustment interface to increase the CPU frequency to 2.0GHz to accelerate compilation, keeping all 8 processor cores active, ensuring that the memory operating frequency remains at a normal level, and keeping disk read / write in high-speed mode. After the configuration change, the compilation task continues to execute and successfully completes 20 minutes after the lid is closed (i.e., 30 minutes after startup). Throughout the process, users do not need to manually adjust the power settings. The system automatically switches from low-power configuration to high-performance configuration, ensuring the continuous execution and timely completion of compilation tasks.
[0066] In another example, a user runs two target tasks simultaneously on a laptop: an ongoing video rendering task and a large database backup task. To support the simultaneous execution of these two tasks, the system has already applied initial configuration information: the processor is running at a high frequency of 2.5GHz, all eight cores are active, WiFi remains active for database backup uploads to the cloud, and memory operates at a high-speed mode. During the execution of both tasks, the user needs to briefly leave and close the laptop lid. At this time, the system detects the target operation and determines that the target task option is enabled. The system further checks the current power configuration of the electronic device and finds that the device already has the initial configuration information, and the performance parameters of each hardware module meet the requirements for the continued execution of the two target tasks. Therefore, the system does not need to make any configuration adjustments and directly continues the current video rendering and database backup tasks. The video rendering process continues to utilize GPU and CPU resources for image processing and encoding, while the database backup process continues to transmit backup data to the cloud server via WiFi. Both tasks maintain normal execution progress. Approximately 40 minutes after closing the lid, the video rendering task completes first, and the system adjusts the initial configuration information to a lower power configuration to support only the database backup task continuing to execute. About 20 minutes later, the database backup task was also completed. At this point, the system switched the power consumption configuration information to the second configuration information, and the device entered a low-power sleep state.
[0067] Understandably, by determining the type of power consumption configuration information currently possessed by the electronic device and adopting different processing strategies based on the determination results, this method can achieve more accurate power consumption management. This differentiated processing approach based on the actual configuration state makes power consumption management more intelligent and efficient, ensuring continuous task execution while minimizing unnecessary power consumption fluctuations and configuration switching frequency, further optimizing user experience and device energy efficiency.
[0068] As described above, in operation S220', if the option regarding the target task is off, the power consumption configuration information of the electronic device is set to the second configuration information to suspend the execution of the current target task. In one possible implementation, this operation may further include the operation: if the electronic device has the second configuration information, the electronic device enters a wake-up state and suspends the execution of the current target task.
[0069] It's important to note that when electronic devices have the second configuration information, directly entering a wake-up state and pausing tasks reduces system configuration adjustment overhead and speeds up the process compared to first switching the configuration from other states to the second configuration information before entering the wake-up state. For example, if the device is already in a low-power configuration, the system doesn't need to go through a cycle of increasing and decreasing the power configuration; instead, it can quickly enter sleep or hibernation mode, shortening response time and reducing additional power consumption during the transition. This optimized approach allows the device to enter a power-saving state more quickly when the user chooses not to continue performing tasks, maximizing battery life.
[0070] In one example, a user starts a log cleanup task on a laptop, which scans and deletes temporary files and expired logs in the system. When the task starts, the user does not enable the target task option, meaning it is disabled, indicating that the user does not want the cleanup task to continue after closing the laptop lid. During task execution, the user closes the laptop lid to take it to a meeting room. At this point, the system detects the target operation (closing the lid) and determines that the target task option is disabled. The system further checks the current power configuration of the electronic device and finds that the device has already applied the second configuration information according to the user's original lid-close sleep policy: the processor frequency has automatically dropped to 0.8GHz, the WiFi connection is off, the display is off, and only one processor core is maintained to sustain basic system operation. Since the device already has the second configuration information, the system does not need to make any additional configuration adjustments and directly puts the electronic device into a wake-up state. The system calls the power management interface to switch the device to sleep mode, the processor enters a deep sleep state, the memory continues to be powered to preserve the system state, and all peripherals stop working. At the same time, the system sends a pause signal to the ongoing log cleanup task. The cleanup task immediately stops scanning and deleting files, saves the status information such as the currently scanned directory paths, the number of deleted files, and the list of files to be processed to the system configuration file, and then the task process is suspended.
[0071] Understandably, when an electronic device already has secondary configuration information and the target task option is off, the system can quickly respond to the user's operation intent without complex configuration adjustments, directly using the existing low-power configuration to put the device into a wake-up state and pause task execution.
[0072] As described above, if the option regarding the target task is off, the task processing method of this embodiment may further include the operation of: if the electronic device has first configuration information, continuing to execute the current target task.
[0073] In one example, a user initiates a large database backup task on an all-in-one desktop PC, backing up data from a local database to a network storage server. After the backup task starts, the system applies initial configuration information to support task execution: the processor runs at a high frequency of 2.5GHz, all eight processor cores are active, the WiFi network maintains a high-speed connection, the memory operates at a normal frequency of 2400MHz, and the hard drive is in high-speed read / write mode. When the backup is approximately 30% complete, the user presses the power button on the all-in-one PC to turn off the screen, needing to briefly leave their workstation. Since the user has not enabled the target task option (i.e., the option is disabled), it indicates that the user does not wish to continue the backup task after the screen is off. At this point, the system detects the target operation (pressing the power button to turn off the screen) and determines that the target task option is disabled. The system further checks the current power consumption configuration of the electronic device and finds that the device currently has the initial configuration information, and all hardware modules are in a high-performance state supporting the backup task execution. Therefore, the system does not require any configuration adjustments and continues executing the current database backup task. After the task is completed, the system changes the initial configuration information to the second configuration information. The system calls the power management interface to adjust hardware configuration: reduce the processor frequency from 2.5GHz to 0.8GHz, reduce the number of active processor cores from 8 to 1, turn off the WiFi network connection, reduce the memory operating frequency to a low-speed mode of 1600MHz, and switch the hard drive to power-saving mode.
[0074] As described above, in some embodiments, the task processing method of this embodiment may further include the operation of: if the attribute information of the task meets the first condition, determining the task as the target task.
[0075] For example, task attribute information can refer to information describing the inherent characteristics or type of the task. This information is usually determined when the task is created or started, and is relatively stable and does not change frequently during task execution. For instance, task attribute information may include task type, the application from which the task originated, and the task creation time.
[0076] The first condition can be a pre-defined standard or rule used to determine whether the task's attribute information meets the requirements of the target task. For example, the first condition may include: the task type belongs to a predefined list of target task types, such as a download task or a backup task; the task source application belongs to a user-specified list of critical applications; and the expected execution time of the task is greater than a preset time, such as an expected execution time of ≥10 minutes. The system can set one or more first conditions. When the task's attribute information meets any one of the first conditions or meets all of the first conditions, the task is determined to be the target task.
[0077] In one example, a user uses a download manager application on their laptop to download multiple large software installation packages, totaling approximately 10GB. When the task starts, the system retrieves its attributes, including: task type "download task," task priority "high," and expected execution time "60 minutes." The system's preset first condition includes a list of target task types, such as "download task," "backup task," and "synchronization task." Since the download task exists in the list, its attributes meet the first condition, making it a target task and displaying a "target task" label. After approximately 15 minutes of downloading, the user needs to take their laptop to a meeting room and closes the laptop lid. At this point, the system detects the target operation (lid closing), queries the target task management list, and finds that the currently executing download task has been identified as the target task. The system further checks the task's option status and finds that the user has enabled the task's option, meaning the user wants the download to continue after the lid is closed. The system sets the electronic device's power consumption configuration to the first configuration, keeping the processor running at 1.5GHz and maintaining a WiFi network connection to ensure the download task can continue. After the task is completed, the system changes the first configuration to the second configuration to put the laptop into a low-power state.
[0078] As described above, in some other embodiments, the task processing method of this embodiment may further include the operation of determining the task as a target task if the running parameters of the task satisfy a second condition.
[0079] For example, task execution parameters can refer to dynamic parameters that describe the current execution status or resource usage of the task, and these parameters change in real time as the task is executed. For instance, task execution parameters may include current CPU utilization, current memory usage, current network bandwidth usage, current disk read / write speed, task execution time, remaining task execution time, task completion percentage, task data transfer volume, and number of task errors.
[0080] The second condition can be a pre-defined standard or rule used to determine whether the task's running parameters meet the requirements of the target task. For example, the second condition may include: CPU utilization exceeding a preset threshold, such as CPU utilization ≥ 50%, and memory usage exceeding a preset threshold, such as memory usage ≥ 4GB. The system can set one or more second conditions, and when the task's running parameters meet any one or all of the second conditions, the task is determined to be the target task.
[0081] In one example, a user starts a scientific computing task on a computer to process numerical simulations of a large dataset. After the task starts, the system periodically collects the task's runtime parameters. Approximately 5 minutes after the task starts, the system collects the following runtime parameters: current CPU utilization is 92%, current memory usage is 12GB, current disk read / write speed is 150MB / s, task execution time is 5 minutes, estimated remaining execution time is 55 minutes, and task completion progress is 8%. The system's preset second condition includes: CPU utilization is higher than 70%, memory usage is greater than 8GB, and remaining execution time is greater than 30 minutes. The system compares the collected runtime parameters with the second condition: CPU utilization 92% > 70% (met), memory usage 12GB > 8GB (met), and remaining execution time 55 minutes > 30 minutes (met). All three sub-conditions are met, so the system determines that the task's runtime parameters meet the second condition and identifies this scientific computing task as the target task. The system adds the task's process ID to the target task management list and asks the user if they want the task to continue running when they leave. The user clicks "Yes," and the system automatically enables the corresponding option for the task. Approximately 20 minutes into the computation task, the user needs to leave their workstation and press the workstation's power button to turn off the screen. At this point, the system detects the target operation (pressing the power button to turn off the screen), queries the target task management list, and finds that the currently executing scientific computing task has been identified as the target task, and the corresponding option is enabled. The system sets the electronic device's power consumption configuration to the first configuration, maintaining all eight cores of the processor at a high frequency (3.5GHz), maintaining high-speed memory access mode, and maintaining high-speed disk read / write mode to ensure the scientific computing task can continue executing. After the task completes, the system changes the first configuration to the second configuration to put the laptop into a low-power state.
[0082] Understandably, by determining the target task based on task attribute information and / or operating parameters, the system can intelligently identify tasks that require special power management without requiring users to manually mark or configure each task individually.
[0083] In other embodiments, the system may use attribute information or operating parameters alone to determine the target task, or it may use both attribute information and operating parameters simultaneously. When both operations are used simultaneously, the task's attribute information must satisfy a first condition and the operating parameters must satisfy a second condition; only when both conditions are met is the task identified as the target task.
[0084] Figure 3 A schematic diagram of a task processing method according to an embodiment of the present disclosure is shown.
[0085] As described above, the task processing method of this embodiment may further include, in response to a target operation, generating a selection window for the target task, the selection window containing options, the options being used to determine whether to execute the current target task; in response to the selection option being in an on state, determining to continue executing the current target task; in response to the selection option being in a off state, determining to temporarily suspend the execution of the current target task.
[0086] For example, a selection window can refer to a user interface that automatically pops up when a target operation is detected, allowing the user to decide whether to continue executing the current target task after the electronic device enters a wake-up state. The selection window can contain basic information about the target task and options controls for the user to choose from. For instance, the selection window can be displayed in the center of the electronic device's screen, in the notification area at the top or bottom of the screen, or as a floating window over the current application interface. The selection window can be displayed at the instant the user performs the target operation, such as when the user has just pressed the power button, just closed the lid of a laptop, or just folded a flip phone.
[0087] The options in the selection window can be interactive controls used by the user to determine whether to execute the current target task. Options can take various interactive forms, such as toggle buttons, radio buttons, checkboxes, and text links. For example, an option can be displayed as a toggle button that says "Allow task to continue - On / Off," or as two side-by-side text buttons that say "Continue" and "Pause." It should be noted that this disclosure does not impose specific limitations on the specific interactive forms of the options and can be adjusted according to user interface design specifications and user experience requirements.
[0088] Options used to determine whether to execute the current target task can refer to the system's ability to understand the user's intentions through the user's actions on the options, thereby determining the subsequent power consumption configuration strategy. When the user selects the "on" state, it means that the user wants to continue executing the task after the device enters the wake-up state; when the user selects the "off" state, it means that the user wants to pause the execution of the task after the device enters the wake-up state.
[0089] In one example, refer to Figure 3A user is using a laptop to compile code for a large project, which is expected to take 30 minutes to complete. The user needs to attend an impromptu meeting and prepares to close the laptop lid and leave their workstation. As the user touches the laptop lid and begins to close it, the system detects this action and immediately displays a selection window in the center of the screen. The window's title reads "Running Task Detected," and the content area displays "Currently executing: Code compilation task, estimated remaining time 28 minutes." A toggle button is displayed at the bottom of the window, with the text "Continue this task after closing the lid." At this point, the toggle button is grayed out and in the off position. Seeing this prompt, the user realizes that pausing the compilation task now would mean waiting another 30 minutes after the meeting. Therefore, the user clicks the toggle button, turning it blue and displaying "On." After confirming their selection, the user clicks the "OK" button in the window or simply continues closing the lid. The system receives the signal that the user's option is on, records the selection, and confirms that the current code compilation task will continue. The system then sets the electronic device's power consumption configuration to the first configuration, which includes: maintaining an active WiFi connection to retrieve dependency libraries from the code repository, setting the processor frequency to 2.0GHz to ensure compilation speed, allowing all four processor cores to work simultaneously, maintaining normal memory frequency, and turning off the display backlight without entering hibernation mode. After the user closes the lid and leaves the workstation, the laptop continues to perform code compilation in the background. 28 minutes later, the compilation task completes, and the system detects this completion, switching the power consumption configuration from the first to the second configuration. This second configuration includes: turning off the WiFi connection, reducing the processor frequency to 0.8GHz, reducing the number of active processor cores to one, reducing memory frequency, and allowing the system to enter deep hibernation mode, thereby significantly reducing power consumption and extending battery life.
[0090] Understandably, by generating a selection window when the target operation is triggered and determining the task execution strategy based on the user's choice of options, this method achieves real-time interaction and precise matching between user intent and system behavior. Users can flexibly decide whether to continue the task each time the target operation is executed, based on the actual needs at that moment, without needing to make complex configuration changes in the system settings beforehand.
[0091] As described above, if the second configuration information of the electronic device is changed to the first configuration information, the task processing method of this embodiment may further include the operation of: applying the second configuration information in response to the completion of the current target task.
[0092] If the first configuration information of the electronic device is changed to the second configuration information, the task processing method of this embodiment may further include the operation of: applying the first configuration information in response to the completion of the current target task.
[0093] For example, regardless of the power configuration state of the electronic device before the target task is executed, the system records the current configuration information before the task begins and restores it to that configuration state after the task is completed. This design ensures that the system's power management behavior is transparent and predictable to the user, and does not permanently change the user's pre-set power management strategy due to task execution.
[0094] In one example, a user is performing routine office work on a laptop. The electronic device's power configuration is set to the second configuration information, which includes: WiFi connection maintained for receiving emails, processor frequency of 1.0GHz, two active processor cores, memory running at standard frequency, screen brightness set to 50%, and system set to automatically hibernate after 5 minutes of inactivity. Before leaving get off work, the user initiates a large database backup task, estimated to take 45 minutes to complete. The user then needs to leave the office and prepares to close the laptop lid. When the user closes the lid, the system detects this action and displays a selection window asking, "Currently executing: Database backup task, estimated remaining time 43 minutes. Continue execution after closing the lid—On / Off." The user selects the option to enable it. Upon receiving this selection, the system first saves the current second configuration information to the system configuration database, recording parameters such as WiFi connection status, 1.0GHz processor frequency, two active cores, standard memory frequency, and 5-minute automatic hibernation. The system then changes the second configuration information to the first configuration information. Specifically, this involves: maintaining an active WiFi connection for data transfer to the backup server, increasing the processor frequency to 1.8GHz to speed up backup, activating all four processor cores for simultaneous data reading and encryption, increasing the memory frequency to high-performance mode, and disabling the display backlight but disabling automatic hibernation. After the user closes the laptop and places it in a backpack, the laptop continues to perform database backup tasks in the background while on the subway and on the way home. When the system detects that the task is complete, it applies the second configuration information. The system reads the previously saved second configuration information parameters from the configuration database and sends recovery commands to each hardware module. These commands include: maintaining the WiFi connection, reducing the processor frequency from 1.8GHz to 1.0GHz, reducing the number of active processor cores from four to two, restoring the memory frequency from high-performance mode to the standard frequency, and re-enabling the automatic hibernation setting after 5 minutes of inactivity. Since the laptop is still closed and there is no user interaction, the system waits 5 minutes after applying the second configuration information before entering deep hibernation, significantly reducing power consumption.
[0095] Understandably, the configuration save and restore mechanism not only ensures the performance requirements during task execution but also maintains the integrity and consistency of users' personalized configurations. It avoids the tedious operation of manually restoring settings after the task is completed, further improving the system's intelligence and user experience.
[0096] As described above, the task processing method of this embodiment may further include determining a target strategy based on the type information of the current target task, so as to determine whether the current target task has been completed.
[0097] For example, the type information of the target task can refer to attribute data used to describe and distinguish the characteristics of the target task. These attributes may include the task's execution method, data processing mode, resource call mechanism, completion judgment conditions, etc. Type information can be automatically identified by the system when the task is created, or it can be actively declared by the application during task registration, or it can be extracted by analyzing the task's execution code or configuration files. For instance, type information may include characteristics such as whether the task needs to call a machine learning model, whether the task involves large-scale data transfer, whether the task needs continuous communication with a remote server, and whether the task contains multiple serial or parallel subtasks.
[0098] A target strategy can refer to a method for determining task completion based on the type of the target task. Different types of tasks have different execution mechanisms and completion indicators, requiring different detection strategies to accurately determine whether the task has been completed. Target strategies may include, but are not limited to: listening to model output signals, checking file transfer progress, querying database operation status, monitoring process exit events, receiving application completion notifications, and detecting changes in resource utilization. For example, for tasks relying on machine learning models, the target strategy could be to listen to task completion signals emitted by the model's inference engine; for database backup tasks, the target strategy could be to monitor the process status of the backup program and determine task completion when the process exits normally and returns a success status code.
[0099] If the type information is of type 1, which represents that the target task uses the model to perform the task, the method further includes: in response to receiving a signal from the model regarding the completion of the target task, determining that the current target task has been completed.
[0100] For example, the first type can refer to task types that require calling machine learning models, deep learning models, neural network models, or other artificial intelligence models to complete core processing steps during the execution of the target task. For instance, tasks of the first type may include, but are not limited to: intelligent image recognition tasks, natural language processing tasks, speech recognition and transcription tasks, video content analysis tasks, and intelligent recommendation computing tasks.
[0101] The signal indicating task completion from a model can refer to a task completion notification sent to an external system by a machine learning or deep learning model after processing all input data, via a specific communication mechanism. This signal can take various forms, such as event callback functions, message queue notifications, status code updates, and log recordings. For example, in a task that calls a cloud-based AI service, the remote model service will return a "status: completed" status code after processing all requests.
[0102] It should be noted that different model frameworks and inference engines may use different signal notification mechanisms, and the system needs to adapt the corresponding listening method according to the specific model type used in the target task.
[0103] In one example, a user is organizing travel photos using a smart photo album app on their tablet. The user selects 500 photos recently imported from the camera and clicks the "Smart Classification" function, hoping the app will automatically categorize these photos by scene type (e.g., landscape, people, architecture, food, etc.). This smart classification task belongs to type one because it requires content analysis of each photo using a pre-trained image recognition model. Upon receiving the task, the system reads the task type information, identifying it as an "image classification task based on a convolutional neural network model," and then determines the target strategy as "listening to the task completion callback signal from the model inference engine." After initiating the task, the user prepares to close the tablet's protective case because they need to go out for a meal. When the user closes the case, the system detects this target operation and immediately pops up a selection window displaying: "Currently executing: Smart Photo Classification Task, 86 photos completed, 414 photos remaining, estimated remaining time 12 minutes, continue executing the task after closing the case—Open / Close." The user clicks the option to enable the function, and the system records this selection and changes the power consumption configuration information from the second configuration information to the first configuration information. Specifically, this includes: maintaining a WiFi connection to synchronize model updates from the cloud, activating the GPU to accelerate image inference computation, setting the processor frequency to 1.8GHz, allowing four processor cores to work simultaneously to handle image data loading and preprocessing, keeping memory running at high speed to cache model parameters and intermediate calculation results, and disabling the system's automatic sleep function. The system also registers a task completion listener in the image recognition model's inference engine, which receives processing progress updates and completion notifications from the model. After the user closes the protective case and leaves, the tablet continues to perform the photo classification task in the background. When the model inference engine completes processing the 500th photo, the inference engine calls the task completion callback function, sending a completion signal to the system containing "taskId:photo_classification_20240115, status:completed, totalProcessed:500". The system's listener immediately receives this signal, verifies that the task in the signal matches the current target task, confirms that the status field is "completed," and that the number of processed photos matches the total number of photos. It then responds to the signal received from the model regarding the completion of the target task, confirming that the current target task has been completed. Since the second configuration information was previously changed to the first configuration information, the system begins to apply the second configuration information, specifically including: disabling the GPU to save power, reducing the processor frequency from 1.8GHz to 1.0GHz, reducing the number of active processor cores from 4 to 2, reducing the memory operating frequency to standard mode, and re-enabling the automatic hibernation setting after 3 minutes of inactivity.
[0104] In other embodiments, if the type information is a second type, the second type indicating that the target task did not utilize the model to execute the task, the target strategy may include at least one of the following: in response to detecting an input event within a target time period, if the input frequency of the input event is less than a first threshold, determine that the current task has completed; if the process of the current task is in an exit state, determine that the current task has completed; if the resource utilization of the electronic device is less than a second threshold, determine that the current task has completed; if the current task stops running in the scheduled task program and / or background service, determine that the current task has completed.
[0105] For example, the second type can refer to tasks that do not require calling machine learning or deep learning models during execution, but are completed through traditional algorithmic logic, data processing procedures, or system calls. Tasks of this type typically have the following characteristics: they do not rely on pre-trained models for data processing, primarily use CPU for computation rather than GPU or NPU, task completion is determined by monitoring system resources, process status, or user interaction, and no intermediate results from model inference are generated during task execution. For instance, tasks of this type may include, but are not limited to: file compression and decompression tasks, large file download tasks, and database backup and recovery tasks.
[0106] It should be noted that since the second type of task does not actively send explicit notifications similar to model completion signals, the system needs to employ other detection strategies to determine whether the task has completed. These strategies can be based on various technologies such as system resource monitoring, process status tracking, and user interaction analysis. A single strategy can be used, or multiple strategies can be combined to improve the accuracy and reliability of the determination.
[0107] In one implementation, the target strategy includes: in response to detecting an input event within a target time period, determining that the current task has been completed if the input frequency of the input event is less than a first threshold.
[0108] The target time period refers to the time window during which the system observes and counts the frequency of input events. The length of the target time period can be set according to the type and characteristics of the task, such as 30 seconds, 2 minutes, or 5 minutes. For example, for a file download task, the target time period can be set to 1 minute, and the system will count the number of download-related input events in the most recent minute.
[0109] Input events can refer to various operational events related to the execution of the target task. These events may include, but are not limited to, disk read / write operations, network data transmission and reception, memory allocation and release, system call requests, thread creation and destruction, etc. For example, in a file compression task, input events may include disk I / O events for reading the source file and disk I / O events for writing to the compressed file.
[0110] Input frequency can refer to the number of input events or the amount of data that occur within a target time period. Input frequency can be expressed in different units of measurement, such as events per second, data packets per minute, or bytes written per minute. For example, in a file download task, input frequency can be expressed as the number of network data packets received per second. If an average of 50 data packets are received per second in the last minute, then the input frequency is 50 packets / second.
[0111] The first threshold can refer to a critical input frequency value used to determine whether a task has essentially ceased activity. When the input frequency falls below the first threshold, it indicates that task-related operations have significantly decreased or essentially stopped, suggesting that the task may have been completed. The specific value of the first threshold can be set based on the normal execution characteristics of the task. For example, for a file compression task that normally generates 100 disk I / O operations per second, the first threshold can be set to 5 operations / second. When the I / O frequency drops below 5 operations / second, it indicates that the compression operation has essentially ended.
[0112] In another implementation, the target strategy includes: determining that the current task has completed execution if the process of the current task is in an exited state.
[0113] The process of the current task can refer to the process entity executing the target task in the operating system. A task may correspond to an independent process, or it may be completed by multiple processes working together, or it may run as a child process or thread of a parent process. For example, when a user starts a file compression program, the operating system will create a new process for the program, which is responsible for reading the file to be compressed, executing the compression algorithm, writing to the compressed file, and other operations.
[0114] A process being in an exit state can mean that it has completed all its work and terminated normally, or that it terminated abnormally for some reason, and the operating system has reclaimed the resources used by the process. The exit state typically includes an exit code to indicate whether the process terminated normally or abnormally. For example, in Linux systems, an exit code of 0 usually indicates that the process exited normally after completing its task, while a non-zero exit code indicates that the process encountered an error and exited abnormally.
[0115] In another implementation, the target strategy includes: determining that the current task has been completed if the resource utilization of the electronic device is less than a second threshold.
[0116] Resource utilization of electronic devices refers to the degree of occupancy of the device's hardware resources at any given moment. These resources may include, but are not limited to, processor (CPU) utilization and memory utilization. For example, when an electronic device performs a large file compression task, CPU utilization may reach over 80%, and disk I / O utilization may reach over 90%; after the task is completed, CPU utilization will drop to below 10%, and disk I / O utilization will drop to below 5%.
[0117] The second threshold can refer to a critical value for resource utilization used to determine whether a task has essentially ended. When resource utilization falls below the second threshold, it indicates that computational, storage, and transmission operations related to the task have significantly decreased, and system resources are essentially idle, suggesting that the task may have been completed. The specific value of the second threshold can be set based on the system's basic resource usage level, excluding normal resource consumption by the operating system and other background programs. For example, if the system's CPU utilization is typically around 5% in an idle state, the second threshold can be set to 15%. When CPU utilization is detected to drop below 15% and remain below it for a period of time, it indicates that the computationally intensive task may have been completed.
[0118] In another implementation, the target strategy includes: determining that the current task has completed execution if the current task in the scheduled task program and / or background service stops running.
[0119] A scheduled task program can refer to a timed task scheduling service provided by the operating system. Users or applications can use this service to configure certain tasks to be executed automatically at specific times or when specific conditions are met. For example, tasks executed through a scheduled task program usually stop automatically after completion. The system can determine whether a specific task has been completed by querying the task list and task status of the scheduled task program.
[0120] Background services refer to system services or application services that run continuously in the background of the operating system. These services can receive requests from users or other programs and perform corresponding tasks. For example, a file synchronization service can continuously monitor changes to a specified folder and automatically synchronize files to the cloud or other devices.
[0121] A task stopping can mean that its status in the task scheduler or background service's task list has changed from "running" to "completed," "stopped," or another status indicating that the task is no longer executing. The system can periodically query the task scheduler's API or the background service's status interface to obtain the latest status information of the current task. When the system detects that the task status has changed to "stopped," it determines that the task has completed its execution.
[0122] It should be noted that for the second type of task, the system can select one or more of the above strategies and combine them according to the specific characteristics of the task and the execution environment. For example, it can monitor the process status and resource utilization simultaneously, and only determine the task completion when the process exits and the resource utilization is below a threshold, in order to improve the accuracy of the determination; or it can first check the task status of the scheduled task program, and if the task is still running, further check the input frequency and resource utilization, using multi-layer verification to avoid false judgments.
[0123] In one example, a user is conducting research on a laptop and needs to decompress a 50GB compressed file of experimental data. The user right-clicks the compressed file, selects "Extract to current folder," and the decompression program starts and begins the decompression task, which is expected to take 40 minutes to complete. Upon receiving the task, the system reads the task type information and identifies it as a "file decompression task based on traditional compression algorithms," without involving any machine learning model calls; therefore, it is classified as type two. Based on the characteristics of type two, the system determines the target strategy to combine "process status monitoring," "resource utilization detection," and "input frequency analysis" to determine task completion.
[0124] Specifically, the system first obtains the process ID of the decompression program as 12580 and establishes continuous monitoring of the process status; secondly, it sets a second threshold for CPU utilization of 20% and a second threshold for disk I / O utilization of 15%; thirdly, it sets a first threshold for the input frequency of disk write operations of 10 write operations per second, with the target time period being the most recent 2 minutes. Fifteen minutes after the user starts the decompression task, they need to leave to attend a lab meeting and prepare to close their laptop lid. When the user closes the lid, the system detects this target operation and immediately pops up a selection window displaying "Currently executing: Experimental data decompression task, 18GB / 50GB decompressed, estimated remaining time 25 minutes, continue executing the task after closing the lid—On / Off". The user clicks the option to set it to the on state, the system records this selection and changes the power consumption configuration information from the second configuration information to the first configuration information, specifically including: keeping the disk in a high-speed working state to speed up decompression, setting the processor frequency to 2.2GHz to quickly execute the decompression algorithm, allowing 4 processor cores to work simultaneously to process data decompression and verification, keeping the memory at a normal normal frequency to cache the decompressed file data, and disabling the system's automatic hibernation function, etc. After the user closes the lid and leaves, the laptop continues to perform the decompression task in the background.
[0125] During task execution, the system's monitoring module continuously collected relevant data: process 12580 remained running, CPU utilization remained around 65%, disk I / O utilization remained around 80%, and the disk write operation frequency was approximately 150 times per second. After 25 minutes, the decompression task completed the decompression of the last file, and the decompression program began to perform cleanup work, including verifying the integrity of the decompressed files and updating the file index. At this time, the system monitored the following changes: the disk write operation frequency dropped to 8 times per second in the last 2 minutes, below the first threshold of 10 times / second; CPU utilization gradually dropped to 18% in the last 30 seconds, below the second threshold of 20%; and disk I / O utilization dropped to 12% in the last 30 seconds, below the second threshold of 15%. After another 15 seconds, the decompression program completed all cleanup work, and process 12580 exited normally, returning exit code 0, indicating that the task was successfully completed. The system detects that the process status has changed to exit status, reads the exit code as 0 to confirm normal completion, and verifies that the input frequency and resource utilization are both below their respective thresholds. When all three detection conditions are met, the system determines that the current file decompression task has been completed.
[0126] The system then changed the second configuration information to the first configuration information, and the system began to apply the second configuration information, which specifically included: reducing the disk operating frequency to power saving mode, reducing the processor frequency from 2.2GHz to 1.0GHz, reducing the number of active processor cores from 4 to 2, reducing the memory operating frequency to standard mode, and re-enabling the setting of automatic hibernation after 5 minutes of inactivity.
[0127] Figure 4 A second flowchart of a task processing method according to an embodiment of the present disclosure is illustrated schematically.
[0128] As described above, when the electronic device has first configuration information and the current target task is being executed, the task processing method of this embodiment may further include the following operations: if the first device parameter of the electronic device meets the third condition, the power consumption configuration information of the electronic device is set as the second configuration information, and the first strategy corresponding to the first device parameter is executed, wherein the first device parameter indicates that the power of the electronic device is less than the first target threshold.
[0129] While the electronic device has first configuration information and the current target task is being executed, the task processing method of this embodiment may further include the following operations: if the electronic device is in a state where the second device parameter satisfies the fourth condition, the power consumption configuration information of the electronic device is set as the second configuration information, and a second strategy corresponding to the second device parameter is executed, wherein the second device parameter indicates that the temperature of the electronic device is greater than the second target threshold.
[0130] For example, the first device parameter can refer to a parameter used to describe the battery state of an electronic device. The first device parameter may include, but is not limited to: the current remaining battery percentage, the absolute value of the remaining available battery power, the estimated remaining usage time, the battery discharge rate, etc. For example, the first device parameter may be that the current remaining battery power is 18%.
[0131] "Battery level below the first target threshold" means that the remaining battery power of an electronic device has dropped below a preset critical value. At this point, the battery enters a low-power state, and continuing to operate at high power consumption may lead to over-discharge of the battery or unexpected shutdown of the device. The specific value of the first target threshold can be set based on factors such as the battery capacity of the electronic device, the estimated remaining execution time of the task, and the user's usage habits. For example, the first target threshold can be set to 20%, triggering a power-saving protection mechanism when the battery level drops below 20%.
[0132] The third condition can refer to the rules used to determine whether the power protection mechanism needs to be activated. The third condition typically includes a threshold comparison of the first device parameter, and may also include analysis of power level trends. For example, the third condition could be that the current battery level is less than 20%. By setting reasonable third conditions, the system can take timely protective measures when the power is insufficient, preventing the device from suddenly shutting down due to depleted power and resulting in data loss.
[0133] The first strategy refers to the measures the system takes when the battery is low. The first strategy may include, but is not limited to: sending a low battery warning notification to the user, automatically saving the progress data of the current task, adjusting task execution parameters to reduce power consumption, and prompting the user to connect the power adapter. For example, the first strategy could be displaying a message on the screen stating, "Battery level is below 20%, performance has been automatically reduced to extend battery life, it is recommended to connect to a power source as soon as possible."
[0134] The second device parameter can refer to parameters used to describe the temperature status of electronic devices. Second device parameters may include, but are not limited to: processor core temperature, battery temperature, motherboard temperature, chassis temperature, graphics card temperature, etc.
[0135] A temperature exceeding the second target threshold can mean that the temperature of a component in an electronic device has risen to a level that may affect device performance or safety. The specific value of the second target threshold is usually set based on the safe operating temperature range provided by the hardware manufacturer. For example, for processor core temperature, the second target threshold might be set to 80 degrees Celsius, triggering a temperature protection mechanism when this temperature is exceeded; for battery temperature, the second target threshold might be set to 40 degrees Celsius, reducing the charge / discharge rate to protect battery life when this temperature is exceeded.
[0136] The fourth condition can refer to the rules used to determine whether the temperature protection mechanism needs to be activated. The fourth condition typically includes threshold comparisons of the second device parameters, and may also include analysis of temperature change trends and durations. For example, the fourth condition could be a processor core temperature exceeding 80 degrees Celsius. By setting appropriate fourth conditions, the system can take timely cooling measures when the temperature rises abnormally, preventing performance degradation or hardware damage due to overheating.
[0137] The second strategy can refer to the measures the system takes to cope with excessively high temperatures. This second strategy may include, but is not limited to: sending high-temperature warnings to users, increasing cooling fan speeds, reducing processor and graphics card operating frequencies, and advising users to improve the device's cooling environment.
[0138] It should be noted that the third and fourth conditions can be executed independently or simultaneously. When an electronic device encounters both insufficient power and excessive temperature during task execution, the system can simultaneously set the power consumption configuration information to the second configuration information and execute both the first and second strategies to comprehensively address multiple risks.
[0139] In one example, refer to Figure 4A user is working in a coffee shop using a thin and light laptop equipped with a 50Wh battery. The user needs to handle an urgent task: converting 80GB of raw 4K video footage to H.265 encoding for uploading to a video platform. This transcoding task is expected to take 90 minutes to complete. Since there are no power outlets in the coffee shop, the user must rely on battery power. The user launches the video transcoding software, selects the input file and output parameters, and begins the transcoding task. Upon receiving the task, the system reads the task type information and identifies it as a "format conversion task based on video encoding algorithms," belonging to the second type of task. Because the user wants to complete the transcoding as quickly as possible to submit the work promptly, the user sets the performance mode to "high performance" in the system power settings. At this time, the power consumption configuration of the electronic device is set to the first configuration information, specifically including: processor operating frequency of 2.8GHz, all 8 processor cores are active, memory running at the maximum frequency of 2400MHz, the dedicated graphics card is active to assist in video encoding, the cooling fan speed is set to automatic adjustment mode, and the system hibernation function is disabled. The transcoding task begins. The transcoding software calls the hardware encoders of the processor and graphics card, reading the original video frame by frame at a rate of approximately 30 frames per second, applying the H.265 compression algorithm, and writing the encoded video file. At this time, the system power consumption is approximately 35W, the CPU utilization is maintained at around 75%, the graphics card utilization is maintained at around 60%, and the battery is estimated to provide power for approximately 85 minutes, just enough to complete the entire transcoding task. After starting the task, the user continues to process other work emails. 30 minutes later, the user receives an urgent meeting notification requiring immediate participation in a remote video conference. The user closes the laptop lid to prepare to go to the meeting room. The system detects the lid closing operation and pops up a selection window displaying "Currently executing: Video transcoding task, 34% complete, estimated remaining time 60 minutes, continue executing this task after closing the lid - On / Off". The user clicks the option to set it to the on state. The system records this selection and keeps the power consumption configuration information as the first configuration information, continuing to execute the transcoding task in high-performance mode. The user puts the laptop in a backpack and goes to the meeting room, with the laptop continuing to execute the video transcoding task with the lid closed. During the task execution, the system's monitoring module continuously collected battery power and temperature data. Specifically, the battery power started at 68%, dropped to 43% after 30 minutes, and further decreased to 23% after 50 minutes. The processor core temperature gradually increased from 55 degrees Celsius at the start of the task, reaching 72 degrees Celsius after 30 minutes and 78 degrees Celsius after 50 minutes. Because the laptop was closed and placed in a backpack, heat dissipation was poor, resulting in a slow and continuous temperature increase.At the 55-minute mark of task execution, the system monitoring module detected that the processor core temperature had reached 82 degrees Celsius, exceeding the preset second target threshold of 80 degrees Celsius. Furthermore, the temperature had been rising continuously over the past 5 minutes, fulfilling the fourth condition: "Processor core temperature greater than 80 degrees Celsius and continuously rising." The system immediately adjusted the electronic device's power consumption configuration information from the first configuration to the second configuration information. Specifically, this included: reducing the processor operating frequency from 2.8GHz to 1.8GHz, reducing the number of active processor cores from 8 to 6, reducing the memory operating frequency to 1866MHz, reducing the dedicated graphics card operating frequency, and forcibly increasing the cooling fan speed from automatic adjustment mode to 70%. Simultaneously, the system executed the second strategy, adding a high-temperature warning message to the notification queue: "Device temperature is high (82°C). Performance has been automatically reduced to protect hardware. Transcoding speed will be reduced. It is recommended to place the device in a well-ventilated location." This message will be displayed the next time the user opens the computer lid. Over the next 5 minutes, the temperature gradually decreased to 75 degrees Celsius, and the temperature was effectively controlled. The system continues to update the electronic device's second configuration information to the first configuration information until the task is completed, without any issues related to battery power or temperature. Based on the detection strategy for the second type of task, the system's monitoring module detects that the transcoding program has exited normally and returned a success status code, CPU usage has dropped below 15% within the last two minutes, and disk write operation frequency has dropped below 5 times per second. When all three conditions are met simultaneously, the system determines that the video transcoding task has completed. The system then adjusts the first configuration information to the low-power second configuration information.
[0140] Understandably, by continuously monitoring key parameters such as the power and temperature of electronic devices during the execution of the target task, and promptly adjusting the power consumption configuration from the first configuration information to the second configuration information when these parameters exceed preset thresholds, while simultaneously executing corresponding protection strategies, this method achieves dynamic response and proactive protection of the device status.
[0141] Based on the above task processing method, this disclosure also provides a task processing apparatus. The following will be combined with... Figure 5 The device is described in detail.
[0142] Figure 5 A schematic block diagram of a task processing apparatus according to an embodiment of the present disclosure is shown.
[0143] like Figure 5 As shown, the task processing device 300 of this embodiment includes a judgment module 310, a first setting module 320, and a second setting module 330.
[0144] The determination module 310 is used to determine whether the option of the target task is enabled in response to the target operation. In one embodiment, the determination module 310 can be used to perform the operation S210 described above, which will not be repeated here.
[0145] The first setting module 320 is used to set the power consumption configuration information of the electronic device to the first configuration information if the option regarding the target task is enabled, so as to continue executing the current target task. After the target task is completed, the power consumption configuration information of the electronic device is set to the second configuration information. In one embodiment, the first setting module 320 can be used to perform the operations S220-230 described above, which will not be repeated here.
[0146] The second setting module 330 is used to set the power consumption configuration information of the electronic device to the second configuration information if the option regarding the target task is turned off, so as to suspend the execution of the current target task. In one embodiment, the second setting 330 can be used to perform the operation S220' described above, which will not be repeated here.
[0147] The target operation is used to put the electronic device into a wake-up state, and the power consumption of the electronic device configured with the first configuration information is greater than the power consumption of the electronic device configured with the second configuration information.
[0148] According to embodiments of this disclosure, any plurality of modules among the determination module 310, the first setting module 320, and the second setting module 330 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least a portion of the functionality of one or more of these modules can be combined with at least a portion of the functionality of other modules and implemented in one module. According to embodiments of this disclosure, at least one of the determination module 310, the first setting module 320, and the second setting module 330 can be at least partially implemented as a hardware circuit, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging the circuit, or implemented in any one of software, hardware, and firmware, or in a suitable combination of any of these. Alternatively, at least one of the determination module 310, the first setting module 320, and the second setting module 330 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.
[0149] Figure 6 A block diagram schematically illustrates an electronic device suitable for implementing a task processing method according to an embodiment of the present disclosure.
[0150] likeFigure 6 As shown, an electronic device 900 according to an embodiment of the present disclosure includes a processor 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage portion 908 into a random access memory (RAM) 903. The processor 901 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 901 may also include onboard memory for caching purposes. The processor 901 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0151] RAM 903 stores various programs and data required for the operation of electronic device 900. Processor 901, ROM 902, and RAM 903 are interconnected via bus 904. Processor 901 executes various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 902 and / or RAM 903. It should be noted that programs may also be stored in one or more memories other than ROM 902 and RAM 903. Processor 901 may also execute various operations of the method flow according to embodiments of the present disclosure by executing programs stored in one or more memories.
[0152] According to embodiments of this disclosure, the electronic device 900 may further include an input / output (I / O) interface 905, which is also connected to a bus 904. The electronic device 900 may also include one or more of the following components connected to the I / O interface 905: an input section 906 including a keyboard, mouse, etc.; an output section 907 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 910 as needed so that computer programs read from it can be installed into the storage section 908 as needed.
[0153] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0154] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 902 and / or RAM 903 and / or one or more memories other than ROM 902 and RAM 903 described above.
[0155] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the task processing methods provided in the embodiments of this disclosure.
[0156] When the computer program is executed by the processor 901, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0157] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and downloaded and installed via the communication section 909, and / or installed from a removable medium 911. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0158] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 909, and / or installed from the removable medium 911. When the computer program is executed by the processor 901, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0159] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on a user's computing device, partially on a user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0160] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0161] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0162] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.
Claims
1. A method for processing a task, comprising: in response to a target operation, setting power consumption configuration information of an electronic device to first configuration information to continue execution of a current target task if an option related to the target task is in an on state, and setting the power consumption configuration information of the electronic device to second configuration information after the target task is executed; setting the power consumption configuration information of the electronic device to the second configuration information to suspend execution of the current target task if the option related to the target task is in an off state; wherein the target operation is used to make the electronic device in a standby wake-up state, and power consumption of the electronic device in a case where the electronic device is configured with the first configuration information is greater than power consumption of the electronic device in a case where the electronic device is configured with the second configuration information. 2.The method of claim 1, wherein setting the power consumption configuration information of the electronic device to the first configuration information to continue execution of the current target task if the option related to the target task is in the on state comprises: changing the second configuration information of the electronic device to the first configuration information to continue execution of the current target task if the electronic device has the second configuration information; and continuing execution of the current target task if the electronic device has the first configuration information. 3.The method of claim 1, wherein setting the power consumption configuration information of the electronic device to the second configuration information to suspend execution of the current target task if the option related to the target task is in the off state comprises: making the electronic device enter the standby wake-up state and suspending execution of the current target task if the electronic device has the second configuration information. 4.The method of claim 1, wherein if the option related to the target task is in the off state, the method further comprises: continuing execution of the current target task if the electronic device has the first configuration information. 5.The method of claim 1, wherein the method further comprises: determining the task as the target task if attribute information of the task meets a first condition; and / or determining the task as the target task if a running parameter of the task meets a second condition. 6.The method of claim 1, wherein the method further comprises: generating a selection window for the target task in response to the target operation, the selection window containing the option, the option being used to determine whether to execute the current target task; determining to continue execution of the current target task in response to selection of the option as the on state; and determining to suspend execution of the current target task in response to selection of the option as the off state. 7.The method of claim 1, wherein if the second configuration information of the electronic device is changed to the first configuration information, the method further comprises: applying the second configuration information in response to completion of running of the current target task; and if the first configuration information of the electronic device is changed to the second configuration information, the method further comprises: applying the first configuration information in response to completion of running of the current target task. 8.The method of claim 1, wherein the method further comprises: According to the type information of the current target task, a target strategy is determined to determine whether the current target task is run to completion; If the type information is a first type, the first type representing that the target task performs a task by using a model, the method further comprises: In response to receiving a signal that the model is completed with respect to the target task, it is determined that the current target task is run to completion.
9. The method of claim 1, wherein when the electronic device has the first configuration information and during execution of the current target task, the method further comprises: If a first device parameter of the electronic device satisfies a third condition, setting power consumption configuration information of the electronic device as second configuration information, and executing a first strategy corresponding to the first device parameter, the first device parameter representing that an electric quantity of the electronic device is less than a first target threshold value; and / or If a second device parameter of the electronic device satisfies a fourth condition, setting power consumption configuration information of the electronic device as second configuration information, and executing a second strategy corresponding to the second device parameter, the second device parameter representing that a temperature of the electronic device is greater than a second target threshold value.
10. An electronic device, comprising: a processor configured to, in response to a target operation, if an option with respect to a target task is in an open state, set power consumption configuration information of the electronic device as first configuration information to continue to execute a current target task, and set the power consumption configuration information of the electronic device as second configuration information after the target task is executed; and if the option with respect to the target task is in a closed state, set the power consumption configuration information of the electronic device as the second configuration information to suspend execution of the current target task; wherein the target operation is used to make the electronic device in a standby wake-up state, and power consumption of the electronic device in a case where the electronic device is configured with the first configuration information is greater than power consumption of the electronic device in a case where the electronic device is configured with the second configuration information.