Frequency modulation method and apparatus and electronic device

By dynamically adjusting the frequency modulation period and frequency based on historical load sequence and temperature rise prediction, the problem of excessive power consumption in existing frequency modulation solutions is solved, and performance and power consumption are taken into account, avoiding under-supply and over-supply.

WO2024239731A1PCT designated stage expired Publication Date: 2024-11-28HUAWEI TECH CO LTD

Patent Information

Application Number
PCT/CN2024/078230
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-25
Filing Date
2024-02-23
Publication Date
2024-11-28

AI Technical Summary

Technical Problem

While achieving rapid response, existing frequency modulation solutions lead to excessive power consumption and inability to effectively control, resulting in problems of under-supply and over-supply.

Method used

By dynamically adjusting the frequency modulation period and frequency based on the historical load sequence, combining temperature rise prediction and resource reservation, precise regulation of the frequency modulation period and frequency is achieved to avoid waste of power consumption and insufficient resource supply.

Benefits of technology

It realizes the reduction of power consumption while maintaining the performance of electronic equipment, avoiding under-supply and over-supply, improving the efficiency and accuracy of frequency regulation, and reducing the problem of insufficient resource supply.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024078230_28112024_PF_FP_ABST
    Figure CN2024078230_28112024_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a frequency modulation method and apparatus and an electronic device. The frequency modulation method comprises: in response to a first operation of a user, determining a frequency modulation frequency on the basis of a first historical load sequence, wherein the first historical load sequence is the latest counted historical load sequence in M historical load sequences, and M is a positive integer greater than or equal to 1; determining a frequency modulation period on the basis of 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 and obtained on the basis of temperature rise prediction; and performing frequency modulation according to the frequency modulation period and the frequency modulation frequency. According to the frequency modulation method and apparatus and the electronic device, the dynamic adjustment of the frequency modulation period can be achieved, so that undersupply and oversupply are avoided; additionally, the frequency modulation frequency is determined on the basis of the load sequence recently counted in the same scenario, so that the supply of the frequency can respond to a change in a load in time, thereby considering both the performance and the power consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Frequency modulation method, device and electronic equipment

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on May 25, 2023, with application number 202310603723.X and application name “Frequency Modulation Method, Device and Electronic Device”, the entire contents of which are incorporated by reference into this application. Technical Field

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

[0003] 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.

[0004] 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.

[0005] Summary of the Invention

[0006] The present application provides a frequency modulation method, apparatus, and electronic device. Through the frequency modulation method, apparatus, and electronic device, dynamic adjustment of the frequency modulation period can be achieved, thereby avoiding undersupply and oversupply situations; and the frequency modulation frequency is determined based on the most recent statistical load sequence in the same scenario, so that the frequency supply can respond to load changes in a timely manner, achieving a balance between performance and power consumption.

[0007] 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, 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, 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.

[0008] 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.

