Cpu frequency adjustment method and apparatus, electronic device, and storage medium

By differentiating task types and adjusting the CPU frequency according to frequency limiting strategies, the application lag problem caused by insufficient CPU frequency in existing technologies has been solved, thus improving the user experience.

CN115617512BActive Publication Date: 2026-02-10GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211204369.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-29
Publication Date
2026-02-10
Estimated Expiration
2042-09-29

AI Technical Summary

Technical Problem

In existing technologies, when determining the CPU frequency, electronic devices often use the minimum frequency limit as the maximum frequency, which results in the CPU frequency corresponding to the perceptible type of task load being too low, causing application lag and a poor user experience.

Method used

By acquiring the sensing parameters of electronic devices, the task type is distinguished as either perceptible or imperceptible, and the CPU frequency is determined according to the frequency limiting strategy of different types. This ensures that the maximum CPU frequency of perceptible types is greater than that of imperceptible types, thereby achieving differentiated frequency limiting.

Benefits of technology

It effectively alleviates application lag caused by insufficient CPU frequency due to perceptible task load, thus improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115617512B_ABST
    Figure CN115617512B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a CPU frequency adjustment method and device, electronic equipment and a storage medium. The CPU frequency adjustment method can comprise: obtaining a sensing parameter corresponding to a current task load of the electronic equipment; wherein the sensing parameter is a parameter corresponding to a module associated with user perception in the electronic equipment; determining a task type of the current task load according to the sensing parameter, the task type comprising a perceivable type or an imperceptible type; wherein the perceivable type indicates that the current task load is associated with user perception, and the imperceptible type indicates that the current task load is not associated with user perception; determining a CPU frequency corresponding to the current task load according to a frequency limiting strategy corresponding to the task type; wherein a maximum value of the CPU frequency indicated by the frequency limiting strategy corresponding to the perceivable type is greater than a maximum value of the CPU frequency indicated by the frequency limiting strategy corresponding to the imperceptible type. By implementing the method, the problem of application lag can be alleviated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic equipment technology, and in particular to a CPU frequency adjustment method, apparatus, electronic device and storage medium. Background Technology

[0002] Currently, most CPU frequency limiting strategies are hardware-based. When electronic devices receive the frequency limiting values ​​from various hardware modules, they typically choose the smallest value as the final maximum CPU frequency. Subsequent adjustments to the CPU frequency by the electronic device cannot exceed this maximum frequency. Therefore, if the determined maximum CPU frequency is too low, it usually leads to noticeable lag in some applications and a poor user experience. Summary of the Invention

[0003] This application provides a CPU frequency adjustment method, apparatus, electronic device, and storage medium, which can effectively alleviate application lag issues.

[0004] The first aspect of this application provides a CPU frequency adjustment method, including:

[0005] Obtain the perception parameters corresponding to the current task load of the electronic device; wherein, the perception parameters are the parameters corresponding to the modules in the electronic device that are associated with user perception;

[0006] Based on the perception parameters, the task type of the current task load is determined, and the task type includes a perceptible type or an imperceptible type; wherein, the perceptible type indicates that the current task load is related to user perception, and the imperceptible type indicates that the current task load is not related to user perception;

[0007] Based on the frequency limiting policy corresponding to the task type, determine the CPU frequency corresponding to the current task load; wherein, the maximum value of the CPU frequency indicated by the frequency limiting policy corresponding to the perceptible type is greater than the maximum value of the CPU frequency indicated by the frequency limiting policy corresponding to the inperceptible type.

[0008] A second aspect of this application provides a CPU frequency adjustment device, comprising:

[0009] A sensing parameter acquisition unit is used to acquire sensing parameters corresponding to the current task load of the electronic device; wherein, the sensing parameters are parameters corresponding to modules in the electronic device that are associated with user perception;

[0010] A task type determination unit is used to determine the task type of the current task load based on the perception parameters. The task type includes a perceptible type or an imperceptible type. The perceptible type indicates that the current task load is related to user perception, and the imperceptible type indicates that the current task load is not related to user perception.

[0011] The frequency determination unit is used to determine the CPU frequency corresponding to the current task load according to the frequency limiting policy corresponding to the task type; wherein, the maximum value of the CPU frequency indicated by the frequency limiting policy corresponding to the perceptible type is greater than the maximum value of the CPU frequency indicated by the frequency limiting policy corresponding to the inperceptible type.

[0012] A third aspect of this application provides an electronic device, including:

[0013] Memory containing executable program code;

[0014] and the processor coupled to the memory;

[0015] The processor calls the executable program code stored in the memory, and when the executable program code is executed by the processor, the processor implements the method as described in the first aspect of the embodiments of this application.

[0016] A fourth aspect of this application provides a computer-readable storage medium having executable program code stored thereon, wherein when the executable program code is executed by a processor, it implements the method described in the first aspect of this application.

[0017] The fifth aspect of this application discloses a computer program product that, when run on a computer, causes the computer to perform any of the methods disclosed in the first aspect of this application.

[0018] The sixth aspect of this application discloses an application publishing platform for publishing computer program products, wherein when the computer program product is run on a computer, the computer executes any of the methods disclosed in the first aspect of this application.

[0019] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:

