A power consumption control method and related apparatus

By adjusting the CPU power consumption parameter PL1 and sampling power consumption in the terminal device, the stuttering problem caused by low power consumption during multitasking was resolved, improving user experience and system performance.

CN118012691BActive Publication Date: 2025-11-04HONOR DEVICE CO LTD

Patent Information

Application Number
CN202211405854.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-10
Publication Date
2025-11-04
Estimated Expiration
2042-11-10

AI Technical Summary

Technical Problem

When terminal devices handle multiple tasks, power consumption increases, leading to application lag due to excessively low power consumption. Existing power control methods cannot effectively solve the problem of frequent lag.

Method used

When the application experiences lag, the CPU power consumption parameter PL1 is increased to a larger value, and CPU power consumption is sampled within a preset time period to calculate the appropriate CPU power consumption value. PL1 is then adjusted to adapt to the actual load in the application scenario, thereby reducing lag.

Benefits of technology

It improved the smoothness of application operation, reduced lag, enhanced the user experience, and optimized system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118012691B_ABST
    Figure CN118012691B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a kind of power consumption control method and related device, it is related to terminal technical field.The method comprises: terminal equipment opens first application, at first time, CPU power consumption parameter PL1 is first value, and first application appears lag;At second time, CPU power consumption parameter PL1 is third value, wherein, second time is later than first time, and third value is greater than first value;From second time, after first preset time length, at third time, CPU power consumption parameter PL1 is fourth value, wherein, fourth value is greater than first value, and fourth value is less than third value, between first time and third time, load level is first level;Terminal equipment exits first application, and opens first application again, if the load level of terminal equipment is first level, then CPU power consumption parameter PL1 is fourth value.In this way, by adjusting CPU power consumption parameter PL1 for application, application lag can be reduced, and user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of terminal, and particularly relates to a power consumption control method and related device. BACKGROUND

[0002] With the improvement of terminal device performance, the terminal device can process tasks in multiple applications at the same time, resulting in higher and higher power consumption of the terminal device. In order to limit power consumption, the terminal device often needs to reduce the power consumption of some applications during operation. However, too low power consumption of the application may make the application prone to freezing, and even the freezing cannot be recovered, reducing the user experience.

[0003] In some implementations, when the 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 have frequent freezing. SUMMARY

[0004] Embodiments of the present application provide a power consumption control method and related device. When the foreground application of Windows freezes, the terminal device can increase the PL1 of the application scene to a larger value within a preset time period, and within the preset time period, the CPU can be sampled for power consumption to obtain an actual CPU power consumption value, and the adaptive CPU power consumption value within the preset time period can be calculated according to the sampled CPU power consumption value. The adaptive CPU power consumption value may, for example, include an average CPU power consumption value or some values near the average CPU power consumption value. Further, the terminal device can set the PL1 of the application scene to the adaptive CPU power consumption value, so that the user is more smooth when operating in the application scene, reducing the freezing phenomenon, optimizing the system performance, and improving the user experience.

[0005] In a first aspect, embodiments of the present application provide a power consumption control method, the method comprising:

[0006] The terminal device opens a first application. When a load level of the terminal device is a first level, a CPU power consumption parameter PL1 is a first value, and when the load level of the terminal device is a second level, the CPU power consumption parameter PL1 is a second value. At a first time, the CPU power consumption parameter PL1 is the first value, and the first application is stuck. At a second time, the CPU power consumption parameter PL1 is a third value, the second time is later than the first time, and the third value is greater than the first value. After a first preset time period from the second time, at a third time, the CPU power consumption parameter PL1 is a fourth value, the fourth value is greater than the first value, and the fourth value is less than the third value. Between the first time and the third time, the load level is the first level. At a fourth time, the CPU power consumption parameter PL1 is the second value, and the first application is stuck. At a fifth time, the CPU power consumption parameter PL1 is a fifth value, the fifth time is later than the fourth time, and the fifth value is greater than the second value. After a second preset time period from the fifth time, at a sixth time, the CPU power consumption parameter PL1 is a sixth value, the sixth value is greater than the second value, and the sixth value is less than the fifth value. Between the fourth time and the sixth time, the load level is the second level. At a seventh time, 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 time is later than the sixth time. In this way, the application can adapt to a more appropriate CPU power consumption parameter PL1 when stuck, so that the user is more fluent when operating in the application scenario, the phenomenon of sticking is reduced, the system performance is optimized, and the user experience is improved.

[0007] In a possible implementation, between the second time and the third time, the CPU power consumption is collected according to a first sampling period to obtain N CPU power consumption values. A first CPU power consumption adaptation value is determined according to the N CPU power consumption values. A first offset is obtained, and the first offset is a difference between the first CPU power consumption adaptation value and the first value. After the third time, 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 a fourth value obtained by summing the first value and the first offset. In this way, the terminal device can obtain different CPU power consumption adaptation values corresponding to different applications when the load level is the first level by sampling the actual CPU power consumption. During application running, the value of the CPU power consumption parameter PL1 is improved, so that each application can have a more appropriate CPU power consumption limit value, the sticking of the application is reduced, and the user experience is improved.

[0008] In a possible implementation, between the fifth time and the sixth time, 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 a difference between the second CPU power consumption adaptation value and the second value; after the sixth time, 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 a sixth value obtained by summing the second value and the second offset. In this way, the terminal device can obtain different CPU power consumption adaptation values corresponding to different applications when the load level is the second level by sampling the actual CPU power consumption, so that each application can have a more appropriate CPU power consumption limit value, reduce application lag, and improve user experience.

[0009] In a 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 can further 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 application range of the method is relatively wide, and the method has universal applicability, so that the CPU power consumption of each application in the terminal device can be more conveniently controlled and managed, and the performance of the terminal device is improved.

[0010] In a possible implementation, at the eighth time, the terminal device exits the second application and opens the second application again; the eighth time is later than the seventh time; at the ninth time, the terminal device opens the first application, and 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 time is later than the eighth time. In this way, restoring the initial preset value of PL1 can prevent the CPU power consumption values corresponding to each application from being always at a high value, so that the power consumption of the terminal device can be reduced, and the performance of the terminal device is improved.

[0011] In a possible implementation, the second application can include a system performance monitoring module, a scenario scheduling module, and a CPU power consumption acquisition module; between the first time and the second time, the system performance monitoring module determines that the freezing event is a user-perceptible freezing event; at the second time, the scenario scheduling module sets the CPU power consumption parameter PL1 to a third value; from the second time, within a first preset time length, the scenario scheduling module performs power sampling on the CPU through the CPU power consumption acquisition module; at the third time, the scenario scheduling module sets the CPU power consumption parameter PL1 to a fourth value; between the fourth time and the fifth time, the system performance monitoring module determines that the freezing event is a user-perceptible freezing event; at the fifth time, the scenario scheduling module sets the CPU power consumption parameter PL1 to a fifth value; from the fifth time, within a second preset time length, the scenario scheduling module performs power sampling on the CPU through the CPU power consumption acquisition module; at the sixth time, the scenario scheduling module sets the CPU power consumption parameter PL1 to a sixth value; at the seventh time, the terminal device exits the first application and opens the first application again, if the load level of the terminal device is a first level, the scenario scheduling module sets the CPU power consumption parameter PL1 to the fourth value; if the load level of the terminal device is a second level, the scenario scheduling module sets the CPU power consumption parameter PL1 to the sixth value. In this way, the second application sets the adaptive CPU power consumption value for different application scenarios through the mutual coordination of different modules, so that the application runs more smoothly, reduces the freezing phenomenon, optimizes the system performance, and improves the user experience.

[0012] In a possible implementation, the system performance monitoring module determines that the freezing event is a user-perceptible freezing event can include: when the time delay of the freezing event exceeds a third preset time length, the system performance monitoring module determines that the freezing event is a user-perceptible freezing event according to event identification Flags. In this way, the user-perceptible freezing event can be accurately identified, and the CPU power consumption parameter PL1 can be adjusted when the user-perceptible freezing event occurs, reducing the freezing of the application.

[0013] In a possible implementation, the freezing type of the freezing can include one or more of the following: mouse delay freezing, input delay freezing, window unresponsive freezing. In this way, the application power consumption control for the user-perceptible freezing can reduce the probability of application freezing and improve the user experience.

[0014] In a possible implementation, when the load level of the terminal device does not change, 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 suitable CPU power consumption limit, reduce the freezing of the application, and improve the user experience.

[0015] In a second aspect, an apparatus for power consumption control is provided. The apparatus can be a terminal device, or a chip or chip system in the terminal device. The apparatus can include a processing unit. The processing unit is configured to implement any method described in the first aspect or any possible implementation of the first aspect. When the apparatus is a terminal device, the processing unit can be a processor. The apparatus can further include a storage unit, which can be a memory. The storage unit is configured to store instructions. The processing unit is configured to execute the instructions stored in the storage unit to cause the terminal device to implement any method described in the first aspect or any possible implementation of the first aspect. When the apparatus is a chip or chip system in the terminal device, the processing unit can be a processor. The processing unit is configured to execute the instructions stored in the storage unit to cause the terminal device to implement any method described in the first aspect or any possible implementation of the first aspect. The storage unit can be a storage unit (e.g., a register, a cache, etc.) in the chip, or a storage unit (e.g., a read-only memory, a random access memory, etc.) in the terminal device and located outside the chip.