[0009] Optionally, the M historical load sequences are arranged in a first-in-first-out manner, with the first historical load sequence in the M historical load sequences (the historical load sequence that was counted first) entering the queue first, and the Mth historical load sequence in the M historical load sequences (the historical load sequence that was 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 in the M historical load sequences.

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

[0011] 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, which can achieve dynamic adjustment of the frequency modulation period, thereby avoiding undersupply and oversupply, that is, avoiding power consumption waste; and, the method determines the frequency modulation frequency based on the most recent statistical load sequence of the current scenario, 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.

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

[0013] In the embodiment of the present application, the risk of high load of the entire 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 entire machine.

[0014] In combination with the first aspect, in one possible implementation, resource reservation is performed based on the M historical load sequences, including: determining a first average value based on the M historical load sequences, where the first average value is the average value of the M×N load samples included in the M historical load sequences; and performing background cleanup until the sum of the first average 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 entire 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 entire machine.

[0016] In combination with the first aspect, in one possible implementation, 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 cleaning until the sum of the maximum value and the current CPU load is less than 100%, thereby completing resource reservation.

[0017] In an embodiment of the present application, the risk of high load of the entire 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 entire machine. In addition, this method reserves resources based on the maximum value of multiple historical load samples, which can make the reserved resources more sufficient and can avoid the occurrence of insufficient resource supply during the frequency modulation process due to high load of the entire machine to a greater extent.

[0018] 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, where a load counting period of the first load sequence is 4 milliseconds.

[0019] In an embodiment of the present application, the load sequence corresponding to the first operation can be synchronously counted during the occurrence 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 a subsequent frequency modulation process. Moreover, in the process of counting the load sequence, the load counting period used is small, which can enable the subsequently determined frequency modulation period to meet performance requirements.

[0020] 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.

[0021] 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 the 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.

[0022] 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.

[0023] In an embodiment of the present application, the updating process of the M historical load sequences adopts a first-in-first-out format, so that the Mth historical load sequence among the M historical load sequences is always 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 quickly and accurately called, which can improve the efficiency and accuracy of frequency modulation to a certain extent.

[0024] 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 one-to-one to multiple load statistical periods 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 match degree with the first difference among the multiple power consumption values ​​corresponding one-to-one to the multiple load statistical periods as the frequency modulation period.

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

[0026] 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, which can achieve dynamic and accurate adjustment of the frequency modulation period, avoid undersupply and oversupply, and thus avoid waste of power consumption.

[0027] 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; and determining multiple power consumption values ​​corresponding one-to-one to multiple load statistical periods based on the N power consumption values ​​corresponding one-to-one to the N frequency points.

[0028] In a second aspect, a frequency modulation device is provided, the device including: 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, where M is 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 the power consumption budget corresponding to the first operation obtained based on a temperature rise prediction; and a frequency modulation unit for performing frequency modulation according to the frequency modulation period and the frequency modulation frequency.

[0029] 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.

[0030] Optionally, the M historical load sequences are arranged in a first-in-first-out manner, with the first historical load sequence in the M historical load sequences (the historical load sequence that was counted first) entering the queue first, and the Mth historical load sequence in the M historical load sequences (the historical load sequence that was 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 in the M historical load sequences.

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

[0032] 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, which can achieve dynamic adjustment of the frequency modulation period, thereby avoiding undersupply and oversupply, that is, avoiding power consumption waste; and, the method determines the frequency modulation frequency based on the most recent statistical load sequence of the current scenario, 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.

[0033] In combination with the second aspect, in a possible implementation, the apparatus 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.

[0034] In the embodiment of the present application, the risk of high load of the entire 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 entire machine.

[0035] 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, where 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.

[0036] In the embodiment of the present application, the risk of high load of the entire 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 entire machine.

[0037] In combination with the second aspect, in one 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 cleaning until the sum of the maximum value and the current CPU load is less than 100%, thereby completing resource reservation.

[0038] 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. Moreover, through this device, resource reservation can be achieved 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.

[0039] In combination with the second aspect, in a possible implementation, the apparatus 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.

[0040] In an embodiment of the present application, the load sequence corresponding to the first operation can be synchronously counted during the occurrence 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 a subsequent frequency modulation process. Moreover, in the process of counting the load sequence, the load counting period used is small, which can enable the subsequently determined frequency modulation period to meet performance requirements.

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

[0042] 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 the 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.

[0043] In combination with the second aspect, in a possible implementation, the updating unit is specifically configured to: remove the historical load sequence with a priority of 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 priority of M.

[0044] In an embodiment of the present application, the updating process of the M historical load sequences adopts a first-in-first-out format, so that the Mth historical load sequence among the M historical load sequences is always 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 quickly and accurately called, which can improve the efficiency and accuracy of frequency modulation to a certain extent.

[0045] 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 match degree with the first difference among the multiple power consumption values ​​corresponding to the multiple load statistical periods as the frequency modulation period.

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

[0047] 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, which can achieve dynamic and accurate adjustment of the frequency modulation period, avoid undersupply and oversupply, and thus avoid waste of power consumption.

[0048] In combination with the second aspect, in a possible implementation method, the determination unit is further specifically used to: determine N power consumption values ​​corresponding one-to-one to the N frequency points according to the 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 based on the N power consumption values ​​corresponding one-to-one to the N frequency points.

[0049] 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 of the first aspect.

[0050] 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 of the first aspect is implemented.

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

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

[0053] FIG2 is a schematic diagram of a task entering a scheduler queue provided by an embodiment of the present application;

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

[0055] FIG4 is a schematic diagram of a code corresponding to a frequency modulation process provided in an embodiment of the present application;

[0056] FIG5 is a graph showing load demand (performance supply) changing over time in a sliding scenario provided by an embodiment of the present application;

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

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

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

[0060] FIG9 is a schematic diagram of a load sequence provided in an embodiment of the present application;

[0061] FIG10 is a schematic flow chart of another frequency modulation method provided in an embodiment of the present application;

[0062] FIG11 is a schematic flow chart of a resource reservation method provided in an embodiment of the present application;

[0063] FIG12 is a schematic flowchart of another resource reservation method provided in an embodiment of the present application;

[0064] FIG13 is a schematic flowchart of a method for determining a frequency modulation period provided in an embodiment of the present application;

[0065] FIG14 is a schematic flowchart of a method for calculating power consumption corresponding to a load statistical period provided by an embodiment of the present application;

[0066] FIG15 is a schematic flowchart of a method for updating M historical load sequences provided in an embodiment of the present application;

[0067] FIG16 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;

[0068] FIG17 is a system architecture diagram corresponding to a frequency modulation method provided in an embodiment of the present application;

[0069] FIG18 is a schematic diagram of the functional modules of a frequency modulation device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0071] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying 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.

[0072] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, 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.

[0073] The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification of this application and the appended claims, the singular expressions "a", "an", "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 can exist; for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship.

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

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

[0076] 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.

[0077] FIG1 shows a schematic flow chart of a frequency modulation method 100 provided in an embodiment of the present application. As shown in FIG1 , the method 100 includes:

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

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

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

[0081] 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.

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

[0083] Optionally, based on the results of the 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 the CPU small core), it will be switched to the CPU medium core or CPU large core that can provide the frequency, thereby achieving the purpose of frequency regulation.