[0020] In this embodiment, the sensing parameters corresponding to the current task load of the electronic device are obtained; wherein, the sensing parameters are the parameters corresponding to the modules in the electronic device that are associated with user perception; based on the sensing parameters, the task type of the current task load is determined, and the task type includes a perceptible type or an imperceptible type; wherein, a perceptible type indicates that the current task load is related to user perception, and an imperceptible type indicates that the current task load is not related to user perception; based on the frequency limiting policy corresponding to the task type, the CPU frequency corresponding to the current task load is determined; wherein, the maximum value of the CPU frequency indicated by the frequency limiting policy corresponding to the perceptible type is greater than the maximum value of the CPU frequency indicated by the frequency limiting policy corresponding to the imperceptible type.

[0021] By implementing this method, electronic devices link CPU frequency limiting to user perception. By analyzing perceived parameters corresponding to the current task load, the task type of the current task load is determined. Then, based on the frequency limiting strategy corresponding to the task type, the CPU frequency corresponding to the current task load is determined, thus achieving differentiated frequency limiting. Furthermore, since the maximum CPU frequency indicated by the frequency limiting strategy for a perceptible task type is greater than the maximum CPU frequency indicated by the frequency limiting strategy for an insensitive task type, the CPU frequency determined by the electronic device for a perceptible task load is generally not too low. This effectively alleviates the application lag problem caused by excessively low CPU frequencies for perceptible task loads. Attached Figure Description

[0022] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments and the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application, and other drawings can be obtained based on these drawings.

[0023] Figure 1 This is a schematic diagram of a scenario disclosed in an embodiment of this application;

[0024] Figure 2 This is a flowchart illustrating a CPU frequency adjustment method disclosed in an embodiment of this application;

[0025] Figure 3 This is another schematic flowchart of the CPU frequency adjustment method disclosed in the embodiments of this application;

[0026] Figure 4 This is a structural diagram of a CPU frequency adjustment device disclosed in an embodiment of this application;

[0027] Figure 5 This is a structural illustration of an electronic device disclosed in an embodiment of this application. Detailed Implementation

[0028] This application provides a CPU frequency adjustment method, apparatus, electronic device, and storage medium, which can effectively alleviate application lag issues.

[0029] To enable those skilled in the art to better understand the present application, the technical solutions of the embodiments of the present application will be described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. All embodiments based on the present application should fall within the scope of protection of the present application.

[0030] It is understood that the electronic devices involved in the embodiments of this application may include general handheld screen electronic user terminals, such as mobile phones, smartphones, portable terminals, terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), laptops, notebooks, wireless broadband (Wibro) terminals, tablet computers (PCs), smart PCs, point of sale (POS) terminals, and in-vehicle computers, etc.

[0031] Electronic devices can also include wearable devices. Wearable devices are portable electronic devices that can be worn directly on the user's body or integrated into the user's clothing or accessories. Wearable devices are not just hardware devices; they can also achieve powerful intelligent functions through software support, data interaction, and cloud server interaction, such as computing, positioning, and alarm functions. They can also connect to mobile phones and various terminals. Wearable devices can include, but are not limited to, wrist-supported devices (such as watches, wristbands, etc.), foot-supported devices (such as shoes, socks, or other leg-wearing products), head-supported devices (such as glasses, helmets, headbands, etc.), as well as smart clothing, backpacks, canes, accessories, and other non-mainstream product forms.

[0032] To facilitate a clear understanding of the CPU frequency adjustment process by those skilled in the art, an example of an application scenario involved in this application is described below. Please refer to [link / reference]. Figure 1The electronic device 10 first determines the first CPU frequency corresponding to the current task load based on the current task load size. The first CPU frequency refers to the theoretical CPU frequency corresponding to the current task load. Then, the smaller value between the first CPU frequency and the maximum CPU frequency of the electronic device 10 is taken as the CPU frequency corresponding to the current task load, which is the actual CPU frequency of the electronic device 10 when running the current task load. The current task load can represent the number of processes running on the CPU, or the pressure exerted on the CPU by the processes running on the CPU; this embodiment does not limit this. The process corresponding to the current task load can be a process running in the foreground of the electronic device and / or a process running in the background of the electronic device. It should be noted that the larger the current task load, the larger the corresponding first CPU frequency. The first CPU frequency corresponding to the current task load can be obtained by looking up a table, which will be explained in detail below.

[0033] In existing technologies, the maximum CPU frequency of an electronic device 10 is typically determined based on the frequency limiting values ​​corresponding to various frequency limiting modules within the electronic device 10. These frequency limiting modules refer to modules with frequency limiting requirements, and may include temperature control modules, power control modules, etc. Specifically, the electronic device 10 receives frequency limiting requests from various frequency limiting modules, analyzes these requests to obtain the corresponding frequency limiting values, and uses the minimum frequency limiting value among these as the maximum CPU frequency of the electronic device 10. Since the CPU frequency corresponding to the current task load does not exceed the maximum CPU frequency of the electronic device 10, when the initial CPU frequency is significantly higher than the maximum CPU frequency, the CPU frequency corresponding to the current task load becomes the maximum CPU frequency of the electronic device 10. In this case, the application often experiences noticeable lag due to the excessively low CPU frequency corresponding to the current task load, resulting in a poor user experience.

