Frequency modulation method and device and electronic equipment

By dynamically adjusting the frequency modulation cycle and frequency, combined with resource reservation, the problem of excessive power consumption in existing frequency modulation schemes is solved, achieving a balance between performance and power consumption, and improving the efficiency and accuracy of frequency modulation.

CN119025252APending Publication Date: 2024-11-26HUAWEI TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202310603723.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-25
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

While existing frequency modulation schemes can achieve fast response, they result in significant power consumption, making it impossible to achieve a balance between performance and power consumption.

Method used

By dynamically adjusting the frequency modulation cycle and frequency based on historical load sequences and power budgets, combined with a resource reservation mechanism, precise frequency modulation is achieved, avoiding undersupply and oversupply, and ensuring that the frequency responds promptly to load changes.

Benefits of technology

While maintaining good performance of electronic devices, we can reduce power consumption waste, achieve a balance between performance and power consumption, and improve the efficiency and accuracy of frequency modulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025252A_ABST
    Figure CN119025252A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a frequency modulation method and device and electronic equipment, and the method comprises the steps: responding to a first operation of a user, determining a frequency modulation frequency based on a first historical load sequence, the first historical load sequence being a latest statistical historical load sequence in M historical load sequences, and M being a positive integer greater than or equal to 1; determining a frequency modulation period based on a first power consumption budget and the frequency modulation frequency, wherein the first power consumption budget is a power consumption budget corresponding to the first operation obtained based on temperature rise prediction; and performing frequency modulation according to the frequency modulation period and the frequency modulation frequency. According to the frequency modulation method, the frequency modulation device and the electronic equipment, the dynamic adjustment of the frequency modulation period can be realized, so that the conditions of insufficient supply and excessive supply are avoided; moreover, the frequency modulation frequency is determined based on the recently counted load sequence in the same scene, so that the supply of the frequency can respond to the change of the load in time, and the performance and power consumption are both considered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of frequency modulation, and more specifically, to a method, device and electronic device for frequency modulation. Background Art

[0002] With the popularization of smart devices, users have increasingly higher requirements for the response efficiency, completion efficiency and stability of operating electronic devices. Although the current frequency modulation scheme can achieve rapid response to tasks, it also brings about a large power consumption overhead.

[0003] Therefore, there is an urgent need to provide a frequency modulation method that can achieve rapid response to tasks while also controlling power consumption at a low level. Summary of the invention

[0004] The present application provides a frequency modulation method, device and electronic device, through which the frequency modulation method, device and electronic device can realize dynamic adjustment of the frequency modulation period, thereby avoiding undersupply and oversupply; and, based on the most recent statistical load sequence in the same scene, the frequency modulation frequency is determined, so that the frequency supply can respond to the change of the load in time, so as to achieve a balance between performance and power consumption.

[0005] In a first aspect, a frequency modulation method is provided, the method comprising: in response to a first operation of a user, determining a frequency modulation frequency based on a first historical load sequence, the first historical load sequence being the latest statistical historical load sequence among M historical load sequences, and M being a positive integer greater than or equal to 1; determining a frequency modulation period based on a first power consumption budget and the frequency modulation frequency, the first power consumption budget being the power consumption budget corresponding to the first operation obtained based on a temperature rise prediction; and performing frequency modulation according to the frequency modulation period and the frequency modulation frequency.

[0006] Optionally, the first operation includes any one of an application launch operation, a click operation, a slide operation, a window switch operation, and a code scanning operation.

[0007] Optionally, the M historical load sequences are arranged in a first-in-first-out manner, with the first historical load sequence among the M historical load sequences (the historical load sequence that is counted first) entering the queue first, and the Mth historical load sequence among the M historical load sequences (the historical load sequence that is counted most recently) entering the queue last. That is to say, the above-mentioned historical load sequence can also be interpreted as the Mth historical load sequence among the M historical load sequences.

[0008] Optionally, the method for obtaining the first power consumption budget based on the temperature rise prediction may be: calculating the target whole machine current of the current device, and the value obtained by multiplying the target whole machine current by 3.8V is the first power consumption budget.

[0009] In the embodiment of the present application, the frequency modulation period is determined based on the most recent historical load sequence corresponding to the same scene and the power consumption budget of the current scene, so that dynamic adjustment of the frequency modulation period can be achieved, thereby avoiding undersupply and oversupply, that is, waste of power consumption can be avoided; and, the method determines the frequency modulation frequency based on the most recent statistical load sequence of the current scene, so that the frequency supply can respond to changes in the load in a timely manner, achieving a "fast up and fast down" effect, and achieving a balance between performance and power consumption.

[0010] In combination with the first aspect, in a possible implementation manner, the method further includes: in response to a first operation of the user, reserving resources based on the M historical load sequences.

[0011] In the embodiment of the present application, the risk of high load of the whole machine can be identified in advance based on the historical load sequence, and resources can be reserved, which can reduce the problem of insufficient resource supply during the frequency modulation process caused by high load of the whole machine.

[0012] In combination with the first aspect, in a possible implementation method, resource reservation is performed based on the M historical load sequences, including: determining a first average value based on the M historical load sequences, the first average value being the average value of M×N load samples included in the M historical load sequences; performing background cleanup until the sum of the first average value and the current CPU load is less than 100%, thereby completing resource reservation.

[0013] In the embodiment of the present application, the risk of high load of the whole machine can be identified in advance based on the historical load sequence, and resources can be reserved, which can reduce the problem of insufficient resource supply during the frequency modulation process caused by high load of the whole machine.

[0014] In combination with the first aspect, in a possible implementation method, resource reservation is performed based on the M historical load sequences, including: determining the maximum value among the M×N load samples included in the M historical load sequences; performing background cleanup until the sum of the maximum value and the current CPU load is less than 100%, thereby completing resource reservation.

[0015] In the embodiment of the present application, the risk of high load of the whole machine can be identified in advance based on the historical load sequence, and resources can be reserved, which can reduce the problem of insufficient resource supply due to high load of the whole machine. In addition, the method reserves resources based on the maximum value of multiple historical load samples, which can make the reserved resources more sufficient and avoid the occurrence of insufficient resource supply during the frequency modulation process due to high load of the whole machine to a greater extent.

[0016] In combination with the first aspect, in a possible implementation manner, the method further includes: counting a first load sequence corresponding to the first operation, and a load counting period of the first load sequence is 4 milliseconds.

[0017] In the embodiment of the present application, the load sequence corresponding to the first operation can be synchronously counted during the process of the first operation, so that after the first operation is completed, the counted load sequence can be promptly updated to M historical load sequences for use in subsequent frequency modulation processes. In addition, in the process of counting the load sequences, the load counting period used is small, so that the subsequently determined frequency modulation period can meet the performance requirements.

[0018] In combination with the first aspect, in a possible implementation manner, the method further includes: updating the M historical load sequences according to the first load sequence.

[0019] In an embodiment of the present application, when a user performs a new scenario operation, the load sequence corresponding to the operation will be recorded in a timely manner, and after the operation is completed, the recorded load sequence will be updated to M historical load sequences in a timely manner, thereby ensuring that the M historical load sequences remain the load sequences of the most recent M statistics, making the resources reserved according to the M historical load sequences more reasonable, and making the frequency modulation period and frequency modulation frequency determined according to the historical load sequences more accurate, thereby further reducing power consumption overhead while achieving precise frequency modulation.

[0020] In combination with the first aspect, in a possible implementation, updating the M historical load sequences according to the first load sequence includes: removing the historical load sequence with a sequence number 1 from the M historical load sequences in a first-in-first-out manner, and using the first load sequence as the historical load sequence with a sequence number M.

[0021] In an embodiment of the present application, the updating process of the M historical load sequences adopts a first-in-first-out form, so that the Mth historical load sequence among the M historical load sequences can always be the most recently counted load sequence. In this way, when the frequency modulation period and frequency modulation frequency are determined using the most recently counted historical load sequence, the most recently counted load sequence can be called quickly and accurately, which can improve the efficiency and accuracy of frequency modulation to a certain extent.

[0022] In combination with the first aspect, in a possible implementation method, determining the frequency modulation period based on the first power consumption budget and the frequency modulation frequency includes: determining the first power consumption budget; determining a first difference by subtracting the current power consumption of the entire machine from the first power consumption budget; when the first difference is less than or equal to 0, determining that the frequency modulation period is 20 milliseconds; or, when the first difference is greater than 0, determining multiple power consumption values ​​corresponding to multiple load statistical periods one by one based on the frequency modulation frequency, the multiple load statistical periods including 4 milliseconds, 8 milliseconds, 12 milliseconds, 16 milliseconds, and 20 milliseconds; determining the load statistical period corresponding to the power consumption value with the highest matching degree with the first difference among the multiple power consumption values ​​corresponding to the multiple load statistical periods as the frequency modulation period.

[0023] Among them, the current power consumption of the whole machine = the current current of the whole machine × 3.8V.

[0024] In an embodiment of the present application, the frequency modulation period is determined based on the most recent historical load sequence corresponding to the same scenario and the power consumption budget of the current scenario (obtained based on the temperature rise prediction), and the temperature rise prediction is incorporated into the frequency modulation basis. This can achieve dynamic and accurate adjustment of the frequency modulation period to avoid undersupply and oversupply, that is, to avoid waste of power consumption.