[0084] In order to more clearly understand the above step S101, illustratively, FIG2 shows a schematic diagram of a task entering a scheduler queue.

[0085] As shown in FIG2 , 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.

[0086] Among them, the stop scheduler belongs to the highest priority scheduling class. It can preempt all other processes and 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 there are no other processes to schedule. Each CPU will have an idle thread.

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

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

[0089] In another example, when a task enters the RT scheduler queue, the scheduling policies corresponding to the RT scheduler queue are real-time process scheduling policy (SCHED_RR) and real-time process scheduling policy (SCHED_FIFO). Among them, the real-time process scheduling policy (SCHED_RR) is time slice round-robin. After the process uses up the time slice, it is added to the tail of the run 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 first-in-first-out scheduling. There is no time slice. If there is no higher priority, it can only wait to actively give up the CPU.

[0090] 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 running; the normal process scheduling policy (SCHED_BATCH) is batch processing, which enables the task to select the CFS scheduler for scheduling and running, and the normal process scheduling policy (SCHED_IDLE) is used to enable the task to select the CFS scheduler for scheduling and running with the lowest priority.

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

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

[0093] FIG3 shows a schematic flow chart of an existing frequency modulation method 300 provided in an embodiment of the present application. As shown in FIG3 , the method 300 includes:

[0094] S301: Recognizing the first operation of the user.

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

[0096] 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.

[0097] 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.

[0098] 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 within a first time period.

[0099] After the electronic device recognizes the user's first operation, it will quickly increase the CPU frequency within a short period of time. The higher the CPU frequency, the faster the task execution speed, and thus it can quickly complete the task corresponding to the first operation.

[0100] Among them, the first experience value is the frequency that can meet the resource requirements of the task.

[0101] S303: After exceeding the first time period, restore free frequency modulation.