[0016] In a possible implementation, the processing unit is configured to set the CPU power consumption parameter PL1 for the application.

[0017] In a possible implementation, the processing unit is configured to collect the CPU power consumption according to the first sampling period to obtain N CPU power consumption values, and determine the first CPU power consumption adaptation value according to the N CPU power consumption values, and specifically obtain the first offset.

[0018] In a possible implementation, the processing unit is configured to collect the CPU power consumption according to the second sampling period to obtain M CPU power consumption values, and determine the second CPU power consumption adaptation value according to the M CPU power consumption values, and specifically obtain the second offset.

[0019] In a possible implementation, the processing unit is configured to clear the first offset and the second offset when the second application exits.

[0020] In a possible implementation, the processing unit is configured to set the CPU power consumption parameter PL1 for the application when the terminal device exits the second application and opens the second application again.

[0021] In a possible implementation, the processing unit is configured to determine that the freezing event is a user-perceptible freezing event, and 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. The processing unit is further configured to perform power sampling on the CPU by using the CPU power consumption sampling module.

[0022] In a possible implementation, the processing unit is configured to determine that the freezing event is a user-perceptible freezing event according to the event identifier Flags when the time delay of the freezing event exceeds a third preset time length.

[0023] In a possible implementation, the freezing type of the freezing event can include one or more of the following: mouse delay freezing, input delay freezing, and window unresponsive freezing.

[0024] In a possible implementation, different CPU power consumption parameters PL1 correspond to different application scenarios when the load level of the terminal device is unchanged.

[0025] In a third aspect, an embodiment of the present application provides a terminal device, including a processor and a memory. The memory is configured to store code instructions, and the processor is configured to run the code instructions to perform the power consumption control method described in the first aspect or any possible implementation of the first aspect.

[0026] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores a computer program or instructions. When the computer program or instructions run on a computer, the computer program or instructions make the computer perform the power consumption control method described in the first aspect or any possible implementation of the first aspect.

[0027] 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 program makes the computer perform the power consumption control method described in the first aspect or any possible implementation of the first aspect.

[0028] 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 through a line. The at least one processor is configured to run a computer program or instructions to perform the power consumption control method described in the first aspect or any possible implementation of the first aspect. The communication interface in the chip can be an input / output interface, a pin, or a circuit, etc.

[0029] In a possible implementation, the chip or the chip system described above in the application further includes at least one memory in which instructions are stored. The memory can be a storage unit inside the chip, for example, a register, a cache, etc., or a storage unit of the chip (for example, a read-only memory, a random access memory, etc.).

[0030] It should be understood that the second aspect to the sixth aspect of the application correspond to the technical solution of the first aspect of the application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation manner are similar, which will not be described again. BRIEF DESCRIPTION OF DRAWINGS

[0031] Figure 1 A structural schematic diagram of a terminal device provided by an embodiment of the application is shown in FIG. 1.

[0032] Figure 2 A software structural schematic diagram of a terminal device provided by an embodiment of the application is shown in FIG. 2.

[0033] Figure 3 A scheme framework schematic diagram of a power consumption control method provided by an embodiment of the application is shown in FIG. 3.

[0034] Figure 4 A flow schematic diagram of a power consumption control method in an office scenario provided by an embodiment of the application is shown in FIG. 4.

[0035] Figure 5 A flow schematic diagram of a power consumption control method in a browser scenario provided by an embodiment of the application is shown in FIG. 5.

[0036] Figure 6 A schematic diagram of a specific power consumption control method provided by an embodiment of the application is shown in FIG. 6.

[0037] Figure 7 A numerical change schematic diagram of adjusting a CPU power consumption parameter PL1 provided by an embodiment of the application is shown in FIG. 7.

[0038] Figure 8 A structural schematic diagram of a chip provided by an embodiment of the application is shown in FIG. 8. DETAILED DESCRIPTION

[0039] In order to clearly describe the technical solutions of the embodiments of the application, the following briefly introduces some terms and technologies involved in the embodiments of the application:

[0040] 1、PL1: PL is a power limit, PL1 can represent a functional loss limit of a central processing unit (CPU), also referred to as a CPU power consumption limit or a CPU power consumption parameter. Because different application scenarios have different CPU power consumptions, each application scenario can correspond to its own CPU power consumption parameter PL1. The CPU power consumption of an application in each application scenario cannot exceed the CPU power consumption parameter PL1 of the application scenario, where the CPU power consumption parameter PL1 can also be referred to as PL1.

[0041] 2、Load level and PL1: According to CPU and other performance data of a terminal device, 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; and 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 the present application.

[0042] According to different load levels of a terminal device, different application scenarios can set different initial values of PL1 under different load levels.

[0043] For example, when the application scenario is A, the initial values of PL1 corresponding to different load levels can be different. For example, when the terminal device is in light load, the initial value of PL1 corresponding to the application scenario A can be A1; when the terminal device is in medium load, the initial value of PL1 corresponding to the application scenario A can be A2; and when the terminal device is in heavy load, the initial value of PL1 corresponding to the application scenario A can be A3, where A1 is less than A2, and A2 is less than A3.

[0044] For example, when the application scenario is B, the initial values of PL1 corresponding to different load levels can be different. For example, when the terminal device is in light load, the initial value of PL1 corresponding to the application scenario B can be B1; when the terminal device is in medium load, the initial value of PL1 corresponding to the application scenario B can be B2; and when the terminal device is in heavy load, the initial value of PL1 corresponding to the application scenario B can be B3, where B1 is less than B2, and B2 is less than B3.

[0045] The specific relationship between the load level of a terminal device and the initial value of PL1 corresponding to an application scenario can be as shown in Table 1.

[0046] Table 1

[0047]

[0048] 3. IPC message: is the message of inter process communication (IPC), which can transmit messages between two processes.

[0049] 4. Terms

[0050] In the embodiments of the present application, the same items or similar items with basically the same functions and effects are distinguished by using "first", "second", and the like. For example, the first chip and the second chip are merely used to distinguish different chips, and do not limit the sequence. Those skilled in the art can understand that "first", "second", and the like do not limit the quantity and execution sequence, and "first", "second", and the like do not necessarily mean different.

[0051] It should be noted that in the embodiments of the present application, "exemplary" or "for example" is used to represent an example, illustration, or description. Any embodiment or design scheme described as "exemplary" or "for example" in the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, "exemplary" or "for example" is used to present the relevant concept in a specific manner.

[0052] In the embodiments of the present application, "at least one" means one or more, and "multiple" means two or more. "And / or" describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the following three cases: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after it. "At least one of the following" or the like means any combination of these items, including any combination of single item or multiple items. For example, at least one of a, b, or c can represent a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple.

[0053] 5. Terminal device

[0054] The terminal device of the embodiments of the present application can also be any form of electronic device. For example, the electronic device can include a handheld device, a vehicle-mounted device, etc. For example, some electronic devices are: a mobile phone, a tablet computer, a palm computer, a notebook computer, a mobile internet device (MID), a wearable device, a virtual reality (VR) device, an augmented reality (AR) device, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), an access terminal, a subscriber unit, a subscriber station, a mobile station, a remote station, a remote terminal, a mobile device, a terminal, a wireless communication device, a user agent, or a user equipment cellular phone, a cordless phone, a session initiation protocol (SIP) phone, a wireless local loop (WLL) station, a personal digital assistant (PDA), a handheld device with wireless communication function, a computing device, or other processing device connected to a wireless modem, a vehicle-mounted device, a wearable device, a terminal device in a 5G network, or a terminal device in a future evolved public land mobile network (PLMN), etc. The embodiments of the present application are not limited thereto.

[0055] As an example but not limitation, in embodiments of the present application, the terminal device can also be a wearable device. The wearable device can also be referred to as a wearable smart device, which is a general term for devices that are designed and developed by applying wearable technology to daily wear, such as glasses, gloves, watches, clothing, and shoes. The wearable device is a portable device that is directly worn on the body or integrated into the clothes or accessories of the user. The wearable device is not only a hardware device, but also a powerful function achieved through software support and data interaction, cloud interaction. The general wearable smart device includes a full function, large size, and can realize complete or partial functions without relying on a smart phone, such as a smart watch or smart glasses, and focuses on a certain application function, and needs to cooperate with other devices such as a smart phone, such as various smart wristbands, smart jewelry, and the like.

[0056] In addition, in embodiments of the present application, the terminal device can also be a terminal device in an Internet of Things (IoT) system. The IoT is an important part of the future information technology development, and its main technical feature is to connect objects through communication technology and network, so as to realize the intelligent network of man-machine interconnection and object-object interconnection.

[0057] In embodiments of the present application, the 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 CPU, memory management unit (MMU), and memory (also referred to as main memory) and the like. The operating system can be any one or more computer operating systems that realize business processing through processes, such as Linux operating system, Unix operating system, Android operating system, iOS operating system, or windows operating system, and the like. The application layer includes a browser, an address book, a word processing software, an instant messaging software, and the like.

[0058] Exemplarily, Figure 1 A structural schematic diagram of the terminal device is shown.

[0059] The terminal device can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charge 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, an earphone interface 170D, a key 190, an indicator 192, a camera 193, and a display screen 194, and the like.

[0060] It can be understood that the structural schematic of the embodiments of the present application does not constitute a specific limitation on the terminal device. In other embodiments of the present application, the terminal device can include more or fewer components than the schematic, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.

