Equipment control method and electronic equipment

By powering only critical memory units in the STR state of electronic devices and saving non-critical content to disk, the problems of high power consumption and slow recovery speed in standby mode are solved, and power consumption reduction and recovery speed improvement are achieved.

CN119200809APending Publication Date: 2024-12-27HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202310775430.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-27
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

In standby mode, especially in S3, existing electronic devices need to supply power to all memory, resulting in high power consumption and slow wake-up recovery speed, making it difficult to reduce power consumption and improve recovery speed.

Method used

When the electronic device is in the suspended memory (STR) state, only the memory unit that holds the key content is powered, the non-critical content is saved on disk, and the preset storage is determined based on the amount of key content in memory occupancy through the memory swap module. Scope and exchange non-critical content with critical content until no non-critical content exists within the preset storage range.

Benefits of technology

It reduces the power consumption of electronic devices in the STR state, and restores the process of key content first when wake up, improves the recovery speed after the device wakes up, and ensures user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119200809A_ABST
    Figure CN119200809A_ABST
Patent Text Reader

Abstract

A device control method and an electronic device, relating to the technical field of terminals, can supply power to a memory unit storing key content when the electronic device is in a memory STR state without supplying power to other memory units, thereby reducing the power consumption of the electronic device. In the device control method, the electronic device receives a first event, and controls the electronic device to enter an STR state in response to the first event. When the electronic device is in the STR state, the electronic device continues to store key content in the memory in the memory and stores non-key content in the memory in a disk of the electronic device, and the key content is used for representing necessary data corresponding to a process supporting operation of the electronic device. And the electronic equipment supplies power to the memory unit storing the key content in the memory, and stops supplying power to other memory units except the memory unit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a device control method and an electronic device. Background Art

[0002] Current electronic devices all follow the regulations of the Advanced Configuration and Power Interface (ACPI). ACPI defines six power states, S0-S5. Correspondingly, different power states also correspond to different working states of electronic devices.

[0003] Among them, when the electronic device enters the standby mode, it is in the S3 state, or the S3 state can also indicate that the electronic device is in the suspend to RAM (STR) state. In this state, some peripherals of the electronic device are powered off or enter a low power consumption state, the electronic device writes user-related data into the memory, and can be awakened by a keyboard, mouse, power button, universal serial bus (USB), etc. to resume working status.

[0004] When the electronic device is in the S3 state, the current user-related data is stored in a memory with a faster reading and writing speed. Therefore, if the electronic device is awakened, the recovery speed of the electronic device is faster. However, when the existing electronic device is in the S3 state, the memory that stores the data needs to be powered for a long time, so the power consumption of the electronic device to store the memory data is also relatively high. Summary of the invention

[0005] The embodiments of the present application provide a device control method and an electronic device, which can supply power to a memory unit storing key content when the electronic device is in the STR state without supplying power to other memory units, thereby reducing the power consumption of the electronic device.

[0006] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

[0007] In a first aspect, a device control method is provided. In the method, an electronic device receives a first event, and in response to the first event, controls the electronic device to enter a suspended to memory STR state. When the electronic device is in the STR state, the electronic device continues to store the key content in the memory in the memory, and stores the non-key content in the memory in the disk of the electronic device, wherein the key content is used to represent the necessary data corresponding to the process supporting the operation of the electronic device. The electronic device then supplies power to the memory unit storing the key content in the memory, and stops supplying power to other memory units except the memory unit.

[0008] In the above method, when the electronic device is in the STR state, power is supplied to the memory unit storing key contents in the memory, while other memory units do not need to be supplied, thereby reducing the power consumption of the electronic device.

[0009] In an implementation method of the first aspect, the above-mentioned memory is used to provide memory space for processes running on the electronic device; the memory space is used to store necessary data for the running of the process; when the process type corresponding to the memory space is a foreground process or a system process, the content in the memory space is key content; when the process type corresponding to the memory space is a background process, the content in the memory space is non-key content.

[0010] Among them, the system process refers to the necessary process that supports the normal operation of the electronic device, which comes from the system kernel of the electronic device or represents the process provided by the system of the electronic device. The foreground process refers to the process running in the system foreground of the electronic device. The functions, interfaces, contents, etc. provided by such processes can be intuitively presented or intuitively perceived by the user, such as the process of the lock screen application, the process of the foreground running application, etc. The process corresponding to the non-critical content can be a background process, etc. The background process refers to the process that does not affect the normal operation of the electronic device or represents the process running in the system background of the electronic device. The functions, interfaces, contents, etc. provided by such processes will not be intuitively presented or intuitively perceived by the user, such as the process of the background running application, etc.

[0011] In an implementable manner of the first aspect, the electronic device determines a preset storage range of the memory according to the total amount of memory occupied by the key content in the memory, and then exchanges and saves the non-key content within the preset storage range with the key content outside the preset storage range until the non-key content does not exist in the preset storage range. In this implementation manner, the electronic device exchanges and saves the non-key content within the preset storage range with the key content outside the preset storage range until the non-key content does not exist in the preset storage range, thereby achieving the purpose of aggregating and saving the key content.

[0012] In an implementation of the first aspect, after each non-critical content in a preset storage range of the electronic device is exchanged and saved outside the preset storage range, each non-critical content is saved to the disk of the electronic device. In this implementation, after each non-critical content in the preset storage range is exchanged and saved outside the preset storage range, the non-critical content on the memory is also aggregated and saved.

[0013] In an implementation of the first aspect, when the electronic device is in the STR state, it can also receive a first wake-up operation for waking up the electronic device. Afterwards, the electronic device responds to the first wake-up operation and resumes running the process corresponding to the key content according to the key content stored in the memory, and saves the non-key content in the disk to the memory. After the process corresponding to the key content resumes running, or after the screen of the electronic device is unlocked, the electronic device continues to resume running the process corresponding to the non-key content according to the non-key content in the memory.

[0014] In this implementation, when an electronic device in the STR state is awakened, the electronic device can first restore the corresponding process according to the key content stored in the memory, first restore the interface or function that the user can intuitively see or experience, or first provide the user with necessary interfaces, applications or functions, etc., to ensure the normal operation of the electronic device, instead of restoring the corresponding process according to non-critical content first, thereby speeding up the recovery speed of the electronic device after being awakened and ensuring the user's usage experience.

[0015] In an implementation of the first aspect, the electronic device receives a second event, and in response to the second event, controls the electronic device to enter a suspended to disk STD state. When the electronic device is in the STD state, the electronic device saves the critical content and the non-critical content in the disk of the electronic device, respectively. In this implementation, when the electronic device is in the STD state, the critical content and the non-critical content in the disk are also aggregated and saved separately.

[0016] In an implementation of the first aspect, when the electronic device is in the STD state, the electronic device receives a second wake-up operation for waking up the electronic device. Afterwards, the electronic device saves the critical content in the disk to the memory in response to the second wake-up operation, and resumes the process corresponding to the critical content according to the critical content in the memory. When the process corresponding to the critical content resumes operation, the electronic device saves the non-critical memory in the disk to the memory. And, after the process corresponding to the critical content resumes operation, or after the screen of the electronic device is unlocked, the electronic device continues to resume the process corresponding to the non-critical content according to the non-critical content in the memory.

[0017] In this implementation, when an electronic device in the STD state is awakened, the electronic device can first restore the corresponding process based on the key content stored in the memory, first restore the interface or function that the user can intuitively see or experience, or first provide the user with necessary interfaces, applications or functions, etc., to ensure the normal operation of the electronic device, instead of restoring the corresponding process based on non-critical content first, thereby speeding up the recovery speed of the electronic device after being awakened and ensuring the user's usage experience.

[0018] In one implementation of the first aspect, the electronic device obtains the address of each memory cell on the memory, and determines the target number of memory cells to be powered based on the address of each memory cell and the total amount of memory occupied by key content, and powers the target number of memory cells.