[0034] In this technical solution, the electronic device 10 links CPU frequency limiting with user perception. By analyzing the perceived parameters corresponding to the current task load, it determines the task type of the current task load. Then, based on the frequency limiting strategy corresponding to the task type, it determines the CPU frequency corresponding to the current task load, thereby achieving differentiated frequency limiting. Furthermore, since the maximum value of the CPU frequency indicated by the frequency limiting strategy corresponding to a perceptible type is greater than the maximum value of the CPU frequency indicated by the frequency limiting strategy corresponding to an imperceptible type, when the current task load is a perceptible type, the CPU frequency determined by the electronic device 10 for the current task load will generally not be too low, effectively alleviating the application lag problem caused by the CPU frequency corresponding to a perceptible type of task load being too low.

[0035] Please see Figure 2 , Figure 2 This is a flowchart illustrating a CPU frequency adjustment method disclosed in an embodiment of this application. Figure 2 The CPU frequency adjustment method shown may include the following steps:

[0036] 201. Obtain the perception parameters corresponding to the current task load of the electronic device; wherein, the perception parameters are the parameters corresponding to the modules in the electronic device that are associated with user perception.

[0037] For details regarding the current task load, please refer to the description above; it will not be repeated here.

[0038] In some embodiments, the modules associated with user perception may include any one or a combination of the following: a display module, an audio output module, and a vibration module, etc. The perception parameters corresponding to the current task load may include any one or a combination of the following: screen brightness parameters of the display module, refresh rate of the display module, sound parameters of the audio output module, and vibration parameters of the vibration module, etc. Specifically, the screen brightness parameters indicate whether the display module is on or off, the refresh rate of the display module indicates the output rate of the image on the display module, the sound parameters indicate whether sound is present and / or whether the sound is urgent, and the vibration parameters indicate whether a touch has occurred.

[0039] 202. Based on the perception parameters corresponding to the current task load, determine the task type of the current task load. The task type includes perceptible type or imperceptible type. Among them, perceptible type indicates that the current task load is related to user perception, and imperceptible type indicates that the current task load is not related to user perception.

[0040] In some embodiments, determining the task type of the current task load based on the sensing parameters may include: if the values ​​of each sensing parameter corresponding to the current task load match the values ​​of each sensing parameter corresponding to a perceptible type, then the current task type is a perceptible type; if the values ​​of each sensing parameter corresponding to the current task load match the values ​​of each sensing parameter corresponding to an imperceptible type, then the current task type is an imperceptible type.

[0041] For example, the sensing parameters corresponding to the current task load include the screen-on parameters of the display module, the refresh rate of the display module, the sound parameters of the audio output module, and the vibration parameters of the vibration module. Each parameter has a value of 0 or 1. A screen-on parameter value of 0 indicates that the display module is in a screen-off state, while a value of 1 indicates that the display module is in a screen-on state. A refresh rate value of 0 indicates that the display module does not display an image, while a value of 1 indicates that the display module displays an image. A sound parameter value of 0 indicates that the audio output module does not output sound, while a value of 1 indicates that the audio output module outputs sound. A vibration parameter value of 0 indicates that the vibration module does not vibrate, while a value of 1 indicates that the vibration module vibrates. For perceptible types, the values ​​of each sensing parameter include: at least one sensing parameter is 1; for imperceptible types, the values ​​of each sensing parameter include: all sensing parameters are 0.

[0042] 203. Determine the CPU frequency corresponding to the current task load based on the frequency limiting policy corresponding to the task type; wherein, the maximum value of the CPU frequency indicated by the frequency limiting policy corresponding to the perceptible type is greater than the maximum value of the CPU frequency indicated by the frequency limiting policy corresponding to the inperceptible type.

[0043] In this embodiment, the task type is an imperceptible type, and the corresponding frequency limiting strategy is that the maximum CPU frequency is determined by the frequency limiting module of the electronic device. The task type is an perceptible type, and the corresponding frequency limiting strategy is that the maximum CPU frequency is determined by the frequency limiting module of the electronic device and overclocking parameters.

[0044] Regarding the method for determining the maximum CPU frequency based on the frequency limiting module of the electronic device, please refer to the description above, which will not be repeated here. Overclocking parameters can indicate the maximum CPU frequency for perceptible types, or the percentage by which it exceeds the maximum CPU frequency for inperceptible types.

[0045] In some embodiments, the overclocking parameters pre-stored by the electronic device can be one or more, and this application embodiment does not limit this. Wherein, if there is one overclocking parameter, it indicates that the overclocking parameters corresponding to each task load of the sensed type are the same; if there are multiple overclocking parameters, it indicates that the overclocking parameters corresponding to each task load of the sensed type are different.

[0046] By implementing the above method, electronic devices link CPU frequency limiting to user perception. By analyzing the perceived parameters corresponding to the current task load, the task type of the current task load is determined. Then, based on the frequency limiting strategy corresponding to the task type, the corresponding CPU frequency is determined, thus achieving differentiated frequency limiting. Furthermore, since the maximum CPU frequency indicated by the frequency limiting strategy for a perceptible task type is greater than the maximum CPU frequency indicated by the frequency limiting strategy for an inperceptible task type, the CPU frequency determined by the electronic device for a perceptible task load is generally not too low. This effectively alleviates the application lag problem caused by excessively low CPU frequencies for perceptible task loads.

[0047] Please see Figure 3 , Figure 3 This is another schematic flowchart of the CPU frequency adjustment method disclosed in the embodiments of this application. Figure 3 The CPU frequency adjustment method shown may include the following steps:

[0048] 301. Obtain the perception parameters corresponding to the current task load of the electronic device; wherein, the perception parameters are the parameters corresponding to the modules in the electronic device that are associated with user perception.