[0061] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices, or can be integrated in one or more processors. The controller can be the nerve center and command center of the terminal device. The controller can generate operation control signals according to instruction operation codes and timing signals, complete the control of fetching instructions and executing instructions.

[0062] The processor 110 can 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 can save instructions or data that the processor 110 has just used or repeatedly uses. If the processor 110 needs to use the instructions or data again, it can directly call from the above-mentioned memory. Avoiding repeated access, reducing the waiting time of the processor 110, thus improving the efficiency of the system.

[0063] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a USB interface, etc.

[0064] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a limitation on the structure of the terminal device. In some other embodiments of the present application, the terminal device can also use different interface connection modes or a combination of multiple interface connection modes in the above embodiments.

[0065] 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 realize the data storage function. For example, music, video, and other files are saved in the external memory card.

[0066] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 can include a program storage area and a data storage area. The program storage area can store an operating system, application programs required by at least one function (such as a sound playing function, an image playing function, etc.), and the like. The data storage area can store data created during use of the terminal device (such as audio data, a phone book, etc.), and the like. In addition, the internal memory 121 can include a high-speed random access memory, and can also include a non-volatile memory, for example, at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like. The processor 110 executes various function applications and data processing of the terminal device by running instructions stored in the internal memory 121 and / or instructions stored in a memory disposed in the processor. For example, in the embodiments of the present application, the processor can cause the terminal device to perform the power consumption control method provided by the embodiments of the present application by running instructions stored in the internal memory.

[0067] The USB interface 130 is an interface conforming to the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 can be used to connect a charger to charge the terminal device, and can also be used to transmit data between the terminal device and a peripheral device. The interface can also be used to connect a headset to play audio through the headset. The interface can also be used to connect other terminal devices, such as an AR device, and the like.

[0068] 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. The charging management module 140 can charge the battery 142, and can also supply power to the terminal device through the power management module 141.

[0069] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to supply power to the processor 110, the internal memory 121, the external memory interface 120, the display screen 194, and the wireless communication module 160, and the like. In some embodiments, the power management module 141 and the charging management module 140 can also be disposed in the same device.

[0070] The wireless communication module 160 can provide solutions for wireless communication 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 (NFC), infrared (IR) technology, and the like, which are applied on the terminal device.

[0071] The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via an antenna, frequency-modulates and filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 can also receive signals to be transmitted from the processor 110, frequency-modulate them, amplify them, and radiate them as electromagnetic waves via an antenna.

[0072] The terminal device can implement display functions through a GPU, a display screen 194, and an application processor, and the like. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information. The terminal device can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor, and the like.

[0073] The terminal device can implement audio functions such as audio playing or recording through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, and an application processor, and the like.

[0074] The audio module 170 is configured to convert digital audio information into analog audio signals and to convert analog audio input into digital audio signals. The speaker 170A, also known as a "loudspeaker", is configured to convert audio electrical signals into sound signals. The terminal device can include one or N speakers 170A, where N is a positive integer greater than one. The terminal device can listen to music, videos, or hands-free calls, etc. through the speaker 170A. The microphone 170B, also known as a "receiver", is configured to convert audio electrical signals into sound signals. When the terminal device is on a call or receiving a voice message, the user can hold the receiver 170B close to the ear to listen to the voice. The microphone 170C, also known as a "microphone" or "microphone", is configured to convert sound signals into electrical signals. The earphone interface 170D is configured to connect a wired earphone.

[0075] The keys 190 include a power key, a volume key, etc. The keys 190 can be mechanical keys or touch keys. The terminal device can receive key inputs and generate key signal inputs related to user settings and function controls of the terminal device.

[0076] The indicator 192 can be an indicator light, which can be used to indicate the charging status, the power change, etc.

[0077] The camera 193 is configured to capture still images or videos. In some embodiments, the terminal device can include one or N cameras 193, where N is a positive integer greater than one.

[0078] The display screen 194 is configured to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the terminal device can include one or N display screens 194, where N is a positive integer greater than one. The terminal device implements the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor.

[0079] The software system of the terminal device described above can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiment of the present application takes the Windows system with a layered architecture as an example to exemplarily illustrate the software structure of the terminal device.

[0080] Figure 2 is a software structure block diagram of the terminal device of the embodiment of the present application.

[0081] The layered architecture divides software into several layers, each of which has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Windows system is divided into user mode and kernel mode. Among them, the user mode includes the application layer and the subsystem dynamic link library. The kernel mode is divided into executors, kernels and device drivers from top to bottom, and a hardware abstraction layer (HAL), etc.

[0082] As shown in Figure 2 , the application layer includes computer manager, office, browser, social, music, video, game, etc. Application programs. Application programs can include system applications and third-party applications. The application layer can also include an environment subsystem, which can display some subsets of basic executor system services to application programs in a specific form, providing an execution environment for application programs. Among them, in the computer manager application in the embodiment of the present application, the system performance monitoring module, the scene scheduling module, and the CPU power consumption acquisition module, etc. can be included.

[0083] The system performance monitoring module can include a stall detection module, which can obtain stall events in the terminal device system and report the stall events to the scene scheduling module.

[0084] The scene scheduling module can 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 matched with the application scenario. The scheduling module can obtain the load condition of the terminal device, and determine the actual scheduling strategy conforming to the actual running condition of the terminal device in combination with the load condition of the terminal device and the above basic scheduling strategy. In addition, the scene scheduling module can also obtain the CPU power consumption value from the CPU power consumption acquisition module.

[0085] The CPU power consumption acquisition module can obtain the CPU power consumption value and report it to the scene scheduling module.

[0086] The subsystem dynamic link library can include an application programming interface (API) module, which includes a Windows API, a Windows native API, and the like. The Windows API and the Windows native API can both provide system call entry and internal function support for an application, with the difference being that the Windows native API is an API native to the Windows system. For example, the Windows API can include user.dll and kernel.dll, and the Windows native API can include ntdll.dll. The user.dll is a Windows user interface interface and can be used to perform operations such as creating a window and sending a message. The kernel.dll is used to provide an application with an interface for accessing a kernel. The ntdll.dll is an important Windows NT kernel-level file. When Windows starts, the ntdll.dll resides in a specific write-protected area of memory, so that other programs cannot occupy this memory area.

[0087] The executive can 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.

[0088] The process manager is used to create and abort processes and threads.

[0089] The virtual memory manager implements "virtual memory". The virtual memory manager also provides basic support for the cache manager.

[0090] The I / O manager performs device-independent input / output and further processes to call appropriate device drivers.

[0091] The power manager can manage power state changes of all devices that support power state changes.

[0092] The system event driver node can interact with the kernel and the driver layer, for example, interacting with a graphics card driver, and after determining that there is a GPU video decoding event, reporting the GPU video decoding event to the scene recognition engine.

[0093] The kernel and the driver layer include a kernel and a device driver.

[0094] The kernel is an abstraction of the processor architecture, which isolates the executive from the differences in processor architecture and ensures the portability of the system. The kernel can perform thread scheduling and scheduling, trap processing and exception scheduling, interrupt processing and scheduling, and the like.

[0095] Device drivers run in kernel mode and provide an interface between the I / O system and the associated hardware. Device drivers can include graphics card drivers, audio drivers, video drivers, camera drivers, keyboard drivers, and so on.

[0096] HAL is a kernel-mode module that hides various hardware-related details, such as I / O interfaces, interrupt controllers, and multiprocessor communication mechanisms, and provides a uniform 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, internal components of Windows and device drivers written by users do not directly access hardware, but call routines in HAL.

[0097] It should be noted that the embodiments of the present application are only exemplified by the Windows system, and in other operating systems (such as the Android system, the IOS system, etc.), as long as the functions of each functional module are similar to the embodiments of the present application, the scheme of the present application can also be achieved.

[0098] With the improvement of the performance of the terminal device, the terminal device can process tasks in multiple applications at the same time, resulting in higher and higher power consumption of the terminal device. In order to limit the power consumption, the terminal device often needs to reduce the power consumption of some applications during running. However, too low power consumption of the application may cause the application to easily appear to be stuck, or even appear to be stuck and cannot be recovered, reducing the user experience.

[0099] In some implementations, a management application in the terminal device can control the power consumption of the application. The management application may, for example, include a computer housekeeper application, a security management application, and the like. For ease of description, the computer housekeeper application controlling the power consumption is taken as an example for description hereinafter.

[0100] For example, the computer housekeeper application in the terminal device can be preset with the PL1 initial value of each application scenario in the terminal device. When each application is running, the computer housekeeper application can control the PL1 of each application scenario to be the PL1 initial value of each application scenario at 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 appear to be stuck when running at a small PL1 initial value. When an application appears to be stuck, the terminal device can increase the PL1 value of the application scenario according to the indication of the computer housekeeper application within a preset time period, so that the application runs in a high-performance state, reducing the application's stuck. After the end of the preset time period, the PL1 of the application scenario can return to the PL1 initial value of the application scenario.

[0101] For example, Figure 3In the original scheme, when the computer manager application detects that an application in the foreground of Windows is stuck, the computer manager application sends a stuck event message to the scene scheduling module. The scene scheduling module increases the PL1 of the application scene to a large 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 returns to the initial value of the PL1 of the application scene.

[0102] However, in the above implementation, because the PL1 of the application scene returns to the initial value of the PL1 of the application scene after the preset time period, the application may still be stuck frequently in subsequent running.