[0019] Among them, the address of each memory unit can indicate the memory capacity that each memory unit can provide. For example, if the address of a memory unit is 0-1GB, it means that the memory capacity that the memory unit can provide is 1G. In this implementation, the principle for the electronic device to determine the target number is to ensure that the target number is minimum and the total memory capacity provided by the target number of memory units is greater than the total memory occupied by the key content. In addition, in some application scenarios, since the electronic device can store the key content in a preset storage range of the memory, a smaller target number can be determined for the key content that is centrally (or aggregated).

[0020] In an implementation manner of the first aspect, the above-mentioned first event is triggered by a user, and the first event includes the user clicking one or more of the controls, buttons, and keys that control the electronic device to enter the STR state; and / or, the first event is a preset device event, and the device event includes the first preset duration of the electronic device being in the screen-off state.

[0021] For example, the control on the electronic device that controls the electronic device to enter the STR state may be a control such as "hibernate" or "sleep" displayed on the electronic device. Alternatively, the electronic device may start timing when it is in the screen-off state or the cover-closed state, and after a first preset time, if no operation to wake up the electronic device is received, the electronic device automatically enters the STR state.

[0022] In one possible implementation of the first aspect, the second event is triggered by a user, and the second event includes the user clicking one or more of a control, a button, or a key that controls the electronic device to enter the STD state; and / or the second event is a preset device event, and the device event includes the second preset duration of time that the electronic device is in the screen-off state.

[0023] For example, the control on the electronic device that controls the electronic device to enter the STD state may be a control such as "hibernate" or "sleep" displayed on the electronic device. Alternatively, the electronic device may start timing when it is in the screen-off state or cover-closed state, and after a second preset time, if no operation to wake up the electronic device is received, the electronic device automatically enters the STD state.

[0024] Also, it is understandable that the controls triggered to enter the STD state may be different, and the controls triggered to enter the STR state may also be different between electronic devices of different manufacturers or models; and the controls triggered to enter the STD state and the controls triggered to enter the STR state may be different for electronic devices of the same manufacturer or model.

[0025] In a second aspect, a device control method is provided, including: a power management module receives a first event, and in response to the first event, controls the electronic device to enter a suspend to memory STR state; when the electronic device is in the STR state, a classification storage module continues to store key content in the memory of the electronic device in the memory, and stores non-key content in the memory in the disk of the electronic device; the key content is used to represent necessary data corresponding to a process that supports the operation of the electronic device; the power driver supplies power to a memory unit that stores the key content in the memory, and stops supplying power to other memory units except the memory unit.

[0026] In an implementation manner of the second aspect, the method also includes: a memory exchange module determines a preset storage range of the memory based on the total amount of memory occupied by the critical content in the memory; the memory exchange module exchanges and saves non-critical content within the preset storage range with critical content outside the preset storage range until there is no non-critical content within the preset storage range.

[0027] In an implementation manner of the second aspect, the method also includes: when the electronic device is in the STR state, the power management module receives a first wake-up operation to wake up the electronic device, and sends a first notification to the processing module; the processing module receives the first notification, and resumes running the process corresponding to the critical content according to the critical content stored in the memory, and saves the non-critical content in the disk to the memory; after the process corresponding to the critical content is resumed, or after the screen of the electronic device is unlocked, the processing module continues to resume running the process corresponding to the non-critical content according to the non-critical content in the memory.

[0028] In an implementation manner of the second aspect, the method also includes: the power management module receives a second event, and in response to the second event, controls the electronic device to enter a suspend to disk STD state; when the electronic device is in the STD state, the classification storage module saves the critical content and non-critical content in the disk of the electronic device respectively.

[0029] In an implementation manner of the second aspect, the method also includes: when the electronic device is in the STD state, the power management module receives a second wake-up operation to wake up the electronic device, and sends a second notification to the processing module; the processing module receives the second notification, saves the key content in the disk to the memory, and resumes the process corresponding to the key content based on the key content in the memory; when resuming the process corresponding to the key content, the processing module saves the non-critical content in the disk to the memory; after the process corresponding to the key content is resumed, or after the screen of the electronic device is unlocked, the processing module continues to resume the process corresponding to the non-critical content based on the non-critical content in the memory.

[0030] In an implementation method of the second aspect, a power driver supplies power to memory cells storing key content on the memory, including: the power driver obtains the address of each memory cell on the memory; the power driver determines a target number of memory cells to be powered based on the address of each memory cell and the total amount of memory occupied by the key content, and supplies power to the target number of memory cells.

[0031] In a third aspect, an electronic device is provided, comprising a disk, a memory, and one or more processors; the memory and the disk are respectively coupled to the processors; a computer program code is stored in the memory, and the computer program code comprises computer instructions, and when the computer instructions are executed by the processor, the electronic device executes a device control method as in the first aspect and any implementation thereof.

[0032] In one implementation of the third aspect, when the electronic device is in the STR state, the disk is used to save critical content in the memory, and when the electronic device is in the STD state, the disk is used to save critical content and non-critical content in the memory.

[0033] In a fourth aspect, a computer-readable storage medium is provided, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes a device control method as in the first aspect and any implementation thereof, or executes a device control method as in the second aspect and any implementation thereof.

[0034] In a fifth aspect, a computer program product is provided. When the computer program product runs on a computer, it enables the computer to execute the device control method as in the first aspect and any implementation thereof, or execute the device control method as in the second aspect and any implementation thereof.

[0035] It can be understood that the beneficial effects that can be achieved by the device control method described in the second aspect, the electronic device described in the third aspect, the computer-readable storage medium described in the fourth aspect, and the computer program product described in the fifth aspect can refer to the beneficial effects in the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 A schematic diagram of six power supply states shown in an embodiment of the present application;

[0037] Figure 2 The structure of the electronic device shown in the embodiment of the present application is shown in FIG. Figure 1 ;

[0038] Figure 3 A schematic diagram of the memory structure corresponding to the process shown in the embodiment of the present application;

[0039] Figure 4 The structure of the electronic device shown in the embodiment of the present application is shown in FIG. Figure 2 ;

[0040] Figure 5 The structure of the electronic device shown in the embodiment of the present application is shown in FIG. Figure 3 ;

[0041] Figure 6 The process diagram of the device control method shown in the embodiment of the present application is as follows Figure 1 ;

[0042] Figure 7 Memory schematic diagram of the embodiment of the present application Figure 1 ;

[0043] Figure 8 Memory schematic diagram of the embodiment of the present application Figure 2 ;

[0044] Fig. 9 The process diagram of the device control method shown in the embodiment of the present application is as follows Figure 2 ;

[0045] Fig.10 The process diagram of the device control method shown in the embodiment of the present application is as follows Figure 3 ;

[0046] Fig.11 The structure of the electronic device shown in the embodiment of the present application is shown in FIG. Figure 4 . DETAILED DESCRIPTION

[0047] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the present application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship, for example, A / B can represent A or B; "and / or" in the present application is only a description of the association relationship of the associated objects, indicating that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. And, in the description of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not necessarily limit the differences. At the same time, in the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design solutions. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete manner for ease of understanding.

[0048] In addition, the business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. A person of ordinary skill in the art can appreciate that with the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0049] Usually, when a user is not using an electronic device (such as a personal computer), the user will control the electronic device to standby or hibernate, thereby preventing the electronic device from consuming excessive power and reducing the power consumption of the electronic device.

[0050] Current electronic devices all follow the Advanced Configuration and Power Management Interface (ACPI), which defines the following: Figure 1 There are six power states S0-S5 shown, and accordingly, different power states also correspond to different working states of the electronic device.

[0051] Exemplarily, when the electronic device is working normally, it is in the S0 state. In this state, the system of the electronic device is fully operational and all components are in working state. When the electronic device is closed or the screen is off, it is in the S1 or S2 state. In this state, the network transmission of the electronic device is suspended, the process is frozen, or the push is stopped. When the electronic device enters the standby mode, it is in the S3 state, or the S3 state can also indicate that the electronic device is in the STR state. In this state, some peripherals of the electronic device are powered off or enter a low-power state. The electronic device writes user-related data into the memory and can be awakened by the keyboard, mouse, power button, USB, etc. to resume the working state. When the electronic device enters the sleep mode, it is in the S4 state, or the S4 state can also indicate that the electronic device is in the suspend to disk (suspend to disk, STD) state. In this state, the electronic device writes all memory data to the disk and the system of the electronic device stops running. When the electronic device is shut down, it is in the S5 state.