[0049] 302. Based on the perception parameters, determine the task type of the current task load. The task type includes perceptible type or imperceptible type. The perceptible type indicates that the current task load is related to user perception, and the imperceptible type indicates that the current task load is not related to user perception.

[0050] For a description of steps 301-302, please refer to [link / reference needed]. Figure 2 The descriptions of steps 201-202 shown will not be repeated here.

[0051] 303. Determine the first CPU frequency corresponding to the current task load based on the current task load size.

[0052] In some embodiments, the electronic device may have a pre-set load frequency relationship table, which may include multiple CPU frequencies and a load range corresponding to each CPU frequency. The larger the value of the load range, the larger the corresponding CPU frequency.

[0053] Furthermore, determining the first CPU frequency corresponding to the current task load based on the current task load size can include: finding the target load range corresponding to the current task load size from the load frequency relationship table; and using the CPU frequency corresponding to the target load range as the first CPU frequency corresponding to the current task load.

[0054] Given that the current task load represents the pressure exerted on the CPU by the currently running process, for example, if the current task load is 213, the corresponding first CPU frequency obtained from the table is 1478400Hz.

[0055] 304. Determine the maximum CPU frequency corresponding to the current task load based on the frequency limiting policy corresponding to the task type.

[0056] In some embodiments, the task type is an imperceptible type. Determining the maximum CPU frequency corresponding to the current task load based on the frequency limiting policy corresponding to the task type may include: determining a second CPU frequency based on the frequency limiting value corresponding to the frequency limiting module; and using the second CPU frequency as the maximum CPU frequency corresponding to the current task load. The method for determining the second CPU frequency based on the frequency limiting value corresponding to the frequency limiting module can be found in the above description and will not be repeated here.

[0057] In some embodiments, the task type is a perceptible type. Determining the maximum CPU frequency corresponding to the current task load based on the frequency limiting policy corresponding to the task type may include: determining a second CPU frequency based on the frequency limiting value corresponding to the frequency limiting module; determining the target overclocking parameter corresponding to the current task load; and determining the maximum CPU frequency corresponding to the current task load based on the target overclocking parameter and the second CPU frequency.

[0058] In some embodiments, determining the target overclocking parameters corresponding to the current task load may include: obtaining stuttering parameters corresponding to the current task load, wherein the stuttering parameters include the frame rendering duration and / or the execution wait duration of a specified audio thread; determining the target perception level corresponding to the current task load based on the stuttering parameters; and using the overclocking parameters corresponding to the target perception level as the target overclocking parameters corresponding to the current task load.

[0059] In some embodiments, the stuttering parameters include the rendering duration and the execution waiting duration. Determining the target perception level corresponding to the current task load based on the stuttering parameters may include: obtaining a first duration difference between the rendering duration and a rendering duration threshold, determining a first interval in which the first duration difference lies, and obtaining a first stuttering probability corresponding to the first interval; obtaining a second duration difference between the execution waiting duration and an execution waiting duration threshold, determining a second interval in which the second duration difference lies, and obtaining a second stuttering probability corresponding to the second interval; determining a target stuttering probability corresponding to the current task load based on the first stuttering probability and the second stuttering probability; and using the perception level corresponding to the target stuttering probability as the target perception level corresponding to the current task load.

[0060] For example, with a refresh rate of 120Hz, the rendering duration threshold is 8 milliseconds (ms).

[0061] In some embodiments, determining the target lag probability corresponding to the current task load based on the first lag probability and the second lag probability can be achieved in ways including, but not limited to, the following:

[0062] The maximum value between the first lag probability and the second lag probability is determined as the target lag probability corresponding to the current task load;

[0063] or,

[0064] The average of the first and second stutter probabilities is determined as the target stutter probability corresponding to the current task load.

[0065] or,

[0066] The first probability value is obtained by multiplying the first lag probability by the first weighting coefficient, and the second probability value is obtained by multiplying the second lag probability by the second weighting coefficient. Finally, the target lag probability corresponding to the current task load is obtained by adding the first probability value to the second probability value.

[0067] In some embodiments, the electronic device may pre-store a probability level relationship table, which may include multiple perception levels and a probability interval corresponding to each perception level. Further, using the perception level corresponding to the target lag probability as the target perception level corresponding to the current task load may include: searching the probability level relationship table for the target probability interval where the target lag probability lies, and determining the perception level corresponding to the target probability interval as the target perception level corresponding to the current task load.

[0068] By implementing the above method, when the current task load is of a perceptible type, the perceptibility level corresponding to the current task load can be further determined based on the stuttering parameters corresponding to the current task load. Based on the corresponding perceptibility level, the maximum value of the CPU frequency corresponding to the current task load can be determined, allowing for the extent to which the second CPU frequency (the maximum value of the CPU frequency obtained from the frequency limiting module) can be exceeded. For strong perceptibility levels, a large number of exceedances are allowed, while for weak perceptibility levels, a small number of exceedances are allowed. This helps to refine the granularity of CPU frequency adjustment, and the balance between performance and power consumption is more reasonable.

[0069] In some embodiments, the maximum value of the CPU frequency corresponding to the current task load is determined based on the target overclocking parameters and the second CPU frequency, which may include, but is not limited to, the following methods:

[0070] When the target overclocking parameter is the first overclocking parameter: obtain the first computing power value corresponding to the second CPU frequency; determine the second computing power value based on the first computing power value and the first overclocking parameter; and take the frequency corresponding to the second computing power value as the maximum value of the CPU frequency corresponding to the current task load.