[0103] Therefore, the power consumption control method provided in the embodiments of the present application is as follows. Figure 3 In the optimization scheme, when the computer manager application detects that an application in the foreground of Windows is stuck, the scene scheduling module increases the PL1 of the application scene to a large value within a preset time period. During the preset time period, the scene scheduling module can collect the power consumption of the CPU through the CPU power consumption collection module to obtain an actual CPU power consumption value, and calculate an adaptive CPU power consumption value in the preset time period according to the sampled CPU power consumption value. The adaptive CPU power consumption value may include, for example, an average CPU power consumption value or some values around the average CPU power consumption value. Then, the scene scheduling module sets the PL1 of the application scene to the adaptive CPU power consumption value, so that the user can operate more smoothly in the application scene, the phenomenon of sticking is reduced, the system performance is optimized, and the user experience is improved.

[0104] In the embodiments of the present application, the computer manager application can set different initial values of PL1 for different application scenes. The application scenes may include, for example, an office scene, a browser scene, a video playing scene, a conference scene, a game scene, and a social scene.

[0105] The applications in the terminal device can be pre-divided into corresponding application scenes. For example, the office scene can include a scene of using an office document application, a scene of using a power point (PPT) application, or a scene of using an excel table application. The browser scene can include a scene of using various browser applications. When the terminal device identifies the application scene, the terminal device can determine the application scene to which the application belongs based on the identification of the application running in the foreground of the terminal device.

[0106] The power consumption control method provided in the embodiments of the present application will be described in detail below in combination with two different application scenes. For example, scene one can be an office scene, and scene two can be a browser scene.

[0107] Scenario one: office scenario.

[0108] When the user opens a certain office application, the scenario scheduling module of the computer manager application can obtain the current load condition of the terminal device, and according to the load condition, the load level can be determined. The specific way of determining the load level can refer to the related description of the load level above, and will not be repeated. In addition, the scenario scheduling module can obtain the initial value of PL1 in the office scenario according to the different load levels.

[0109] For example, when the terminal device is in a light load condition, the initial value of PL1 in the office scenario can be 9W; when the terminal device is in a medium load condition, the initial value of PL1 in the office scenario can be 15W; and when the terminal device is in a heavy load condition, the initial value of PL1 in the office scenario can be 35W. Wherein, the initial value of PL1 in the office scenario can be set by the computer manager application according to the experience 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 condition is less than the initial value of PL1 in the medium load condition, and the initial value of PL1 in the medium load condition is less than the initial value of PL1 in the heavy load condition, the present application embodiment does not make specific limitation to the initial value of PL1 in each load condition.

[0110] For example, when the terminal device is in a light load condition, the initial value of PL1 in the office scenario can be 9W; when the terminal device is in a medium load condition, the initial value of PL1 in the office scenario can be 15W; and when the terminal device is in a heavy load condition, the initial value of PL1 in the office scenario can be 35W. Wherein, the initial value of PL1 in the office scenario can be set by the computer manager application according to the experience 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 condition is less than the initial value of PL1 in the medium load condition, and the initial value of PL1 in the medium load condition is less than the initial value of PL1 in the heavy load condition, the present application embodiment does not make specific limitation to the initial value of PL1 in each load condition. Figure 4 The schematic diagram of the power consumption control method in the office scenario is shown.

[0111] S401, frame freezing event monitoring.

[0112] During the running of the office application in the foreground of Windows, frame freezing may occur, and frame freezing may occur frequently. At this time, the frame freezing detection module in the computer manager application can obtain the frame freezing event reported by the office application to the terminal device. In a possible implementation, the frame freezing detection module can receive the frame freezing event by subscribing to the event tracing (event tracing for Windows, ETW) of the terminal device. The frame freezing event monitored by the frame freezing detection module can include 35 / 37 / 38 / 173 events in the Windows system.

[0113] S402, frame freezing event content analysis.

[0114] After the caton detection module listens to the caton event, the caton event can be reported to the listening system performance module in the computer housekeeper application. The listening system performance module can analyze the content of the caton event to obtain the caton delay and the event identifier Flags for filtering whether the caton is perceptible to the user. The user-perceptible caton event can include mouse delay, input delay, window unresponsive event, and the like.

[0115] S403, whether the caton delay is greater than a preset caton duration.

[0116] The listening system performance module can filter the caton event based on the caton delay. For example, the listening system performance module can determine the event with the caton delay greater than the preset caton duration as a candidate caton event and continue to perform step S404; and for the event with the caton delay less than or equal to the preset caton duration, no processing is performed. The preset caton duration can be set according to an empirical preset value obtained by analyzing data, for example, the preset caton duration can be 3 seconds, and the specific value of the preset caton duration is not limited in the embodiments of the present application.

[0117] S404, determining whether the caton event is perceptible to the user according to the Flags.

[0118] In the embodiments of the present application, if the listening system performance module determines that the caton delay of the caton event exceeds the preset caton duration (for example, 3 seconds) and the caton event is a foreground process or the caton event is a process with user input operation, it can be considered that the caton event is perceptible to the user.

[0119] In a possible implementation of determining the user-perceptible caton event, the listening system performance module can filter whether the caton event is perceptible to the user according to the event identifier Flags of the user-perceptible caton. For example, the listening system performance module can perform an AND (&) operation on the user-perceptible event identifier Flags value and 0xCE0, and determine whether the current caton event is perceptible to the user according to the result of the AND operation. For example, if the Flags value & 0xCE0 > 0 and the caton delay > the preset caton duration (for example, 3 seconds), it is considered that the caton event is perceptible to the user. The 0xCE0 can be an empirical value obtained by multiple tests, and the value of 0xCE0 is not limited in the embodiments of the present application.

[0120] S405, generating the caton event content.

[0121] If the listening system performance module determines that the caton event is perceptible to the user, the caton event content can be further generated.

[0122] S406, encapsulating the caton IPC message.

[0123] The monitoring system performance module can encapsulate the content of the generated stutter event into an IPC message. In turn, the monitoring system performance module can report the stutter IPC message to the scene scheduling module in the computer housekeeper application.

[0124] S407, receiving the stutter IPC message.

[0125] The scene scheduling module can receive the stutter IPC message reported by the monitoring system performance module and continue to perform step S408.

[0126] S408, whether the office scene is in a stutter scene.

[0127] After receiving the stutter IPC message, the scene scheduling module can determine whether the current office scene is in a stutter scene according to the stutter state value. If the current office scene is in a stutter scene, it means that the current office scene is in a PL1 high performance state locked for a preset stutter duration, and the scene scheduling module does not process the stutter IPC message. If the current office scene is not in a stutter scene, the scene scheduling module can consider that the received stutter IPC message needs to be processed, and then perform step S409. The stutter state value can be of a data type such as a Boolean type, an integer type, or a string type. For example, the stutter state value when in a stutter scene can be set to true, and the stutter state value when not in a stutter scene can be set to false. The specific setting method of the stutter state value is not limited in the embodiments of the present application.

[0128] S409, setting the office scene as a stutter scene, setting the stutter state value, issuing the stutter strategy parameter, and setting PL1 to a large value.

[0129] When it is determined that the office scene is not in a stutter scene, the scene scheduling module can set the current office scene as a stutter scene, generate a strategy parameter corresponding to the stutter event, and set a stutter state value, for example, the stutter state value can be set to true. The stutter strategy parameter can be a CPU power consumption parameter PL1. Since the stutter event strategy parameter is used to improve the performance of the CPU, PL1 can be set to a large value, for example, the large value of PL1 can be 35W. It can be understood that PL1 can also be a preset maximum value. The large value of PL1 can be set according to the experience preset value obtained by analyzing the data, and the specific large value of PL1 is not limited in the embodiments of the present application.

[0130] Further, the scene scheduling module can issue a larger value of the PL1 corresponding to the frame freezing event to the underlying chip, and the underlying chip can adjust the PL1 from an initial value to the larger value, where the larger value of the PL1 is greater than the initial value of the PL1. For example, the initial value of the PL1 before adjustment in the office scenario can be 9W, and the larger value of the PL1 after adjustment can be 35W. In this way, the increase in the value of the PL1 can improve the performance of the CPU, thereby reducing the frame freezing event.

[0131] S410, a timer with a preset time duration is created, and the value of the PL1 is not modified within the preset time duration.

[0132] When the scene scheduling module issues the policy parameter corresponding to the frame freezing event, the scene scheduling module can create and start a timer, and set the time duration of the timer to be the preset time duration. The preset time duration can be set according to an experience preset value obtained by analyzing data, for example, the preset time duration can be 5 minutes, and the specific value of the preset time duration is not limited in the embodiments of the present application.

[0133] It can be understood that within the preset time duration, the scene scheduling module no longer issues a new policy parameter, that is, within the preset time duration (for example, 5 minutes), the scene scheduling module no longer modifies the value of the PL1, so that the PL1 is locked at the larger value and remains unchanged. In this way, the PL1 can be kept 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 frame freezing.

[0134] S411, the actual CPU power consumption is collected.

[0135] Within the preset time duration (for example, 5 minutes), the PL1 is in a frame freezing high-performance parameter state, and at the same time, the scene scheduling module can obtain the actual CPU power consumption from the CPU power consumption collection module to sample the CPU power consumption value within the preset time duration.