[0052] The above-mentioned memory is also called internal memory, which mainly provides memory space for electronic devices to store data, information and other memory. When the electronic device is in the above-mentioned S0, S1 or S2 state, the electronic device will randomly allocate the corresponding memory space for the currently running process. Among them, the memory space corresponding to the process stores the necessary information or data required for the process to run, such as the process corresponding, memory mapping files, local variables, uninitialized global variables, initialized global variables, execution code, constant variables, parameter values, return values, etc., so that the process can run normally based on the content of the memory space.

[0053] When the electronic device is in the S3 state, the current user-related data continues to be stored in the memory with faster read and write speeds. Therefore, if the electronic device is awakened, the electronic device can directly load data from the memory, and the electronic device recovers faster. However, when the electronic device is awakened, it needs to load all the data in the memory, so that when it is in the S3 state, the electronic device needs to power all the memory units or particles that store data, thereby increasing the power consumption of the electronic device.

[0054] When the electronic device is in S4 state, all memory data must be written to the disk. When the electronic device is awakened, the system must be started and the data saved in the disk must be loaded, which will lead to the problem of slow recovery of the electronic device.

[0055] It can be seen that, when the current electronic device is in the above-mentioned S3 or S4 standby state, it is difficult to take into account both the problem of reducing the power consumption of the device and the problem of increasing the wake-up recovery speed.

[0056] Based on the above content, an embodiment of the present application provides a device control method. In the method, the electronic device can receive a first event, and in response to the first event, control the electronic device to enter the STR state. When the electronic device is in the STR state, the key content in the memory of the electronic device continues to be stored in the memory, and the non-key content in the memory is stored in the disk of the electronic device. Afterwards, the memory unit storing the key content in the memory is powered on, and the memory units other than the memory units are powered off.

[0057] It is understandable that in the above device control method, when the electronic device is in the STR state, power is supplied to the memory unit storing key contents in the memory without supplying power to other memory units, thereby reducing the power consumption of the electronic device.

[0058] Exemplarily, the above-mentioned key content is used to represent the necessary data corresponding to the process that supports the operation of the electronic device. The process corresponding to the above-mentioned key content may be a system process, a foreground process, etc. Among them, the system process represents the necessary process that supports the normal operation of the electronic device, which comes from the system kernel of the electronic device or represents the process provided by the system of the electronic device. The foreground process represents the process running in the system foreground of the electronic device. The functions, interfaces, contents, etc. provided by such processes can be intuitively presented or intuitively perceived by the user, such as the process of the lock screen application, the process of the foreground running application, etc. The process corresponding to the non-key content may be a background process, etc. The background process represents the process that does not affect the normal operation of the electronic device or represents the process running in the system background of the electronic device. The functions, interfaces, contents, etc. provided by such processes will not be intuitively presented or intuitively perceived by the user, such as the process of the background running application, etc.

[0059] In some possible application scenarios, when an electronic device in the STR state is awakened, the electronic device can first resume running the processes corresponding to the key content based on the key content stored in the memory, such as the foreground process, the system process, etc., and first provide the user with the necessary interface, applications or functions, etc. to ensure the normal operation of the electronic device, instead of first resuming the background process based on non-critical content, thereby speeding up the recovery speed of the electronic device after being awakened and ensuring the user experience.

[0060] In some possible application scenarios, the electronic device can also receive a second event. Similarly, the electronic device can also respond to the second event and control the electronic device to enter the STD state. When the electronic device is in the STD state, the key content and non-key content are respectively saved in the disk of the electronic device. When the electronic device in the STD state is awakened, the electronic device can first save the key content in the disk to the memory, and according to the key content in the memory, resume running the process corresponding to the key content, such as the foreground process, the system process, etc., instead of first resuming the background process, etc., according to the non-key content, thereby speeding up the recovery speed of the electronic device after being awakened and ensuring the user experience.

[0061] In some possible application scenarios, after the electronic device is awakened, it may be in a locked screen state. The process from when the electronic device receives the awakening operation to when the locked screen state is displayed can be regarded as the recovery phase of the electronic device.

[0062] See also Figure 2 As shown, the electronic device may include an application layer, a framework layer, a kernel layer, a driver layer, and a hardware layer. Each layer has a clear role and division of labor. The layers communicate with each other through software interfaces.

[0063] The application layer may include a series of application packages and processes corresponding to the application packages, such as background processes, foreground processes, system processes, etc. Generally, electronic devices can allocate memory space for processes to ensure the normal operation of the processes. In some possible application scenarios, the memory in the electronic device may include random access memory, memory sticks, etc., that is, random access memory (RAM), memory sticks, synchronous dynamic random access memory (DDR SDRAM), etc. may provide memory space for the electronic device.

[0064] And, the memory space stores the necessary data required for the corresponding process to run, such as memory-mapped files, local variables, uninitialized global variables, initialized global variables, execution code, constant variables, parameter values, return values, etc. For example, Figure 3As shown, the process corresponds to a process control block in the operating system of the electronic device, and the process control block includes a memory descriptor corresponding to the process. And the memory descriptor is used to describe the composition of the memory space allocated by the electronic device for the process or the data structure of the memory space, for example, including a stack area, a mapping area, a heap area, a BSS segment, a data segment, a code segment, etc., wherein the stack area stores local variables temporarily created by the process, the mapping area stores memory mapping files, the heap area stores memory segments dynamically allocated during the operation of the process, the BSS segment stores uninitialized global variables of the process, the data segment stores initialized global variables of the process, and the code segment stores the execution code and constant variables of the process.

[0065] The framework layer provides application programming interface (API) and programming framework for applications and processes in the application layer. The framework layer includes some predefined functions. The framework layer can include window management module, content provider module, view system, resource management module, notification management module, power management module, etc.

[0066] The window management module is used to manage window programs or processes. The window management module can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0067] The content provider module is used to store and retrieve data and make the data accessible to applications or processes. The data may include videos, images, audio, browsing history, and bookmarks. The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. The notification management module enables applications to display notification information in the status bar, which can be used to convey notification-type messages.

[0068] The resource management module provides various resources for applications or processes, such as localized strings, icons, images, layout files, video files, etc.

[0069] In some possible application scenarios, the power management module is used to obtain the first event, the second event, the first wake-up event, the second wake-up event, etc. triggered on the electronic device. After obtaining the first event or the second event, the power management module controls the electronic device to enter the STR state or the STD state, and sends a notification message to the resource management module, thereby triggering the resource management module to send the process information of the normal operation process of the electronic device to the memory management module, so that the memory management module determines the type of memory content in the memory space allocated for the process. Among them, the process information includes the memory address corresponding to the process, the application to which the process belongs, etc.

[0070] The kernel layer includes memory management module, memory switching module and classification storage module.

[0071] In some possible application scenarios, the memory management module is used to classify the memory content according to the process information sent by the resource management module, for example, the content in the memory space corresponding to the foreground process and the system process is determined as key content, and the content in the memory space corresponding to the background process is determined as non-key content. Afterwards, the memory management module sends the classification result to the memory exchange module and the classification storage module.

[0072] In some possible application scenarios, the memory exchange module is used to move non-critical content in a preset storage area in the memory to a storage area outside the preset storage area, so as to realize the centralized storage of critical content and non-critical content in the memory. For example, see Figure 4 As shown, the system process, foreground process, etc. correspond to key content, background process 1 and background process 2 correspond to non-key content, and the memory exchange module can exchange and save the non-key content in the preset storage area with the key content outside the preset storage area.