[0102] To understand the above step S302 more clearly,示例性ly, FIG. 4 shows a schematic code diagram corresponding to a frequency modulation process provided by an embodiment of the present application.

[0103] In FIG. 4, the code line <cnd id="4099" power="13205" name="app_start" is the code related to the application startup. Among them, "4099" and "13205" are the related scenario numbers of the application startup.

[0104] <action>

[0105] <lit_cpu0_min_freq>1700000< / lit_cpu0_min_freq>

[0106] <mid_cpu0_min_freq>2343000< / mid_cpu0_min_freq>

[0107] <big_cpu0_min_freq>2631000< / big_cpu0_min_freq>

[0108] < / action>

[0109] In the above action code,

[0110] The code line "<lit_cpu0_min_freq>1700000< / lit_cpu0_min_freq>" means to increase the lowest frequency point of the CPU little core to 1700000; [[ID=2३]]

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

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

[0113] It can be seen from FIG. 4 that the boost mechanism increases the lowest frequency point of the CPU in a short time, that is, lit_cpu0_min_freq, mid_cpu0_min_freq, big_cpu0_min_freq.

[0114] Taking the user's first operation as a sliding operation as an example,示例性ly, FIG. 5 shows a curve graph of the load demand (performance supply) changing with time in a sliding scenario provided by an embodiment of the present application.

[0115] As shown in Figure 5, the solid curve represents the curve of actual load demand changing over time, the dotted curve represents the curve of LINU native load prediction changing over time, and the dotted line with a triangle mark represents the sliding event boost performance supply. As shown in Figure 5, for low-load scenarios such as video, the sliding event boost performance supply curve is higher than the actual load curve (see area A in Figure 5). This boost mechanism increases the CPU frequency too much, resulting in over-supply and wasted power. For low-probability sudden high-load scenarios during the sliding process, the sliding event boost performance supply curve is lower than the actual load curve (see area B in Figure 5). The boost mechanism does not increase the CPU frequency in a timely manner, resulting in under-supply, which can lead to unmet task latency or frame loss and lag. In addition, as shown in Figure 5, the LINU native load prediction curve has a significant lag compared to the actual load curve, which can also lead to excessive or untimely CPU frequency increases.

[0116] The Android kernel is typically modified and optimized based on the Linux kernel. However, the Linux kernel's native free frequency scaling strategy cannot achieve the desired CPU frequency increase quickly based on the task load in the scenario described above, such as when the user performs the first operation. This method, thanks to the boost strategy, can immediately increase the CPU's minimum frequency to a certain empirical value upon identifying this scenario, and then resume free frequency scaling after a period of time (the same time period).

[0117] 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, resulting in the failure to meet the task delay or frame loss and jamming.

[0118] FIG6 shows a schematic flow chart of another existing frequency modulation method 600 provided in an embodiment of the present application. As shown in FIG6 , the method 600 includes:

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

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

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

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

[0123] In order to more clearly understand the above step S601, illustratively, FIG7 shows a schematic diagram of a method for obtaining N loads provided in an embodiment of the present application.

[0124] As shown in Figure 7, 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 is out and the latest load 6 is in. At this time, the loads corresponding to the second scenario are 3, 4, 7, 5, and 6. In addition, the CPU frequency required by the current task (the task corresponding to the second scenario) is 6 (the average of 3, 4, 7, 5, and 6 (5) and the maximum value of the last load (6)).

[0125] In this method, the CPU frequency value required to execute the current task is obtained by statistical calculation based on the load over a period of time. The prediction period is long and the accuracy is poor, resulting in a lag in frequency regulation. When this 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 once every 20ms, which has poor real-time performance and is prone to "undersupply".

[0126] 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 equipment, that is, to avoid power consumption waste.

[0127] For example, FIG8 shows a schematic flow chart of a frequency modulation method 800 provided in an embodiment of the present application. As shown in FIG8 , the method 800 includes:

[0128] 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.

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

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

[0131] 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, after the user completes the previous operation of the first operation and before performing the first operation.

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