[0136] In order to balance the feasibility of the scheme and the system power consumption, the embodiments of the present application select 5 seconds as the sampling period for calculating the average CPU power consumption in the embodiments of the present application after comparing a plurality of sampling periods (for example, the sampling period is set to 1 second, 3 seconds, 5 seconds, or 10 seconds, etc.). The specific sampling period is not limited in the embodiments of the present application.

[0137] S412, whether the timer is overdue.

[0138] If the timer is not overdue, the sampling of the CPU power consumption is continued in step S411. If the timer is overdue, the sampling of the CPU power consumption is ended, and step S413 is executed.

[0139] S413, a first adaptive value and a first offset are calculated.

[0140] After the timer expires, that is, after a preset time length (such as 5 minutes), the scene scheduling module can calculate a first adaptation value of the CPU power consumption in the office scene, where the first adaptation value may include, for example, an average CPU power value AverageCPUPower1 or some values around the average CPU power value. Further, the scene scheduling module can calculate the first adaptation value and the initial value of PL1 in the office scene to obtain a first offset OFFSET 轻1 .

[0141] For example, in the light load case, the first offset OFFSET 轻1 may be the difference between the average CPU power value AverageCPUPower1 and the initial value PL11 of PL1, and the first offset OFFSET 轻1 may satisfy the following formula:

[0142] OFFSET1 轻1 = AverageCPUPower11 - PL11

[0143] It can be understood that the first offset OFFSET 轻1 may also be a preprocessed value, including multiplying the first adaptation value and then calculating the difference with the initial value of PL1, or multiplying the difference between the first adaptation value and the initial value of PL1, and the like. The specific way of calculating the first offset is not limited in the embodiments of the present application.

[0144] The value of the first offset can be saved in an array or other data structure. Taking the value of the first offset saved in the array as an example, the array can be used to save the offsets corresponding to various application scenarios, and the application scenario and the offset can be in a one-to-one relationship. For example, if the office scene can be represented by the SCENE_TYPE_WORKING field, the offset corresponding to the office scene is 8W, and the offset corresponding to the office scene in the array can be represented as {SCENE_TYPE_WORKING, 8}.

[0145] It should be noted that when the scene scheduling module calculates the first offset, the data may not be ideal. For example, the scene scheduling module can consider that the first offset is valid in the interval (0, 10]. Where setting the first offset to be greater than 0 can prevent the first offset from setting the initial value of PL1 to be lower, so that the application is less likely to cause lag. Setting the first offset to be no more than 10 can reduce the high load scenarios where the CPU power consumption is abnormal.

[0146] S414, clear the freezing state value, and re-identify the application scenario.

[0147] When the timer expires, the scene scheduling module can clear the freezing state value, for example, set the freezing state value to false, and re-identify the application scenario. The application scenario can be identified by the scene identification module in the computer manager application. The specific identification method can refer to the description in the implementation of the application scenario identification described above, and will not be described again.

[0148] When the re-identified application scenario is an office scenario, step S415 is executed.

[0149] S415, still in the office scenario, update the PL1 to the adjustment value.

[0150] When it is identified that the application scenario is still an office scenario, if the terminal device is in light load, the scene scheduling module can issue the first adaptation value calculated as the adjustment value of PL1 to the underlying chip, and the underlying chip can modify PL1 from a larger value to the 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, the CPU power consumption of the terminal device can be reduced in the state that PL1 is not too low, and the CPU performance can be improved while reducing the freezing event.

[0151] In the embodiment of the application, in the case of light load, the adjustment value of PL1 can be the sum of the initial value of PL1 and the first offset. It can be understood that when calculating the first offset, if a certain processing is performed on the calculation process of the difference, when calculating the adjustment value of PL1, the corresponding reverse processing calculation can be performed. The process of calculating the adjustment value of PL1 will not be described again in the embodiment of the application.

[0152] It can be understood that in the same application scenario, different load levels can correspond to different offsets. Exemplarily, in the office scenario, if the load level identified in step S415 is medium load, the adjustment value of PL1 can be the sum of the initial value of PL1 corresponding to the medium load and the offset OFFSET1 中1 corresponding to the medium load. That is, the adjustment value of PL1 in the case of medium load cannot be calculated using the offset OFFSET1 轻1 corresponding to the light load. Wherein, if the offset has not been calculated in the medium load office scenario, the value of the offset OFFSET1 中1 corresponding to the medium load can be considered as 0, and in the case of medium load, the adjustment value of PL1 can be the initial value of PL1.

[0153] In the office scenario, if the load level identified in step S415 is heavy load, it can be considered that the CPU power consumption of the terminal device is already relatively large in heavy load, and the PL1 in heavy load can not be adjusted.

[0154] In a possible implementation, if the user exits the office application, when the user opens the office application again, the computer housekeeper application can re-identify the application scenario. When the application scenario is re-identified as the office scenario, step S415 can be performed to update the PL1 to the adjusted value.

[0155] In a possible implementation, if the subsequent jank occurs again in the office scenario, the computer housekeeper application can re-calculate the offset in the office scenario and save it in the array. It can be understood that if the array already stores the value of the offset, the re-calculated value of the offset can overwrite the previous value. For example, when the load level is light load, the re-calculated offset OFFSET1 轻1 may overwrite the value of the existing offset OFFSET1 轻1 corresponding to light load. When the load level is medium load, the re-calculated offset OFFSET1 中1 may overwrite the value of the existing offset OFFSET1 中1 corresponding to medium load.

[0156] After the terminal device is re-identified as the office scenario, the PL1 can be updated to the adjusted value according to the sum of the initial value of PL1 and the offset corresponding to the load level. When calculating the adjusted value of PL1, the initial value corresponding to PL1 can remain unchanged, for example, the initial value of PL1 in light load can remain the preset 9W, and the initial value of PL1 in medium load can remain the preset 15W. The offset corresponding to PL1 can be obtained from the array, that is, the offset corresponding to PL1 is the value calculated and saved last time. The adjusted value of PL1 calculated by the power consumption control method of the embodiment of the present application improves the value of PL1 relative to the initial value of PL1, thereby reducing the possibility of frequent jank in the office scenario.

[0157] Scenario two: browser scenario.

[0158] When the user opens a certain browser application, the scenario scheduling module of the computer housekeeper application can obtain the current load of the terminal device, and determine the load level according to the load. The specific way of determining the load level can refer to the related description of the load level above, and will not be repeated. In addition, the scenario scheduling module can obtain the initial value of PL1 in the browser scenario according to the different load levels.

[0159] For example, when the terminal device is in light load, the initial value of PL1 in the browser scenario can be 12W; when the terminal device is in medium load, the initial value of PL1 in the browser scenario can be 21W; and when the terminal device is in heavy load, the initial value of PL1 in the browser scenario can be 45W. The initial value of PL1 in the browser scenario can be set by an empirical preset value obtained by the computer manager application according to analysis data, and 12W, 21W and 45W can be replaced by any possible value, as long as the initial value of PL1 in light load is less than that in medium load, and the initial value of PL1 in medium load is less than that in heavy load. The embodiments of the present application do not make specific limitations on the initial value of PL1 in each load.

[0160] For example, when the terminal device is in light load, the initial value of PL1 in the browser scenario can be 12W; when the terminal device is in medium load, the initial value of PL1 in the browser scenario can be 21W; and when the terminal device is in heavy load, the initial value of PL1 in the browser scenario can be 45W. The initial value of PL1 in the browser scenario can be set by an empirical preset value obtained by the computer manager application according to analysis data, and 12W, 21W and 45W can be replaced by any possible value, as long as the initial value of PL1 in light load is less than that in medium load, and the initial value of PL1 in medium load is less than that in heavy load. The embodiments of the present application do not make specific limitations on the initial value of PL1 in each load. Figure 5 A schematic diagram of the power consumption control method in the browser scenario is shown.

[0161] S501, stuttering event monitoring.

[0162] During the running of the browser application in the foreground of Windows, stuttering may occur, and stuttering may occur frequently. At this time, the stuttering detection module in the computer manager application can obtain the stuttering event reported by the browser application to the terminal device. Specifically, the implementation of the stuttering detection module to detect the stuttering event can refer to the above description of the stuttering detection module in the office scenario. Figure 4 The related description in S401 is not repeated.

[0163] S502, stuttering event content analysis.

[0164] In the embodiments of the present application, the implementation of stuttering event content analysis can refer to the above description of stuttering event content analysis in the office scenario. Figure 4 The related description in S402 is not repeated.

[0165] S503, whether the stuttering delay is greater than the preset stuttering duration.

[0166] In the embodiments of the present application, whether the stuttering delay is greater than the preset stuttering duration can refer to the above description of whether the stuttering delay is greater than the preset stuttering duration in the office scenario. Figure 4 The related description in S403 is not repeated. It can be understood that the preset stuttering duration corresponding to the browser scenario and the preset stuttering duration corresponding to the above-mentioned office scenario can be the same or different, for example, the preset stuttering duration can be 4 seconds. The specific value of the preset stuttering duration is not limited in the embodiments of the present application.

[0167] S504, determining whether the stuttering event is user-perceptible according to Flags.

[0168] In the embodiments of the present application, the implementation of determining whether it is a user-perceived freezing event can refer to the above Figure 4 The related description in S404 is not repeated.

[0169] S505, generating freezing event content.

[0170] If the system performance monitoring module determines that the freezing event is a user-perceived freezing event, the freezing event content can be further generated.

[0171] S506, packaging freezing IPC message.