[0073] like Figure 5 As shown, in some possible application scenarios, the system process, the foreground process, etc. correspond to key content, and the background process 1 and the background process 2 correspond to non-key content. When the electronic device is in the STR state, the classification storage module can keep the key content in the memory, and the key content is centrally saved, while the non-key content is written to the disk of the electronic device for storage. In other possible application scenarios, the classification storage module can also write both the key content and the non-key content to the disk of the electronic device for storage when the electronic device is in the STD state, and, in the disk, the key content is centrally saved, occupying one area, and the non-key content is also centrally saved, occupying another area.

[0074] In some other possible application scenarios, when the electronic device is in the STR state, the memory management module can also directly save the contents of the memory space corresponding to the foreground process and the system process in the memory according to the process information, and write the contents of the memory space corresponding to the background process to the disk of the electronic device for storage. And, when the electronic device is in the STD state, the memory management module can also directly write the contents of the memory space corresponding to the foreground process and the system process to the disk of the electronic device for storage according to the process information, and write the contents of the memory space corresponding to the background process to the disk of the electronic device for storage.

[0075] The driver layer includes a board support package (BSP) and drivers, among which the drivers include at least a display driver, a camera driver, an audio driver, a sensor driver, a power driver, and the like.

[0076] In some possible application scenarios, the memory in the electronic device is composed of at least one memory unit or memory particle. The power driver is used to power the memory unit or memory particle that stores key content when the electronic device is in the STR state, and power off other memory units or memory particles, thereby reducing the power consumption of the electronic device.

[0077] The hardware layer mainly includes system-on-a-chip (SOC), memory (such as DDR, RAM, etc.), external storage (such as disk, hard disk, USB flash drive, magnetic disk, CD, etc.), etc. The difference between memory and external storage is that the memory has a fast read and write speed, but the stored content is affected by power failure, and the stored content will be lost after power failure; while the external storage has a slow read and write speed, but the stored content is not affected by power failure, and the stored content will not be lost after power failure.

[0078] In addition, in some possible application scenarios, the power management module can also obtain the first wake-up operation for waking up the electronic device when the electronic device is in the STR state, and after receiving the first wake-up operation, notify (for example, send a first notification) the chip, processing module, etc. of the electronic device to first resume running the process corresponding to the key content according to the above key content, such as the foreground process, system process, etc., to ensure that the system can run normally during the recovery process of the electronic device, and the foreground process can run normally, and first provide the user with the necessary interface, application or function, etc.; and will not resume, for example, the background process, etc. according to the non-critical content first, thereby speeding up the recovery speed of the electronic device after being awakened and ensuring the user experience. After the process corresponding to the key content resumes running or after the screen of the electronic device is unlocked, the chip, processing module, etc. continue to run the corresponding process according to the non-critical content.

[0079] In some other possible application scenarios, the power management module can also obtain a second wake-up operation for waking up the electronic device when the electronic device is in the STD state, and after receiving the second wake-up operation, notify (for example, send a second notification) the chip, processing module, etc. of the electronic device to first read the key content stored in the disk back to the memory, and first resume the corresponding process according to the key content. In this way, it can also ensure that the system of the electronic device can run normally during the recovery process, and the foreground process can run normally, and first provide the user with the necessary interface, application or function, etc., so as to speed up the recovery speed of the electronic device after being awakened and ensure the user's experience. While resuming the process corresponding to the key content, the chip, processing module, etc. read the non-key content in the disk back to the memory. After the process corresponding to the key content resumes running or after the screen of the electronic device is unlocked, the chip, processing module, etc. continue to resume the corresponding process according to the non-key content.

[0080] The electronic device in the embodiment of the present application may be a terminal device such as a laptop computer, a tablet computer, a personal computer (PC), a mobile phone, a game console, etc.

[0081] Before entering the STR state, the electronic device may be in the S0, S1 or S2 state shown in the above embodiments. When the electronic device is in the S0, S1 or S2 state, since the electronic device has randomly allocated memory space for the currently running process, the memory space of the electronic device already has corresponding memory content.

[0082] The following uses DDR to provide memory space and the external memory as a disk as an example to illustrate the device control method provided in the embodiment of the present application. Figure 6 As shown, the device control method provided in the embodiment of the present application may include the following steps S601-S603.

[0083] S601: The electronic device receives a first event, and enters a STR state in response to the first event.

[0084] The first event may be triggered by a user; and / or the first event may be a preset device event, wherein the device event includes the first preset duration of time that the electronic device is in the screen-off state.

[0085] In some possible application scenarios, if the first event can be triggered by a user, the user's triggering operation may include pressing the power button or power on / off button of the electronic device, clicking a control or physical key (or button) provided on the electronic device to control the electronic device to enter the STR state, a physical key (or button), etc. In this case, the user's triggering operation can be regarded as the above-mentioned first event. Exemplarily, the control on the electronic device that controls the electronic device to enter the STR state may be a control such as "hibernate" or "sleep" displayed on the electronic device, or the user may control the electronic device to enter the STR state by pressing the power button, power on / off button, etc. a preset number of times.

[0086] In some other possible application scenarios, the user can also control the electronic device to enter the screen-off state or the cover-closed state when the electronic device is not in use temporarily. When the electronic device is in the screen-off state or the cover-closed state, if the user has not used the electronic device for a long time, the electronic device can automatically enter the STR state. Exemplarily, the electronic device can start timing when it is in the screen-off state or the cover-closed state. After a first preset time (for example, 10 minutes, 20 minutes, etc.), if no operation to wake up the electronic device (such as moving the mouse, clicking a keyboard button, opening the cover, etc.) is received, the electronic device automatically enters the STR state. In this case, when the electronic device detects that it is in the screen-off state or the cover-closed state for the first preset time, it can be regarded as receiving the above-mentioned first event.

[0087] In some possible application scenarios, the electronic device may classify the memory content before receiving the first event. In other possible application scenarios, the electronic device may classify the memory content after receiving the first event or when the electronic device is in the STR state.

[0088] In some embodiments, the electronic device may classify the memory content in the memory space according to the process type corresponding to the memory space, wherein the process type may include but is not limited to system process, foreground process, background process, etc., and the type of memory content may include key content and non-key content.

[0089] Exemplarily, each memory space can be marked with marking information related to the corresponding process type when used by a process. The electronic device can first determine which processes are currently running, and mark the processes according to the process types, and the process marking information is used to indicate the process types. Afterwards, the electronic device marks the memory space corresponding to the process according to the process marking information, and the memory space marking information is used to indicate which type of process uses the memory space. Furthermore, the electronic device determines the process type corresponding to the content in the memory space according to the marking information of the memory space, and when the process type is a system process, a foreground process, or the like, the corresponding memory content is critical content; when the process type is a background process, or the like, the corresponding memory content is non-critical content.

[0090] As another example, after each memory space is allocated to a process, the memory space may include corresponding process information, such as the memory address corresponding to the process, the application to which the process belongs, etc. The electronic device then determines the corresponding process type according to the process information corresponding to the memory space. If it is a system process, a foreground process, etc., the content stored in the memory space is the key content; if it is a background process, etc., the content stored in the memory space is the non-key content.

[0091] The foreground process, system process, etc. mentioned above can provide the user with an interface or function that can be intuitively seen or experienced when running. Exemplarily, the foreground process can refer to a process running in the foreground of an electronic device, which can be a process corresponding to an application on the electronic device, or a process running to ensure the normal operation or work of the system. The system process can also refer to a process running to ensure the normal operation or work of the system.

[0092] When the above-mentioned background process is running, the functions or interfaces provided by it cannot be intuitively seen or experienced by the user. Exemplarily, the background process can refer to a process running in the background of the electronic device, and such a process can also be a process corresponding to an application on the electronic device.

[0093] It can be understood that the above-mentioned method of determining the memory content type by the process type corresponding to the memory space is only an example. In some other embodiments or possible application scenarios, the type of memory content can also be determined according to other methods to achieve the purpose of classifying the memory content into critical content and non-critical content. This is not specifically limited in the embodiments of the present application.