[0071] The first overclocking parameter represents the degree to which the first computing power value is exceeded. In some embodiments, determining the second computing power value based on the first computing power value and the first overclocking parameter may include:

[0072] Based on the first computing power value and the first overclocking parameter, the computing power value increment is determined, and the sum of the computing power value increment and the first computing power value is determined as the second computing power value; wherein, the second computing power value = the first computing power value + the first computing power value * the first overclocking parameter;

[0073] or,

[0074] The sum of the first overclocking parameter and 1 is used as the first target coefficient, and the first target coefficient is multiplied by the first computing power value to obtain the second computing power value; where the second computing power value = (1 + first overclocking parameter) * first computing power value.

[0075] It should be noted that the first computing power value corresponding to the second CPU frequency can be obtained by looking up Table 1.

[0076] Frequency (Hz) computing power 307200 45 403200 59 518400 76 614400 90 729600 107 844800 123 960000 140 1075200 157 1171200 171 1267200 185 1363200 188 1478400 216 1574400 230 1689600 247 1785600 261

[0077] Table 1

[0078] For example, if the second CPU frequency is 1171200Hz, the first computing power value is 171, and the first overclocking parameter is 0.1, then the second computing power value = 171 * 1.1 = 188, and the maximum CPU frequency corresponding to the current task load is 1363200Hz.

[0079] When the target overclocking parameter is the second overclocking parameter, the frequency increment is determined based on the second overclocking parameter; based on the second CPU frequency and the frequency increment, the maximum value of the CPU frequency corresponding to the current task load is determined.

[0080] The second overclocking parameter represents the degree to which the second CPU frequency is exceeded. Frequency increment = second CPU frequency * second overclocking parameter; the maximum CPU frequency corresponding to the current task load = second CPU frequency + frequency increment.

[0081] For example, if the second CPU frequency is 1171200Hz and the second overclocking parameter is 0.3, then the maximum CPU frequency corresponding to the current task load is 1171200Hz * 0.3 + 1171200Hz = 1522560Hz.

[0082] By implementing the above method, when the current task load is of a perceptible type, the perceptibility level corresponding to the current task load can be further determined based on the stuttering parameters corresponding to the current task load. Based on the corresponding perceptibility level, the maximum value of the CPU frequency corresponding to the current task load can be determined, allowing for the extent to which the second CPU frequency (the maximum value of the CPU frequency obtained from the frequency limiting module) can be exceeded. For strong perceptibility levels, a large number of exceedances are allowed, while for weak perceptibility levels, a small number of exceedances are allowed. This helps to refine the granularity of CPU frequency adjustment, making the balance between performance and power consumption more reasonable.

[0083] 305. Take the smaller of the first CPU frequency and the maximum value of the CPU frequency as the CPU frequency corresponding to the current task load.

[0084] For example, the first CPU frequency is 1478400Hz, and the second CPU frequency is 1171200Hz. If the current task load is imperceptible, the maximum CPU frequency is 1171200Hz, and the CPU frequency corresponding to the current task load is 1171200Hz. If the current task load is imperceptible, the maximum CPU frequency is allowed to exceed 1171200Hz, specifically 1522560Hz, and the CPU frequency corresponding to the current task load is 1478400Hz.

[0085] By implementing the above method, the electronic device links CPU frequency limiting with user perception. It analyzes the perceived parameters corresponding to the current task load to determine the task type, and then determines the corresponding CPU frequency based on the frequency limiting strategy for that task type, thus achieving differentiated frequency limiting. Furthermore, since the maximum CPU frequency indicated by the frequency limiting strategy for a perceptible task type is greater than that for an inperceptible task type, the CPU frequency determined by the electronic device for a perceptible task load is unlikely to be too low, effectively alleviating application stuttering caused by excessively low CPU frequencies for perceptible task loads. Moreover, the electronic device determines a first CPU frequency corresponding to the current task load based on its magnitude and takes the smaller of this first CPU frequency and the maximum CPU frequency as the CPU frequency for the current task load, which helps improve the rationality of CPU frequency adjustment.

[0086] Please see Figure 4 , Figure 4 This is a structural diagram of a CPU frequency adjustment device disclosed in an embodiment of this application. Figure 4The CPU frequency adjustment device shown may include: a sensing parameter acquisition unit 401, a task type determination unit 402, and a frequency determination unit 403; wherein:

[0087] The sensing parameter acquisition unit 401 is used to acquire the sensing parameters corresponding to the current task load of the electronic device; wherein, the sensing parameters are the parameters corresponding to the modules in the electronic device that are associated with user perception.

[0088] The task type determination unit 402 is used to determine the task type of the current task load based on the perception parameters. The task type includes a perceptible type or an imperceptible type. The perceptible type indicates that the current task load is related to user perception, and the imperceptible type indicates that the current task load is not related to user perception.

[0089] The frequency determination unit 403 is used to determine the CPU frequency corresponding to the current task load according to the frequency limiting policy corresponding to the task type; wherein, the maximum value of the CPU frequency indicated by the frequency limiting policy corresponding to the perceptible type is greater than the maximum value of the CPU frequency indicated by the frequency limiting policy corresponding to the inperceptible type.