[0172] The system performance monitoring module can package the content of the freezing event into an IPC message. Further, the system performance monitoring module can report the freezing IPC message to the scene scheduling module in the computer manager application.

[0173] S507, receiving freezing IPC message.

[0174] The scene scheduling module can receive the freezing IPC message reported by the system performance monitoring module, and continue to execute step S508.

[0175] S508, whether the browser scene is in a freezing scene.

[0176] In the embodiments of the present application, the method of determining whether it is in a freezing scene can refer to the above Figure 4 The related description in S408 is not repeated. If the current is in a freezing scene, no processing is performed. If the current is not in a freezing scene, step S509 is executed.

[0177] S509, setting to freezing scene, setting freezing state value, issuing freezing strategy parameter, and setting PL1 to a larger value.

[0178] In the embodiments of the present application, step S509 can refer to the above Figure 4 The related description in S409 is not repeated. For example, the initial value of the PL1 before adjustment in the browser scene can be 12W, and the larger value of the PL1 after adjustment can be 45W. In this way, the value of PL1 is increased, which can improve the performance of CPU, thereby reducing the freezing event.

[0179] S510, creating a timer with a preset time duration, and not modifying the value of PL1 within the preset time duration.

[0180] In the embodiments of the present application, step S510 can refer to the above Figure 4The description of S410 is corresponding, and will not be repeated. It can be understood that the preset time length of the browser scenario and the preset time length of the above-mentioned office scenario can be the same or different. For example, the preset time length can be 3 minutes, and the specific value of the preset time length is not limited in the embodiment of the application.

[0181] S511, collecting the actual CPU power consumption.

[0182] In the embodiment of the application, step S511 can refer to the above-mentioned Figure 4 The description of S411 is corresponding, and will not be repeated. It can be understood that the sampling period of the browser scenario and the sampling period of the above-mentioned office scenario can be the same or different. The specific sampling period of the browser scenario is not limited in the embodiment of the application.

[0183] S512, whether the timer is timed out.

[0184] If the timer is not timed out, step S511 is continued to sample the CPU power consumption. If the timer is timed out, the sampling of the CPU power consumption is ended, and step S513 is executed.

[0185] S513, calculating the second adaptive value and the second offset.

[0186] After the timer is timed out, that is, after the preset time length (for example, 3 minutes), the scene scheduling module can calculate the second adaptive value of the CPU power consumption in the browser scenario, wherein the second adaptive value is 轻2 The calculation method of the second offset OFFSET Figure 4 The description of S413 is corresponding, and will not be repeated.

[0187] For example, in the case of light load, the second offset OFFSET 轻2 may be the difference between the average CPU power value AverageCPUPower2 and the initial value PL12 of PL1, and the second offset OFFSET 轻2 may satisfy the following formula:

[0188] OFFSET1 轻2 = AverageCPUPower12 - PL12

[0189] In the embodiment of the application, the calculation method, the saving method, and the value range of the offset can refer to the above-mentioned Figure 4 The description of S413 is corresponding, and will not be repeated.

[0190] S514, clearing the frame freezing state value and re-identifying the application scenario.

[0191] In the embodiments of the present application, step S514 can refer to the related description in the above Figure 4 The related description in the corresponding S414 is not repeated. When the application scenario is re-identified as the browser scenario, step S515 is performed.

[0192] In the browser scenario, the PL1 is updated to the adjustment value.

[0193] When the application scenario is identified as the browser scenario, if the terminal device is in the light load, the scene scheduling module can send the second adaptation value calculated as the adjustment value of the PL1 to the underlying chip, and the underlying chip can modify the PL1 from the larger value to the adjustment value, wherein the adjustment value of the PL1 is less than the larger value of the PL1, and the adjustment value of the PL1 is greater than the initial value of the PL1.

[0194] In the embodiments of the present application, the calculation method of the PL1 adjustment value can refer to the related description in the above Figure 4 The related description in the corresponding S415 is not repeated.

[0195] It can be understood that in the same application scenario, the offset corresponding to different load levels can be different. For example, in the browser scenario, if the load level identified in step S515 is medium load, the adjustment value of the PL1 can be the sum of the PL1 initial value corresponding to the medium load and the offset OFFSET1 中2 corresponding to the medium load. That is, the adjustment value of the PL1 in the medium load case cannot be calculated using the offset OFFSET1 轻2 corresponding to the light load. Wherein, if the offset is not calculated in the medium load browser scenario, it can be considered that the value of the offset OFFSET1 中2 corresponding to the medium load is 0, and in the case of medium load, the adjustment value of the PL1 can be the initial value of the PL1.

[0196] In the browser scenario, if the load level identified in step S515 is heavy load, it can be considered that when the load is heavy, the CPU power consumption of the terminal device is relatively large, and the PL1 under the heavy load can not be adjusted.

[0197] 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 re-identified application scenario is the browser scenario, step S515 can be performed to update the PL1 to the adjusted 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 the other application scenario is similar to that in the office scenario or the browser scenario, and will not be described herein again. The difference is that the values of the respective PL1 and the offset and the like corresponding to different scenarios are different. For example, the initial value of the PL1, the larger value of the PL1, the adjusted value of the PL1, and the offset in different scenarios can be the same or different, and the embodiment of the present application does not limit this.

[0198] In a possible implementation, if the subsequent jank occurs again in the browser scenario, the computer manager application can re-calculate the offset in the browser scenario. The specific calculation method of the offset can refer to the above description. Figure 6 The related description in S415 is not described herein again.

[0199] 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 not be executed any more, and the relationship between the respective application scenarios and the offset OFFSET in the memory will also be released, that is, the value of the offset OFFSET can be cleared. When the computer manager application is started next time, the value of the offset OFFSET corresponding to each application scenario and the like needs to be re-calculated.

[0200] The power consumption control method of the embodiment of the present application will be described in detail through specific embodiments. The embodiments below can be combined or implemented independently, and the same or similar concepts or processes can not be described herein again in some embodiments.

[0201] Figure 4 A power consumption control method of the embodiment of the present application is shown. The method comprises:

[0202] S601, a terminal device opens a first application. When a load level of the terminal device is a first level, a CPU power consumption parameter PL1 is a first value. When the load level of the terminal device is a second level, the CPU power consumption parameter PL1 is a second value.

[0203] In the embodiment of the present application, the first application can be an application program opened by a user. For example, the first application can be the office application or the browser application in the above embodiments, and the type of the application is not limited in the embodiment of the present application.

[0204] It is understandable that, within the same application scenario, different load levels correspond to different initial values ​​for the CPU power consumption parameter PL1. The specific correspondence between load levels and initial PL1 values ​​can be found above. Figure 5 or Figure 4 The relevant descriptions in the corresponding embodiments will not be repeated here.

[0205] For example, the first value can be as described above. Figure 5 In the corresponding embodiment, under office scenarios and light load, the initial value of PL1 (9W) is either as described above. Figure 4 In the corresponding embodiment, under a browser scenario and light load, the initial PL1 value is 12W; the second value can be as described above. Figure 5 In the corresponding embodiment, the initial PL1 value (15W) under medium load in an office scenario, or as described above. Figure 4 In the corresponding embodiment, under medium load in the browser scenario, the initial value of PL1 is 20W. The first and second values ​​can be set by the PC Manager application based on empirical preset values ​​obtained from data analysis, as long as the first value is less than the second value. This application embodiment does not specifically limit the first and second values.

[0206] S602: At the first moment, the CPU power consumption parameter PL1 is at its first value, and the first application experiences lag.

[0207] In this embodiment, the first moment can be the moment when the PL1 of the first application is at its initial value under the first load level. At the first moment, the PL1 set by the terminal device for the first application is a first value, and the first value is relatively small.

[0208] The detection of stuttering events can be referred to the above. Figure 4 The relevant descriptions in S401 will not be repeated here.

[0209] S603. At the second moment, the CPU power consumption parameter PL1 is the third value, where the second moment is later than the first moment, and the third value is greater than the first value.

[0210] In this embodiment, the second moment can be the moment when the PL1 of the first application is at a larger value at the first load level. The third value can be the larger PL1 value set by the terminal device for the first application. For example, the third value can be the one described above. Figure 5 In the corresponding embodiment, in an office scenario, the terminal device sets a larger PL1 value (35W) for office applications, or, the third value can be the one mentioned above. Figure 4 In the corresponding embodiment, in the browser scenario, the terminal device sets the PL1 value to a larger value (45W) for the browser application. The specific process of setting PL1 to a larger value can be found above. Figure 4The description of S409 is corresponding, and is not repeated here.

[0211] S604, at a third time after the first preset time from the second time, 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 time and the third time, the load level is the first level.

[0212] In the embodiment of the application, the third time can be the time when the PL1 of the first application is the adjustment value at the first load level. The first level can be a light load level, or a medium load level, etc., and the specific load level corresponding to the first level is not limited in the embodiment of the application.

[0213] The fourth value can be the adjustment value of the PL1 set by the terminal device for the first application, and the fourth value can be the adjustment value of the PL1 set by the terminal device for the first application Figure 4 In the corresponding embodiment, the terminal device sets the PL1 adjustment value (17W) for the office application in the office scenario. The calculation process of the PL1 adjustment value can be referred to the above description of the step S603. Figure 4 The description of S413 is corresponding, and is not repeated here.