[0025] In combination with the first aspect, in a possible implementation method, multiple power consumption values ​​corresponding one-to-one to multiple load statistical periods are determined based on the frequency modulation frequency, including: determining N power consumption values ​​corresponding one-to-one to N frequency points according to an energy efficiency query table, the frequency modulation frequency includes the N frequency points, the N frequency points correspond one-to-one to the N load samples included in the first historical load sequence, and the value of N is obtained by dividing the duration of the operation corresponding to the first historical load sequence by the statistical period of the first historical load sequence; determining multiple power consumption values ​​corresponding one-to-one to multiple load statistical periods according to the N power consumption values ​​corresponding one-to-one to the N frequency points.

[0026] In a second aspect, a frequency modulation device is provided, the device comprising: a determination unit, for determining a frequency modulation frequency based on a first historical load sequence in response to a first operation of a user, the first historical load sequence being the latest statistical historical load sequence among M historical load sequences, and M being a positive integer greater than or equal to 1; the determination unit, for determining a frequency modulation period based on a first power consumption budget and the frequency modulation frequency, the first power consumption budget being a power consumption budget corresponding to the first operation obtained based on a temperature rise prediction; a frequency modulation unit, for performing frequency modulation according to the frequency modulation period and the frequency modulation frequency.

[0027] Optionally, the first operation includes any one of an application launch operation, a click operation, a slide operation, a window switch operation, and a code scanning operation.

[0028] Optionally, the M historical load sequences are arranged in a first-in-first-out manner, with the first historical load sequence among the M historical load sequences (the historical load sequence that is counted first) entering the queue first, and the Mth historical load sequence among the M historical load sequences (the historical load sequence that is counted most recently) entering the queue last. That is to say, the above-mentioned historical load sequence can also be interpreted as the Mth historical load sequence among the M historical load sequences.

[0029] Optionally, the method for obtaining the first power consumption budget based on the temperature rise prediction may be: calculating the target whole machine current of the current device, and the value obtained by multiplying the target whole machine current by 3.8V is the first power consumption budget.

[0030] In the embodiment of the present application, the frequency modulation period is determined based on the most recent historical load sequence corresponding to the same scene and the power consumption budget of the current scene, so that dynamic adjustment of the frequency modulation period can be achieved, thereby avoiding undersupply and oversupply, that is, waste of power consumption can be avoided; and, the method determines the frequency modulation frequency based on the most recent statistical load sequence of the current scene, so that the frequency supply can respond to changes in the load in a timely manner, achieving a "fast up and fast down" effect, and achieving a balance between performance and power consumption.

[0031] In combination with the second aspect, in a possible implementation manner, the device further includes: a resource reserving unit, configured to, in response to a first operation of the user, reserve resources based on the M historical load sequences.

[0032] In the embodiment of the present application, the risk of high load of the whole machine can be identified in advance based on the historical load sequence, and resources can be reserved, which can reduce the problem of insufficient resource supply during the frequency modulation process caused by high load of the whole machine.

[0033] In combination with the second aspect, in a possible implementation method, the resource reservation unit is specifically used to: determine a first average value based on the M historical load sequences, and the first average value is the average value of the M×N load samples included in the M historical load sequences; perform background cleaning until the sum of the first average value and the current CPU load is less than 100%, thereby completing resource reservation.

[0034] In the embodiment of the present application, the risk of high load of the whole machine can be identified in advance based on the historical load sequence, and resources can be reserved, which can reduce the problem of insufficient resource supply during the frequency modulation process caused by high load of the whole machine.

[0035] In combination with the second aspect, in a possible implementation, the resource reservation unit is specifically used to: determine the maximum value among the M×N load samples included in the M historical load sequences; perform background cleanup until the sum of the maximum value and the current CPU load is less than 100%, thereby completing resource reservation.

[0036] In the embodiment of the present application, the risk of high load of the whole machine can be identified in advance based on the historical load sequence, and resources can be reserved, which can reduce the problem of insufficient resource supply due to the high load of the whole machine. Moreover, through the device, resource reservation can be implemented based on the maximum value of multiple historical load samples, which can make the reserved resources more sufficient and avoid the insufficient resource supply in the frequency modulation process due to the high load of the whole machine to a greater extent.

[0037] In combination with the second aspect, in a possible implementation manner, the device further includes: a load statistics unit, configured to count a first load sequence corresponding to the first operation, wherein a load statistics period of the first load sequence is 4 milliseconds.

[0038] In the embodiment of the present application, the load sequence corresponding to the first operation can be synchronously counted during the process of the first operation, so that after the first operation is completed, the counted load sequence can be promptly updated to M historical load sequences for use in subsequent frequency modulation processes. In addition, in the process of counting the load sequences, the load counting period used is small, so that the subsequently determined frequency modulation period can meet the performance requirements.

[0039] In combination with the second aspect, in a possible implementation manner, the device further includes: an updating unit, configured to update the M historical load sequences according to the first load sequence.

[0040] In an embodiment of the present application, when a user performs a new scenario operation, the load sequence corresponding to the operation will be recorded in a timely manner, and after the operation is completed, the recorded load sequence will be updated to M historical load sequences in a timely manner, thereby ensuring that the M historical load sequences remain the load sequences of the most recent M statistics, making the resources reserved according to the M historical load sequences more reasonable, and making the frequency modulation period and frequency modulation frequency determined according to the historical load sequences more accurate, thereby further reducing power consumption overhead while achieving precise frequency modulation.

[0041] In combination with the second aspect, in a possible implementation, the updating unit is specifically used to: remove the historical load sequence with a sequence number 1 from the M historical load sequences in a first-in-first-out manner, and use the first historical load sequence as the historical load sequence with a sequence number M.

[0042] In an embodiment of the present application, the updating process of the M historical load sequences adopts a first-in-first-out form, so that the Mth historical load sequence among the M historical load sequences can always be the most recently counted load sequence. In this way, when the frequency modulation period and frequency modulation frequency are determined using the most recently counted historical load sequence, the most recently counted load sequence can be called quickly and accurately, which can improve the efficiency and accuracy of frequency modulation to a certain extent.

[0043] In combination with the second aspect, in a possible implementation method, the determination unit is specifically used to: determine the first power consumption budget; determine a first difference by subtracting the current power consumption of the entire machine from the first power consumption budget; when the first difference is less than or equal to 0, determine that the frequency modulation period is 20 milliseconds; or, when the first difference is greater than 0, determine multiple power consumption values ​​corresponding to multiple load statistical periods based on the frequency modulation frequency, and the multiple load statistical periods include 4 milliseconds, 8 milliseconds, 12 milliseconds, 16 milliseconds, and 20 milliseconds; determine the load statistical period corresponding to the power consumption value with the highest matching degree with the first difference among the multiple power consumption values ​​corresponding to the multiple load statistical periods as the frequency modulation period.

[0044] Among them, the current power consumption of the whole machine = the current current of the whole machine × 3.8V.

[0045] In an embodiment of the present application, the frequency modulation period is determined based on the most recent historical load sequence corresponding to the same scenario and the power consumption budget of the current scenario (obtained based on the temperature rise prediction), and the temperature rise prediction is incorporated into the frequency modulation basis. This can achieve dynamic and accurate adjustment of the frequency modulation period to avoid undersupply and oversupply, that is, to avoid waste of power consumption.

[0046] In combination with the second aspect, in a possible implementation method, the determination unit is also specifically used to: determine N power consumption values ​​corresponding one-to-one to the N frequency points according to an energy efficiency query table, the frequency modulation frequency includes the N frequency points, the N frequency points correspond one-to-one to the N load samples included in the first historical load sequence, and the value of N is obtained by dividing the duration of the operation corresponding to the first historical load sequence by the statistical period of the first historical load sequence; determine multiple power consumption values ​​corresponding one-to-one to multiple load statistical periods according to the N power consumption values ​​corresponding one-to-one to the N frequency points.

[0047] In a third aspect, an electronic device is provided, comprising a memory and a processor, wherein the memory is used to store computer program code, and the processor is used to execute the computer program code stored in the memory to implement the method in the above-mentioned first aspect or any possible implementation manner of the first aspect.

[0048] In a fourth aspect, a computer-readable storage medium is provided, in which a computer program or instruction is stored. When the computer program or instruction is executed, the method in the above-mentioned first aspect or any possible implementation manner of the first aspect is implemented.

[0049] In a fifth aspect, a chip is provided, in which instructions are stored. When the instructions are executed on a device, the chip executes the method in the above-mentioned first aspect or any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 is a schematic flow chart of a frequency modulation method provided in an embodiment of the present application;

[0051] Figure 2 It is a schematic diagram of a task entering a scheduler queue provided by an embodiment of the present application;

[0052] Figure 3 is a schematic flow chart of an existing frequency modulation method provided in an embodiment of the present application;

[0053] Figure 4 It is a code schematic diagram corresponding to a frequency modulation process provided in an embodiment of the present application;

[0054] Figure 5is a graph showing the change of load demand (performance supply) over time in a sliding scenario provided by an embodiment of the present application;