[0094] In some possible application scenarios, when an electronic device is connected to a peripheral device (such as a Bluetooth device, mouse, keyboard, speaker, etc.), the electronic device will also provide memory space in DDR for the peripheral device. In this case, the content in the memory space corresponding to the peripheral device can also be used as key content.

[0095] S602: When the electronic device is in the STR state, the key content in the DDR of the electronic device continues to be stored in the DDR, and the non-key content in the DDR is stored in the disk of the electronic device.

[0096] In some embodiments, when the electronic device is in the STR state, the electronic device may first continue to retain and aggregate critical content in the DDR, read non-critical content out of the DDR, and write it to the disk for storage.

[0097] In some embodiments, when aggregating key content, the electronic device may determine the preset storage range of the DDR based on the total amount of memory occupied by the key content in the DDR, or the total amount of DDR space required to store the key content. In some possible application scenarios, the preset storage range may be greater than or equal to the total amount of memory occupied by the key content, or greater than or equal to the total amount of DDR space required to store the key content. In other possible application scenarios, the preset storage range may start from any memory address of the DDR, for example, from a memory address of 0, or from a memory address of 1GB.

[0098] For example, see Figure 7As shown in (a), the total amount of memory occupied by the key content in the memory space provided by DDR is XGB, and the preset storage range is the range corresponding to 0-XGB in DDR. The preset storage range may include memory space for storing key content and memory space for storing non-key content. During aggregation, the electronic device may determine the non-key content within the preset storage range, and exchange and save the non-key content within the preset storage range with the key content outside the preset storage range until there is no non-key content within the preset storage range, or there is no key content outside the preset storage range, thereby achieving the purpose of aggregating and saving the key content, for example Figure 7 As shown in (b) in .

[0099] In some possible application scenarios, after each non-critical content in the preset storage range is exchanged and saved outside the preset storage range, the non-critical content on the DDR is also aggregated and saved, and the electronic device can continue to write each non-critical content to the disk of the electronic device for storage. In other possible application scenarios, the electronic device can also directly write a non-critical content in the preset storage range to the disk of the electronic device for storage after exchanging the non-critical content with the critical content outside the preset storage range.

[0100] In some embodiments, the size of the memory space allocated by the electronic device for each process may be the same or different. Also, the memory in the electronic device is managed by page, for example, managing 4KB of memory or 32KB of memory per page.

[0101] Therefore, when exchanging critical content and non-critical content, the electronic device may determine that the non-critical content within a preset storage range corresponds to a plurality of pages, and then exchange critical content of a corresponding number of pages outside the preset storage range with the non-critical content.

[0102] Taking the example of managing 4KB memory per page, if the non-critical content in the preset storage range is 1GB, the number of pages corresponding to the non-critical content can be determined as: 1024*1024KB / 4KB=262144 pages, where 1GB=1024MB=1024*1024KB. Accordingly, the 262144 pages of critical content outside the preset storage range need to be exchanged with the non-critical content.

[0103] In some possible application scenarios, the physical memory randomly allocated by the electronic device to the process (i.e., the memory space obtained through DDR) is non-continuous memory fragments. In this case, each process accesses the corresponding physical memory, which may cause problems such as process access confusion, low efficiency, and physical memory waste. In order to avoid these problems, the electronic device can map the addresses of physical memory and virtual memory, and the system kernel of the electronic device can manage the processes in a unified manner. The physical memory is non-continuous, and the mapped virtual memory is continuous, that is, at the process level, the process can logically access continuous memory in sequence, which can effectively utilize physical memory and improve the efficiency of process access. Furthermore, the mapping relationship between the physical memory and virtual memory corresponding to the process can be represented in the form of a memory mapping file and saved in the memory space corresponding to the process.

[0104] It is understandable that the above-mentioned method of using the preset storage range to aggregate and save the key content and the non-key content is only an example. In some other embodiments, other methods can also be used to aggregate and save the key content and the non-key content.

[0105] In some possible application scenarios, when exchanging non-critical content with critical content, the non-critical content and critical content to be exchanged can be compressed first, and then the compressed critical content of the compressed non-critical content can be exchanged, thereby reducing the storage space occupied during the exchange operation, and also reducing the transmission amount during the exchange operation, speeding up the exchange operation.

[0106] In some other possible application scenarios, when non-critical content is written to a disk for storage, the non-critical content may be compressed and then written, thereby reducing the amount of transmission during the write operation and speeding up the movement of the non-critical content.

[0107] S603: When the electronic device is in the STR state, power is supplied to the memory unit storing key contents on the DDR, and power is stopped for other memory units except the memory unit.

[0108] As mentioned above, DDR provides memory, and DDR is composed of at least one memory unit (or memory particle).

[0109] In some embodiments, the electronic device may first determine the memory capacity that each memory unit can provide, or obtain the address of each memory unit, wherein the address of each memory unit may indicate the memory capacity that each memory unit can provide, for example, Figure 8As shown in (a), the address of the first memory unit is 0-1GB, which means that the memory capacity that the first memory unit can provide is 1GB, the address of the second memory unit is 1GB-2GB, which means that the memory capacity that the second memory unit can provide is also 1GB, the address of the third memory unit is 2GB-3GB, which means that the memory capacity that the third memory unit can provide is also 1GB, and so on. The memory capacity that each memory unit can provide is 1GB.

[0110] After obtaining the address of the memory unit, the electronic device can continue to determine the target number of memory units to be powered according to the address of each memory unit and the total amount of memory occupied by the key content. For example, according to the address of each memory unit, it can be determined that the memory capacity provided by each memory unit is 1GB, and the total amount of memory occupied by the key content is 2.8GB. Figure 8 As shown in (b), the target number of memory cells to be powered is 3.

[0111] It is understandable that the principle of determining the target number is to ensure that the target number is the minimum and the total memory capacity provided by the target number of memory units is greater than the total memory occupied by the key content. In addition, in some application scenarios, since the electronic device can centrally store the key content in the preset storage range of DDR, a smaller target number can be determined for the centrally stored key content.

[0112] Finally, the electronics powers the target number of memory cells. Figure 8 The first three memory cells in (b) are powered on, while the other memory cells are powered off, thereby reducing the power consumption of the electronic device.

[0113] The device control method in the above embodiment can save the key content in the DDR when the electronic device is in the STR state, and power the memory unit that stores the key content to ensure that the key content can be read and loaded at any time, and the electronic device cuts off power to other memory units, thereby avoiding unnecessary resource consumption and reducing the power consumption of the electronic device.

[0114] In the above embodiments, the device control method is described by taking the electronic device entering the STR state as an example. In some other embodiments, when the electronic device is in the STR state, it can also be awakened to resume normal working state. Fig. 9 As shown, the device control method in the embodiment of the present application may also include the following steps S901-S903.

[0115] S901: When the electronic device is in the STR state, a first wake-up operation for waking up the electronic device is received.

[0116] The first wake-up operation may refer to an operation of a user triggering the electronic device to wake up, such as pressing a power button or a power button of the electronic device, touching a display screen or a touch pad of the electronic device, inputting a fingerprint on the display screen or the touch pad of the electronic device, etc. In addition, the first wake-up operation may also refer to an operation of a user operating a peripheral connected to the electronic device, such as moving a mouse, pressing any key on a keyboard, etc.

[0117] S902: In response to the first wake-up operation, the electronic device resumes running the process corresponding to the key content according to the key content stored in the DDR, and saves the non-key content in the disk into the DDR.

[0118] It is understandable that there is no order restriction for the operation of the electronic device to restore the process corresponding to the critical content and the operation of saving the non-critical content to the DDR, that is, the process corresponding to the critical content can be restored first, and then the non-critical content can be saved to the DDR; or the non-critical content can be saved to the DDR first, and then the process corresponding to the critical content can be restored; or, the non-critical content can be saved to the DDR while the process corresponding to the critical content is restored. This is not specifically limited in the embodiments of the present application.

[0119] With reference to the aforementioned embodiments, the key content may represent the content stored in the memory space corresponding to processes such as the foreground process and the system process, and may provide the user with an interface or function that can be intuitively seen or experienced. During the recovery process, the electronic device may first resume running the process corresponding to the key content based on these contents, thereby first restoring the interface or function that the user can intuitively see or experience.

