Mixed sleep method and electronic equipment
By flexibly controlling the timing and sequence of device power-down in hybrid sleep mode and optimizing the sleep strategy based on historical usage data, the problem of high power consumption in hybrid sleep mode is solved, resulting in longer battery life and a better user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUAWEI DEVICE CO LTD
- Filing Date
- 2024-10-25
- Publication Date
- 2026-04-28
AI Technical Summary
In the existing hybrid sleep mode, the power consumption of electronic devices needs to be optimized, resulting in insufficient battery life and affecting user experience.
By flexibly controlling the power-down timing of electronic devices in a hybrid sleep mode, a multi-stage sleep strategy is adopted. Based on historical usage data and sleep conditions, the power-down sequence and duration of devices are adjusted, prioritizing the power-down of devices with low usage frequency while keeping devices with high usage frequency powered on.
It effectively reduces power consumption in hybrid sleep mode, extends the battery life of electronic devices, improves the adaptability of devices in different usage environments, and enhances the user experience.
Smart Images

Figure CN121934701A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a method and electronic device for hybrid sleep. Background Technology
[0002] When a user is not using an electronic device, the device can enter a power-saving mode to reduce its power consumption.
[0003] In one possible implementation, the power-saving mode of the electronic device includes a hybrid sleep mode. When the electronic device enters hybrid sleep mode, some components (such as the CPU) are powered down, while others (such as memory) remain powered on. Even after the electronic device enters sleep mode, the operation of the other components still generates some power consumption. Subsequently, the electronic device can automatically transition from this sleep state to a hibernation state, in which most components are powered down to reduce the overall power consumption of the electronic device.
[0004] However, the power consumption of the hybrid sleep method described above needs further optimization in order to extend the battery life of electronic devices. Summary of the Invention
[0005] This application provides a hybrid sleep method and an electronic device. This solution supports powering down at least one device corresponding to a sleep condition during the sleep process of the electronic device, in response to the fulfillment of a sleep condition. This solution can flexibly control the power-down timing of various devices in the electronic device in hybrid sleep mode, facilitating the phased power-down of devices in hybrid sleep mode. This reduces the power consumption of the electronic device in hybrid sleep mode, thereby improving the battery life of the electronic device.
[0006] Firstly, this hybrid sleep method can be applied to electronic devices. Optionally, the electronic device includes a first device, a second device, and a third device. Here, the hybrid sleep method provided in this embodiment is used as an example for illustration. The hybrid sleep method includes: in response to satisfying a first sleep condition, triggering the first device to enter a low-power mode or power down, the first sleep condition including detecting a user-triggered sleep operation or not receiving a user operation within a preset time range; in response to satisfying a second sleep condition, triggering the second device to enter a low-power mode or power down, the second sleep condition including the sleep duration of the electronic device being greater than or equal to a first duration.
[0007] Therefore, compared to related technologies, the solution provided in this application improves the flexibility of sleep state changes in electronic devices under hybrid sleep mode. By instructing the electronic device to periodically power down different devices or reduce their power consumption in hybrid sleep mode through at least one candidate sleep strategy, it gradually enters a sleep state with lower power consumption, which helps to reduce the power consumption of the electronic device in hybrid sleep mode. This helps to save power during standby of the electronic device and helps to extend the battery life of the electronic device.
[0008] On the other hand, by employing at least one candidate sleep strategy, the timing of powering down or entering low-power mode for each device in the electronic device can be specifically triggered. This makes the power-down timing of devices in the hybrid sleep mode more flexible and helps improve the adaptability of the hybrid sleep mode to devices in different usage environments. Considering that users may wake up the electronic device in hybrid sleep mode through certain devices, the sleep strategy supports prioritizing the power-down of devices used less frequently by the user, while keeping devices used more frequently powered on for a longer period of time. This helps ensure that the electronic device can respond to user operations promptly even in hybrid sleep mode.
[0009] In one possible implementation, the electronic device includes at least one sleep strategy, which is used to indicate different sleep conditions and devices to be powered off. The devices to be powered off include a first device, a second device, or a third device. The first device is indicated by a first sleep strategy. In response to satisfying a second sleep condition, triggering a second device to enter a low-power mode or power off includes: in response to satisfying the second sleep condition, obtaining a second sleep strategy indicating the second sleep condition from at least one sleep strategy; and triggering the second device indicated by the second sleep strategy to enter a low-power mode or power off.
[0010] Thus, the sleep strategy instructs devices to be powered down, which helps to achieve orderly power-down of devices during the sleep process of electronic devices.
[0011] In one possible implementation, at least one sleep strategy includes multiple sleep strategies with a selection order; in response to satisfying a second sleep condition, obtaining a second sleep strategy indicating the second sleep condition from the at least one sleep strategy includes: for the i-th sleep strategy among the multiple sleep strategies, adding the sleep duration parameters of the i-1 sleep strategies with the highest selection order to obtain a first duration parameter, the sleep duration parameter being used to characterize the duration threshold for the sleep strategy to be effective, where i is a positive integer; if the first duration parameter is greater than or equal to the first duration, obtaining the second sleep strategy according to the i-th sleep strategy.
[0012] Optionally, the electronic device uses the i-th sleep strategy as the second sleep strategy.
[0013] In this way, a selection order is set among multiple sleep strategies, allowing the electronic device to use each strategy in the order of selection. Since the electronic device only uses a sleep strategy with a higher selection order after the device in that strategy has been powered down, some devices in the electronic device are already powered down before the device in the later-selected sleep strategy is powered down. This eliminates the need for the same devices to be indicated between the higher-selection sleep strategy and the later-selection sleep strategy. This method helps reduce the amount of data related to powered-down device information in later-selection sleep strategies.
[0014] Moreover, this approach eliminates the need for electronic devices to detect whether each device is powered down or in a low-power mode before powering down the devices or entering a low-power mode according to the sleep strategy instruction. This helps reduce the execution logic of the power-down devices in electronic devices and improves their efficiency.
[0015] In one possible implementation, before triggering the second device to enter a low-power mode or power down in response to the satisfaction of the second sleep condition, the method further includes: obtaining the second sleep condition according to the i-th sleep strategy and the first duration.
[0016] In one possible implementation, the i-th sleep strategy includes a first sleep duration parameter, and a second duration is greater than or equal to the sum of the first duration and the first sleep duration parameter.
[0017] In one possible implementation, the method further includes: in response to satisfying a third sleep condition, powering down a second device, the third sleep condition including a sleep duration of the electronic device being greater than or equal to a second duration, the second duration being greater than a first duration.
[0018] This helps to enable devices in electronic devices to be powered down in stages or enter a low-power mode, and helps to gradually reduce power consumption during the sleep process of electronic devices.
[0019] In one possible implementation, the first device is a device pre-configured in the electronic device to be among the first to be powered down after entering a sleep state.
[0020] In one possible implementation, the method further includes: acquiring historical usage data, which characterizes the historical usage of the electronic device; and acquiring at least one sleep strategy based on the historical usage data, wherein the at least one sleep strategy is used to indicate different sleep conditions and devices to be powered off, the devices to be powered off including a first device, a second device, and a third device. Optionally, a device to be powered off refers to a device that, under the condition that the corresponding sleep condition is met, requires the electronic device to be triggered to power off or enter a low-power mode.
[0021] In this way, at least one sleep strategy is generated using historical usage data, allowing this strategy to adapt to the user's usage habits. In hybrid sleep mode, prioritizing the power-down of less frequently used devices reduces their on-time, which not only helps reduce the power consumption of electronic devices but also improves the match between the sleep state of the electronic devices in hybrid sleep mode and the user's device usage habits.
[0022] In one possible implementation, the historical usage data includes at least one of the following: device usage period, device usage information, and sleep start and end times; device usage period, used to characterize the historical usage period of the electronic device; device usage information, used to reflect the user's demand for devices in the electronic device; and sleep start and end times, used to characterize the historical sleep period of the electronic device.
[0023] In one possible implementation, at least one sleep strategy is obtained based on historical usage data, including: obtaining sleep duration parameters for each of the at least one sleep strategy based on the sleep start and end times, wherein the sleep duration parameters are used to characterize the duration threshold for the sleep strategy to be effective; and obtaining the sleep strategy to which each of the multiple devices in the electronic device belongs based on device usage information.
[0024] In one possible implementation, obtaining the sleep strategy of each of the multiple devices in the electronic device based on device usage information includes: determining the power-down priority among the devices based on the device usage information; and indicating a corresponding sleep strategy to each device based on the power-down priority among the devices.
[0025] Therefore, determining the sleep strategy for devices based on power-down priority helps instruct electronic devices to prioritize powering down or entering low-power mode for devices used less frequently. Since users have low dependence on such devices, powering them down first helps reduce their power consumption without affecting user operation of electronic devices.
[0026] In one possible implementation, after indicating the corresponding sleep strategy to each device according to the power-down priority among the devices, the method further includes: for each of the multiple devices, obtaining a reasonable value of the sleep strategy to which the device belongs based on historical usage data, and adjusting the sleep strategy to which the device belongs if the reasonable value meets the modification conditions.
[0027] This helps improve the rationality of the devices that the sleep strategy instructs to power down or enter a low-power mode, and helps improve the matching degree between the sleep strategy and the user's usage habits of electronic devices.
[0028] In one possible implementation, the first sleep strategy includes at least one of the following: sleep strategy identifier, sleep duration parameter, power-off device information, sleep level, and wake-up state.
[0029] Among them, the sleep strategy identifier is used to identify the first sleep strategy; the sleep duration parameter is used to indicate the duration of the sleep state corresponding to the first sleep strategy, or, when using the first sleep strategy, the maximum sleep duration of the electronic device; the power-down device information is used for at least one device that is about to be powered down or enters low power mode; the sleep level is used to characterize the sleep state or hibernation state corresponding to the first sleep strategy; and the wake-up state is used to characterize the form of the electronic device after it is woken up from sleep according to the first sleep strategy.
[0030] In a second aspect, this application provides an electronic device, which includes a first device, a second device, and a third device; the electronic device includes a processor and a memory; the processor of the at least one computing device is configured to execute instructions stored in the memory so that the electronic device performs the methods in the first aspect and any possible implementation thereof.
[0031] In one possible implementation, the electronic device includes at least one sleep strategy, which is used to indicate different sleep conditions and devices to be powered off. The devices to be powered off include a first device, a second device, or a third device. The first device is indicated by a first sleep strategy. In response to satisfying a second sleep condition, triggering a second device to enter a low-power mode or power off includes: in response to satisfying the second sleep condition, acquiring a second sleep strategy indicated by the second sleep condition in at least one sleep strategy; and triggering the second device indicated by the second sleep strategy to enter a low-power mode or power off.
[0032] In one possible implementation, at least one sleep strategy includes multiple sleep strategies with a selection order; in response to satisfying a second sleep condition, obtaining a second sleep strategy indicating the second sleep condition from the at least one sleep strategy includes: for the i-th sleep strategy among the multiple sleep strategies, adding the sleep duration parameters of the i-1 sleep strategies with the highest selection order to obtain a first duration parameter, the sleep duration parameter being used to characterize the duration threshold for the sleep strategy to be effective, where i is a positive integer; if the first duration parameter is greater than or equal to the first duration, obtaining the second sleep strategy according to the i-th sleep strategy.
[0033] In one possible implementation, when the processor reads computer instructions from memory, it also causes the electronic device to perform: acquiring a second sleep condition based on the i-th sleep strategy and the first duration.
[0034] In one possible implementation, the i-th sleep strategy includes a first sleep duration parameter, and a second duration is greater than or equal to the sum of the first duration and the first sleep duration parameter.
[0035] In one possible implementation, when the processor reads computer instructions from memory, it also causes the electronic device to: trigger a third device to enter a low-power mode or power down in response to a third sleep condition being met, wherein the third sleep condition includes a sleep duration of the electronic device being greater than or equal to a second duration, the second duration being greater than a first duration.
[0036] In one possible implementation, the first device is a device pre-configured in the electronic device to be among the first to be powered down after entering a sleep state.
[0037] In one possible implementation, when the processor reads computer instructions from memory, it also causes the electronic device to perform: acquiring historical usage data, which characterizes the historical usage of the electronic device; and acquiring at least one sleep strategy based on the historical usage data, which respectively indicates different sleep conditions and devices to be powered off, including a first device, a second device, and a third device.
[0038] In one possible implementation, the historical usage data includes at least one of the following: device usage period, device usage information, and sleep start and end times; device usage period, used to characterize the historical usage period of the electronic device; device usage information, used to reflect the user's demand for devices in the electronic device; and sleep start and end times, used to characterize the historical sleep period of the electronic device.
[0039] In one possible implementation, at least one sleep strategy is obtained based on historical usage data, including: obtaining sleep duration parameters for each of the at least one sleep strategy based on sleep start and end times, wherein the sleep duration parameters are used to characterize the duration threshold for the sleep strategy to be effective; and obtaining the sleep strategy belonging to each of a plurality of devices in the electronic device based on device usage information. The plurality of devices includes a first device, a second device, and a third device.
[0040] In one possible implementation, the sleep strategy of each device is obtained based on device usage information, including: determining the power-down priority between devices based on device usage information; and indicating a corresponding sleep strategy for each device based on the power-down priority between devices.
[0041] In one possible implementation, the first sleep strategy includes at least one of the following: sleep strategy identifier, sleep duration parameter, power-off device information, sleep level, and wake-up state.
[0042] Thirdly, this application provides a computer-readable storage medium storing a computer program or instructions that, when executed by a processing device, implement the method described in the first aspect and any of the optional implementations of the first aspect.
[0043] Fourthly, a chip system is provided, the chip system including a processing circuit and a storage medium, the storage medium storing computer instructions; when the computer instructions are executed by the processing circuit, they implement the method as described in any possible embodiment of the first aspect.
[0044] Fifthly, this application provides a computer program product, which includes a computer program or instructions that, when executed by an electronic device, implement the method in the first aspect and any of the optional implementations of the first aspect.
[0045] The beneficial effects of aspects two through five above can be referred to the description of aspect one or any implementation thereof, and will not be repeated here. Based on the implementations provided in the above aspects, this application can be further combined to provide more implementations. Attached Figure Description
[0046] Figure 1 This is a schematic diagram illustrating the setup of a hybrid sleep mode in an exemplary embodiment.
[0047] Figure 2 A schematic diagram of an electronic device provided in an embodiment of this application;
[0048] Figure 3 A schematic diagram of the communication system used in the hybrid sleep method provided in the embodiments of this application;
[0049] Figure 4 A schematic diagram of the composition structure of the electronic device provided in the embodiments of this application;
[0050] Figure 5 A software structure block diagram of an electronic device provided in an embodiment of this application;
[0051] Figure 6 A schematic diagram of the functional modules of the electronic device provided in the embodiments of this application;
[0052] Figure 7 A schematic diagram illustrating the effect of the first interface provided in the embodiments of this application;
[0053] Figure 8 One of the flowcharts illustrating the hybrid sleep mode provided in the embodiments of this application;
[0054] Figure 9 A schematic diagram of the interface for setting the power saving mode provided in an embodiment of this application;
[0055] Figure 10 A second schematic flowchart illustrating the hybrid sleep mode provided in this application embodiment;
[0056] Figure 11 This is a schematic diagram illustrating the power consumption changes under hybrid sleep mode provided in an embodiment of this application.
[0057] Figure 12 This is one of the interactive diagrams between functional modules provided in the embodiments of this application;
[0058] Figure 13 This is the second schematic diagram illustrating the interaction between functional modules provided in the embodiments of this application;
[0059] Figure 14 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0060] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0061] The terms "comprising" and "having," and any variations thereof, used in the description of the embodiments of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.
[0062] Hereinafter, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature.
[0063] In this application, the terms "exemplarily" or "for example" are used to indicate that something is being described as an example, illustration, or illustration. Any embodiment or design described as "exemplarily" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.
[0064] In the description of the embodiments in this application, unless otherwise stated, "multiple" means two or more. "And / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone.
[0065] In some embodiments, when the electronic device is not in use by the user, it can enter a power-saving mode. This reduces the power consumption of the electronic device by cutting off the power supply to the components within it. These components include, but are not limited to, at least one of the following: memory, central processing unit (CPU), universal serial bus (USB), fingerprint sensor, wireless fidelity (WiFi), Bluetooth device, and touchpad. Optionally, the components may also include a system-on-a-chip (SoC) integrating memory, CPU, and other components.
[0066] Taking a certain operating system as an example, the power-saving modes provided by the operating system include at least the following sleep modes: S3 (suspend to ram, STR) sleep mode, S4 (suspend to disk, STD) hibernation mode, and hybrid sleep mode.
[0067] S3 sleep mode refers to a power-saving mode in electronic devices where components such as the CPU are powered off, while other components such as memory are powered on. In other words, in S3 sleep mode, some components in the electronic device are powered off, while others remain powered on. Optionally, these powered-on components operate at low power consumption, resulting in lower power consumption compared to when they are in active mode. When the electronic device is in S3 sleep mode, the memory remains powered on, and the device's runtime data is stored in memory. This runtime data is used to record the execution status of program instructions during normal use of the electronic device. Optionally, the runtime data includes at least one of the following: runtime context, instruction data, etc.
[0068] In this scenario, when a user performs a sleep-wake operation (e.g., opening the laptop lid to wake the device), the electronic device responds and exits S3 sleep mode. Since the memory and other components are not powered down, the running data remains in memory. Therefore, upon waking, the electronic device can directly use the running data in memory to begin working.
[0069] S4 hibernation mode refers to the power-saving mode in which electronic devices operate after the memory, CPU, and other components are powered off. Before switching to S4 hibernation mode, the operating data stored in memory needs to be backed up to non-volatile storage such as a hard drive to prevent data loss after power failure. Compared to S3 sleep mode, electronic devices consume less power in S4 hibernation mode. However, because waking up an electronic device from S4 hibernation mode requires restoring operating data from non-volatile storage to memory before it can use that data to begin working, waking up an electronic device from S4 hibernation mode may take longer than waking up from S3 sleep mode.
[0070] The names of S3 sleep mode and S4 hibernation mode may differ in different operating systems. S4 hibernation mode is the next level of power-saving mode after S3 sleep mode. During the same standby time of an electronic device, S4 hibernation mode consumes less power than S3 sleep mode. S3 sleep mode does not require backing up the running data in memory to non-volatile memory, while S4 hibernation mode requires backing up the data in memory to non-volatile memory beforehand.
[0071] In some embodiments, the hybrid sleep mode is a power-saving mode obtained by combining the S3 sleep mode and the S4 hibernation mode.
[0072] In one implementation, the hybrid sleep mode comprises two stages: the first stage is S3 sleep mode, and the second stage is S4 hibernation mode. After the electronic device enters hybrid sleep mode, it first powers down some components according to S3 sleep mode, while keeping other components such as memory powered on. This continues until the electronic device enters S4 hibernation mode. Optionally, the sleep duration is a preset time in the operating system. Of course, some operating systems also allow users to manually set the sleep duration in the configuration interface.
[0073] Figure 1 This is a schematic diagram illustrating the settings of the hybrid sleep mode provided in an embodiment of this application. Figure 1 As shown, a hybrid sleep control 12 is displayed in the sleep mode settings interface 10. When the electronic device detects a trigger operation on the hybrid sleep control 12, it sets the power-saving mode currently used by the electronic device to hybrid sleep mode. After saving this setting, if the electronic device needs to enter power-saving mode later, it will switch to hybrid sleep mode.
[0074] In the implementation described above, the S3 sleep mode in the hybrid sleep mode is singular, resulting in a fixed timing for the power-down or entry into low-power mode of each device in the electronic device. For any single device, it either powers down or enters low-power mode when the electronic device just enters the hybrid sleep mode, or it powers down or enters low-power mode before the transition from the first stage S3 sleep mode to the second stage S4 hibernation mode.
[0075] It is evident that for certain components, the electronic device needs to continuously supply power during the first stage of the hybrid sleep mode, resulting in higher power consumption during this stage and consequently higher overall power consumption for the hybrid sleep mode. These components include those that are underutilized or not used at all after the electronic device enters power-saving mode. For electronic devices with limited battery power, such as laptops, consuming significant power in hybrid sleep mode is detrimental to extending battery life, easily causing battery anxiety for users, and negatively impacting the user experience.
[0076] To address the aforementioned issues, this application provides a hybrid sleep method. In this solution, the hybrid sleep mode supports the electronic device gradually powering down or entering a low-power mode to adjust its sleep state. In some embodiments, when the electronic device receives an instruction or automatically enters sleep mode, it controls some devices to power down or enter a low-power mode. Subsequently, when the sleep duration of the electronic device meets the sleep conditions, the electronic device controls at least one of the other devices (excluding the aforementioned devices) to power down or enter a low-power operating mode. This continues until the electronic device enters hibernation mode. Optionally, the electronic device is configured with at least one sleep strategy. For an electronic device in hybrid sleep mode, in response to a sleep interruption instruction, the electronic device selects a first sleep strategy from at least one sleep strategy that matches the sleep interruption information, and power-offs a first device according to the first sleep strategy, thereby adjusting the sleep state of the electronic device. By flexibly configuring the first device, a more flexible sleep strategy implementation is achieved.
[0077] In some embodiments, the hybrid sleep method provided in this application is applied to an electronic device 100.
[0078] Optionally, the electronic device 100 is a terminal device such as a laptop computer, personal computer, wearable device, in-vehicle terminal, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), artificial intelligence (AI) device, etc., and the operating system installed on the electronic device 100 includes, but is not limited to, those that... Or other operating systems.
[0079] In some embodiments, the electronic device 100 triggers sleep mode upon detecting a sleep operation by the user control device or upon not receiving any user operation within a preset time range. The electronic device puts a first device into a low-power mode or powers it down, entering an initial sleep state. Subsequently, in response to a second sleep condition being met, the electronic device triggers a second device into a low-power mode or powers it down to enter a new sleep state. That is, during the sleep process of the electronic device, the device is triggered to enter a low-power mode or powers it down at least once, gradually entering a lower-power sleep state, ultimately reaching a lower-power sleep state.
[0080] Optionally, the gradual entry into a low-power mode or power-down of devices in electronic device 100 is indicated by at least one sleep policy stored in electronic device 100. This at least one sleep policy is generated by electronic device 100.
[0081] Alternatively, at least one sleep strategy is provided by the server to the electronic device 100. In this case, the hybrid sleep method can also be applied to communication systems, such as... Figure 3 As shown, the communication system includes server 200 and Figure 2 Electronic devices 100.
[0082] For information on electronic devices, please refer to 100. Figure 2 Corresponding instruction manual examples.
[0083] Server 200 is a device or server with computing capabilities, such as a cloud server or a network server. Server 200 can be a single server, a server cluster consisting of multiple servers, or a cloud computing data center. For example, server 200 is a backend server for software. If the software used to implement this sleep strategy method is integrated into an operating system, then server 200 is a cloud server providing backend support for the operating system.
[0084] In some embodiments, the sleep policy is provided by the server 200 to the electronic device 100. Optionally, the server 200 obtains historical usage data sent by the electronic device 100 and obtains at least one sleep policy based on the historical usage data. Then, the server 200 sends the at least one sleep policy to the electronic device 100. Correspondingly, the electronic device 100 receives the at least one sleep policy. The electronic device can select a suitable sleep policy from the at least one sleep policy and obtain sleep conditions based on the sleep policy. When the sleep conditions are met, the electronic device triggers at least one device to power down or enter a low-power mode, allowing the electronic device to gradually enter a lower-power sleep state, thereby achieving more flexible sleep management.
[0085] For example, Figure 4 A schematic diagram of the structure of the electronic device 100 is shown. For example... Figure 4 As shown, the electronic device 100 includes at least the following components: processor 110, memory 120, communication module 130, charging management module 140, power management module 141, battery 142, and display screen 150.
[0086] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware. Optionally, Figure 4 Each component mentioned in the corresponding embodiment has its own power transmission path, and the electronic device 100 can provide the corresponding power transmission path to realize the power-off and power-on of the components.
[0087] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0088] The memory 120 includes at least one of the following: an external memory card and internal memory. The external memory card communicates with the processor 110 through an external memory interface to implement data storage functions. The memory 120 can store data created or generated during the use of the electronic device 100 (such as audio data, phonebooks, etc.). The internal memory may include high-speed random access memory and non-volatile memory. For example, at least one disk storage device, flash memory device, universal flash storage (UFS), etc. After entering a hybrid sleep state, the electronic device 100 needs to transfer the data in the internal memory to non-volatile memory (such as a hard disk) to prevent the data stored in the memory from being permanently lost after the memory is powered off.
[0089] The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in internal memory and / or instructions stored in memory set in the processor.
[0090] The communication module 130 may include a mobile communication module and a wireless communication module, used to realize data transmission and reception between the electronic device 100 and the server 200. Optionally, the mobile communication module, the wireless communication module, and the antenna jointly realize the wireless communication function.
[0091] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via a USB interface. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.
[0092] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, memory 120, communication module 130, and display screen 150, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.
[0093] In some embodiments, the electronic device 100 obtains at least one sleep policy from the server 200 via the communication module 130. The at least one sleep policy is stored in the memory 120 to execute the hybrid sleep method provided in the embodiments of this application.
[0094] The following is an introduction Figure 2 The software architecture of the electronic device 100. Optionally, the software system of the electronic device 100 adopts a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture.
[0095] This application uses the layered architecture of the Android system as an example to illustrate the software structure of the electronic device 100. Figure 5 This is a software structure block diagram of an electronic device provided in an embodiment of this application. The electronic device is... Figure 2 The electronic device 100 in the system. A layered architecture divides the software into several layers, each with a clear role and function. Optionally, layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0096] The application layer can include a series of application packages.
[0097] like Figure 5 As shown, the application package includes at least one of the following: camera, gallery, calendar, call, map, navigation, wireless fidelity (WLAN), Bluetooth, music, video, SMS, and other applications.
[0098] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0099] like Figure 5 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, sleep adjustment module, sleep decision module, etc. Optionally, the application framework layer may also include functional modules from the electronic device 100.
[0100] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0101] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.
[0102] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon might include views for displaying text and views for displaying images.
[0103] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).
[0104] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and so on.
[0105] The notification manager allows applications to display notification information in the status bar to convey informational messages. Optionally, the message disappears automatically after a short pause, without user interaction.
[0106] The sleep decision module 610 is used to acquire sleep conditions in order to determine the power-down timing of devices in the electronic device under a hybrid sleep mode. Optionally, the sleep conditions are acquired based on a sleep strategy. The sleep strategy instructs the electronic device to trigger at least one device to enter a low-power mode or power down. Optionally, the sleep strategy module 610 selects a sleep strategy from at least one sleep strategy, acquires the corresponding sleep conditions based on the selected sleep strategy, and determines the timing of the device indicated by the selected sleep strategy entering a low-power mode or powering down based on the sleep conditions.
[0107] The sleep adjustment module 620 is used to power down at least one device corresponding to a sleep condition when the sleep condition is met. Subsequently, the CPU of the electronic device is powered down, and the electronic device enters a new sleep state. Optionally, the at least one device corresponding to the sleep condition is preset, and different devices correspond to different sleep conditions.
[0108] For example, such as Figure 6As shown, during the sleep process of the electronic device, the sleep decision module 610 and the sleep adjustment module 620 operate cyclically. For example, after the sleep strategy module 610 obtains sleep conditions according to the sleep strategy, the sleep adjustment module 620 powers down the devices corresponding to the sleep conditions, and the electronic device enters a new sleep state. When the sleep conditions are met, the sleep decision module 610 is woken up by a clock to update the sleep adjustment, and then the sleep adjustment module 620 powers down the devices corresponding to the updated sleep conditions. This cycle repeats, gradually increasing the number of powered-down devices in the electronic device, thus continuously reducing the power consumption of the electronic device.
[0109] In some embodiments, the application framework layer further includes at least one of the following: a policy storage module, a data collection module, and a policy generation module.
[0110] The policy storage module stores at least one selectable sleep policy under the hybrid sleep mode. For each of the at least one sleep policy, the sleep policy indicates a sleep condition and at least one device to be powered off corresponding to that sleep condition. The data collection module collects historical usage data. This historical usage data characterizes the user's usage habits of the electronic device 100. Historical sleep data includes, but is not limited to, at least one of the following: device usage duration, device usage time period, historical wake-up time, and historical wake-up method.
[0111] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
[0112] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0113] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection. System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (such as OpenGL ES), 2D graphics engines (such as SGL), etc.
[0114] The Surface Manager is used to manage the display subsystem and provides fusion of two-dimensional (2D) and three-dimensional (3D) layers for multiple applications.
[0115] The media library supports playback and recording of various commonly used audio and video formats, as well as still image files. It supports multiple audio and video coding formats, such as: Moving Picture Experts Group 4 (MPEG4), Advanced Video Coding (H.264), Moving Picture Experts Group Audio Layer III (MP3), Advanced Audio Coding (AAC), Adaptive Multi Rate (AMR), Joint Photographic Experts Group (JPG), and Portable Network Graphics (PNG).
[0116] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing. The 2D graphics engine is the drawing engine for 2D drawing.
[0117] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0118] In some embodiments, the hybrid sleep method is composed of Figure 2 The electronic device 100 comprises functional modules. These functional modules are located within a software architecture. Optionally, the various functional modules involved in the embodiments of this application are arranged in... Figure 5 In the application architecture layer shown.
[0119] The hybrid sleep method provided in the embodiments of this application will now be described.
[0120] First, the process of obtaining the sleep strategy is introduced. In order to make the hybrid sleep mode more adaptable to the user's habits of using electronic devices, and to ensure the user experience while saving power, at least one sleep strategy is obtained based on the historical usage data generated during the user's use of electronic devices.
[0121] Optionally, the sleep policy can be personalized for the user or pre-set. For example, developers can set a shared sleep policy for various electronic devices in a region, or a shared sleep policy for a certain type of group of people. Exemplarily, the sleep policy is generated by the electronic device or a server; the following description uses the electronic device as the executing entity to illustrate this process. The process of obtaining the sleep policy includes the following steps:
[0122] Step S10: Obtain historical usage data of the electronic device.
[0123] Historical usage data is used to characterize the historical usage of electronic devices. For example, historical usage data is used to record a user's use of electronic devices during a first historical period.
[0124] Optionally, historical usage data may include at least one of the following: device usage time period, device usage information, and sleep start and end times.
[0125] The device usage period is used to characterize the historical usage time of electronic devices. For example, the device usage period includes the historical usage time of electronic devices every day during January and February. The historical usage period is the time period from when the electronic device is turned on until when the electronic device is turned off or enters power-saving mode. For example, if an electronic device is turned on at 8:00 and turned off at 12:00, then 8:00-12:00 is the historical usage period of the electronic device for that day.
[0126] Among them, the device usage information is used to reflect the user's usage requirements for various devices in electronic devices.
[0127] In some embodiments, the electronic device includes internal devices and external devices. Optionally, the internal devices include at least one of the following: CPU, memory, WiFi, touchpad, system-on-chip (SoC), and Bluetooth (BT). Optionally, the external devices include at least one of the following: external writing devices (such as mouse, keyboard), external storage devices (such as USB flash drive), and external playback output devices (headphones, speakers, etc.).
[0128] Optionally, for each component of the electronic device, a power transmission path is provided between the battery of the electronic device and that component. When the power transmission path is connected, the component is powered on and can operate normally; when the power transmission path is disconnected, the component is powered off and cannot operate thereafter, thus generating no power consumption. In other words, when a component in the electronic device is powered on, it is energized; when it is powered off, it is de-energized.
[0129] In some embodiments, device usage information includes at least one of the following: device identifier, device usage period, device usage frequency, etc. The device identifier indicates a device that is needed during the operation of the electronic device; the device usage period reflects the time during which the user habitually uses the device; and the device usage frequency reflects the degree of reliance the user has on the functions provided by the device.
[0130] Optionally, the frequency of device usage is positively correlated with the number of times the device is used and negatively correlated with the power-on duration of the device. The number of times the device is used is related to user operations. For example, if the function corresponding to the first user operation requires the device to be implemented, then the number of times the device is used increases by one for each occurrence of the first user operation.
[0131] Among them, the sleep start and end times are used to characterize the first historical moment when the electronic device enters the sleep state and the second historical moment when the sleep state is interrupted.
[0132] In some embodiments, the electronic device obtains historical usage data through system logs. For example, the electronic device retrieves historical usage data for a first historical period from the system logs. Exemplarily, the first historical period is a week, a month, a quarter, a year, etc.
[0133] In some embodiments, step S10 is performed by a data collection module in the electronic device. Optionally, the data collection module acquires historical usage data of the electronic device every first historical cycle, so as to periodically update the sleep strategy based on the historical usage data.
[0134] The following describes the process of generating sleep strategies based on user habits.
[0135] In step S20, the electronic device obtains at least one sleep strategy based on historical usage data.
[0136] In the hybrid sleep method provided in this application embodiment, the electronic device is supported in gradually powering down its components in a hybrid sleep mode to achieve automatic adjustment of the sleep state. Optionally, the electronic device gradually adjusts to a lower power consumption sleep state according to at least one sleep strategy.
[0137] First, sleep strategies are introduced. At least one sleep strategy is employed by the electronic device in a hybrid sleep mode. Optionally, the at least one sleep strategy includes a first type of sleep strategy, each corresponding to a sleep state. For example, the at least one sleep strategy also includes a second type of sleep strategy, corresponding to a hibernation state. Optionally, in the hybrid sleep mode, the electronic device gradually powers down based on the instruction of the at least one sleep strategy. This causes the electronic device to experience at least two sleep states before finally reaching a hibernation state.
[0138] In some embodiments, the sleep strategy is used to power down at least one device required to enter the sleep state corresponding to the sleep strategy. Optionally, the sleep strategy is also used to determine sleep conditions so that, when the sleep conditions are met, the electronic device is triggered to adjust to a new sleep state.
[0139] Optionally, for each of the at least one sleep strategy, the sleep strategy includes at least one of the following: sleep strategy identifier, sleep duration parameter, power-off device information, sleep level, and device wake-up status.
[0140] The sleep policy identifier is used to identify the sleep policy. For example, the sleep policy is a sequence number. Optionally, at least one sleep policy includes multiple sleep policies with a selection order. The electronic device can determine the selection order among the multiple sleep policies through the sleep policy identifier. For example, the selection order of the sleep policy corresponding to the smaller sequence number is higher than the selection order of the sleep policy corresponding to the larger sequence number. Or, for example, the selection order of the sleep policy corresponding to the larger sequence number is higher than the selection order of the sleep policy corresponding to the smaller sequence number.
[0141] The sleep duration parameter is used to indicate the duration of the sleep state corresponding to the sleep strategy.
[0142] Optionally, the sleep duration parameter characterizes the duration from when the electronic device enters the sleep state corresponding to the sleep strategy until when it exits that sleep state. For example, a sleep duration parameter of 1 hour means that the electronic device exits the sleep state 1 hour after entering the sleep state corresponding to the sleep strategy. In other words, the sleep duration parameter characterizes the effective duration of the sleep strategy. When the effective duration of the sleep strategy is greater than or equal to the sleep duration parameter, the electronic device selects a new sleep strategy from at least one sleep strategy, and under the instruction of the new sleep strategy, shuts down the device, thereby entering a new sleep state or hibernation state.
[0143] Optionally, the sleep duration parameter is used to characterize the time span from when the electronic device enters the mixed sleep mode to when it ends the sleep state indicated by the sleep strategy. For example, if the sleep duration parameter in a certain sleep strategy includes 2 hours, and the electronic device enters the mixed sleep mode at 15:00, then the electronic device ends the sleep state corresponding to the sleep strategy at 17:00.
[0144] Power-down device information is used to indicate at least one device whose power consumption needs to be reduced. When the electronic device is in a sleep state corresponding to a sleep strategy, the at least one device switches to a low-power mode or indicates that the at least one device should be powered down. The low-power mode consumes less power than the device's operating mode.
[0145] In other words, during the sleep state corresponding to the sleep strategy of the electronic device, at least one device operates in a low-power mode, or the at least one device is powered off and no longer generates power.
[0146] In some embodiments, the power consumption reduction method for each device is preset. The power consumption reduction method is either entering a low-power mode or powering off. For example, device 1 reduces power consumption by entering a low-power mode, and device 2 reduces power consumption by powering off. For sleep strategy 1 in at least one sleep strategy, the power-off device information in sleep strategy 1 indicates that when the electronic device is in the sleep state corresponding to the sleep strategy, device 1 is in low-power mode, and device 2 is powered off.
[0147] Optionally, entering a low-power mode is used to control the device to reduce its power consumption from a first power consumption to a second power consumption. The second power consumption is less than the first power consumption.
[0148] In other embodiments, the power-down device information includes at least one power-saving method for each of the devices.
[0149] Optionally, the power-down device information includes a device identifier for each of the at least one device. The device identifier includes at least one of the following: device name or device number. For example, for each of the at least one device, the power-down device information includes the power-saving mode corresponding to that device. For instance, the power-down device information includes: Device 1, power-down; Device 2, enters low-power mode.
[0150] Sleep levels are used to characterize the sleep level corresponding to a sleep strategy. Sleep levels can determine whether there are devices in an electronic device that have not yet reduced power consumption. Optionally, sleep levels may include at least the following categories: S3 sleep, S4 hibernation.
[0151] S3 sleep indicates that at least one device in the electronic device is not reducing power consumption, and the electronic device is in a sleep state. For example, if a sleep strategy has a sleep level of S3 sleep, it means that after the electronic device controls the device indicated by the power-down device information in the sleep strategy to enter a low-power mode or power down, there is still at least one device in the electronic device that has not reduced power consumption. Subsequently, the electronic device triggers the power-down of the at least one device that has not been powered down, so as to enter a lower-power sleep state or hibernation state.
[0152] S4 sleep mode is used to indicate that there are no devices in the electronic device that are not yet powered off.
[0153] Device wake-up state is used to characterize the physical form of an electronic device after the sleep state corresponding to a sleep strategy ends. For example, if the electronic device is a laptop and the sleep interruption information is "closed," then after being woken up from sleep, the laptop is in a closed state. For instance, the side of the laptop where the screen is located is closed with the side where the keyboard is located.
[0154] In one example, the sleep policy includes a sleep policy identifier, sleep duration parameters, power-off device information, sleep level, and device wake-up state. Devices that are powered off during sleep mode include: USB, fingerprint sensor, WiFi, SoC, touchpad, and Bluetooth. These devices enter low-power modes in stages during the hybrid sleep mode, or are powered off. At least one sleep policy is shown in Table 1.
[0155] Table 1
[0156] Sleep strategy label Sleep duration parameters Information on power supply components Sleep Level Sleep interruption information 1 1 hour USB S3 Sleep Close the lid 2 2 hours Fingerprint, WiFi S3 Sleep Close the lid 3 3 hours SoC, touchpad, Bluetooth S3 Sleep Close the lid 4 NA (infinity) NA (infinity) S4 hibernation Close the lid
[0157] As shown in Table 1, at least one sleep strategy includes sleep strategy 1, sleep strategy 2, sleep strategy 3, and sleep strategy 4. Taking sleep strategy 1 as an example, as shown in the second row of Table 1, sleep strategy 1 has a sleep strategy identifier of "1", a sleep duration parameter of "1 hour", power-off device information used to indicate triggering the USB to enter low power mode or power off, a sleep level of "S3 sleep", and a sleep interrupt information of "close lid".
[0158] In some embodiments, at least one sleep strategy includes multiple sleep strategies, and there is a selection order among the multiple sleep strategies. The electronic device selects a sleep strategy from the at least one sleep strategy according to the selection order and triggers the device indicated by the selected sleep strategy to enter a low-power mode or power down.
[0159] Optionally, the devices indicated by at least one sleep strategy are not duplicated. For example, for sleep strategy 1 and sleep strategy 2 in at least one sleep strategy, sleep strategy 1 is used to instruct n devices to enter a low-power mode or be powered down, and sleep strategy 2 is used to instruct m devices to enter a low-power mode or be powered down, where n and m are positive integers, and the m devices do not overlap with the n devices. If sleep strategy 1 is used in priority over sleep strategy 2, then when the electronic device is in the sleep state corresponding to sleep strategy 2, both the aforementioned n devices and m devices are already in a low-power mode or powered down.
[0160] For example, at least one sleep strategy is one of the four sleep strategies included in Table 1, and the selection order of these four sleep strategies is as follows: selected from largest to smallest sleep strategy identifier. After the electronic device enters hybrid sleep mode, the USB is powered off first, followed by the fingerprint device and WiFi. Then, the SoC is triggered to enter low-power mode, and the touchpad and Bluetooth are powered off. Finally, all components in the electronic device are powered off or operate in low-power mode. The electronic device remains in sleep mode unless interrupted by user operation.
[0161] In some embodiments, at least one sleep strategy includes multiple sleep strategies, among which there is an initial sleep strategy and a final sleep strategy. The initial sleep strategy is the first sleep strategy used by the electronic device to enter the hybrid sleep mode, and the final sleep strategy is the last sleep strategy used by the electronic device in the hybrid sleep mode. Optionally, the final sleep strategy does not include a sleep duration parameter, or the sleep duration parameter in the final sleep strategy is infinite.
[0162] Taking Table 1 as an example, the sleep strategy marked as "1" in Table 1 is the initial sleep strategy, and the sleep strategy marked as "4" in Table 1 is the final sleep strategy.
[0163] For example, the sleep level in the terminal hibernation strategy is S4 hibernation, while the sleep level in other sleep strategies is S3 sleep.
[0164] Thus, by setting a selection order among multiple sleep strategies, the electronic device uses each sleep strategy according to the selection order. Since the electronic device only uses a sleep strategy with a higher selection order after the device is powered down, the device indicated by the higher-order sleep strategy is already in low-power mode or powered down before the device is triggered to enter low-power mode or power down by the lower-order sleep strategy. This avoids duplication of devices indicated by the higher-order sleep strategy and the lower-order sleep strategy. Since the number of devices in the electronic device is prioritized, avoiding different sleep strategies indicating the same device helps reduce the amount of data related to the powered-down device in the lower-order sleep strategy.
[0165] Furthermore, this method eliminates the need for the electronic device to detect whether it is already in a low-power mode or powered off before triggering the sleep strategy instruction to enter a low-power mode or power down. This simplifies the execution logic of the electronic device controller entering a low-power mode or powering down, thereby improving the efficiency of this process.
[0166] The process of generating at least one sleep strategy based on historical usage data is described below.
[0167] Optionally, historical usage data may include the device usage time period, device usage information, and sleep start and end times of electronic devices.
[0168] In some embodiments, the electronic device obtains at least one sleep strategy based on historical usage data, including: the electronic device determining a sleep duration parameter of at least one sleep strategy based on the sleep start and end times; the electronic device obtaining the power-down priority of multiple devices based on device usage information; and the electronic device obtaining at least one sleep strategy based on the power-down priority among the multiple devices.
[0169] Power-down priority is used to characterize the order in which multiple devices in an electronic device enter low-power mode or power down. Devices with higher power-down priority are powered down earlier than those with lower power-down priority.
[0170] Because the types of low-frequency components vary among different users' electronic devices—for example, some users rarely use Bluetooth, while others use it frequently—for the former, triggering Bluetooth to enter low-power mode or power off as early as possible in hybrid sleep mode has a relatively small impact on user experience and can effectively reduce power consumption. However, for the latter, powering off Bluetooth too early in hybrid sleep mode may prevent users from waking up the device using a wireless mouse or keyboard. Therefore, customizing at least one sleep strategy for each user based on historical usage data helps to accurately determine the actual power-off time for each component in the electronic device.
[0171] In this way, at least one sleep strategy is generated using historical usage data, allowing this strategy to adapt to the user's usage habits. In hybrid sleep mode, less frequently used devices are prioritized for power-down, reducing their on-time. This not only helps reduce the power consumption of electronic devices but also improves the alignment between the electronic device's sleep state and the user's device usage habits in hybrid sleep mode.
[0172] Optionally, the electronic device determines the sleep duration parameter of at least one sleep strategy based on the sleep start and end times, including: the electronic device obtaining the historical sleep duration of the electronic device based on the sleep start and end times; the electronic device dividing the average sleep duration to obtain the sleep duration parameter of at least one sleep strategy.
[0173] For example, the sleep start and end times include the first historical moment and the second historical moment within any day in the first historical cycle; for each day's sleep start and end times, the electronic device obtains the historical sleep duration for that day by subtracting the first historical moment from the second historical moment; the electronic device averages the historical sleep duration for each day to obtain the historical sleep duration.
[0174] If a day includes multiple first historical moments and multiple second historical moments, it means that the electronic device entered a sleep state multiple times on that day. The electronic device determines the historical sleep duration of each sleep state based on the corresponding first and second historical moments, and averages the historical sleep durations of multiple sleep states to obtain the historical sleep duration for that day. Alternatively, the electronic device may ignore the sleep start and end information for that day.
[0175] For example, an electronic device divides the average sleep duration and obtains sleep duration parameters for at least one sleep strategy, including: the electronic device divides the average sleep duration into k equal parts to obtain sleep duration parameters for k sleep strategies, where k is a positive integer. In this case, the duration of the sleep state corresponding to each sleep strategy is equal.
[0176] In another possible implementation, the sleep duration parameter is pre-configured. For example, electronic devices may default to at least one sleep strategy with a sleep duration parameter of 30 minutes, 1 hour, etc. This approach helps reduce the computational burden during the sleep strategy generation process.
[0177] Optionally, the electronic device obtains the power-down priority among multiple devices based on device usage information, including: the electronic device sorts the devices according to their usage frequency to obtain the power-down priority among multiple devices. Devices with higher usage frequency have lower power-down priority, and devices with lower usage frequency have higher power-down priority.
[0178] Optionally, the electronic device obtains at least one sleep strategy based on the power-down priority among multiple devices, including: the electronic device determines the sleep strategy to which each device belongs according to the power-down priority among multiple devices. Devices with higher power-down priority are assigned to sleep strategies with higher selection priority; devices with lower power-down priority are assigned to sleep strategies with lower selection priority.
[0179] For example, if at least one sleep strategy includes k sleep strategies and the electronic device includes j devices, then the electronic device will distribute the j devices equally among the k sleep strategies according to the power-down priority. Each sleep strategy will include at most j / k (the entire number of devices) and at least j%k (the number of devices), where j and k are positive integers. Here, " / " represents j divided by k and rounded down, and "%" represents j divided by k and rounded down.
[0180] Therefore, determining the sleep strategy for a device based on its power-down priority helps instruct electronic devices to prioritize reducing the power consumption of devices used less frequently. Since users have low reliance on such devices, triggering them to enter low-power mode or power down first helps reduce their power consumption without affecting the user's use of the electronic device.
[0181] To improve the adaptability of sleep strategies to users' device usage habits, after assigning devices to corresponding sleep strategies, electronic devices adjust the sleep strategies of some devices.
[0182] In some embodiments, for each of the multiple devices, the electronic device obtains a reasonable value for the sleep strategy to which the device belongs based on historical usage data, and adjusts the sleep strategy to which the device belongs if the reasonable value meets the modification conditions.
[0183] Optionally, the electronic device determines the reasonable value of the current sleep strategy of the device based on historical usage data, including: the electronic device obtains the strategy usage period corresponding to the sleep strategy based on the sleep start and end time and sleep duration parameters; the electronic device obtains the reasonable value corresponding to the device based on the overlap between the device usage period and the strategy usage period corresponding to the sleep strategy.
[0184] For example, for the historical usage data of each day in the first historical period, the electronic device obtains the policy usage period corresponding to the sleep strategy based on the first historical time and the sleep duration parameter. If the sleep strategy is the sleep strategy selected first in the order of at least one sleep strategy, the electronic device determines the policy usage period corresponding to the sleep strategy as the period from the first historical time to the sum of the first historical time and the sleep duration parameter.
[0185] If there is a sleep strategy with higher priority in the selection order before the sleep strategy, such as the sleep strategy to which the device belongs is the i-th selected sleep strategy among multiple sleep strategies, the electronic device adds the first historical time to the sleep duration parameters included in the first i-1 sleep strategies to obtain the start time of the sleep strategy. It adds the start time to the sleep duration parameter in the i-th sleep strategy to obtain the stop time. The time period from the start time to the stop time is the strategy usage period corresponding to the i-th sleep strategy, where i is a positive integer.
[0186] For example, the electronic device obtains a reasonable value for the device based on the overlap between the device's usage period and the policy usage period corresponding to the sleep policy, including: for each day in the first historical period, if the device's usage period on that day is earlier than the policy usage period corresponding to the sleep policy, the reasonable number of days is increased by 1; if the device's usage period on that day overlaps with the policy usage period corresponding to the sleep policy, the reasonable number of days is not increased; the reasonable number of days used by the electronic device is divided by the total number of days included in the first historical period to obtain the reasonable value corresponding to the device.
[0187] In some embodiments, the modification condition is that the reasonable value corresponding to the device is less than or equal to a reasonable threshold. Optionally, if the reasonable value corresponding to the device is greater than the reasonable threshold, it is not necessary to adjust the sleep strategy to which the device belongs.
[0188] Optionally, if the reasonable value corresponding to a device is less than or equal to a reasonable threshold, the sleep strategy to which the device belongs needs to be adjusted. For example, the electronic device may assign the device to a sleep strategy with a later selection order.
[0189] Optionally, the reasonable threshold can be preset, such as 0.9, 0.8, 0.7, etc. For example, the reasonable threshold is equal to 0.9. In this way, setting a higher reasonable threshold helps to improve the adaptability of the sleep strategy generated based on historical usage data to the user's device usage habits and reduces the interference caused by the hybrid sleep method to the user's normal use of electronic devices.
[0190] In one possible implementation, the process of obtaining at least one sleep policy based on historical usage data is performed by the server. Optionally, the electronic device obtains a policy generation request based on historical usage data; the electronic device sends the policy generation request to the server; the server obtains at least one sleep policy based on the policy generation request and sends at least one sleep policy to the electronic device.
[0191] The policy generation request is used to request the generation of a sleep policy. Optionally, the policy generation request includes historical usage data of the electronic device. For example, the server generates at least one sleep policy based on data statistics.
[0192] Optionally, the step of the server obtaining at least one sleep policy is similar to the step of the electronic device obtaining at least one sleep policy. Please refer to the sleep policy acquisition process for electronic devices described above for details; it will not be repeated here.
[0193] For example, the server inputs historical usage data into a large model, and the large model outputs at least one sleep policy. In this way, by leveraging the server's computing power to generate sleep policies using a large model, it is helpful to generate sleep policies that are more in line with user habits based on historical usage data.
[0194] To enhance the ability of sleep strategies to adapt to changes in user habits, the method provided in this application supports periodic updates to sleep strategies. In some embodiments, the electronic device periodically acquires historical usage data and obtains at least one updated sleep strategy based on the updated historical usage data. Optionally, the electronic device periodically reports historical usage data to a server so that the server can obtain an updated sleep strategy based on the historical usage data after acquiring it.
[0195] Optionally, if the updated sleep strategy is inconsistent with the previous sleep strategy, the electronic device applies the updated sleep strategy.
[0196] In one example, at least one sleep policy includes: sleep policy 1, sleep policy 2, and sleep policy 3; if the updated at least one sleep policy includes: sleep policy 1, sleep policy 2', and sleep policy 3, then the electronic device replaces sleep policy 2 with sleep policy 2'. Figure 7 As shown, the electronic device displays sleep strategy 2' on the first interface. Figure 7 The 710 in the text replaces the display sleep strategy 2. The first interface is the lock screen of the electronic device, the desktop of the electronic device, or the application interface.
[0197] In some embodiments, the electronic device displays at least one sleep policy on a first interface. Optionally, the first interface also displays a second control for editing the sleep policy, and the electronic device edits at least one sleep policy in response to triggering the second control. For example, in response to triggering the second control, the electronic device adds a device identifier to or deletes a device identifier from the power-off device information of a certain sleep policy to adjust the sleep policy of the device.
[0198] The operations that trigger the second control include, but are not limited to, clicks, swipes, double-clicks, and other operations performed on the second control.
[0199] This allows users to specify power-down conditions for devices through sleep strategies, enabling the sleep strategies to quickly respond to user needs. For example, when an electronic device's battery is low, the user can add the device identifiers of most devices to the power-down device information in the initial sleep strategy. This ensures that when the electronic device enters a hybrid sleep mode, some essential devices remain in low-power operation while the remaining devices are powered down, effectively reducing power consumption in hybrid sleep mode and extending the device's usability as much as possible. The following example illustrates this. Figure 8 Taking an example, the hybrid sleep method provided in this application will be specifically described. The hybrid sleep method consists of... Figure 2 The electronic device 100 performs the operation. In this embodiment, the functional modules included in the electronic device 100 include at least the following: Figure 5 The sleep decision-making module and sleep adjustment module in the system. For example... Figure 8 As shown, the hybrid sleep method provided in this application includes steps S810 to S840.
[0200] In step S810, in response to the sleep operation of the control device, the electronic device triggers the initial device to enter a low-power mode or power down. The sleep operation of the control device is used to instruct the electronic device to enter a power-saving mode. The power-saving mode is a low-power standby mode for the electronic device, used to reduce standby power consumption during idle periods when the electronic device is used less frequently.
[0201] Optionally, the operation to control the device to sleep is triggered by the user, or automatically triggered if the duration for which the electronic device has not received user input reaches a first duration threshold. For example, the first duration threshold is preset, such as 5 minutes, 10 minutes, 30 minutes, or 1 hour.
[0202] In some embodiments, after the electronic device enters a power-saving mode, the electronic device triggers at least one device of the electronic device to power down or enter a low-power mode, and then the electronic device enters a sleep state or hibernation state.
[0203] The sleep state reflects the power-on status of various components in an electronic device. The power-on status of these components differs depending on the sleep state. The hibernation state represents the lowest power consumption state for the electronic device; in this state, almost all components are either powered off or in a low-power mode. Optionally, the power-on status of a component can be: powered on, low-power powered on, or powered off.
[0204] In some embodiments, the power-saving mode includes the following optional modes: S3 sleep mode, S4 hibernation mode, hybrid sleep mode, etc.
[0205] Optionally, the power-saving mode used by the electronic device is pre-configured in the operating system. That is, after the operating system is installed on the electronic device, the power-saving mode it uses is predetermined. For example, the operating system may pre-configure the electronic device to use a hybrid sleep mode for standby.
[0206] For example, the power-saving mode applied by the electronic device is configured by the user.
[0207] like Figure 9 As shown, the electronic device displays a first interface 900; in response to an operation that triggers a first control on the first interface 900, the electronic device sets the application of a hybrid sleep mode. Optionally, the first interface also displays at least one sleep strategy 910 so that the user can clearly understand the sleep states that the electronic device may experience in the hybrid sleep mode.
[0208] Thus, allowing users to set the power-saving mode of electronic devices according to their usage habits helps improve the adaptability of electronic devices to user habits. The initial device is the first device in the electronic device to power down or enter a low-power mode during hybrid sleep mode. The initial device corresponds to the first device in the claim.
[0209] Optionally, the initial device is indicated by an initial sleep strategy in at least one sleep strategy.
[0210] For example, in response to an operation to control the device to sleep, the electronic device obtains an initial sleep policy from at least one sleep policy; the electronic device determines at least one initial device through the power-down device information in the initial sleep policy; the CPU controls the power transmission path between the first initial device and the battery to disconnect, thereby powering down the first initial device; and / or the CPU controls the second initial device to enter a low-power mode. Wherein, the first initial device is an initial device whose power reduction method is power-down, and the first initial device is an initial device whose power reduction method is entering a low-power operation mode. The initial devices include at least one of the first initial device and the second initial device.
[0211] For example, after at least one initial device has entered a low-power mode or power-down is complete, the CPU of the electronic device is powered down, and the electronic device enters an initial sleep state.
[0212] For example, the initial sleep strategy corresponds to the initial sleep state, in which at least one initial device is powered off or in a low-power mode when the electronic device is in the initial sleep state.
[0213] In some embodiments, step S810 is performed by the policy storage module and Figure 5 The sleep decision module in the system works in concert. In response to the operation of controlling the device to sleep, the sleep decision module retrieves an initial sleep policy from at least one sleep policy stored in the policy storage module. Subsequently, the sleep policy module triggers either a power-down initial device or an initial device to enter a low-power mode according to the initial sleep policy, so that the electronic device enters an initial sleep state.
[0214] Optionally, step S810 is performed after step S10.
[0215] For example, step S810 is an optional execution step in this solution. If at least one sleep policy has been acquired, the hybrid sleep method begins execution from step S810 for electronic devices that have not entered hybrid sleep mode; for electronic devices that are currently in hybrid sleep mode, the hybrid sleep method begins execution from step S820.
[0216] The following examples illustrate how electronic devices trigger devices to enter low-power modes or power down in a hybrid sleep mode.
[0217] Step S820: Obtain sleep conditions.
[0218] In some embodiments, sleep conditions are used to trigger the device to enter a low-power mode or power down.
[0219] Optionally, when the sleep conditions are met, the electronic device triggers at least one device corresponding to the sleep conditions to enter a low-power mode or power down. Accordingly, the sleep state of the electronic device changes. When the sleep conditions are not met, the electronic device maintains its current sleep state, and the power-on state of each device in the electronic device remains unchanged.
[0220] Optionally, the sleep conditions include a first sleep condition and a second sleep condition.
[0221] The first sleep condition is used to trigger step S810. Optionally, the first sleep condition includes: detecting a sleep operation of the user control device or not receiving a user operation within a preset time range. For example, step S810 is triggered if the duration of not receiving a user operation exceeds the preset time range. The duration of not receiving a user operation is counted from the start of the last detected user operation.
[0222] In some embodiments, the second sleep condition is related to the duration of the sleep state.
[0223] Optionally, different sleep states correspond to different second sleep conditions. For example, the second sleep condition is the duration of a certain sleep state, which is greater than or equal to a duration threshold for that sleep state.
[0224] Optionally, the second sleep condition is related to the sleep duration of the electronic device. The sleep duration of the electronic device is equal to the sum of the durations of each sleep state. In the solution provided in this application embodiment, the sleep state of the electronic device can change at least once during the sleep process; therefore, the sleep duration of the electronic device is the cumulative duration of each sleep state. For example, for any given sleep state, the duration of that sleep state is determined by the sleep strategy indicating that sleep state. For instance, the duration of the sleep state may not exceed the sleep duration parameter in the sleep strategy. Therefore, the sleep duration of the electronic device can be determined by the sum of the sleep duration parameters of each sleep strategy already used.
[0225] In one example, the second sleep condition includes: the sleep duration of the electronic device is greater than or equal to the first duration, and the second sleep condition corresponds to the second device. When the sleep duration of the electronic device is greater than or equal to the first duration, the electronic device triggers the second device to enter a low-power mode or power down; when the sleep duration of the electronic device is less than the first duration, the second device does not enter a low-power mode or power down temporarily.
[0226] For example, after the electronic device obtains the initial sleep strategy in step S810, the electronic device obtains the second sleep condition based on the sleep duration parameter in the initial sleep strategy. Exemplarily, the second sleep condition is the duration of the initial sleep state, which is greater than or equal to the sleep duration parameter in the initial sleep strategy.
[0227] For example, in at least one sleep strategy, a second sleep strategy corresponds to a second sleep state, and the second sleep strategy includes power-down device information and a second sleep duration parameter. When the electronic device is in the second sleep state, the second device is either powered down or in a low-power mode.
[0228] The second sleep strategy is any one of the at least one sleep strategies other than the end sleep strategy and the initial sleep strategy, and the power-down device information of the second sleep strategy includes the device identifier of at least one second device.
[0229] Optionally, at least one sleep strategy includes multiple sleep strategies with a selection order. When the sleep condition is related to the sleep duration of the electronic device, the first duration parameter is obtained by adding the sleep duration parameters of the first i-1 sleep strategies selected in the multiple sleep strategies. If the first duration parameter is greater than or equal to the first duration, the electronic device determines the i-th sleep strategy as the second sleep strategy, where i is a positive integer. The power-down device information in the i-th sleep strategy is used to indicate the power-down of the second device.
[0230] The following describes a method for triggering devices to enter a low-power mode or power down when sleep conditions are met during the sleep process of an electronic device.
[0231] In step S830, in response to the sleep condition being met, at least one device is triggered to enter a low-power mode or power down.
[0232] In some embodiments, after a sleep condition is met, the electronic device identifies at least one device that needs to be powered down or enter a low-power mode, and triggers each of the at least one device to enter a low-power mode or power down. Here, the sleep condition does not include a first sleep condition.
[0233] Optionally, the fulfillment of sleep conditions is triggered by a real-time clock (RTC) in the electronic device. For example, before entering a second sleep state, the electronic device sets the RTC according to a second sleep duration parameter so that if the duration of the second sleep state reaches the second sleep duration parameter, it triggers the electronic device to power down at least one device.
[0234] The real-time clock contains a counter for continuous counting, which records the changes in time. Even after the electronic device is powered off, the real-time clock continues to function normally until the backup power supply to power it is depleted. In other words, the real-time clock can operate normally even when the electronic device is in sleep mode.
[0235] In one example, the real-time clock triggers a sleep interrupt command when sleep conditions are met. For instance, if the second sleep duration parameter is 1 hour and the current time recorded by the real-time clock is 14:00, then the real-time clock will trigger a sleep interrupt command when it reaches 15:00. As another example, if the second sleep duration parameter is 1 hour, the real-time clock will trigger a sleep interrupt command after a 1-hour countdown.
[0236] The sleep interrupt instruction is an internal instruction of the electronic device used to power on the CPU. Optionally, the sleep interrupt instruction is also called a wake-up interrupt. In some examples, the initial sleep strategy includes powering off the CPU (the initial device includes the CPU). Therefore, after executing the initial sleep strategy, the CPU is in a power-off state. Subsequently, during the adaptive adjustment of the electronic device's sleep state, the electronic device needs to obtain and execute an appropriate sleep strategy through the CPU. Therefore, the electronic device needs to wake up the CPU at regular intervals.
[0237] For example, when sleep conditions are met, the clock chip containing the real-time clock triggers a sleep interrupt instruction. In one example, there is a power supply path between the clock chip and the chip containing the CPU. When it is necessary to wake up the electronic device, the clock chip controls the power supply path to be powered on, thereby waking up the CPU. In other words, the sleep interrupt instruction can be implemented by powering on the power supply path.
[0238] Optionally, in response to meeting a sleep condition, the electronic device triggers at least one device to enter a low-power mode or power down, comprising: the electronic device selecting a sleep strategy from at least one sleep strategy in response to meeting the sleep condition; the electronic device obtaining a device identifier of at least one device based on the power-down device information in the selected sleep strategy; and the electronic device triggering each device to enter a low-power mode or power down based on the device identifier. Optionally, the selected sleep strategy corresponds to the second sleep strategy in the claim.
[0239] Subsequently, the CPU of the electronic device is powered off, and the electronic device enters the sleep state corresponding to the selected sleep strategy, or the electronic device eventually enters a hibernation state.
[0240] Among them, the selected sleep strategy is related to the sleep conditions met.
[0241] In some embodiments, there are multiple sleep strategies having a selection order; in response to a sleep condition being met, the electronic device selects a sleep strategy from at least one sleep strategy, including: the electronic device determining a historical sleep strategy corresponding to the sleep condition; and the electronic device obtaining the selected sleep strategy from the multiple sleep strategies according to the selection order of the historical sleep strategies.
[0242] Optionally, the historical sleep strategy includes the first sleep strategy in the claims. Exemplarily, the selected sleep strategy and the historical sleep strategy are relative concepts; if the selected sleep strategy changes, the historical sleep strategy also changes. In one example, the selection order of the selected sleep strategy is adjacent to the selection order of the historical sleep strategy, and the selection order of the selected sleep strategy lags behind the selection order of the historical sleep strategy.
[0243] Optionally, the electronic device determines the historical sleep strategy corresponding to the sleep condition, including: when the duration of the second sleep state is greater than or equal to the second sleep duration parameter, the electronic device obtains the historical sleep strategy based on the second sleep state.
[0244] For example, a historical sleep strategy is a sleep strategy that indicates the second sleep state among multiple sleep strategies. The sleep duration parameter in the historical sleep strategy is equal to the second sleep duration parameter.
[0245] In one example, when sleep conditions are met, the electronic device responds to a sleep interrupt command by powering on the CPU. Subsequently, the electronic device acquires device wake-up information; based on the sleep interrupt information, the electronic device retrieves historical sleep policies from multiple sleep policies.
[0246] The sleep interruption information is used to characterize the factors that trigger the CPU wake-up. For example, the sleep interruption information includes clock information. This clock information characterizes the first moment when the sleep interrupt instruction is generated by the real-time clock. For instance, if the real-time clock triggers the sleep interrupt instruction at 24:12:01;12:00, then the first moment is 24:12:01;12:00.
[0247] For example, the sleep state of an electronic device is adjusted by the CPU of the electronic device. The CPU controls the power management module in the electronic device to realize the power-on, power-off, and power consumption management of the device. For example, after the electronic device enters a hybrid sleep mode, the CPU powers down. The CPU is woken up by a sleep interrupt instruction, and the CPU executes the hybrid sleep method to trigger at least one device to enter a low-power mode or power down. Subsequently, the CPU powers down until it is woken up again by a sleep interrupt instruction.
[0248] Optionally, the electronic device obtains historical sleep strategies from multiple sleep strategies based on sleep interruption information, including: the electronic device obtains a first duration based on a first moment and a second moment of entering the historical sleep state; the electronic device determines the sleep strategy with the sleep duration parameter equal to the first duration and the latest selection order from at least one sleep strategy that has been selected from multiple sleep strategies as the historical sleep strategy.
[0249] The selection order of the chosen sleep strategy is later than the selection order of the historical sleep strategies.
[0250] For example, among the multiple sleep strategies with a selection order, there is a first sleep strategy and a second sleep strategy, with the selection order of the first sleep strategy taking precedence over the selection order of the second sleep strategy. If the sleep condition is determined based on the first sleep strategy, the selected sleep strategy can be the second sleep strategy. When the sleep condition is met, the electronic device triggers at least one device to power down or enter a low-power mode, which is the device indicated by the power-down device information in the second sleep strategy.
[0251] For example, an electronic device may select a sleep strategy as the one whose sleep strategy identifier is less than or equal to the sleep strategy identifier of a historical sleep strategy among multiple sleep strategies.
[0252] Since sleep strategies can be generated from historical usage data, determining the power-down order of devices based on the selection order of sleep strategies helps to enable multiple devices to power down sequentially or enter low-power mode without affecting user operation.
[0253] In some embodiments, if the selected sleep strategy does not correspond to a hibernation state, the electronic device repeats steps S820 and S830 until the electronic device is in a hibernation state, or the electronic device displays a second interface in response to a user operation, or the battery is depleted and the electronic device shuts down.
[0254] Optionally, each sleep state corresponds to different sleep conditions. When the sleep conditions are met, the electronic device will power down at least one device and execute step S820 to update the sleep conditions, obtaining the updated sleep conditions. The updated sleep conditions are used to trigger the power-down device again to adjust the sleep state of the electronic device.
[0255] This helps to enable graded power-down of devices in hybrid sleep mode, improves the flexibility of device power-down, and also helps to reduce the power consumption of electronic devices.
[0256] In some embodiments, after obtaining the selected sleep strategy in step S830, the electronic device repeats step S820 according to the selected sleep strategy to obtain updated sleep conditions. For example, the updated sleep conditions are the duration of the sleep state corresponding to the selected sleep strategy, which is greater than or equal to the sleep duration parameter in the selected sleep strategy. At this time, the selected sleep strategy serves as the historical sleep strategy in the next sleep state adjustment process, until the selected sleep strategy is the end-of-life sleep strategy among at least one sleep strategy.
[0257] In one example, after executing step S810, the selected sleep strategy is the initial sleep strategy. The electronic device obtains the sleep conditions according to the initial sleep strategy. At this time, the sleep conditions are the duration of the initial sleep state, which is greater than or equal to the initial sleep duration parameter. Then, the electronic device sets the real-time clock according to the first sleep duration parameter.
[0258] If the duration of the initial sleep state reaches the initial sleep duration parameter, the CPU is powered on by the real-time clock. The electronic device selects a second sleep strategy from multiple sleep strategies based on the initial sleep strategy. The electronic device powers down the second device indicated by the second sleep strategy and obtains updated sleep conditions based on the second sleep strategy. Optionally, the updated sleep conditions are the duration of the second sleep state, which is greater than or equal to the second sleep duration parameter.
[0259] If the duration of the second sleep state is greater than or equal to the second sleep duration parameter, the CPU is powered on by the real-time clock. The electronic device selects a third sleep strategy from multiple sleep strategies based on the second sleep strategy. The electronic device powers down the third device indicated by the third sleep strategy and obtains the updated sleep conditions according to the third sleep strategy.
[0260] Step S840: Electronic device enters sleep mode.
[0261] Optionally, the electronic device executes steps S820 and S830 repeatedly until the electronic device goes into sleep mode.
[0262] Optionally, if the sleep strategy is selected as the end-to-end hibernation strategy in step S830, the electronic device no longer sets the real-time clock and enters hibernation mode.
[0263] This helps improve the flexibility of reducing device power consumption in hybrid sleep modes, enabling timely triggering of devices to enter low-power modes or power down. It also helps to further optimize power consumption during the sleep process of electronic devices.
[0264] like Figure 10 As shown, the hybrid sleep method includes the following steps, and the main body responsible for executing these steps is... Figure 2Electronic devices 100.
[0265] In step S1010, in response to the first sleep condition being met, the first device is triggered to enter a low-power mode or power down.
[0266] In this context, the power consumption of the device in low-power mode is lower than a power consumption threshold. This power consumption threshold is preset. Different devices may have the same or different power consumption thresholds.
[0267] In step S1020, in response to the second sleep condition being met, the second device is triggered to enter a low-power mode or power down.
[0268] In this example, the electronic device includes a first device, a second device, and a third device. When the electronic device is in operation, the first device, the second device, and the third device are all powered on. After the electronic device enters a hybrid sleep mode, the first device, the second device, and the third device can reduce power consumption in stages to reduce the overall power consumption of the electronic device in the hybrid sleep mode.
[0269] Optionally, the power-down timing of the first device, the second device, and the third device is different; that is, the power-down of the first device, the second device, and the third device is triggered by different sleep conditions.
[0270] The first sleep condition and the second sleep condition are distinct, with the first sleep condition being triggered in a higher order than the second. Optionally, the first sleep condition may be acquired earlier than the second sleep condition.
[0271] Optionally, the first sleep condition includes detecting an operation that puts the control device into sleep mode, or receiving a user operation within a preset time range. The first device has an initial sleep strategy indication in at least one sleep strategy, also referred to as the first sleep strategy. The initial sleep strategy has the highest priority among the at least one sleep strategies.
[0272] Optionally, the second sleep condition is determined based on a historical sleep strategy from at least one sleep strategy. For example, the second sleep condition is determined based on an initial sleep strategy, such as the second sleep condition being that the duration of the initial sleep state is greater than or equal to an initial sleep duration parameter. Subsequently, when the second sleep condition is met, the electronic device selects a second sleep strategy from the at least one sleep strategy, powers down the second device indicated by the second sleep strategy, and determines a third sleep condition based on the second sleep strategy. The electronic device can use the third sleep condition as the new second sleep condition, repeatedly executing the step of selecting a second sleep strategy from the at least one sleep strategy when the second sleep condition is met, until the second sleep strategy is the start of the final sleep strategy, until the electronic device is in a sleep state.
[0273] Therefore, compared to related technologies, the solution provided in this application improves the flexibility of sleep state changes in electronic devices under hybrid sleep mode. By instructing the electronic device to enter hybrid sleep mode or power down in stages through at least one candidate sleep strategy, it gradually enters a sleep state with lower power consumption, which helps reduce the power consumption of the electronic device in hybrid sleep mode. This helps save power during standby of the electronic device and helps extend the battery life of the electronic device.
[0274] On the other hand, by employing at least one candidate sleep strategy, the power-down timing of each component in the electronic device can be specifically controlled, making the power-down timing of components in the hybrid sleep mode more flexible and helping to improve the adaptability of the hybrid sleep mode to devices in different usage environments. Considering that users may wake up the electronic device in hybrid sleep mode through certain components, the sleep strategy supports prioritizing the power-down of components with lower user frequency, while keeping components with higher user frequency powered on for a longer period of time. This helps ensure that the electronic device can respond to user operations promptly even in hybrid sleep mode.
[0275] The following examples illustrate a method for interrupting the hybrid sleep mode of electronic devices.
[0276] In some embodiments, the sleep state of the electronic device is interrupted by user operation. Subsequently, the electronic device re-powers the powered-off devices in the hybrid sleep mode and restores the devices that have entered low-power mode to normal power consumption, so that the electronic device can resume from sleep state to operating state.
[0277] Optionally, in this case, the sleep interruption command is triggered by a device. For example, when the electronic device is in sleep mode, a device in the electronic device responds to a user operation and triggers the generation of a sleep interruption command; subsequently, the electronic device displays a second interface. This second interface includes, but is not limited to, the power-on / unlock interface, the main application interface, etc.
[0278] The device in question is a component of the electronic device that is not powered off. For example, user actions include, but are not limited to, clicking the touchpad, moving the mouse, typing on the keyboard, and pressing the power button. For instance, the mouse in the electronic device might trigger a sleep interrupt command in response to a movement operation.
[0279] For example, when a sleep interruption instruction is triggered by a device, the CPU powers on; the electronic device acquires sleep interruption information, which includes the device identifier and clock information of the device used by the user; the electronic device updates historical usage data based on the sleep interruption information. The updated historical usage data is used to acquire at least one updated sleep strategy.
[0280] For example, electronic devices may add clock information as the second historical moment when the sleep state is interrupted to the sleep start and end times corresponding to the current day, and use device information as the sleep interruption method.
[0281] Figure 11 This is a power consumption diagram of the hybrid sleep method provided in an embodiment of this application. Figure 11 As shown, in hybrid sleep mode, the electronic device first powers down the initial device according to the initial sleep strategy, entering an initial sleep state. If the duration of the initial sleep state reaches t1, the electronic device, in response to meeting the sleep conditions, triggers at least one device to enter a low-power mode or powers down, and the electronic device enters a new sleep state. This process of triggering at least one device to enter a low-power mode or powers down in response to meeting the sleep conditions is repeated, progressively reducing device power consumption until the electronic device enters a hibernation state. In this way, the power consumption of the electronic device in hybrid sleep mode is gradually reduced, achieving the goal of reducing device power consumption.
[0282] This embodiment supports using a sleep strategy to periodically power down devices in a hybrid sleep mode. This helps avoid power waste caused by prolonged power-on of devices in hybrid sleep mode, reduces power consumption during standby, and thus helps extend the standby time of electronic devices.
[0283] Figure 12 This is one of the interactive diagrams between functional modules provided in the embodiments of this application. For example... Figure 12 As shown, the hybrid sleep method comprises a data collection module, a strategy generation module, a strategy storage module, a sleep decision module, and a sleep adjustment module in the electronic device. The execution of the hybrid sleep method includes the following steps: 1. The data collection module acquires historical usage data. 2. The strategy generation module acquires at least one sleep strategy based on the historical usage data. 3. The strategy storage module stores at least one sleep strategy. 4. In response to an operation controlling the device to sleep, the sleep decision module acquires a first sleep strategy from the at least one sleep strategy. 5. The sleep adjustment module executes the first sleep strategy, causing the electronic device to enter a first sleep state. 6. The sleep strategy module is woken up by a real-time clock, whereby a new first sleep strategy is acquired from the at least one sleep strategy, until the electronic device enters a hibernation state. 7. When the electronic device is woken up by user operation, the sleep decision module reports sleep start and end information to the data collection module. This allows the data collection module to update historical usage data, and the strategy generation module to periodically update at least one sleep strategy.
[0284] In one possible implementation, the process of obtaining at least one sleep policy based on historical usage data is performed by the server. Optionally, the electronic device obtains a policy generation request based on historical usage data; the electronic device sends the policy generation request to the server; the server generates at least one sleep policy based on the policy generation request and sends the at least one sleep policy to the electronic device.
[0285] The policy generation request is used to request the generation of a sleep policy. Optionally, the policy generation request includes historical usage data. For example, the server inputs historical usage data into a large model and outputs at least one sleep policy from the large model. For example, the server performs data statistics based on historical usage data to generate at least one sleep policy.
[0286] In this way, leveraging the server's computing power helps generate sleep strategies that are more in line with user habits based on historical usage data.
[0287] Figure 13 This is a second schematic diagram illustrating the interaction between functional modules provided in an embodiment of this application. For example... Figure 13 As shown, the hybrid sleep method consists of a data collection module, a policy storage module, a sleep decision module, and a sleep adjustment module in the electronic device. The data collection module provides historical usage data to the server, and the policy storage module retrieves at least one sleep policy from the server. (Related information...) Figure 13 For further information, please refer to [link / reference]. Figure 12 The corresponding implementation examples will not be described in detail here.
[0288] The above combination Figures 7-13 The hybrid sleep method provided in the embodiments of this application is described in detail below. Figure 14 This application provides a detailed description of the electronic devices and servers provided in its embodiments.
[0289] All or part of any feature in any embodiment of this application can be freely combined. The combined technical solution also falls within the scope of this application.
[0290] In one possible design, Figure 14 This is a schematic diagram of the structure of the electronic device provided in an embodiment of this application. For example... Figure 14 As shown, the electronic device 100 may include a transceiver unit 1401 and a processing unit 1402. The electronic device 100 can be used to implement the functions of the electronic device involved in the above method embodiments.
[0291] Optionally, the transceiver unit 1401 is used to support the electronic device 100 in performing step S20 in the above embodiments.
[0292] Optionally, the processing unit 1402 is used to support the electronic device 100 in performing... Figure 8S810-S840 in the series.
[0293] The transceiver unit may include a receiving unit and a transmitting unit, and may be implemented by a transceiver or transceiver-related circuit components, and may be a transceiver or transceiver module. The operation and / or function of each unit in the electronic device 100 are respectively to implement the corresponding process of the hybrid sleep method described in the above method embodiments. All relevant content of each step involved in the above method embodiments can be referred to the functional description of the corresponding functional unit, and for the sake of brevity, it will not be repeated here.
[0294] Optionally, Figure 14 The illustrated electronic device 100 may also include a storage unit ( Figure 14 (not shown in the image), this storage unit stores a program or instruction. When the transceiver unit 1401 and the processing unit 1402 execute the program or instruction, it causes... Figure 14 The electronic device 100 shown can perform the hybrid sleep method described in the above method embodiments.
[0295] Figure 14 The technical effects of the electronic device 100 shown can be referred to the technical effects of the hybrid sleep method described in the above method embodiments, and will not be repeated here.
[0296] In addition to being in the form of electronic device 100, the technical solutions provided in this application may also be functional units or chips in electronic devices, or devices used in conjunction with electronic devices.
[0297] This application also provides a chip system, including: a processor coupled to a memory, the memory being used to store programs or instructions, wherein when the program or instructions are executed by the processor, the chip system implements the methods in any of the above method embodiments.
[0298] Optionally, the chip system may contain one or more processors. These processors can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor, implemented by reading software code stored in memory.
[0299] Optionally, the chip system may contain one or more memories. The memory may be integrated with the processor or disposed separately from it; this application embodiment does not limit this. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or disposed separately on different chips. This application embodiment does not specifically limit the type of memory or the arrangement of the memory and processor.
[0300] For example, the chip system may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a micro controller unit (MCU), a programmable logic device (PLD), or other integrated chips.
[0301] It should be understood that each step in the above method embodiments can be completed by integrated logic circuits in the processor hardware or by instructions in software form. The method steps disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor.
[0302] This application also provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the aforementioned steps to implement the hybrid sleep method described in the above embodiments.
[0303] This application also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the hybrid sleep method described in the above embodiments.
[0304] In this application, the computer-readable storage medium, computer program product, or chip provided in the embodiments are all used to execute the corresponding methods described above. Therefore, the beneficial effects they can achieve can be referred to in the beneficial effects of the corresponding methods described above, and will not be repeated here.
[0305] The steps of the methods or algorithms described in conjunction with the embodiments of this application can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory, flash memory, read-only memory, erasable programmable read-only memory, electrically erasable programmable read-only memory, registers, hard disks, portable hard disks, optical discs, or any other form of storage medium well known in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can reside in an application-specific integrated circuit (ASIC).
[0306] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, the division of the above functional modules is only used as an example. In practical applications, the above functions can be assigned to different functional modules as needed; that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0307] In the several embodiments provided in this application, it should be understood that the disclosed methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules or units is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of modules or units may be electrical, mechanical or other forms.
[0308] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units. Computer-readable storage media include, but are not limited to, any of the following: USB flash drive, portable hard drive, read-only memory, random access memory, magnetic disk, or optical disk, and other media capable of storing program code.
[0309] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A hybrid sleep method, characterized in that, The method is performed by an electronic device, the electronic device including a first device, a second device, and a third device, the method comprising: In response to the fulfillment of a first sleep condition, the first device is triggered to enter a low-power mode or power down. The first sleep condition includes detecting a sleep operation of the user control device or not receiving a user operation within a preset time range. The power consumption in the low-power mode is lower than a power consumption threshold. In response to the fulfillment of a second sleep condition, the second device is triggered to enter a low-power mode or power down, wherein the second sleep condition includes a sleep duration of the electronic device that is greater than or equal to a first duration.
2. The method according to claim 1, characterized in that, The electronic device includes at least one sleep strategy, which is used to indicate different sleep conditions and devices to be powered off. The devices to be powered off include the first device, the second device, or the third device. The first device is indicated by the first sleep strategy. The step of triggering the second device to enter a low-power mode or power down in response to the satisfaction of a second sleep condition includes: In response to the satisfaction of the second sleep condition, a second sleep strategy indicating the second sleep condition is obtained from the at least one sleep strategy; The second device, triggered by the second sleep strategy, enters a low-power mode or is powered down.
3. The method according to claim 2, characterized in that, The at least one sleep strategy includes multiple sleep strategies with a selection order; The step of obtaining a second sleep strategy indicated by the second sleep condition in the at least one sleep strategy in response to satisfying the second sleep condition includes: For the i-th sleep strategy among the multiple sleep strategies, the sleep duration parameters of the i-1 sleep strategies selected in the order are added together to obtain the first duration parameter. The sleep duration parameter is used to characterize the duration threshold for the sleep strategy to be effective, where i is a positive integer. If the first duration parameter is greater than or equal to the first duration, the second sleep strategy is obtained according to the i-th sleep strategy.
4. The method according to claim 3, characterized in that, Before triggering the second device to enter a low-power mode or power down in response to the satisfaction of the second sleep condition, the method further includes: The second sleep condition is obtained based on the i-th sleep strategy and the first duration.
5. The method according to claim 4, characterized in that, The i-th sleep strategy includes a first sleep duration parameter, and the second duration is greater than or equal to the sum of the first duration and the first sleep duration parameter.
6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: In response to the fulfillment of a third sleep condition, the third device is triggered to enter a low-power mode or power down. The third sleep condition includes the sleep duration of the electronic device being greater than or equal to a second duration, wherein the second duration is greater than the first duration.
7. The method according to any one of claims 1 to 6, characterized in that, The first device is a device that is pre-configured in the electronic device to be among the first to be powered down after entering a sleep state.
8. The method according to any one of claims 1 to 7, characterized in that, The method further includes: Acquire historical usage data, which is used to characterize the historical usage of the electronic device; Based on the historical usage data, at least one sleep strategy is obtained. The at least one sleep strategy is used to indicate different sleep conditions and devices to be powered off, including the first device, the second device, and the third device.
9. The method according to claim 8, characterized in that, The historical usage data includes at least one of the following: device usage time period, device usage information, sleep start and end time; The device usage period is used to characterize the historical usage period of the electronic device; The device usage information is used to reflect the user's needs for the devices in the electronic device; The sleep start and end times are used to characterize the historical sleep periods of the electronic device.
10. The method according to claim 9, characterized in that, The step of obtaining at least one sleep strategy based on the historical usage data includes: Based on the sleep start and end times, obtain the sleep duration parameters of at least one sleep strategy, wherein the sleep duration parameters are used to characterize the duration threshold for the sleep strategy to be effective. Based on the device usage information, obtain the sleep strategy of each of the multiple devices of the electronic device, including the first device, the second device, and the third device.
11. The method according to claim 10, characterized in that, The step of obtaining the sleep strategy for each of the multiple devices in the electronic device based on the device usage information includes: Based on the device usage information, the power-down priority among the devices is determined; Based on the power-down priority among the devices, a corresponding sleep strategy is indicated for each device.
12. The method according to any one of claims 2 to 11, characterized in that, The first sleep strategy includes at least one of the following: sleep strategy identifier, sleep duration parameter, power-off device information, sleep level, and wake-up state.
13. An electronic device, characterized in that, The electronic device includes a processor and a memory; the processor is configured to execute instructions stored in the memory to cause the electronic device to perform the method as described in any one of claims 1 to 12.
14. A computer-readable storage medium, characterized in that, It includes computer program instructions, which, when executed by a cluster of computing devices, perform the method as described in any one of claims 1 to 12.