[0214] S605, at a fourth time, the CPU power consumption parameter PL1 is the second value, and the first application appears to be stuck.

[0215] In the embodiment of the application, the fourth time can be the time when the PL1 of the first application is the initial value at the second load level. At the fourth time, the PL1 set by the terminal device for the first application is the second value, and the second value is relatively small.

[0216] The detection of the stuck event can be referred to the above description of the step S604. Figure 4 The description of S401 is corresponding, and is not repeated here.

[0217] S606, at a fifth time, the CPU power consumption parameter PL1 is a fifth value, wherein the fifth time is later than the fourth time, and the fifth value is greater than the second value.

[0218] In the embodiment of the application, the fifth time can be the time when the PL1 of the first application is a larger value at the second load level. The fifth value can be a larger value of the PL1 set by the terminal device for the first application. For example, the setting of the fifth value can refer to the above description of the step S603, and it can be understood that the fifth value and the third value can be the same or different. The specific process of setting the fifth value can refer to the above description of the step S603. Figure 4 The description of S409 is corresponding, and is not repeated here.

[0219] S607, after the second preset time length from the fifth moment, at a 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.

[0220] In the embodiment of the application, the sixth moment can be a moment when the PL1 of the first application is the adjustment value at the second load level. The sixth value can be the adjustment value of the PL1 set by the terminal device for the first application. The specific calculation process of the adjustment value of the PL1 can be referred to the above Figure 4 Corresponding to the related description in S413, details are not repeated.

[0221] The second level can be a light load level, or a medium load level, and the like. It can be understood that the second level can be different from the first level, and the specific load level corresponding to the second level is not limited in the embodiment of the application.

[0222] S608, at a 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 a 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.

[0223] In the embodiment of the application, the seventh moment can be a moment when the terminal device exits the first application and opens the first application again. The calculation method of the fourth value and the sixth value can be referred to the above Figure 6 Corresponding to the related description in S415, details are not repeated. The application can adapt to a more appropriate CPU power consumption value parameter PL1 when the application is stuck, so that the user is more smooth when operating in the application scenario, reduces the stuck phenomenon, realizes the optimization of the system performance, and improves the user experience.

[0224] Optionally, in the Figure 4 Based on the corresponding embodiment, the following can be included: 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, if the load level of the terminal device is the first level, the CPU power consumption parameter PL1 is a fourth value obtained by summing the first value and the first offset.

[0225] In the embodiment of the application, the first sampling period can be referred to the above Figure 4The relevant descriptions in S411 will not be repeated here. For example, if the sampling period is 5 seconds and the preset timing duration is 5 minutes, then 60 CPU power consumption values ​​can be collected, meaning that N can be 60.

[0226] The first CPU power consumption adaptation value may, for example, include the average CPU power consumption value or some values ​​near the average CPU power consumption value. For example, the first CPU power consumption adaptation value may be as described above. Figure 5 The corresponding average CPU power consumption value in the office scenario, AverageCPUPower1, or the first CPU power consumption adaptation value, can also be the above. Figure 4 The average CPU power consumption value (AverageCPUPower2) in the corresponding browser scenario.

[0227] The calculation method for the first offset can be referred to above. Figure 7 The relevant description in S413 will not be repeated here. For example, the first offset can be the first offset OFFSET in the above office scenario. 轻1 Alternatively, the first offset can also be the second offset OFFSET in the browser scenario described above. 轻2 .

[0228] For example, such as Figure 4 As shown above, Figure 6 Taking the office scenario in the corresponding embodiment as an example, assuming the first level is a light load situation, the initial value (first value) of PL1 in this office scenario can be 9W; after the office application lags, 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 within 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).

[0229] Therefore, the first offset can be calculated to be 8W. Since the fourth value of PL1 can also be the sum of the first value of PL1 (9W) and the first offset (8W), the fourth value can also be calculated to be 17W. It is understandable that if the calculated fourth value of PL1 is greater than or equal to the third value of PL1, then the fourth value of PL1 is discarded, and the first value of PL1 is still used.

[0230] By sampling the actual CPU power consumption, the terminal device can obtain different CPU power consumption adaptation values ​​for different applications when the load level is the first level. During the application operation, the value of the CPU power consumption parameter PL1 is increased, so that each application can have a more suitable CPU power consumption limit, reduce application lag, and improve the user experience.

[0231] Optional, inFigure 4 On the basis of the corresponding embodiment, the method can comprise: between the fifth time and the sixth time, collecting CPU power consumption according to a second sampling period to obtain M CPU power consumption values; determining a second CPU power consumption adaptation value according to the M CPU power consumption values; obtaining a second offset, the second offset being a difference between the second CPU power consumption adaptation value and a second numerical value; and after the sixth time, the terminal device exits the first application and reopens the first application, and if the load level of the terminal device is the second level, the CPU power consumption parameter PL1 is a sixth numerical value obtained by summing the second numerical value and the second offset.

[0232] In the embodiment of the present application, the second sampling period can refer to the above-mentioned Figure 4 The related description in the corresponding S411 is not repeated. The second sampling period and the first sampling period can be the same or different. That is, the values of M and N can be the same or different. The second CPU power consumption adaptation value can be an average CPU power consumption value obtained when the load level is the second level or some values near the average CPU power consumption value, which is not limited in the embodiment of the present application.

[0233] The second offset can be an offset calculated when the load level is the second level. The calculation method of the second offset can refer to the above-mentioned Figure 6 The related description in the corresponding S413 is not repeated.

[0234] The terminal device can obtain different CPU power consumption adaptation values corresponding to different applications when the load level is the second level by sampling the actual CPU power consumption, so that each application can have a more appropriate CPU power consumption limit value, reduce the application lag, and improve the user experience.

[0235] Optionally, in the embodiment of the present application, the method can further comprise: Figure 6 On the basis of 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, and the method can further comprise: when the second application exits, the first offset and the second offset are both cleared.

[0236] In the embodiment of the present application, the second application can be some management application in the terminal device, and the management application can comprise, for example, a computer housekeeper application, a security management application, etc. For example, the second application can be the computer housekeeper application in the above-mentioned embodiment. When the second application runs, the power consumption control method of the embodiment of the present application can be executed, and the second application can control or manage the first numerical value, the second numerical value, the larger value, the CPU power consumption configuration value, and the offset of the PL1 value, etc.

[0237] When the second application exits, the power consumption control method provided by the embodiment of the present application will not be executed any more, and the relationship between the corresponding application scenarios and the offsets will also be released in the memory, that is, the values of the offsets can be cleared. When the second application is started next time, the values of the offsets corresponding to the application scenarios and other parameters need to be calculated again.

[0238] The power consumption control method of the embodiment of the present application can be executed in multiple management applications of the terminal device, and the application range of the method is relatively wide, which has universal applicability and 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.

[0239] Optionally, in the embodiment, 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, and 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.

[0240] In the embodiment of the present application, because the relationship between each application scenario and the corresponding offset will also be released in the memory after the second application exits, for example, the offset OFFSET1 轻1 , OFFSET1 中1 , and the offset OFFSET1 轻2 , OFFSET1 中2 and other values in the above-mentioned office scenario are all cleared. When the second application is opened again, because 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; and when the load level of the first application is the second level, the initial value of PL1 is the second value.

[0241] Restoring the initial preset value of PL1 can make the CPU power consumption values corresponding to each application not always be at a high value, which can reduce the power consumption of the terminal device and improve the performance of the terminal device.

[0242] Optionally, in the embodiment, Figure 6On the basis of the corresponding embodiment, the second application can include a system performance monitoring module, a scene scheduling module, and a CPU power consumption acquisition module; between the first time and the second time, the system performance monitoring module determines that the freezing event is a user-perceptible freezing event; at the second time, the scene scheduling module sets the CPU power consumption parameter PL1 to a third value; from the second time, within a first preset time period, the scene scheduling module samples the CPU power consumption through the CPU power consumption acquisition module; at the third time, the scene scheduling module sets the CPU power consumption parameter PL1 to a fourth value; between the fourth time and the fifth time, the system performance monitoring module determines that the freezing event is a user-perceptible freezing event; at the fifth time, the scene scheduling module sets the CPU power consumption parameter PL1 to a fifth value; from the fifth time, within a second preset time period, the scene scheduling module samples the CPU power consumption through the CPU power consumption acquisition module; at the sixth time, the scene scheduling module sets the CPU power consumption parameter PL1 to a sixth value; at the seventh time, the terminal device exits the first application and opens the first application again, and if the load level of the terminal device is a 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 a second level, the scene scheduling module sets the CPU power consumption parameter PL1 to the sixth value.

[0243] In the embodiments of the present application, the system performance monitoring module of the second application can obtain a freezing event in the system of the terminal device and report the freezing event to the scene scheduling module. The scene scheduling module can identify an application scenario in which the terminal device is located, and can also obtain a load condition of the terminal device and determine a CPU power consumption parameter PL1 that conforms to actual operation of the terminal device in combination with the load condition of the terminal device. The CPU power consumption acquisition module can obtain a CPU power consumption value and report the CPU power consumption value to the scene scheduling module.

[0244] The second application sets an adaptive CPU power consumption value for different application scenarios through mutual coordination of different modules, so that the application runs more smoothly and reduces freezing, optimizes system performance, and improves user experience.