[0133] 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. 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.

[0134] 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.

[0135] The value of N = duration of the operation corresponding to the historical load sequence / 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.

[0136] For example, if operation A corresponds to the first historical load sequence and the load statistics period corresponding to the first historical load sequence is 20 ms, the number N of load samples included in the first historical load sequence is equal to the duration of operation A / 20 ms.

[0137] In one implementation, five power consumption budget values ​​are first determined based on historical load sequences, corresponding to statistical periods of 4ms, 8ms, 12ms, 16ms, and 20ms, respectively. A power consumption budget for the current scenario (i.e., a first power consumption budget) is then determined based on the temperature rise prediction. Finally, a frequency modulation period is determined based on these five power consumption budget values ​​and the power consumption budget for the current scenario. The detailed method for determining the frequency modulation period will be described in subsequent embodiments.

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

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

[0140] 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.

[0141] 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 WALTS-related code.

[0142] 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.

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

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

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

[0146] 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, 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 method determines the frequency modulation frequency based on the most recent statistical load sequence of the current scenario, so that the frequency supply can respond to changes in the load in a timely manner, achieve the effect of "fast up and fast down", and achieve a balance between performance and power consumption.

[0147] In order to more clearly understand the above load sequence (eg, historical load sequence, first load sequence), illustratively, FIG9 shows a load sequence schematic diagram provided in an embodiment of the present application.

[0148] Figure 9 shows the load sequence corresponding to two click operations, two swipe operations, two return operations, four browsing periods, and one idle period. Click and return operations have the highest load, followed by swipe operations. The loads corresponding to the idle period and browsing period are almost zero. This means that different operations generally have different loads, and some operations can have significantly different loads, such as between click and swipe operations.

[0149] For example, FIG10 shows a schematic flow chart of another frequency modulation method 1000 provided in an embodiment of the present application. As shown in FIG10 , the method 1000 includes:

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

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

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

[0153] 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.

[0154] The value of N = duration of the operation corresponding to the historical load sequence / 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.

[0155] For example, if operation A corresponds to the first historical load sequence and the load statistics period corresponding to the first historical load sequence is 20 ms, the number N of load samples included in the first historical load sequence is equal to the duration of operation A / 20 ms.

[0156] Optionally, an average or maximum value of M×N load samples included in the M historical load sequences is first calculated based on the M historical load sequences, and then resource reservation is performed based on the average or maximum value of the M×N load samples included in the M historical load sequences. A more detailed description of resource reservation is provided in the description of subsequent embodiments.

[0157] 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.

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

[0159] Specifically, the N frequencies corresponding to the N load samples included in the Mth historical load sequence are first calculated, and then the N power consumptions corresponding to the N frequencies are determined based on the energy efficiency lookup table. Finally, the power consumption corresponding to the load statistical period is determined based on the N power consumptions and the load statistical period. A more detailed description of this step is provided in the description of the subsequent embodiments.

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

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

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

[0163] A more detailed introduction to this step is given in the description of the subsequent embodiments.

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

[0165] 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.

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

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

[0168] 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.

[0169] 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 WALTS-related code.

[0170] The above load statistics period may also be referred to as a walt period.

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

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

[0173] For an explanation of the updating method of the M historical load sequences, reference may be made to the description in the embodiment shown in FIG. 7 .

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

[0175] 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.

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

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

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

[0179] 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 latest 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 latest 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.

[0180] To more clearly understand the above step S1001 (resource reservation based on M historical load sequences), FIG11 exemplarily shows a schematic flow chart of a resource reservation method 1100 provided in an embodiment of the present application. As shown in FIG11 , the method 1100 includes:

[0181] S1101: Record M historical load sequences, where each of the M historical load sequences includes N load samples.

[0182] 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.

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

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

[0185] 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.

[0186] The value of N = duration of the operation corresponding to the historical load sequence / 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.

[0187] For example, if operation A corresponds to the first historical load sequence and the load statistics period corresponding to the first historical load sequence is 20 ms, the number N of load samples included in the first historical load sequence is equal to the duration of operation A / 20 ms.

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

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

