Power consumption control method and related device
By detecting application lags in terminal devices and dynamically adjusting CPU power consumption parameters, the lag problems caused by increased power consumption when handling multitasking in terminal devices are solved, achieving a smoother user operation experience and system performance optimization.
Patent Information
- Application Number
- CN202411027124.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-10
- Publication Date
- 2024-12-17
AI Technical Summary
The power consumption of terminal devices increases when handling multitasking, resulting in application lag. The prior art cannot effectively avoid frequent lags when increasing power consumption to prevent lags, affecting the user experience.
When the terminal device detects an application stutter, it can increase the CPU power consumption parameter PL1 within the preset time period, perform CPU power consumption sampling, calculate the adaptation value, and adjust PL1 in the application scenario to ensure smoother operation of the user. Reduce lag.
By dynamically adjusting CPU power consumption parameters, we can reduce application lag, improve user experience, and optimize system performance to make terminal devices run more stable under different load levels.
Smart Images

Figure CN119149330A_ABST
Abstract
Description
[0001] This application is a divisional application. The application number of the original application is 202211405854.9, and the original application date is November 10, 2022. The entire contents of the original application are incorporated into this application by reference. Technical Field
[0002] The present application relates to the field of terminal technology, and in particular to a power consumption control method and related devices. Background Art
[0003] As the performance of terminal devices improves, terminal devices can handle tasks in multiple applications at the same time, resulting in higher power consumption of terminal devices. In order to limit power consumption, terminal devices often need to reduce the power consumption of some applications during operation. However, if the power consumption of an application is too low, the application may be prone to freezing, or even freeze and cannot be recovered, which reduces the user experience.
[0004] In some implementations, when an application freezes, the terminal device can increase the power consumption of the application so that the application runs in a high-performance state. However, the application may still freeze frequently. Summary of the invention
[0005] The embodiment of the present application provides a power consumption control method and related devices. When a Windows foreground application freezes, the terminal device can increase the PL1 of the application scenario to a larger value within a preset time period, and within the preset time period, the CPU power consumption can be sampled to obtain the actual CPU power consumption value, and the adapted CPU power consumption value within the preset time period can be calculated based on the sampled CPU power consumption value. Among them, the adapted CPU power consumption value may include, for example, the average CPU power consumption value or some values near the average CPU power consumption value. Furthermore, the terminal device can set the PL1 in the application scenario to the adapted CPU power consumption value, so that the user can operate more smoothly in the application scenario, reduce freezes, achieve system performance tuning, and improve user experience.
[0006] In a first aspect, an embodiment of the present application provides a power consumption control method, the method comprising:
[0007] The terminal device opens the first application. When the load level of the terminal device is the first level, the CPU power consumption parameter PL1 is the first value. When the load level of the terminal device is the second level, the CPU power consumption parameter PL1 is the second value. At the first moment, the CPU power consumption parameter PL1 is the first value, and the first application freezes. At the second moment, the CPU power consumption parameter PL1 is the third value, wherein the second moment is later than the first moment, and the third value is greater than the first value. From the second moment, after the first preset time, at the third moment, the CPU power consumption parameter PL1 is the fourth value, wherein the fourth value is greater than the first value, and the fourth value is less than the third value, and between the first moment and the third moment, the load level is the first level. At the fourth moment, the CPU power consumption parameter PL 1 is the second value, and the first application freezes; at the fifth moment, the CPU power consumption parameter PL1 is the fifth value, wherein the fifth moment is later than the fourth moment, and the fifth value is greater than the second value; from the fifth moment, after the second preset time, at the sixth moment, the CPU power consumption parameter PL1 is the sixth value, wherein the sixth value is greater than the second value, and the sixth value is less than the fifth value, and between the fourth moment and the sixth moment, the load level is the second level; at the seventh moment, the terminal device exits the first application and opens the first application again. If the load level of the terminal device is the first level, the CPU power consumption parameter PL1 is the fourth value, and if the load level of the terminal device is the second level, the CPU power consumption parameter PL1 is the sixth value, wherein the seventh moment is later than the sixth moment. In this way, the application can adapt to a more appropriate CPU power consumption parameter PL1 when it freezes, so that the user can operate more smoothly in this application scenario, reduce freezes, optimize system performance, and improve user experience.
[0008] In a possible implementation, between the second moment and the third moment, the CPU power consumption is collected according to the first sampling period to obtain N CPU power consumption values; the first CPU power consumption adaptation value is determined according to the N CPU power consumption values; the first offset is obtained, and the first offset is the difference between the first CPU power consumption adaptation value and the first value; wherein, after the third moment, the terminal device exits the first application and opens the first application again, and if the load level of the terminal device is the first level, the CPU power consumption parameter PL1 is the fourth value obtained by summing the first value and the first offset. In this way, by sampling the actual CPU power consumption, the terminal device can obtain different CPU power consumption adaptation values corresponding to different applications when the load level is the first level. During the running of the application, the value of the CPU power consumption parameter PL1 is increased, so that each application can have a more appropriate CPU power consumption limit, reduce application jams, and improve user experience.
[0009] In a possible implementation, between the fifth moment and the sixth moment, the CPU power consumption is collected according to the second sampling period to obtain M CPU power consumption values; the second CPU power consumption adaptation value is determined according to the M CPU power consumption values; the second offset is obtained, and the second offset is the difference between the second CPU power consumption adaptation value and the second value; wherein, after the sixth moment, the terminal device exits the first application and opens the first application again, and if the load level of the terminal device is the second level, the CPU power consumption parameter PL1 is the sixth value obtained by summing the second value and the second offset. In this way, by sampling the actual CPU power consumption, the terminal device can obtain different CPU power consumption adaptation values corresponding to different applications when the load level is the second level, so that each application can have a more appropriate CPU power consumption limit, reduce application jams, and improve user experience.
[0010] In one possible implementation, the CPU power consumption parameter PL1 value of the first application is controlled by the second application, and the first offset and the second offset are managed by the second application. The method may also include: when the second application exits, the first offset and the second offset are both cleared. In this way, the power consumption control method of the embodiment of the present application can be executed in multiple management applications of the terminal device. The method has a relatively wide scope of application and is generally applicable. It is more convenient to control and manage the CPU power consumption of each application in the terminal device and improve the performance of the terminal device.
[0011] In a possible implementation, at the eighth moment, the terminal device exits the second application and opens the second application again; the eighth moment is later than the seventh moment; at the ninth moment, the terminal device opens the first application, when the load level of the terminal device is the first level, the CPU power consumption parameter PL1 is the first value, and when the load level of the terminal device is the second level, the CPU power consumption parameter PL1 is the second value; the ninth moment is later than the eighth moment. In this way, restoring the initial preset value of PL1 can prevent the CPU power consumption value corresponding to each application from always being at a high value, which can reduce the power consumption of the terminal device and improve the performance of the terminal device.
[0012] In a possible implementation, the second application may include a monitoring system performance module, a scene scheduling module, and a CPU power consumption collection module; between a first moment and a second moment, the monitoring system performance module determines that the jamming event is a user-perceivable jamming event; at the second moment, the scene scheduling module sets the CPU power consumption parameter PL1 to a third value; from the second moment onwards, within a first preset time length, the scene scheduling module samples the power consumption of the CPU through the CPU power consumption collection module; at the third moment, the scene scheduling module sets the CPU power consumption parameter PL1 to a fourth value; between the fourth moment and the fifth moment, the monitoring system performance module determines that the jamming event is a user-perceivable jamming event Perceived freeze event; at the fifth moment, the scene scheduling module sets the CPU power consumption parameter PL1 to the fifth value; from the fifth moment, within the second preset time, the scene scheduling module samples the CPU power consumption through the CPU power consumption acquisition module; at the sixth moment, the scene scheduling module sets the CPU power consumption parameter PL1 to the sixth value; at the seventh moment, the terminal device exits the first application and opens the first application again. If the load level of the terminal device is the first level, the scene scheduling module sets the CPU power consumption parameter PL1 to the fourth value; if the load level of the terminal device is the second level, the scene scheduling module sets the CPU power consumption parameter PL1 to the sixth value. In this way, the second application sets the appropriate CPU power consumption value for different application scenarios through the mutual coordination of different modules, so that the application runs more smoothly, reduces freezes, optimizes system performance, and improves user experience.
[0013] In a possible implementation, the monitoring system performance module determines that the jamming event is a user-perceivable jamming event, which may include: when the delay of the jamming event exceeds the third preset duration, the monitoring system performance module determines that the jamming event is a user-perceivable jamming event according to the event identifier Flags. In this way, the user-perceivable jamming event can be accurately identified, and when the user-perceivable jamming event occurs, the CPU power consumption parameter PL1 can be adjusted to reduce the jamming of the application.
[0014] In a possible implementation, the types of freezes may include one or more of the following: mouse delay freezes, input delay freezes, and window unresponsive freezes. In this way, controlling the application power consumption based on the freezes that can be perceived by the user can reduce the probability of application freezes and improve the user experience.
[0015] In a possible implementation, when the load level of the terminal device remains unchanged, different application scenarios correspond to different CPU power consumption parameters PL1. In this way, different CPU power consumption parameters PL1 corresponding to different applications can make each application have a more appropriate CPU power consumption limit, reduce application jams, and improve user experience.
[0016] In a second aspect, an embodiment of the present application provides a device for power consumption control, which may be a terminal device, or a chip or chip system in a terminal device. The device for power consumption control may include a processing unit. The processing unit is used to implement any method related to processing performed by the terminal device in the first aspect or any possible implementation of the first aspect. When the device for power consumption control is a terminal device, the processing unit may be a processor. The device for power consumption control may also include a storage unit, which may be a memory. The storage unit is used to store instructions, and the processing unit executes the instructions stored in the storage unit so that the terminal device implements a method described in the first aspect or any possible implementation of the first aspect. When the device for power consumption control is a chip or chip system in a terminal device, the processing unit may be a processor. The processing unit executes the instructions stored in the storage unit so that the terminal device implements a method described in the first aspect or any possible implementation of the first aspect. The storage unit may be a storage unit in the chip (for example, a register, a cache, etc.), or a storage unit in the terminal device located outside the chip (for example, a read-only memory, a random access memory, etc.).
[0017] In a possible implementation, the processing unit is configured to set a CPU power consumption parameter PL1 for an application.
[0018] In a possible implementation, the processing unit is used to collect CPU power consumption according to a first sampling period to obtain N CPU power consumption values; and is also used to determine a first CPU power consumption adaptation value according to the N CPU power consumption values; and is specifically used to obtain a first offset.
[0019] In a possible implementation, the processing unit is used to collect CPU power consumption according to a second sampling period to obtain M CPU power consumption values; and is also used to determine a second CPU power consumption adaptation value according to the M CPU power consumption values; and is specifically used to obtain a second offset.
[0020] In a possible implementation, the processing unit is configured to clear both the first offset and the second offset to zero when the second application exits.
[0021] In a possible implementation, the processing unit is configured to set a CPU power consumption parameter PL1 for the application when the terminal device exits the second application and reopens the second application.
[0022] In one possible implementation, the processing unit is used to determine that the freeze event is a freeze event that is perceptible to the user; it is also used to set the CPU power consumption parameter PL1 to a third value, set the CPU power consumption parameter PL1 to a fourth value, set the CPU power consumption parameter PL1 to a fifth value, and set the CPU power consumption parameter PL1 to a sixth value; and is specifically used to sample the power consumption of the CPU through a CPU power consumption collection module.
[0023] In a possible implementation, the processing unit is used to determine that the freeze event is a freeze event perceptible to the user according to the event identifier Flags when the delay of the freeze event exceeds a third preset duration.
[0024] In a possible implementation, the types of lag may include one or more of the following: mouse delay lag, input delay lag, and window unresponsive lag.
[0025] In a possible implementation, when the load level of the terminal device remains unchanged, different application scenarios correspond to different CPU power consumption parameters PL1.
[0026] In a third aspect, an embodiment of the present application provides a terminal device, including a processor and a memory, the memory being used to store code instructions, and the processor being used to run the code instructions to execute the power consumption control method described in the first aspect or any possible implementation of the first aspect.
[0027] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is run on a computer, the computer executes the power consumption control method described in the first aspect or any possible implementation of the first aspect.
[0028] In a fifth aspect, an embodiment of the present application provides a computer program product including a computer program. When the computer program runs on a computer, the computer executes the power consumption control method described in the first aspect or any possible implementation of the first aspect.
[0029] In a sixth aspect, the present application provides a chip or a chip system, which includes at least one processor and a communication interface, the communication interface and the at least one processor are interconnected by a line, and the at least one processor is used to run a computer program or instruction to execute the power consumption control method described in the first aspect or any possible implementation of the first aspect. Among them, the communication interface in the chip can be an input / output interface, a pin or a circuit, etc.
[0030] In a possible implementation, the chip or chip system described above in the present application further includes at least one memory, in which instructions are stored. The memory may be a storage unit inside the chip, such as a register, a cache, etc., or a storage unit of the chip (e.g., a read-only memory, a random access memory, etc.).
[0031] It should be understood that the second to sixth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application;
[0033] Figure 2 A schematic diagram of the software structure of a terminal device provided in an embodiment of the present application;
[0034] Figure 3 A schematic diagram of a scheme framework of a power consumption control method provided in an embodiment of the present application;
[0035] Figure 4 A flowchart of a power consumption control method in an office scenario provided by an embodiment of the present application;
[0036] Figure 5 A flowchart of a power consumption control method in a browser scenario provided by an embodiment of the present application;
[0037] Figure 6 A schematic diagram of a specific power consumption control method provided in an embodiment of the present application;
[0038] Figure 7 A schematic diagram of a value change of adjusting a CPU power consumption parameter PL1 provided in an embodiment of the present application;
[0039] Figure 8 A schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] In order to clearly describe the technical solutions of the embodiments of the present application, some terms and technologies involved in the embodiments of the present application are briefly introduced below:
[0041] 1. PL1: PL is the output power limit (PL). PL1 can represent the functional loss limit of the central processing unit (CPU), and can also be called the CPU power consumption limit or CPU power consumption parameter. Because different application scenarios have different CPU power consumption, each application scenario can correspond to its own CPU power consumption parameter PL1. When the application in each application scenario is running, the power consumption of the CPU cannot exceed the CPU power consumption parameter PL1 of the application scenario. The CPU power consumption parameter PL1 can also be referred to as PL1.
[0042] 2. Load level and PL1: Based on the performance data of the terminal device such as the CPU, the load of the terminal device can be divided into different levels. For example, when the CPU utilization is less than or equal to 20%, the load level can be light load; when the CPU utilization is greater than 20% and less than or equal to 50%, the load level can be medium load; when the CPU utilization is greater than 50%, the load level can be heavy load. The specific method of dividing the load level is not limited in the embodiments of this application.
[0043] According to different load levels of terminal equipment, different application scenarios can set the initial value of PL1 under different load levels.
[0044] Exemplarily, when the application scenario is A, the initial values of PL1 corresponding to different load levels may be different. For example, when the terminal device is lightly loaded, the initial value of PL1 corresponding to the application scenario A may be A1; when the terminal device is medium loaded, the initial value of PL1 corresponding to the application scenario A may be A2; when the terminal device is heavily loaded, the initial value of PL1 corresponding to the application scenario A may be A3, wherein A1 is less than A2, and A2 is less than A3.
[0045] When the application scenario is B, the initial value of PL1 corresponding to different load levels may be different. For example, when the terminal device is lightly loaded, the initial value of PL1 corresponding to the application scenario B may be B1; when the terminal device is medium loaded, the initial value of PL1 corresponding to the application scenario B may be B2; when the terminal device is heavily loaded, the initial value of PL1 corresponding to the application scenario B may be B3, where B1 is less than B2, and B2 is less than B3.
[0046] The relationship between the load level of a specific terminal device and the initial value of PL1 corresponding to the application scenario can be shown in Table 1.
[0047] Table 1
[0048] Load level of terminal equipment Light load Medium load Heavy load PL1 for application scenario A A1 A2 A3 PL1 for application scenario B B1 B2 B3
[0049] 3. IPC message: It is an inter-process communication (IPC) message that can transmit messages between two processes.
[0050] 4. Terminology
[0051] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. For example, the first chip and the second chip are only used to distinguish different chips, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0052] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0053] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, c can be single or multiple.
[0054] 5. Terminal equipment
[0055] The terminal device of the embodiment of the present application may also be any form of electronic device. For example, the electronic device may include a handheld device, a vehicle-mounted device, etc. For example, some electronic devices are: mobile phones, tablet computers, PDAs, laptop computers, mobile internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, user equipment (UE), mobile stations (MS), mobile terminals (MT), access terminals, subscriber units, subscriber stations, mobile stations, mobile stations, remote stations, remote terminals, mobile devices, terminals, wireless communication devices, user agents or user devices, cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), etc. assistant, PDA), handheld devices with wireless communication capabilities, computing devices or other processing devices connected to a wireless modem, vehicle-mounted devices, wearable devices, terminal devices in a 5G network, or terminal devices in a future evolved public land mobile communication network (public land mobile network, PLMN), etc., and the embodiments of the present application are not limited to this.
[0056] As an example but not limitation, in the embodiments of the present application, the terminal device may also be a wearable device. Wearable devices may also be referred to as wearable smart devices, which are a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also powerful functions achieved through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include full-featured, large-sized, and fully or partially independent of smartphones, such as smart watches or smart glasses, as well as devices that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various types of smart bracelets and smart jewelry for vital sign monitoring.
[0057] In addition, in the embodiments of the present application, the terminal device may also be a terminal device in an Internet of Things (IoT) system. IoT is an important part of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, thereby realizing an intelligent network that interconnects people and machines and things.
[0058] In an embodiment of the present application, a terminal device or each network device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a CPU, a memory management unit (MMU), and a memory (also called main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or a Windows operating system. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.
[0059] For example, Figure 1 A schematic diagram of the structure of a terminal device is shown.
[0060] The terminal device 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 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a button 190, an indicator 192, a camera 193, and a display screen 194, etc.
[0061] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the terminal device. In other embodiments of the present application, the terminal device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0062] 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 processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated into one or more processors. The controller may be the nerve center and command center of the terminal device, and the controller may generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions.
[0063] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0064] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a USB interface, etc.
[0065] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the terminal device. In other embodiments of the present application, the terminal device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0066] 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 terminal device. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.
[0067] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the terminal device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the terminal device by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor. For example, in an embodiment of the present application, the processor may enable the terminal device to execute the power consumption control method provided in an embodiment of the present application by running instructions stored in the internal memory.
[0068] The USB interface 130 is an interface that complies with the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the terminal device, and can also be used to transfer data between the terminal device and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other terminal devices, such as AR devices, etc.
[0069] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While the charging management module 140 charges the battery 142, it can also power the terminal device through the power management module 141.
[0070] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory 120, the display screen 194, and the wireless communication module 160. In some embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0071] The wireless communication module 160 can provide wireless communication solutions for application in terminal devices, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.
[0072] The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via an antenna, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be sent from the processor 110, modulate the frequency of the signal, amplify the signal, and convert it into an electromagnetic wave for radiation via the antenna.
[0073] The terminal device implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information. The terminal device can implement the shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0074] The terminal device can implement audio functions such as audio playback or recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor.
[0075] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The speaker 170A, also known as the "speaker", is used to convert audio electrical signals into sound signals. The terminal device may include 1 or N speakers 170A, where N is a positive integer greater than 1. The terminal device can listen to music, videos, or listen to hands-free calls through the speaker 170A. The receiver 170B, also known as the "earpiece", is used to convert audio electrical signals into sound signals. When the terminal device answers a call or voice message, the voice can be answered by placing the receiver 170B close to the human ear. The microphone 170C, also known as the "microphone" or "microphone", is used to convert sound signals into electrical signals. The headphone jack 170D is used to connect wired headphones.
[0076] The key 190 includes a power key, a volume key, etc. The key 190 can be a mechanical key or a touch key. The terminal device can receive key input and generate key signal input related to user settings and function control of the terminal device.
[0077] The indicator 192 may be an indicator light, which may be used to indicate the charging status, or a change in the amount of electricity, etc.
[0078] The camera 193 is used to capture static images or videos. In some embodiments, the terminal device may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0079] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the terminal device may include 1 or N display screens 194, where N is a positive integer greater than 1. The terminal device implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor.
[0080] The software system of the terminal device can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention takes a Windows system with a layered architecture as an example to exemplify the software structure of the terminal device.
[0081] Figure 2 It is a software structure block diagram of the terminal device of an embodiment of the present application.
[0082] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Windows system is divided into user state and kernel state. Among them, the user state includes the application layer and the subsystem dynamic link library. The kernel state is divided from top to bottom into the executive body, kernel and device driver, and the hardware abstraction layer (HAL).
[0083] like Figure 2 As shown, the application layer includes computer housekeeper, office, browser, social, music, video, game and other applications. Applications may include system applications and third-party applications. The application layer may also include an environment subsystem, which can display certain subsets of basic executive system services to applications in a specific form to provide an execution environment for applications. Among them, in an embodiment of the present application, the computer housekeeper application may include a monitoring system performance module, a scene scheduling module, and a CPU power consumption acquisition module.
[0084] The monitoring system performance module may include a jamming detection module, which may obtain jamming events in the terminal device system and report the jamming events to the scene scheduling module.
[0085] The scene scheduling module may include a scene recognition module and a scheduling module. Among them, the scene recognition module can identify the application scenario of the terminal device and determine the basic scheduling strategy that matches the application scenario. The scheduling module can obtain the load condition of the terminal device, and determine the actual scheduling strategy that meets the actual operation condition of the terminal device in combination with the load condition of the terminal device and the above-mentioned basic scheduling strategy. In addition, the scene scheduling module can also obtain the CPU power consumption value from the CPU power consumption acquisition module.
[0086] The CPU power consumption acquisition module can obtain the CPU power consumption value and report the CPU power consumption value to the scene scheduling module.
[0087] The subsystem dynamic link library may include an application programming interface (API) module, which includes Windows API, Windows native API, etc. Among them, both Windows API and Windows native API can provide system call entry and internal function support for applications, the difference is that Windows native API is an API native to the Windows system. For example, Windows API may include user.dll and kernel.dll, and Windows native API may include ntdll.dll. Among them, user.dll is a Windows user interface interface, which can be used to perform operations such as creating windows and sending messages. Kernel.dll is used to provide applications with an interface to access the kernel. ntdll.dll is an important Windows NT kernel-level file. When Windows starts, ntdll.dll resides in a specific write-protected area in the memory, so that other programs cannot occupy this memory area.
[0088] The executive body may include a process manager, a virtual memory manager, an I / O manager, a power manager, an operating system event driver (OsEventDriver) node, and the like.
[0089] The process manager is used to create and terminate processes and threads.
[0090] The Virtual Memory Manager implements "virtual memory". The Virtual Memory Manager also provides basic support for the Cache Manager.
[0091] The I / O manager performs device-independent input / output and further processes calls appropriate device drivers.
[0092] The power manager manages power state changes for all devices that support power state changes.
[0093] The system event driven node can interact with the kernel and driver layer, for example, interact with the graphics card driver, and after determining that there is a GPU video decoding event, report the GPU video decoding event to the scene recognition engine.
[0094] The kernel and driver layer includes the kernel and device drivers.
[0095] The kernel is an abstraction of the processor architecture, isolating the executive body from the differences in the processor architecture to ensure the portability of the system. The kernel can perform thread scheduling and dispatching, trap handling and exception dispatching, interrupt handling and dispatching, etc.
[0096] Device drivers run in kernel mode and are interfaces between the I / O system and related hardware. Device drivers may include graphics card drivers, audio drivers, video drivers, camera drivers, keyboard drivers, etc.
[0097] HAL is a kernel-state module that can hide various hardware-related details, such as I / O interfaces, interrupt controllers, and multi-processor communication mechanisms, and provide a unified service interface for different hardware platforms running Windows, achieving portability on multiple hardware platforms. It should be noted that in order to maintain the portability of Windows, Windows internal components and user-written device drivers do not directly access the hardware, but call routines in HAL.
[0098] It should be noted that the embodiments of the present application are only illustrated using the Windows system as an example. In other operating systems (such as the Android system, the IOS system, etc.), as long as the functions implemented by each functional module are similar to those in the embodiments of the present application, the solutions of the present application can also be implemented.
[0099] As the performance of terminal devices improves, terminal devices can handle tasks in multiple applications at the same time, resulting in higher power consumption of terminal devices. In order to limit power consumption, terminal devices often need to reduce the power consumption of some applications during operation. However, if the power consumption of an application is too low, the application may be prone to freezing, or even freeze and cannot be recovered, which reduces the user experience.
[0100] In some implementations, a management application in the terminal device may control the power consumption of the application, and the management application may include, for example, a computer manager application, a security management application, etc. For ease of description, the following description will be given by taking the computer manager application controlling power consumption as an example.
[0101] Exemplarily, the computer manager application in the terminal device may preset the PL1 initial value of each application scenario in the terminal device. When each application is running, the computer manager application may control the PL1 of each application scenario to the PL1 initial value of each application scenario under the load level based on the load level of the terminal device. In order to reduce the power consumption of the terminal device, the PL1 initial value of each application is usually small. However, some applications may be stuck when running at a smaller PL1 initial value. When an application is stuck, the terminal device can increase the PL1 value of the application scenario within a preset time period according to the instructions of the computer manager application, so that the application runs in a high-performance state and reduces the jamming of the application. After the preset time period ends, the PL1 of the application scenario can be restored to the PL1 initial value of the application scenario.
[0102] like Figure 3As shown in the original scheme, when the jam detection module of the PC Manager application detects that a certain application in the Windows foreground is jammed, the jam detection module can send a jam event message to the scene scheduling module. The scene scheduling module can increase the PL1 of the application scene to a larger value within a preset time period, so that the application runs in a high-performance state. After the preset time period ends, the PL1 of the application scene is restored to the initial PL1 value of the application scene.
[0103] However, in the above implementation, because the larger PL1 value of the application scenario is restored to the initial PL1 value of the application scenario after the preset time period, the application may still frequently freeze in subsequent operation.
[0104] In view of this, an embodiment of the present application provides a power consumption control method, such as Figure 3 As shown in the optimization scheme, when the jam detection module detects that the Windows foreground application is jammed, the scene scheduling module can increase the PL1 of the application scenario to a larger value within a preset time period, and within the preset time period, the scene scheduling module can sample the CPU power consumption through the CPU power consumption acquisition module, obtain the actual CPU power consumption value, and calculate the adapted CPU power consumption value within the preset time period based on the sampled CPU power consumption value. Among them, the adapted CPU power consumption value may include, for example, the average CPU power consumption value or some values near the average CPU power consumption value. Furthermore, the scene scheduling module can set the PL1 in the application scenario to the adapted CPU power consumption value, so that the user can operate more smoothly in the application scenario, reduce jamming, achieve system performance tuning, and improve user experience.
[0105] In the embodiment of the present application, the computer manager application can set different PL1 initial values for different application scenarios, wherein the application scenarios may include office scenarios, browser scenarios, video playback scenarios, meeting scenarios, game scenarios, and social scenarios.
[0106] Applications in the terminal device can be pre-divided into corresponding application scenarios. For example, office scenarios can include scenarios using office document applications, scenarios using office presentation (power point, PPT) applications, or scenarios using excel spreadsheet applications. Browser scenarios can include scenarios using various browser applications. When the terminal device identifies an application scenario, it can determine the application scenario to which the application belongs based on the identifier of the application running in the foreground of the terminal device.
[0107] The power consumption control method of the embodiment of the present application is described in detail below in combination with two different application scenarios. For example, scenario one may be an office scenario, and scenario two may be a browser scenario.
[0108] Scene 1: Office scene.
[0109] When a user opens an office application, the scene scheduling module of the computer manager application can obtain the current load of the terminal device and determine the load level based on the load. The specific method of determining the load level can refer to the above description of the load level and will not be repeated. In addition, the scene scheduling module can obtain the initial value of PL1 in the corresponding office scene according to the different load levels.
[0110] Exemplarily, when the terminal device is lightly loaded, the initial value of PL1 in the office scene can be 9W; when the terminal device is medium loaded, the initial value of PL1 in the office scene can be 15W; when the terminal device is heavily loaded, the initial value of PL1 in the office scene can be 35W. The initial value of PL1 in the office scene can be set by the computer housekeeper application according to the empirical preset value obtained by analyzing the data. 9W, 15W and 35W can be replaced by any possible value, as long as the initial value of PL1 in the light load is less than the initial value of PL1 in the medium load, and the initial value of PL1 in the medium load is less than the initial value of PL1 in the heavy load. The embodiment of the present application does not specifically limit the initial value of PL1 in each load.
[0111] Take the case where the terminal device is lightly loaded as an example. Assuming that the initial value of PL1 in this office scenario is 9W, Figure 4 A schematic diagram of a power consumption control method in an office scenario is shown.
[0112] S401, freeze event monitoring.
[0113] During the operation of the office application in the Windows foreground, there may be jams, and there may be frequent jams. At this time, the jam detection module in the PC Manager application can obtain the jam event reported by the office application to the terminal device. In a possible implementation, the jam detection module can receive the jam event by subscribing to the event tracing for Windows (ETW) of the delayed Windows window to the terminal device. Among them, the jam events monitored by the jam detection module may include 35 / 37 / 38 / 173 events in the Windows system.
[0114] S402: Analysis of the content of the freeze event.
[0115] After the jam detection module detects a jam event, it can report it to the monitoring system performance module in the PC Manager application. The monitoring system performance module can parse the content of the jam event to obtain the jam delay and the event flags used to filter whether it is a user-perceivable jam. Among them, user-perceivable jam events may include: mouse delay, input delay, window unresponsiveness and other events.
[0116] S403: Whether the freeze delay is greater than the preset freeze duration.
[0117] The monitoring system performance module can filter out freeze events based on freeze delay. For example, the monitoring system performance module can determine an event with a freeze delay greater than a preset freeze duration as an alternative freeze event, and continue to execute step S404; for an event with a freeze delay less than or equal to the preset freeze duration, no processing is performed. Among them, the preset freeze duration can be set according to the empirical preset value obtained by analyzing the data, for example, the preset freeze duration can be 3 seconds, and the specific value of the preset freeze duration is not limited in the embodiment of the present application.
[0118] S404: Determine whether it is a user-perceivable freeze event according to Flags.
[0119] In an embodiment of the present application, if the monitoring system performance module determines that the freeze delay of the freeze event exceeds the preset freeze duration (such as 3 seconds), and the freeze event is a foreground process or the freeze event is a process with user input operation, then the freeze event can be considered to be a user-perceivable freeze.
[0120] In a possible implementation of determining a user-perceivable jamming event, the monitoring system performance module may filter whether the jamming event is a user-perceivable jamming event based on the event identifier Flags of the user-perceivable jamming. Exemplarily, the monitoring system performance module may perform an AND (&) operation on the user-perceivable event identifier Flags value and 0xCE0, and determine whether the current jamming event is a user-perceivable jamming based on the result of the AND operation. For example, if "Flags value & 0xCE0>0, and the jamming delay>preset jamming duration (such as 3 seconds)", the jamming event is considered to be a user-perceivable jamming. Among them, 0xCE0 can be an empirical value obtained based on multiple tests, and the embodiment of the present application does not limit the value of 0xCE0.
[0121] S405: Generate freeze event content.
[0122] If the monitoring system performance module determines that the freeze event is a freeze event that can be perceived by the user, the freeze event content can be further generated.
[0123] S406, encapsulate the stuck IPC message.
[0124] The monitoring system performance module can encapsulate the content of the generated jam event into an IPC message. Furthermore, the monitoring system performance module can report the jam IPC message to the scene scheduling module in the computer manager application.
[0125] S407, receiving the stuck IPC message.
[0126] The scene scheduling module may receive the jamming IPC message reported by the monitoring system performance module and continue to execute step S408.
[0127] S408: Whether the office scene is in a stuck state.
[0128] After receiving the jamming IPC message, the scene scheduling module can determine whether the current office scene is already in a jamming scene based on the jamming status value. If it is currently in a jamming scene, it means that the current office scene is already in the PL1 high-performance state that is locked with a preset jamming duration, and the scene scheduling module does not process the jamming IPC message. If it is not currently in a jamming scene, the scene scheduling module may deem it necessary to process the received jamming IPC message, and then execute step S409. Among them, the jamming status value can be a data type such as Boolean, integer, or string. For example, the jamming status value when it is already in a jamming scene can be set to true, and the jamming status value when it is not in a jamming scene can be set to false. The embodiment of the present application does not limit the specific setting method of the jamming status value.
[0129] S409, set the jamming scene, set the jamming state value, issue the jamming policy parameters, and set PL1 to a larger value.
[0130] When it is determined that the office scene is not in a stuck scene, the scene scheduling module can set the current office scene to a stuck scene, generate policy parameters corresponding to the stuck event, and set the stuck state value, for example, the stuck state value can be set to true. Among them, the stuck policy parameter can be the CPU power consumption parameter PL1. Since the policy parameter of the stuck event is used to improve the performance of the CPU, PL1 can be set to a larger value. For example, the maximum value of PL1 can be 35W. It can be understood that PL1 can also be a preset maximum value. The maximum value of PL1 can be set according to the empirical preset value obtained by analyzing the data. The embodiment of the present application does not limit the specific maximum value of PL1.
[0131] Furthermore, the scene scheduling module can send the larger value of PL1 corresponding to the jam event to the underlying chip, and the underlying chip can adjust PL1 from the initial value to the larger value, wherein the larger value of PL1 is greater than the initial value of PL1. Exemplarily, the initial value of PL1 before adjustment in the office scene can be 9W, and the larger value of PL1 after adjustment can be 35W. In this way, after the value of PL1 increases, the performance of the CPU can be improved, thereby reducing jam events.
[0132] S410: Create a timer with a preset timing duration, and do not modify the value of PL1 within the preset timing duration.
[0133] When the scene scheduling module issues the policy parameters corresponding to the freeze event, it can create and start a timer and set the timer duration to the preset timing duration. The preset timing duration can be set according to the empirical preset value obtained by analyzing the data. For example, the preset timing duration can be 5 minutes. The specific value of the preset timing duration is not limited in the embodiment of the present application.
[0134] It is understandable that within the preset time duration, the scene scheduling module no longer issues new policy parameters, that is, within the preset time duration (such as 5 minutes), the scene scheduling module no longer modifies the value of PL1, so that PL1 is locked at a larger value and remains unchanged. In this way, PL1 can be maintained at a high-performance parameter value and will not be adjusted, so that the office application can run smoothly for a period of time, thereby reducing the impact of freezes.
[0135] S411. Collect actual CPU power consumption.
[0136] During the preset timing duration (such as 5 minutes), PL1 is in a stuck high-performance parameter state. At the same time, the scene scheduling module can obtain the actual CPU power consumption from the CPU power consumption collection module to achieve sampling of the CPU power consumption value within the preset timing duration.
[0137] In order to balance the feasibility of the solution and the power consumption of the entire system, the embodiment of the present application compares multiple sampling periods (such as the sampling period is set to 1 second, 3 seconds, 5 seconds, or 10 seconds, etc.), and selects 5 seconds as the sampling period for calculating the average power consumption of the CPU in the embodiment of the present application. The specific sampling period is not limited in the embodiment of the present application.
[0138] S412: Check whether the timer has timed out.
[0139] If the timer has not timed out, then continue to execute step S411 to sample the CPU power consumption. If the timer has timed out, then end the CPU power consumption sampling and execute step S413.
[0140] S413: Calculate a first adaptation value and a first offset.
[0141] After the timer times out, that is, after a preset timer duration (such as 5 minutes), the scene scheduling module can calculate the first adaptation value of the CPU power consumption in the office scene, wherein the first adaptation value may include, for example, the average CPU power consumption value AverageCPUPower1 or some values near the average CPU power consumption value. Further, the scene scheduling module can calculate the first adaptation value with the initial value of PL1 in the office scene to obtain the first offset OFFSET corresponding to the office scene under light load conditions. 轻1 .
[0142] For example, under light load conditions, the first offset OFFSET 轻1 It can be the difference between the average CPU power consumption value AverageCPUPower1 and the initial value PL11 of PL1, the first offset OFFSET 轻1 The following formula can be satisfied:
[0143] OFFSET1 轻1 =AverageCPUPower11-PL11
[0144] It is understandable that the first offset OFFSET 轻1 It can also be a preprocessed value, including performing a multiplication operation on the first adaptation value and then performing a difference operation with the PL1 initial value, or performing a multiplication operation on the difference between the first adaptation value and the PL1 initial value, etc. The specific method of calculating the first offset is not limited in the embodiment of the present application.
[0145] The value of the first offset can be stored in an array or other data structure. Taking the value of the first offset stored in an array as an example, the array can be used to store the offsets corresponding to each application scenario, and the application scenario and the offset can be a one-to-one relationship. For example, if the office scene can be represented by the SCENE_TYPE_WORKING field, and the offset corresponding to the office scene is 8W, then the offset corresponding to the office scene in the array can be represented as {SCENE_TYPE_WORKING, 8}.
[0146] It should be noted that when the scene scheduling module calculates the first offset, unsatisfactory data may occur. Exemplarily, the scene scheduling module may consider the first offset to be a valid value in the interval (0,10]. Among them, setting the first offset to be greater than 0 can prevent the first offset from setting the initial value of PL1 lower, which can make the application less likely to cause lag. Setting the first offset to no more than 10 can reduce scenarios such as abnormal high loads of CPU power consumption.
[0147] S414. Clear the jam status value and re-identify the application scenario.
[0148] When the timer times out, the scene scheduling module can clear the jam state value, for example, set the jam state value to false, and re-identify the application scene. The application scene can be identified by the scene recognition module in the PC Manager application. The specific identification method can refer to the description in the implementation of the above application scene recognition, which will not be repeated here.
[0149] When the re-identified application scenario is an office scenario, step S415 is executed.
[0150] S415: Still in the office scene, update PL1 to the adjustment value.
[0151] When it is identified that the application scenario is still an office scenario, if the terminal device is lightly loaded, the scene scheduling module can send the calculated first adaptation value as the adjustment value of PL1 to the underlying chip, and the underlying chip can modify PL1 from a larger value to an adjustment value, wherein the adjustment value of PL1 is less than the larger value of PL1, and the adjustment value of PL1 is greater than the initial value of PL1. Exemplarily, the initial value of PL1 in the office scenario can be 9W, the larger value of PL1 can be 35W, and the adjustment value of PL1 can be 17W. In this way, when PL1 is not very low, the CPU power consumption of the terminal device can be reduced, and the CPU performance can be improved while reducing freeze events.
[0152] In the embodiment of the present application, under light load conditions, the adjustment value of PL1 may be the sum of the initial value of PL1 and the first offset. It is understandable that when calculating the first offset, if the calculation process of the difference is processed to a certain extent, when calculating the adjustment value of PL1, a corresponding reverse processing calculation may be performed. The specific process of calculating the adjustment value of PL1 is not further described in the embodiment of the present application.
[0153] It is understandable that in the same application scenario, different load levels may correspond to different offsets. For example, in the office scenario, if the load level identified in step S415 is medium load, the adjustment value of PL1 may be the initial value of PL1 corresponding to the medium load and the offset OFFSET1 corresponding to the medium load. 中1 That is to say, the adjustment value of PL1 under medium load cannot use the offset OFFSET1 corresponding to light load. 轻1 If the offset has not been calculated in the medium load office scenario, the offset OFFSET1 corresponding to the medium load can be considered 中1 If the value of PL1 is 0, then under medium load conditions, the adjustment value of PL1 can be the initial value of PL1.
[0154] In this office scenario, if the load level identified in step S415 is a heavy load, it can be considered that under heavy load, the CPU power consumption of the terminal device is relatively large, and PL1 under heavy load does not need to be adjusted.
[0155] In a possible implementation, if the user exits the office application, when the user opens the office application again, the computer manager application can re-identify the application scene. When the application scene is re-identified as the office scene, step S415 can be executed to update PL1 to the adjustment value.
[0156] In a possible implementation, if the computer freezes again in the office scene, the PC Manager application can recalculate the offset in the office scene and save it in an array. It is understandable that if the offset value is already stored in the array, the recalculated offset value can overwrite the previous value. For example, when the load level is light load, the recalculated offset OFFSET1 轻1 Can overwrite the offset OFFSET1 corresponding to the existing light load 轻1 When the load level is medium load, the recalculated offset OFFSET1 中1 Can overwrite the offset OFFSET1 corresponding to the existing medium load 中1 The value of .
[0157] After the terminal device is re-identified as an office scene, PL1 can be updated to an adjusted value based on the sum of the initial value of PL1 and the offset of the corresponding load level. Among them, when calculating the PL1 adjustment value, the initial value corresponding to PL1 can remain unchanged. For example, the initial value of PL1 can remain at a preset 9W under light load, and the initial value of PL1 can remain at a preset 15W under medium load. The offset corresponding to PL1 can be taken from the array, that is, the offset corresponding to PL1 is the value calculated and saved last time. The adjusted value of PL1 recalculated by the power consumption control method of the embodiment of the present application increases the value of PL1 relative to the initial value of PL1, thereby reducing the possibility of frequent freezes in the office scene.
[0158] Scenario 2: Browser scenario.
[0159] When a user opens a browser application, the scene scheduling module of the computer manager application can obtain the current load of the terminal device and determine the load level based on the load. The specific method of determining the load level can refer to the above description of the load level and will not be repeated. In addition, the scene scheduling module can obtain the initial value of PL1 in the corresponding browser scene according to the different load levels.
[0160] Exemplarily, when the terminal device is lightly loaded, the initial value of PL1 in the browser scenario can be 12W; when the terminal device is medium loaded, the initial value of PL1 in the browser scenario can be 21W; when the terminal device is heavily loaded, the initial value of PL1 in the browser scenario can be 45W. Among them, the initial value of PL1 in the browser scenario can be set by the computer manager application according to the empirical preset value obtained by analyzing the data, and 12W, 21W and 45W can be replaced by any possible value, which satisfies that the initial value of PL1 in light load is less than the initial value of PL1 in medium load, and the initial value of PL1 in medium load is less than the initial value of PL1 in heavy load. The embodiment of the present application does not specifically limit the initial value of PL1 in each load.
[0161] Take the case of a light load terminal device as an example. Assuming that the initial value of PL1 in this browser scenario is 12W, Figure 5 A schematic diagram of a power consumption control method in a browser scenario is shown.
[0162] S501, jam event monitoring.
[0163] When the browser application in the Windows foreground is running, it may freeze and freeze frequently. At this time, the freeze detection module in the PC Manager application can obtain the freeze event reported by the browser application to the terminal device. Specifically, the freeze detection module can detect the freeze event as described above. Figure 4 The corresponding description in S401 is not repeated here.
[0164] S502: Analysis of the content of the freeze event.
[0165] In the embodiment of the present application, the implementation of the freeze event content analysis can refer to the above Figure 4 The corresponding description in S402 is not repeated here.
[0166] S503: Whether the freeze delay is greater than the preset freeze duration.
[0167] In the embodiment of the present application, it can be determined whether the freeze delay is greater than the preset freeze duration by referring to the above Figure 4 It is understandable that the preset freeze duration corresponding to the browser scenario may be the same as or different from the preset freeze duration corresponding to the above-mentioned office scenario. For example, the preset freeze duration may be 4 seconds. The specific value of the preset freeze duration is not limited in the present embodiment.
[0168] S504: Determine whether it is a user-perceivable freeze event according to Flags.
[0169] In the embodiment of the present application, the implementation of determining whether it is a user-perceivable freeze event can refer to the above Figure 4 The corresponding description in S404 is not repeated here.
[0170] S505: Generate freeze event content.
[0171] If the monitoring system performance module determines that the freeze event is a freeze event that can be perceived by the user, the freeze event content can be further generated.
[0172] S506, encapsulate the stuck IPC message.
[0173] The monitoring system performance module can encapsulate the content of the generated jam event into an IPC message. Furthermore, the monitoring system performance module can report the jam IPC message to the scene scheduling module in the computer manager application.
[0174] S507, receiving the stuck IPC message.
[0175] The scene scheduling module can receive the jamming IPC message reported by the monitoring system performance module and continue to execute step S508.
[0176] S508: Whether the browser scene is in a stuck state.
[0177] In the embodiment of the present application, the method for determining whether a freeze scene has occurred can refer to the above Figure 4 The corresponding description in S408 is not repeated here. If the current scene is already stuck, no processing is performed. If the current scene is not stuck, step S509 is executed.
[0178] S509: Set the scene to a jamming scenario, set the jamming state value, issue jamming policy parameters, and set PL1 to a larger value.
[0179] In the embodiment of the present application, step S509 can refer to the above Figure 4 The corresponding description in S409 is omitted. For example, in the browser scenario, the initial value of PL1 before adjustment may be 12 W, and the maximum value of PL1 after adjustment may be 45 W. In this way, after the value of PL1 increases, the performance of the CPU can be improved, thereby reducing freeze events.
[0180] S510: Create a timer with a preset timing duration, and do not modify the value of PL1 within the preset timing duration.
[0181] In the embodiment of the present application, step S510 can refer to the above Figure 4The corresponding description in S410 is not repeated here. It is understandable that the preset timing duration corresponding to the browser scenario and the preset timing duration corresponding to the above-mentioned office scenario may be the same or different. For example, the preset timing duration may be 3 minutes, and the specific value of the preset timing duration is not limited in the embodiment of the present application.
[0182] S511. Collect actual CPU power consumption.
[0183] In the embodiment of the present application, step S511 can refer to the above Figure 4 The relevant description in the corresponding S411 is not repeated here. It is understandable that the sampling period corresponding to the browser scenario and the sampling period corresponding to the above-mentioned office scenario may be the same or different. The sampling period corresponding to the specific browser scenario is not limited in the embodiment of the present application.
[0184] S512: Check whether the timer has timed out.
[0185] If the timer has not timed out, then continue to execute step S511 to sample the CPU power consumption. If the timer has timed out, then end the CPU power consumption sampling and execute step S513.
[0186] S513: Calculate a second adaptation value and a second offset.
[0187] After the timer times out, that is, after a preset timing duration (such as 3 minutes), the scene scheduling module can calculate the second adaptation value of the CPU power consumption in the browser scene, wherein the second adaptation value example and the second offset OFFSET1 under light load 轻2 The calculation method can refer to the above Figure 4 The corresponding description in S413 is not repeated here.
[0188] For example, under light load conditions, the second offset OFFSET 轻2 The second offset OFFSET can be the difference between the average CPU power consumption value AverageCPUPower2 and the initial value PL12 of PL1. 轻2 The following formula can be satisfied:
[0189] OFFSET1 轻2 =AverageCPUPower12-PL12
[0190] In the embodiment of the present application, the calculation method, storage method, and value range of the offset can all refer to the above Figure 4 The corresponding description in S413 is not repeated here.
[0191] S514: Clear the jam status value and re-identify the application scenario.
[0192] In the embodiment of the present application, step S514 can refer to the above Figure 4 The corresponding description in S414 is not repeated here. When the application scenario is re-identified as a browser scenario, step S515 is executed.
[0193] S515: Still in the browser scenario, update PL1 to the adjusted value.
[0194] When it is identified that the application scenario is still a browser scenario, if the terminal device is lightly loaded, the scene scheduling module can send the calculated second adaptation value as the adjustment value of PL1 to the underlying chip, and the underlying chip can modify PL1 from a larger value to an adjustment value, wherein the adjustment value of PL1 is less than the larger value of PL1, and the adjustment value of PL1 is greater than the initial value of PL1.
[0195] In the embodiment of the present application, the calculation method of the PL1 adjustment value can refer to the above Figure 4 The corresponding description in S415 is not repeated here.
[0196] It is understandable that in the same application scenario, different load levels may correspond to different offsets. For example, in the browser scenario, if the load level identified in step S515 is medium load, the adjustment value of PL1 may be the initial value of PL1 corresponding to the medium load and the offset OFFSET1 corresponding to the medium load. 中2 That is to say, the adjustment value of PL1 under medium load cannot use the offset OFFSET1 corresponding to light load. 轻2 If the offset has not been calculated in the medium load browser scenario, the offset OFFSET1 corresponding to the medium load can be considered 中2 If the value of PL1 is 0, then under medium load conditions, the adjustment value of PL1 can be the initial value of PL1.
[0197] In this browser scenario, if the load level identified in step S515 is heavy load, it can be considered that under heavy load, the CPU power consumption of the terminal device is relatively large, and PL1 under heavy load may not be adjusted.
[0198] In a possible implementation, if the user exits the browser application, when the user opens the browser application again, the computer manager application can re-identify the application scenario. If the application scenario is re-identified as a browser scenario, step S515 can be executed to update PL1 to an adjustment value. If the identified application scenario is another application scenario, the power consumption control method of the embodiment of the present application can be re-executed. It can be understood that the execution process of the power consumption control method in other application scenarios is similar to that in the office scenario or the browser scenario, and will not be repeated. The difference is that the values of the various PL1 and offset data corresponding to different scenarios are different. For example, the initial value of PL1, the maximum value of PL1, the adjustment value of PL1, and the offset in different scenarios may be the same or different, and the embodiment of the present application does not limit this.
[0199] In a possible implementation, if the browser freezes again in the future, the PC Manager application can recalculate the offset in the browser scenario. The specific offset calculation method can refer to the above Figure 4 The corresponding description in S415 is not repeated here.
[0200] It should be understood that when the computer manager application is running, the power consumption control method of the embodiment of the present application can be executed. When the computer manager application exits, the power consumption control method provided by the embodiment of the present application will no longer be executed, and the corresponding relationship between each application scenario and the offset OFFSET will also be released in the memory, that is, the value of the offset OFFSET can be cleared. When the computer manager application is started next time, the parameters such as the value of the offset OFFSET corresponding to each application scenario need to be recalculated.
[0201] The power consumption control method of the embodiment of the present application is described in detail below through specific embodiments. The following embodiments can be combined with each other or implemented independently, and the same or similar concepts or processes may not be repeated in some embodiments.
[0202] Figure 6 A power consumption control method according to an embodiment of the present application is shown. The method includes:
[0203] S601. The terminal device opens a first application. When the load level of the terminal device is the first level, the CPU power consumption parameter PL1 is a first value. When the load level of the terminal device is the second level, the CPU power consumption parameter PL1 is a second value.
[0204] In the embodiment of the present application, the first application may be an application opened by the user. For example, the first application may be an office application or a browser application in the above embodiment. The embodiment of the present application does not limit the type of application.
[0205] It is understandable that in the same application scenario, different load levels correspond to different initial values of the CPU power consumption parameter PL1. The specific correspondence between the load level and the initial value of PL1 can be referred to above. Figure 4 or Figure 5 The relevant descriptions in the corresponding embodiments are not repeated here.
[0206] Exemplarily, the first value may be Figure 4 In the corresponding embodiment, in the office scene, the corresponding PL1 initial value (9W) under light load, or the above Figure 5 In the corresponding embodiment, in the browser scenario, the corresponding PL1 initial value (12W) under light load; the second value can be the above Figure 4 In the corresponding embodiment, in the office scene, the corresponding PL1 initial value (15W) at medium load, or the above Figure 5 In the corresponding embodiment, in the browser scenario, the corresponding PL1 initial value (20W) at medium load. The first value and the second value can be set by the computer manager application according to the empirical preset values obtained by analyzing the data, and the first value is less than the second value. The embodiment of the present application does not specifically limit the first value and the second value.
[0207] S602: At a first moment, the CPU power consumption parameter PL1 is a first value, and a first application freezes.
[0208] In the embodiment of the present application, the first moment may be the moment when the PL1 of the first application is the initial value at the first load level. At the first moment, the PL1 set by the terminal device for the first application is the first value, and the first value is relatively small.
[0209] The detection of the jam event can refer to the above Figure 4 The corresponding description in S401 is not repeated here.
[0210] S603. At a second moment, the CPU power consumption parameter PL1 is a third value, wherein the second moment is later than the first moment, and the third value is greater than the first value.
[0211] In the embodiment of the present application, the second moment may be the moment when the PL1 of the first application is a larger value at the first load level. The third value may be the larger PL1 value set by the terminal device for the first application. Figure 4 In the corresponding embodiment, in the office scene, the terminal device sets the PL1 maximum value (35W) for the office application, or the third value can be the above Figure 5 In the corresponding embodiment, in the browser scenario, the terminal device sets a maximum PL1 value (45W) for the browser application. The specific process of setting PL1 to a maximum value can refer to the above Figure 4The corresponding description in S409 is not repeated here.
[0212] S604. Starting from the second moment, after the first preset time, at the third moment, the CPU power consumption parameter PL1 is a fourth value, wherein the fourth value is greater than the first value, and the fourth value is less than the third value, and between the first moment and the third moment, the load level is the first level.
[0213] In the embodiment of the present application, the third moment may be when PL1 of the first application is an adjusted value at the first load level. The first level may be a light load level or a medium load level, etc. The specific load level corresponding to the first level is not limited in the embodiment of the present application.
[0214] The fourth value may be an adjustment value of PL1 set by the terminal device for the first application. The fourth value may be the above Figure 4 In the corresponding embodiment, in the office scenario, the terminal device sets the PL1 adjustment value (17W) for the office application. The specific calculation process of the PL1 adjustment value can refer to the above Figure 4 The corresponding description in S413 is not repeated here.
[0215] S605. At the fourth moment, the CPU power consumption parameter PL1 is a second value, and the first application freezes.
[0216] In the embodiment of the present application, the fourth moment may be the moment when the PL1 of the first application is the initial value at the second load level. At the fourth moment, the PL1 set by the terminal device for the first application is the second value, and the second value is relatively small.
[0217] The detection of the jam event can refer to the above Figure 4 The corresponding description in S401 is not repeated here.
[0218] S606. At a fifth moment, the CPU power consumption parameter PL1 is a fifth value, wherein the fifth moment is later than the fourth moment, and the fifth value is greater than the second value.
[0219] In the embodiment of the present application, the fifth moment may be the moment when the PL1 of the first application is a larger value at the second load level. The fifth value may be the larger value of PL1 set by the terminal device for the first application. Exemplarily, the setting of the fifth value may refer to the relevant description of setting the third value in step S603 above. It can be understood that the fifth value and the third value may be the same or different. The specific process of setting the fifth value may refer to the above Figure 4 The corresponding description in S409 is not repeated here.
[0220] S607. From the fifth moment, after the second preset time, at the sixth moment, the CPU power consumption parameter PL1 is a sixth value, wherein the sixth value is greater than the second value, and the sixth value is less than the fifth value, and between the fourth moment and the sixth moment, the load level is the second level.
[0221] In the embodiment of the present application, the sixth moment may be the moment when the PL1 of the first application is an adjusted value at the second load level. The sixth value may be the adjusted value of PL1 set by the terminal device for the first application. The specific calculation process of the adjusted value of PL1 may refer to the above Figure 4 The corresponding description in S413 is not repeated here.
[0222] The second level may be a light load level or a medium load level, etc. It is understandable that the second level may be different from the first level, and the specific load level corresponding to the second level is not limited in the embodiments of the present application.
[0223] S608. At the seventh moment, the terminal device exits the first application and opens the first application again. If the load level of the terminal device is the first level, the CPU power consumption parameter PL1 is the fourth value. If the load level of the terminal device is the second level, the CPU power consumption parameter PL1 is the sixth value. The seventh moment is later than the sixth moment.
[0224] In the embodiment of the present application, the seventh moment may be the moment when the terminal device exits the first application and reopens the first application. The calculation method of the fourth value and the sixth value may refer to the above Figure 4 The corresponding description in S415 is not repeated here. When the application is stuck, a more appropriate CPU power consumption value parameter PL1 can be adapted, so that the user can operate more smoothly in the application scenario, reduce the stuck phenomenon, optimize the system performance, and improve the user experience.
[0225] Optional, in Figure 6 On the basis of the corresponding embodiments, it may include: between the second moment and the third moment, collecting CPU power consumption according to the first sampling period to obtain N CPU power consumption values; determining the first CPU power consumption adaptation value according to the N CPU power consumption values; obtaining a first offset, the first offset being the difference between the first CPU power consumption adaptation value and the first value; wherein, after the third moment, the terminal device exits the first application, and opens the first application again, if the load level of the terminal device is the first level, then the CPU power consumption parameter PL1 is a fourth value obtained by summing the first value and the first offset.
[0226] In the embodiment of the present application, the first sampling period can refer to the above Figure 4The corresponding description in S411 is not repeated here. For example, if the sampling period is 5 seconds and the preset timing duration is 5 minutes, 60 CPU power consumption values can be collected, that is, N can be 60.
[0227] The first CPU power consumption adaptation value may include, for example, the average CPU power consumption value or some values near the average CPU power consumption value. Figure 4 The corresponding average CPU power consumption value AverageCPUPower1 in the office scene, or the first CPU power consumption adaptation value can also be the above Figure 5 The corresponding average CPU power consumption value in the browser scenario is AverageCPUPower2.
[0228] The calculation method of the first offset can refer to the above Figure 4 The corresponding description in S413 is omitted. For example, the first offset may be the first offset OFFSET in the above office scene. 轻1 Alternatively, the first offset can also be the second offset OFFSET in the above browser scenario 轻2 .
[0229] For example, Figure 7 As shown above Figure 4 Take the office scene in the corresponding embodiment as an example, assuming that the first level is a light load, the initial value (first value) of PL1 in the office scene can be 9W; after the office application freezes, PL1 is adjusted to a larger value, for example, the third value of the larger value of PL1 can be 35W; then the fourth value of PL1 can be the average power consumption value of the CPU in the sampling period, for example, the fourth value can be 17W. Among them, the first value (9W) < the fourth value (17W) < the third value (35W).
[0230] Then, it can be calculated that the first offset can be 8 W. Since the fourth value of PL1 can also be the sum of the first value of PL1 (9 W) and the first offset (8 W), it can also be calculated that the fourth value can be 17 W. It can be understood that if the fourth value of PL1 calculated is greater than or equal to the third value of PL1, the fourth value of PL1 is abandoned and the first value of PL1 is still used.
[0231] By sampling the actual CPU power consumption, the terminal device can obtain different CPU power consumption adaptation values corresponding to different applications when the load level is the first level. During the running of the application, the value of the CPU power consumption parameter PL1 is increased so that each application can have a more appropriate CPU power consumption limit, reduce application jams, and improve user experience.
[0232] Optional, in Figure 6 On the basis of the corresponding embodiment, it may include: between the fifth moment and the sixth moment, collecting the CPU power consumption according to the second sampling period to obtain M CPU power consumption values; determining the second CPU power consumption adaptation value according to the M CPU power consumption values; obtaining the second offset, the second offset being the difference between the second CPU power consumption adaptation value and the second value; wherein, after the sixth moment, the terminal device exits the first application and opens the first application again, if the load level of the terminal device is the second level, then the CPU power consumption parameter PL1 is the sixth value obtained by summing the second value and the second offset.
[0233] In the embodiment of the present application, the second sampling period can refer to the above Figure 4 The relevant description in the corresponding S411 is not repeated here. Among them, the second sampling period and the first sampling period may be the same or different. That is to say, the values of M and N may be the same or different. The second CPU power consumption adaptation value may be the average CPU power consumption value or some values near the average CPU power consumption value obtained when the load level is the second level, which is not limited in the embodiment of the present application.
[0234] The second offset may be an offset calculated when the load level is the second level. The calculation method of the second offset may refer to the above Figure 4 The corresponding description in S413 is not repeated here.
[0235] By sampling the actual CPU power consumption, the terminal device can obtain different CPU power consumption adaptation values corresponding to different applications when the load level is the second level, so that each application can have a more appropriate CPU power consumption limit, reduce application jams, and improve user experience.
[0236] Optional, in Figure 6 Based on the corresponding embodiment, the CPU power consumption parameter PL1 value of the first application is controlled by the second application, and the first offset and the second offset are managed by the second application. The method may also include: when the second application exits, the first offset and the second offset are both cleared.
[0237] In the embodiment of the present application, the second application may be some management applications in the terminal device, and the management application may include, for example, a computer housekeeper application, a security management application, etc. Exemplarily, the second application may be the computer housekeeper application in the above embodiment. When the second application is running, the power consumption control method of the embodiment of the present application may be executed, and the second application may control or manage the first value, the second value, the larger value, the CPU power consumption configuration value, and the offset, etc. of the PL1 value.
[0238] When the second application is exited, the power consumption control method provided in the embodiment of the present application will no longer be executed, and the corresponding relationship between each application scenario and the offset will also be released in the memory, that is, the value of the offset can be cleared. When the second application is started next time, the parameters such as the offset value corresponding to each application scenario need to be recalculated.
[0239] The power consumption control method of the embodiment of the present application can be executed in multiple management applications of a terminal device. The method has a relatively wide scope of application and is generally applicable. It can more conveniently control and manage the CPU power consumption of each application in the terminal device and improve the performance of the terminal device.
[0240] Optional, in Figure 6 On the basis of the corresponding embodiment, at the eighth moment, the terminal device exits the second application and opens the second application again; the eighth moment is later than the seventh moment; at the ninth moment, the terminal device opens the first application, when the load level of the terminal device is the first level, the CPU power consumption parameter PL1 is the first value, when the load level of the terminal device is the second level, the CPU power consumption parameter PL1 is the second value; the ninth moment is later than the eighth moment.
[0241] In the embodiment of the present application, after the second application is exited, the relationship between each application scenario and the corresponding offset will also be released in the memory. For example, the offset OFFSET1 in the above office scenario is 轻1 、OFFSET1 中1 , and the offset OFFSET1 in the browser scenario 轻2 、OFFSET1 中2 When the second application is opened again, since the offset is 0, when the load level of the first application is the first level, the initial value of PL1 is the first value; when the load level is the second level, the initial value of PL1 is the second value.
[0242] Restoring the initial preset value of PL1 can prevent the CPU power consumption value corresponding to each application from always being at a high value, thereby reducing the power consumption of the terminal device and improving the performance of the terminal device.
[0243] Optional, in Figure 6On the basis of the corresponding embodiments, it can include: the second application can include a monitoring system performance module, a scene scheduling module, and a CPU power consumption collection module; between the first moment and the second moment, the monitoring system performance module determines that the jamming event is a user-perceivable jamming event; at the second moment, the scene scheduling module sets the CPU power consumption parameter PL1 to a third value; from the second moment onwards, within the first preset time length, the scene scheduling module samples the power consumption of the CPU through the CPU power consumption collection module; at the third moment, the scene scheduling module sets the CPU power consumption parameter PL1 to a fourth value; between the fourth moment and the fifth moment, the monitoring system performance module determines that the jamming event is A user-perceivable freeze event; at the fifth moment, the scene scheduling module sets the CPU power consumption parameter PL1 to the fifth value; from the fifth moment, within the second preset time period, the scene scheduling module samples the CPU power consumption through the CPU power consumption acquisition module; at the sixth moment, the scene scheduling module sets the CPU power consumption parameter PL1 to the sixth value; at the seventh moment, the terminal device exits the first application and opens the first application again. If the load level of the terminal device is the first level, the scene scheduling module sets the CPU power consumption parameter PL1 to the fourth value; if the load level of the terminal device is the second level, the scene scheduling module sets the CPU power consumption parameter PL1 to the sixth value.
[0244] In the embodiment of the present application, the monitoring system performance module of the second application can obtain the jamming event in the terminal device system and report the jamming event to the scene scheduling module. The scene scheduling module can identify the application scenario of the terminal device, and can also obtain the load condition of the terminal device, and determine the CPU power consumption parameter PL1 that meets the actual operation of the terminal device in combination with the load condition of the terminal device. The CPU power consumption acquisition module can obtain the CPU power consumption value and report the CPU power consumption value to the scene scheduling module.
[0245] The second application sets the appropriate CPU power consumption value for different application scenarios through the mutual coordination of different modules, so that the application runs more smoothly, reduces the jamming phenomenon, optimizes the system performance, and improves the user experience.
[0246] Optional, in Figure 6 On the basis of the corresponding embodiment, the monitoring system performance module determines that the freeze event is a user-perceptible freeze event, which may include: when the delay of the freeze event exceeds the third preset duration, the monitoring system performance module determines that the freeze event is a user-perceptible freeze event based on the event identifier Flags.
[0247] The above method can accurately identify user-perceivable jamming events (such as mouse delay, input delay, window unresponsiveness, etc.), and when user-perceivable jamming events occur, the CPU power consumption parameter PL1 can be adjusted to reduce application jamming.
[0248] Optional, in Figure 6 Based on the corresponding embodiments, the types of freezes may include one or more of the following: mouse delay freezes, input delay freezes, and window unresponsive freezes.
[0249] The embodiments of the present application control the power consumption of applications according to the freezes that can be perceived by users, which can reduce the probability of application freezes and improve the user experience.
[0250] Optional, in Figure 6 On the basis of the corresponding embodiment, it may include: when the load level of the terminal device remains unchanged, different application scenarios correspond to different CPU power consumption parameters PL1.
[0251] In the embodiment of the present application, different CPU power consumption parameters PL1 corresponding to different applications can enable each application to have a more appropriate CPU power consumption limit, reduce application jams, and improve user experience.
[0252] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily appreciate that, in combination with the method steps of each example described in the embodiment disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.
[0253] The embodiment of the present application can divide the functional modules of the device for implementing the power consumption control method according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0254] like Figure 8 FIG. 8 is a schematic diagram of a chip structure provided by an embodiment of the present application. The chip 800 includes one or more (including two) processors 801 , a communication line 802 , a communication interface 803 and a memory 804 .
[0255] In some implementations, the memory 804 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.
[0256] The method described in the above embodiment of the present application can be applied to the processor 801, or implemented by the processor 801. The processor 801 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware or software instructions in the processor 801. The above processor 801 can be a general processor (for example, a microprocessor or a conventional processor), a digital signal processor (digital signal processing, DSP), an application specific integrated circuit (application specific integrated circuit, ASIC), a field-programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gates, transistor logic devices or discrete hardware components. The processor 801 can implement or execute the methods, steps and logic block diagrams related to each processing disclosed in the embodiment of the present application.
[0257] The steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. Among them, the software module can be located in a mature storage medium in the field such as a random access memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable read only memory (EEPROM). The storage medium is located in the memory 804, and the processor 801 reads the information in the memory 804 and completes the steps of the above method in combination with its hardware.
[0258] The processor 801 , the memory 804 , and the communication interface 803 may communicate with each other via the communication line 802 .
[0259] In the above embodiments, the instructions stored in the memory for execution by the processor may be implemented in the form of a computer program product, wherein the computer program product may be pre-written in the memory, or may be downloaded and installed in the memory in the form of software.
[0260] The present application embodiment also provides a computer program product including one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated. For example, the available medium may include a magnetic medium (e.g., a floppy disk, a hard disk or a tape), an optical medium (e.g., a digital versatile disc (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
[0261] The present application also provides a computer-readable storage medium. The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. Computer-readable media may include computer storage media and communication media, and may also include any medium that can transfer a computer program from one place to another. The storage medium may be any target medium that can be accessed by a computer.
[0262] As a possible design, the computer readable medium may include a compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disc storage; the computer readable medium may include a magnetic disk storage or other magnetic disk storage device. Moreover, any connection line may also be appropriately referred to as a computer readable medium. For example, if the software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology (such as infrared, radio and microwave), the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disk and disc as used herein include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, where disks usually reproduce data magnetically, while optical discs reproduce data optically using lasers.
[0263] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
Claims
1. A power consumption control method, applied to electronic equipment, It is characterized in that The method comprises: At a first moment, a first application is started, and after the first moment, the CPU power consumption parameter PL1 is a first value; After the first moment, after the first application freezes, at a second moment, the CPU power consumption parameter PL1 is set to a third value, wherein the second moment is later than the first moment, and the third value is greater than the first value; From the second moment, after the first preset time, at a third moment, the CPU power consumption parameter PL1 is set to a fourth value, wherein the fourth value is greater than the first value, and the fourth value is less than the third value.
2. The method according to claim 1, It is characterized in that The fourth value is determined based on the actual power consumption of the CPU within the first preset time period from the second moment.
3. The method according to claim 1 or 2, It is characterized in that The method further comprises: After the third moment, the first application is closed and then started, wherein after starting the first application, the CPU power consumption parameter PL1 is the fourth value.
4. The method according to any one of claims 1 to 3, It is characterized in that The method further comprises: At a fourth moment, the first application is started, and after the fourth moment, the CPU power consumption parameter PL1 is the second value, and the fourth moment is later than the third moment; After the fourth moment, after the first application freezes, at a fifth moment, the CPU power consumption parameter PL1 is set to a fifth value, wherein the fifth moment is later than the fourth moment, and the fifth value is greater than the second value; From the fifth moment, after the second preset time, at a sixth moment, the CPU power consumption parameter PL1 is set to a sixth value, wherein the sixth value is greater than the second value, and the sixth value is less than the fifth value, and between the fourth moment and the sixth moment, the load level of the electronic device is the second level, and between the first moment and the third moment, the load level of the electronic device is the first level; At the seventh moment, the first application is closed and started again. If the load level of the electronic device is the first level, the CPU power consumption parameter PL1 is the fourth value. If the load level of the electronic device is the second level, the CPU power consumption parameter PL1 is the sixth value. The seventh moment is later than the sixth moment.
5. The method according to claim 4, It is characterized in that include: Between the second moment and the third moment, collecting CPU power consumption according to the first sampling period to obtain N CPU power consumption values; Determine a first CPU power consumption adaptation value according to the N CPU power consumption values; Obtaining a first offset, where the first offset is a difference between the first CPU power consumption adaptation value and the first value; Among them, after the third moment, the first application is closed and started again. If the load level of the electronic device is the first level, the CPU power consumption parameter PL1 is the fourth value obtained by summing the first value and the first offset.
6. The method according to claim 5, It is characterized in that include: Between the fifth moment and the sixth moment, collecting CPU power consumption according to the second sampling period to obtain M CPU power consumption values; Determine a second CPU power consumption adaptation value according to the M CPU power consumption values; Obtaining a second offset, where the second offset is a difference between the second CPU power consumption adaptation value and the second value; Among them, after the sixth moment, the first application is closed and started again. If the load level of the electronic device is the second level, the CPU power consumption parameter PL1 is the sixth value obtained by summing the second value and the second offset.
7. The method according to claim 6, It is characterized in that The CPU power consumption parameter PL1 value of the first application is controlled by a second application, the first offset and the second offset are managed by the second application, and the method further includes: When the second application is closed, the first offset and the second offset are both cleared.
8. The method according to claim 7, It is characterized in that include: At an eighth moment, closing the second application, and restarting the second application; the eighth moment is later than the seventh moment; At the ninth moment, the first application is started. When the load level of the electronic device is the first level, the CPU power consumption parameter PL1 is the first value. When the load level of the electronic device is the second level, the CPU power consumption parameter PL1 is the second value. The ninth moment is later than the eighth moment.
9. The method according to claim 7 or 8, It is characterized in that The second application includes a monitoring system performance module, a scene scheduling module, and a CPU power consumption acquisition module; Between the first moment and the second moment, the monitoring system performance module determines that the freeze event is a freeze event perceptible to the user; At the second moment, the scene scheduling module sets the CPU power consumption parameter PL1 to the third value; From the second moment on, within the first preset time, the scene scheduling module samples the power consumption of the CPU through the CPU power consumption collection module; At the third moment, the scene scheduling module sets the CPU power consumption parameter PL1 to the fourth value; Between the fourth moment and the fifth moment, the monitoring system performance module determines that the freeze event is a freeze event perceptible to the user; At the fifth moment, the scene scheduling module sets the CPU power consumption parameter PL1 to the fifth value; From the fifth moment on, within the second preset time, the scene scheduling module samples the power consumption of the CPU through the CPU power consumption collection module; At the sixth moment, the scene scheduling module sets the CPU power consumption parameter PL1 to the sixth value; At the seventh moment, exit the first application and start the first application again. If the load level of the electronic device is the first level, the scene scheduling module sets the CPU power consumption parameter PL1 to the fourth value; if the load level of the electronic device is the second level, the scene scheduling module sets the CPU power consumption parameter PL1 to the sixth value.
10. The method according to any one of claims 1 to 9, It is characterized in that The monitoring system performance module determines that the freeze event is a freeze event that can be perceived by the user, including: When the delay of the freeze event exceeds a third preset duration, the monitoring system performance module determines, based on the event identifier Flags, that the freeze event is a freeze event that is perceptible to the user.
11. The method according to any one of claims 1 to 10, It is characterized in that The types of freeze include one or more of the following: mouse delay freeze, input delay freeze, and window unresponsive freeze.
12. The method according to any one of claims 1 to 11, It is characterized in that When the load level of the electronic device remains unchanged, different application scenarios correspond to different CPU power consumption parameters PL1.
13. An electronic device, It is characterized in that include: A memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program to execute the power consumption control method according to any one of claims 1 to 12.
14. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed, the computer executes the power consumption control method according to any one of claims 1 to 12.
15. A computer program product, It is characterized in that The invention comprises a computer program, and when the computer program is executed, the electronic device executes the power consumption control method according to any one of claims 1 to 12.
