Control method of electronic device, device, readable storage medium and program product
By adjusting the CPU's target operating parameters to high-performance preset values during the electronic device wake-up phase, the problem of performance degradation caused by high power consumption during the wake-up phase is solved, achieving faster loading and a higher-performance user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-08-30
- Publication Date
- 2026-05-19
AI Technical Summary
During the power-on and wake-up phase of electronic devices, the system loads various services and applications, resulting in high power consumption, which leads to performance degradation and affects user experience.
During the wake-up phase, the CPU's target operating parameters are adjusted to high-performance preset values by detecting wake-up commands, such as increasing the frequency and disabling the emergency shutdown control switch, to ensure high performance for 3 minutes and quickly load system and application services.
Maintain high performance during the wake-up phase to improve running speed and response speed, thereby enhancing the user experience.
Smart Images

Figure CN120066239B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power electronics technology, and in particular to a control method, device, readable storage medium, and program product for an electronic device. Background Technology
[0002] As the performance of electronic devices improves, their power consumption also increases. To enhance the user experience, it's possible to reduce power consumption and extend battery life.
[0003] Currently, electronic devices may perform power management immediately upon power-on; for example, a laptop powered on immediately after being unplugged will perform power management. However, during the power-on wake-up phase, various system services and third-party applications are loaded, resulting in higher system power consumption and weaker overall performance. At this time, power management to reduce power consumption would exacerbate performance degradation, leading to slower operation and response times, thus impacting user experience. Summary of the Invention
[0004] This application provides a control method, device, readable storage medium, and program product for an electronic device.
[0005] Firstly, embodiments of this application provide a control method for an electronic device, applied to an electronic device including a central processing unit (CPU). The method includes: detecting a first instruction, the first instruction being used to load at least one of system services and third-party services of the electronic device; responding to the first instruction, within a first time period, replacing a first value of a target operating parameter in a current first operating strategy with a second value to obtain a second operating strategy, wherein the target operating parameter is a parameter affecting the CPU's operating performance, and the CPU's performance is higher when the electronic device uses the second operating strategy than when the electronic device uses the first operating strategy; and executing the first instruction based on the second operating strategy within the first time period. It can be understood that the aforementioned first instruction can be a wake-up instruction for the electronic device. In this case, the electronic device can replace the first value of the target operating parameter in an already effective operating strategy at the hardware layer with the second value. Thus, it is possible to control the electronic device based on a preset value (i.e., the second value) of the target operating parameter, enabling the electronic device to maintain high performance during the first time period of the wake-up phase, such as within 3 minutes, and to quickly load various system services and third-party application services / resources during the wake-up phase, ensuring a fast operating speed and response speed of the electronic device during this period, thereby improving the user experience during the wake-up phase.
[0006] In one possible implementation of the first aspect mentioned above, the target operating parameters include at least one of the following: long-term turbo boost power consumption PL1, short-term turbo boost power consumption PL2, CPU energy efficiency ratio (EPP), emergency shutdown (EPO) control switch status information, and CPU acceleration switch status information. That is, the target operating parameters are parameters that affect CPU performance.
[0007] In one possible implementation of the first aspect described above, the operating strategy includes target operating parameters, and further includes at least one of the following operating parameters: fan speed, discrete graphics processor (DGPU) overclocking value, video memory overclocking value, integrated graphics processor (IGPU) minimum frequency, IGPU maximum frequency, DGPU minimum frequency, DGPU maximum frequency, power-saving display status information, CPU minimum frequency, core binding information, and memory cleanup status information. The parameters in the operating strategy are those that affect the operating performance and / or power consumption of the electronic device.
[0008] In one possible implementation of the first aspect described above, during a first time period, executing a first instruction based on a second operating strategy includes: corresponding to a first type of chip platform for the CPU; disabling the CPU's Emergency Power Off (EPO) control switch during the first time period; and controlling the operation of the electronic device based on the second operating strategy. The first type of CPU can be... The CPU chip. At this time, this application prevents the issued PPM parameter from being modified by the system by first turning off the EPO control switch and then issuing the second value of the target operating parameter, namely the high-performance PPM parameter, to ensure that the high-performance PPM parameter is effective at the hardware layer, thereby ensuring the high performance of the CPU.
[0009] In one possible implementation of the first aspect above, the first instruction is any one of a power-on instruction, a hibernation / wake-up instruction, or a sleep / wake-up instruction; corresponding to the first instruction being a power-on instruction, the first operating strategy is a default operating strategy; corresponding to the first instruction being a hibernation / wake-up instruction or a sleep / wake-up instruction, the first operating strategy is a historical operating strategy, which includes the operating strategy of the electronic device in the last scheduled operation.
[0010] In one possible implementation of the first aspect described above, the method further includes: responding to a first instruction, stopping the scheduling of a first type of operating strategy within a first time period, wherein the first type of operating strategy is determined based on the current operating state information of the electronic device, and the operating state information is used to characterize the hardware operation and / or system operation when the electronic device operates the current focus window. That is, responding to the first instruction, stopping the scheduling of the performance-power consumption model described below within the first time period. Triggered by the first instruction, the electronic device can stop scheduling the first type of operating strategy that limits the operating power consumption of the electronic device and stabilizes the operating performance of the electronic device, for example, stopping the scheduling of the performance-power consumption engine to determine the operating strategy to avoid reducing power consumption and affecting performance.
[0011] In one possible implementation of the first aspect above, the first type of operation strategy is determined using a first model (the performance power consumption model below), which is used to determine the values of the operation parameters in the first type of operation strategy based on the current operation status information.
[0012] In one possible implementation of the first aspect described above, the method further includes: within a first time period, in response to a second instruction, determining that the electronic device is currently in a first operating scenario, the second instruction being used to instruct the electronic device to load services under the first operating scenario; within the first time period, obtaining a third operating strategy corresponding to the first operating scenario, wherein the third operating strategy belongs to a second type of operating strategy, the second type of operating strategy being determined based on the current operating scenario of the electronic device, the operating scenario being used to describe the context in which the electronic device responds to user operations to perform tasks in the currently focused window. That is, within the first time period of the wake-up phase, the electronic device can determine the operating strategy based solely on the current operating scenario using only the scene recognition engine.
[0013] In one possible implementation of the first aspect mentioned above, the method further includes: updating the historical operating strategy to the third operating strategy within a first time period.
[0014] In one possible implementation of the first aspect described above, the method further includes: corresponding to a first type of CPU chip platform, during a first time period, setting the EPO control switch in the third running strategy to the off state, and replacing the third value of the target running parameter in the third running strategy with the second value to obtain a fourth running strategy; during the first time period, executing a second instruction based on the fourth running strategy. The EPO control switch status information is in the off state; if the EPO control switch status information is 0, it is used to trigger the EPO control switch to be turned off. Thus, the current fourth running strategy is issued, and high-performance PPM parameters are issued to ensure that the fourth running strategy is issued and takes effect normally.
[0015] In one possible implementation of the first aspect mentioned above, the method further includes: detecting the end of the first time period, scheduling a first type of operating strategy; determining the historical operating strategy as a third operating strategy, and controlling the electronic device based on the third operating strategy. That is, after the wake-up phase ends, the model in the performance and power consumption engine is rescheduled, and the current historical operating strategy is reissued to the hardware layer through the scheduling engine.
[0016] In one possible implementation of the first aspect described above, the method further includes: responding to a third instruction, determining the current operating scenario as a second operating scenario, and determining a fifth operating strategy corresponding to the second operating scenario, wherein the third instruction is used to instruct the electronic device to load services under the second operating scenario. For example, the third instruction can trigger a performance power consumption engine and a scene recognition engine to determine the operating strategy, so as to adjust the operating strategy according to the current operating scenario.
[0017] In one possible implementation of the first aspect above, the method further includes: corresponding to the chip platform type of the CPU as a first type, under a first switching condition, turning on the EPO control switch, switching the power plan of the electronic device from the first power plan to the second power plan, wherein the first power plan is the power plan under the second operating scenario, and the second power plan is the power plan under the second operating scenario; updating the historical operating strategy to the fifth operating strategy, and executing the third instruction based on the fifth operating strategy; wherein the first switching condition includes: the historical operating strategy corresponds to the first identification information and the third operating scenario corresponds to the second identification information, the first identification information is used to indicate improving the operating performance of the electronic device, and the second identification information is used to indicate reducing the operating power consumption of the electronic device.
[0018] At this point, the CPU chip platform type is Type 1, namely Intel. When using a CPU chip, electronic devices can send EPO enable and performance exit commands to the hardware layer via the scheduling engine to turn on the EPO control switch and exit performance scenarios. Specifically, the hardware layer can turn on the EPO control switch when triggered by the EPO disable command. The hardware layer can exit performance scenarios when triggered by the performance exit command, such as exiting a high-performance power plan, and can also switch to a balanced or energy-saving power plan. In this way, the electronic device first turns on the EPO switch through the scheduling engine before issuing the operating policy, preventing the operating policy corresponding to the high-performance scenario from failing to exit and causing subsequent issued operating policies to be ineffective.
[0019] In one possible implementation of the first aspect mentioned above, the method further includes: corresponding to the chip platform type being the first type, under the second switching condition, updating the historical operating strategy to the fifth operating strategy, and executing the third instruction based on the fifth operating strategy. The second switching condition includes: both the operating scenario corresponding to the historical operating strategy and the third operating scenario correspond to the first identification information; both the operating scenario corresponding to the historical operating strategy and the third operating scenario correspond to the second identification information; and the historical operating strategy corresponds to the second identification information and the third operating scenario corresponds to the first identification information. It can be understood that under the second switching condition, the EPO control switch in the hardware layer is in the on state by default. At this time, the scheduling engine does not need to instruct the hardware layer to turn on the EPO control switch, but directly sends the operating strategy to the hardware layer, such as sending the fifth operating strategy to the hardware layer through the scheduling engine.
[0020] In one possible implementation of the first aspect above, determining the fifth operating strategy corresponding to the second operating scenario includes: obtaining the sixth operating strategy corresponding to the third operating scenario, and determining the seventh operating strategy based on the operating status information under the third operating scenario, wherein the sixth operating strategy is a second type of operating strategy and the seventh operating strategy is a first type of operating strategy; and merging the sixth operating strategy and the seventh operating strategy into the fifth operating strategy.
[0021] In one possible implementation of the first aspect described above, the sixth and seventh operating strategies are merged into a fifth operating strategy. This includes: determining the operating performance results corresponding to the fourth value of the first operating parameter in the sixth operating strategy and the fifth value of the second operating parameter in the seventh operating strategy, based on the first identification information corresponding to the third operating scenario; and using the fourth value of the first operating parameter as the fifth operating strategy, or using the fifth value of the second operating parameter as the fifth operating strategy, based on the operating performance result where the fourth value of the first operating parameter is higher than the fifth value of the second operating parameter. This results in the merged fifth operating strategy controlling the electronic device to achieve higher operating performance.
[0022] In one possible implementation of the first aspect described above, the sixth and seventh operating strategies are merged into a fifth operating strategy, including: determining the operating power consumption results corresponding to the fourth value of the first operating parameter in the sixth operating strategy and the fifth value of the second operating parameter in the seventh operating strategy, based on the second identification information corresponding to the third operating scenario; and using the fourth value of the first operating parameter as the fifth operating strategy, or using the fifth value of the second operating parameter as the fifth operating strategy, based on the operating power consumption result where the fourth value of the first operating parameter is lower than the fifth value of the second operating parameter. This results in the merged fifth operating strategy controlling the electronic device to operate with lower power consumption.
[0023] Secondly, embodiments of this application provide an electronic device, which includes: a memory and one or more processors; wherein the memory is used to store computer program code, the computer program code including computer instructions; when the computer instructions are executed by the processor, the electronic device performs the method as described in the first aspect above and any possible implementation thereof.
[0024] Thirdly, embodiments of this application provide a computer-readable storage medium including computer instructions; when the computer instructions are executed on an electronic device, they cause the electronic device to perform the method as described in the first aspect and any possible implementation thereof.
[0025] Fourthly, embodiments of this application provide a computer program product that, when run on a computer, causes the computer to perform the methods described in the first aspect and any possible implementation thereof.
[0026] The technical effects of any of the design methods in the second, third, and fourth aspects can be found in the technical effects of different design methods in the first aspect, and will not be repeated here. Attached Figure Description
[0027] Figure 1 According to some embodiments of this application, a schematic diagram of the structure of an electronic device 100 is shown;
[0028] Figure 2 According to some embodiments of this application, a schematic diagram of the interaction principle of a module related to operation strategy control in an electronic device 100 is shown.
[0029] Figure 3 According to some embodiments of this application, a schematic diagram of the interaction principle of a module related to operation strategy control in an electronic device 100 is shown;
[0030] Figure 4 According to some embodiments of this application, a schematic diagram of a module related to operation strategy control in an electronic device 100 is shown;
[0031] Figure 5 According to some embodiments of this application, a flowchart of a control method for an electronic device is shown;
[0032] Figure 6 According to some embodiments of this application, a schematic diagram of an electronic device's usage scenario is shown;
[0033] Figure 7 According to some embodiments of this application, a flowchart of a control method for an electronic device is shown;
[0034] Figure 8 According to some embodiments of this application, a schematic diagram of an electronic device's usage scenario is shown;
[0035] Figure 9 According to some embodiments of this application, a flowchart of a control method for an electronic device is shown;
[0036] Figure 10 According to some embodiments of this application, a schematic diagram of the software and hardware workflow for an electronic device 100 to control operating parameters is shown. Detailed Implementation
[0037] The illustrative embodiments of this application include, but are not limited to, control methods for electronic devices, devices, computer-readable storage media, and program products.
[0038] To ensure clarity and conciseness in the description of the following embodiments, a brief introduction to the relevant concepts or technologies is given first:
[0039] (1) Focus window: This refers to the window that has the focus. The focus is the position where the cursor is currently active. In other words, the focus window is the window where the cursor is currently active; it is the current operation window and can receive keyboard input. Generally, the window whose title bar is not grayed out is the focus window.
[0040] (2) Operating Scenario: The operating scenario describes the context in which an electronic device responds to user operations to perform a task in the focus window. Here, the task refers to the execution content related to the functions provided by the focus window. For example, the operating scenarios of an electronic device may include video scenarios, game scenarios, social scenarios, office scenarios, browser scenarios, smart interconnection scenarios, evaluation scenarios, programming scenarios, super terminal scenarios, design software scenarios, process startup scenarios, large file opening scenarios, desktop scenarios, etc.
[0041] The tasks corresponding to video scenarios can be playing videos; the tasks corresponding to gaming scenarios can be playing games; the tasks corresponding to social scenarios can be voice chat, video chat, text chat, etc.; the tasks corresponding to office scenarios can be editing documents; the tasks corresponding to browser scenarios can be browsing web pages; the tasks corresponding to smart interconnection scenarios can be sharing information after multiple electronic devices are interconnected; the tasks corresponding to evaluation scenarios can be experimentally analyzing the performance of electronic devices; the tasks corresponding to programming scenarios can be programming; the tasks corresponding to super terminal scenarios can be electronic devices operating one or more other electronic devices; the tasks corresponding to software design scenarios can be designing software; the tasks corresponding to process startup scenarios can be memory management, task scheduling, etc.; the tasks corresponding to opening large files can be opening files exceeding the preset file size; and the desktop scenarios can be desktop background, icon arrangement, taskbar display or configuration scenarios.
[0042] The video scenarios can be further divided into video playback scenarios, video browsing scenarios, and video comment scenarios. The social scenarios can be further divided into text chat scenarios, voice chat scenarios, and video chat scenarios. The office scenarios can be further divided into document editing scenarios, document browsing scenarios, and video conferencing scenarios; these scenarios can also be referred to as refined office software operation scenarios. The browser scenarios can include web browsing scenarios and video playback scenarios.
[0043] (3) Power consumption scenarios: These are operating scenarios that aim to reduce the power consumption of electronic devices, such as office scenarios, social scenarios, and desktop scenarios.
[0044] (4) Performance scenarios: Performance scenarios are operating scenarios that reduce the power consumption of electronic devices while taking into account the operating performance of electronic devices, such as programming scenarios, video scenarios, game scenarios, large file opening scenarios (file opening scenarios exceeding the preset file size), etc.
[0045] (5) Power Plan: A power plan is a feature provided by the operating system that adjusts the computer's power usage based on the operating scenario and user needs to achieve energy saving or performance improvement. Power plans can be categorized as follows: Balanced, Energy Saving, and High Performance. The Balanced plan is the default and is suitable for office work, web browsing, video playback, and other similar scenarios. The Energy Saving plan is suitable for video conferencing and other similar scenarios, reducing battery consumption and extending battery life. The High Performance plan is suitable for gaming and other similar scenarios, providing stable and high-performance output.
[0046] (6) Power limit (PL) is used to limit the power consumption of the central processing unit (CPU) in electronic devices. It is generally expressed as "PL + number" to indicate the level of power limit for the CPU. The "number" in "PL + number" represents the specific level. For example, there are four levels of power limit for the CPU, from smallest to largest: PL1, PL2, PL3, and PL4. The smaller the number, the lower the power limit level. This application mainly involves PL1 and PL2, which will be described below. (7) Long-term turbo boost power consumption (power limit 1, PL1) refers to the power consumption of the CPU under normal load, equivalent to the thermal design power. The CPU's power consumption for most of the time does not exceed PL1.
[0047] (8) Short-term turbo boost power consumption (power limit 2, PL2) refers to the highest power consumption that the CPU can reach in a short period of time, which has a duration limit. Generally, PL2 is greater than PL1.
[0048] (9) CPU Energy Performance Preference (EPP) is the ratio of CPU energy consumption to performance output, used to reflect the CPU's scheduling tendency. Its value ranges from 0 to 255. The lower the CPU EPP, the more the CPU tends to perform high; the higher the CPU EPP, the more the CPU tends to perform low.
[0049] (10) CPU frequency, also known as processor clock speed or clock speed, is an important indicator of CPU performance. It represents the number of instructions that the CPU can execute per unit of time (usually seconds). CPU frequency can be measured in Hertz (Hz), gigahertz (GHz), or megahertz (MHz). The higher the CPU frequency, theoretically it means that the CPU can complete more work per unit of time, that is, faster processing speed.
[0050] (11) Emergency Power Off (EPO) Control Switch: Emergency Power Off (EPO) control is a safety function used to immediately cut off the power to electronic devices in an emergency. For example, electronic devices such as laptops can use hardware or software configuration to implement the EPO function to ensure that the computer can be quickly shut down in extreme situations, protecting user safety. The EPO function of laptops is usually inactive, waiting to be activated by the user through a specific method (such as a physical switch) when necessary.
[0051] As mentioned in the background section, reducing power consumption during the wake-up phase of an electronic device, such as powering on, will lead to decreased performance and affect the user experience.
[0052] This application provides a control method for an electronic device. During the wake-up phase of an electronic device in a power-off / sleep / hibernation state, within a certain period of time (e.g., 3 minutes) after detecting a wake-up command (e.g., a power-on command), the target operating parameters of the CPU can be set to a high-performance preset value. This preset value allows the CPU frequency to be increased, such as to the maximum frequency, to improve CPU performance, resulting in higher performance and higher power consumption for the electronic device during the wake-up phase. At this time, the overall power consumption of the electronic device can be greater than LP1, for example, LP2. Then, the value of the target operating parameter in the current operating strategy of the electronic device can be replaced with the aforementioned preset value, and the electronic device can be controlled based on this adjusted operating strategy to achieve control of the electronic device based on the preset value of the target operating parameters. This ensures that the electronic device maintains high performance during the 3-minute wake-up phase, enabling rapid loading of various system services and third-party application services / resources, guaranteeing fast operation and response speed during this period, and improving the user experience during the wake-up phase.
[0053] For example, the electronic device in the embodiments of this application may be a tablet computer, desktop computer, laptop computer, handheld computer, notebook computer, ultra-mobile personal computer (UMPC) device, etc. The embodiments of this application do not impose special restrictions on the specific form of the electronic device.
[0054] Please refer to Figure 1This is a schematic diagram of the structure of the electronic device 100 provided in the embodiments of this application.
[0055] like Figure 1 As 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, a wireless communication module 150, a display screen 160, etc.
[0056] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0057] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0058] In some embodiments, processor and central processing unit (CPU) may refer to the same component. The processor usually refers to the CPU, which is one of the core components of an electronic device and is responsible for executing various instructions and performing data processing.
[0059] However, in some other embodiments, the processor and the CPU may not be the same component. The processor can refer to a more complete system. For example, the processor can be a system on a chip (SoC), which includes not only the CPU but may also include other components such as the GPU, memory controller, etc.
[0060] In this embodiment, the operating parameters can be parameters related to the CPU and GPU. During the wake-up phase of an electronic device in a state such as power off / hibernate / sleep, the processor can acquire high-performance preset values of the target operating parameters related to the CPU within a preset time period (which can be referred to as the first preset time period). Then, the processor can replace the value of the target operating parameter in the current operating strategy (which can be referred to as the first value) with the aforementioned preset value (which can be referred to as the second value) to control the operation of the electronic device based on the adjusted operating strategy, thereby ensuring the performance of the electronic device during the wake-up phase.
[0061] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.
[0062] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0063] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an 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 USB interface, etc.
[0064] The charging management module 140 receives charging input from a charger, which can be a wireless charger or a wired charger. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.
[0065] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, internal memory 121, external memory, display screen 160, and wireless communication module 150, etc. In some embodiments, the power management module 141 and the charging management module 140 may also be housed in the same device.
[0066] The wireless communication module 150 can provide solutions for wireless communication applications on the electronic device 100, including WLAN (such as Wi-Fi), Bluetooth, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc.
[0067] The wireless communication module 150 may be one or more devices integrating at least one communication processing module. The wireless communication module 150 receives electromagnetic waves via an antenna, performs frequency modulation and filtering of the electromagnetic wave signal, and sends the processed signal to the processor 110. The wireless communication module 150 may also receive signals to be transmitted from the processor 110, perform frequency modulation and amplification on them, and then convert them into electromagnetic waves for radiation via the antenna.
[0068] Electronic device 100 implements display functions through a GPU, a display screen 160, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 160 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0069] The display screen 160 is used to display images, videos, etc. The display screen 160 includes a display panel.
[0070] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0071] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. For example, in this embodiment, processor 110 can execute instructions stored in internal memory 121, which may include a program storage area and a data storage area.
[0072] The program storage area can store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.). The data storage area can store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.). Furthermore, the internal memory 121 can include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0073] Figure 2 A schematic diagram illustrating the interaction principle of a module related to operation strategy control in an electronic device 100 is shown. For example... Figure 2 As shown, the electronic device 100 may include a scene recognition engine, a performance and power consumption engine, and a scheduling engine. In some embodiments, the scene recognition engine, performance and power consumption engine, and scheduling engine may be... Figure 1 The modules in the processor 110 of the illustrated embodiment are used to implement the corresponding functions.
[0074] The performance power consumption engine can determine the operating strategy (which can be called the first type of operating strategy) to limit the operating power consumption of electronic device 100 and stabilize the operating performance of electronic device 100. Specifically, the performance power consumption engine can train a performance power consumption model and use the trained performance power consumption model to determine the operating strategy.
[0075] The scene recognition engine can identify the operating scene of the electronic device 100, such as a performance scene or a power consumption scene, and determine the operating strategy (which can be called the second type of operating strategy) that matches the operating scene. In addition, the scene recognition engine is also used to detect events such as power-on wake-up events, or to detect wake-up commands such as power-on commands. After a wake-up event is detected, a timer is started, and within the preset time period of the timer, the target operating parameters of the CPU in the current operating strategy are adjusted to preset values.
[0076] The scheduling engine is used to control the resource scheduling of electronic devices using operating strategies, specifically to control the operation of hardware such as the CPU and GPU within the electronic devices. The scheduling engine can include scheduling engine 1 and scheduling engine 2. Scheduling engine 1 is used to distribute a first type of operating strategy to the hardware layer, and scheduling engine 2 is used to distribute a second type of operating strategy, or a combined second and first type of operating strategy, to the hardware layer. For ease of explanation, the scheduling engine appearing alone in the following embodiments can be a collective term for scheduling engine 1 and scheduling engine 2.
[0077] In some embodiments, the performance power consumption engine and the scene recognition engine can collaboratively or independently determine the operating strategy to control the electronic device 100. This application can determine the operating state of the performance power consumption engine and the scene recognition engine, such as normal scheduling or no scheduling, based on the electronic device's operating phase, operating scenario, power mode, and event triggering. For example, during the wake-up phase, the electronic device 100 can determine the operating strategy by only normally scheduling the scene recognition engine; during the operating phase, the operating strategy can be determined by both the scene recognition engine and the performance power consumption engine. For instance, in DC mode, the electronic device 100 can determine the operating strategy by normally scheduling the performance power consumption engine, while in AC / DC mode, the operating strategy can be determined by both the scene recognition engine and the performance power consumption engine.
[0078] The AC and DC modes mentioned above refer to different power supply modes for electronic devices. AC stands for alternating current, meaning the electronic device 100 is plugged in; DC stands for direct current, meaning the electronic device 100 is unplugged. Accordingly, AC / DC mode refers to whether the electronic device is plugged in or unplugged.
[0079] Next, combining Table 1 and Figure 3 The relationship between the scene recognition engine, the performance and power consumption engine and the operation strategy is shown, and the steps related to determining the operation strategy during the wake-up phase of the electronic device 100 are explained.
[0080] Referring to Table 1, a schematic diagram is shown of the working state of the performance power consumption engine and the scene recognition engine, as well as the usage state of the preset values of the target operating parameters of the CPU during the wake-up phase of the electronic device 100 in this embodiment of the application.
[0081] Table 1:
[0082]
[0083] As shown in Table 1, during the wake-up phase of electronic device 100's power-off / hibernation / sleep state, if in AC / DC mode, the performance and power consumption model can be stopped, and the scene recognition engine can be scheduled normally to determine the operating strategy. It can be understood that during the wake-up phase of electronic device 100's power-off / hibernation / sleep state, various system services and third-party services need to be loaded, thus requiring high performance of electronic device 100. Therefore, stopping the scheduling of the performance and power consumption engine during the preset time period of the wake-up phase can avoid reducing power consumption; furthermore, the scene recognition engine can use scheduling engine 2 to replace the values of the target operating parameters in the current operating strategy with the aforementioned preset values to ensure high performance during the wake-up phase.
[0084] It is understandable that during the wake-up phase, electronic devices do not need to consider the power mode when determining their operating strategy. That is, regardless of whether the power mode of the electronic device is DC or AC, the electronic device uses the scene recognition engine to determine the operating strategy and stops scheduling the performance and power consumption engine.
[0085] Figure 3 A schematic diagram illustrating the interaction principle of a module related to operation strategy control in an electronic device 100 is shown. For example... Figure 3 As shown, the scene recognition engine may include a system probe module, a scene recognition module, a scene strategy configuration module, a timing module, and a parameter configuration module.
[0086] The system probe module is used to obtain the operating status information of electronic devices.
[0087] Operating status information may include one or more of the following: power status information, peripheral device status information, process load information, audio / video status information, system load information, or system event information. Among these, the power status information, peripheral device status information, and audio / video status information can be considered as hardware operating status; process load information, system load information, and system event information can be considered as system operating status.
[0088] The power status information may include one or more of the following: battery (remaining) power, power mode, etc. The power mode may include AC and DC.
[0089] Peripheral status information may include one or more of the following: mouse wheel scroll events, mouse click events, keyboard input events, microphone input events, or camera input events.
[0090] Process load information includes the average percentage of CPU time used by each process in the system. Process load information reflects the operational status of each process in the system, including system kernel processes and other user processes.
[0091] The audio and video status information includes the audio and video events currently existing on the electronic device 100. Audio and video events may include one or more of the following: GPU decoding events, video events, video frame rates, or video subtitles.
[0092] System load information includes the total number of processes currently being executed by the CPU and those waiting to be executed by the CPU. System load information can be an important indicator of the system's workload level.
[0093] System event information may include one or more of the following: window change information, system lock information, process creation information, or thread creation information.
[0094] The running status information described above is just an example. Running status information can also be other information used to characterize the hardware operation and / or system operation when the electronic device operates the focus window, such as screen brightness, download speed, etc., but is not limited to these.
[0095] The system probe module can include various types of probes, such as power status probes, peripheral device status probes, process load probes, audio / video status probes, system load probes, and system event probes. Accordingly, power status probes can be used to detect power status information; peripheral device status probes can be used to detect peripheral device status information; process load probes can be used to detect process load information; audio / video status probes can be used to detect audio / video status information; system load probes can be used to detect system load information; and system event probes can be used to detect system event information. The information detected by each probe can also be called probe status information; that is, the probe status information detected by each probe can be used as runtime status information.
[0096] The scene recognition module can determine the current operating scene. For example, the operating scene of an electronic device may include video scene, game scene, social scene, office scene, browser scene, smart interconnection scene, evaluation scene, programming scene, super terminal scene, design software scene, process startup scene, large file opening scene, etc.
[0097] The scenario strategy configuration module is used to store the mapping relationship between running scenarios and running strategies (i.e., the second type of running strategies), and this mapping relationship is stored in the form of a strategy table.
[0098] The timing module is used for timing, such as when an electronic device receives a power-on command, sleep wake-up command, or hibernation wake-up command during the wake-up phase.
[0099] The parameter setting module is used to set and store the preset values of the CPU's target operating parameters. For example, the target operating parameters can be called PPM parameters, and the preset values of the target operating parameters can be called P1. In addition, the parameter setting module is also used to record the operating policy last issued by the scheduling engine (which can be called the historical operating policy) and the operating policy to be issued now (which can be called the current operating policy).
[0100] like Figure 3 As shown, the performance power consumption engine can include a performance power consumption model. The performance power consumption model is used to determine the corresponding operating strategy based on the operating status information of the operating scenario.
[0101] Figure 3 S1 to S10 represent the wake-up phase of the electronic device 100, detailing the interaction between the performance and power consumption engine, the scene recognition engine, and the scheduling engine. The roles of the performance and power consumption engine, the scene recognition engine, and the scheduling engine in this embodiment of the application will be described in detail below.
[0102] S1: The scene recognition engine receives a wake-up command and, triggered by the wake-up command, calls a timer through the scene recognition module to start timing. For example, the timing period of the timer can be called a preset time period or T1, such as 3 minutes.
[0103] S2: The scene recognition engine sends a stop scheduling command to the performance and power consumption engine through the scene recognition module.
[0104] When triggered by a wake-up command, the scene recognition engine notifies the performance and power consumption engine to stop scheduling.
[0105] In some embodiments, the scene recognition engine and the performance and power consumption engine are processes within a management application installed in the electronic device 100. For example, the two engines can interact using inter-process communication (IPC) messages, such as the scene recognition engine sending a stop scheduling command to the performance and power consumption engine using IPC messages.
[0106] S3: The scene recognition engine calls the parameter setting module through the scene recognition module to set the PPM parameter to P1, so that the scene recognition module can obtain P1 from the parameter configuration module.
[0107] When triggered by a wake-up command, the scene recognition engine calls the parameter setting module to set the PPM parameters.
[0108] S4: The scene recognition engine sends an EPO shutdown command to the scheduling engine through the scene recognition module.
[0109] The scene recognition engine can operate on CPU chip platforms such as Intel. When the CPU chip is in use, an EPO shutdown command is sent. This allows the hardware layer to disable the EPO control switch upon triggering the EPO shutdown command.
[0110] S5: The scene recognition engine calls the scene recognition module to send P1 to the scheduling engine.
[0111] It's understandable that when the EPO control switch in the CPU of an electronic device is turned on, the CPU typically uses the default value of the target operating parameter (i.e., the PPM parameter), such as a value that balances CPU performance and power consumption. However, if the PPM parameter is directly sent when the EPO control switch is on, the CPU at the hardware level might modify the sent PPM parameter value (e.g., the preset value) to the default value, causing the sent PPM parameter to be modified by the system. This would prevent the sent high-performance PPM parameter (i.e., P1) from taking effect.
[0112] Thus, for example on an Intel chip platform, this application prevents the preset values of the target running parameters issued by the scheduling engine from being modified by the system by first turning off the EPO control switch and then issuing the PPM parameters, thereby ensuring that the issued PPM parameters, such as P1, take effect.
[0113] In some embodiments, the operating policy that has been implemented in the hardware layer of the electronic device 100 includes the value of the target operating parameter. After the scheduling engine sends the preset value of the target operating parameter to the hardware layer, the value of the target operating parameter in the operating policy can be replaced with the preset value, that is, the PPM parameter in the operating policy can be replaced with P1.
[0114] If the wake-up command is a power-off wake-up command, then the wake-up phase of the electronic device 100 is the power-on phase, and the effective operating strategy can be the default operating strategy or the operating strategy obtained from the scenario strategy configuration module (i.e., the second type of operating strategy).
[0115] If the wake-up command is a wake-up command for hibernation / sleep, then the effective running strategy can be the running strategy stored in the scenario strategy configuration module (i.e., the second type of running strategy), or the running strategy determined by the performance and power consumption engine (i.e., the first type of running strategy), or the running strategy after the fusion of the running strategy stored in the scenario strategy configuration module and the running strategy determined by the performance and power consumption engine.
[0116] It is understandable that the operating strategies already in effect at the hardware layer can be the historical operating strategies recorded in the scene recognition engine.
[0117] The operating strategy includes various operating parameters, which can be power consumption-related or parameters of the electronic device related to its operating performance.
[0118] The operating strategy may include a combination of one or more operating parameters such as PL1, PL2, EPP, EPO control switch status information, CPU acceleration (Turbo) switch status information, fan speed, discrete graphics processing unit (DGPU) overclocking value, video memory overclocking value, integrated graphics processing unit (IGPU) minimum frequency, IGPU maximum frequency, DGPU minimum frequency, DGPU maximum frequency, power saving display status information, CPU minimum frequency, core binding information, and memory cleanup status information.
[0119] Core binding, also known as setting process or thread affinity, refers to binding a process or thread to a specific CPU core to run on. This improves performance because the process or thread only runs on the bound CPU core, reducing the time spent switching between multiple cores. However, core binding does not mean that the process or thread has exclusive access to that CPU core; other processes or threads can still run on that core.
[0120] As an example, CPU-related target operating parameters (i.e., PPM parameters) may include parameters such as PL1, PL2, EPP, and CPU acceleration switch status information. Target operating parameters are those that affect CPU frequency and thus CPU performance.
[0121] S6: The scene recognition engine calls the system probe module to obtain the current running status information.
[0122] Within a preset time period, the scene recognition module can determine the current running scene based on the current running status information.
[0123] S7: The scene recognition engine determines the current running scene based on the running status information through the scene recognition module, and sends the current running scene to the scene strategy configuration module.
[0124] S8: The scene recognition engine obtains the running strategy corresponding to the current running scene from the scene strategy configuration module through the scene recognition module.
[0125] In some embodiments, the scene recognition engine can send information about the current running scene to the scene policy configuration module through the scene recognition module. Then, the scene policy configuration module can match the running policy corresponding to the current running scene from the stored policy table, and then send the running policy to the scene recognition module, enabling the scene recognition engine to obtain the running policy.
[0126] S9: The scene recognition engine sends the running strategy obtained by the scene recognition module to the parameter configuration module to update the historical running strategy recorded by the parameter configuration module.
[0127] S10: The scene recognition engine calls the scene recognition module to replace the PPM parameter in the current running strategy with P1, and sends the running strategy after replacing P1 to the scheduling engine.
[0128] Within a preset time period, the scene recognition module replaces the values of the target running parameters in the running strategy of the current running scene with preset values and sends the running strategy after replacing the preset values to the scheduling engine.
[0129] Thus, during the preset time period of the wake-up phase, when triggered by a wake-up command, the scene recognition engine can stop scheduling through the performance and power consumption engine to avoid generating power-reducing operating strategies through the performance and power consumption engine. Furthermore, in response to the wake-up command, the scene recognition engine can issue high-performance preset values for the target operating parameters to ensure the performance of the electronic device during the wake-up phase.
[0130] Next, combining Table 2 and Figure 4 The relationship between the scene recognition engine, the performance and power consumption engine and the operation strategy is shown, and the steps related to determining the operation strategy during the normal operation phase of the electronic device 100 are explained.
[0131] Referring to Table 2, a schematic diagram is shown of the working status of the performance power consumption engine and the scene recognition engine, as well as the usage status of the preset values of the target operating parameters of the CPU during the operation phase of the electronic device 100 in this embodiment of the application.
[0132] Table 2:
[0133]
[0134]
[0135] As shown in Table 2, during the normal operation phase of electronic device 100, such as after the preset time period of the wake-up phase ends, the performance power consumption engine and the scene recognition engine in AC / DC mode can collaboratively or independently determine the operating strategy to control electronic device 100. The two engines work together to achieve a balance between performance and power consumption.
[0136] As shown in Table 2, during operation, if the electronic device 100 detects that the current operating scenario is a performance scenario, it will use the normal scheduling scenario recognition engine in AC / DC mode to determine the second type of operating strategy matching the current operating scenario, and simultaneously stop the performance power consumption engine from determining the operating strategy. Then, the second type of operating strategy is sent to the hardware layer through scheduling engine 2. This continues until the performance scenario is exited, at which point the performance power consumption engine is rescheduled.
[0137] As shown in Table 2, during the operation phase, if the first event is detected in DC mode, the electronic device 100 will normally schedule the performance and power consumption engine to determine the operating strategy and stop the scheduling scene recognition engine from operating. Then, the operating strategy determined by the performance and power consumption engine will be sent to the hardware layer through the scheduling engine 1.
[0138] The first event is an event that affects the operating performance of an electronic device. The first event can be used to trigger the electronic device to determine its operating strategy using a performance power consumption engine.
[0139] The first event can include one or more of the following: a primary event, a performance-constrained event, or a performance-power model training event. A primary event can include user actions on the currently focused window, and / or lag events. For example, an action event can include one or more of the following: a mouse click event, a keyboard input event, or an action event for switching applications.
[0140] A performance-limited event is an event in which the hardware performance of an electronic device is limited, based on hardware feedback. Specifically, hardware performance limitation can manifest as a limitation on the operating speed of the electronic device's chip. Therefore, a performance-limited event can also be called a chip performance-limited event.
[0141] The performance power consumption model training event is the event that trains the performance power consumption model.
[0142] As shown in Table 1, during the operation of electronic device 100, if the current operating scenario is detected as a power consumption scenario or a second event is detected in AC / DC mode, the normal scheduling scenario identification engine determines the second type of operating strategy matching the current operating scenario, and the normal scheduling performance power consumption engine obtains the first type of operating strategy under the current operating scenario. Then, the second type of operating strategy and the first type of operating strategy are fused to obtain the fused operating strategy. Subsequently, the fused operating strategy is sent to the CPU and GPU in the hardware layer through the scheduling engine 2 to control the electronic device.
[0143] The second event can be an event that does not affect the operating performance of the electronic device, but does affect the power consumption of the electronic device.
[0144] The second event can be an evaluation event of the electronic device. The second event can also include events generated by the electronic device after the user uses it. For example, the second event could be a change in the size of the focused window, a change in CPU / GPU / network usage, a switch between AC and DC modes, PL1 settings not taking effect, or the electronic device's battery level being lower than a preset value.
[0145] It is understandable that during normal operation, electronic devices do not directly issue preset values of the target operating parameters to the CPU. Instead, they determine the values of the target operating parameters based on the operating strategy scheduling method, in order to improve performance to a certain extent while reducing power consumption.
[0146] Furthermore, during normal operation, such as the operation phase after the preset time period of the wake-up phase, electronic devices can consider power modes when determining their operating strategies. For example, in DC mode, the electronic device can independently schedule the performance and power consumption engine to determine the operating strategy. Alternatively, in AC / DC mode, the electronic device can utilize the scene recognition engine and the performance and power consumption engine in tandem to determine the operating strategy.
[0147] Furthermore, during normal operation, electronic devices do not need to use the scheduling engine to send high-performance PPM parameters of the CPU to the hardware layer to force adjustments to the PPM parameters in the subsequent operating parameters.
[0148] Figure 4 A schematic diagram of a module related to operation strategy control in an electronic device 100 is shown. For example... Figure 4 As shown, the 100 operating stages of an electronic device, such as Figure 3 The running phase following the wake-up phase can resume the normal scheduling performance and power consumption model, so as to determine the running strategy in collaboration with the performance and power consumption model and the scene recognition engine, such as by fusing the running strategies determined by the two engines.
[0149] and Figure 3 compared to, Figure 4 The scene recognition engine also includes a fusion module. The fusion module is used to fuse the operating strategy determined by the scene recognition module and the operating strategy determined by the performance and power consumption model.
[0150] The scheme for determining the operating strategy during the operation phase of electronic device 100 may include S11 to S21 as shown below:
[0151] S11: The scene recognition engine calls the timing module through the scene recognition module to end the timing.
[0152] For example, the 3-minute timer in the timing module ends when the preset time period of the wake-up phase ends.
[0153] S12: The scene recognition engine sends scheduling instructions to the performance and power consumption engine through the scene recognition module. The scene recognition engine then instructs the performance and power consumption engine to perform normal scheduling to determine the operating strategy.
[0154] That is, when the scene recognition module is triggered by the end of the preset time period, it sends a scheduling instruction to the performance and power consumption engine.
[0155] S13: The performance and power consumption engine obtains the current operating status information from the system probe module of the scene recognition engine.
[0156] S14: The scene recognition engine obtains the operating strategy determined by the performance and power consumption engine through the scene recognition module.
[0157] S15: The scene recognition engine obtains the current running status information from the system probe module through the scene recognition module.
[0158] S16: The scene recognition engine determines the current running scene based on the running status information through the scene recognition module, and sends the current running scene to the scene strategy configuration module.
[0159] For example, the running scenario changes within a preset time period, that is, it changes from the previous running scenario to the current running scenario.
[0160] Furthermore, if the current running scenario determined by the scene recognition module is the same as the previous running scenario and no scene switching has occurred, there is no need to re-obtain the running strategy corresponding to the running scenario from the scene strategy configuration module.
[0161] S17: The scene recognition engine obtains the running strategy corresponding to the current running scene from the scene strategy configuration module through the scene recognition module.
[0162] S18: The scene recognition engine calls the fusion module through the scene recognition module to obtain the fused running strategy.
[0163] For example, after identifying the current operating scenario, the scene recognition module can send the operating strategy determined by the performance and power consumption model and the operating strategy corresponding to the current operating scenario stored in the scene strategy configuration module to the fusion module. Then, the fusion module can merge these two operating strategies to obtain a fused operating strategy.
[0164] S19: The scene recognition engine sends the running strategy obtained by the scene recognition module to the parameter configuration module under the first or second switching condition, so as to update the historical running strategy recorded by the parameter configuration module.
[0165] The first switching condition may include switching the operating scenario of electronic device 100 from a performance scenario to a power consumption scenario. For example, the historical operating strategy recorded in the parameter configuration module corresponds to the performance scenario, while the current operating strategy obtained by the scenario recognition module corresponds to the power consumption scenario.
[0166] The second switching condition may include the fact that the operating scenario of the electronic device 100 has not changed, or that the operating scenario has changed from a power consumption scenario to a performance scenario. For example, the operating scenario corresponding to the historical operating strategy recorded in the parameter configuration module is a power consumption scenario, while the operating scenario corresponding to the current operating strategy obtained by the scenario recognition module is a performance scenario. Or, for instance, the operating scenario corresponding to the historical operating strategy recorded in the parameter configuration module is a performance scenario, while the operating scenario corresponding to the current operating strategy obtained by the scenario recognition module is still a performance scenario.
[0167] S20: The scene recognition engine sends an EPO start command and a performance exit command to the scheduling engine under the first switching condition.
[0168] In CPU chip platform types, such as Intel When the CPU chip is in use, the call engine can send EPO enable and performance exit commands to the hardware layer. The hardware layer can then activate the EPO control switch upon being triggered by the EPO enable command. Conversely, the hardware layer can exit performance scenarios upon being triggered by the performance exit command, such as exiting a high-performance power plan and switching to a balanced or energy-saving power plan. This method of first enabling the EPO switch and then issuing the execution policy prevents the execution policy corresponding to the high-performance scenario from failing to exit, ensuring that the currently issued execution policy takes effect.
[0169] S21: The scene recognition engine sends the running strategy obtained by the scene recognition module to the scheduling engine under the first / second switching conditions.
[0170] Under the first switching condition, the EPO control switch in the hardware layer switches to the on state when triggered by the EPO enable command.
[0171] Under the second switching condition, the EPO control switch in the hardware layer is on by default. In this case, the scheduling engine does not need to instruct the hardware layer to enable the EPO control switch; instead, it directly sends the execution policy to the hardware layer. Under the second switching condition, after executing S19, S21 can be executed directly to send the execution policy to the hardware layer.
[0172] Therefore, when the EPO control switch is turned on, the hardware layer can implement the running policy issued by the scheduling engine, such as the PPM parameter value in the CPU, which is the default value.
[0173] Thus, after the preset wake-up period ends and the electronic device 100 enters normal operation, it can re-schedule the performance and power consumption engine, such as by using the scene recognition engine and the performance and power consumption engine to collaboratively determine the operating strategy. This improves the performance of the electronic device while reducing power consumption, achieving a longer battery life.
[0174] In other words, the electronic device 100 guarantees high performance during the preset time period of the wake-up phase; while in the subsequent normal operation phase, it can balance performance and power consumption, minimizing power consumption while ensuring performance.
[0175] Figure 5 A flowchart illustrating a control method for an electronic device is shown. This flowchart describes the device control process during the wake-up phase of the electronic device, and includes the following steps:
[0176] S501: The electronic device receives a wake-up command. For example, the wake-up command (also known as the first command) is a wake-up command for the electronic device to power off / go to sleep / go to hibernation.
[0177] During the wake-up phase of an electronic device, which is also the power-on phase, the wake-up command can be triggered by pressing the power button.
[0178] During the wake-up phase of an electronic device's hibernation / sleep state, the wake-up command can be triggered by the following actions: pressing the power button, moving the mouse or touchpad, pressing any key on the keyboard, or turning on the laptop screen.
[0179] In some embodiments, during the wake-up phase (power-on phase) of an electronic device that has been powered off, some parameters or variables related to the running strategy can be initialized to initialize the scene recognition engine. For example, during the power-on phase, the electronic device can launch a management application and initialize and assign values to timers and variables related to historical running strategies.
[0180] Electronic device management apps can be either system management apps or third-party management apps. These apps are used to optimize system performance, improve the running speed of electronic devices, and resolve software malfunctions and system anomalies.
[0181] The following is an example of pseudocode representing the initialization method of timers and history strategy variables, as shown in Table 3 below.
[0182] Table 3:
[0183]
[0184]
[0185] As shown in the code in Table 3, the timer duration is set to 3 minutes, indicating that the timer is initialized as a 3-minute timer. The historical execution strategy (lastStrategy) in the scene strategy can be assigned the default execution strategy. In this case, during the power-on phase of the electronic device, the timer duration can be set to 3 minutes, and the historical execution strategy can be set to the default execution strategy. Of course, the timer duration in this application is not limited to 3 minutes; it can also be other durations, such as 5 minutes.
[0186] In this way, the electronic device can initialize the scene recognition engine according to the assignment of timer and lastStrategy in the code shown in Table 3 above.
[0187] For example, Figure 6 This is a schematic diagram illustrating a usage scenario of an electronic device provided in an embodiment of this application. For example... Figure 6 As shown in (a), the electronic device is in sleep mode and the screen is off. The keyboard includes a power button 101, and the electronic device can receive the user's click of the power button 101 and respond to the operation as follows: Figure 6 As shown in (b) in the figure, the electronic device displays window 102 and determines the mouse click operation as a wake-up event, generating a wake-up command.
[0188] S502: In response to the wake-up command, the electronic device obtains the preset values of the target operating parameters of the CPU within a preset time period and stops scheduling the first type of operating strategy.
[0189] It is understandable that, triggered by a wake-up command, an electronic device can use a timer, such as a 3-minute timer, to begin timing and enter the aforementioned preset time period. The preset values of the CPU's target operating parameters correspond to the CPU's high performance.
[0190] In some embodiments, triggered by a wake-up command, the electronic device can stop scheduling a first type of operating strategy that limits the operating power consumption of the electronic device 100 and stabilizes the operating performance of the electronic device, such as stopping the performance power consumption engine from determining the operating strategy to avoid reducing power consumption and affecting performance.
[0191] S503: The electronic device replaces the preset value (such as the second value) of the target operating parameter with the value (such as the first value) of the target operating parameter in the current first operating strategy to obtain a second operating strategy, and uses the second operating strategy to control the electronic device.
[0192] That is, the electronic device uses the second operating strategy to control the electronic device to execute the wake-up command (such as the first command) and load various system services and various third-party services / resources.
[0193] As an example, after an electronic device enters sleep mode in a game scenario, when the electronic device detects a wake-up command, it can execute steps S501 to S503 as described above to quickly load task-related resources and various system services such as audio output services within a preset time period of the sleep-wake phase. This ensures that tasks in the game scenario can be loaded quickly during the sleep-wake phase, thereby improving the user's gaming experience.
[0194] In some embodiments, the electronic device can adjust the EPO control switch according to the CPU chip platform type, and then issue an operating strategy to achieve high-performance preset value control of the electronic device based on the CPU's target operating parameters. For example, the above-mentioned Figure 5 S503 can include S503a, S503b and S503c.
[0195] S503a: Electronic device determines the chip platform type of the CPU.
[0196] Chip platform types can include a first type and a second type. The CPU of the first type can be... CPU chips, the second type of CPU can be CPU chip.
[0197] If the CPU chip platform type is type one, that is... If the CPU chip is of type 2, then enter S503b and first disable the EPO control switch. For CPU chips, entering the S503c mode does not require turning off the EPO control switch.
[0198] S503b: Corresponding to the first type, the electronic device turns off the EPO control switch, replaces the preset value of the target operating parameter in the current first operating strategy with the value of the target operating parameter to obtain the second operating strategy, and uses the second operating strategy to control the electronic device.
[0199] The following is an example of pseudocode representing the wake-up callback process during the wake-up phase, as shown in Table 4:
[0200] Table 4:
[0201]
[0202] As shown in the code in Table 4, the parameter message in the IPCMessage message code is assigned the value stopWork, which means setting the content of the IPC message.
[0203] In the PostIPCMessage() code, the parameter fromModule is set to Scene Recognition & Scheduling, indicating that the IPC message is initiated by the Scene Recognition Engine; the parameter AIModel is set to AIModel, indicating that the IPC message is sent to the Performance and Power Consumption Engine; and the parameter message indicates that the content of the IPC message is stopWork. In this case, the PostIPCMessage() code is used to indicate that the Scene Recognition Engine notifies the Performance and Power Consumption Engine to stop scheduling via the IPC message.
[0204] The SceneStrategy strategy = {high-performance PPM parameter} code indicates that the preset value of the target running parameter of the CPU is obtained, that is, the high-performance PPM parameter, or P1.
[0205] The `CloseEPOSwitch()` code is used to instruct electronic devices to turn off the EPO control switch. For example, this code instructs the scene recognition engine to send an EPO shutdown command to the hardware layer through the scheduling engine.
[0206] The `ExecuteStrategy(strategy)` code indicates that the electronic device uses the PPM parameter. For example, this code instructs the scene recognition engine to send a high-performance PPM parameter, P1, to the hardware layer through the scheduling engine. In this way, the hardware layer can replace the PPM parameter in the currently effective running strategy (such as the first running strategy) with P1 to obtain the replaced running strategy (such as the second running strategy).
[0207] It is understandable that this application prevents the issued PPM parameters from being modified by the system by first turning off the EPO control switch and then issuing the PPM parameters, thus ensuring that the high-performance PPM parameters are effective at the hardware layer and thus guaranteeing the high performance of the CPU.
[0208] S503c: Corresponding to the second type, the electronic device replaces the preset value of the target operating parameter with the value of the target operating parameter in the current first operating strategy to obtain the second operating strategy, and uses the second operating strategy to control the electronic device.
[0209] Similarly, for the second type of CPU chip platform, the EPO control switch in the electronic device is off by default. In this case, the electronic device does not need to turn off the EPO control switch; instead, it directly sends high-performance PPM parameters to the hardware layer through the scheduling engine. Therefore, for the second type of CPU chip platform, the pseudocode for the wake-up callback process in the wake-up phase can omit the CloseEPOSwitch() code compared to the code shown in Table 4.
[0210] In this way, during the wake-up phase of an electronic device from shutdown / hibernation / sleep, the CPU's target operating parameters can be used to control the device at high-performance preset values, ensuring performance during the wake-up phase and enabling the device to quickly load various system services and third-party services. Furthermore, during the wake-up phase, the electronic device can stop scheduling the first type of operating strategy that limits its power consumption performance, i.e., stop scheduling the performance power consumption engine, to avoid performance degradation caused by reduced power consumption.
[0211] Figure 7 A flowchart illustrating a control method for an electronic device is shown. This flowchart describes the device control process during the wake-up phase and the transition from the wake-up phase to the normal operation phase. The process includes the following steps: Figure 7 The steps following the illustrated S506 may include:
[0212] S701: Within a preset time period, the electronic device responds to the second instruction and detects that the current operating scenario is the first operating scenario.
[0213] For example, it is detected that the current running scenario has switched from the initial running scenario to the first running scenario, which can correspond to the first running strategy mentioned above.
[0214] At this point, the first instruction is used to instruct the electronic device to load the service in the first running scenario.
[0215] In some embodiments, the electronic device may detect the current second operating scenario in response to a second instruction of some events. For example, the event may be a first event or a second event, such as a user action event on the currently focused window.
[0216] For example, an electronic device detects that the current running scene has switched from a game scene to a video scene. At this time, the electronic device can receive a user's command to switch the focus window of the current game scene, that is, detect the command of the switching event, and respond to the command to switch the focus window, such as the focus window of the video playback, thereby determining that the current running scene has switched from the game scene to the video scene.
[0217] S702: The electronic device obtains the third operating strategy corresponding to the first operating scenario.
[0218] When the first running scenario is detected within a preset time, the third running strategy is the second type of running strategy determined by the scene recognition engine of the electronic device, that is, the running strategy corresponding to the first running scenario obtained by the scene recognition module from the scene strategy configuration module.
[0219] For example, the first running scenario is a video scenario, and the third running strategy is the running strategy corresponding to the video scenario.
[0220] S703: The electronic device sets the EPO control switch status information in the third operating strategy to the off state, replaces the value of the target operating parameter in the third operating strategy with the preset value to obtain the fourth operating strategy, and updates the historical operating strategy to the third operating strategy.
[0221] The EPO control switch status information is in the off state. If the EPO control switch status information value is 0, it is used to trigger the EPO control switch to close. If the EPO control switch status information is in the on state. If the EPO control switch status information value is 1, it is used to trigger the EPO control switch to open.
[0222] The following is an example of pseudocode representing the strategy adjustment process during the runtime phase, as shown in Table 5:
[0223] Table 5:
[0224]
[0225]
[0226] The code `lastStrategy = curStrategy` indicates that when the current running strategy is determined, the current running strategy (curStrategy) is used to update the historical running strategy (lastStrategy), i.e., S703 is executed.
[0227] The timed conditional branch If sxTime>3min indicates whether a preset time period has ended, such as whether a 3-minute timer has ended.
[0228] If the timing judgment branch determines that the timer has not ended, it enters the Else branch of the timing judgment branch, that is, if the preset time period has not ended, it executes 704. At this time, the electronic device executes the code curStrategy = curStrategy{EPO=0,P1}, which changes the EPO control switch status information in the current running strategy information curStrategy to 0 (i.e., turns off the EPO control switch), and then modifies the PPM parameter to P1. Then, the ExecuteStrategy(strategy) code is used to issue the current running strategy, such as the fourth running strategy, and issues the high-performance PPM parameter to execute S704, ensuring that the fourth running strategy is issued and takes effect normally.
[0229] If the timer judgment branch determines that the timer has ended, it enters the switching condition judgment branch of the timer judgment branch, that is, if it determines that the preset time period has ended, then S707 is executed.
[0230] S704: Electronic devices use the fourth operating strategy to control electronic devices.
[0231] In the fourth operating strategy, the EPO control switch status information is in the off state, and the target operating parameters are preset values.
[0232] S705: The electronic device detects the end of the preset time period, allows the scheduling of the first type of operation strategy, and controls the electronic device based on the current historical operation strategy.
[0233] After the preset time expires, the electronic device can resume normal scheduling of the performance and power consumption engine through the scene recognition engine, allowing the scheduling of the first type of operation strategy. At this time, the electronic device can redistribute the historical operation strategy through the scheduling engine and re-control the electronic device based on the historical operation strategy, such as the third scheduling strategy.
[0234] The following is an example of pseudocode representing exiting wake-up, as shown in Table 6:
[0235] Table 6:
[0236]
[0237] As shown in the code in Table 6, the parameter message in the IPCMessage message code is assigned the value startWork, which means setting the content of the IPC message.
[0238] In the PostIPCMessage() code, the parameter fromModule is set to Scene Recognition & Scheduling, indicating that the IPC message is initiated by the Scene Recognition Engine; the parameter AIModel is set to AIModel, indicating that the IPC message is sent to the Performance and Power Consumption Engine; and the parameter message indicates that the content of the IPC message is startWork. In this case, the PostIPCMessage() code is used to indicate that the Scene Recognition Engine notifies the Performance and Power Consumption Engine of normal scheduling via the IPC message.
[0239] The ExecuteStrategy(strategy) code indicates that the electronic device issues the current operating strategy. For example, entering S705 to reissue a current operating strategy, such as the fourth operating strategy.
[0240] S706: The electronic device responds to the third instruction, detects that the current operating scenario is the second operating scenario, and obtains the fifth operating strategy corresponding to the second operating scenario.
[0241] For example, an electronic device detects that the current operating scenario has switched from a first operating scenario to a second operating scenario. A third instruction can then instruct the electronic device to load services under the second operating scenario.
[0242] For example, an electronic device detects that the current operating scene has switched from a video scene to a desktop scene. At this time, the electronic device can receive a user's closing event of the focus window in the current video scene, that is, detect the instruction of the closing event, and respond to the instruction to switch the focus window, such as the focus window of the desktop, thereby determining that the current operating scene has switched from the video scene to the desktop scene.
[0243] For example, continue to refer to Figure 6 The scene shown. (As shown) Figure 6 As shown in (b), the electronic device display window 102 can be an interface for a video application, and the window 102 includes a close control 103. The electronic device can receive an operation from a user clicking the close control 103, and in response to the operation, as shown in (b). Figure 8 As shown, the electronic device displays the desktop, i.e., the main interface, and determines the switching of the operating scenario based on this operation, such as switching from a performance scenario to a power consumption scenario. Furthermore, this mouse click operation can be identified as a second event, i.e., an event that requires the performance / power consumption engine and the scene recognition engine to work together to determine the operating strategy.
[0244] In some embodiments, the operating scenario corresponds to preset identification information. The preset identification information is used to characterize whether the current scenario of the electronic device is a performance scenario or a power consumption scenario, that is, to characterize the target tendency of the electronic device in the current operating scenario. The target tendency includes a tendency to reduce operating power consumption or a tendency to improve operating performance. For example, the preset identification information includes first identification information and second identification information. When the preset identification information for the current operating scenario is the first identification information, it indicates that the current operating scenario is a performance scenario, and the target tendency is to improve operating performance; when the preset identification information for the current operating scenario is the second identification information, it indicates that the current operating scenario is a power consumption scenario, and the target tendency is to reduce operating power consumption.
[0245] The first identification information is used to indicate the improvement of the operating performance of the electronic device, and the second identification information is used to indicate the reduction of the operating power consumption of the electronic device.
[0246] In some embodiments, the electronic device acquires a sixth operating strategy corresponding to the second operating scenario and acquires a seventh operating strategy based on the current operating state information. Then, the electronic device merges the sixth and seventh operating strategies to obtain a fifth operating strategy. At this point, the electronic device can merge the sixth and seventh operating strategies according to the target tendency indicated by the preset identification information of the switched second operating scenario.
[0247] For example, if the goal of the second operating scenario is to reduce operating power consumption, then the target value of the operating parameter that is conducive to reducing power consumption is selected from the sixth and seventh operating strategies to obtain the fused fifth operating strategy. For example, the values of the operating parameters in the seventh operating strategy from the performance power consumption engine and the values of the operating parameters in the sixth operating strategy from the scenario strategy configuration module can be compared, and the value of the operating parameter that makes the power consumption of the electronic device lower can be selected to obtain the fused operating strategy.
[0248] For example, if the goal of the second operating scenario is to improve operating performance, then the target values of the operating parameters that are beneficial to improving operating performance are selected from the sixth and seventh operating strategies to obtain the fused fifth operating strategy. For instance, the values of the operating parameters in the seventh operating strategy from the performance and power consumption engine can be compared with the values of the operating parameters in the sixth operating strategy from the scenario strategy configuration module, and the values of the operating parameters that improve the performance of the electronic device can be selected to obtain the fused operating strategy.
[0249] It is understandable that the target operating parameter value in the fifth operating strategy can be a preset value or other data value, which is determined according to the current operating scenario and operating status information, that is, according to the current operating status of the electronic device.
[0250] In other embodiments, the electronic device may also trigger the execution of acquiring and fusing the sixth and seventh operating strategies to obtain the fifth operating strategy based on instructions of some events (such as the third instruction), such as the second event.
[0251] S707: The chip platform type corresponding to the CPU is the first type. The electronic device determines whether the first switching condition or the second switching condition is met.
[0252] In some embodiments, the first switching condition is that the preset identification information of the second operating scenario is the first identification information, and the preset identification information of the third operating scenario is the second identification information. That is, the first switching condition indicates that the operating scenario of the electronic device is switched from a performance scenario to a power consumption scenario. At this time, the second operating scenario is a performance scenario, and the third operating scenario is a power consumption scenario.
[0253] In some embodiments, the second switching condition includes: the preset identification information of the second operating scenario is the second identification information, and the preset identification information of the third operating scenario is the first identification information; the preset identification information of both the second and third operating scenarios is the first identification information; and the preset identification information of both the second and third operating scenarios is the second identification information. That is, the second switching condition may include the electronic device's operating scenario not changing, or the operating scenario changing from a power consumption scenario to a performance scenario.
[0254] If the first switching condition is met, proceed to S708 to close the EPO control switch and issue the operating strategy. If the second switching condition is met, proceed to S709.
[0255] Referring to the code shown in Table 5, in the code "If lastStrategy tendency = 1 && curStrategy tendency = 0" of the switching condition judgment branch, "lastStrategy tendency = 1" means that the preset identifier information corresponding to the historical running strategy is 1, that is, the second running scenario corresponding to the historical running strategy is the performance scenario; "curStrategytendency = 0" means that the preset identifier information corresponding to the current running strategy is 0, that is, the third running scenario corresponding to the current running strategy is the performance scenario.
[0256] If the code `If lastStrategy tendency = 1 && curStrategy tendency = 0` evaluates to "yes", indicating that the first switching condition is met, then proceed to S708. If the code evaluates to "no", indicating that the second switching condition is met, then proceed to S709.
[0257] S708: Under the first switching condition, the electronic device updates the historical operating strategy to the fifth operating strategy, turns on the EPO control switch, exits the performance scenario, and uses the fifth operating strategy to control the electronic device.
[0258] The CPU chip platform type is Type 1, namely Intel. When using a CPU chip, electronic devices can send EPO enable and performance exit commands to the hardware layer via the scheduling engine to turn on the EPO control switch and exit performance scenarios. Specifically, the hardware layer can turn on the EPO control switch when triggered by the EPO disable command. The hardware layer can exit performance scenarios when triggered by the performance exit command, such as exiting a high-performance power plan, and can also switch to a balanced or energy-saving power plan. In this way, the electronic device first turns on the EPO switch through the scheduling engine before issuing the operating policy, preventing the operating policy corresponding to the high-performance scenario from failing to exit and causing subsequent issued operating policies to be ineffective.
[0259] Referring to the code shown in Table 5, in the branch where the switching condition judgment is yes, the OpenEPOSwitch() code indicates that the EPO control switch is turned on to prevent the performance strategy from failing to exit. The current running strategy, such as the fifth running strategy, is then issued through the ExecuteStrategy(lastStrategy) code.
[0260] S709: Under the second switching condition, the electronic device updates the historical operating strategy to the fifth operating strategy and uses the fifth operating strategy to control the electronic device.
[0261] Under the second switching condition, the EPO control switch in the hardware layer is in the on state by default. At this time, the scheduling engine does not need to instruct the hardware layer to turn on the EPO control switch, but directly sends the running strategy to the hardware layer, such as sending the fifth running strategy to the hardware layer through the scheduling engine.
[0262] Based on the code shown in Table 5, in the branch where the conditional judgment is not true, the ExecuteStrategy(lastStrategy) code indicates that the current running strategy is directly issued, such as the fifth running strategy.
[0263] Thus, the control method for the electronic device provided in this application determines the operating strategy by using the normal scheduling performance power consumption engine and the scene recognition engine after the preset time period of the wake-up phase ends, which can improve performance and reduce power consumption to a certain extent.
[0264] Next, refer to Figure 9 The diagram shown is a flowchart illustrating a control method for an electronic device improved according to an embodiment of this application. Specifically, when the management application starts, it can initialize a 3-minute timer and the historical running strategy lastStategy, such as setting the timer's duration to 3 minutes and setting lastStategy to the process where the default running strategy scene recognition engine resides. Furthermore, when the management application starts, it can also start the process (not shown) where the performance power consumption model resides.
[0265] like Figure 9 As shown, when the scene recognition engine receives a power-on event / sleep wake-up event / hibernation wake-up event, it enters the wake-up phase. Within a 3-minute timer, the CPU's PPM parameter can be set to P1, meaning the CPU's target operating parameters are set to a high-performance preset value. Furthermore, the scene recognition engine first disables the EPO control switch (i.e., disables EPO). Then, it issues P1 through the scheduling engine, causing the hardware layer to replace the PPM parameter in the current operating policy information with P1, and uses P1 to control electronic devices to ensure high CPU performance during the wake-up phase. Additionally, when the scene recognition engine receives a power-on event / sleep wake-up event / hibernation wake-up event, it can stop scheduling the performance power consumption model through the performance power consumption engine to prevent power consumption reduction during the wake-up phase.
[0266] In some embodiments, the electronic device can initialize a timer each time a power-on event / sleep wake-up event / hibernation wake-up event is received, to start the timer to begin timing, such as starting a 3-minute timer. At this time, when a power-on event is detected, the scene recognition engine initializes the historical running strategy `lastStategy`, and when a sleep wake-up event / hibernation wake-up event is received, the scene recognition engine can directly retrieve the previously recorded historical running strategy `lastStategy`.
[0267] The scene recognition engine performs scene recognition within a 3-minute timer, matches the current running scene with the corresponding running strategy A, and sets running strategy A as the current running strategy curStategy, outputting curStategy. Then, it checks if the 3-minute timer has expired. If not, it means the 3-minute timer has not ended, and executes lastStategy = curStategy to update the historical running strategy to the current running strategy. Next, it sets the PPM parameter in the current running strategy to P1 and the EPO parameter to 0, and then issues the adjusted current running strategy via the scheduling engine, issuing P1 to maintain high CPU performance during the wake-up phase.
[0268] Furthermore, such as Figure 9 As shown, once the scene recognition engine recognizes the end of the 3-minute timer, it can notify the performance and power consumption engine to resume normal scheduling and start working, and issue the current historical running policy lastStategy through the scheduling engine.
[0269] Subsequently, as Figure 9As shown, the scene recognition engine performs scene recognition after a 3-minute timeout. If it matches the current running scenario's corresponding running strategy A, it can also obtain the running strategy B output by the performance and power consumption engine, and fuse these two running strategies to obtain a fused running strategy. This fused running strategy is used as the current running strategy, `curStategy`, and is output as `curStategy`. Then, the scene recognition engine can determine whether `lastStrategy tendency = 1` and `curStrategy tendency = 0` are true, that is, whether the preset flag `tendency = 1` of the historical running strategy `lastStategy` and the preset flag `tendency = 0` of the current running strategy `curStategy` are true, i.e., whether the scene switch has changed from a performance scenario to a power consumption scenario. If the determination is yes, the scene recognition engine executes `lastStategy = curStategy` to update the historical running strategy to the current running strategy, turns on the EPO control switch (turns on EPO), proposes a performance scenario, and then issues the current running strategy `curStategy` through the scheduling engine. Alternatively, if the determination is no, the scene recognition engine executes `lastStategy = curStategy` to update the historical running strategy to the current running strategy, and directly issues the current running strategy `curStategy` through the scheduling engine. This allows electronic devices to balance performance and power consumption during operation.
[0270] Figure 10 A schematic diagram of the software and hardware workflow for controlling operating parameters in electronic device 100 is shown.
[0271] like Figure 10 As shown, the scene recognition engine described above can be located at the application layer of the electronic device. The scene recognition engine includes a system probe module, a scene recognition module, and a scene policy configuration module, as well as a timing module (not shown) and a parameter configuration module (not shown).
[0272] The scene recognition module can determine the current operating scene. Operating scenes can include video scenes, game scenes, office scenes, and social scenes, etc. For example, when the scene recognition engine identifies the focused window as a video application window, it determines that the electronic device 100 is in a video scene. Another example is when the scene recognition engine identifies the focused window as WeChat... TM When a chat window is accessed, the electronic device 100 is determined to be in a social scenario. The scenario recognition module can also send this scenario to the scenario policy configuration module. The scenario policy configuration module can determine the operating parameters based on this scenario. The scenario policy configuration module can then send these operating parameters back to the scenario recognition module. The scenario recognition module can then send these operating parameters and the scenario to the application layer's scheduling engine.
[0273] The scene recognition module determines that the current operating scene is based on existing technology, which will not be elaborated further here.
[0274] The functions of the scene recognition module, scene strategy configuration module, timing module, and parameter configuration module are the same as those described above. Figure 3 and Figure 4 The similarities are not repeated here.
[0275] In some embodiments, the scene recognition module can send a request to the system probe module to query operating status information. In response, the system probe module can report operating status information to the scene recognition module.
[0276] The system probe module can subscribe to kernel events at the kernel layer to determine runtime status information based on callback functions fed back from the kernel layer, and then report this information to the scene recognition module. Specifically, the system probe module includes multiple types of probes, each of which can subscribe to corresponding kernel events at the kernel layer to obtain the corresponding runtime status information.
[0277] For example, a power status probe can subscribe to power status events from the kernel layer and determine power status information based on callback functions returned by the kernel layer. The kernel layer may include, for example, subsystem dynamic link libraries, the executable, the kernel and driver layers, the HAL, the firmware layer, and the hardware layer. The power status probe can send a request to subscribe to power status events to the system event driver (OsEventDriver) node of the executable in the kernel layer. The OsEventDriver node then forwards this request to the power manager of the executable. Upon receiving the request, the power manager can return a callback function to the power status probe through the OsEventDriver node, thus implementing the subscription to power status events.
[0278] Peripheral status probes can subscribe to peripheral events from the kernel layer and determine peripheral status information based on callback functions fed back from the kernel layer.
[0279] Process load probes can subscribe to process load events at the kernel level and determine process load information based on callback functions fed back from the kernel level.
[0280] System load probes can subscribe to system load events at the kernel layer and determine system load information based on callback functions fed back from the kernel layer.
[0281] The audio and video status probe can subscribe to audio and video events from the kernel layer and determine the current audio and video status information of the electronic device 100 based on the callback function fed back by the kernel layer.
[0282] For example, the audio / video status probe can send a request to the OsEventDriver node of the execution entity to subscribe to GPU decoding information. The OsEventDriver node then forwards this request to the GPU driver in the kernel and driver layer. After receiving the request, the GPU driver sends a callback function back to the audio / video status probe through the OsEventDriver node, so that after monitoring the GPU performing decoding operations, it can obtain audio / video status information based on the callback function of the audio / video status probe.
[0283] System event probes can subscribe to system events from the kernel layer and determine system event information based on callback functions returned by the kernel layer. System event information may include one or more of the following: window change information, system lock information, process creation information, or thread creation information.
[0284] For example, a system event probe can send a request to the OsEventDriver node of the executor to subscribe to process creation information. The OsEventDriver node then forwards this request to the process manager. Upon receiving the request, the process manager sends a callback function back to the system event probe through the OsEventDriver node, so that system event information can be obtained based on the callback function after the process is created. As another example, the system event probe can also send a request to the API module to subscribe to focus window change information. The API module sends a callback function back to the system event probe to monitor whether the focus window of the electronic device 100 has changed, and when a change is detected, obtains the focus window change information based on the callback function.
[0285] As can be seen, the system probe module subscribes to various events of electronic device 100 from the kernel layer, and then obtains the probe status based on the callback function fed back by the kernel layer, thus obtaining the operating status information of electronic device 100.
[0286] In some embodiments, the scene recognition module can notify the performance power consumption engine to stop scheduling within a preset time period during the wake-up phase, and notify the performance power consumption engine to resume normal scheduling after the preset time period, so as to avoid reducing device power consumption during the wake-up phase. Furthermore, within the preset time period of the wake-up phase, the scene recognition module can issue high-performance preset parameters of the CPU's target operating parameters in response to the wake-up command, such as first turning on the EPO switch and then issuing high-performance parameters, to perform scheduling based on the operating strategy corresponding to the CPU's high-performance parameters. In this embodiment, the scheduling engine can send instructions to the CPU through the power manager and BIOS, carrying operating parameter 1 in the operating strategy. The scheduling engine can send instructions to the Intel DTT driver through WMI, carrying operating parameter 2 in the operating strategy. Then, the Intel DTT driver can send the received instructions to the CPU through the BIOS. The scheduling engine can also send instructions to the CPU through the System-to-Chip (OS2SOC) driver node, carrying operating parameter 2 in the operating strategy, such as the preset value of the CPU's target operating parameters. Operating parameter 1, operating parameter 2, and operating parameter 3 can be different operating parameters in the operating strategy.
[0287] This application also provides a computer storage medium that includes computer instructions. When the computer instructions are executed on the electronic device, the electronic device causes the electronic device to perform various functions or steps performed by the mobile phone in the above method embodiment.
[0288] This application also provides a computer program product that, when run on a computer, causes the computer to perform the various functions or steps performed by the mobile phone in the above method embodiments.
[0289] It is understood that the electronic device provided in this application embodiment includes hardware structures and / or software modules corresponding to perform each function in order to achieve the above-mentioned functions. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application.
[0290] This application embodiment can divide the above-described electronic device into functional modules based on the method example described above. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware or as software functional modules. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0291] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0292] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0293] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0294] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0295] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0296] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A control method for an electronic device, applied to an electronic device, characterized in that, The electronic device includes a central processing unit (CPU), and the method includes: A first instruction is detected, which is used to instruct the electronic device to load at least one of system services and third-party services; the first instruction is any one of a power-on instruction, a sleep-wake instruction, and a sleep-wake instruction. In response to the first instruction, within a first time period, the first value of the target running parameter in the current first running strategy is replaced with a second value to obtain the second running strategy. The target operating parameters are parameters that affect the operating performance of the CPU, and the CPU performance is higher when the electronic device uses the second operating strategy than when the electronic device uses the first operating strategy. The target operating parameters include at least one of the following: long-term turbo boost power consumption PL1, short-term turbo boost power consumption PL2, CPU energy efficiency ratio EPP, emergency shutdown EPO control switch status information, and CPU acceleration switch status information. During the first time period, the first instruction is executed based on the second operating strategy; The step of executing the first instruction based on the second operating strategy within the first time period includes: The chip platform type corresponding to the CPU is the first type. During the first time period, the EPO control switch of the CPU is turned off, and the electronic device is controlled to run based on the second running strategy. When the EPO control switch in the CPU is turned on, the CPU uses the default value of the target running parameters.
2. The method according to claim 1, characterized in that, The operating strategy includes the target operating parameters, and also includes at least one of the following operating parameters: fan speed, independent graphics processor (DGPU) overclocking value, video memory overclocking value, integrated graphics processor (IGPU) minimum frequency, IGPU maximum frequency, DGPU minimum frequency, DGPU maximum frequency, power saving display status information, CPU minimum frequency, core binding information, and memory cleanup status information.
3. The method according to claim 1, characterized in that, The first instruction corresponds to the power-on instruction, and the first running strategy is the default running strategy; Corresponding to the first instruction being a sleep-wake instruction or a sleep-wake instruction, the first operating strategy is a historical operating strategy, which includes the operating strategy of the electronic device in the last scheduling.
4. The method according to claim 3, characterized in that, The method further includes: In response to the first instruction, during the first time period, the scheduling of the first type of operation strategy is stopped, wherein the first type of operation strategy is determined based on the current operation status information of the electronic device, and the operation status information is used to characterize the hardware operation status and / or system operation status of the electronic device when operating the current focus window.
5. The method according to claim 4, characterized in that, The first type of operation strategy is determined using a first model, which is used to determine the values of the operation parameters in the first type of operation strategy based on the current operation status information.
6. The method according to claim 5, characterized in that, The method further includes: During the first time period, in response to the second instruction, it is determined that the electronic device is currently in a first operating scenario, and the second instruction is used to instruct the electronic device to load the service under the first operating scenario; During the first time period, a third operating strategy corresponding to the first operating scenario is obtained, wherein the third operating strategy belongs to the second type of operating strategy. The second type of operating strategy is determined according to the current operating scenario of the electronic device. The operating scenario is used to describe the situation in which the electronic device responds to user operation to perform a task in the current focus window.
7. The method according to claim 6, characterized in that, The method further includes: During the first time period, the historical operating strategy is updated to the third operating strategy.
8. The method according to claim 7, characterized in that, The method further includes: The chip platform type corresponding to the CPU is the first type. During the first time period, the EPO control switch in the third running strategy is set to the off state, and the third value of the target running parameter in the third running strategy is replaced with the second value to obtain the fourth running strategy. During the first time period, the second instruction is executed based on the fourth operating strategy.
9. The method according to claim 8, characterized in that, The method further includes: Upon detecting the end of the first time period, the first type of operation strategy is scheduled; The historical operating strategy is determined as the third operating strategy, and the electronic device is controlled based on the third operating strategy.
10. The method according to claim 9, characterized in that, The method further includes: In response to the third instruction, the current operating scenario is determined to be the second operating scenario, and a fifth operating strategy corresponding to the second operating scenario is determined. The third instruction is used to instruct the electronic device to load the service under the second operating scenario.
11. The method according to claim 10, characterized in that, The method further includes: The chip platform type corresponding to the CPU is the first type. Under the first switching condition, the EPO control switch is turned on to switch the power plan of the electronic device from the first power plan to the second power plan, wherein the first power plan is the power plan under the second operating scenario, and the second power plan is the power plan under the second operating scenario. Update the historical operating strategy to the fifth operating strategy, and execute the third instruction based on the fifth operating strategy; The first switching condition includes: the historical operation strategy corresponds to the first identification information and the third operation scenario corresponds to the second identification information. The first identification information is used to indicate the improvement of the operating performance of the electronic device, and the second identification information is used to indicate the reduction of the operating power consumption of the electronic device.
12. The method according to claim 11, characterized in that, The method further includes: Corresponding to the chip platform type being the first type, under the second switching condition, the historical operating strategy is updated to the fifth operating strategy, and the third instruction is executed based on the fifth operating strategy, wherein, The second switching conditions include: the operating scenario corresponding to the historical operating strategy and the third operating scenario both correspond to the first identification information; the operating scenario corresponding to the historical operating strategy and the third operating scenario both correspond to the second identification information; and the historical operating strategy corresponds to the second identification information and the third operating scenario corresponds to the first identification information.
13. The method according to claim 12, characterized in that, The determination of the fifth operating strategy corresponding to the second operating scenario includes: Obtain the sixth operation strategy corresponding to the third operation scenario, and determine the seventh operation strategy based on the operation status information under the third operation scenario, wherein the sixth operation strategy is the second type of operation strategy, and the seventh operation strategy is the first type of operation strategy; The sixth and seventh operating strategies are merged into the fifth operating strategy.
14. The method according to claim 13, characterized in that, The merging of the sixth and seventh operating strategies into a fifth operating strategy includes: Corresponding to the first identification information in the third running scenario, determine the running performance results corresponding to the fourth value of the first running parameter in the sixth running strategy and the fifth value of the second running parameter in the seventh running strategy; If the performance result corresponding to the fourth value of the first operating parameter is higher than the performance result corresponding to the fifth value of the second operating parameter, then the fourth value of the first operating parameter is taken as the fifth operating strategy. or, If the performance result corresponding to the fifth value of the second operating parameter is higher than the performance result corresponding to the fourth value of the first operating parameter, then the fifth value of the second operating parameter shall be used as the fifth operating strategy.
15. The method according to claim 13, characterized in that, The merging of the sixth and seventh operating strategies into a fifth operating strategy includes: Corresponding to the second identification information of the third operating scenario, determine the operating power consumption results corresponding to the fourth value of the first operating parameter in the sixth operating strategy and the fifth value of the second operating parameter in the seventh operating strategy; If the power consumption result corresponding to the fourth value of the first operating parameter is lower than the power consumption result corresponding to the fifth value of the second operating parameter, then the fourth value of the first operating parameter is used as the fifth operating strategy. or, If the power consumption result corresponding to the fifth value of the second operating parameter is lower than the power consumption result corresponding to the fourth value of the first operating parameter, the fifth value of the second operating parameter shall be used as the fifth operating strategy.
16. An electronic device, characterized in that, The electronic device includes: a memory and one or more processors; The memory is used to store computer program code, which includes computer instructions; when the computer instructions are executed by the processor, the electronic device performs the method as described in any one of claims 1 to 15.
17. A computer-readable storage medium, characterized in that, Includes computer instructions; When the computer instructions are executed on an electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1 to 15.
18. A computer program product, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 1 to 15.