Electronic equipment control method, equipment, readable storage medium and program product
By replacing the target operating parameters of the CPU with high performance preset values during the wake-up stage of the electronic device, the problem of high power consumption and weak performance after the wake-up stage is solved, and high performance and fast loading in the wake-up stage is achieved.
Patent Information
- Application Number
- CN202411218532.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2044-08-30
AI Technical Summary
Existing electronic devices are immediately dispatched after power is turned on, resulting in higher power consumption and weaker performance in the wake-up stage, affecting the user experience.
After detecting the wake-up instruction, the initial value of the target running parameters of the CPU is replaced within a certain period of time (such as 3 minutes), and the wake-up instruction is executed using this running strategy to ensure high performance and rapid loading of system services and application services in the wake-up stage.
Maintain high performance during the wake-up phase, ensure faster running speed and response speed, improve user experience, and avoid the problem of reducing power consumption and affecting performance.
Smart Images

Figure CN120066239A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of power electronics technologies, and in particular, to a control method, device, readable storage medium, and program product for an electronic device. Background Art
[0002] With the improvement of the performance of electronic devices, the power consumption of electronic devices is also getting higher and higher. In order to improve the user experience, the power consumption of electronic devices can be reduced, and the battery life of electronic devices can be improved.
[0003] Currently, an electronic device may perform power consumption scheduling immediately after being powered on. For example, a laptop computer in a battery-disconnected state will perform power consumption scheduling immediately after being powered on. However, the system of the electronic device will load various system services and third-party application services during the power-on wake-up phase, resulting in a relatively high system power consumption and a relatively weak overall performance. At this time, if power consumption scheduling is performed, such as reducing power consumption, it will exacerbate the performance degradation, such as causing the running speed and response speed to slow down, which will affect the user experience. Summary of the Invention
[0004] Embodiments of the present application provide a control method, device, readable storage medium, and program product for an electronic device.
[0005] In a first aspect, an embodiment of the present application provides a control method for an electronic device, which is applied to the electronic device. The electronic device includes a central processing unit (CPU). The method includes: detecting a first instruction, where the first instruction is used to instruct to load at least one of the system services and third-party services of the electronic device; in response to the first instruction, within a first time period, replacing a first value of a target operating parameter in a current first operating policy with a second value to obtain a second operating policy, where the target operating parameter is a parameter that affects the operating performance of the CPU, and the performance of the CPU when the electronic device uses the second operating policy is higher than the performance of the CPU when the electronic device uses the first operating policy; within the first time period, executing the first instruction based on the second operating policy. It can be understood that the above first instruction may be a wake-up instruction of the electronic device. At this time, the electronic device can replace the first value of the target operating parameter in the operating policy that has taken effect at the hardware layer with the second value. In this way, it is possible to control the electronic device based on a preset value (i.e., the second value) of the target operating parameter, so that the electronic device can maintain a relatively high performance within a first time period, such as 3 minutes, during the wake-up phase, and can quickly load various system services and third-party application services / resources during the wake-up phase, ensuring that the running speed and response speed of the electronic device are relatively fast during this period and improving the user experience during the wake-up phase.
[0006] In a possible implementation of the first aspect described above, the target operating parameter includes at least one of the following: long-term turbo power consumption PL1, short-term turbo power consumption PL2, CPU energy efficiency ratio EPP, emergency shutdown EPO control switch status information, CPU acceleration switch status information. That is, the target operating parameter is a parameter that affects the CPU performance.
[0007] In a possible implementation of the first aspect described above, the operating policy includes the target operating parameter, and also includes at least one of the following operating parameters: fan speed, discrete graphics processing unit (DGPU) overclock value, video memory overclock value, integrated graphics processing unit (IGPU) minimum frequency, IGPU maximum frequency, DGPU minimum frequency, DGPU maximum frequency, energy-saving display status information, CPU minimum frequency, core binding information, and memory cleaning status information. The parameters in the operating policy are parameters that affect the operating performance and / or operating power consumption of the electronic device.
[0008] In a possible implementation of the first aspect described above, in the first time period, executing the first instruction based on the second operating policy includes: corresponding to the chip platform type of the CPU being the first type, in the first time period, turning off the emergency shutdown EPO control switch of the CPU, and controlling the operation of the electronic device based on the second operating policy. The CPU of the first type can be the CPU chip. At this time, in this application, by first turning off the EPO control switch and then issuing the second value of the target operating parameter, that is, the high-performance PPM parameter, it is prevented that the issued PPM parameter is modified by the system, ensuring that the high-performance PPM parameter takes effect at the hardware layer to ensure the high performance of the CPU.
[0009] In a possible implementation of the first aspect described above, the first instruction is any one of a power-on instruction, a sleep wake-up instruction, and a suspend wake-up instruction; corresponding to the first instruction being a power-on instruction, the first operating policy is the default operating policy; corresponding to the first instruction being a sleep wake-up instruction or a suspend wake-up instruction, the first operating policy is the historical operating policy, and the historical operating policy includes the operating policy scheduled by the electronic device last time.
[0010] In a possible implementation of the first aspect described above, the method further includes: in response to the first instruction, in the first time period, stopping the scheduling of the first type of operating policy, where the first type of operating policy is determined according to the current operating state information of the electronic device, and the operating state information is used to characterize the hardware operating conditions and / or system operating conditions when the electronic device operates the current focused window. That is, in response to the first instruction, the scheduling of the performance power consumption model described below is stopped in the first time period. Triggered by the first instruction, the electronic device can stop scheduling the first type of operating policy 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 operating policy determined by the performance power consumption engine, so as to avoid affecting the performance due to reducing the power consumption.
[0011] In a possible implementation of the first aspect above, the first type of operating strategy is determined using a first model (such as the performance power consumption model described below), and the first model is used to determine the values of operating parameters in the first type of operating strategy based on current operating status information.
[0012] In a possible implementation of the first aspect, the method further includes: in 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 is used to instruct the electronic device to load a service under the first operating scenario; in 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 is determined according to the current operating scenario of the electronic device, and the operating scenario is used to describe the scenario in which the electronic device responds to a user operation to perform a task in the current focus window. That is, in the first time period of the wake-up phase, the electronic device can only use the scene recognition engine to determine the operating strategy based on the current operating scenario.
[0013] In a possible implementation manner of the first aspect above, the method further includes: updating the historical operation strategy to a third operation strategy within the first time period.
[0014] In a possible implementation of the first aspect, the method further includes: corresponding to the chip platform type of the CPU being the first type, within the first time period, setting the EPO control switch in the third operation strategy to the off state, and replacing the third value of the target operation parameter in the third operation strategy with the second value, to obtain a fourth operation strategy; within the first time period, executing the second instruction based on the fourth operation strategy. The EPO control switch status information is in the off state, such as the EPO control switch status information value is 0, which is used to trigger the EPO control switch to be turned off. In this way, the current fourth operation strategy is issued, and the high-performance PPM parameters are issued to ensure that the fourth operation strategy is issued normally and takes effect.
[0015] In a possible implementation of the first aspect, the method further includes: detecting the end of the first time period, scheduling the first type of operation strategy; determining the historical operation strategy as the third operation strategy, and controlling the electronic device based on the third operation strategy. That is, after the wake-up phase ends, the model in the performance power consumption engine is rescheduled, and the current historical operation strategy is resent to the hardware layer through the scheduling engine.
[0016] In a possible implementation of the first aspect, the method further includes: in response to a third instruction, determining that the current operation scenario is a second operation scenario, and determining a fifth operation strategy corresponding to the second operation scenario, wherein the third instruction is used to instruct the electronic device to load a service under the second operation scenario. For example, the third instruction may trigger the performance power consumption engine and the scene recognition engine to determine the operation strategy, so as to adjust the operation strategy according to the current operation scenario.
[0017] In a possible implementation of the above first aspect, the method further includes: corresponding to the chip platform type of the CPU being the first type, under the first switching condition, turning on the EPO control switch, and switching the power plan of the electronic device from the first power plan to the second power plan, where the first power plan is the power plan in the second operating scenario, and the second power plan is the power plan in the second operating scenario; updating the historical operating policy to the fifth operating policy, and executing the third instruction based on the fifth operating policy; where the first switching condition includes: the historical operating policy 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 time, when the chip platform type of the CPU is the first type, that is, an Intel CPU chip, the electronic device can send an EPO enable instruction and a performance exit instruction to the hardware layer through the scheduler to turn on the EPO control switch and exit the performance scenario. Specifically, the hardware layer can turn on the EPO control switch under the trigger of the EPO off instruction. The hardware layer can exit the performance scenario under the trigger of the performance exit instruction, such as exiting the power plan of the high-performance type, and can also switch to the balanced type or the energy-saving type of power plan. In this way, the electronic device first turns on the EPO switch through the scheduler and then issues the operating policy, preventing the operating policy corresponding to the high-performance scenario from not being able to exit and causing the subsequent issued operating policy to become ineffective.
[0019] In a possible implementation of the above first aspect, the method further includes: corresponding to the chip platform type being the first type, under the second switching condition, updating the historical operating policy to the fifth operating policy, and executing the third instruction based on the fifth operating policy, where the second switching condition includes: the operating scenario corresponding to the historical operating policy and the third operating scenario both correspond to the first identification information, the operating scenario corresponding to the historical operating policy and the third operating scenario both correspond to the second identification information, the historical operating policy 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 default in the on state. At this time, the scheduler does not need to instruct the hardware layer to turn on the EPO control switch, but directly issues the operating policy to the hardware layer, such as issuing the fifth operating policy to the hardware layer through the scheduler.
[0020] In a possible implementation of the above first aspect, determining the fifth operation policy corresponding to the second operation scenario includes: obtaining the sixth operation policy corresponding to the third operation scenario, and determining the seventh operation policy according to the operation status information in the third operation scenario, where the sixth operation policy is a second type of operation policy and the seventh operation policy is a first type of operation policy; fusing the sixth operation policy and the seventh operation policy into the fifth operation policy.
[0021] In a possible implementation of the above first aspect, fusing the sixth operation policy and the seventh operation policy into the fifth operation policy includes: corresponding to the first identification information corresponding to the third operation scenario, determining the operation performance result corresponding to the fourth value of the first operation parameter in the sixth operation policy and the fifth value of the second operation parameter in the seventh operation policy; corresponding to the operation performance result of the fourth value of the first operation parameter being higher than the operation performance result of the fifth value of the second operation parameter, taking the fourth value of the first operation parameter as the fifth operation policy, or corresponding to the operation performance result of the fifth value of the second operation parameter being higher than the operation performance result of the fourth value of the first operation parameter, taking the fifth value of the second operation parameter as the fifth operation policy. So that the fused fifth operation policy has a higher operation performance when controlling the operation of the electronic device.
[0022] In a possible implementation of the above first aspect, fusing the sixth operation policy and the seventh operation policy into the fifth operation policy includes: corresponding to the second identification information corresponding to the third operation scenario, determining the operation power consumption result corresponding to the fourth value of the first operation parameter in the sixth operation policy and the fifth value of the second operation parameter in the seventh operation policy; corresponding to the operation power consumption result of the fourth value of the first operation parameter being lower than the operation power consumption result of the fifth value of the second operation parameter, taking the fourth value of the first operation parameter as the fifth operation policy, or corresponding to the operation power consumption result of the fifth value of the second operation parameter being lower than the operation power consumption result of the fourth value of the first operation parameter, taking the fifth value of the second operation parameter as the fifth operation policy. So that the fused fifth operation policy has a lower operation power consumption when controlling the operation of the electronic device.
[0023] In a second aspect, an embodiment of the present application provides an electronic device, which includes: a memory and one or more processors; where the memory is used to store computer program code, and the computer program code includes computer instructions; when the computer instructions are executed by the processor, the electronic device is caused to execute the method in the above first aspect and any of its possible implementation manners.
[0024] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, including computer instructions; when the computer instructions are run on an electronic device, the electronic device is caused to execute the method in the first aspect and any of its possible implementation manners.
[0025] Fourthly, an embodiment of the present application provides a computer program product. When the computer program product runs on a computer, it causes the computer to execute the method in the first aspect and any possible implementation manner thereof.
[0026] Among them, for the technical effects brought by any design manner in the second aspect, the third aspect, and the fourth aspect, reference can be made to the technical effects brought by different design manners in the first aspect, which will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 According to some embodiments of the present application, a schematic structural diagram of an electronic device 100 is shown;
[0028] Figure 2 According to some embodiments of the present application, a schematic diagram of the interaction principle of modules related to operation policy control in an electronic device 100 is shown;
[0029] Figure 3 According to some embodiments of the present application, a schematic diagram of the interaction principle of modules related to operation policy control in an electronic device 100 is shown;
[0030] Figure 4 According to some embodiments of the present application, a schematic diagram of modules related to operation policy control in an electronic device 100 is shown;
[0031] Figure 5 According to some embodiments of the present application, a schematic flowchart of a control method for an electronic device is shown;
[0032] Figure 6 According to some embodiments of the present application, a schematic diagram of a usage scenario of an electronic device is shown;
[0033] Figure 7 According to some embodiments of the present application, a schematic flowchart of a control method for an electronic device is shown;
[0034] Figure 8 According to some embodiments of the present application, a schematic diagram of a usage scenario of an electronic device is shown;
[0035] Figure 9 According to some embodiments of the present application, a schematic flowchart of a control method for an electronic device is shown;
[0036] Figure 10 According to some embodiments of the present application, a schematic flowchart of the working process of software and hardware for an electronic device 100 to control operation parameters is shown. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0037] Exemplary embodiments of the present application include, but are not limited to, a control method, a device, a computer-readable storage medium, and a program product for an electronic device.
[0038] For the sake of clear and concise description of the following embodiments, a brief introduction to relevant concepts or technologies is first given:
[0039] (1) Focus window, which refers to the window that has the focus. Among them, the focus is the position where the current cursor is activated. That is to say, the focus window is the window where the current cursor is activated, and this focus window is the current operation window and can receive keyboard input. Generally, the window with a non-gray title bar is the focus window.
[0040] (2) Running scenario, which is used to describe the scenario where the electronic device responds to user operations to execute tasks in the focus window. Among them, the task refers to the execution content related to the function provided by the focus window. For example, the running scenarios that the electronic device is in may include a video scenario, a game scenario, a social scenario, an office scenario, a browser scenario, a smart interconnection scenario, a performance evaluation scenario, a programming scenario, a super terminal scenario, a design software scenario, a process startup scenario, a large file opening scenario, a desktop scenario, and so on.
[0041] The task corresponding to the video scenario can be playing a video; the task corresponding to the game scenario can be playing a game; the tasks corresponding to the social scenario can be voice chatting, video chatting, typing chatting, etc.; the tasks corresponding to the office scenario can be editing a document; the tasks corresponding to the browser scenario can be browsing the web; the tasks corresponding to the smart interconnection scenario can be sharing information after multiple electronic devices are interconnected, the tasks corresponding to the performance evaluation scenario can be experimental analysis of the performance of the electronic device; the tasks corresponding to the programming scenario can be programming; the tasks corresponding to the super terminal scenario can be that the electronic device can operate one or more other electronic devices, the tasks corresponding to the design software scenario can be designing software, the tasks corresponding to the process startup scenario can be memory management, task scheduling, etc.; the large file opening scenario can be a scenario for opening a file that exceeds a preset file size, etc.; the desktop scenario can be a scenario for the desktop background, icon arrangement, display or configuration of the task bar.
[0042] Among them, the video scenario can further include a video playback scenario, a video browsing scenario, and a video barrage scenario. The social scenario can further include a text chatting scenario, a voice chatting scenario, a video chatting scenario, etc. The office scenario can further include a document editing scenario, a document browsing scenario, a video conferencing scenario, etc., and these scenarios can also be called refined scenarios for office software operations. The browser scenario can include a web browsing scenario and a video playback scenario, etc.
[0043] (3) Power consumption scenario. A power consumption scenario is an operating scenario mainly aimed at reducing the power consumption of an electronic device, such as an office scenario, a social scenario, a desktop scenario, etc.
[0044] (4) Performance scenario. A performance scenario is an operating scenario that takes into account the operating performance of an electronic device while reducing its power consumption. For example, a programming scenario, a video scenario, a game scenario, a large file opening scenario (a file opening scenario exceeding a preset file size), etc.
[0045] (5) Power plan. A power plan is a function provided by an operating system that can adjust the power usage mode of a computer according to the operating scenario and user needs to achieve the purpose of energy saving or performance improvement. The types of power plans can include the following: balanced, power saver, high performance. The balanced type is the default power plan and is suitable for operating scenarios such as office work, web browsing, and video playback. The power saver type is suitable for operating scenarios such as video conferencing, can reduce battery consumption, and extend battery life. The high performance type is suitable for operating scenarios such as games and can output stably and with high performance.
[0046] (6) Power limit (PL). It is used to limit the power consumption of the central processing unit (CPU) in an electronic device. Generally, the form of "PL + number" can be used to represent the level of power consumption limit for the CPU. Among them, the "number" in "PL + number" represents the specific level. For example, the levels of power consumption limit for the CPU from small to large numbers include four levels, namely PL1, PL2, PL3, and PL4. The smaller the number, the lower the power consumption limit level. The embodiments of this application mainly relate to PL1 and PL2, and PL1 and PL2 are mainly introduced below. (7) Long-term turbo power consumption (PL1). It refers to the power consumption of the CPU under normal load, which is equivalent to the thermal design power consumption. The operating power consumption of the CPU does not exceed PL1 for most of the time.
[0047] (8) Short-term turbo power consumption (PL2). It refers to the highest power consumption that the CPU can reach within a short period of time, and it has a duration limit. Generally, PL2 is greater than PL1.
[0048] (9) CPU energy efficiency ratio (EPP). It can be the ratio of CPU energy consumption to performance output, used to reflect the scheduling tendency of the CPU, and its value range is 0 to 255. The smaller the CPU energy efficiency ratio, the more the CPU tends to high performance; the higher the CPU energy efficiency ratio, the more the CPU tends to low power consumption.
[0049] (10) The CPU frequency, also known as the processor clock speed or main frequency, is an important indicator for measuring CPU performance. It represents the number of instructions that the CPU can execute per unit of time (usually seconds). The 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, the processing speed is faster.
[0050] (11) Emergency power off (EPO) control switch. Emergency power off (EPO) control is a safety function used to immediately cut off the power supply of electronic devices in case of an emergency. For example, electronic devices such as laptops can implement the EPO function through hardware or software configurations to ensure that the computer can be quickly shut down in extreme cases to protect user safety. The EPO function of a laptop is usually in an inactive state, waiting to be activated by the user through a specific method (such as a physical switch) when necessary.
[0051] As described in the background art above, during the wake-up stage such as when an electronic device is powered on, if the power consumption is reduced, it will lead to poor performance and affect the user experience.
[0052] The present application provides a control method for an electronic device. During the wake-up stage of the electronic device in the shutdown / sleep / hibernation state, within a period of time such as 3 minutes (min) after detecting a wake-up instruction (such as a power-on instruction) for waking up the electronic device, the target operating parameters of the CPU can be set to a preset value of high performance. Then, through this preset value, the CPU frequency can be increased, such as adjusted to the maximum frequency value, to improve the CPU performance, so that the performance of the electronic device during the wake-up stage is relatively high and the power consumption is relatively large. At this time, the overall power consumption of the electronic device can be greater than LP1, such as the power consumption is LP2. Then, the numerical value of the target operating parameters in the current operating strategy of the electronic device can be replaced with the above preset value, and the electronic device can be controlled based on the adjusted operating strategy to achieve the control of the electronic device based on the preset value of the target operating parameters. In this way, the electronic device can maintain a relatively high performance within 3 minutes during the wake-up stage, be able to quickly load various system services and third-party application services / resources during the wake-up stage, ensure that the running speed and response speed of the electronic device are relatively fast during this period, and improve the user experience during the wake-up stage.
[0053] Exemplarily, the electronic device in the embodiments of the present application can be an electronic device such as a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC) device, etc. The embodiments of the present application do not impose special restrictions on the specific form of the electronic device.
[0054] Please refer to Figure 1, which is a schematic structural diagram of the electronic device 100 provided by the embodiment of the present application.
[0055] As Figure 1 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 can be 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 those shown, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0057] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0058] In some embodiments, the processor and the 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 the electronic device and is responsible for executing various instructions and performing data processing.
[0059] However, in other embodiments, the processor and the CPU may not be the same component. The processor may refer to a more complete system. For example, the processor may be a system on a chip (SoC), which not only includes the CPU but may also include other components such as the GPU and the memory controller.
[0060] In the embodiments of the present application, the operating parameters may be parameters related to the CPU and GPU. During the wake-up phase of the electronic device in the shutdown / sleep / sleep state, etc., the processor may obtain a high-performance preset value of the target operating parameters related to the CPU within a preset time period (which may be referred to as the first preset time period). Then, the processor may replace the value of the target operating parameter in the current operating policy (which may be referred to as the first value) with the above preset value (which may be referred to as the second value), so as to control the operation of the electronic device based on the adjusted operating policy, thereby ensuring the performance of the electronic device during the wake-up phase.
[0061] The controller may be the nerve center and command center of the electronic device 100. The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
[0062] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory may save the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0063] In some embodiments, the processor 110 may include one or more interfaces. The 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 is used to receive a charging input from a charger. Among them, the charger may be a wireless charger or a wired charger. While charging the battery 142, the charging management module 140 may also supply power to the electronic device through 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 inputs from the battery 142 and / or the charging management module 140 to supply power to the processor 110, the internal memory 121, the external memory, the display screen 160, the wireless communication module 150, etc. In some embodiments, the power management module 141 and the charging management module 140 may also be provided in the same device.
[0066] The wireless communication module 150 can provide wireless communication solutions applied to the electronic device 100, including WLAN (such as Wi-Fi), Bluetooth, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), 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 the antenna, frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 150 can also receive the signals to be sent from the processor 110, frequency-modulate them, amplify them, and convert them into electromagnetic waves through the antenna for radiation.
[0068] The electronic device 100 realizes the display function through the GPU, the display screen 160, and the application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 160 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change the 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 memory 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 memory interface 120 to achieve the data storage function. For example, files such as music and videos are saved in the external memory card.
[0071] The internal memory 121 can be used to store computer-executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. For example, in the embodiments of the present application, the processor 110 can execute the instructions stored in the internal memory 121, and the internal memory 121 can include a program storage area and a data storage area.
[0072] Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.). In addition, the internal memory 121 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0073] Figure 2 The schematic diagram of the interaction principle of modules related to the operation policy control in an electronic device 100 is shown. As Figure 2 shown, the electronic device 100 can include a scene recognition engine, a performance and power consumption engine, and a scheduling engine. In some embodiments, the scene recognition engine, the performance and power consumption engine, and the scheduling engine can be Figure 1 modules in the processor 110 of the shown embodiments for implementing corresponding functions.
[0074] The performance and power consumption engine can determine an operation policy (which can be called the first type of operation policy) that limits the operation power consumption of the electronic device 100 and stabilizes the operation performance of the electronic device. Among them, the performance and power consumption engine can train a performance and power consumption model, and use the trained performance and power consumption model to determine the operation policy.
[0075] The scene recognition engine can recognize the operation scene where the electronic device 100 is located, such as a performance scene or a power consumption scene, and determine an operation policy (which can be called the second type of operation policy) that matches the operation scene. In addition, the scene recognition engine is also used to detect events such as wake-up events like power-on, or to detect wake-up instructions such as power-on instructions. After recognizing the wake-up event, a timer is started, and within a preset time period timed by the timer, the target operation parameter of the CPU in the current operation policy is adjusted to a preset value.
[0076] The scheduling engine is used to control the resource scheduling of the electronic device by using the operation policy. Specifically, it performs resource scheduling to control the operation of hardware such as the CPU and GPU in the electronic device. The scheduling engine may include a scheduling engine 1 and a scheduling engine 2. The scheduling engine 1 is used to send the first type of operation policy to the hardware layer, and the scheduling engine 2 is used to send the second type of operation policy or the operation policy after fusing the second type of operation policy and the first type of operation policy to the hardware layer. For the convenience of description, the scheduling engine that appears alone in the following embodiments may be a general term for the scheduling engine 1 and the scheduling engine 2.
[0077] In some embodiments, the performance power consumption engine and the scenario recognition engine may cooperate or independently determine the operation policy to control the electronic device 100. This application can determine the working states of the performance power consumption engine and the scenario recognition engine according to the working stage, operation scenario, power mode, and event trigger of the electronic device, such as normal scheduling or stopping scheduling. For example, the electronic device 100 may only normally schedule the scenario recognition engine to determine the operation policy during the wake-up stage, and may determine the operation policy through the scenario recognition engine and the performance power consumption engine during the running stage. For example, when the electronic device 100 is in the DC mode, it can normally schedule the performance power consumption engine to determine the operation policy, while in the AC / DC mode, it can determine the operation policy through the scenario recognition engine and the performance power consumption engine.
[0078] Among them, the above AC mode and DC mode are different power modes of the electronic device. AC is alternating current, which means that the electronic device 100 is in the plugged-in state; DC is direct current, which means that the electronic device 100 is in the unplugged state. Correspondingly, the AC / DC mode means that the electronic device is in the plugged-in state or the unplugged state.
[0079] Next, in combination with Table 1 and Figure 3 the relationship between the scenario recognition engine and the performance power consumption engine and the operation policy shown, the steps related to determining the operation policy during the wake-up stage of the electronic device 100 are described.
[0080] Referring to Table 1, a schematic diagram showing the working states of the performance power consumption engine and the scenario recognition engine and the usage status of the preset values of the target operation parameters of the CPU during the wake-up stage of the electronic device 100 in the embodiments of this application is shown.
[0081] Table 1:
[0082]
[0083] As shown in Table 1, during the wake-up phase of the electronic device 100 when it is shut down / sleeping / hibernating, in the AC / DC mode, for example, the scheduling of the performance power consumption model can be stopped, and the scenario recognition engine can be normally scheduled to determine the operating policy. It can be understood that during the wake-up phase of the electronic device 100, since various system services and third-party services need to be loaded, it is necessary to ensure the high performance of the electronic device 100. Then, within a preset time period during the wake-up phase, stopping the scheduling of the performance power consumption engine can avoid reducing power consumption; and the scenario recognition engine can replace the value of the target operating parameter in the current operating policy with the above preset value through the scheduling engine 2 to ensure high performance during the wake-up phase.
[0084] It can be understood that during the wake-up phase, when the electronic device determines the operating policy, it does not need to consider the power mode, that is, regardless of whether the power mode of the electronic device is the DC mode or the AC mode, the electronic device uses the scenario recognition engine to determine the operating policy and stops scheduling the performance power consumption engine.
[0085] Figure 3 The schematic diagram of the interaction principle of the modules related to the operating policy control in an electronic device 100 is shown. As Figure 3 shown, the scenario recognition engine can include a system probe module, a scenario recognition module, a scenario policy configuration module, a timing module, and a parameter configuration module.
[0086] The system probe module is used to obtain the operating status information of the electronic device.
[0087] The operating status information can include one or more of power status information, peripheral status information, process load information, audio-video status information, system load information, or system event information, etc. Among them, the above power status information, peripheral status information, and audio-video status information can be considered as the hardware operating conditions; the process load information, system load information, and system event information can be considered as the system operating conditions.
[0088] Among them, the power status information can include one or more of the battery (remaining) power, power mode, etc. The power mode can include AC and DC.
[0089] The peripheral status information can include one or more of a mouse wheel scrolling event, a mouse click event, a keyboard input event, a microphone input event, or a camera input event, etc.
[0090] The process load information includes the average value information of the CPU time ratio occupied by each process in the system. The process load information can reflect the operating conditions of each process in the system, including system core processes and other user processes.
[0091] The audio and video status information includes the audio and video events currently existing in the electronic device 100. The audio and video events may include one or more of GPU decoding events, video events, video frame rates, video subtitles, etc.
[0092] The system load information includes the total information of the number of processes currently being executed by the CPU and waiting to be executed by the CPU. The system load information can be an important indicator reflecting the busy and idle degree of the system.
[0093] The system event information may include one or more of window change information, system lock information, process creation information, or thread creation information, etc.
[0094] The operation status information described above is only an example. The operation status information can also be other information used to characterize the hardware operation situation and / or system operation situation when the electronic device operates on the focus window, such as screen brightness, download speed, etc., but not limited thereto.
[0095] The system probe module may include multiple types of probes. For example, it may include a power status probe, a peripheral status probe, a process load probe, an audio and video status probe, a system load probe, and a system event probe, etc. Correspondingly, the power status probe can be used to detect power status information; the peripheral status probe can be used to detect peripheral status information; the process load probe can be used to detect process load information; the audio and video status probe can be used to detect audio and video status information; the system load probe can be used to detect system load information; the system event probe can be used to detect system event information. Among them, the information detected by each probe can also be called probe status information. That is to say, the probe status information detected by each probe can be used as the operation status information.
[0096] The scene recognition module can determine the current operation scene. For example, the operation scene where the electronic device is located may include a video scene, a game scene, a social scene, an office scene, a browser scene, a smart interconnection scene, a test scene, a programming scene, a super terminal scene, a design software scene, a process startup scene, a large file opening scene, etc.
[0097] The scene policy configuration module is used to store the mapping relationship between the operation scene and the operation policy (i.e., the second type of operation policy), and this mapping relationship is stored in the form of a policy table.
[0098] The timing module is used for timing. For example, when the electronic device receives a power-on instruction, a sleep wake-up instruction, or a hibernation wake-up instruction during the wake-up phase, timing is performed through a timer.
[0099] The parameter setting module is used to set and store the preset values of the target operating parameters of the CPU. For example, the target operating parameter can be called the PPM parameter, and the preset value of the target operating parameter can be called P1. In addition, the parameter setting module is also used to record the operation policy issued by the scheduling engine last time (which can be called the historical operation policy), and the operation policy to be issued currently (which can be called the current operation policy).
[0100] As Figure 3 shown, the performance and power consumption engine may include a performance and power consumption model. The performance and power consumption model is used to determine the corresponding operation policy according to the operation status information of the operation scenario.
[0101] Figure 3 In S1 to S10 in [the figure], it is the wake-up stage of the electronic device 100 and the interaction process among the performance and power consumption engine, the scenario recognition engine, and the scheduling engine. The roles of the performance and power consumption engine, the scenario recognition engine, and the scheduling engine in the wake-up stage of the electronic device 100 in the embodiments of the present application will be specifically introduced below.
[0102] S1: The scenario recognition engine receives a wake-up instruction, and under the trigger of the wake-up instruction, starts timing by calling a timer through the scenario recognition module. For example, the timing time of the timer can be called the preset time period or T1, such as the timing time is 3 min.
[0103] S2: The scenario recognition engine sends a stop scheduling instruction to the performance and power consumption engine through the scenario recognition module.
[0104] The scenario recognition engine, under the trigger of the wake-up instruction, notifies the performance and power consumption engine to stop scheduling.
[0105] In some embodiments, the scenario recognition engine and the performance and power consumption engine are respectively a process in the housekeeper application installed in the electronic device 100. For example, the two engines can interact using inter-process communication (IPC) messages. For example, the scenario recognition engine can use IPC messages to send a stop scheduling instruction to the performance and power consumption engine.
[0106] S3: The scenario recognition engine calls the parameter setting module through the scenario recognition module to set the PPM parameter to P1, so as to obtain P1 from the parameter configuration module through the scenario recognition module.
[0107] The scenario recognition engine, under the trigger of the wake-up instruction, calls the parameter setting module to set the PPM parameter.
[0108] S4: The scenario recognition engine sends an EPO off instruction to the scheduling engine through the scenario recognition module.
[0109] The scenario recognition engine may be when the chip platform type of the CPU is, for example, Intel When the CPU chip is in a certain state, an EPO off command is sent. In this way, the hardware layer can turn off the EPO control switch under the trigger of the EPO off command.
[0110] S5: The scenario recognition engine calls the scenario recognition module to send P1 to the scheduling engine.
[0111] It can be understood that when the EPO control switch in the CPU of the electronic device is turned on, the CPU usually uses the default value of the target operating parameter (i.e., the PPM parameter). For example, this default value is a value that makes the performance and power consumption of the CPU relatively balanced. Then, when the EPO control switch is on, if the PPM parameter is directly sent, in the hardware layer, the CPU may modify the value of the sent PPM parameter, such as the preset value, to the default value, resulting in the sent PPM parameter being modified by the system, and thus the sent high-performance PPM parameter (i.e., P1) cannot take effect.
[0112] In this way, for example, on the Intel chip platform, in the present application, by first turning off the EPO control switch and then sending the PPM parameter, it is prevented that the preset value of the target operating parameter sent by the scheduling engine is modified by the system, ensuring that the sent PPM parameter such as P1 takes effect.
[0113] In some embodiments, the effective operating policy 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 this operating policy can be replaced with the preset value, that is, the PPM parameter in this operating policy is replaced with P1.
[0114] If the wake-up instruction is a wake-up instruction for shutdown, then the wake-up stage of the electronic device 100 is the power-on stage, and the effective operating policy can be the default operating policy or the operating policy obtained from the scenario policy configuration module (i.e., the second type of operating policy).
[0115] If the wake-up instruction is a wake-up instruction for hibernation / sleep, then the effective operating policy can be the operating policy stored in the scenario policy configuration module (i.e., the second type of operating policy), or the operating policy determined by the performance power consumption engine (i.e., the first type of operating policy), or the operating policy after the fusion of the operating policy stored in the scenario policy configuration module and the operating policy determined by the performance power consumption engine.
[0116] It can be understood that the effective operating policy in the hardware layer can be the historical operating policy recorded in the scenario recognition engine.
[0117] The operating policy includes various operating parameters, and the operating parameters can be parameters of the electronic device related to power consumption and the operating performance of the electronic device.
[0118] The operating policy may include one or a combination of 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) overclock value, video memory overclock value, integrated graphics processing unit (IGPU) minimum frequency, IGPU maximum frequency, DGPU minimum frequency, DGPU maximum frequency, energy-saving display status information, CPU minimum frequency, core binding information, and memory cleaning status information.
[0119] Among them, core binding, also known as setting the affinity of a process or thread, refers to binding a certain process or thread to a specific CPU core for running. This can improve performance because the process or thread only runs on the bound CPU core, reducing the time for switching between multiple cores. However, core binding does not mean that the process or thread exclusively occupies the CPU core, and other processes or threads can still run on this core.
[0120] As an example, the target operating parameters related to the CPU (i.e., PPM parameters) may include parameters such as PL1, PL2, EPP, and CPU acceleration switch status information. The target operating parameters are the operating parameters that affect the CPU frequency and thus affect the CPU performance.
[0121] S6: The scenario recognition engine calls the system probe module to obtain the current operating status information.
[0122] Within a preset time period, the scenario recognition module can determine the current operating scenario based on the current operating status information.
[0123] S7: The scenario recognition engine determines the current operating scenario based on the operating status information through the scenario recognition module and sends the current operating scenario to the scenario policy configuration module.
[0124] S8: The scenario recognition engine obtains the operating policy corresponding to the current operating scenario from the scenario policy configuration module through the scenario recognition module.
[0125] In some embodiments, the scenario recognition engine can send the information of the current operating scenario to the scenario policy configuration module through the scenario recognition module. Further, the scenario policy configuration module can match the operating policy corresponding to the current operating scenario from the stored policy table and then send the operating policy to the scenario recognition module, so that the scenario recognition engine obtains the operating policy.
[0126] S9: The scenario recognition engine sends the operation policy obtained by the scenario recognition module to the parameter configuration module to update the historical operation policy recorded by the parameter configuration module.
[0127] S10: The scenario recognition engine calls the scenario recognition module to replace the PPM parameter in the current operation policy with P1, and sends the operation policy after replacing P1 to the scheduling engine.
[0128] Within a preset time period, the scenario recognition module replaces the value of the target operation parameter in the operation policy of the current operation scenario with a preset value, and sends the operation policy after replacing the preset value to the scheduling engine.
[0129] In this way, within the preset time period of the wake-up phase of the electronic device 100, triggered by the wake-up instruction, the scenario recognition engine can stop scheduling through the performance power consumption engine to avoid generating an operation policy for reducing power consumption through the performance power consumption engine. In addition, in response to the wake-up instruction, the scenario recognition engine can issue a high-performance preset value of the target operation parameter to ensure the performance of the electronic device during the wake-up phase.
[0130] Next, in combination with Table 2 and Figure 4 the relationship between the scenario recognition engine and the performance power consumption engine and the operation policy shown, the steps related to determining the operation policy during the normal operation phase of the electronic device 100 will be described.
[0131] Referring to Table 2, a schematic diagram showing the working states of the performance power consumption engine and the scenario recognition engine and the usage status of the preset values of the target operation parameters of the CPU during the operation phase of the electronic device 100 in the embodiments of the present application is shown.
[0132] Table 2:
[0133]
[0134]
[0135] As shown in Table 2, during the normal operation phase of the electronic device 100, after the preset time period of the wake-up phase ends, in the AC / DC mode, the performance power consumption engine and the scenario recognition engine can cooperate or independently determine the operation policy to control the electronic device 100. The cooperation of the two engines can achieve a balance between performance and power consumption.
[0136] As shown in Table 2, during the operation phase of the electronic device 100, if it is detected that the current operation scenario is a performance scenario, then in the AC / DC mode, the scenario recognition engine is normally scheduled to determine the second type of operation policy matching the current operation scenario, and at the same time, the scheduling of the performance power consumption engine to determine the operation policy is stopped. Furthermore, the second type of operation policy is sent to the hardware layer through the scheduling engine 2. Until the performance scenario is exited, the performance power consumption engine is rescheduled.
[0137] As shown in Table 2, during the operation phase of the electronic device 100, if a first event is detected in the DC mode, the normal scheduling performance power consumption engine determines the operation policy and stops the operation policy of the scheduling scenario recognition engine. Then, the operation policy determined by the performance power consumption engine is sent to the hardware layer through the scheduling engine 1.
[0138] The first event is an event that affects the operation performance of the electronic device. The first event can be used to trigger the electronic device to determine the operation policy using the performance power consumption engine.
[0139] The first event may include one or more of a primary event, a performance-limited event, or a performance power consumption model training event. The primary event may include an operation event of the user on the current focused window, and / or a stuttering event. Exemplarily, the operation event may include one or more of a mouse click event, a keyboard input event, or an operation event for switching applications.
[0140] The performance-limited event is an event in which the hardware performance feedback by the hardware of the electronic device is limited. Among them, the hardware performance limitation may be that the operating speed of the chip of the electronic device is limited. Based on this, the performance-limited event may also be referred to as a chip performance-limited event.
[0141] The performance power consumption model training event is an event for training the performance power consumption model.
[0142] As shown in Table 1, during the operation phase of the electronic device 100, if the current operation scenario is detected as a power consumption scenario or a second event is detected in the AC / DC mode, the normal scheduling scenario recognition engine determines the second type of operation policy matching the current operation scenario, and the normal scheduling performance power consumption engine obtains the first type of operation policy in the current operation scenario, and then fuses the second type of operation policy and the first type of operation policy to obtain the fused operation policy. Then, the fused operation policy 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 may be an event that does not affect the operation performance of the electronic device but affects the power consumption of the electronic device.
[0144] The second event may be an evaluation event of the electronic device. The second event may also include an event generated by the electronic device after the user uses the electronic device. Exemplarily, the second event may be a change in the size of the focused window, a change in the CPU / GPU / network usage rate, a conversion between the AC or DC mode, the PL1 setting not taking effect, or the power of the electronic device being less than a preset value.
[0145] It can be understood that during the normal operation phase of the electronic device, the electronic device does not directly issue the preset value of the target operating parameter of the CPU, but determines the value of the target operating parameter based on the operation policy scheduling method, so as to improve the performance to a certain extent while reducing the power consumption.
[0146] In addition, usually during the normal operation phase, such as the operation phase after the preset time period in the wake-up phase ends, the electronic device can consider the power mode when determining the operation policy. For example, in the DC mode, the electronic device can separately schedule the performance power consumption engine to determine the operation policy. Another example is that in the AC / DC mode, the electronic device can use the scene recognition engine and the performance power consumption engine to jointly determine the operation policy.
[0147] Moreover, during the normal operation phase, the electronic device does not need to separately issue the high-performance PPM parameter of the CPU to the hardware layer through the scheduling engine to forcibly adjust the PPM parameter in the operating parameter.
[0148] Figure 4 FIG. shows a schematic diagram of modules related to operation policy control in an electronic device 100. As Figure 4 shown, during the operation phase of the electronic device 100, such as Figure 3 the operation phase after the wake-up phase shown ends, the normal scheduling performance power consumption model can be restored to determine the operation policy through the cooperation of the performance power consumption model and the scene recognition engine, such as fusing the operation policies determined by the two engines.
[0149] Compared with Figure 3 , Figure 4 the scene recognition engine in
[0150] also includes a fusion module. The fusion module is used to fuse the operation policy determined by the scene recognition module and the operation policy determined by the performance power consumption model.
[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 the timing, that is, the preset time period in the wake-up phase ends.
[0153] S12: The scene recognition engine sends a scheduling instruction to the performance power consumption engine through the scene recognition module. The scene recognition engine notifies the performance power consumption engine to perform normal scheduling to determine the operation policy.
[0154] That is, the scene recognition module sends a scheduling instruction to the performance power consumption engine under the trigger of the event that the preset time period ends.
[0155] S13: The performance and power consumption engine obtains the current operating status information from the system probe module of the scenario recognition engine.
[0156] S14: The scenario recognition engine obtains the operating policy determined by the performance and power consumption engine through the scenario recognition module.
[0157] S15: The scenario recognition engine obtains the current operating status information from the system probe module through the scenario recognition module.
[0158] S16: The scenario recognition engine determines the current operating scenario according to the operating status information through the scenario recognition module, and sends the current operating scenario to the scenario policy configuration module.
[0159] For example, within a preset time period, the operating scenario switches, that is, switches from the previous operating scenario to the current operating scenario.
[0160] In addition, if the current operating scenario determined by the scenario recognition module is the same as the previous operating scenario and no scenario switch occurs, there is no need to re-obtain the operating policy corresponding to the operating scenario from the scenario policy configuration module.
[0161] S17: The scenario recognition engine obtains the operating policy corresponding to the current operating scenario from the scenario policy configuration module through the scenario recognition module.
[0162] S18: The scenario recognition engine calls the fusion module through the scenario recognition module to obtain the fused operating policy.
[0163] For example, after the scenario recognition module recognizes the current operating scenario, it can send the operating policy determined by the performance and power consumption model and the operating policy corresponding to the current operating scenario stored in the scenario policy configuration module to the fusion module. Furthermore, the fusion module can fuse these two operating policies to obtain the fused operating policy.
[0164] S19: The scenario recognition engine sends the operating policy obtained by the scenario recognition module to the parameter configuration module under the first switching condition or the second switching condition to update the historical operating policy recorded by the parameter configuration module.
[0165] The first switching condition may include that the operating scenario of the electronic device 100 switches from the performance scenario to the power consumption scenario. For example, the operating scenario corresponding to the historical operating policy recorded in the parameter configuration module is the performance scenario, and the operating scenario corresponding to the current operating policy obtained by the scenario recognition module is the power consumption scenario.
[0166] The second switching condition may include that the operating scenario of the electronic device 100 has not switched, or the operating scenario has switched from a power consumption scenario to a performance scenario. For example, the operating scenario corresponding to the historical operating policy recorded in the parameter configuration module is a power consumption scenario, and the operating scenario corresponding to the current operating policy obtained by the scenario recognition module is a performance scenario. Another example is that the operating scenario corresponding to the historical operating policy recorded in the parameter configuration module is a performance scenario, and the operating scenario corresponding to the current operating policy obtained by the scenario recognition module is still a performance scenario.
[0167] S20: The scenario recognition engine sends an EPO enable instruction and a performance exit instruction to the scheduling engine under the first switching condition.
[0168] When the chip platform type of the CPU is, for example, an Intel CPU chip, the call engine can send an EPO enable instruction and a performance exit instruction to the hardware layer. In this way, the hardware layer can turn on the EPO control switch under the trigger of the EPO enable instruction. The hardware layer can exit the performance scenario under the trigger of the performance exit instruction, such as exiting a high-performance type power plan and switching to a balanced type or energy-saving type power plan. In this way, by first turning on the EPO switch and then issuing the operating policy, it is prevented that the operating policy corresponding to the high-performance scenario cannot be exited, ensuring that the currently issued operating policy takes effect.
[0169] S21: The scenario recognition engine issues the operating policy obtained by the scenario recognition module to the scheduling engine under the first switching condition / the second switching condition.
[0170] Under the first switching condition, the EPO control switch in the hardware layer switches to the on state under the trigger of the EPO enable instruction.
[0171] Under the second switching condition, the EPO control switch in the hardware layer is default in the on state. At this time, the scheduling engine does not need to instruct the hardware layer to turn on the EPO control switch, but directly issues the operating policy to the hardware layer. Under the second switching condition, after executing S19, S21 can be directly executed to directly issue the operating policy to the hardware layer.
[0172] Then, when the EPO control switch is in the on state, the hardware layer can make the operating policy issued by the scheduling engine take effect, such as making the value of the PPM parameter in the operating policy take effect in the CPU, such as the default value.
[0173] In this way, after the preset time period in the wake-up stage of the electronic device 100 ends, that is, after entering the normal operation stage, the electronic device can reschedule the performance power consumption engine normally, such as determining the operating policy through the cooperation of the scenario recognition engine and the performance power consumption engine. While improving the performance of the electronic device, the power consumption is reduced, realizing a long battery life experience.
[0174] That is to say, the electronic device 100 ensures high performance within a preset time period during the wake-up stage; while in the subsequent normal operation stage, it can balance performance and power consumption, and minimize power consumption while ensuring performance.
[0175] Figure 5 The flowchart shows the control method of an electronic device, which is the device control process of the electronic device during the wake-up stage, and the process includes the following steps:
[0176] S501: The electronic device receives a wake-up instruction. For example, the wake-up instruction (also known as the first instruction) is the wake-up instruction for the electronic device to shut down / hibernate / sleep.
[0177] During the wake-up stage of the electronic device when it is shut down, i.e., the power-on stage, the triggering operation of the wake-up instruction can be pressing the power button.
[0178] During the wake-up stage of the electronic device when it is hibernating / sleeping, the triggering operation of the wake-up instruction can include the following operations: pressing the power button, moving the mouse or touchpad, pressing any key on the keyboard, opening the screen of the laptop.
[0179] In some embodiments, during the wake-up stage of the electronic device when it is shut down, i.e., the power-on stage, some parameters or variables related to the operation strategy can be initialized to initialize the scene recognition engine. As an example, during the power-on stage, the electronic device can start the housekeeper application and initialize and assign values to the timer and the variables of the historical operation strategy.
[0180] The housekeeper application of the electronic device can be a system housekeeper application or a third-party housekeeper application. The housekeeper application is used to optimize system performance, improve the running speed of the electronic device, and solve software failures, system anomalies, etc.
[0181] The following exemplarily shows a piece of pseudocode representing the initialization method of the timer and the historical policy variables, as shown in Table 3 below.
[0182] Table 3:
[0183]
[0184]
[0185] As shown in the code of Table 3, the timing duration timer of the timer (i.e., Timer) is assigned 3 min, indicating that the timer is initialized as a 3-min timer. The historical operation strategy (lastStrategy) in the scenario strategy (denoted as SceneStrategy) can be assigned the default operation strategy. At this time, during the startup phase of the electronic device, the timing duration of the timer can be set to 3 min, and the historical operation strategy can be set to the default operation strategy. Of course, in this application, the timing duration of the timer is not limited to 3 min and can also be other durations, that is, the duration of the above preset time period can also be other durations, such as 5 min, etc.
[0186] In this way, the electronic device can initialize the scenario recognition engine according to the assignment of timer and the assignment of lastStrategy in the code shown in Table 3 above.
[0187] Exemplarily, Figure 6 is a schematic diagram of the usage scenario of an electronic device provided by an embodiment of this application. As Figure 6 shown in (a) therein, the electronic device is in the sleep state and the screen is in the off state. The keyboard includes a power button 101. The electronic device can receive the operation of the user clicking the power button 101. In response to this operation, as Figure 6 shown in (b) therein, the electronic device displays a window 102, and determines this mouse click operation as a wake-up event, generating a wake-up instruction.
[0188] S502: In response to the wake-up instruction, the electronic device obtains the preset value of the target operating parameter of the CPU within a preset time period and stops scheduling the first type of operation strategy.
[0189] It can be understood that triggered by the wake-up instruction, the electronic device can start timing using a timer such as a 3-min timer and enter the above preset time period. The preset value of the target operating parameter of the CPU corresponds to the high performance of the CPU.
[0190] In some embodiments, triggered by the wake-up instruction, the electronic device can stop scheduling the first type of operation strategy that restricts the operating power consumption of the electronic device 100 and stabilizes the operating performance of the electronic device, such as stopping scheduling the operation strategy determined by the performance power consumption engine, so as to avoid affecting the performance due to reducing the power consumption.
[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 operation strategy to obtain a second operation strategy, and uses the second operation strategy to control the electronic device.
[0192] That is, the electronic device uses the second operation strategy to control the electronic device to execute the wake-up instruction (such as the first instruction) and load various system services and various third-party services / resources.
[0193] As an example, after the electronic device enters the sleep state in a game scenario, when the electronic device detects a wake-up instruction, the electronic device can execute the steps of S501 to S503 above to quickly load the resources related to the tasks in the game scenario and various system services such as audio output services within a preset time period in the sleep wake-up stage. In this way, it is ensured that the tasks in the game scenario can be quickly loaded in the sleep wake-up stage to improve the user's game experience.
[0194] In some embodiments, the electronic device can adjust the EPO control switch according to the chip platform type of the CPU, and then issue an operation strategy to implement high-performance preset value control of the electronic device based on the target operation parameters of the CPU. For example, the above Figure 5 S503 in can include S503a, S503b, and S503c.
[0195] S503a: The electronic device determines the chip platform type of the CPU.
[0196] The chip platform type can include a first type and a second type. Among them, the CPU of the first type can be the CPU chip of, and the CPU of the second type can be the CPU chip of.
[0197] If the chip platform type of the CPU is the first type, that is, the CPU chip of, then enter S503b to first turn off the EPO control switch. If the chip platform type of the CPU is the second type, that is, the CPU chip of, then enter S503c without 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 operation parameter in the current first operation strategy with the value of the target operation parameter to obtain a second operation strategy, and uses the second operation strategy to control the electronic device.
[0199] The following exemplarily shows a piece of pseudo-code representing the wake-up callback process in the wake-up stage, and this pseudo-code is shown in Table 4 below:
[0200] Table 4:
[0201]
[0202] As shown in the code of Table 4, the parameter message in the IPCMessage message code is assigned the value stopWork, indicating setting the content of the IPC message.
[0203] In the PostIPCMessage() code, the parameter fromModule is assigned the value of "Scene Recognition & Scheduling", indicating that the IPC message is initiated by the scene recognition engine; the parameter AIModel is assigned the value of "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". At this time, the PostIPCMessage() code is used to represent that the scene recognition engine notifies the performance and power consumption engine to stop scheduling through the IPC message.
[0204] The code "SceneStrategy strategy = {High-performance PPM parameters}" represents obtaining the preset value of the target operating parameters of the CPU, that is, the high-performance PPM parameters, which is also P1.
[0205] The CloseEPOSwitch() code is used to instruct the electronic device to turn off the EPO control switch. For example, this code instructs the scene recognition engine to send an EPO off command to the hardware layer through the scheduling engine.
[0206] The ExecuteStrategy(strategy) code represents that the electronic device uses the PPM parameters. For example, this code instructs the scene recognition engine to send the high-performance PPM parameter, that is, P1, to the hardware layer through the scheduling engine. In this way, the hardware layer can replace the PPM parameter in the currently effective current operating strategy (such as the first operating strategy) with P1 to obtain the replaced operating strategy (such as the second operating strategy).
[0207] It can be understood that in this application, by first turning off the EPO control switch and then sending the PPM parameters, it is prevented that the sent PPM parameters are modified by the system, ensuring that the high-performance PPM parameters take effect in the hardware layer to ensure 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 in the current first operating strategy with the numerical value of the target operating parameter to obtain the second operating strategy, and uses the second operating strategy to control the electronic device.
[0209] Similarly, corresponding to the second type of CPU chip platform, the EPO control switch in the electronic device is default closed. At this time, the electronic device does not need to turn off the EPO control switch, but directly sends the high-performance PPM parameters to the hardware layer through the scheduling engine. Then, corresponding to the second type of CPU chip platform, compared with the code shown in Table 4, the pseudo-code of the wake-up callback process in the wake-up phase can remove the CloseEPOSwitch() code.
[0210] In this way, during the wake-up phase of the electronic device in the shutdown / sleep / hibernation state, the target operating parameters of the CPU can be used to control the electronic device with the preset high-performance values, ensuring the performance of the electronic device during the wake-up phase and enabling the electronic device to quickly load various system services and third-party services. Moreover, during the wake-up phase, the electronic device can stop scheduling the first type of operating policy that restricts the operating power consumption performance of the electronic device, that is, stop scheduling the performance power consumption engine, so as to avoid performance degradation caused by power consumption reduction.
[0211] Figure 7 The flowchart shows the control process of an electronic device during the wake-up phase and when transitioning from the wake-up phase to the normal operating phase. The process includes the following steps, that is, Figure 7 After S506 shown can include the following steps:
[0212] S701: Within a preset time period, in response to a second instruction, the electronic device detects that the current operating scenario is the first operating scenario.
[0213] For example, it is detected that the current operating scenario has switched from the initial operating scenario to the first operating scenario, and the initial operating scenario can correspond to the above-mentioned first operating policy.
[0214] At this time, the first instruction is used to instruct the electronic device to load the services in the first operating scenario.
[0215] In some embodiments, the electronic device can detect the current second operating scenario in response to a second instruction for some events. For example, the event can be the first event or the second event, such as the event being an operation event of the user on the current focused window.
[0216] For example, the electronic device detects that the current operating scenario has switched from the game scenario to the video scenario. At this time, the electronic device can receive a switching event of the focused window switching the focused window in the current game scenario, that is, detect the instruction of this switching event, and in response to this instruction, the focused window can be switched, such as the focused window for video playback, so as to determine that the current operating scenario has switched from the game scenario to the video scenario.
[0217] S702: The electronic device obtains the third operating policy corresponding to the first operating scenario.
[0218] When the first operating scenario is detected within the preset time, the third operating policy is the second type of operating policy determined by the electronic device through the scenario recognition engine, that is, the operating policy corresponding to the first operating scenario obtained by the scenario recognition module from the scenario policy configuration module.
[0219] For example, when the first operating scenario is the video scenario, the third operating policy is the operating policy corresponding to the video scenario.
[0220] S703: The electronic device sets the EPO control switch status information in the third operation strategy to the off state, replaces the value of the target operation parameter in the third operation strategy with a preset value to obtain a fourth operation strategy, and updates the historical operation strategy to the third operation strategy.
[0221] The EPO control switch status information is in the off state. For example, if the value of the EPO control switch status information is 0, it is used to trigger the closing of the EPO control switch; the EPO control switch status information is in the on state. For example, if the value of the EPO control switch status information is 1, it is used to trigger the opening of the EPO control switch.
[0222] The following exemplarily shows a piece of pseudocode representing the operation phase strategy adjustment process, as shown in Table 5 below:
[0223] Table 5:
[0224]
[0225]
[0226] The code "lastStrategy = curStrategy" means that when determining the current operation strategy, the current operation strategy, that is, curStrategy, is used to update the historical operation strategy, that is, lastStrategy, which means executing S703.
[0227] The timing judgment branch "If sxTime > 3min" means judging whether the preset time period has ended, such as judging whether the 3min timer has timed out.
[0228] If the timing judgment branch determines that the timer has not ended and enters the Else branch of the timing judgment branch, that is, it is judged that the preset time period has not ended, then S704 is executed. At this time, the electronic device executes the code "curStrategy = curStrategy{EPO = 0, P1}", which can change the EPO control switch status information in the current operation strategy information curStrategy to 0 (that is, turn off the EPO control switch), and then modify the PPM parameter to P1. Furthermore, the code "ExecuteStrategy(strategy)" is used to send down the current operation strategy, such as the fourth operation strategy, to send down the high-performance PPM parameter to execute S704 to ensure that the fourth operation strategy is sent down and takes effect normally.
[0229] If the timing judgment branch determines that the timer has ended and enters the switching condition judgment branch of the timing judgment branch, that is, it is judged that the preset time period has ended, then S707 is executed.
[0230] S704: The electronic device controls the electronic device using the fourth operation strategy.
[0231] The EPO control switch status information in the fourth operation strategy is in the off state, and the target operation parameter is a preset value.
[0232] S705: The electronic device detects the end of a 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 ends, the electronic device can restore the normal scheduling performance power consumption engine through the scenario recognition engine to allow the scheduling of the first type of operation strategy. At this time, the electronic device can reissue 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 exemplarily shows a piece of pseudo-code representing exiting the wake-up state, as shown in Table 6 below:
[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, indicating the content of the IPC message is set.
[0238] In the PostIPCMessage() code, the parameter fromModule is assigned the value scenario recognition & scheduling, indicating that the IPC message is initiated by the scenario recognition engine; the parameter AIModel is assigned the value AIModel, indicating that the IPC message is sent to the performance power consumption engine, and the parameter message indicates that the content of the IPC message is startWork. At this time, the PostIPCMessage() code is used to represent that the scenario recognition engine notifies the performance power consumption engine of normal scheduling through the IPC message.
[0239] The ExecuteStrategy(strategy) code represents that the electronic device issues the current operation strategy, such as reissuing a current operation strategy like the fourth operation strategy when entering S705.
[0240] S706: In response to the third instruction, the electronic device detects that the current operation scenario is the second operation scenario and obtains the fifth operation strategy corresponding to the second operation scenario.
[0241] For example, the electronic device detects that the current operation scenario has switched from the first operation scenario to the second operation scenario. The third instruction can instruct the electronic device to load the services in the second operation scenario.
[0242] For example, the electronic device detects that the current running scenario switches from a video scenario to a desktop scenario. At this time, the electronic device can receive a close event of switching the focus window for the focus window in the current video scenario, that is, an instruction for detecting this close event, and in response to this instruction, it can switch the focus window, such as the focus window of the desktop, so as to determine that the current running scenario switches from the video scenario to the desktop scenario.
[0243] Exemplarily, continue to refer to Figure 6 the scenario shown. As Figure 6 shown in (b) therein, the display window 102 of the electronic device can be the interface of a video application, and the window 102 includes a close control 103. The electronic device can receive an operation in which the user clicks on the close control 103, and in response to this operation, as Figure 8 shown, the electronic device displays the desktop, that is, the main interface, and determines that the running scenario has switched based on this operation, such as switching from a performance scenario to a power consumption scenario. In addition, this mouse click operation can be determined as a second event, that is, an event that requires the performance power consumption engine and the scenario recognition engine to jointly determine the running policy.
[0244] In some embodiments, the running 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 running scenario, and the target tendency includes a tendency to reduce the running power consumption or a tendency to improve the running performance. For example, the preset identification information includes first identification information and second identification information. When the preset identification information of the current running scenario is the first identification information, it indicates that the current running scenario is a performance scenario, and the target tendency is to improve the running performance; when the current running scenario is the second identification information, it indicates that the current running scenario is a power consumption scenario, and the target tendency is to reduce the running power consumption.
[0245] That is, the first identification information is used to indicate improving the running performance of the electronic device, and the second identification information is used to indicate reducing the running power consumption of the electronic device.
[0246] In some embodiments, the electronic device obtains a sixth running policy corresponding to a second running scenario, and obtains a seventh running policy according to the current running state information. Furthermore, the electronic device fuses the sixth running policy and the seventh running policy to obtain a fifth running policy. At this time, the electronic device can fuse the sixth running policy and the seventh running policy according to the target tendency indicated by the preset identification information of the switched second running scenario.
[0247] For example, if the target tendency of the second operating scenario is to reduce the operating power consumption, the target values of the operating parameters that are beneficial to reducing the power consumption are selected from the sixth operating policy and the seventh operating policy to obtain the fused fifth operating policy. For example, the numerical values of the operating parameters in the seventh operating policy from the performance power consumption engine and the numerical values of the operating parameters in the sixth operating policy from the scenario policy configuration module can be compared, and the numerical values of the operating parameters that make the power consumption of the electronic device low are selected, so as to obtain the fused operating policy.
[0248] For another example, if the target tendency of the second operating scenario is to improve the operating performance, the target values of the operating parameters that are beneficial to improving the operating performance are selected from the sixth operating policy and the seventh operating policy to obtain the fused fifth operating policy. For example, the numerical values of the operating parameters in the seventh operating policy from the performance power consumption engine and the numerical values of the operating parameters in the sixth operating policy from the scenario policy configuration module can be compared, and the numerical values of the operating parameters that make the performance of the electronic device high are selected, so as to obtain the fused operating policy.
[0249] It can be understood that the numerical values of the target operating parameters in the fifth operating policy can be preset values or other data values, which are specifically determined according to the current operating scenario and operating state information, that is, according to the current operating situation of the electronic device.
[0250] In some other embodiments, the electronic device can also trigger the execution of obtaining and fusing the sixth operating policy and the seventh operating policy to obtain the fifth operating policy based on the instructions of some events (such as the third instruction), where the event is the second event.
[0251] S707: Corresponding to the chip platform type of the CPU being the first type, the electronic device determines whether the first switching condition or the second switching condition is satisfied.
[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 switches from the performance scenario to the power consumption scenario. At this time, the second operating scenario is the performance scenario, and the third operating scenario is the 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 operating scenario and the third operating scenario is the first identification information; the preset identification information of both the second operating scenario and the third operating scenario is the second identification information. That is, the second switching condition can include that the operating scenario of the electronic device does not change, or the operating scenario switches from the power consumption scenario to the performance scenario.
[0254] If it is determined that the first switching condition is met, enter S708 to turn off the EPO control switch and issue an operation policy. If it is determined that the second switching condition is met, enter S709.
[0255] Combined with 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 identification information corresponding to the historical operation policy is 1, that is, the second operation scenario corresponding to the historical operation policy is the performance scenario; curStrategy tendency = 0 means that the preset identification information corresponding to the current operation policy is 0, that is, the third operation scenario corresponding to the current operation policy is the performance scenario.
[0256] If the code "If lastStrategy tendency = 1 && curStrategy tendency = 0" is judged to be true, that is, it is determined that the first switching condition is met, enter S708. If this code is judged to be false, that is, it is determined that the second switching condition is met, enter S709.
[0257] S708: Under the first switching condition, the electronic device updates the historical operation policy to the fifth operation policy, turns on the EPO control switch, exits the performance scenario, and uses the fifth operation policy to control the electronic device.
[0258] When the chip platform type of the CPU is the first type, that is, an Intel CPU chip, the electronic device can send an EPO enable instruction and a performance exit instruction to the hardware layer by calling the engine to turn on the EPO control switch and exit the performance scenario. Specifically, the hardware layer can turn on the EPO control switch under the trigger of the EPO off instruction. The hardware layer can exit the performance scenario under the trigger of the performance exit instruction, such as exiting the high-performance type power plan, and can also switch to the balanced type or energy-saving type power plan. In this way, the electronic device first turns on the EPO switch through the scheduling engine and then issues the operation policy to prevent the operation policy corresponding to the high-performance scenario from not being able to exit, resulting in the ineffectiveness of the subsequent issued operation policy.
[0259] Combined with the code shown in Table 5, in the branch where the switching condition judgment branch is judged to be true, the OpenEPOSwitch() code means to turn on the EPO control switch to prevent the performance policy from not being able to exit, and the current operation policy, such as the fifth operation policy, is issued through the ExecuteStrategy(lastStrategy) code.
[0260] S709: Under the second switching condition, the electronic device updates the historical operation policy to the fifth operation policy and uses the fifth operation policy to control the electronic device.
[0261] It can be understood that under the second switching condition, the EPO control switch in the hardware layer is default in the on state. 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 operation policy to the hardware layer. For example, the fifth operation policy is sent to the hardware layer through the scheduling engine.
[0262] Combined with the code shown in Table 5, in the branch where the judgment result in the switching condition judgment branch is "no", the ExecuteStrategy(lastStrategy) code means directly sending the current operation policy, such as the fifth operation policy.
[0263] In this way, for the control method of the electronic device provided in this application, after the preset time period in the wake-up stage ends, the operation policy is determined by the normal scheduling performance power consumption engine and the scenario recognition engine, which can improve the performance to a certain extent while reducing the power consumption.
[0264] Next, refer to Figure 9 As shown, it is a schematic flowchart of a control method of an electronic device improved in an embodiment of this application. Specifically, when the housekeeper application starts, it can initialize the 3-minute timer and the historical operation policy lastStategy. For example, set the timing duration of the timer to 3 minutes and set lastStategy to the process where the default operation policy scenario recognition engine is located. In addition, when the housekeeper application starts, it can also start the process where the performance power consumption model is located (not shown).
[0265] As Figure 9 shown, when the scenario recognition engine receives a power-on event / sleep wake-up event / hibernation wake-up event, it enters the wake-up stage. During the 3-minute timing duration, the PPM parameter of the CPU can be set to P1, that is, the target operation parameter of the CPU is set to the preset value of high performance. Furthermore, the scenario recognition engine first turns off the EPO control switch (i.e., turns off the EPO), and then sends P1 through the scheduling engine, so that the hardware layer replaces the PPM parameter in the current operation policy information with P1 and uses P1 to control the electronic device to ensure high performance of the CPU during the wake-up stage. In addition, when the scenario recognition engine receives a power-on event / sleep wake-up event / hibernation wake-up event, the scenario recognition engine can stop scheduling the performance power consumption model through the performance power consumption engine to avoid power consumption reduction during the wake-up stage.
[0266] In some embodiments, each time a power-on event / sleep wake-up event / hibernation wake-up event is received, the electronic device can initialize a timer to start timing, such as starting a 3-minute timing. At this time, when a power-on event is detected, the scenario recognition engine initializes the historical operation policy lastStategy, and when a sleep wake-up event / hibernation wake-up event is received, the scenario recognition engine can directly obtain the previously recorded historical operation policy lastStategy.
[0267] The scenario recognition engine performs scenario recognition within the 3-minute timing duration, matches the operation policy A corresponding to the current operation scenario, and uses the operation policy A as the current operation policy curStategy to output curStategy. Furthermore, it is determined whether the 3-minute timer has expired. If the determination is no, indicating that the 3-minute timing duration has not ended, then execute lastStategy = curStategy to update the historical operation policy to the current operation policy. Furthermore, set the PPM parameter in the current operation policy to P1, and set the EPO in this operation policy to 0, and issue the adjusted current operation policy through the scheduling engine, to issue P1 and continue to maintain the high performance of the CPU during the wake-up phase.
[0268] Furthermore, as Figure 9 shown, if the scenario recognition engine recognizes that the 3-minute timing duration has ended, it can notify the performance and power consumption engine to resume normal scheduling and start working, and issue the current historical operation policy lastStategy through the scheduling engine.
[0269] Subsequently, as Figure 9As shown, the scene recognition engine performs scene recognition after the end of the 3-minute timing duration. If the running policy A corresponding to the current running scene is matched, it can also obtain the running policy B output by the performance power consumption engine and fuse these two running policies to obtain the fused running policy. This fused running policy is used as the current running policy curStategy to output curStategy. Then, the scene recognition engine can determine whether lastStrategy tendency = 1 && curStrategy tendency = 0 holds, that is, determine whether the preset identifier tendency of the historical running policy lastStategy is 1 and the preset identifier tendency of the current running policy curStategy is 0, that is, determine whether the scene switch is from the performance scene to the power consumption scene. If the judgment is yes, the scene recognition engine executes lastStategy = curStategy to update the historical running policy to the current running policy, turns on the EPO control switch (turns on EPO), exits the performance scene, and then sends the current running policy curStategy through the scheduling engine. In addition, if the judgment is no, the scene recognition engine executes lastStategy = curStategy to update the historical running policy to the current running policy and directly sends the current running policy curStategy through the scheduling engine. In this way, the electronic device can balance performance and power consumption during the operation stage.
[0270] Figure 10 Fig. shows a schematic diagram of the working process of the software and hardware for the electronic device 100 to control the running parameters.
[0271] As Figure 10 shown, the above-mentioned scene recognition engine can be located in 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. In addition, it also includes a timing module (not shown) and a parameter configuration module (not shown).
[0272] The scene recognition module can determine the current running scene. The running scene can include a video scene, a game scene, an office scene, a social scene, etc. For example, when the scene recognition engine recognizes that the focus window is the window of a video application, it determines that the electronic device 100 is in the video scene. Another example is that when the scene recognition engine recognizes that the focus window is the TM chat window of WeChat, it determines that the electronic device 100 is in the social scene. The scene recognition module can also send the running scene to the scene policy configuration module. The scene policy configuration module can determine the running parameters according to the running scene. The scene policy configuration module can feedback the running parameters to the scene recognition module. The scene recognition module can send the running parameters and the running scene to the scheduling engine in the application layer.
[0273] The scenario recognition module determines that the current operating scenario is a prior art, which will not be elaborated here.
[0274] The functions of the scenario recognition module, the scenario policy configuration module, the timing module, and the parameter configuration module are the same as those described above Figure 3 and Figure 4 will not be elaborated here.
[0275] In some embodiments, the scenario recognition module may send a request for querying the running status information to the system probe module. In this way, the system probe module can respond to this request and report the running status information to the scenario recognition module.
[0276] Among them, the system probe module can subscribe to kernel events from the kernel layer, so as to determine the running status information according to the callback function feedback by the kernel layer and report it to the scenario recognition module. Specifically: The multiple types of probes included in the system probe module can respectively subscribe to corresponding kernel events from the kernel layer to obtain the corresponding running status information.
[0277] For example, the power status probe can subscribe to the power status event from the kernel layer and determine the power status information according to the callback function feedback by the kernel layer. For example, the kernel layer may include: subsystem dynamic link library, executive body, kernel and driver layer, HAL, firmware layer, and hardware layer. The power status probe can send a request for subscribing to the power status event to the system event driver (OsEventDriver) node of the executive body in the kernel layer, and the OsEventDriver node forwards this request to the power manager of the executive body. After receiving this request, the power manager can feedback the callback function to the power status probe through the OsEventDriver node to implement the subscription of the power status event.
[0278] The peripheral status probe can subscribe to the peripheral event from the kernel layer and determine the peripheral status information according to the callback function feedback by the kernel layer.
[0279] The process load probe can subscribe to the process load event from the kernel layer and determine the process load information according to the callback function feedback by the kernel layer.
[0280] The system load probe can subscribe to the system load event from the kernel layer and determine the system load information according to the callback function feedback by the kernel layer.
[0281] The audio / video status probe can subscribe to the audio / video event from the kernel layer and determine the current audio / video status information existing in the electronic device 100 according to the callback function feedback by the kernel layer.
[0282] For example, the audio and video status probe may send a request to subscribe to GPU decoding information to the OsEventDriver node of the executor, and the OsEventDriver node forwards the request to the graphics card driver in the kernel and driver layers. After receiving the request, the graphics card driver feeds back a callback function to the audio and video status probe through the OsEventDriver node, so that after monitoring that the GPU is performing decoding operations, the audio and video status information can be obtained based on the callback function of the audio and video status probe.
[0283] The system event probe can subscribe to system events from the kernel layer and determine system event information according to the callback function fed back by the kernel layer. The system event information may include one or more of window change information, system lock information, process creation information, or thread creation information, etc.
[0284] For example, the system event probe may send a request to subscribe to process creation information to the OsEventDriver node of the executor, and the OsEventDriver node forwards the request to the process manager. After receiving the request, the process manager feeds back a callback function to the system event probe through the OsEventDriver node, so that after a process is created, the system event information can be obtained based on the callback function fed back by the system event probe. Another example is that the system event probe also sends a request to subscribe to focus window change information to the API module, and the API module feeds back a callback function to the system event probe, so as to monitor whether the focus window of the electronic device 100 changes, and when it is monitored that the focus window changes, the focus window change information can be obtained based on the callback function fed back by the system event probe.
[0285] It can be seen that the system probe module subscribes to various events of the electronic device 100 from the kernel layer, and then obtains the probe status according to the callback function fed back by the kernel layer, that is, obtains the running status information of the electronic device 100.
[0286] In some embodiments, the scene recognition module can notify the performance and power consumption engine to stop scheduling within a preset time during the wake-up phase, and notify the performance and power consumption engine to resume normal scheduling after the preset time period, so as to avoid reducing the device power consumption during the wake-up phase. In addition, within the preset time during the wake-up phase, in response to a wake-up instruction, the scene recognition module can issue high-performance preset parameters of the target operating parameters of the CPU, such as turning on the EPO switch first and then issuing high-performance parameters, so as to perform scheduling based on the operating policy corresponding to the high-performance parameters of the CPU. In the embodiments of the present application, the scheduling engine can send an instruction to the CPU through the power manager and the BIOS, and the instruction carries the operating parameter 1 in the operating policy. The scheduling engine can send an instruction to the Intel DTT driver through WMI, and the instruction carries the operating parameter 2 in the operating policy. Then, the Intel DTT driver can send the received instruction to the CPU through the BIOS. The scheduling engine can send an instruction to the CPU through the system-to-chip (OS2SOC) driver node, and the instruction carries the operating parameter 2 in the operating policy, such as the preset value of the target operating parameters of the CPU. Among them, the operating parameter 1, the operating parameter 2, and the operating parameter 3 can be different operating parameters in the operating policy.
[0287] The embodiments of the present application also provide a computer storage medium, which includes computer instructions. When the computer instructions run on the above-mentioned electronic device, the electronic device is enabled to execute each function or step performed by the mobile phone in the above-mentioned method embodiments.
[0288] The embodiments of the present application also provide a computer program product. When the computer program product runs on a computer, the computer is enabled to execute each function or step performed by the mobile phone in the above-mentioned method embodiments.
[0289] It can be understood that in order to implement the above functions, the electronic device provided in the embodiments of the present application includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed in this article, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.
[0290] The embodiments of the present application can divide the above-mentioned electronic device into functional modules according to the above method examples. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of a software functional module. It should be noted that the division of modules in the embodiments of the present application is illustrative, and is only a logical function division. There may be other division methods in actual implementation.
[0291] Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0292] In several embodiments provided by the present application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical or other forms.
[0293] The units described as separate components may or may not be physically separated. The components displayed as units may be one physical unit or multiple physical units, that is, they can be located in one place, or they can be distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0294] In addition, each functional unit in the various embodiments of the present application can be integrated in one processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0295] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The software product is stored in a storage medium and includes several instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.
[0296] The above content is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A control method of 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, where the first instruction is used to instruct loading of at least one of a system service and a third-party service of the electronic device; In response to the first instruction, within a first time period, a first value of a target operating parameter in a current first operating strategy is replaced with a second value to obtain a second operating strategy, The target operating parameter is a parameter that affects the operating performance of the CPU, and the performance of the CPU when the electronic device uses the second operating strategy is higher than the performance of the CPU when the electronic device uses the first operating strategy; During the first time period, the first instruction is executed based on the second operation strategy.
2. The method according to claim 1, characterized in that The target operating parameters include at least one of the following: Long-time turbo power consumption PL1, short-time turbo power consumption PL2, CPU energy efficiency ratio EPP, emergency shutdown EPO control switch status information, CPU acceleration switch status information.
3. The method according to claim 1, characterized in that The operation strategy includes the target operation parameters, and also includes at least one of the following operation parameters: fan speed, independent graphics processor DGPU overspeed value, video memory overclocking value, integrated graphics processor IGPU minimum frequency, IGPU maximum frequency, DGPU minimum frequency, DGPU maximum frequency, energy-saving display status information, CPU minimum frequency, core binding information and memory cleanup status information.
4. The method according to claim 1, characterized in that The executing the first instruction based on the second operation strategy within the first time period includes: The chip platform type corresponding to the CPU is of the first type. During the first time period, the emergency shutdown (EPO) control switch of the CPU is turned off, and the operation of the electronic device is controlled based on the second operation strategy.
5. The method according to claim 1, characterized in that The first instruction is any one of a power-on instruction, a sleep wake-up instruction, and a sleep wake-up instruction; Corresponding to the first instruction being a power-on instruction, the first operation strategy is a default operation strategy; Corresponding to the first instruction being a dormancy wake-up instruction or a sleep wake-up instruction, the first operation strategy is a historical operation strategy, and the historical operation strategy includes the operation strategy last scheduled by the electronic device.
6. The method according to claim 5, characterized in that The method further comprises: In response to the first instruction, stop scheduling the first type of operation strategy within the first time period, 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 when the electronic device operates the current focus window.
7. The method according to claim 6, characterized in that The first type of operation strategy is determined by using a first model, and the first model is used to determine the values of the operation parameters in the first type of operation strategy according to the current operation status information.
8. The method according to claim 7, characterized in that The method further comprises: In response to a second instruction, determining that the electronic device is currently in a first operating scenario within the first time period, the second instruction is used to instruct the electronic device to load a service in the first operating scenario; During the first time period, a third operation strategy corresponding to the first operation scenario is obtained, wherein the third operation strategy belongs to a second type of operation strategy, and the second type of operation strategy is determined based on the current operation scenario of the electronic device. The operation scenario is used to describe the scenario in which the electronic device responds to a user operation to perform a task in the current focus window.
9. The method according to claim 8, characterized in that The method further comprises: During the first time period, the historical operation strategy is updated to the third operation strategy.
10. The method according to claim 9, characterized in that The method further comprises: The chip platform type corresponding to the CPU is the first type, and within the first time period, the EPO control switch in the third operation strategy is set to an off state, and the third value of the target operation parameter in the third operation strategy is replaced by the second value to obtain a fourth operation strategy; During the first time period, the second instruction is executed based on the fourth operating strategy.
11. The method according to claim 10, characterized in that The method further comprises: Upon detecting that the first time period has ended, scheduling the first type of operation strategy; The historical operation strategy is determined to be the third operation strategy, and the electronic device is controlled based on the third operation strategy.
12. The method according to claim 11, characterized in that The method further comprises: In response to the third instruction, the current operation scenario is determined to be the second operation scenario, and a fifth operation strategy corresponding to the second operation scenario is determined. The third instruction is used to instruct the electronic device to load the service under the second operation scenario.
13. The method according to claim 12, characterized in that The method further comprises: The chip platform type corresponding to the CPU is the first type, and under a 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; Updating the historical operation strategy to the fifth operation strategy, and executing the third instruction based on the fifth operation strategy; Among them, the first switching condition includes: the historical operation strategy corresponds to first identification information and the third operation scenario corresponds to second identification information, the first identification information is used to indicate improving the operation performance of the electronic device, and the second identification information is used to indicate reducing the operation power consumption of the electronic device.
14. The method according to claim 13, characterized in that The method further comprises: Corresponding to the chip platform type being the first type, under the second switching condition, the historical operation strategy is updated to the fifth operation strategy, and the third instruction is executed based on the fifth operation strategy, wherein: The second switching condition includes: the operation scenario corresponding to the historical operation strategy and the third operation scenario both correspond to the first identification information, the operation scenario corresponding to the historical operation strategy and the third operation scenario both correspond to the second identification information, the historical operation strategy corresponds to the second identification information and the third operation scenario corresponds to the first identification information.
15. The method according to claim 14, characterized in that The determining a fifth operation strategy corresponding to the second operation scenario includes: Acquire a sixth operation strategy corresponding to the third operation scenario, and determine a seventh operation strategy according to 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 operation strategy and the seventh operation strategy are merged into the fifth operation strategy.
16. The method according to claim 15, characterized in that The step of fusing the sixth operation strategy and the seventh operation strategy into a fifth operation strategy includes: Corresponding to the first identification information corresponding to the third operating scenario, determining an operating performance result 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; The operating performance result corresponding to the fourth value of the first operating parameter is higher than the operating performance result corresponding to the fifth value of the second operating parameter, and the fourth value of the first operating parameter is used as the fifth operating strategy, or, The operating performance result corresponding to the fifth value of the second operating parameter is higher than the operating performance result corresponding to the fourth value of the first operating parameter, and the fifth value of the second operating parameter is used as the fifth operating strategy.
17. The method according to claim 15, characterized in that The step of fusing the sixth operation strategy and the seventh operation strategy into a fifth operation strategy includes: Corresponding to the second identification information corresponding to the third operating scenario, determining an operating power consumption result 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; The operating power consumption result corresponding to the fourth value of the first operating parameter is lower than the operating power consumption result of the fifth value of the second operating parameter, and the fourth value of the first operating parameter is used as the fifth operating strategy, or, The operating power consumption result corresponding to the fifth value of the second operating parameter is lower than the operating power consumption result of the fourth value of the first operating parameter, and the fifth value of the second operating parameter is used as the fifth operating strategy.
18. An electronic device, characterized in that: The electronic device comprises: a memory and one or more processors; The memory is used to store computer program code, and the computer program code includes computer instructions; when the computer instructions are executed by the processor, the electronic device executes the method as described in any one of claims 1 to 17.
19. A computer-readable storage medium, characterized in that: including computer instructions; When the computer instructions are executed on an electronic device, the electronic device is caused to execute the method as claimed in any one of claims 1 to 17.
20. A computer program product, characterized in that When the computer program product is run on a computer, the computer is caused to perform the method according to any one of claims 1 to 17.
Citation Information
Patent Citations
Power-saving system and power-saving method by adjusting CPU (central processing unit) frequency of mobile terminal
CN103440032A
Method and device used for setting system memory overclock, and electronic equipment
CN107301075A
Resource scheduling method and system, electronic equipment and medium
CN114741187A
System and method for implementing a user specified processing speed in a computer system and for overriding the user specified processing speed during a startup and shutdown process
US6681336B1