Equipment wakeup method and related device
By dividing the peripherals of the device into two categories: necessary and non-essential, priority is given to wake up and restore the process scheduling of the required peripherals, and then dealing with non-essential peripherals, the problem of long wake-up time of existing devices is solved, and faster device wake-up and better user experience is achieved.
Patent Information
- Application Number
- CN202311724640.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-14
- Publication Date
- 2025-06-17
AI Technical Summary
The existing device wake-up method requires the peripherals to wake up one by one, resulting in the device wake-up time, the user wait time is too long, and the experience is poor.
By dividing peripherals into required wake-up peripherals and non-necessary wake-up peripherals, priority is given to wake up and restore the process scheduling of the required peripherals, and then wake up the non-necessary peripherals. When the system enters the working state, there is no need to wait for the process scheduling of all peripherals to resume.
It shortens the total time it takes for the device to wake up all peripherals, speeds up the device to wake up, and improves the user experience.
Smart Images

Figure CN120162086A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technologies, and in particular, to a device wake-up method and related devices. Background Art
[0002] Currently, devices such as desktop computers and laptop computers usually include a large number of peripherals, such as keyboards, mice, displays, and so on. When waking up a device, it is usually necessary to first wake up the peripherals of the device and restore the system scheduling before the system can be controlled to enter the working state, such as starting the display of the display screen, logging in to the desktop, and so on. This makes the device wake-up take a long time, resulting in a long waiting time for the user and a poor experience. Summary of the Invention
[0003] This application provides a device wake-up method and related devices. This method can wake up multiple peripherals in the system at the same time, and after the process scheduling of some peripherals is restored, the system can be controlled to enter the working state, accelerating the device wake-up speed.
[0004] In a first aspect, an embodiment of this application provides a device wake-up method, which includes: an electronic device detects a wake-up operation; the electronic device wakes up a first peripheral, restores the process scheduling of the first peripheral, and wakes up a second peripheral, restores the process scheduling of the second peripheral; after the process scheduling of the first peripheral is restored, the electronic device controls the system to enter the working state.
[0005] When implementing the method provided by the embodiment of this application, when starting to wake up, the electronic device can wake up multiple devices at the same time, which can shorten the total time consumed by the electronic device to wake up all peripherals, and after the process scheduling of the first peripheral is restored, the system can be controlled to enter the working state, accelerating the device wake-up speed.
[0006] In combination with the first aspect, in a possible implementation manner, the system does not need to wait for the process scheduling of the second peripheral to be restored before entering the working state.
[0007] That is to say, before the system enters the working state, the electronic device does not need to complete the restoration of the process scheduling of the second peripheral, reducing the work content that needs to be completed before the system enters the working state, accelerating the speed at which the system enters the working state, and thus accelerating the device wake-up speed.
[0008] In combination with the first aspect, in a possible implementation manner, the first peripheral includes the peripherals that must be woken up for the system to enter the working state.
[0009] The first peripheral can refer to the peripherals that must be woken up. It can be seen that after starting to wake up, the electronic device can first ensure that the peripherals that must be woken up are woken up and restore the process scheduling of the peripherals that must be woken up, ensuring that the system can enter the working state as soon as possible.
[0010] In combination with the first aspect, in a possible implementation, the second peripheral device includes a peripheral device that does not necessarily need to be awakened when the system enters the working state.
[0011] The second peripheral device may refer to a non-essential wake-up peripheral device. It can be seen that after the electronic device is started and awakened, it can first ensure that the essential wake-up peripheral devices are awakened and resume the process scheduling of the essential wake-up peripheral devices. For non-essential wake-up peripheral devices, there is no need to limit that their process scheduling recovery must be completed before the system enters the working state, decoupling the system wake-up of non-essential wake-up peripheral devices from the main process of system wake-up.
[0012] In combination with the first aspect, in a possible implementation, the electronic device controls the system to enter the working state, specifically including: the electronic device turns on the screen or displays the login interface of the system account or displays the user interface before hibernation or sleep.
[0013] It can be seen that after the electronic device completes the wake-up of the first peripheral device and the recovery of the process scheduling of the first peripheral device, it can turn on the screen, or display the login interface of the system account, or display the user interface of light hibernation or sleep, accelerating the device wake-up speed from the user's perception.
[0014] In combination with the first aspect, in a possible implementation, the first peripheral device includes one or more of the following: clock, power management unit PMU, direct memory access DMA controller, inter-core communication module IPC, system memory management unit SMMU, input / output microcontroller unit IOMCU, general-purpose input / output port GPIO controller, high-speed serial computer expansion bus standard PCIE controller, universal flash storage UFS controller, graphics processing unit GPU, data processing unit DPU, display screen.
[0015] In combination with the first aspect, in a possible implementation, the second peripheral device includes one or more of the following: universal serial bus USB controller, universal serial bus USB extender, keyboard, mouse, memory, network card, Wi-Fi chip, Bluetooth chip, camera.
[0016] In combination with the first aspect, in a possible implementation, the first peripheral device includes a first sub-peripheral device, and the wake-up of the first sub-peripheral device depends on the wake-up of the second sub-peripheral device. The second sub-peripheral device belongs to the first peripheral device or the second peripheral device. The electronic device wakes up the first peripheral device, specifically including: the electronic device wakes up the first sub-peripheral device after the second sub-peripheral device is awakened.
[0017] It can be seen that if the essential wake-up peripheral devices include peripheral devices that depend on the wake-up of other peripheral devices, then when waking up the peripheral devices, it can first ensure that the other peripheral devices they depend on are awakened first, so as to ensure the successful wake-up of the essential wake-up peripheral devices.
[0018] In combination with the first aspect, in a possible implementation, the first peripheral device includes a third sub-peripheral device, the second peripheral device includes a fourth sub-peripheral device, and the wake-up of the fourth sub-peripheral device depends on the wake-up of the third sub-peripheral device. For the electronic device to wake up the second peripheral device, it specifically includes: after the third sub-peripheral device wakes up, the electronic device wakes up the fourth sub-peripheral device.
[0019] It can be seen that if there are peripherals that depend on each other for wake-up among the essential wake-up peripherals and the non-essential wake-up peripherals, and the peripherals included in the non-essential wake-up peripherals depend on the peripherals included in the essential wake-up peripherals, then the electronic device can wake up the peripherals that depend on wake-up in the non-essential wake-up peripherals after the peripherals that are depended on in the essential wake-up peripherals wake up. And, since the electronic device does not need to wait for the wake-up of the non-essential wake-up peripherals, even if there are peripherals that depend on each other for wake-up between the non-essential wake-up peripherals and the essential wake-up peripherals, the electronic device does not need to wait for all the mutually dependent devices to wake up completely, weakening the wake-up dependency relationship between the peripherals that support synchronous wake-up and effectively shortening the time it takes for the electronic device 100 to enter the working state.
[0020] In combination with the first aspect, in a possible implementation, the second peripheral device includes a fifth sub-peripheral device and a sixth sub-peripheral device, and the wake-up of the sixth sub-peripheral device depends on the wake-up of the fifth sub-peripheral device. For the electronic device to wake up the second peripheral device, it specifically includes: the electronic device first wakes up the fifth sub-peripheral device and then wakes up the sixth sub-peripheral device.
[0021] That is to say, if there are peripherals that depend on each other for wake-up in the non-essential wake-up peripherals, even if these mutually dependent peripherals can only be serially woken up one by one, the electronic device does not need to wait for their serial wake-up process. As long as the process scheduling of the essential wake-up peripherals resumes, the system can enter the working state.
[0022] In combination with the first aspect, in a possible implementation, for the electronic device to wake up the second peripheral device, it specifically includes: the electronic device wakes up multiple peripherals in the second peripheral device in parallel.
[0023] It can be seen that the electronic device can wake up multiple peripherals in the non-essential wake-up peripherals in parallel, accelerating the speed of waking up the peripherals.
[0024] In combination with the first aspect, in a possible implementation, the wake-up order of each peripheral in the second peripheral device is determined by the electronic device according to the user's usage frequency of the peripheral. Among them, the higher the user's usage frequency of the peripheral, the earlier the wake-up order.
[0025] In this way, it can be ensured as much as possible that the peripherals with higher user frequencies can be woken up first. Even if the electronic device does not wake up all the peripherals, it can also ensure the user's normal use of the electronic device 100 as much as possible.
[0026] In combination with the first aspect, in a possible implementation, the electronic device wakes up the first peripheral device, specifically including: the electronic device wakes up the first peripheral device through the main thread; the electronic device wakes up the second peripheral device, specifically including: the electronic device wakes up the second peripheral device through an asynchronous thread.
[0027] The asynchronous thread is a thread different from the main thread. The asynchronous thread is a new thread separately created by the kernel and is specifically used to handle asynchronous transactions. It is at the same level as the main thread and can run simultaneously with the main thread. This asynchronous thread does not block the operation of the main thread, enabling the electronic device to prioritize waking up the first peripheral device.
[0028] In combination with the first aspect, in a possible implementation, the first peripheral device is determined by the electronic device according to a whitelist, and various peripheral device types belonging to the first peripheral device are preset in the whitelist.
[0029] In this way, the electronic device can classify peripheral devices through the whitelist, quickly distinguish non-essential wake-up peripheral devices and essential wake-up peripheral devices. Moreover, later developers can modify the whitelist again, thereby achieving flexible classification of non-essential wake-up peripheral devices and essential wake-up peripheral devices in the electronic device and dynamically adjusting the peripheral devices included in the non-essential wake-up peripheral devices and essential wake-up peripheral devices.
[0030] In combination with the first aspect, in a possible implementation, the electronic device is a tablet computer, a laptop computer, or a desktop computer.
[0031] In a second aspect, an embodiment of the present application provides an electronic device, including a memory, one or more processors, and one or more programs; when the one or more processors execute the one or more programs, the electronic device implements the method described in the first aspect or any one of the implementation manners in the first aspect.
[0032] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, including a computer program, which is composed of instructions and is a set of instructions. When the computer program runs on the electronic device, the electronic device is caused to execute the method described in the first aspect or any one of the implementation manners in the first aspect.
[0033] In a fourth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on a computer, the computer is caused to execute the method described in the first aspect or any one of the implementation manners in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 It is a schematic diagram of the wake-up timing sequence of the device wake-up method provided by the embodiment of the present application and other technologies;
[0035] Figure 2Schematic diagram of the hardware structure of the electronic device 100 provided by the embodiment of the present application;
[0036] Figure 3 Schematic diagram of the system architecture of the electronic device 100 provided by the embodiment of the present application;
[0037] Figures 4A - 4D Schematic diagram of the application scenario of the device wake-up method provided by the embodiment of the present application;
[0038] Figure 5 Schematic diagram of the overall process of the device wake-up method provided by the embodiment of the present application;
[0039] Figure 6 Schematic diagram of the process of a device wake-up method provided by the embodiment of the present application. Detailed implementation manners
[0040] Next, the technical solutions in the embodiments of the present application will be clearly and elaborately described with reference to the accompanying drawings. Among them, in the description of the embodiments of the present application, unless otherwise specified, " / " means "or". For example, A / B may represent A or B; "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "a plurality of" means two or more than two.
[0041] Hereinafter, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as implying or suggesting relative importance or implicitly indicating the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of the present application, unless otherwise specified, the meaning of "a plurality of" is two or more than two.
[0042] In the following embodiments of this application, the term "user interface (UI)" refers to the media interface for interaction and information exchange between an application or an operating system and a user. It realizes the conversion between the internal form of information and the form acceptable to the user. The user interface is the source code written in specific computer languages such as Java and Extensible Markup Language (XML). The interface source code is parsed and rendered on an electronic device and finally presented as content recognizable by the user. The common manifestation form of the user interface is the graphical user interface (GUI), which refers to the user interface related to computer operations displayed in a graphical way. It can be visual interface elements such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and Widgets displayed on the display screen of an electronic device.
[0043] To accelerate the device wake-up speed, an asynchronous wake-up method is to divide the peripherals into peripherals that support asynchronous wake-up and peripherals that support synchronous wake-up. When the electronic device triggers wake-up, the wake-up process of the peripherals that do not support asynchronous wake-up can be executed in the main thread, and the wake-up process of the peripherals that support asynchronous wake-up can be executed in an asynchronous thread. After that, after the peripherals that do not support asynchronous wake-up are awakened, the main thread waits for the peripherals that support asynchronous wake-up to be awakened. After all the peripherals are awakened, the subsequent processes are executed, including thawing the kernel threads, work queues, user-mode processes, etc. of the peripherals, starting the display screen to light up, and displaying the user interface, etc.
[0044] Among them, asynchronous wake-up is relative to synchronous wake-up. Synchronous wake-up means that the devices are awakened serially one by one, and asynchronous wake-up means that the devices can be awakened in parallel. The peripherals that support asynchronous wake-up can refer to the peripherals that have no dependency relationship with other peripherals and do not need to wait for other peripherals to be awakened before being awakened. For example, Peripheral Component Interconnect Express (PCIE) network cards, Universal Serial Bus (USB) controllers, USB keyboards, USB mice, display screens, etc. The peripherals that support synchronous wake-up can refer to the peripherals that have a dependency relationship with other peripherals and need to wait for other peripherals to be awakened before being awakened. For example, Inter-Integrated Circuit (I2C) controllers, Universal Asynchronous Receiver / Transmitter (UART) controllers, etc.
[0045] It can be seen that, compared with waking up without differentiating peripherals, classifying peripherals into those that support asynchronous wake-up and those that do not support asynchronous sleep wake-up, and waking up these two types of devices separately can, to a certain extent, speed up the device wake-up speed, but the benefit is small. The electronic device still needs to wait for all peripherals to wake up before it can start executing subsequent wake-up processes, such as restoring the process scheduling of peripherals, starting the screen to light up, and displaying the login interface of the system account, etc. The duration that the user waits for the device to wake up has not been significantly improved.
[0046] An embodiment of the present application provides a device wake-up method. This method can classify the peripherals in an electronic device into essential wake-up peripherals and non-essential wake-up peripherals. When the electronic device is triggered to wake up, it can wake up the essential wake-up peripherals, restore the process scheduling of the essential wake-up peripherals, and wake up the non-essential wake-up peripherals, restore the process scheduling of the non-essential wake-up peripherals. After the process scheduling of the essential wake-up peripherals is restored, the system enters the working state.
[0047] Among them, the system entering the working state can include any one of the following: starting the display screen to light up, displaying the login interface of the system account, displaying the user interface before hibernation or sleep, etc.
[0048] In this way, after being triggered to wake up, the electronic device can wake up multiple devices simultaneously, shortening the total duration consumed by the electronic device to wake up all peripherals. And it does not need to wait for all peripherals to wake up and restore the process scheduling before allowing the system to enter the working state. Instead, after the process of the essential wake-up peripherals is restored, the system can enter the working state, reducing the work content that needs to be completed before the system enters the working state and speeding up the device wake-up speed.
[0049] Peripherals, that is, external devices, refer to the devices outside the integrated circuit chip. External devices can be connected to the integrated circuit chip through dedicated circuits and buses.
[0050] Among them, according to the positional relationship between the device and the integrated circuit chip, peripherals can include: on-chip peripherals, off-chip peripherals. On-chip peripherals refer to the devices integrated on the integrated circuit chip but not belonging to the chip itself, such as universal flash storage (UFS) controllers, data processing units (DPUs), graphics processing units (GPUs), clocks, etc. Off-chip peripherals can refer to the devices that are not located on the integrated circuit chip but are externally connected to the integrated circuit chip, such as keyboards, mice, display screens, USB flash drives, network cards, cameras, etc.
[0051] Among them, the peripherals that must be awakened include the peripherals that must be awakened during the system wake-up process, and the peripherals that do not need to be awakened include the peripherals that do not need to be awakened during the system wake-up process. The peripherals necessary for system wake-up refer to the peripherals that affect the system's entry into the working state. If these peripherals are not in the working state, the system cannot enter the working state. The peripherals that do not need to be awakened during system wake-up refer to the peripherals that have no impact on the system's entry into the working state. If these peripherals are not in the working state, the system can still enter the working state. In this way, when the electronic device wakes up, it can first ensure that the devices necessary for system wake-up are awakened, ensure the normal execution of system wake-up, and accelerate the system wake-up speed.
[0052] Before the electronic device wakes up, the electronic device is in a sleep or hibernation state, and at this time, the peripherals in the electronic device are in a suspended state.
[0053] Among them, in the sleep state, the central processing unit (CPU) in the electronic device stops executing instructions, and the data in the memory remains in the memory. In the hibernation state, the CPU in the electronic device stops executing instructions, and the data generated in the original working state is written to the hard disk. After switching to the working state (waking up), the data written to the hard disk will be loaded into the memory as it is, and the system resumes operation.
[0054] Exemplarily, the electronic device can detect the wake-up operation initiated by the user and start the device wake-up. For example, the electronic device can detect the click operation on the power button and start the device wake-up. For the specific method of the electronic device to start waking up, reference can be made to the subsequent method embodiments, which will not be elaborated here first.
[0055] After the electronic device starts to wake up, the system can continue to execute from the instructions where it stopped during the last hibernation or sleep, start the wake-up process, including: enabling the CPU, waking up the on-chip peripherals and off-chip peripherals, restoring the kernel threads, work queues, process scheduling, etc., the display subsystem then starts the display sending process, the system sends the display data to the display screen through the display driver and lights up the display screen, then displays the login interface of the system account, and after the user authentication passes, enters the desktop, and the user can use the system normally to complete the wake-up of the electronic device.
[0056] To better understand the difference between this solution and other technologies, Figure 1 Fig. shows the wake-up timing diagrams of the device wake-up method provided by the embodiments of the present application and other technologies.
[0057] Among them, Figure 1 (a) in shows the wake-up timing diagram without distinguishing peripherals, Figure 1 and (b) in shows the wake-up timing diagram in which the peripherals are divided into peripherals supporting synchronous wake-up and peripherals supporting asynchronous wake-up and are awakened, Figure 1Among them, (c) shows the wake-up timing diagram of the device wake-up method provided by the embodiments of the present application.
[0058] From Figure 1 It can be seen that if the external devices are woken up according to the wake-up timing in (a), the electronic device can only gradually wake up each external device, and it is necessary to wait until all external devices are woken up before the subsequent wake-up process can be executed. The wake-up duration of the device is too long. If the external devices are woken up according to the wake-up timing in (b), the electronic device can wake up the external devices that support synchronous wake-up and the external devices that support asynchronous wake-up at the same time. However, the electronic device still needs to wait until all external devices are woken up before the subsequent wake-up process can be executed, and the number of external devices that support asynchronous wake-up is much larger than the number of external devices that support synchronous wake-up, so the improvement of the device wake-up duration is limited. If the external devices are woken up according to the wake-up timing in (c), the electronic device can not only wake up the necessary external devices and non-necessary external devices at the same time, but also does not need to wait until all external devices are woken up before starting the subsequent wake-up process, which greatly shortens the device wake-up duration.
[0059] Among them, executing the subsequent wake-up process may include, after the external device is woken up, restoring the process scheduling of the external device, such as thawing the kernel thread, work queue, user-mode process, etc. of the external device, and starting the display screen to light up and display the user interface, etc.
[0060] Generally speaking, the device wake-up method provided by the embodiments of the present application can wake up multiple external devices in parallel, shorten the time consumed for waking up the external devices, and moreover, the electronic device does not need to wait until all external devices are woken up or all external devices have restored the process scheduling, which speeds up the system wake-up speed.
[0061] Figure 2 It is a schematic hardware structure diagram of the electronic device 100 provided by the embodiments of the present application.
[0062] As Figure 2 shown, the electronic device 100 may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, as well as a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, a mixed reality (MR) device, an artificial intelligence (AI) device, a wearable device, a vehicle-mounted device, a smart home device, and / or a smart city device. The embodiments of the present application do not impose special restrictions on the specific type of the electronic device 100.
[0063] Optionally, in some embodiments of the present application, the electronic device 100 may be a desktop computer, a laptop computer, a handheld computer, a notebook computer, etc.
[0064] As Figure 2 shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, and a display screen 194, etc. The sensor module 180 may include, but is not limited to, a pressure sensor 180A, a fingerprint sensor 180B, a temperature sensor 180C, a touch sensor 180D, an ambient light sensor 180E, etc.
[0065] It can be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than those shown, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0066] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0067] In some embodiments, the processor 110 can be used to trigger the wake-up of the device when a wake-up operation of the user is detected. Specifically, it can include waking up the peripherals included in the electronic device 100 and resuming the process scheduling of the peripherals. Moreover, the processor 110 can be used to divide the peripherals in the electronic device 100 into essential wake-up peripherals and non-essential wake-up peripherals, and after the essential wake-up peripherals are woken up and the process scheduling is resumed, the screen of the electronic device 100 is turned on.
[0068] The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
[0069] A memory can also be set in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can save the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0070] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0071] In some embodiments, the electronic device 100 can identify one or more peripherals connected to the electronic device 100 through one or more interfaces in the processor 110.
[0072] The wireless communication function of the electronic device 100 can be implemented through an antenna, a wireless communication module 160, a modulation and demodulation processor, a baseband processor, etc.
[0073] The electronic device 100 implements the display function through a GPU, a display screen 194, an application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
[0074] The display screen 194 is used to display images, videos, etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.
[0075] In some embodiments, the display screen 194 can be used to turn on the screen after the necessary wake-up peripherals are woken up and the process scheduling is restored, and after the screen is turned on, display the login interface of the system account, and after the user logs in to a certain system account on this login interface, display the desktop or the user interface displayed before the electronic device 100 goes into hibernation or sleep. For the specific content displayed by the display screen 194 after the electronic device 100 is woken up, please refer to the subsequent Figures 4A - 4D description and will not be elaborated here.
[0076] The electronic device 100 can implement the shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, etc.
[0077] Among them, the internal memory 121 can be used to store computer-executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the sound playback function, the image playback function, etc.). The data storage area can store the data created during the use of the electronic device 100 (such as audio data, phone book, etc.). In addition, the internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0078] In some embodiments, the internal memory 121 can be used to store a whitelist, which can be pre-set with device types belonging to necessary wake-up peripherals and / or non-necessary wake-up peripherals. The electronic device 100 can divide the peripherals in the electronic device 100 into non-necessary wake-up peripherals and necessary wake-up peripherals through this whitelist. For the specific description of the whitelist, please refer to the relevant content in the subsequent Figure 3 and Figure 5 and will not be expanded here.
[0079] The electronic device 100 can implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, and an application processor, etc. For example, music playback, recording, etc.
[0080] As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than limiting them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
[0081] Figure 3 It is a schematic diagram of the system architecture of the electronic device 100 provided by the embodiments of the present application.
[0082] The electronic device 100 can be a portable terminal device equipped with Harmony, iOS, Android, Microsoft, Linux or other operating systems, such as a mobile phone, a tablet computer, a wearable device, etc., and can also be a non-portable terminal device such as a laptop computer with a touch-sensitive surface or a touch panel, a desktop computer with a touch-sensitive surface or a touch panel. In the embodiments of the present application, the Linux operating system is taken as an example to exemplarily illustrate the system architecture of the electronic device 100.
[0083] The user mode and the kernel mode can refer to two running levels of the Linux operating system. When a program runs at the 3-level privilege level, it can be said to be running in the user mode. When a program runs at the 0-level privilege level, it can be said to be running in the kernel mode. In other words, the user mode can refer to a form of resources that users can operate, and the kernel mode can refer to a form of resources that the system kernel can operate. Among them, the basic unit of program execution - a process runs in the user mode. A process has multiple threads. The user mode corresponds to the use of user threads, and the kernel mode corresponds to the use of kernel threads.
[0084] As Figure 3 shown, there are user-mode processes running in the user mode, and the kernel mode can include modules such as a power management module, a device management driver, and a bus driver. Among them:
[0085] The power management module is used to control the wake-up of the device, specifically including: waking up the necessary wake-up peripherals and non-necessary wake-up peripherals in the electronic device 100 respectively, and executing the subsequent wake-up process after the necessary wake-up peripherals are woken up. In addition, the power management module can establish and maintain a device linked list, which can be used to record the necessary wake-up peripherals and / or non-necessary wake-up peripherals in the electronic device 100. In this way, the power management module can realize the parallel wake-up of different types of peripherals according to the device linked list.
[0086] A whitelist can be preset in the device management driver. The electronic device 100 can use this whitelist to classify the peripherals in the electronic device 100 that belong to non-necessary wake-up and necessary wake-up.
[0087] The bus driver can be used to identify all the peripherals in the electronic device 100, including pluggable peripherals and non-pluggable peripherals. Pluggable peripherals refer to those that users can manually disconnect and connect to the main body of the electronic device 100, such as USB flash drives, mice, keyboards, etc. Correspondingly, non-pluggable peripherals can refer to those that users cannot manually disconnect and connect to the main body of the electronic device 100. And, the bus driver can also update the peripherals recognized on the electronic device 100 in real time according to the access and disconnection of the peripherals. Taking pluggable peripherals as an example, when a pluggable peripheral is connected to the main body of the electronic device 100, the bus driver can recognize the access of the peripheral, read the device information of the peripheral, and call the interface for adding a device to register the peripheral in the device linked list maintained by the power management module. If the peripheral disconnects from the main body of the electronic device 100, the bus driver can recognize the disconnection of the peripheral and delete the peripheral from the device linked list.
[0088] In specific implementation, the bus driver can recognize all the peripherals connected to the electronic device 100 and register all the currently connected peripherals in the device linked list. The device management driver can classify the peripherals registered in the device linked list according to the whitelist, for example, label the peripherals belonging to necessary wake-up peripherals and non-necessary wake-up peripherals with different tags, so that the power management module can wake up the necessary wake-up peripherals and non-necessary wake-up peripherals in the electronic device 100 respectively.
[0089] Exemplarily, the whitelist can be a list preset by developers in the electronic device 100, and various devices belonging to necessary wake-up devices and / or various devices belonging to non-necessary wake-up devices can be listed in this whitelist.
[0090] In addition, the hardware in the electronic device 100 can include a system-on-chip (SoC), where peripherals 2... external peripherals M are integrated inside the SoC.
[0091] For the specific descriptions of on-chip peripherals and off-chip peripherals, reference may be made to the foregoing content and will not be elaborated here. It can be understood that Figure 3 only an exemplary introduction to the system architecture of the electronic device 100 is provided. In other embodiments, the electronic device 100 may further include more or fewer software and hardware structures, and the embodiments of the present application do not limit this.
[0092] Taking the electronic device 100 as a laptop computer as an example below, Figures 4A - 4D an application scenario of the device wake-up method according to the embodiments of the present application will be described by way of example.
[0093] Figure 4A is a schematic diagram of the electronic device 100 being in a dormant or sleeping state.
[0094] As Figure 4A shown, when the electronic device 100 is in a dormant or sleeping state, the display screen of the electronic device 100 is in a black screen state. When the electronic device 100 detects a user operation on the power button, such as a click operation, in response to this operation, the electronic device 100 can initiate device wake-up. Among them, the wake-up of the device may include waking up the peripherals included in the electronic device 100, and resuming the process scheduling of the system until the display screen lights up and a user interface is displayed on the display screen, etc.
[0095] It can be understood that in addition to triggering the wake-up of the electronic device 100 through the power button of the electronic device 100, the wake-up of the electronic device 100 can also be achieved through other means. For example, the electronic device 100 can detect a wake-up operation on the mouse or keyboard and initiate the wake-up of the electronic device 100. For the specific ways for the electronic device 100 to initiate wake-up, reference may be made to the subsequent embodiments and will not be elaborated here.
[0096] During the wake-up process, the electronic device 100 can divide the peripherals into essential wake-up peripherals and non-essential wake-up peripherals, initiate the wake-up of the essential wake-up peripherals and non-essential wake-up peripherals respectively, and after the essential wake-up peripherals are successfully woken up, resume the process scheduling of the essential wake-up peripherals, and after the process scheduling of the essential wake-up is resumed, make the system enter the working state, such as starting the screen lighting of the electronic device 100.
[0097] Figure 4B is a schematic diagram of starting the screen lighting during the wake-up process of the electronic device 100.
[0098] Further, after the electronic device 100 lights up the screen, the electronic device 100 can continue to execute the wake-up of the non-essential wake-up peripherals that have not completed wake-up, and resume the process scheduling of the non-essential wake-up peripherals.
[0099] Exemplarily, after the electronic device 100 lights up the screen, the electronic device 100 can display as Figure 4CThe login interface 01 shown. This login interface 01 can display the system account login page that the electronic device 100 shows before entering the desktop. The user can enter the account password or select the logged-in account on this login interface, so that during the working process of the electronic device 100, the user permissions are controlled, the user behaviors are recorded, and the operation security is protected, etc. through the logged-in account.
[0100] In some embodiments, the electronic device 100 can complete the wake-up of non-essential wake-up peripherals and resume the process scheduling of non-essential wake-up peripherals before displaying the login interface 01 as Figure 4C shown. In this way, the electronic device 100 can complete all the preparatory work for waking up the peripherals before entering the desktop, ensuring that the user can normally use the electronic device 100.
[0101] Exemplarily, after the electronic device 100 passes through the Figure 4C shown login interface 01 and completes the login of the account, the electronic device 100 can restore to the user interface shown before hibernation or sleep, such as Figure 4D the desktop main interface 02 shown.
[0102] In some other embodiments, the electronic device 100 can complete the wake-up of non-essential wake-up peripherals and resume the process scheduling of non-essential wake-up peripherals after displaying the Figure 4C shown login interface 01 and before displaying the Figure 4D shown desktop main interface 02. In this way, not only can all the preparatory work for waking up the peripherals be completed outside the formal use of the electronic device 100 by the user, ensuring the normal use of the electronic device 100 by the user, but also the speed of the electronic device 100 displaying the login interface can be accelerated, and from the user's perception, the speed of device wake-up can be further accelerated.
[0103] It can be understood that in addition to completing the wake-up of all peripherals and resuming the process scheduling of all peripherals before displaying the Figure 4C shown login interface 01 and before displaying the user interface in a light hibernation or sleep state, such as Figure 4D the desktop main interface 02 shown, some non-essential wake-up peripherals in the electronic device 100 can also be woken up at other nodes. For example, assuming that the camera is a non-essential wake-up peripheral, since the user does not use the camera when there is no photo-taking requirement, therefore, the electronic device 100 does not need to execute the wake-up of the camera when detecting the user's wake-up operation, but wakes up the camera when the user has a need to use the camera. The embodiments of the present application do not limit the timing of waking up non-essential wake-up peripherals.
[0104] It can be understood that Figures 4A - 4D this is only for the convenience of understanding the solution and does not constitute a limitation to the solution.
[0105] Figure 5 This is a schematic diagram of the overall process of the device wake-up method provided by the embodiments of this application.
[0106] As Figure 5 shown, the device wake-up method provided by the embodiments of this application may include but is not limited to the following steps:
[0107] S101. The electronic device 100 detects a wake-up operation.
[0108] The wake-up operation can be used to trigger the wake-up of the device, and switch the electronic device 100 from the sleep or dormant state to the working state.
[0109] Before the electronic device 100 detects the wake-up operation, all the peripherals in the electronic device 100 are in the suspended state. After the electronic device 100 detects the wake-up operation, the electronic device 100 can wake up the peripherals and switch them from the suspended state to the working state.
[0110] Among them, making the peripheral enter the suspended state means pausing the work of the peripheral and making it enter the sleep state, such as stopping the tasks in the work queue in the device driver, closing the interrupt, closing the clock, and making the peripheral enter the low-power state, etc. Correspondingly, waking up the peripheral and switching it from the suspended state to the working state means resuming the work of the peripheral, such as restoring the peripheral from the low-power state in the device driver, turning on the clock, re-initializing the register, resuming the tasks in the work queue, etc. In addition, when the peripheral enters the suspended state or wakes up the peripheral, the device driver of the peripheral can transmit data through physical connection channels such as PCIE, USB, I2C, serial peripheral interface (SPI), etc.
[0111] Exemplarily, there can be the following multiple situations for this wake-up operation:
[0112] 1) This wake-up operation can refer to the wake-up operation of the user acting on a wake-up source such as a mouse, keyboard, or power button
[0113] When the user performs a wake-up operation on a wake-up source such as a mouse, keyboard, or power button, such as a click operation, the electronic device 100 can obtain a wake-up instruction generated by the electronic device 100 in response to this wake-up operation, thereby triggering the wake-up of the device.
[0114] 2) This wake-up operation can refer to the operation of the user plugging in or unplugging a USB flash drive
[0115] Exemplarily, when the USB flash drive is inserted into the USB interface of the electronic device 100, the electronic device 100 can generate a wake-up instruction to trigger the wake-up of the device.
[0116] 3) If the electronic device 100 is a laptop computer, the wake-up operation may refer to the operation of the user opening and closing the upper and lower covers of the laptop computer.
[0117] It can be understood that the embodiments of the present application do not limit the wake-up operation. In addition, in addition to the wake-up operation initiated by the user to wake up the electronic device 100, the electronic device 100 can also be triggered to wake up in other ways. For example, if there are scheduled tasks or scheduled wake-up events set in the electronic device 100, the electronic device 100 will generate a wake-up instruction at the set time point to trigger the wake-up of the device. Another example is that other devices can also send a wake-up instruction to the electronic device 100 through the network to remotely control the wake-up of the electronic device 100. The embodiments of the present application do not limit the method of waking up the electronic device 100.
[0118] S102. The electronic device 100 wakes up the first peripheral device, resumes the process scheduling of the first peripheral device, and wakes up the second peripheral device, and resumes the process scheduling of the second peripheral device.
[0119] Since the electronic device 100 will back up the data in the peripherals of the electronic device 100 and make the peripherals enter the suspended state before entering the sleep or hibernation state, therefore, waking up the peripherals may include rewriting the data backed up in the peripherals before the electronic device 100 enters the sleep or hibernation state back into the peripherals.
[0120] That is to say, waking up the first peripheral device may include rewriting the data backed up in the first peripheral device before the electronic device 100 enters the sleep or hibernation state back into the first peripheral device, and waking up the second peripheral device may include rewriting the data backed up in the second peripheral device before the electronic device 100 enters the sleep or hibernation state back into the second peripheral device.
[0121] Since the electronic device 100 will traverse all the kernel threads, work queues, user-mode processes and other work tasks in the system and freeze all the freezable work tasks before entering the sleep or hibernation state, therefore, after waking up the peripherals, it is also necessary to resume the process scheduling of the peripherals, that is, thaw the frozen work tasks of the peripherals.
[0122] Among them, freezing may refer to the system putting user-mode processes, kernel threads, etc. into a controllable "paused" state. Thawing the kernel threads, work queues, and user-mode processes that the peripherals depend on can make these kernel threads, work queues, and user-mode processes enter the working state and resume the system's access to the peripherals. Among them, the kernel threads, work queues, and user-mode processes that the peripherals depend on may refer to the kernel threads, work queues, and user-mode processes that accessed the peripherals before the electronic device 100 entered the sleep or hibernation state.
[0123] That is to say, resuming the process scheduling of the first peripheral device may include thawing the kernel threads, work queues, and user-mode processes that the first peripheral device depends on. Resuming the process scheduling of the second peripheral device may include thawing the kernel threads, work queues, and user-mode processes that the second peripheral device depends on.
[0124] Among them, the first peripheral device may refer to the aforementioned necessary wake-up peripheral device, and this necessary wake-up peripheral device may refer to the peripheral device that must be woken up for the system to enter the working state. In other words, the system of the electronic device 100 requires the participation of this peripheral device to enter the working state. If this peripheral device is in a suspended state or a closed state, the system cannot enter the working state.
[0125] Exemplarily, the first peripheral device may include any one or more of the following: clock, PMU, direct memory access (DMA) controller, Inter-processor communication (IPC), system memory management units (SMMU), input-output microcontroller unit (IOMCU), general purpose input output (GPIO) controller, PCIE controller, UFS controller, DPU, GPU, display screen, etc.
[0126] In some embodiments, in order to accelerate the wake-up speed of the first peripheral device of the electronic device 100, the electronic device 100 may wake up multiple devices in the first peripheral device in parallel.
[0127] Among them, the second peripheral device may refer to the aforementioned non-necessary wake-up peripheral device, and this necessary wake-up peripheral device may refer to the peripheral device that is not necessary to be woken up for the system to enter the working state. In other words, the system of the electronic device 100 does not require the participation of this peripheral device to enter the working state. Even if this peripheral device is in a suspended state or a closed state, the system can still enter the working state.
[0128] Exemplarily, the second peripheral device may include any one or more of the following: USB controller, keyboard, mouse, USB flash drive, network card, camera, USB extender, Wi-Fi chip, Bluetooth chip.
[0129] Exemplarily, the electronic device 100 may wake up the second peripheral device while waking up the first peripheral device, so as to realize the electronic device 100 waking up multiple peripheral devices in parallel and accelerating the device wake-up speed.
[0130] In one implementation, the electronic device 100 can wake up the first peripheral device and the second peripheral device simultaneously by means of multi-threaded wake-up. Exemplarily, the electronic device 100 can wake up the first peripheral device through the main thread and wake up the second peripheral device through an asynchronous thread. Among them, the main thread is a thread that is defaultly started after a program runs. The asynchronous thread is a thread different from the main thread. The asynchronous thread is a new thread separately created by the kernel and is specifically used to process asynchronous transactions. It is at the same level as the main thread and can run simultaneously with the main thread. This asynchronous thread will not block the operation of the main thread, enabling the electronic device 100 to prioritize ensuring the wake-up of the first peripheral device.
[0131] In some implementations, when the electronic device 100 wakes up the second peripheral device, it can further wake up multiple peripheral devices in the second peripheral device in parallel. This is because the second peripheral device usually includes some peripheral devices with relatively long wake-up durations. Waking up multiple peripheral devices in the second peripheral device in parallel can further save the time consumed for waking up the peripheral devices.
[0132] Furthermore, the electronic device 100 can divide the peripheral devices to be woken up in parallel in the second peripheral device according to the wake-up duration of the peripheral devices. For example, the peripheral devices with relatively long wake-up times in the second peripheral device can be separately divided and woken up in parallel with other peripheral devices in the second peripheral device, thereby effectively shortening the total wake-up duration of the peripheral devices.
[0133] In one implementation, the electronic device 100 can determine the first peripheral device and the second peripheral device according to a whitelist. The whitelist can be determined by developers, and various peripheral device types belonging to the first peripheral device and / or the second peripheral device can be preset in the whitelist. In this way, the electronic device 100 can classify peripheral devices through the whitelist, quickly divide non-essential wake-up peripheral devices and essential wake-up peripheral devices. Moreover, developers can modify the whitelist again later, thereby realizing flexible division of non-essential wake-up peripheral devices and essential wake-up peripheral devices in the electronic device 100 and dynamically adjusting the peripheral devices included in non-essential wake-up peripheral devices and essential wake-up peripheral devices.
[0134] For example, various peripheral device types belonging to the first peripheral device can be preset in the whitelist, including: clock, UFS controller, DPU, GPU, display screen, etc. In this way, the electronic device 100 can search for the peripheral devices in itself that are in the whitelist and determine them as the first peripheral device, and determine the remaining peripheral devices not in the whitelist as the second peripheral device.
[0135] For another example, various peripheral types of the second peripherals may be preset in the whitelist, including: keyboards, mice, USB flash drives, network cards, cameras, USB extenders, Wi-Fi chips, Bluetooth chips, and so on. In this way, the electronic device 100 can search for the peripherals in the whitelist included in itself, determine them as the second peripherals, and determine the remaining peripherals not in the whitelist as the first peripherals.
[0136] In the internal implementation of the electronic device 100 for waking up the first peripherals and the second peripherals, a device linked list can be established and maintained inside the electronic device 100. All the peripherals connected in the electronic device 100 can be recorded in the device linked list. The electronic device 100 can traverse all the peripherals recorded in the linked list through the whitelist, so as to find the first peripherals and the second peripherals included in the electronic device 100. Among them, when a peripheral is connected to the electronic device 100, a device node corresponding to the peripheral is newly added to the device linked list, and the device node can store the peripheral type of the peripheral. When a peripheral disconnects from the electronic device 100, the device node of the peripheral recorded in the device linked list disappears. In this way, by using the device linked list to find the necessary-to-wake-up peripherals and non-necessary-to-wake-up peripherals in the electronic device 100, even if the user plugs and unpluggs peripherals, the electronic device 100 can accurately record the peripherals currently connected to the electronic device 100 and achieve precise wake-up of different peripherals.
[0137] It can be understood that for some of the second peripherals, the electronic device 100 may not need to wake up the peripheral at the same time as waking up the first peripherals. Exemplarily, for the peripherals that have nothing to do with the screen lighting, the electronic device 100 can wake up the peripheral according to the user's usage requirements when the user needs to use the peripheral. For example, taking the camera as an example, the electronic device 100 does not need to wake up the camera when detecting the user's wake-up operation, but wakes up the camera when the user has a need to use the camera, such as detecting the operation of the user opening the camera application. In this way, not only can the number of peripherals woken up by the electronic device 100 during startup wake-up be reduced, the wake-up of the device can be accelerated, but also the power consumption of some peripherals can be reduced.
[0138] Since the peripherals include peripherals that support synchronous wake-up and peripherals that support asynchronous wake-up. Among them, the wake-up of the peripherals that support synchronous wake-up depends on the wake-up of other peripherals. In other words, the peripherals that support synchronous wake-up need to be serially woken up one by one. Correspondingly, the peripherals that support asynchronous wake-up do not depend on the wake-up of other peripherals, and the peripherals that support asynchronous wake-up can be woken up in parallel. Then, during the process of the electronic device 100 waking up the first peripherals and the second peripherals, if there are peripherals that support synchronous wake-up among the first peripherals and the second peripherals, the devices that support synchronous wake-up need to be woken up according to their sequential wake-up dependency relationships.
[0139] For example, if the first peripheral device includes a first sub-peripheral device, and the wake-up of the first sub-peripheral device depends on the wake-up of a second sub-peripheral device, the second sub-peripheral device may belong to the first peripheral device or the second peripheral device. Then, when the electronic device 100 wakes up the first peripheral device, it may include: after the second sub-peripheral device is woken up, the electronic device 100 wakes up the first sub-peripheral device.
[0140] That is to say, if the peripherals that need to be woken up include peripherals that depend on the wake-up of other peripherals, then when waking up the peripherals, it is possible to first ensure that the other peripherals on which they depend are woken up first to ensure the successful wake-up of the peripherals that need to be woken up.
[0141] For another example, if the first peripheral device includes a third sub-peripheral device and the second peripheral device includes a fourth sub-peripheral device, and the wake-up of the fourth sub-peripheral device depends on the wake-up of the third sub-peripheral device. Then, when the electronic device 100 wakes up the second peripheral device, it may include: after the third sub-peripheral device is woken up, the electronic device 100 wakes up the fourth sub-peripheral device.
[0142] That is to say, if the peripherals that need to be woken up and the peripherals that do not need to be woken up include peripherals that depend on each other for wake-up, and the peripherals included in the peripherals that do not need to be woken up depend on the peripherals included in the peripherals that need to be woken up, then the electronic device 100 can wake up the peripherals that depend on wake-up in the peripherals that do not need to be woken up after the peripherals on which they depend in the peripherals that need to be woken up are woken up. And because the electronic device 100 does not need to wait for the wake-up of the peripherals that do not need to be woken up, even if the peripherals that need to be woken up and the peripherals that do not need to be woken up include peripherals that depend on each other for wake-up, and the electronic device 100 can only wake up these peripherals that depend on each other one by one, the electronic device 100 does not need to wait for all the mutually dependent devices to be woken up, weakening the wake-up dependency relationship between the peripherals that support synchronous wake-up and effectively shortening the time taken for the electronic device 100 to enter the working state.
[0143] For another example, if the second peripheral device includes a fifth sub-peripheral device and a sixth sub-peripheral device, and the wake-up of the sixth sub-peripheral device depends on the wake-up of the fifth sub-peripheral device. Then, when the electronic device 100 wakes up the second peripheral device, it can first wake up the fifth sub-peripheral device and then wake up the sixth sub-peripheral device.
[0144] That is to say, if the peripherals that do not need to be woken up include peripherals that depend on each other for wake-up, even if these peripherals that depend on each other can only be serially woken up one by one, the electronic device 100 does not need to wait for their serial wake-up process, and only needs to make the system enter the working state after the process scheduling of the peripherals that need to be woken up resumes.
[0145] It can be understood that the sub-devices mentioned above are only used to refer to the devices included in the first device or the second device, and are not used to define the "parent-child relationship" or "subordinate relationship" in terms of function, connection, location, etc. between the devices.
[0146] S103. After the process scheduling of the first peripheral device of the electronic device 100 is restored, without waiting for the process scheduling of the second peripheral device to be restored, the control system enters the working state.
[0147] Since the first peripheral device includes the devices necessary for system wake-up, and the second peripheral device includes the devices not necessary for system wake-up, therefore, after waking up the first peripheral device and restoring the process scheduling of the first peripheral device, the electronic device 100 can control the system to enter the working state without waiting for the wake-up of the second peripheral device and the restoration of the process scheduling of the second peripheral device. This can accelerate the speed of the electronic device 100 entering the working state.
[0148] Among them, the electronic device 100 entering the working state may refer to: turning on the screen, displaying the login interface of the system account, displaying the user interface before hibernation or sleep, etc.
[0149] In one implementation, since the wake-up operation initiated by the user may be a wake-up operation on the peripheral device in the electronic device 100, in this case, the possibility that the user wants to use the peripheral device is relatively high. Therefore, if the wake-up source of the wake-up operation is the peripheral device in the electronic device 100, the first peripheral device further includes the peripheral device on which the wake-up operation acts. Exemplarily, the peripheral device on which the wake-up operation acts may refer to a keyboard, a mouse, etc. In this way, after detecting the wake-up operation of the user on a certain peripheral device, the electronic device 100 can wake up the peripheral device before the control system enters the working state to ensure the normal use of the peripheral device by the user.
[0150] In one implementation, the peripheral devices can be divided into the necessary wake-up peripheral devices and the non-necessary wake-up peripheral devices during the system wake-up process according to whether they are related to turning on the screen. In this case, the necessary wake-up peripheral devices may include the peripheral devices related to turning on the screen, and the non-necessary wake-up peripheral devices may include the peripheral devices not related to turning on the screen. Among them, the peripheral devices related to turning on the screen refer to the peripheral devices that affect turning on the screen. If these peripheral devices are not in the working state, the electronic device cannot turn on the screen normally. The peripheral devices not related to turning on the screen refer to the peripheral devices that have no influence on turning on the screen. If these peripheral devices are not in the working state, the electronic device can still turn on the screen normally.
[0151] In one implementation, in addition to determining the first peripheral device and the second peripheral device according to whether they are the necessary wake-up peripheral devices during the system wake-up process, the electronic device 100 can also determine the first peripheral device and the second peripheral device in combination with the wake-up duration of the peripheral devices. For example, if the wake-up duration of a peripheral device is short, then even if the peripheral device is not necessary for the system wake-up process, the electronic device 100 can still classify it into the first peripheral device. In this case, the first peripheral device includes not only the necessary wake-up peripheral devices during the system wake-up process, but also the non-necessary wake-up peripheral devices during the system wake-up process and with a wake-up duration less than the threshold. Then, the peripheral devices included in the second peripheral device may be the non-necessary wake-up peripheral devices during the system wake-up process and with a wake-up duration greater than or equal to the threshold.
[0152] In this way, even for the peripherals that are not necessarily awakened during the system wake-up process but have a short wake-up time, they can be classified as peripherals that must be awakened. This can reduce the number of peripherals in the non-necessarily awakened peripherals, reduce the pressure of awakening non-necessarily awakened devices, avoid the electronic device 100 spending too much time awakening non-necessarily awakened devices, and reduce the total time consumed by the electronic device 100 to awaken all peripherals.
[0153] In some embodiments, the electronic device 100 can also adjust the wake-up order of each peripheral in the second peripheral according to the usage frequency of the peripheral. Among them, for the peripherals with a higher user usage frequency, their wake-up order can be earlier, and for the peripherals with a lower user usage frequency, their wake-up order can be later. In this way, it can be ensured as much as possible that the peripherals with a higher user frequency can be awakened first. Even if the electronic device 100 does not awaken all peripherals, it can also ensure the normal use of the electronic device 100 by the user as much as possible.
[0154] Figure 6 It is a schematic flow chart of a device wake-up method provided by an embodiment of the present application.
[0155] As Figure 6 shown, the device wake-up method may include the following steps:
[0156] S201. The electronic device 100 starts to wake up.
[0157] The electronic device 100 can start to wake up in response to a wake-up operation of the user acting on the wake-up source after detecting it. Taking Figures 4A - 4D the electronic device 100 shown as an example, the wake-up source can refer to a power button, a keyboard, a laptop lid, etc.
[0158] Exemplarily, the electronic device 100 can detect a pressing operation of the user on the power button when the system is in the sleep state and start to wake up.
[0159] For the specific way of the electronic device 100 to start to wake up, reference can be made to the detailed content in the foregoing step S101, which will not be elaborated here.
[0160] Among them, after the electronic device 100 starts to wake up, it is necessary to wake up the peripherals included in the electronic device 100. In order to accelerate the wake-up speed of the peripherals, the peripherals in the electronic device 100 can be divided into necessary wake-up peripherals and non-necessary wake-up peripherals, and after starting to wake up, the necessary wake-up peripherals and non-necessary wake-up peripherals are woken up simultaneously.
[0161] That is to say, in the system wake-up process of the electronic device 100, there can be two branches: steps S202 - S203, S206 - S207 and steps S204 - S205. Among them, steps S202 - S203, S206 - S207 are the main processes of system wake-up, which are used to wake up the peripherals that must be woken up, resume the process scheduling of the peripherals that must be woken up, and achieve screen lighting. Steps S204 - S205 are the branch processes of system wake-up, which are used to wake up the peripherals that do not need to be woken up necessarily and resume the process scheduling of the peripherals that do not need to be woken up necessarily.
[0162] S202. The electronic device 100 wakes up the peripherals that must be woken up.
[0163] The peripherals that must be woken up can include the peripherals that must be woken up during the system wake-up process. The electronic device 100 can start to wake up the peripherals that must be woken up after starting the wake-up.
[0164] Further specifically, the peripherals that must be woken up can include the peripherals related to screen lighting. The peripherals related to screen lighting refer to the peripherals that affect screen lighting. If these peripherals are not in the working state, the electronic device cannot light up the screen normally.
[0165] Among them, waking up the peripherals that must be woken up can include rewriting the data backed up in the peripherals that must be woken up into the peripherals that must be woken up before the electronic device 100 enters the sleep or dormant state.
[0166] S203. The electronic device 100 unfreezes the kernel threads, work queues, and user-mode processes of the peripherals that must be woken up.
[0167] After the peripherals that must be woken up are woken up, the electronic device 100 can unfreeze the kernel threads, work queues, and user-mode processes of the peripherals that must be woken up, thereby resuming the process scheduling of the peripherals that must be woken up, that is, resuming the system's access to the peripherals that must be woken up.
[0168] S204. The electronic device 100 wakes up the peripherals that do not need to be woken up necessarily.
[0169] The peripherals that do not need to be woken up necessarily can include the peripherals that do not need to be woken up necessarily during the system wake-up process.
[0170] Further specifically, the peripherals that do not need to be woken up necessarily can include the peripherals that have nothing to do with screen lighting. The peripherals that have nothing to do with screen lighting refer to the peripherals that do not affect screen lighting. If these peripherals are not in the working state, the electronic device can still light up the screen normally.
[0171] Among them, waking up the peripherals that do not need to be woken up necessarily can include rewriting the data backed up in the peripherals that do not need to be woken up necessarily into the peripherals that do not need to be woken up necessarily before the electronic device 100 enters the sleep or dormant state.
[0172] After the electronic device 100 is started and awakened, it can start to awaken non-essential awakened peripherals. That is to say, step S202 and step S204 can be executed simultaneously. In this way, after the electronic device 100 is started and awakened, it can awaken essential awakened peripherals and non-essential awakened peripherals at the same time, shortening the time spent in awakening all peripherals in the electronic device 100.
[0173] In one implementation, the electronic device 100 can awaken essential awakened peripherals in the main thread and awaken non-essential awakened peripherals in other threads, such as asynchronous threads. For the specific descriptions of the main thread and the asynchronous thread, please refer to the relevant content in step S102 above, which will not be elaborated here.
[0174] S205. The electronic device 100 unfreezes the kernel threads, work queues, and user-mode processes of non-essential awakened peripherals.
[0175] After the non-essential awakened peripherals are awakened, the electronic device 100 can unfreeze the kernel threads, work queues, and user-mode processes of the non-essential awakened peripherals, thereby restoring the process scheduling of the non-essential awakened peripherals, that is, restoring the system's access to the non-essential awakened peripherals.
[0176] It should be noted that the electronic device 100 can execute step S208 after executing step S205.
[0177] S206. The electronic device 100 executes display driver to send display.
[0178] The electronic device 100 can execute display driver to send display after the kernel threads, work queues, and user-mode processes of essential awakened peripherals are unfrozen. Moreover, executing display driver to send display does not need to wait for the awakening of non-essential awakened peripherals and the unfreezing of the kernel threads, work queues, and user-mode processes of non-essential awakened peripherals. In this way, the operations that the electronic device 100 needs to execute before step S206 can be reduced, shortening the time spent in the process from the start-up awakening of the electronic device 100 to the execution of display driver to send display.
[0179] S207. The electronic device 100 turns on the screen.
[0180] The electronic device 100 can turn on the screen after the display driver sends display.
[0181] Combined with steps S203 - S204, it can be seen that the electronic device 100 can turn on the screen without waiting for the awakening of non-essential awakened peripherals and the restoration of their process scheduling. In this way, after the electronic device is started and awakened, it only needs to wait until the process scheduling of essential awakened devices is restored to complete, and then it can realize the normal screen turning on of the electronic device, accelerating the screen turning on speed of the electronic device 100, avoiding the user waiting for a long time during the awakening of the electronic device 100, and from the user's perception, accelerating the awakening speed of the electronic device 100.
[0182] S208. The electronic device 100 displays the login interface of the system account.
[0183] The login interface of the system account may refer to the interface that is first displayed after the electronic device 100 lights up. The user can log in to the system account on the electronic device 100 through this interface.
[0184] Exemplarily, the login interface of the system account may refer to Figure 4C the shown login interface 01.
[0185] Among them, the electronic device 100 can display the login interface of the system account after lighting up and after thawing the kernel threads, work queues, and user-mode processes of non-essential wake-up peripherals.
[0186] That is to say, the electronic device 100 can complete the wake-up of all peripherals and resume the process scheduling of all peripherals before displaying the login interface of the system account. In this way, it can be ensured that after the electronic device 100 displays the login interface of the system account, the normal use of the electronic device 100 by the user is guaranteed.
[0187] This is because after the user logs in to a certain system account through this login interface, the user can start using the electronic device 100. If all or most of the peripherals of the electronic device 100 are restored to the working state before hibernation or sleep before the user starts using the electronic device 100, the normal use of the electronic device 100 by the user can be ensured in time, and it can be avoided that when the user needs to use a certain peripheral, the peripheral has not been woken up or is still in the wake-up process, affecting the user experience.
[0188] It can be understood that in other embodiments of the present application, the electronic device 100 can also complete the wake-up of all peripherals in the electronic device 100 and resume the process scheduling of all peripherals before displaying the user interface before hibernation or sleep. The embodiments of the present application do not limit the time node for the electronic device 100 to resume the process scheduling of all peripherals.
[0189] For the specific content not described in detail in steps S201 - S208, reference can be made to the relevant content of the foregoing steps S101 - S103, which will not be elaborated here.
[0190] Generally speaking, the device wake-up method provided by the embodiments of the present application can wake up both essential and non-essential wake-up peripherals and resume the process scheduling of these peripherals after the electronic device starts to wake up. However, the system wake-up process does not need to wait for the wake-up of non-essential wake-up peripherals or the resume of process scheduling. It only needs to start lighting up after waking up the essential wake-up peripherals and resuming the process scheduling of the essential wake-up peripherals, which not only speeds up the device wake-up speed but also speeds up the lighting-up speed of the electronic device.
[0191] It should be understood that each step in the above method embodiments can be completed by the integrated logic circuit of the hardware in the processor or the instructions in the form of software. The method steps disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by the hardware processor, or executed and completed by the combination of the hardware and software modules in the processor.
[0192] The present application also provides an electronic device, which may include: a memory and a processor. Among them, the memory can be used to store a computer program; the processor can be used to call the computer program in the memory, so that the electronic device executes the method executed by the electronic device 100 in any one of the above embodiments.
[0193] The present application also provides a chip system, and the chip system includes at least one processor for implementing the functions involved in the method executed by the electronic device 100 in any one of the above embodiments.
[0194] In a possible design, the chip system further includes a memory, and the memory is used to store program instructions and data, and the memory is located inside or outside the processor.
[0195] The chip system can be composed of chips, or can include chips and other discrete devices.
[0196] Optionally, the processor in the chip system can be one or more. The processor can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented by software, the processor can be a general-purpose processor, which is implemented by reading the software code stored in the memory.
[0197] Optionally, the memory in the chip system can also be one or more. The memory can be integrated with the processor or can be separately arranged from the processor, and the embodiments of the present application do not limit this. Exemplarily, the memory can be a non-transitory processor, such as a read-only memory ROM, which can be integrated with the processor on the same chip or can be separately arranged on different chips. The embodiments of the present application do not make specific limitations on the type of the memory and the setting manner of the memory and the processor.
[0198] Exemplarily, the chip system may be a field programmable gate array (FPGA), may be an application specific integrated circuit (ASIC), may also be a system on chip (SoC), may also be a central processor unit (CPU), may also be a network processor (NP), may also be a digital signal processor (DSP), may also be a micro controller unit (MCU), may also be a programmable logic device (PLD) or other integrated chips.
[0199] The present application also provides a computer program product, which includes: a computer program (which may also be referred to as code or instruction). When the computer program is run, it causes the computer to execute the method performed by any one of the electronic devices 100 in any one of the above embodiments.
[0200] The present application also provides a computer-readable storage medium, which stores a computer program (which may also be referred to as code or instruction). The computer program is composed of instructions and is a set of instructions. When the computer program is run, it causes the computer to execute the method performed by any one of the electronic devices 100 in any one of the above embodiments.
[0201] It should be understood that the processor in the embodiments of the present application may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method embodiments can be completed by the integrated logic circuit in the hardware of the processor or instructions in the form of software. The above-mentioned processor may be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by the hardware decoding processor, or executed and completed by a combination of the hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register, etc. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps of the above method.
[0202] In addition, the embodiments of the present application further provide a device. The device may specifically be a component or a module, and the device may include one or more processors and a memory connected thereto. Among them, the memory is used to store a computer program. When the computer program is executed by one or more processors, the device is caused to execute the methods in the above method embodiments.
[0203] Among them, the device, computer-readable storage medium, computer program product or chip provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be elaborated here.
[0204] The various embodiments of the present application can be combined arbitrarily to achieve different technical effects.
[0205] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in this application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wire (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that the computer can access or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state disk (SSD)), etc.
[0206] Those of ordinary skill in the art can understand all or part of the processes in the above embodiments of the method. These processes can be completed by relevant hardware instructed by a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments. The foregoing storage media include: various media such as ROM or random access memory RAM, magnetic disks, or optical discs that can store program codes.
[0207] In summary, the above are only embodiments of the technical solutions of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made based on the disclosure of the present invention shall be included within the protection scope of the present invention.
Claims
1. A device wake-up method, characterized in that, The method includes: The electronic device detects a wake-up operation; The electronic device wakes up a first peripheral device, resumes the process scheduling of the first peripheral device, and wakes up a second peripheral device, and resumes the process scheduling of the second peripheral device; After the process scheduling of the first peripheral device is resumed, the electronic device controls the system to enter the working state.
2. The method according to claim 1, characterized in that, The system enters the working state without waiting for the process scheduling of the second peripheral device to be resumed.
3. The method according to claim 1 or 2, characterized in that, The first peripheral device includes the peripheral devices that must be woken up for the system to enter the working state.
4. The method according to claim 3, characterized in that, The second peripheral device includes the peripheral devices that do not have to be woken up for the system to enter the working state.
5. The method according to any one of claims 1-4, characterized in that, The electronic device controls the system to enter the working state, specifically including: The electronic device turns on the screen or displays the login interface of the system account or displays the user interface before hibernation or sleep.
6. The method according to any one of claims 1-5, characterized in that, The first peripheral device includes one or more of the following: clock, power management unit PMU, direct memory access DMA controller, inter-core communication module IPC, system memory management unit SMMU, input / output microcontroller unit IOMCU, general-purpose input / output port GPIO controller, high-speed serial computer expansion bus standard PCIE controller, universal flash storage UFS controller, graphics processing unit GPU, data processing unit DPU, display screen.
7. The method according to any one of claims 1-6, characterized in that, The second peripheral device includes one or more of the following: universal serial bus USB controller, universal serial bus USB extender, keyboard, mouse, memory, network card, Wi-Fi chip, Bluetooth chip, camera.
8. The method according to any one of claims 1-7, characterized in that, The first peripheral device includes a first sub-peripheral device, and the wake-up of the first sub-peripheral device depends on the wake-up of a second sub-peripheral device, and the second sub-peripheral device belongs to the first peripheral device or the second peripheral device. The electronic device wakes up the first peripheral device, specifically including: The electronic device wakes up the first sub-peripheral device after the second sub-peripheral device is woken up.
9. The method according to any one of claims 1-8, characterized in that, The first peripheral device includes a third sub-peripheral device, the second peripheral device includes a fourth sub-peripheral device, and the wake-up of the fourth sub-peripheral device depends on the wake-up of the third sub-peripheral device. The electronic device wakes up the second peripheral device, specifically including: The electronic device wakes up the fourth sub-peripheral device after the third sub-peripheral device is woken up.
10. The method according to any one of claims 1-9, characterized in that, The second peripheral device includes a fifth sub-peripheral device and a sixth sub-peripheral device, and the wake-up of the sixth sub-peripheral device depends on the wake-up of the fifth sub-peripheral device. The electronic device wakes up the second peripheral device, specifically including: The electronic device first wakes up the fifth sub-peripheral device, and then wakes up the sixth sub-peripheral device.
11. The method according to any one of claims 1-10, characterized in that, The electronic device wakes up the second peripheral device, specifically including: The electronic device wakes up multiple peripheral devices in the second peripheral device in parallel.
12. The method according to any one of claims 1-11, characterized in that, The wake-up order of each peripheral device in the second peripheral device is determined by the electronic device according to the usage frequency of the peripheral device by the user. Among them, the higher the usage frequency of the peripheral device by the user, the earlier the wake-up order.
13. The method according to any one of claims 1-12, characterized in that, The electronic device wakes up the first peripheral device, specifically including: The electronic device wakes up the first peripheral device through the main thread; The electronic device wakes up the second peripheral device, specifically including: The electronic device wakes up the second peripheral device through an asynchronous thread.
14. The method according to any one of claims 1-13, characterized in that, The first peripheral device is determined by the electronic device according to the whitelist, and various peripheral device types belonging to the first peripheral device are preset in the whitelist.
15. The method according to any one of claims 1-14, characterized in that, The electronic device is a tablet computer, a laptop computer, or a desktop computer.
16. An electronic device, characterized in that, It includes a memory, one or more processors, and one or more programs; when the one or more processors execute the one or more programs, the electronic device implements the method according to any one of claims 1 to 15.
17. A computer-readable storage medium, comprising a computer program, characterized in that, When the computer program runs on the electronic device, the electronic device is caused to execute the method according to any one of claims 1 to 15.
18. A computer program product, comprising a computer program, characterized in that, When the computer program product runs on the electronic device, the electronic device is caused to execute the method according to any one of claims 1 to 15.
Citation Information
Cited By
Device wake-up method and related apparatus
EP4730117A1
Device wake-up method and related apparatus
WO2025124464A1