[0190] 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.

[0191] Optionally, background load cleaning can be performed by preferentially freezing processes that are not related to the foreground for a short period of time (for example, freezing by a native operating system mechanism) based on the relevance of the current process to the foreground.

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

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

[0194] In the embodiment of the present application, the risk of high load of the entire 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 entire machine.

[0195] In parallel with the embodiment shown in FIG11 , FIG12 exemplarily shows a schematic flow chart of another resource reservation method 1200 provided in an embodiment of the present application. As shown in FIG12 , the method 1100 includes:

[0196] S1201: Record M historical load sequences, where each of the M historical load sequences includes N load samples.

[0197] The explanation of this step is the same as the explanation of step S1101 in the embodiment shown in FIG11 , and will not be repeated here for the sake of brevity.

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

[0199] 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].

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

[0201] Optionally, background load cleaning can be performed by preferentially freezing processes that are not related to the foreground for a short period of time (for example, freezing by a native operating system mechanism) based on the relevance of the current process to the foreground.

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

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

[0204] In an embodiment of the present application, the risk of high load of the entire 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 entire machine. Moreover, compared with the method of the embodiment shown in Figure 11, the method of this embodiment reserves resources based on the maximum value of multiple historical load samples, which can make the reserved resources more sufficient and can avoid the occurrence of insufficient resource supply due to high load of the entire machine to a greater extent.

[0205] 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), FIG13 shows, for example, a schematic flow chart of a method 1300 for determining the frequency modulation period provided by an embodiment of the present application. As shown in FIG13, the method 1300 includes:

[0206] S1301: Record M historical load sequences, where each of the M historical load sequences includes N load samples.

[0207] The explanation of this step is the same as the explanation of step S1101 in the embodiment shown in FIG11 , and will not be repeated here for the sake of brevity.

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

[0209] The explanation of this step is the same as the explanation of step S1002 in the embodiment shown in FIG10 , and will not be repeated here for the sake of brevity.

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

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

[0212] The device's heat dissipation capacity is a fixed value determined by the product's hardware configuration and can be measured in units of mA / °C. The device's target temperature is defined by the terminal manufacturer and is measured in units of °C. The ambient temperature can be obtained by fitting based on the terminal's sensors and is measured in units of °C. The target device current is measured in mA.

[0213] S1304: Calculate the value of Δ.

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

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

[0216] It can be understood that the target entire device current×3.8V is the first power consumption budget described in the embodiment shown in FIG8 and the embodiment shown in FIG10 .

[0217] Optionally, Δ=target whole machine power consumption−current whole machine power consumption, wherein target whole machine power consumption=target whole machine current×3.8V, and current whole machine power consumption=current whole machine current×3.8V.

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

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

[0220] 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. In other words, the target whole machine power consumption is less than the current whole machine power consumption. The power consumption increase generated by the current aggressive frequency modulation strategy will lead to a worsening temperature rise, and thus performance cannot be improved. Accordingly, the frequency modulation period is determined to be 20ms, the maximum value among the five levels.

[0221] 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.

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

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

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

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