[0090] In some embodiments, the frequency determination unit 403 is used to determine the CPU frequency corresponding to the current task load according to the frequency limiting policy corresponding to the task type. Specifically, the frequency determination unit 403 is used to determine the first CPU frequency corresponding to the current task load according to the size of the current task load; and to determine the maximum value of the CPU frequency corresponding to the current task load according to the frequency limiting policy corresponding to the task type; and to take the smaller value between the first CPU frequency and the maximum value of the CPU frequency as the CPU frequency corresponding to the current task load.

[0091] In some embodiments, the task type is an imperceptible type, and the frequency limiting strategy corresponding to the imperceptible type is that the maximum value of the CPU frequency is determined according to the frequency limiting module of the electronic device. The frequency limiting module refers to the module that has frequency limiting requirements.

[0092] The frequency determination unit 403 is used to determine the maximum value of the CPU frequency corresponding to the current task load according to the frequency limiting policy corresponding to the task type. Specifically, the frequency determination unit 403 is used to determine the second CPU frequency according to the frequency limiting value corresponding to the frequency limiting module; and to use the second CPU frequency as the maximum value of the CPU frequency corresponding to the current task load.

[0093] In some embodiments, the task type is a perceptible type, and the frequency limiting strategy corresponding to the perceptible type is that the maximum value of the CPU frequency is determined based on the frequency limiting module of the electronic device and the overclocking parameters. The frequency limiting module refers to a module with frequency limiting requirements.

[0094] The frequency determination unit 403 is used to determine the maximum value of the CPU frequency corresponding to the current task load according to the frequency limiting strategy corresponding to the task type. Specifically, the frequency determination unit 403 is used to determine the second CPU frequency according to the frequency limiting value corresponding to the frequency limiting module; determine the target overclocking parameters corresponding to the current task load; and determine the maximum value of the CPU frequency corresponding to the current task load according to the target overclocking parameters and the second CPU frequency.

[0095] In some embodiments, the frequency determination unit 403 may determine the target overclocking parameters corresponding to the current task load in a specific manner, including: the frequency determination unit 403 acquiring stuttering parameters corresponding to the current task load, the stuttering parameters including the frame rendering duration and / or the execution waiting duration of a specified audio thread; determining the target perception level corresponding to the current task load based on the stuttering parameters; and using the overclocking parameters corresponding to the target perception level as the target overclocking parameters corresponding to the current task load.

[0096] In some embodiments, the stuttering parameters include drawing duration and execution waiting duration; the frequency determination unit 403 is used to determine the target perception level corresponding to the current task load based on the stuttering parameters, specifically including: the frequency determination unit 403 is used to obtain a first duration difference between the drawing duration and a drawing duration threshold, and determine a first interval in which the first duration difference is located, and obtain a first stuttering probability corresponding to the first interval; obtain a second duration difference between the execution waiting duration and an execution waiting duration threshold, and determine a second interval in which the second duration difference is located, and obtain a second stuttering probability corresponding to the second interval; determine the target stuttering probability corresponding to the current task load based on the first stuttering probability and the second stuttering probability; and use the perception level corresponding to the target stuttering probability as the target perception level corresponding to the current task load.

[0097] In some embodiments, the target overclocking parameter is a first overclocking parameter; the frequency determination unit 403 is used to determine the maximum value of the CPU frequency corresponding to the current task load based on the target overclocking parameter and the second CPU frequency. Specifically, the frequency determination unit 403 is used to obtain a first computing power value corresponding to the second CPU frequency; determine a second computing power value based on the first computing power value and the first overclocking parameter; and take the frequency corresponding to the second computing power value as the maximum value of the CPU frequency corresponding to the current task load.

[0098] In some embodiments, the target overclocking parameter is a second overclocking parameter; the frequency determination unit 403 is used to determine the maximum value of the CPU frequency corresponding to the current task load based on the target overclocking parameter and the second CPU frequency. Specifically, the frequency determination unit 403 is used to determine the frequency increment based on the second overclocking parameter; and to determine the maximum value of the CPU frequency corresponding to the current task load based on the second CPU frequency and the frequency increment.

[0099] In some embodiments, the module associated with user perception includes at least one of a display module, an audio output module, and a vibration module, and the perception parameters include at least one of the following: the screen brightness parameter of the display module, the refresh rate of the display module, the sound parameter of the audio output module, and the vibration parameter of the vibration module.

[0100] Please see Figure 5 , Figure 5 This is a structural illustration of an electronic device disclosed in an embodiment of this application. For example... Figure 5 The electronic device shown may have a processor 501 and a memory 502 coupled to the processor 501, wherein the memory 502 may store one or more computer programs.

[0101] Processor 501 may include one or more processing cores. Processor 501 connects to various parts of the electronic device using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in memory 502, and by calling data stored in memory 502. Optionally, processor 501 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). Processor 501 may integrate one or more of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into processor 501 and may be implemented separately using a communication chip.

[0102] The memory 502 may include random access memory (RAM) or read-only memory (ROM). The memory 502 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 502 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described above. The data storage area may also store data created during the use of the electronic device.

[0103] In this embodiment of the application, the processor 501 also has the following functions:

[0104] Obtain the perception parameters corresponding to the current task load of the electronic device; where the perception parameters are the parameters corresponding to the modules in the electronic device that are associated with user perception.

[0105] Based on the perception parameters, determine the task type of the current task load. The task type includes perceptible type or imperceptible type. Among them, perceptible type indicates that the current task load is related to user perception, and imperceptible type indicates that the current task load is not related to user perception.