[0120] It is understandable that when the user can intuitively see or experience the interface or function of the electronic device, the user's experience is that the electronic device has been awakened and the recovery phase has ended. In addition, the electronic device needs to enter the working state normally after the recovery is completed. When in the working state, the foreground process, background process, system process, etc. of the electronic device must run normally. Therefore, when the electronic device resumes the process corresponding to the key content, it can read the non-critical content stored in the disk back to the DDR for storage, so as to prepare for the electronic device to continue to enter the normal working state.

[0121] Because when the electronic device is in the STR state, only some memory units that store critical content are powered, while other memory units are not powered and cannot store content. Therefore, in some embodiments, the electronic device can first respond to the first wake-up operation to restore power to all memory units of the DDR or restore power to the content units that have been powered off, and after power is restored, the non-critical content in the disk is saved to the DDR to ensure that the non-critical content can be saved by the DDR.

[0122] In some possible application scenarios, when reading non-critical content back to DDR, the non-critical content may be compressed and then read, thereby reducing the amount of transmission during the read operation and speeding up the reading of the non-critical content.

[0123] S903: After the process corresponding to the critical content is resumed, or after the screen of the electronic device is unlocked, the electronic device continues to resume the process corresponding to the non-critical content according to the non-critical content in the DDR.

[0124] In some possible application scenarios, the user can set the electronic device to display the lock screen page after being awakened. After the user enters the login password to unlock the screen, the electronic device will be fully restored to normal working state. In this case, the functions or processes corresponding to the interface that can be provided by the electronic device when displaying the lock screen page can be regarded as the foreground process, system process and other processes mentioned above. Furthermore, the content stored in the memory space corresponding to these processes is the key content. After the electronic device is awakened, the key content is loaded first, which can provide the user with some necessary display content as soon as possible to meet the user's needs on the lock screen page.

[0125] Furthermore, after the screen of the electronic device is unlocked, the electronic device continues to resume running background processes based on non-critical content in the DDR, so that the background processes of the electronic device can also run normally, ensuring the normal working state of the electronic device.

[0126] In some other possible application scenarios, after being awakened, the electronic device may not display the lock screen page and directly enter the working state. In this case, the electronic device may first resume running the foreground process, system process and other processes according to the key content in the DDR, and then resume running the background process according to the non-key content after the process corresponding to the key content resumes running, so as to ensure that the electronic device can enter the working state normally after being awakened from the STR state.

[0127] It can be seen that in the above device control method, when an electronic device in the STR state is awakened, the electronic device can first restore the corresponding process according to the key content saved in the DDR, and provide the user with necessary interfaces, applications or functions, etc. to ensure the normal operation of the electronic device, instead of restoring the corresponding process according to non-critical content first, thereby speeding up the recovery speed of the electronic device after being awakened and ensuring the user's experience.

[0128] In the above embodiment, the device control method is described by taking the electronic device entering the STR state as an example. In some other embodiments, the electronic device can also be triggered to enter the STD state, and before entering the STD state, the electronic device can be in the S0, S1, S2 or STR state shown in the above embodiments. When the electronic device is in the S0, S1, S2 or STR state, since the electronic device has allocated memory space for the currently running process, the corresponding memory content is already stored in the memory space of the electronic device. Based on this, Fig.10 As shown, the device control method in the embodiment of the present application may also include the following steps S1001-S1006.

[0129] S1001: The electronic device receives a second event, and enters a STD state in response to the second event.

[0130] The second event may be triggered by a user; and / or the second event may be a preset device event, wherein the device event includes the second preset duration of time that the electronic device is in the screen-off state.

[0131] In some possible application scenarios, when a user triggers an electronic device to enter the STD state, the user's triggering operation may include pressing the power button or the on / off button of the electronic device, clicking a control or physical key (or button) provided on the electronic device to control the electronic device to enter the STD state, a physical key (or button), etc. In this case, the user's triggering operation can be regarded as the second event mentioned above.

[0132] Exemplarily, the control on the electronic device that controls the electronic device to enter the STD state can be a "hibernate" or "sleep" control displayed on the electronic device, or the user can control the electronic device to enter the STD state by pressing the power button, the on / off button, etc. a preset number of times.

[0133] And, it is understandable that, since electronic devices of different manufacturers or models have different configurations, the controls that are triggered to enter the STD state may be different between electronic devices of different manufacturers or models, and the controls that are triggered to enter the STR state may also be different; for electronic devices of the same manufacturer or model, the controls that are triggered to enter the STD state and the controls that are triggered to enter the STR state are different. For example, for electronic devices 1 and 2 of different models, the user triggers electronic device 1 to enter the STR state (or STD state) by clicking a control such as "sleep", and can trigger electronic device 2 to enter the STR state (or STD state) by clicking a control such as "sleep"; or, for electronic device 3, the user can trigger electronic device 3 to enter the STR state by clicking a control such as "sleep", and trigger electronic device 3 to enter the STD state by clicking a control such as "sleep". The embodiments of the present application do not specifically limit the controls, buttons, etc. that trigger the electronic device to enter the STR state or STD state.

[0134] In some other possible application scenarios, the user can also control the electronic device to enter the screen-off state or the cover-closed state when the electronic device is not in use temporarily. When the electronic device is in the screen-off state or the cover-closed state, if the user still does not use the electronic device for a long time, the electronic device can automatically enter the STD state. Exemplarily, the electronic device can start timing when it is in the screen-off state or the cover-closed state. After a second preset time (for example, 30 minutes, 40 minutes, etc.), if no operation to wake up the electronic device (such as moving the mouse, clicking a keyboard button, opening the cover, etc.) is received, the electronic device automatically enters the STD state. In this case, when the electronic device detects that it is in the screen-off state or the cover-closed state for the second preset time, it can be regarded as receiving the above-mentioned second event.

[0135] In some possible application scenarios, the electronic device may classify the memory content before receiving the second event. In other possible application scenarios, the electronic device may classify the memory content after receiving the second event or when the electronic device is in the STD state.

[0136] With reference to the contents of the aforementioned embodiments, the electronic device can classify the memory contents in the memory space according to the process type corresponding to the memory space. For example, according to the tag information corresponding to the memory space mentioned in the aforementioned embodiments, the process type corresponding to the contents in the memory space is determined, and when the process type is a system process, a foreground process, or the like, the corresponding memory content is the key content; when the process type is a background process, or the like, the corresponding memory content is the non-key content. For another example, according to the process information corresponding to the memory space, the corresponding process type is determined. If it is a system process, a foreground process, or the like, the content stored in the memory space is the key content; and if it is a background process, or the like, the content stored in the memory space is the non-key content.

[0137] S1002: When the electronic device is in the STD state, the key content and the non-key content are respectively stored in the disk of the electronic device.

[0138] Since the STD state indicates a state of suspending to disk, when in this state, the electronic device needs to write the content in DDR to the disk for storage.

[0139] In some embodiments, after determining the memory content type corresponding to each memory space, the electronic device may first continue to retain the key content in the DDR and aggregate it, and aggregate the non-key content in the DDR, and after aggregation, read the key content and the non-key content out of the DDR and write them to the disk for storage. The method of aggregating the key content can refer to the method of exchanging the non-key content in the preset storage range with the key content outside the preset storage range in the aforementioned embodiment, which will not be repeated here.

[0140] The aggregated key content and non-key content are respectively stored in corresponding memory spaces in DDR. Accordingly, when writing to the disk, the electronic device may also store the key content in one storage area of ​​the disk and the non-key content in another storage area of ​​the disk.

[0141] In some possible application scenarios, the electronic device may directly enter the STD state in response to the second event described above. In this case, the electronic device needs to classify the memory content in the memory space.