[0226] 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 Δ (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.

[0227] 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, which can achieve dynamic and accurate adjustment of the frequency modulation period, avoid undersupply and oversupply, and thus avoid waste of power consumption.

[0228] To more clearly understand step S1002 in the embodiment shown in FIG10 and step S1302 in the embodiment shown in FIG13 (calculating the power consumption corresponding to five load statistical cycles respectively), FIG14 shows, for example, a schematic flow chart of a method 1400 for calculating the power consumption corresponding to a load statistical cycle provided in an embodiment of the present application. As shown in FIG14 , the method 1400 includes:

[0229] S1401: Record M historical load sequences, where each of the M historical load sequences includes N load samples.

[0230] The explanation of this step is the same as the explanation of step S1101 in the embodiment shown in FIG11 , and will not be repeated here for the sake of brevity.

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

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

[0233] ,…,

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

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

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

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

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

[0239] predict_load[M][j] refers to the load statistics corresponding to the j-th load sample in the M-th load sequence;

[0240] targetload is the target load, with a maximum value of 100 and a minimum value of 1. Different operation scenarios correspond to different values ​​and can follow the native configuration of each terminal manufacturer.

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

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

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

[0244] ,…,

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

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

[0247] 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:

[0248] Table 1

[0249] As can be seen from Table 1, in the energy efficiency table, each frequency point corresponds to a power consumption value. Through the energy efficiency table, the power consumption value corresponding to the frequency point can be queried according to the frequency point.

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

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

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

[0253] When the load statistical period is 4 ms, the calculation formula for the power consumption corresponding to the load statistical period (4 ms) is:

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

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

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

[0257] 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,

[0258] predict_power = ∑(predict_freq_power[M][j] × cpuUtil[M][j]) × load statistics period / 2, j = 0, 1, 2, ..., N-2 (N is an odd number). When the load statistics period is 12ms, the power consumption corresponding to the load statistics period (12ms) is calculated as follows:

[0259] 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,

[0260] 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,

[0261] 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).

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

[0263] 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,

[0264] 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,

[0265] 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,

[0266] 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).

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

[0268] 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,

[0269] 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,

[0270] 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,

[0271] 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,

[0272] 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).

[0273] It is understandable that:

[0274] The statistical calculation method for the load in walt is:

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

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

[0277] CPU capacity is a normalized value between 0 and 1024 and is usually a fixed value (different terminal manufacturers may configure it differently in different scenarios).

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

[0279] NextFreq = curFreq * cpuLoad / targetload. The maximum value of targetload is 100 and the minimum value is 1. The configuration varies in different scenarios and can follow the native configuration of each terminal manufacturer.

[0280] 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 statistics period.

[0281] To more clearly understand step S1005 (updating M historical load sequences in real time) in the embodiment shown in FIG10 , FIG15 exemplarily shows a schematic flow chart of a method 1500 for updating M historical load sequences provided in an embodiment of the present application. As shown in FIG15 , the method 1500 includes:

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

[0283] The explanation of this step is the same as the explanation of step S802 in the embodiment shown in FIG. 8 and the explanation of step S1004 in the embodiment shown in FIG. 10 , and will not be repeated here for the sake of brevity.

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

[0285] The specific process of updating the M historical load sequences may refer to the description in the embodiment shown in FIG. 7 .

[0286] 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 the M historical load sequences in a timely manner, and the updating process adopts a first-in-first-out form, so as to ensure 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 period, thereby further reducing power consumption overhead while achieving precise frequency modulation.

[0287] For example, FIG16 shows a comparison diagram of the effects of the frequency modulation method provided by the present application and the existing boost frequency modulation method (the method of the embodiment shown in FIG3 ).

[0288] As shown in Figure 16, 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 this 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.

[0289] As shown in Figure 16, the fit between 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 fit between 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 (the shaded rectangular area in Figure 16) while meeting performance requirements.

[0290] It can also be seen from Figure 16 that the shorter the load cycle (Figure 16 shows the corresponding load conditions when the load cycle switches between 20ms and 4ms), the higher the performance; the longer the load cycle, the lower the power consumption. In other words, 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 a timely manner, achieving the effect of "fast up and fast down", thereby avoiding the problems of oversupply and undersupply.

[0291] For example, FIG17 shows a system architecture diagram corresponding to a frequency modulation method provided in an embodiment of the present application. As shown in FIG17 , 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. 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. The frequency modulation module 1750 includes a calculation unit 1751. Specifically:

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

[0293] 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.

[0294] 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.

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

[0296] 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.

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

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

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

[0300] 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. 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.

[0301] 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.

[0302] The value of N = duration of the operation corresponding to the historical load sequence / 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.

[0303] For example, if operation A corresponds to the first historical load sequence and the load statistics period corresponding to the first historical load sequence is 20 ms, the number N of load samples included in the first historical load sequence is equal to the duration of operation A / 20 ms.