[0106] Based on the frequency limiting policy corresponding to the task type, determine the CPU frequency corresponding to the current task load; wherein, the maximum value of the CPU frequency indicated by the frequency limiting policy corresponding to the perceptible type is greater than the maximum value of the CPU frequency indicated by the frequency limiting policy corresponding to the inperceptible type.

[0107] In this embodiment of the application, the processor 501 also has the following functions:

[0108] Determine the first CPU frequency corresponding to the current task load based on the current task load size;

[0109] Determine the maximum CPU frequency corresponding to the current task load based on the frequency limiting policy corresponding to the task type;

[0110] The smaller of the first CPU frequency and the maximum CPU frequency is taken as the CPU frequency corresponding to the current task load.

[0111] In this embodiment, the task type is an imperceptible type. The frequency limiting strategy corresponding to the imperceptible type is that the maximum CPU frequency is determined based on the frequency limiting module of the electronic device. The frequency limiting module refers to a module with frequency limiting requirements. The processor 501 also has the following functions:

[0112] The second CPU frequency is determined based on the frequency limiting value corresponding to the frequency limiting module;

[0113] Use the second CPU frequency as the maximum CPU frequency corresponding to the current task load.

[0114] In this embodiment, the task type is a perceptible type, and the frequency limiting strategy corresponding to the perceptible type is that the maximum CPU frequency is determined based on the frequency limiting module of the electronic device and the overclocking parameters. The frequency limiting module refers to a module with frequency limiting requirements. The processor 501 also has the following functions:

[0115] The second CPU frequency is determined based on the frequency limiting value corresponding to the frequency limiting module;

[0116] Determine the target overclocking parameters corresponding to the current task load;

[0117] Based on the target overclocking parameters and the second CPU frequency, determine the maximum value of the CPU frequency corresponding to the current task load.

[0118] In this embodiment of the application, the processor 501 also has the following functions:

[0119] Get the stuttering parameters corresponding to the current task load. The stuttering parameters include the frame rendering time and / or the execution wait time of the specified audio thread.

[0120] Based on the lag parameters, determine the target perception level corresponding to the current task load;

[0121] The overclocking parameters corresponding to the target perception level will be used as the target overclocking parameters for the current task load.

[0122] In this embodiment, the stuttering parameters include drawing duration and execution wait duration; the processor 501 also has the following functions:

[0123] Get the first duration difference between the drawing duration and the drawing duration threshold, determine the first interval in which the first duration difference is located, and get the first stutter probability corresponding to the first interval;

[0124] Obtain the second duration difference between the execution wait time and the execution wait time threshold, determine the second interval in which the second duration difference is located, and obtain the second stutter probability corresponding to the second interval;

[0125] Based on the first lag probability and the second lag probability, determine the target lag probability corresponding to the current task load;

[0126] The perception level corresponding to the target lag probability is used as the target perception level corresponding to the current task load.

[0127] In this embodiment, the target overclocking parameter is the first overclocking parameter; the processor 501 also has the following functions:

[0128] Obtain the first computing power value corresponding to the second CPU frequency;

[0129] The second computing power value is determined based on the first computing power value and the first overclocking parameter;

[0130] The frequency corresponding to the second computing power value is taken as the maximum CPU frequency corresponding to the current task load.

[0131] In this embodiment, the target overclocking parameter is the second overclocking parameter; the processor 501 also has the following functions:

[0132] The frequency increment is determined based on the second overclocking parameter;

[0133] Based on the second CPU frequency and frequency increment, determine the maximum CPU frequency corresponding to the current task load.

[0134] In this embodiment of the application, the modules associated with user perception include at least one of a display module, an audio output module, and a vibration module. The perception parameters include at least one of the following: the screen brightness parameters of the display module, the refresh rate of the display module, the sound parameters of the audio output module, and the vibration parameters of the vibration module.

[0135] This application discloses a computer-readable storage medium that stores a computer program, wherein when the computer program is executed by a processor, the processor performs some or all of the steps performed by the electronic device in the above embodiments.

[0136] This application discloses a computer program product that, when run on a computer, causes the computer to perform some or all of the steps performed by the electronic device in the above embodiments.

[0137] This application discloses an application publishing platform for publishing computer program products. When the computer program product is run on a computer, the computer performs some or all of the steps performed by the electronic device in the above embodiments.

[0138] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0139] A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, magnetic disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state disks (SSDs)).

[0140] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0141] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

[0142] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0143] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0144] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0145] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for adjusting CPU frequency, characterized in that, include: Obtain the perception parameters corresponding to the current task load of the electronic device; wherein, the perception parameters are the parameters corresponding to the modules in the electronic device that are associated with user perception; Based on the perception parameters, the task type of the current task load is determined, and the task type includes a perceptible type or an imperceptible type; wherein, the perceptible type indicates that the current task load is related to user perception, and the imperceptible type indicates that the current task load is not related to user perception; Based on the frequency limiting policy corresponding to the task type, the CPU frequency corresponding to the current task load is determined; wherein, the maximum value of the CPU frequency indicated by the frequency limiting policy corresponding to the perceptible type is greater than the maximum value of the CPU frequency indicated by the frequency limiting policy corresponding to the inperceptible type, the maximum value of the CPU frequency in the frequency limiting policy corresponding to the inperceptible type is determined based on the frequency limiting module of the electronic device, and the maximum value of the CPU frequency in the frequency limiting policy corresponding to the perceptible type is determined based on the frequency limiting module of the electronic device and overclocking parameters.