[0142] In other possible application scenarios, if the electronic device is already in the STR state, if the user has not used the electronic device for a long time, the electronic device may also automatically enter the STD state. Exemplarily, the electronic device may start timing when it is in the STR state, and after a third preset time (e.g., 10 minutes, 20 minutes, etc.), if no operation to wake up the electronic device (e.g., moving the mouse, clicking a keyboard button, opening the cover, etc.) is received, the electronic device automatically enters the STD state. In this case, when the electronic device detects that it is in the STD state for the third preset time, it can be regarded as receiving the above-mentioned second event.

[0143] It is understandable that if the electronic device receives the second event in the S0 state (such as normal working state), S1 state or S2 state (such as screen off state, cover closed state, etc.), it can refer to the above embodiment to write both the key content and the non-key content to the disk for storage. If the electronic device automatically enters the STD state in the STR state, then since the electronic device has classified the memory content in the memory space and written the non-key content to the disk when it is in the STR state, when the electronic device is in the STD state, there is no need to classify the memory content in the memory space, nor to write the non-key content to the disk, and the key content can continue to be written to the disk.

[0144] S1003: When the electronic device is in the STD state, receiving a second wake-up operation for waking up the electronic device.

[0145] The second wake-up operation may refer to an operation in which a user triggers the electronic device to wake up, such as pressing a power button or a power button of the electronic device.

[0146] S1004: In response to the second wake-up operation, the electronic device saves the key content in the disk to the DDR, and resumes running the process corresponding to the key content according to the key content in the DDR.

[0147] Since the electronic device will save both critical content and non-critical content in the disk when it is in the STD state, when the electronic device is awakened from the STD state, it is necessary to read the critical content saved in the disk back to the DDR, and resume running the foreground process, system process and other processes according to the critical content, so as to first restore the interface or function that the user can intuitively see or experience. In addition, during the recovery process, the electronic device will not resume running the background process according to the non-critical content first, so as to speed up the recovery speed of the electronic device after being awakened and ensure the user experience.

[0148] In some embodiments, when the electronic device is in the STD state, all memory units of the DDR of the electronic device are powered off or cut off. When the electronic device receives the second wake-up operation, it can first respond to the second wake-up operation to restore power to all memory units of the DDR or restore power to the memory units that are powered off on the DDR, and after power is restored, read the key content in the disk back to the DDR to ensure that the key content can be saved by the DDR.

[0149] S1005. While resuming the process corresponding to the critical content, the electronic device saves the non-critical content in the disk into the DDR.

[0150] It is understandable that there is no order restriction for the operation of the electronic device to resume the operation of the process corresponding to the critical content and the operation of saving the non-critical content in the disk to the DDR, that is, the process corresponding to the critical content can be resumed first, and then the non-critical content can be saved to the DDR; or the non-critical content can be saved to the DDR first, and then the process corresponding to the critical content can be resumed; or, the non-critical content can be saved to the DDR while the process corresponding to the critical content is resumed. This is not specifically limited in the embodiments of the present application.

[0151] S1006: After the process corresponding to the critical content is resumed, or after the screen of the electronic device is unlocked, the electronic device continues to resume the process corresponding to the non-critical content according to the non-critical content in the DDR.

[0152] With reference to the aforementioned embodiment, the user can set the electronic device to display the lock screen page after being awakened, and after the user enters the login password to unlock the screen, the electronic device will be completely restored to normal working state. In this case, after the electronic device is awakened, it will first resume running the foreground process, system process and other processes according to the key content, and can provide the user with some necessary display content or functions as soon as possible to meet the user's needs on the lock screen page, while improving the recovery speed of the electronic device. After the screen of the electronic device is unlocked, the electronic device continues to resume running the background process according to the non-critical content in the DDR, so that the background process of the electronic device can also operate normally, ensuring the normal working state of the electronic device.

[0153] Alternatively, after being awakened, the electronic device may enter the working state directly without displaying the lock screen page. In this case, the electronic device may first resume the corresponding process according to the key content in the DDR, and then resume the corresponding process according to the non-key content, which can also improve the recovery speed of the electronic device and ensure that the electronic device can enter the working state normally after resuming from the STD state.

[0154] In some other possible application scenarios, the electronic device can also respond to the second wake-up operation and read both the key content and the non-key content in the disk back to the DDR. After reading, the electronic device still resumes the corresponding process according to the key content in the DDR first, and resumes the interface or function that the user can intuitively see or experience first. Then, the electronic device continues to resume the corresponding process according to the non-key content.

[0155] In the above device control method, when an electronic device in the STD state is awakened, the electronic device can first restore the corresponding process according to the key content saved in the DDR, and provide the user with necessary interfaces, applications or functions, etc. to ensure the normal operation of the electronic device, instead of restoring the corresponding process according to non-critical content first, thereby speeding up the recovery speed of the electronic device after being awakened and ensuring the user's usage experience.

[0156] By using the above-mentioned device control method provided in the embodiment of the present application to control the electronic device, the power consumption of the electronic device for powering DDR can be reduced when the electronic device is in the STR state. For example, referring to the following Table 1, for the 16GB fourth-generation DDR (such as DDR4) at 25°C, the electronic device consumes about 37mW of power when powering all memory units. If the electronic device is in the STR state, the memory unit that stores the key content is about 8GB, then the electronic device consumes about 18.5mW of power for these memory units. It can be seen that the electronic device can save about 37-18.5=18.5mW of power by using the device control method in the embodiment of the present application. For the 16GB fifth-generation DDR (such as DDR5) at 25°C, the electronic device consumes about 10mW of power when powering all memory units. If the electronic device is in the STR state, the memory unit that stores the key content is about 8GB, then the electronic device consumes about 8mW of power for these memory units. It can be seen that the electronic device can save about 10-8=2mW of power by using the device control method in the embodiment of the present application.

[0157] Also, referring to Table 1, when DDR is at different temperatures, electronic devices can reduce power consumption by about 50% for 16GB DDR4, and can reduce power consumption by about 20% for 16GB DDR5.

[0158] Table 1

[0159]

[0160] In addition, for the above-mentioned DDR4, when the above-mentioned device control method provided in the embodiment of the present application is used to control the electronic device, since the key content stored in the DDR accounts for approximately 50% of the total DDR memory, the key content is loaded first after the electronic device is awakened from the STR state or the STD state, thereby speeding up the recovery speed of the electronic device by approximately 50%.

[0161] In some schemes, multiple embodiments of the present application can be combined, and the combined scheme can be implemented. Optionally, some operations in the process of each method embodiment are optionally combined, and / or the order of some operations is optionally changed. In addition, the execution order between the steps of each process is only exemplary and does not constitute a restriction on the execution order between the steps. There can also be other execution orders between the steps. It is not intended to show that the execution order is the only order in which these operations can be performed. A person of ordinary skill in the art will think of a variety of ways to reorder the operations described in the embodiments of the present application. In addition, it should be noted that the process details involved in a certain embodiment of the present application are also applicable to other embodiments in a similar manner, or different embodiments can be used in combination.

[0162] In addition, some steps in the method embodiment may be equivalently replaced by other possible steps. Alternatively, some steps in the method embodiment may be optional and may be deleted in certain usage scenarios. Alternatively, other possible steps may be added to the method embodiment.

[0163] Furthermore, the various method embodiments may be implemented separately or in combination.

[0164] It is understandable that in order to implement the above functions, the aforementioned electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.

[0165] In this embodiment, the electronic device can be divided into functional modules according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0166] The present application also provides an electronic device, such as Fig.11 As shown, the electronic device may include one or more processors 1101 , an internal memory 1102 , a communication interface 1103 and an external memory 1105 .

[0167] The internal memory 1102 , the communication interface 1103 , and the external memory 1105 are coupled to the processor 1101 . For example, the internal memory 1102 , the communication interface 1103 , the external memory 1105 , and the processor 1101 may be coupled together via a bus 1104 .

[0168] The internal memory 1102 may be the memory in the previous embodiment, and specifically may include the RAM, DDR, memory stick, etc. in the previous embodiment. The external memory 1105 may include the disk, hard disk, USB disk, magnetic disk, optical disk, etc. in the previous embodiment.