[0055] Figure 6 is a schematic flow chart of another existing frequency modulation method provided in an embodiment of the present application;

[0056] Figure 7 is a schematic diagram of a method for obtaining N loads provided in an embodiment of the present application;

[0057] Figure 8 is a schematic flow chart of a frequency modulation method provided in an embodiment of the present application;

[0058] Fig. 9 This is a load sequence schematic diagram provided in an embodiment of the present application;

[0059] Fig.10 is a schematic flow chart of another frequency modulation method provided in an embodiment of the present application;

[0060] Fig.11 is a schematic flow chart of a resource reservation method provided in an embodiment of the present application;

[0061] Fig.12 is a schematic flow chart of another resource reservation method provided in an embodiment of the present application;

[0062] Fig.13 is a schematic flow chart of a method for determining a frequency modulation period provided in an embodiment of the present application;

[0063] Fig.14 is a schematic flow chart of a method for calculating power consumption corresponding to a load statistical period provided by an embodiment of the present application;

[0064] Fig.15 is a schematic flow chart of a method for updating M historical load sequences provided in an embodiment of the present application;

[0065] Fig.16 This is a comparison diagram of the effects of a frequency modulation method provided by the present application and an existing boost frequency modulation method provided by an embodiment of the present application;

[0066] Fig.17 It is a system architecture diagram corresponding to a frequency modulation method provided in an embodiment of the present application;

[0067] Fig.18 It is a functional module diagram of a frequency modulation device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0068] The technical solution in the present application will be described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments.

[0069] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "plurality" or "multiple" refers to two or more than two.

[0070] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0071] The terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one, two or more. The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.

[0072] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "one embodiment", "some embodiments", "another embodiment", "some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.

[0073] The technical solution of the embodiments of the present application can be applied to Android, IOS, Hongmeng and other systems.

[0074] With the popularization of smart devices, users have increasingly higher requirements for the response efficiency, completion efficiency and stability of operating electronic devices. Although the current frequency modulation scheme can achieve rapid response to tasks, it also brings about a large power consumption overhead.

[0075] Figure 1 FIG. 1 is a schematic flow chart of a frequency modulation method 100 provided in an embodiment of the present application. Figure 1 As shown, the method 100 includes:

[0076] S101: The task enters the scheduler queue corresponding to its own priority according to its own priority.

[0077] Among them, different scheduler queues correspond to different scheduling strategies.

[0078] S102: Perform load calculation during task execution.

[0079] Optionally, when the task starts executing, load calculation is performed according to the WALT (windows-assisted load tracking) or PELT (per entity load tracing) algorithm. The calculated load can be understood as the amount of resources required for the task execution, or can be understood as the number of instructions that the task needs to execute per unit time. Generally, the higher the load, the higher the CPU frequency required.

[0080] S103: Frequency adjustment is performed according to the result of load calculation.

[0081] Optionally, based on the result of load calculation, the frequency of the CPU core that can meet the resource requirements of the task is determined. If the current CPU's highest frequency cannot meet the resource requirements corresponding to the task execution (that is, the current CPU's highest frequency is less than the task's resource requirements, such as currently running on a CPU small core), it will switch to a CPU medium core or a CPU large core that can provide that frequency, thereby achieving the purpose of frequency regulation.

[0082] In order to more clearly understand the above step S101, illustratively, Figure 2 A schematic diagram showing a task entering a scheduler queue is shown.

[0083] like Figure 2As shown, the scheduler queue may include a stop scheduler, a deadline scheduler, a real-time (RT) scheduler, a completely fair (CFS) scheduler, and an idle (IDLE-Task) scheduler.

[0084] Among them, the stop scheduler belongs to the highest priority scheduling class, which can preempt all other processes but cannot be preempted by other processes; the deadline scheduler can use a red-black tree to sort processes according to absolute deadlines and select the smallest process for scheduling; the RT scheduler is used to maintain a queue for each priority; the CFS scheduler adopts a completely fair scheduling algorithm and introduces the concept of virtual running time; the IDLE-Task scheduler is used to schedule and run idle threads when no other processes can be scheduled. Each CPU will have an idle thread.

[0085] Among them, the stop scheduler and IDLE-Task scheduler are only used by the Linux kernel and cannot be selected by users.

[0086] In one example, when a task enters a deadline scheduler queue, the scheduling policy corresponding to the deadline scheduler queue is a deadline process scheduling policy (SCHED_DEADLINE), so that the task selects the deadline scheduler for scheduling and running;

[0087] In another example, when a task enters the RT scheduler queue, the scheduling policies corresponding to the RT scheduler queue are the real-time process scheduling policy (SCHED_RR) and the real-time process scheduling policy (SCHED_FIFO), wherein the real-time process scheduling policy (SCHED_RR) is a time slice rotation, and after the process uses up the time slice, it is added to the tail of the running queue corresponding to the priority, and the CPU is given to other processes of the same priority; the real-time process scheduling policy (SCHED_FIFO) is a first-in-first-out scheduling, without a time slice, and in the absence of a higher priority, it can only wait to actively give up the CPU;

[0088] In another example, when a task enters the CFS scheduler queue, the scheduling policies corresponding to the CFS scheduler queue are the normal process scheduling policy (SCHED_NORMAL), the normal process scheduling policy (SCHED_BATCH) and the normal process scheduling policy (SCHED_IDLE), among which the normal process scheduling policy (SCHED_NORMAL) is used to enable the task to select the CFS scheduler for scheduling and operation; the normal process scheduling policy (SCHED_BATCH) is batch processing, which enables the task to select the CFS scheduler for scheduling and operation, and the normal process scheduling policy (SCHED_IDLE) is used to enable the task to select the CFS scheduler for scheduling and operation with the lowest priority.

[0089] Among them, the RT scheduler corresponds to real-time processes, and the CFS scheduler corresponds to ordinary processes. The smaller the value of the priority corresponding to each scheduler queue, the higher the priority; and the priority value = nice value + 120. Ordinary processes can adjust their priorities by modifying the nice value.

[0090] Furthermore, with respect to the above step S103, there are two specific frequency modulation methods in the prior art.

[0091] Figure 3 FIG. 3 is a schematic flow chart of an existing frequency modulation method 300 provided in an embodiment of the present application. Figure 3 As shown, the method 300 includes:

[0092] S301: Identify the first operation of the user.

[0093] The first operation of the user refers to the operation of the user triggering the execution of the task on the electronic device.

[0094] Optionally, the first operation can be any one of an application launch operation, a click operation, a sliding operation, and a window switching operation. In addition, the first operation can also be other operations that trigger task execution, such as: an unlock operation, an edit operation, a return operation, etc. This application does not limit this.

[0095] Optionally, the terminal device equipped with the Android system has a boost frequency modulation mechanism, through which modules such as the application manager service (AMS) and the window manager service (WMS) at the framework layer of the Android system recognize the user's first operation.

[0096] S302: Raise the lowest frequency of the CPU to a value greater than or equal to a first empirical value, and maintain the lowest frequency of the CPU greater than or equal to the first empirical value during a first time period.

[0097] After recognizing the user's first operation, the electronic device will quickly increase the CPU frequency in a short period of time. The higher the CPU frequency, the faster the task execution speed, and thus the task corresponding to the first operation can be completed quickly.

[0098] The first experience value is the frequency at which the resource requirement of the task can be met.

[0099] S303: After exceeding the first time period, free frequency modulation is restored.

[0100] In order to more clearly understand the above step S302, illustratively, Figure 4Shows a schematic diagram of the code corresponding to the frequency modulation process provided by an embodiment of the present application.

[0101] In Figure 4 The code line <cnd id="4099" power="13205" name="app_start" is the code related to the application startup, where "4099" and "13205" are the relevant scenario numbers for the application startup.

[0102] <action>

[0103] <lit_cpu0_min_freq>1700000< / lit_cpu0_min_freq>

[0104] <mid_cpu0_min_freq>2343000< / mid_cpu0_min_freq>

[0105] <big_cpu0_min_freq>2631000< / big_cpu0_min_freq>

[0106] < / action>

[0107] In the above action code,

[0108] The code line "<lit_cpu0_min_freq>1700000< / lit_cpu0_min_freq>" means to increase the minimum frequency point of the CPU little core to 1700000;

[0109] The code line "<mid_cpu0_min_freq>2343000< / mid_cpu0_min_freq>" means to increase the minimum frequency point of the CPU middle core to 2343000;

[0110] The code line "<big_cpu0_min_freq>2631000< / big_cpu0_min_freq>" means to increase the minimum frequency point of the CPU big core to 2631000.

[0111] From Figure 4 It can be seen that the boost mechanism increases the minimum frequency points of the CPU, namely lit_cpu0_min_freq, mid_cpu0_min_freq, and big_cpu0_min_freq, in a short time.

[0112] Taking the user's first operation as a swipe operation as an example,示例性地, Figure 5 Shows a curve diagram of the load demand (performance supply) changing with time in a swipe scenario provided by an embodiment of the present application.