2. The method according to claim 1, characterized in that, The step of determining the CPU frequency corresponding to the current task load based on the frequency limiting policy corresponding to the task type includes: Based on the current task load, determine the first CPU frequency corresponding to the current task load; Based on the frequency limiting policy corresponding to the task type, determine the maximum value of the CPU frequency corresponding to the current task load; The smaller of the first CPU frequency and the maximum value of the CPU frequency is taken as the CPU frequency corresponding to the current task load.

3. The method according to claim 2, characterized in that, The task type is an imperceptible type, and the frequency limiting module refers to a module with frequency limiting requirements. Determining the maximum CPU frequency corresponding to the current task load based on the frequency limiting strategy corresponding to the task type includes: The second CPU frequency is determined based on the frequency limiting value corresponding to the frequency limiting module; The second CPU frequency is taken as the maximum value of the CPU frequency corresponding to the current task load.

4. The method according to claim 2, characterized in that, The task type is a perceptible type, and the frequency limiting module refers to a module with frequency limiting requirements. Determining the maximum CPU frequency corresponding to the current task load based on the frequency limiting strategy corresponding to the task type includes: The second CPU frequency is determined based on the frequency limiting value corresponding to the frequency limiting module; Determine the target overclocking parameters corresponding to the current task load; Based on the target overclocking parameters and the second CPU frequency, determine the maximum value of the CPU frequency corresponding to the current task load.

5. The method according to claim 4, characterized in that, Determining the target overclocking parameters corresponding to the current task load includes: Obtain the stuttering parameters corresponding to the current task load, the stuttering parameters including the frame rendering duration and / or the execution wait duration of the specified audio thread; Based on the lag parameters, determine the target perception level corresponding to the current task load; The overclocking parameters corresponding to the target perception level are used as the target overclocking parameters corresponding to the current task load.

6. The method according to claim 5, characterized in that, The lag parameters include the rendering duration and the execution waiting duration; determining the target perception level corresponding to the current task load based on the lag parameters includes: Obtain the first duration difference between the drawing duration and the drawing duration threshold, determine the first interval in which the first duration difference is located, and obtain the first stutter probability corresponding to the first interval; Obtain the second duration difference between the execution waiting time and the execution waiting time threshold, determine the second interval in which the second duration difference is located, and obtain the second stutter probability corresponding to the second interval; Based on the first lag probability and the second lag probability, determine the target lag probability corresponding to the current task load; The perception level corresponding to the target lag probability is used as the target perception level corresponding to the current task load.

7. The method according to any one of claims 4-6, characterized in that, The target overclocking parameter is the first overclocking parameter; determining the maximum value of the CPU frequency corresponding to the current task load based on the target overclocking parameter and the second CPU frequency includes: Obtain the first computing power value corresponding to the second CPU frequency; The second computing power value is determined based on the first computing power value and the first overclocking parameter; The frequency corresponding to the second computing power value is taken as the maximum value of the CPU frequency corresponding to the current task load.

8. The method according to any one of claims 4-6, characterized in that, The target overclocking parameter is the second overclocking parameter; determining the maximum value of the CPU frequency corresponding to the current task load based on the target overclocking parameter and the second CPU frequency includes: The frequency increment is determined based on the second overclocking parameter; The maximum value of the CPU frequency corresponding to the current task load is determined based on the second CPU frequency and the frequency increment.

9. The method according to claim 1, characterized in that, The module associated with user perception includes at least one of a display module, an audio output module, and a vibration module. The perception parameters include at least one of the following: the screen brightness parameter of the display module, the refresh rate of the display module, the sound parameter of the audio output module, and the vibration parameter of the vibration module.

10. A CPU frequency adjustment device, characterized in that, include: A sensing parameter acquisition unit is used to acquire sensing parameters corresponding to the current task load of the electronic device; wherein, the sensing parameters are parameters corresponding to modules in the electronic device that are associated with user perception; A task type determination unit is used to determine the task type of the current task load based on the perception parameters. The task type includes a perceptible type or an imperceptible type. The perceptible type indicates that the current task load is related to user perception, and the imperceptible type indicates that the current task load is not related to user perception. A frequency determination unit is used to determine the CPU frequency corresponding to the current task load according to the frequency limiting strategy corresponding to the task type; wherein, the maximum value of the CPU frequency indicated by the frequency limiting strategy corresponding to the perceptible type is greater than the maximum value of the CPU frequency indicated by the frequency limiting strategy corresponding to the inperceptible type, the frequency limiting strategy corresponding to the inperceptible type is that the maximum value of the CPU frequency is determined according to the frequency limiting module of the electronic device, and the frequency limiting strategy corresponding to the perceptible type is that the maximum value of the CPU frequency is determined according to the frequency limiting module of the electronic device and overclocking parameters.

11. An electronic device, characterized in that, include: Memory containing executable program code; and the processor coupled to the memory; The processor calls the executable program code stored in the memory, and when the executable program code is executed by the processor, the processor implements the method as described in any one of claims 1-9.

12. A computer-readable storage medium having executable program code stored thereon, characterized in that, When the executable program code is executed by the processor, it implements the method as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Control method and device for over-frequency working state of CPU

    CN107357654A

  • CPU frequency adjusting method and system

    CN110413400A