[0169] Among them, the communication interface 1103 is used to transmit data with other devices. Computer program code is stored in the internal memory 1102. The computer program code includes computer instructions. When the computer instructions are executed by the processor 1101, the electronic device executes the above-mentioned device control method in the embodiment of the present application. In some possible application scenarios, when the electronic device is in the STR state, the key content in the internal memory 1102 is saved in the external memory 1105, and when the electronic device is in the STD state, the key content and non-key content in the internal memory 1102 are saved in the external memory 1105.

[0170] Among them, the processor 1101 can be a processor or a controller, for example, it can be a central processing unit (CPU), a general processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the contents of the embodiments of the present application. The processor can also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0171] The bus 1104 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus 1104 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.11 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0172] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program code is stored. When the above-mentioned processor executes the computer program code, the processor executes the relevant method steps in the above-mentioned method embodiment.

[0173] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute the relevant method steps in the above method embodiment.

[0174] Among them, the electronic device, computer storage medium or computer program product provided in this application is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.

[0175] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned 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.

[0176] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0177] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0178] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0179] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), DDR, disk or optical disk and other media that can store program codes.

[0180] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A device control method, characterized in that: include: receiving a first event, and in response to the first event, controlling the electronic device to enter a suspend-to-memory STR state; When the electronic device is in the STR state, the key content in the memory of the electronic device continues to be stored in the memory, and the non-key content in the memory is stored in the disk of the electronic device; the key content is used to represent the necessary data corresponding to the process supporting the operation of the electronic device; The memory unit storing the key content in the memory is powered, and the other memory units except the memory unit are powered off.

2. The method according to claim 1, characterized in that The memory is used to provide memory space for the process running on the electronic device; the memory space is used to store necessary data for the process running; when the process type corresponding to the memory space is a foreground process or a system process, the content in the memory space is the key content; When the process type corresponding to the memory space is a background process, the content in the memory space is the non-critical content.

3. The method according to claim 1 or 2, characterized in that: Continuing to store the key content in the memory includes: Determining a preset storage range of the memory according to the total amount of memory occupied by the key content in the memory; The non-critical content in the preset storage range is exchanged and stored with the critical content outside the preset storage range until there is no non-critical content in the preset storage range.

4. The method according to claim 3, characterized in that Saving the non-critical content in the memory in a disk of the electronic device includes: After each non-critical content in the preset storage range is exchanged and stored outside the preset storage range, each non-critical content is stored in a disk of the electronic device.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: When the electronic device is in the STR state, receiving a first wake-up operation to wake up the electronic device; In response to the first wake-up operation, according to the key content stored in the memory, the process corresponding to the key content is resumed, and the non-key content in the disk is saved in the memory; After the process corresponding to the critical content is resumed, or after the screen of the electronic device is unlocked, the process corresponding to the non-critical content is resumed based on the non-critical content in the memory.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: receiving a second event, and in response to the second event, controlling the electronic device to enter a suspend to disk STD state; When the electronic device is in the STD state, the critical content and the non-critical content are respectively stored in a disk of the electronic device.

7. The method according to claim 6, characterized in that The method further comprises: When the electronic device is in the STD state, receiving a second wake-up operation to wake up the electronic device; In response to the second wake-up operation, the key content in the disk is saved in the memory, and according to the key content in the memory, the process corresponding to the key content is resumed; When the process corresponding to the critical content resumes running, saving the non-critical memory in the disk into the memory; After the process corresponding to the critical content is resumed, or after the screen of the electronic device is unlocked, the process corresponding to the non-critical content is resumed based on the non-critical content in the memory.

8. The method according to any one of claims 1 to 7, characterized in that: The step of supplying power to a memory unit storing the key content on the memory includes: Obtaining the address of each memory unit in the memory; According to the address of each of the memory cells and the total amount of memory occupied by the key content, a target number of memory cells to be powered is determined, and power is supplied to the target number of memory cells.

9. The method according to any one of claims 1 to 8, characterized in that: The first event is triggered by a user, and the first event includes a user clicking one or more of a control, a button, and a key that controls the electronic device to enter the STR state; and / or, The first event is a preset device event, and the device event includes a first preset duration that the electronic device is in the screen-off state.

10. The method according to claim 6, characterized in that The second event is triggered by a user, and the second event includes a user clicking one or more of a control, a button, and a key that controls the electronic device to enter the STD state; and / or, The second event is a preset device event, and the device event includes a second preset duration of time that the electronic device is in the screen-off state.

11. A device control method, characterized in that: include: The power management module receives a first event, and in response to the first event, controls the electronic device to enter a suspend-to-memory STR state; When the electronic device is in the STR state, the classification storage module continues to store the key content in the memory of the electronic device in the memory, and stores the non-key content in the memory in the disk of the electronic device; the key content is used to represent the necessary data corresponding to the process supporting the operation of the electronic device; The power supply driver supplies power to the memory unit storing the key content on the memory, and stops supplying power to other memory units except the memory unit.

12. The method according to claim 11, characterized in that The method further comprises: The memory exchange module determines a preset storage range of the memory according to the total amount of memory occupied by the key content in the memory; The memory exchange module exchanges and stores the non-critical content in the preset storage range with the critical content outside the preset storage range until the non-critical content no longer exists in the preset storage range.

13. The method according to claim 11 or 12, characterized in that: The method further comprises: When the electronic device is in the STR state, the power management module receives a first wake-up operation to wake up the electronic device, and sends a first notification to the processing module; The processing module receives the first notification, and according to the key content stored in the memory, resumes the process corresponding to the key content, and saves the non-key content in the disk to the memory; After the process corresponding to the critical content is resumed, or after the screen of the electronic device is unlocked, the processing module continues to resume the process corresponding to the non-critical content according to the non-critical content in the memory.

14. The method according to claim 11, characterized in that The method further comprises: The power management module receives a second event, and in response to the second event, controls the electronic device to enter a suspend to disk STD state; When the electronic device is in the STD state, the classification storage module stores the key content and the non-key content in the disk of the electronic device respectively.

15. The method according to claim 14, characterized in that The method further comprises: When the electronic device is in the STD state, the power management module receives a second wake-up operation to wake up the electronic device, and sends a second notification to the processing module; The processing module receives the second notification, saves the key content in the disk into the memory, and resumes running the process corresponding to the key content according to the key content in the memory; The processing module saves the non-critical content in the disk to the memory when resuming the process corresponding to the critical content; After the process corresponding to the critical content is resumed, or after the screen of the electronic device is unlocked, the processing module continues to resume the process corresponding to the non-critical content according to the non-critical content in the memory.

16. The method according to any one of claims 11 to 15, characterized in that: The power driver supplies power to a memory unit storing the key content on the memory, including: The power driver obtains the address of each memory unit in the memory; The power driver determines the target number of memory cells to be powered according to the address of each memory cell and the total amount of memory occupied by the key content, and supplies power to the target number of memory cells.

17. An electronic device, characterized in that: It includes a disk, a memory, and one or more processors; the memory and the disk are coupled to the processor respectively; the memory stores computer program code, and the computer program code includes computer instructions. When the computer instructions are executed by the processor, the electronic device executes the device control method as described in any one of claims 1 to 10, or executes the device control method as described in any one of claims 11 to 16.

18. The electronic device according to claim 17, characterized in that: When the electronic device is in the STR state, the disk is used to save the critical content in the memory, and when the electronic device is in the STD state, the disk is used to save the critical content and the non-critical content in the memory.

19. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, enable the electronic device to execute the device control method as claimed in any one of claims 1 to 10, or execute the device control method as claimed in any one of claims 11 to 16.

Citation Information

Patent Citations

  • Power consumption control method and electronic equipment

    CN107092340A

  • An electronic device and a control method

    CN109976504A

  • Deep sleep method, awakening method and sleep and awakening method of system on chip

    CN111506351A

  • Device dormancy method and computing device

    CN113467923A

  • Electronic device, power saving control method for the same, and program

    JP2010191951A