[0304] The power consumption budget module 1730 is used to determine five power consumption budget values ​​based on the Mth historical load sequence, and the five 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 scenario (i.e., the first power consumption budget) based on the temperature rise prediction.

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

[0306] The load statistics unit 1722 included in the load statistics and prediction module 1720 is configured to count a first load sequence corresponding to a first operation performed by a user.

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

[0308] 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.

[0309] 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.

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

[0311] 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.

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

[0313] 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.

[0314] The value of N = duration of the operation corresponding to the historical load sequence / 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.

[0315] For example, if operation A corresponds to the first historical load sequence and the load statistics period corresponding to the first historical load sequence is 20 ms, the number N of load samples included in the first historical load sequence is equal to the duration of operation A / 20 ms.

[0316] Optionally, the resource reservation module 1740 is specifically used to: first calculate the average value or maximum value of the 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.

[0317] The frequency modulation module 1750 is configured to perform frequency modulation according to a frequency modulation period and a frequency modulation frequency.

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

[0319] 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 scenario and the power consumption budget of the current scenario, which can realize dynamic adjustment of the frequency modulation period to avoid undersupply and oversupply, that is, to avoid power consumption waste; and, the device determines the frequency modulation frequency based on the most recent statistical load sequence of the same scenario, 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.

[0320] An embodiment of the present application provides an electronic device, which 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 as described in the embodiment shown in Figure 17.

[0321] The electronic device in the embodiment of the present application can be a portable electronic device, such as a mobile phone, a tablet computer, a camera, a video camera, a video recorder, a wearable electronic device with a camera function (such as a smart watch), etc. It can also be a computer (for example: Windows PC) and a terminal device in a 5G network or a terminal device in a future evolved public land mobile communication network (public land mobile network, PLMN), etc. This application is not limited to this.

[0322] As shown in FIG18 , an embodiment of the present application also provides, by way of example, a functional module diagram of a frequency modulation apparatus 1800. The frequency modulation apparatus 1800 includes a processor 1810 coupled to a memory 1820. The memory 1820 is configured to store computer programs, instructions, and / or data. The processor 1810 is configured to execute the computer programs, instructions, and / or data stored in the memory 1820, thereby executing the method described in the above method embodiment.

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

[0324] Optionally, as shown in FIG18 , the frequency modulation device 1800 may further include a memory 1820 .

[0325] Optionally, the frequency modulation device 1800 may include one or more memories 1820 .

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

[0327] Optionally, as shown in FIG18 , the frequency modulation device 1800 may further include a transceiver 1830 for receiving and / or transmitting signals. For example, the processor 1810 is used to control the transceiver 1830 to receive and / or transmit signals. One or more of the above modules or units may be implemented in software, hardware, or a combination of both. 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. The processor may 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 unit (MCU), or an artificial intelligence processor, and other types of computing devices that run software. Each computing device may include one or more cores for executing software instructions to perform calculations or processing. The processor may be built into an SoC (system on chip) or an application-specific integrated circuit (ASIC), or it may be a standalone semiconductor chip. In addition to the core used to execute software instructions to perform calculations or processing, the processor may further include necessary hardware accelerators, such as field programmable gate arrays (FPGAs), PLDs (programmable logic devices), or logic circuits that implement dedicated logic operations.

[0328] 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.

[0329] 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 can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can 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)).

[0330] Those skilled 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 beyond the scope of this application.

[0331] Those skilled in the art will 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.

[0332] In the several embodiments provided in this 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 merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, 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.

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

[0334] 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.

[0335] 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, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0336] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection 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 scanning 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

Patent Citations

  • Frequency modulation method and device and electronic equipment

    CN119025252A

  • Energy efficiency adjustments for CPU governor

    CN112912820A

  • Load processing method and related device

    CN114968546A

  • Method and system for selecting an operating frequency for a chip to provide a desired overall power dissipation value for the chip

    US8281160B1

Cited By

  • Low-power-consumption management method and system of electric energy meter

    CN119689083A