[0113] As Figure 5 shown, the solid line curve represents the curve diagram of the actual load demand changing with time, the dashed line curve represents the curve diagram of the linu native load prediction changing with time, and the dashed line with triangular marks represents the boost performance supply of the swipe event. From Figure 5 it can be known that for low-load scenarios such as videos, the boost performance supply curve of the swipe event is higher than the actual load curve (see Figure 5The boost mechanism raises the CPU frequency too high, resulting in over-supply of frequency and wasting power. For the small probability of sudden high load during the sliding process, the performance supply curve of the sliding event boost is lower than the actual load curve (see Figure 5 In the B area shown in the figure, the boost mechanism fails to increase the CPU frequency in time, resulting in insufficient supply, which will cause the task delay to fail to meet the requirements or cause frame loss and jamming. In addition, due to Figure 5 It can be seen that the LINU native load prediction curve has an obvious lag compared to the actual load curve, which may also lead to excessive CPU frequency increase or untimely CPU frequency increase.

[0114] The Android system kernel is usually modified and optimized based on the Linux kernel, and the native free frequency adjustment strategy of the Linux kernel cannot achieve the purpose of fast frequency increase according to the task load in the scenario where the user performs the first operation. In this method, due to the intervention of the boost strategy, the minimum frequency of the CPU can be immediately increased to a certain empirical value after the above scenario is identified, and the free frequency adjustment is restored after a period of time (same time).

[0115] However, this one-step frequency increase method first has the problem of over-supply of frequency, which leads to waste of power consumption. In addition, the subsequent free frequency modulation stage also has the problem of under-supply, which leads to the failure to meet the task delay or frame loss and jamming.

[0116] Figure 6 FIG. 6 is a schematic flow chart of another existing frequency modulation method 600 provided in an embodiment of the present application. Figure 6 As shown, the method 600 includes:

[0117] S601: Obtain an i-th load according to the CPU load condition in an i-th time period, where i=1, 2, 3, ..., N, and i and N are both positive integers.

[0118] S602: Calculate based on N loads to obtain the CPU frequency required for the current task.

[0119] Optionally, the maximum value of the Nth load and the average value of N loads is taken as the CPU frequency required for the current task.

[0120] S603: Adjust the CPU frequency according to the CPU frequency required by the current task.

[0121] In order to more clearly understand the above step S601, illustratively, Figure 7 A schematic diagram of a method for obtaining N loads provided in an embodiment of the present application is shown.

[0122] like Figure 7 As shown, the loads corresponding to the first scenario are 3, 3, 4, 7, and 5. When the first scenario ends and switches to the second scenario, the newly generated load is 6. The N (N=5 in this example) loads obtained follow the first-in-first-out rule. The first load 3 goes out and the latest load 6 comes in. At this time, the loads corresponding to the second scenario are 3, 4, 7, 5, and 6. In addition, the CPU frequency required for the current task (the task corresponding to the second scenario) is 6 (the average value of 3, 4, 7, 5, and 6 (5) and the maximum value of the later entrants (6)).

[0123] In this method, the CPU frequency value required to execute the current task is obtained by statistical calculation based on the load in the past period of time. The prediction period is long and the accuracy is poor, which leads to a lag in frequency regulation. When the calculated value is used to predict the CPU frequency required in the future, it is easy to cause oversupply or undersupply. In addition, the default load calculation period is 20ms, which has poor real-time performance and is easy to cause "undersupply".

[0124] In view of this, an embodiment of the present application provides a frequency modulation method and device, through which the load statistical period can be dynamically adjusted based on the user's operating scenario and power consumption budget to achieve precise frequency modulation, so as to avoid undersupply and oversupply while maintaining good performance of the electronic device, that is, to avoid waste of power consumption.

[0125] For example, Figure 8 FIG. 8 is a schematic flow chart of a frequency modulation method 800 provided in an embodiment of the present application. Figure 8 As shown, the method 800 includes:

[0126] S801: In response to a user performing a first operation, determining a frequency modulation period based on M historical load sequences and a first power consumption budget, where M is greater than or equal to 1.

[0127] The first power consumption budget refers to the power consumption budget of the current scenario obtained based on the temperature rise prediction.

[0128] Specifically, the frequency modulation period is determined based on the Mth historical load sequence among M historical load sequences and the first power consumption budget, wherein the Mth historical load sequence among M historical load sequences refers to the load sequence that last entered the historical load sequence, that is, the most recently counted historical load sequence.

[0129] Optionally, in this step, determining the frequency modulation period based on the M historical load sequences and the first power consumption budget may also occur before the user performs the first operation, for example, may occur after the user performs an operation previous to the first operation and before performing the first operation.

[0130] Optionally, the value of M may be any integer in the range of 3-10, for example, 3, 4, or 5.

[0131] Among them, in one example, the first operation is the fourth click operation, then the M historical load sequences correspond to the user's first click operation, second click operation, and third click operation respectively, and the first click operation, second click operation, and third click operation occur before the fourth click operation, and the third click operation is the previous click operation of the fourth click operation.

[0132] Each of the M historical load sequences includes N load samples. That is, the number of load samples included in the M historical load sequences is M×N.

[0133] The value of N=the duration of the operation corresponding to the historical load sequence / the statistical period of the historical load sequence. The statistical period of the historical load sequence can be any one of 4ms, 8ms, 12ms, 16ms, and 20ms.

[0134] For example, operation A corresponds to the first historical load sequence. When the load statistical period corresponding to the first historical load sequence is 20 ms, the number of load samples N included in the first historical load sequence = the duration of operation A / 20 ms.

[0135] In one implementation, five power consumption budget values ​​are first determined based on the historical load sequence, and the five power consumption budget values ​​correspond to statistical periods of 4ms, 8ms, 12ms, 16ms, and 20ms, respectively; then the power consumption budget of the current scene (i.e., the first power consumption budget) is determined based on the temperature rise prediction; finally, the frequency modulation period is determined based on the five power consumption budget values ​​and the power consumption budget of the current scene. The detailed method for determining the frequency modulation period is described in the subsequent embodiments.

[0136] S802: In response to a user performing a first operation, counting a first load sequence corresponding to the first operation.

[0137] The first load sequence includes N load samples.

[0138] The value of N=the duration of the first operation / the statistical period of the first load sequence, wherein the statistical period of the first load sequence is 4 ms.

[0139] Optionally, before step S802, the method may further include the step of adjusting the statistical period of the first load sequence to 4 ms, wherein the statistical period of the first load sequence may be adjusted by changing the Linux kernel walt related code.

[0140] S803: Determine a frequency modulation frequency (also referred to as a frequency point) based on the Mth historical load sequence among the M historical load sequences.

[0141] Specifically, according to N load samples included in the Mth historical load sequence among the M historical load sequences, N frequencies corresponding to the N load samples are determined, and the N frequencies are used as frequency modulation frequencies.

[0142] S804: Perform frequency modulation according to the frequency modulation period and the frequency modulation frequency.

[0143] Optionally, the above step S802 is an optional step.

[0144] In the embodiment of the present application, the frequency modulation period is determined based on the most recent historical load sequence corresponding to the same scene and the power consumption budget of the current scene, so that dynamic adjustment of the frequency modulation period can be achieved to avoid undersupply and oversupply, that is, waste of power consumption can be avoided; and, the method determines the frequency modulation frequency based on the most recent statistical load sequence of the current scene, so that the frequency supply can respond to changes in the load in a timely manner, achieving a "fast up and fast down" effect, and achieving a balance between performance and power consumption.

[0145] In order to more clearly understand the above load sequence (eg, historical load sequence, first load sequence), illustratively, Fig. 9 A load sequence schematic diagram provided in an embodiment of the present application is shown.

[0146] like Fig. 9 As shown in the figure, the load sequence corresponding to two click operations, the load sequence corresponding to two slide operations, the load sequence corresponding to two return operations, the load sequence corresponding to four browsing periods, and the load sequence corresponding to one idle period are shown. Among them, the load corresponding to the execution process of the click operation and the return operation is the largest, followed by the slide operation, and the load corresponding to the idle period and the browsing period is almost 0. In other words, the load conditions corresponding to different operations are generally different, and the load conditions corresponding to some operations may be very different, for example: between the click operation and the slide operation.

[0147] For example, Fig.10 FIG. 1 is a schematic flow chart of another frequency modulation method 1000 provided in an embodiment of the present application. Fig.10 As shown, the method 1000 includes:

[0148] S1001: In response to a user performing a first operation, resource reservation is performed based on M historical load sequences.

[0149] Optionally, resource reservation based on the M historical load sequences may also occur before the user performs the first operation.

[0150] Optionally, the value of M may be any integer in the range of 3-10, for example, 3, 4, or 5.

[0151] Each of the M historical load sequences includes N load samples. That is, the number of load samples included in the M historical load sequences is M×N.

[0152] The value of N=the duration of the operation corresponding to the historical load sequence / the statistical period of the historical load sequence. The statistical period of the historical load sequence can be any one of 4ms, 8ms, 12ms, 16ms, and 20ms.

[0153] For example, operation A corresponds to the first historical load sequence. When the load statistical period corresponding to the first historical load sequence is 20 ms, the number of load samples N included in the first historical load sequence = the duration of operation A / 20 ms.

[0154] Optionally, firstly, an average value or a maximum value of M×N load samples included in the M historical load sequences is calculated based on the M historical load sequences, and then resource reservation is performed based on the average value or the maximum value of the M×N load samples included in the M historical load sequences. For a more detailed introduction to resource reservation, see the description in the subsequent embodiments.

[0155] S1002: Calculate power consumption corresponding to five load statistical periods (4 ms, 8 ms, 12 ms, 16 ms, and 20 ms) based on the Mth historical load sequence among the M historical load sequences.

[0156] The Mth historical load sequence among the M historical load sequences refers to the load sequence that enters the historical load sequence last, that is, the historical load sequence that was most recently counted.

[0157] Specifically, the N frequencies corresponding to the N load samples included in the Mth historical load sequence are first calculated respectively, and then the N power consumptions corresponding to the N frequencies are determined respectively based on the energy efficiency query table, and finally the power consumption corresponding to the load statistical period is determined based on the N power consumptions and the load statistical period. For a more detailed introduction to this step, see the description in the subsequent embodiments.

[0158] The five load statistical cycles are 4 ms, 8 ms, 12 ms, 16 ms, and 20 ms respectively; based on the Mth historical load sequence among the M historical load sequences, the five load statistical cycles are calculated respectively to obtain five power consumption values ​​corresponding to the five load statistical cycles.

[0159] S1003: Determine a frequency modulation period according to the power consumption corresponding to the above five load statistical periods (4 ms, 8 ms, 12 ms, 16 ms, and 20 ms) and a first power consumption budget.

[0160] The first power consumption budget refers to the power consumption budget of the current scenario obtained based on the temperature rise prediction.

[0161] For a more detailed introduction to this step, please refer to the description in the subsequent embodiments.

[0162] It can be understood that the above steps S1001 to S1003 may occur before the first operation.

[0163] It can be understood that: the execution order of the above steps S1001 and S1002 is not limited, and the execution order of the above steps S1002 and S1103 is not limited.

[0164] S1004: In response to a user performing a first operation, counting a first load sequence corresponding to the first operation.

[0165] The first load sequence includes N load samples.

[0166] The value of N=the duration of the first operation / the statistical period of the first load sequence, wherein the statistical period of the first load sequence is 4 ms.

[0167] Optionally, before step S1004, the method may further include the step of adjusting the statistical period of the first load sequence to 4 ms, wherein the statistical period of the first load sequence may be adjusted by changing the Linux kernel walt related code.

[0168] The above load statistics cycle may also be called a walt cycle.

[0169] S1005: Update M historical load sequences in real time.

[0170] Optionally, the M historical load sequences are updated in a first-in-first-out manner.

[0171] The explanation of the update method of M historical load sequences can be found in Figure 7 Description of the illustrated embodiment.

[0172] S1006: Determine a frequency modulation frequency (also referred to as a frequency point) based on the Mth historical load sequence.

[0173] Specifically, N frequencies corresponding to the N load samples are determined according to the N load samples included in the Mth historical load sequence, and the N frequencies are used as frequency modulation frequencies.

[0174] It can be understood that the execution order of step S1006 and steps S1004-S1005 is not limited.

[0175] It can be understood that the execution order of step S1006 and steps S1001 - S1003 is not limited.

[0176] S1007: Perform frequency modulation according to the frequency modulation period and the frequency modulation frequency.

[0177] In the embodiment of the present application, the risk of high load of the whole machine can be identified in advance based on the historical load sequence, and resources can be reserved, which can reduce the problem of insufficient resource supply due to high load of the whole machine; and, the method determines the frequency modulation period based on the most recent historical load sequence corresponding to the same scene and the power consumption budget of the current scene, which can realize dynamic adjustment of the frequency modulation period to avoid undersupply and oversupply, that is, it can avoid power consumption waste; in addition, the method determines the frequency modulation frequency based on the most recent statistical load sequence of the same scene, so that the frequency supply can respond to the change of load in time, achieve the effect of "fast up and fast down", and realize the balance between performance and power consumption.

[0178] In order to more clearly understand the above step S1001 (resource reservation based on M historical load sequences), illustratively, Fig.11 FIG. 1 is a schematic flow chart of a resource reservation method 1100 provided in an embodiment of the present application. Fig.11 As shown, the method 1100 includes:

[0179] S1101: Record M historical load sequences, each of which includes N load samples.

[0180] Optionally, the load statistic value can be recorded as predict_load[i][j], where: i represents the i-th load sequence, j represents the j-th load sample in the load sequence, that is, predict_load[i][j] represents the load statistic value corresponding to the j-th load sample in the i-th load sequence, i = 1, 2, ..., M; j = 0, 1, 2, ..., N-1.

[0181] Similarly, the i-th load sequence can be recorded as predict_load[i].

[0182] Optionally, the value of M may be any integer in the range of 3-10, for example, 3, 4, or 5.

[0183] Each of the M historical load sequences includes N load samples. That is, the number of load samples included in the M historical load sequences is M×N.

[0184] The value of N=the duration of the operation corresponding to the historical load sequence / the statistical period of the historical load sequence. The statistical period of the historical load sequence can be any one of 4ms, 8ms, 12ms, 16ms, and 20ms.

[0185] For example, operation A corresponds to the first historical load sequence. When the load statistical period corresponding to the first historical load sequence is 20 ms, the number of load samples N included in the first historical load sequence = the duration of operation A / 20 ms.

[0186] S1102: Calculate the average value of M×N load samples.

[0187] The average value of the M×N load samples=the sum of the M×N load samples / (M×N).

[0188] S1103: Perform background load cleanup until the condition (average value of M×N load samples + current CPU load rate (proc / stat)) < 100% is met, and resource reservation is completed.

[0189] Optionally, the background load cleaning may be performed by preferentially freezing the processes irrelevant to the foreground for a short time (for example, freezing by the native mechanism of the operating system) based on the relevance of the current process to the foreground.

[0190] After completing resource reservation, the normal free frequency modulation process is restored; and after the first operation is completed, the M historical load sequences are updated (see step S1005).

[0191] Optionally, in response to the user performing a first operation, step S1103 is performed.

[0192] In the embodiment of the present application, the risk of high load of the whole machine can be identified in advance based on the historical load sequence, and resources can be reserved, which can reduce the problem of insufficient resource supply caused by high load of the whole machine.

[0193] and Fig.11 The embodiments shown are juxtaposed, exemplarily, Fig.12 FIG. 1 is a schematic flow chart of another resource reservation method 1200 provided in an embodiment of the present application. Fig.12 As shown, the method 1100 includes:

[0194] S1201: Record M historical load sequences, each of which includes N load samples.

[0195] The explanation of this step is the same as above. Fig.11 The explanation of step S1101 in the illustrated embodiments is the same and will not be repeated here for the sake of brevity.

[0196] S1202: Determine the maximum value among M×N load samples.

[0197] Among them, the maximum value among the M×N load samples is the maximum value among predict_load[1][0], predict_load[1][1], predict_load[1][2], predict_load[1][3], …, predict_load[1][N-1]; …; predict_load[M][0], predict_load[M][1], predict_load[M][2], predict_load[M][3], …, predict_load[M][N-1].

[0198] S1203: Perform background load cleanup until the condition (maximum value among M×N load samples + current CPU load rate) < 100% is met, and resource reservation is completed.

[0199] Optionally, the background load cleaning may be performed by preferentially freezing the processes irrelevant to the foreground for a short time (for example, freezing by the native mechanism of the operating system) based on the relevance of the current process to the foreground.

[0200] After completing resource reservation, the normal free frequency modulation process is restored; and after the first operation is completed, the M historical load sequences are updated (see step S1005).

[0201] Optionally, in response to the user performing a first operation, step S1203 is performed.

[0202] In the embodiment of the present application, the high load risk of the whole machine can be identified in advance based on the historical load sequence, and resources can be reserved, which can reduce the problem of insufficient resource supply caused by the high load of the whole machine. In addition, the method of this embodiment is similar to Fig.11 Compared with the method of the illustrated embodiment, reserving resources based on the maximum value of multiple historical load samples can make the reserved resources more sufficient and can avoid insufficient resource supply due to high load of the entire machine to a greater extent.

[0203] In order to more clearly understand the above steps S801, S1002 and S1003 (determining the frequency modulation period based on M historical load sequences and the first power consumption budget), illustratively, Fig.13 FIG. 1 is a schematic flow chart of a method 1300 for determining a frequency modulation period provided in an embodiment of the present application. Fig.13 As shown, the method 1300 includes:

[0204] S1301: Record M historical load sequences, each of which includes N load samples.

[0205] The explanation of this step is the same as above. Fig.11 The explanation of step S1101 in the illustrated embodiments is the same and will not be repeated here for the sake of brevity.

[0206] S1302: Calculate power consumption corresponding to five load statistical periods based on the Mth historical load sequence among the M historical load sequences.

[0207] The explanation of this step is the same as above. Fig.10 The explanation of step S1002 in the illustrated embodiments is the same and will not be repeated here for the sake of brevity.

[0208] S1303: Calculate the target whole-machine current corresponding to the device.

[0209] Target whole machine current (Target_current) = device cooling capability (cool_ability) × (device target temperature (target_thermal) - ambient temperature (env_thermal)).

[0210] Among them, the heat dissipation capacity of the device is a fixed value, which is determined by the product hardware configuration and can be obtained by actual measurement. Its unit is mA / ℃; the target temperature of the device is defined by the terminal manufacturer and its unit is ℃; the ambient temperature can be obtained by fitting based on the terminal sensor and its unit is ℃; the unit of the target whole machine current is mA.

[0211] S1304: Calculate the value of Δ.

[0212] Δ=target total current-current total current.

[0213] The current of the whole machine can be directly read through the command, and its unit is mA.

[0214] It can be understood that the target whole machine current × 3.8V is the above Figure 8 The embodiments shown and Fig.10 A first power consumption budget is described in the illustrated embodiment.

[0215] Optionally, Δ=target whole machine power consumption-current whole machine power consumption, wherein target whole machine power consumption=target whole machine current×3.8V, current whole machine power consumption=current whole machine current×3.8V.

[0216] S1305: Determine whether the value of Δ is greater than 0, if not, execute step S1306; if yes, execute step S1307.

[0217] S1306: Determine that the frequency modulation period is 20ms.

[0218] It can be understood that when the value of Δ is less than or equal to 0, it means that the target whole machine current is less than or equal to the current whole machine current, that is, the target whole machine power consumption is less than the current whole machine power consumption. The power consumption increment generated by the current aggressive frequency modulation strategy will cause the temperature rise to worsen, and thus the performance cannot be improved. Accordingly, the frequency modulation period is determined to be 20ms, the maximum value among the 5 levels.

[0219] S1307: Determine the power consumption value with the highest matching degree with Δ among the five power consumption values ​​corresponding to the five load statistical cycles as the target power consumption budget value.

[0220] Optionally, the power consumption value with the highest matching degree with Δ may be a power consumption value closest to the value of Δ.

[0221] Optionally, when Δ=target whole machine current-current whole machine current, the value of Δ can be directly compared with the 5 power consumption values ​​corresponding to the 5 load statistical cycles, and the power consumption value closest to the value of Δ among the 5 power consumption values ​​is determined as the power consumption value with the highest match with Δ; or the value obtained by Δ×3.8V can be directly compared with the 5 power consumption values ​​corresponding to the 5 load statistical cycles, and the power consumption value closest to the value of Δ among the 5 power consumption values ​​is determined as the power consumption value with the highest match with Δ.

[0222] Optionally, when Δ=target whole machine power consumption-current whole machine power consumption, the value of Δ can be directly compared with 5 power consumption values ​​corresponding to 5 load statistical cycles, and the power consumption value closest to the value of Δ among the 5 power consumption values ​​is determined as the power consumption value with the highest matching degree with Δ.

[0223] S1308: Determine the load statistical period corresponding to the target power consumption budget value as the frequency modulation period corresponding to the first operation.

[0224] It can be understood that when the value of Δ is greater than 0, it means that the target whole machine current is greater than the current whole machine current, that is, the current load cannot meet the first power consumption budget, and performance improvement is needed to meet the demand. Accordingly, at this time, the load statistical period corresponding to the power consumption that best matches the value of Δ (with the highest matching degree) can be determined as the frequency modulation period corresponding to the first operation. For example, if the load statistical period corresponding to the power consumption that best matches the value of Δ is 12ms, the frequency modulation period is determined to be 12ms.

[0225] In an embodiment of the present application, the frequency modulation period is determined based on the most recent historical load sequence corresponding to the same scenario and the power consumption budget of the current scenario (obtained based on the temperature rise prediction), and the temperature rise prediction is incorporated into the frequency modulation basis. This can achieve dynamic and accurate adjustment of the frequency modulation period to avoid undersupply and oversupply, that is, to avoid waste of power consumption.

[0226] To understand more clearly Fig.10 Steps S1002 and S1003 described in the embodiment shown in FIG. Fig.13 Step S1302 (calculating the power consumption corresponding to five load statistical cycles respectively) described in the illustrated embodiment is, illustratively, Fig.14 FIG. 1 is a schematic flow chart of a method 1400 for calculating power consumption corresponding to a load statistical period provided by an embodiment of the present application. Fig.14 As shown, the method 1400 includes:

[0227] S1401: Record M historical load sequences, each of which includes N load samples.

[0228] The explanation of this step is the same as above. Fig.11 The explanation of step S1101 in the illustrated embodiments is the same and will not be repeated here for the sake of brevity.

[0229] Optionally, the M×N load samples included in the M historical load sequences can be respectively expressed as:

[0230] predict_load[1][0], predict_load[1][1], predict_load[1][2],…, predict_load[1][N-1];

[0231] , …,

[0232] predict_load[M][0], predict_load[M][1], predict_load[M][2],…, predict_load[M][N-1].

[0233] S1402: Calculate N frequency points (also referred to as frequencies) corresponding to the N load samples of the Mth load sequence respectively.

[0234] Optionally, the calculation formula for the frequency points corresponding to the N load samples of the Mth load sequence may be:

[0235] predict_freq[M][j]=curFreq×predict_load[M][j] / targetload, j=0,1,2,…,N-1, where:

[0236] curFreq refers to the current frequency point, which can be read directly by the device;

[0237] predict_load[M][j] refers to the load statistic corresponding to the jth load sample in the Mth load sequence;

[0238] targetload is the target load, the maximum value is 100 and the minimum value is 1. Different operation scenarios have different corresponding values ​​and can follow the native configuration of each terminal manufacturer.

[0239] Specifically, the N frequency points corresponding to the Mth historical load sequence are:

[0240] predict_freq[M][0]=curFreq×predict_load[M][0] / targetload;

[0241] predict_freq[M][1]=curFreq×predict_load[M][1] / targetload;

[0242] , …,

[0243] predict_freq[M][N-1]=curFreq×predict_load[M][N-1] / targetload.

[0244] S1403: Obtain N power consumption values ​​corresponding to the N frequency points one by one by querying an energy efficiency table.

[0245] In an example, taking Qualcomm Snapdragon 8gen-1 as an example, the energy efficiency table of the small core can be shown in Table 1:

[0246] Table 1

[0247] Frequency Power consumption Frequency Power consumption Frequency Power consumption 556800 51.19 1132800 104.14 1670400 222.24 691200 62.32 1228800 120.54 1804800 253.16 806400 71.95 1324800 129.36 1920000 320.38 940800 82.65 1440000 166.96 2016000 337.71 1056000 93.31 1555200 195.40

[0248] As can be seen from Table 1, in the energy efficiency table, each frequency point corresponds to a power consumption value, and the energy efficiency table can be used to query the power consumption value corresponding to the frequency point according to the frequency point.

[0249] Optionally, the N power consumption values ​​corresponding to the N frequency points can be expressed as:

[0250] predict_freq_power[M][0], predict_freq_power[M][1], predict_freq_power[M][2],…, predict_freq_power[M][N-1].

[0251] S1404: Calculate the power consumption (predict_power) corresponding to five load statistical periods (4ms, 8ms, 12ms, 16ms, and 20ms) respectively according to the N power consumption values.

[0252] Among them, when the load statistical cycle is 4ms, the calculation formula of the power consumption corresponding to the load statistical cycle (4ms) is:

[0253] predict_power = ∑(predict_freq_power[M][j] × cpuUtil[M][j]) × load statistics period, j = 0, 1, 2, ..., N-1, where:

[0254] cpuUtil is called CPU duty cycle / utilization, which can be obtained using the top command in CMD or proc / stat.

[0255] When the load statistical cycle is 8ms, the calculation formula for the power consumption corresponding to the load statistical cycle (8ms) is:

[0256] predict_power = ∑(predict_freq_power[M][j] × cpuUtil[M][j]) × load statistics period / 2, j = 0, 1, 2, ..., N-1 (N is an even number); or,

[0257] predict_power = ∑(predict_freq_power[M][j] × cpuUtil[M][j]) × load statistical cycle / 2, j = 0, 1, 2, ..., N-2 (N is an odd number). When the load statistical cycle is 12ms, the calculation formula for the power consumption corresponding to the load statistical cycle (12ms) is:

[0258] predict_power = ∑(predict_freq_power[M][j]×cpuUtil[M][j])×load statistics period / 3, j = 0, 1, 2, ..., N-1 (N is a multiple of 3); or,

[0259] predict_power = ∑(predict_freq_power[M][j]×cpuUtil[M][j])×load statistics period / 3, j = 0, 1, 2, ..., N-2 (N-1 is a multiple of 3); or,

[0260] predict_power=∑(predict_freq_power[M][j]×cpuUtil[M][j])×load statistics period / 3, j=0, 1, 2, …, N-3 (N-2 is a multiple of 3).

[0261] When the load statistical cycle is 16ms, the calculation formula for the power consumption corresponding to the load statistical cycle (16ms) is:

[0262] predict_power = ∑(predict_freq_power[M][j]×cpuUtil[M][j])×load statistics period / 4, j = 0, 1, 2, ..., N-1 (N is a multiple of 4); or,

[0263] predict_power = ∑(predict_freq_power[M][j]×cpuUtil[M][j])×load statistics period / 4, j = 0, 1, 2, ..., N-2 (N-1 is a multiple of 4); or,

[0264] predict_power = ∑(predict_freq_power[M][j]×cpuUtil[M][j])×load statistics period / 4, j = 0, 1, 2, ..., N-3 (N-2 is a multiple of 4); or,

[0265] predict_power=∑(predict_freq_power[M][j]×cpuUtil[M][j])×load statistics period / 4, j=0, 1, 2, …, N-4 (N-3 is a multiple of 4).

[0266] When the load statistical cycle is 20ms, the calculation formula for the power consumption corresponding to the load statistical cycle (20ms) is:

[0267] predict_power = ∑(predict_freq_power[M][j]×cpuUtil[M][j])×load statistics period / 5, j=0, 1, 2, ..., N-1 (N is a multiple of 5); or,

[0268] predict_power = ∑(predict_freq_power[M][j]×cpuUtil[M][j])×load statistics period / 5, j = 0, 1, 2, ..., N-2 (N-1 is a multiple of 5); or,

[0269] predict_power = ∑(predict_freq_power[M][j]×cpuUtil[M][j])×load statistics period / 5, j = 0, 1, 2, ..., N-3 (N-2 is a multiple of 5); or,

[0270] predict_power = ∑(predict_freq_power[M][j]×cpuUtil[M][j])×load statistics period / 5, j = 0, 1, 2, ..., N-4 (N-3 is a multiple of 5); or,

[0271] predict_power=∑(predict_freq_power[M][j]×cpuUtil[M][j])×load statistics period / 5, j=0, 1, 2, …, N-5 (N-4 is a multiple of 5).

[0272] It is understandable that:

[0273] The statistical calculation method of the load in walt is:

[0274] cpuLoad = cpuUtil * 100 / CPU_capacity, where

[0275] cpuUtil is called cpu duty cycle / utilization, which can be obtained using the top command in cmd or proc / stat;

[0276] CPU capacity is a normalized value between 0 and 1024, which is usually a fixed value (different terminal manufacturers may have different configurations in different scenarios).

[0277] The calculation method of native frequency modulation based on load is:

[0278] NextFreq = curFreq*cpuLoad / targetload, where targetload is 100 at most and 1 at least. The configuration varies in different scenarios and can follow the native configuration of each terminal manufacturer.

[0279] The value in predict_load[i][j] is cpuLoad, so the calculation formula for the current CPU power consumption can be the above formula: predict_power = ∑(predict_freq_power[M][j]×cpuUtil[M][j])×load statistical period.

[0280] To understand more clearly Fig.10 In the illustrated embodiment, step S1005 (updating M historical load sequences in real time) is exemplarily: Fig.15 FIG. 1 is a schematic flow chart of a method 1500 for updating M historical load sequences provided by an embodiment of the present application. Fig.15 The method 1500 includes:

[0281] S1501: In response to a user performing a first operation, counting a first load sequence.

[0282] The explanation of this step is as follows Figure 8 The explanation of step S802 in the embodiment shown in FIG. Fig.10The explanation of step S1004 in the illustrated embodiments is the same and will not be repeated here for the sake of brevity.

[0283] S1502: In a first-in-first-out manner, remove the historical load sequence with a sequence number 1 from the M historical load sequences, and use the first load sequence as the historical load sequence with a sequence number M, so as to complete the update of the M historical load sequences.

[0284] The specific process of updating M historical load sequences can be found in Figure 7 Description of the illustrated embodiment.

[0285] In an embodiment of the present application, when a user performs a new scenario operation, the load sequence corresponding to the operation will be recorded in a timely manner, and after the operation is completed, the recorded load sequence will be updated to M historical load sequences in a timely manner, and the updating process adopts a first-in-first-out form, thereby ensuring that the M historical load sequences remain the load sequences of the most recent M statistics, so that the resources reserved according to the M historical load sequences are more reasonable, and the dynamic power consumption values ​​obtained according to the M historical load sequences are more referenceable, thereby improving the accuracy of the determined frequency modulation cycle, thereby further reducing power consumption overhead while achieving precise frequency modulation.

[0286] For example, Fig.16 A frequency modulation method provided by the present application and an existing boost frequency modulation method ( Figure 3 1. A comparison diagram of the effects of the method of the embodiment shown in FIG. 1.

[0287] like Fig.16 As shown, the curve marked with a black solid circle represents the change of the actual load over time, the curve marked with a black solid triangle represents the change of the predicted load over time, the curve marked with a hollow circle represents the change of the load corresponding to the frequency modulation method of the present application over time, and the curve marked with a solid four-pointed star represents the change of the load corresponding to the boost frequency modulation method over time.

[0288] Depend on Fig.16 It can be seen that the fitting degree of the curve corresponding to the CPU frequency of the frequency modulation method of the present application (the curve marked with hollow circles) and the curve corresponding to the actual load (the curve marked with black solid circles) is significantly higher than the fitting degree of the curve corresponding to the CPU frequency of the boost frequency modulation method (the curve marked with solid four-pointed stars) and the curve corresponding to the actual load (the curve marked with black solid circles). Compared with the boost frequency modulation method, the frequency modulation method of the present application has a greater power consumption benefit ( Fig.16 The rectangular area filled with medium shadow).

[0289] Depend on Fig.16 It can also be seen that the load cycle ( Fig.16 The figure shows the corresponding load conditions when the load cycle switches between 20ms and 4ms. The shorter the load cycle, the higher the performance; the longer the load cycle, the lower the power consumption. That is to say, the higher the fit between the load change curve provided by the frequency modulation method process (for example, the curve marked with hollow circles) and the actual load (for example, the curve marked with black solid circles), the better the performance and the lower the power consumption. When the fit reaches the required value, the supply of computing power (frequency point) can respond to the change of load in time and achieve the effect of "fast up and fast down", thereby avoiding the problems of oversupply and undersupply.

[0290] For example, Fig.17 FIG. 1 shows a system architecture diagram corresponding to a frequency modulation method provided in an embodiment of the present application. Fig.17 As shown, the system architecture includes a scene perception module 1710, a load statistics and prediction module 1720, a power consumption budget module 1730, a resource reservation module 1740 and a frequency modulation module 1750, wherein the load statistics and prediction module 1720 includes a frequency modulation period determination unit 1721, a load statistics unit 1722 and a load prediction unit 1723, and the frequency modulation module 1750 includes a calculation unit 1751, specifically:

[0291] The scene perception module 1710 is used to identify the user's first operation.

[0292] Optionally, the first operation can be any one of an application launch operation, a click operation, a sliding operation, and a window switching operation. In addition, the first operation can also be other operations that trigger task execution, such as: an unlock operation, an edit operation, a return operation, a code scanning operation, etc. This application does not limit this.

[0293] Optionally, the scene perception module 1710 may be an application manager service (AMS) of the framework layer of the Android system, or a window manager service (WMS) module.

[0294] The scene perception module 1710 is also used to notify the load statistics and prediction module 1720 when the user's first operation is recognized.

[0295] The frequency modulation period determination unit 1721 included in the load statistics and prediction module 1720 is used to determine the frequency modulation period based on the Mth historical load sequence among M historical load sequences and the first power consumption budget in response to the user performing a first operation, where M is greater than or equal to 1.

[0296] The Mth historical load sequence among the M historical load sequences refers to the load sequence that enters the historical load sequence last, that is, the historical load sequence that was most recently counted.

[0297] The first power consumption budget refers to the power consumption budget of the current scenario obtained based on the temperature rise prediction.

[0298] Optionally, the value of M may be any integer in the range of 3-10, for example, 3, 4, or 5.

[0299] Among them, in one example, the first operation is the fourth click operation, then the M historical load sequences correspond to the user's first click operation, second click operation, and third click operation respectively, and the first click operation, second click operation, and third click operation occur before the fourth click operation, and the third click operation is the previous click operation of the fourth click operation.

[0300] Each of the M historical load sequences includes N load samples. That is, the number of load samples included in the M historical load sequences is M×N.

[0301] The value of N=the duration of the operation corresponding to the historical load sequence / the statistical period of the historical load sequence. The statistical period of the historical load sequence can be any one of 4ms, 8ms, 12ms, 16ms, and 20ms.

[0302] For example, operation A corresponds to the first historical load sequence. When the load statistical period corresponding to the first historical load sequence is 20 ms, the number of load samples N included in the first historical load sequence = the duration of operation A / 20 ms.

[0303] The power consumption budget module 1730 is used to determine 5 power consumption budget values ​​based on the Mth historical load sequence, and the 5 power consumption budget values ​​correspond to statistical periods of 4ms, 8ms, 12ms, 16ms, and 20ms respectively; the power consumption budget module 1730 is also used to determine the power consumption budget of the current scene (i.e., the first power consumption budget) based on the temperature rise prediction.

[0304] The frequency modulation period determination unit 1721 is specifically used to determine the frequency modulation period according to the five power consumption budget values ​​and the power consumption budget of the current scenario.

[0305] The load statistics unit 1722 included in the load statistics and prediction module 1720 is used to count a first load sequence corresponding to the first operation in response to the user performing the first operation.

[0306] The first load sequence includes N load samples.

[0307] The value of N=the duration of the first operation / the statistical period of the first load sequence, wherein the statistical period of the first load sequence is 4 ms.

[0308] The load prediction unit 1723 included in the load statistics and prediction module 1720 is used to determine the frequency modulation frequency (also referred to as the frequency point) based on the Mth historical load sequence.

[0309] Specifically, N frequencies corresponding to the N load samples are determined according to the N load samples included in the Mth historical load sequence, and the N frequencies are used as frequency modulation frequencies.

[0310] The resource reservation module 1740 is configured to reserve resources based on M historical load sequences in response to a user performing a first operation.

[0311] Optionally, the value of M may be any integer in the range of 3-10, for example, 3, 4, or 5.

[0312] Each of the M historical load sequences includes N load samples. That is, the number of load samples included in the M historical load sequences is M×N.

[0313] The value of N=the duration of the operation corresponding to the historical load sequence / the statistical period of the historical load sequence. The statistical period of the historical load sequence can be any one of 4ms, 8ms, 12ms, 16ms, and 20ms.

[0314] For example, operation A corresponds to the first historical load sequence. When the load statistical period corresponding to the first historical load sequence is 20 ms, the number of load samples N included in the first historical load sequence = the duration of operation A / 20 ms.

[0315] Optionally, the resource reservation module 1740 is specifically used to: first calculate the average value or maximum value of M×N load samples included in the M historical load sequences based on the M historical load sequences, and then reserve resources based on the average value or maximum value of the M×N load samples included in the M historical load sequences.

[0316] The frequency modulation module 1750 is used to perform frequency modulation according to the frequency modulation period and the frequency modulation frequency.

[0317] Optionally, the frequency modulation module 1750 includes a calculation unit 1751, and the calculation unit 1751 is used to perform frequency modulation according to the frequency modulation period and the frequency modulation frequency.

[0318] In the embodiment of the present application, the frequency modulation period is determined based on the most recent historical load sequence corresponding to the same scene and the power consumption budget of the current scene, which can achieve dynamic adjustment of the frequency modulation period to avoid undersupply and oversupply, that is, to avoid waste of power consumption; and, the device determines the frequency modulation frequency based on the most recent statistical load sequence of the same scene, so that the frequency supply can respond to changes in the load in a timely manner, achieving a "fast up and fast down" effect, and achieving a balance between performance and power consumption.

[0319] The present application embodiment provides an electronic device, the electronic device comprising: Fig.17 The scene perception module 1710, load statistics and prediction module 1720, power consumption budget module 1730, resource reservation module 1740 and frequency modulation module 1750 described in the illustrated embodiment.

[0320] The electronic device in the embodiments of the present application may be a portable electronic device, such as a mobile phone, a tablet computer, a camera, a camcorder, a video recorder, a wearable electronic device with a camera function (such as a smart watch), etc. It may also be a computer (for example: a Windows PC) and a terminal device in a 5G network or a terminal device in a future evolved public land mobile communication network (publicland mobile network, PLMN), etc., and the present application does not limit this.

[0321] like Fig.18 As shown, illustratively, the embodiment of the present application further provides a functional module diagram of a frequency modulation device 1800. The frequency modulation device 1800 includes a processor 1810, the processor 1810 is coupled to a memory 1820, the memory 1820 is used to store computer programs or instructions and / or data, and the processor 1810 is used to execute the computer programs or instructions and / or data stored in the memory 1820, so that the method in the above method embodiment is executed.

[0322] Optionally, the frequency modulation device 1800 includes one or more processors 1810.

[0323] Alternatively, if Fig.18 As shown, the frequency modulation device 1800 may further include a memory 1820 .

[0324] Optionally, the memory 1820 included in the frequency modulation device 1800 may be one or more.

[0325] Optionally, the memory 1820 may be integrated with the processor 1810 or provided separately.

[0326] Alternatively, if Fig.18As shown, the frequency modulation device 1800 may also include a transceiver 1830, which is used to receive and / or send signals. For example, the processor 1810 is used to control the transceiver 1830 to receive and / or send signals. One or more of the above modules or units can be implemented by software, hardware, or a combination of the two. When any of the above modules or units is implemented in software, the software exists in the form of computer program instructions and is stored in a memory, and the processor can be used to execute the program instructions and implement the above method flow. The processor may include but is not limited to at least one of the following: a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a microcontroller (MCU), or an artificial intelligence processor and other types of computing devices that run software, each of which may include one or more cores for executing software instructions to perform calculations or processing. The processor may be built into a SoC (system on chip) or an application specific integrated circuit (ASIC), or it may be an independent semiconductor chip. In addition to the core for executing software instructions to perform calculations or processing, the processor may further include necessary hardware accelerators, such as field programmable gate arrays (FPGA), PLDs (programmable logic devices), or logic circuits for implementing dedicated logic operations.

[0327] When the above modules or units are implemented in hardware, the hardware can be any one or any combination of a CPU, a microprocessor, a DSP, an MCU, an artificial intelligence processor, an ASIC, a SoC, an FPGA, a PLD, a dedicated digital circuit, a hardware accelerator or a non-integrated discrete device, which can run the necessary software or not rely on the software to execute the above method flow.

[0328] When the above modules or units are implemented using software, they can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)), etc.

[0329] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

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

[0331] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

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

[0333] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0334] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.

[0335] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A frequency modulation method, characterized in that: The method comprises: In response to a first operation of the user, determining a frequency modulation frequency based on a first historical load sequence, where the first historical load sequence is a latest statistical historical load sequence among M historical load sequences, where M is a positive integer greater than or equal to 1; determining a frequency modulation period based on a first power consumption budget and the frequency modulation frequency, wherein the first power consumption budget is a power consumption budget corresponding to the first operation obtained based on temperature rise prediction; Frequency modulation is performed according to the frequency modulation period and the frequency modulation frequency.

2. The method according to claim 1, characterized in that The method further comprises: In response to a first operation of the user, resource reservation is performed based on the M historical load sequences.

3. The method according to claim 2, characterized in that The reserving resources based on the M historical load sequences includes: Based on the M historical load sequences, determine a first average value, where the first average value is an average value of M×N load samples included in the M historical load sequences; Background cleaning is performed until the sum of the first average value and the current CPU load is less than 100%, and resource reservation is completed.

4. The method according to claim 2, characterized in that: The reserving resources based on the M historical load sequences includes: Determine a maximum value among the M×N load samples included in the M historical load sequences; Background cleaning is performed until the sum of the maximum value and the current CPU load is less than 100%, and resource reservation is completed.

5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: A first load sequence corresponding to the first operation is counted, where a load counting period of the first load sequence is 4 milliseconds.

6. The method according to claim 5, characterized in that The method further comprises: The M historical load sequences are updated according to the first load sequence.

7. The method according to claim 6, characterized in that The updating of the M historical load sequences according to the first load sequence includes: In a first-in-first-out manner, the historical load sequence with a sequence number 1 among the M historical load sequences is removed, and the first load sequence is used as the historical load sequence with a sequence number M.

8. The method according to any one of claims 1 to 7, characterized in that The determining the frequency modulation period based on the first power consumption budget and the frequency modulation frequency includes: determining the first power consumption budget; Determine a first difference by subtracting the current power consumption of the entire device from the first power consumption budget; When the first difference is less than or equal to 0, determining that the frequency modulation period is 20 milliseconds; or, When the first difference is greater than 0, a plurality of power consumption values ​​corresponding to a plurality of load statistical periods are determined based on the frequency modulation frequency, and the plurality of load statistical periods include 4 milliseconds, 8 milliseconds, 12 milliseconds, 16 milliseconds, and 20 milliseconds; The load statistical period corresponding to the power consumption value with the highest matching degree with the first difference among the multiple power consumption values ​​corresponding one-to-one to the multiple load statistical periods is determined as the frequency modulation period.

9. The method according to claim 8, characterized in that The determining, based on the frequency modulation frequency, a plurality of power consumption values ​​corresponding to a plurality of load statistical periods one by one includes: Determine, according to the energy efficiency query table, N power consumption values ​​corresponding to N frequency points one by one, the frequency modulation frequency includes the N frequency points, the N frequency points correspond to the N load samples included in the first historical load sequence one by one, and the value of N is obtained by dividing the duration of the operation corresponding to the first historical load sequence by the statistical period of the first historical load sequence; A plurality of power consumption values ​​corresponding one-to-one to a plurality of load statistical cycles are determined according to the N power consumption values ​​corresponding one-to-one to the N frequency points.

10. The method according to any one of claims 1 to 9, characterized in that The first operation includes any one of an application launch operation, a click operation, a slide operation, a window switch operation, and a code scan operation.

11. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory is used to store computer program codes, and the processor is used to execute the computer program codes stored in the memory to implement the method according to any one of claims 1 to 10.

12. A computer-readable storage medium, characterized in that: The storage medium stores a program or an instruction, and when the program or the instruction is executed, the method according to any one of claims 1 to 10 is implemented.

13. A chip, characterized in that: include: At least one processor is configured to execute computer programs or instructions in the memory so that the method according to any one of claims 1 to 10 is implemented.

Citation Information

Cited By

  • Frequency modulation method and apparatus and electronic device

    EP4647914A1

  • Frequency modulation method and apparatus and electronic device

    WO2024239731A1