[0245] Optionally, in the embodiments of the present application, Figure 6 On the basis of the corresponding embodiment, the system performance monitoring module determines that the freezing event is a user-perceptible freezing event, which can include: when the time delay of the freezing event exceeds a third preset time period, the system performance monitoring module determines that the freezing event is a user-perceptible freezing event according to an event identifier Flags.

[0246] In the above manner, a user-perceptible freezing event (such as mouse delay, input delay, window unresponsiveness, etc.) can be accurately identified, and the CPU power consumption parameter PL1 can be adjusted when the user-perceptible freezing event occurs to reduce freezing of the application.

[0247] Optionally, in Figure 6 On the basis of the corresponding embodiment, the jank type of the jank can include one or more of the following: mouse delay jank, input delay jank, window unresponsive jank.

[0248] The application embodiment controls the application power consumption for the user-perceived jank, which can reduce the probability of application jank and improve the user experience.

[0249] Optionally, in Figure 8 On the basis of the corresponding embodiment, it can include that when the load level of the terminal device is unchanged, different application scenarios correspond to different CPU power consumption parameters PL1.

[0250] In the application embodiment, different CPU power consumption parameters PL1 corresponding to different applications can make each application have a more appropriate CPU power consumption limit, reduce the jank of the application, and improve the user experience.

[0251] The above mainly introduces the scheme provided by the application embodiment from the perspective of method. To realize the above functions, it contains the hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the method steps of each example described in the embodiment disclosed in the present text, the application can be realized in the form of hardware or the combination of hardware and computer software. Whether a certain function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical scheme. Professional technicians can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the application.

[0252] The application embodiment can divide the function modules of the device for realizing the power consumption control method according to the above method examples, for example, each function module can be divided corresponding to each function, or two or more functions can be integrated in one processing module. The integrated module can be realized in the form of hardware or in the form of software function module. It should be noted that the division of modules in the application embodiment is illustrative, and is only a logical function division. When actually implemented, there can be another division method.

[0253] As Figure 1 The structure of a chip provided by the application embodiment is shown. The chip 800 includes one or more (including two) processors 801, a communication line 802, a communication interface 803, and a memory 804.

[0254] In some embodiments, the memory 804 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.

[0255] The method described in the embodiments of the present application can be applied to the processor 801 or implemented by the processor 801. The processor 801 can be an integrated circuit chip having a signal processing capability. In the implementation process, each step of the above method can be completed by the integrated logic circuit or the instruction in the form of software in the processor 801. The processor 801 described above can be a general processor (for example, a microprocessor or a conventional processor), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, or discrete hardware components. The processor 801 can implement or execute the disclosed processing-related methods, steps and logic block diagrams in the embodiments of the present application.

[0256] The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. 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 combines the hardware to complete the steps of the above method.

[0257] The processor 801, the memory 804 and the communication interface 803 can communicate through the communication line 802.

[0258] In the above embodiments, the instructions stored in the memory for the processor to execute can be implemented in the form of a computer program product. Among them, the computer program product can be written in the memory in advance, or downloaded and installed in the memory in the form of software.

[0259] The embodiments of the present application further provide a computer program product including one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through a wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL) or wireless (for example, infrared, wireless, microwave, etc.) manner. The computer-readable storage medium can be any available medium that can be stored by the computer or a data storage device such as a server, data center, etc. including one or more available media sets. For example, the available media can include magnetic media (for example, floppy disk, hard disk or magnetic tape), optical media (for example, digital versatile disc (DVD)), or semiconductor media (for example, solid state disk (SSD)) and the like.

[0260] The embodiments of the present application further provide 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. The computer-readable medium can include computer storage medium and communication medium, and can also include any medium that can transfer computer programs from one place to another. The storage medium can be any target medium accessible by a computer.

[0261] As a possible design, the computer-readable medium can include compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disk storage; the computer-readable medium can include magnetic disk storage or other magnetic disk storage devices. Moreover, any connection line can also be appropriately referred to as a computer-readable medium. For example, if software is transmitted from a website, server or other remote source using a coaxial cable, optical fiber cable, twisted pair, DSL or wireless technology (such as infrared, radio and microwave), the coaxial cable, optical fiber cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of the medium. As used herein, the disk and the optical disk include compact discs (CD), laser discs, optical discs, digital versatile discs (DVD), floppy disks and Blu-ray discs, wherein the disk is usually reproduced in a magnetic manner, and the optical disk is optically reproduced by laser.

[0262] The embodiments of the present application are described with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as a combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the computer or other programmable data processing device generate a device for implementing the functions specified in the flowchart and / or block diagram. Figure 1 The flow and / or block ​ The device for implementing the functions specified in one flow or multiple flows and / or one block or multiple blocks.

Claims

1. A power consumption control method characterized by comprising: The method comprises: The terminal device opens a first application, when the load level of the terminal device is a first level, the CPU power consumption parameter PL1 is a first value, and when the load level of the terminal device is a second level, the CPU power consumption parameter PL1 is a second value; At a first time, the CPU power consumption parameter PL1 is the first value, and the first application is stuck; At a second time, the CPU power consumption parameter PL1 is a third value, wherein the second time is later than the first time, and the third value is greater than the first value; After a first preset time period from the second time, at a third time, the CPU power consumption parameter PL1 is a fourth value, wherein the fourth value is obtained based on a first offset, the first offset is obtained based on a plurality of CPU power consumption values collected between the second time and the third time, the fourth value is greater than the first value, and the fourth value is less than the third value, and between the first time and the third time, the load level is the first level; At a fourth time, the CPU power consumption parameter PL1 is the second value, and the first application is stuck; At a fifth time, the CPU power consumption parameter PL1 is a fifth value, wherein the fifth time is later than the fourth time, and the fifth value is greater than the second value; After a second preset time period from the fifth time, at a sixth time, the CPU power consumption parameter PL1 is a sixth value, wherein the sixth value is obtained based on a second offset, the second offset is obtained based on a plurality of CPU power consumption values collected between the fifth time and the sixth time, the sixth value is greater than the second value, and the sixth value is less than the fifth value, and between the fourth time and the sixth time, the load level is the second level; At a seventh time, 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 time is later than the sixth time.

2. The method of claim 1, wherein, Comprise: Between the second time and the third time, CPU power consumption is collected according to a first sampling period to obtain N CPU power consumption values; A 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 a difference between the first CPU power consumption adaptation value and the first value; Wherein, after the third time, 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 obtained by summing the first value and the first offset.

3. The method of claim 2, wherein, Comprise: between the fifth moment and the sixth moment, the CPU power consumption is collected according to a second sampling period, and M CPU power consumption values are obtained; a 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 a difference value between the second CPU power consumption adaptation value and the second numerical 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 a sixth numerical value obtained by summing the second numerical value and the second offset.

4. The method of claim 3, wherein, The CPU power consumption parameter PL1 value of the first application is controlled by a second application, and the first offset and the second offset are managed by the second application, and the method further comprises: When the second application exits, the first offset and the second offset are both cleared.

5. The method of claim 4, wherein, comprises: At an 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 a ninth moment, the terminal device opens the first application, and when the load level of the terminal device is the first level, the CPU power consumption parameter PL1 is the first numerical value, and when the load level of the terminal device is the second level, the CPU power consumption parameter PL1 is the second numerical value; the ninth moment is later than the eighth moment.

6. The method according to claim 4 or 5, characterized in that, The second application comprises a system performance monitoring module, a scene scheduling module, and a CPU power consumption collection module; between the first moment and the second moment, the system performance monitoring module determines that the freezing event is a user-perceptible freezing event; At the second moment, the scene scheduling module sets the CPU power consumption parameter PL1 to the third numerical value; From the second moment, within the first preset time period, the scene scheduling module samples the CPU power consumption 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 numerical value; between the fourth moment and the fifth moment, the system performance monitoring module determines that the freezing event is a user-perceptible freezing event; At the fifth moment, the scene scheduling module sets the CPU power consumption parameter PL1 to the fifth numerical 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 collection module; At the sixth moment, the scene scheduling module sets the CPU power consumption parameter PL1 to the sixth numerical value; At the seventh 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 scene scheduling module sets the CPU power consumption parameter PL1 to the fourth numerical 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 numerical value.

7. The method of claim 6, wherein, The monitoring system performance module determines that the freezing event is a user-perceptible freezing event, including: When the time delay of the freezing event exceeds a third preset time length, the monitoring system performance module determines that the freezing event is a user-perceptible freezing event according to event identification Flags.

8. The method according to any one of claims 1 to 5, characterized in that, The freezing type of the freezing event includes one or more of the following: mouse delay freezing, input delay freezing, and window unresponsive freezing.

9. The method of claim 8, wherein, The CPU power consumption parameter PL1 corresponding to different application scenarios is different when the load level of the terminal device is unchanged.

10. A terminal device, comprising: The application further relates to a terminal device and a computer readable storage medium. The memory is used for storing a computer program, and the processor is used for executing the computer program to execute the power consumption control method in any one of claims 1-9.

11. A computer readable storage medium, characterized in that, The computer readable storage medium stores instructions, and when the instructions are executed, the computer executes the power consumption control method in any one of claims 1-9.

12. A computer program product, characterised in that, The computer program is executed to enable the terminal device to execute the power consumption control method in any one of claims 1-9.

Citation Information

Patent Citations

  • Power consumption control method and relevant equipment

    CN107357405A

  • Control method and control device

    CN110928587A

Cited By

  • Power consumption control method and related apparatus

    WO2024098975A1