Power consumption allocation method and terminal
By recording the relationship between temperature and total power consumption, adjusting the budget power consumption of the core cluster based on the actual load and frequency point energy efficiency ratio of the core cluster, solving the problem of unreasonable power consumption allocation in the terminal, and improving the working state of the core cluster and the overall performance of the terminal.
Patent Information
- Application Number
- CN202410225649.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-28
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2044-02-28
AI Technical Summary
The prior art fails to reasonably allocate the power consumption of the processor core cluster in the terminal, resulting in poor frequency energy efficiency and poor core cluster working status.
By recording the temperature and total power consumption relationship of the core cluster, adjust the budget power consumption of the core cluster based on the actual load and frequency point energy efficiency ratio of the core cluster to ensure that the frequency point energy efficiency ratio reaches the preset value and achieve reasonable power consumption allocation.
The reasonable power consumption allocation of the processor core cluster is realized, the working state of the core cluster is improved, the extreme phenomenon of frequency point energy efficiency ratio is avoided, and the overall performance and energy efficiency of the terminal are improved.
Smart Images

Figure CN119248464B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminals, and in particular to a power consumption allocation method and a terminal. Background Art
[0002] The total power consumption of a terminal's processor during different cycles can vary with factors such as temperature. When the processor includes at least one core cluster, the terminal allocates this total power consumption to each core cluster based on the load of each core cluster in the previous cycle to determine the power consumption of each core cluster in the current cycle. The power consumption allocated to a core cluster can affect the frequency of the core cluster in the current cycle. Generally speaking, the greater the power consumption of a core cluster in the current cycle, the higher the frequency at which the core cluster can operate. Frequency can be used to describe the operating frequency of a core cluster. A higher frequency means that the core cluster can handle more tasks, allowing the core cluster to have a greater load in the current cycle.
[0003] The load of the core cluster in the current cycle will affect the power consumption allocated to the core cluster in the future. The terminal needs to reasonably allocate power consumption to each cluster based on the tasks processed by the core cluster (such as load) to achieve a balance between the performance and power consumption of the core cluster. Summary of the Invention
[0004] The present application provides a power consumption allocation method and a terminal, which can more reasonably allocate the total power consumption of a processor to each core cluster based on the energy efficiency ratio of each core cluster in the processor.
[0005] In a first aspect, the present application provides a power consumption allocation method, which is applied to a terminal including a processor, wherein the processor includes N core clusters, the method comprising: the terminal having a first temperature determines the total power consumption that the processor can consume in a first period; the correspondence between the temperature and the total power consumption is recorded in the terminal; the terminal allocates the total power consumption based on the actual load of the N core clusters in a second period to obtain the budgeted power consumption of the N core clusters in the first period; the second period is the period before the first period; N is an integer greater than 1; the terminal determines the maximum frequency of each of the N core clusters under the budgeted power consumption, and then determines the frequency energy efficiency ratio of each core cluster based on the maximum frequency of the N core clusters; the correspondence between the maximum frequency and the frequency energy efficiency ratio of a core cluster is recorded in the terminal; when the sum of the frequency energy efficiency ratios of the N core clusters is less than a preset energy efficiency ratio, the terminal adjusts the budgeted power consumption of some or all of the core clusters to obtain the required power consumption of the N core clusters in the first period; the sum of the frequency energy efficiency ratios determined by the N required power consumption is greater than or equal to the preset energy efficiency ratio.
[0006] In the above embodiment, the first temperature is the temperature measured by the terminal before entering the first cycle. The first cycle may be the current cycle involved in the following embodiment, the kth cycle. The second cycle may be the previous cycle involved in the following embodiment, the k-1th cycle.
[0007] When the sum of the frequency energy efficiency ratios of the N core clusters is less than the preset energy efficiency ratio, it means that the allocation of total power consumption at this time is unreasonable. After adjusting the budget power consumption of the core clusters, the terminal achieves that the sum of the frequency energy efficiency ratios is greater than or equal to the preset energy efficiency ratio, so that the final power consumption (demand power consumption) allocated to the N core clusters is reasonable.
[0008] In combination with the first aspect, in some embodiments, the method also includes: when the sum of the frequency point energy efficiency ratios of the N core clusters is greater than or equal to the preset energy efficiency ratio, the terminal uses the budgeted power consumption of the N core clusters in the first period as the required power consumption of the N core clusters in the first period.
[0009] In the above embodiment, when the sum of the frequency-point energy efficiency ratios is greater than or equal to the preset energy efficiency ratio, it indicates that the allocation of the total power consumption is reasonable.
[0010] In combination with the first aspect, in some embodiments, the terminal adjusts the budget power consumption of some or all core clusters to obtain the required power consumption of N core clusters in the first period, specifically including: the terminal adjusts the maximum frequency points of X target core clusters to obtain X adjusted maximum frequency points; X is an integer less than or equal to N; the maximum frequency point of a target core cluster is obtained based on the budget power consumption of the target core cluster divided by a first parameter, and the first parameter is equal to the number of cores in the target core cluster multiplied by the duration of the first period; the terminal adjusts the budget power consumption of the X target core clusters based on the X adjusted maximum frequency points respectively; the terminal uses the adjusted budget power consumption of the X target core clusters as the required power consumption of the X target core clusters in the first period, and uses the budget power consumption of NX non-target core clusters as the required power consumption of the NX non-target core clusters in the first period.
[0011] In the above embodiment, when the sum of the frequency energy efficiency ratios of the N core clusters is less than the preset energy efficiency ratio, it means that the allocation of total power consumption at this time is unreasonable. After adjusting the budget power consumption of the core cluster, the terminal achieves that the sum of the frequency energy efficiency ratios is greater than or equal to the preset energy efficiency ratio, so that the final power consumption (required power consumption) allocated to the N core clusters is reasonable.
[0012] In combination with the first aspect, in some embodiments, the terminal adjusts the budget power consumption of some or all core clusters to obtain the required power consumption of N core clusters in the first period, specifically including: the terminal adjusts the maximum frequency points of X target core clusters to obtain X adjusted maximum frequency points; X is an integer less than or equal to N; the maximum frequency point of a target core cluster is obtained based on the budget power consumption of the target core cluster divided by a first parameter, and the first parameter is equal to the number of cores in the target core cluster multiplied by the duration of the first period; the terminal reallocates the total power consumption through the X adjusted maximum frequency points and the maximum frequency points of NX non-target core clusters, and adjusts the budget power consumption of N core clusters in the first period; the terminal uses the adjusted budget power consumption of N core clusters as the required power consumption of N core clusters in the first period.
[0013] In the above embodiment, when the sum of the frequency energy efficiency ratios of the N core clusters is less than the preset energy efficiency ratio, it means that the allocation of total power consumption at this time is unreasonable. After adjusting the budget power consumption of the core cluster, the terminal achieves that the sum of the frequency energy efficiency ratios is greater than or equal to the preset energy efficiency ratio, so that the final power consumption (required power consumption) allocated to the N core clusters is reasonable.
[0014] In combination with the first aspect, in some embodiments, the target core cluster includes a core cluster whose maximum frequency among the N core clusters is greater than a first preset frequency, and / or a core cluster whose maximum frequency among the N core clusters is less than a second preset frequency, and the terminal adjusts the maximum frequency of the X target core clusters, specifically including: the terminal lowering the maximum frequency of the target core cluster whose maximum frequency is greater than the first preset frequency, and / or, in addition to the lowering, the terminal also raises the maximum frequency of the target core cluster whose maximum frequency is less than the second preset frequency.
[0015] In the above embodiment, the frequency-point energy efficiency ratio of the core cluster measures the performance that can be achieved within the unit power consumption of the core cluster. If the frequency-point energy efficiency ratio of the core cluster is within a reasonable range, the working state of the core cluster is better, but it is not the case that the higher the better, nor the lower the better. A poor but relatively high energy efficiency indicates that the frequency point of the core cluster is too high, resulting in the core cluster being able to run more tasks but with low efficiency. A poor but relatively low energy efficiency indicates that the frequency point of the core cluster is too low, resulting in the core cluster running fewer tasks and low efficiency. Therefore, it is necessary to lower the maximum frequency point corresponding to the core cluster with a higher energy efficiency ratio so that the energy efficiency ratio of the core cluster can be improved. The maximum frequency point corresponding to the core cluster with a lower energy efficiency ratio is increased so that the energy efficiency ratio of the core cluster can be improved.
[0016] In combination with the first aspect, in some embodiments, the terminal allocates the total power consumption based on the actual load of the N core clusters in the second period, and obtains the budgeted power consumption of the N core clusters in the first period, specifically including: the terminal determines the performance frequency of each core cluster based on the actual load of the N core clusters; the correspondence between the actual load and performance frequency of a core cluster is recorded in the terminal; the terminal allocates the total power consumption based on the performance frequency of the N core clusters, and obtains the budgeted power consumption of the N core clusters in the first period; the budgeted power consumption allocated to a core cluster divided by the total power consumption is equal to the performance frequency of the core cluster divided by the sum of the performance frequencies of the N core clusters.
[0017] In combination with the first aspect, in some embodiments, after obtaining the required power consumption of N core clusters in the first period, the method also includes: when the task on the first core cluster changes, the terminal determines the predicted demand frequency of the first core cluster based on the budgeted load required to complete the task; when the predicted demand frequency is less than or equal to the maximum frequency of the first core cluster, the terminal uses the predicted demand frequency as a demand frequency of the first core cluster in the first period.
[0018] In combination with the first aspect, in some embodiments, the method also includes: when the predicted demand frequency is greater than the maximum frequency of the first core cluster, the terminal determines the overflow power consumption on the first core cluster when adopting the predicted demand frequency; the terminal determines a demand frequency of the first core cluster in the first period based on the overflow power consumption, the predicted demand frequency and the total remaining power consumption on the first core cluster; wherein the overflow power consumption on the first core cluster is equal to the power consumption required to adopt the predicted demand frequency during the remaining time of the first period minus the power consumption required to adopt the maximum frequency during the remaining time; the total remaining power consumption on the first core cluster is equal to the power consumption required to adopt the maximum frequency during the used time of the first period minus the power consumption consumed during the used time.
[0019] In combination with the first aspect, in some embodiments, the terminal determines a demand frequency of the first core cluster in the first period based on the overflow power consumption, the predicted demand frequency and the total remaining power consumption on the first core cluster, specifically including: when it is determined that the total remaining power consumption can offset the overflow power consumption, the terminal uses the predicted demand frequency as a demand frequency of the first core cluster in the first period; when it is determined that the total remaining power consumption cannot offset the overflow power consumption, the terminal uses the maximum frequency of the first core cluster as a demand frequency of the first core cluster in the first period.
[0020] In the above embodiment, when the demand frequency is greater than the maximum frequency, the additional power consumption of the demand frequency is boosted by the remaining power consumption of the demand frequency already used in the current cycle. However, whether boosting is possible is determined. Boosting is only supported when the total remaining power consumption can offset the excess power consumption. This way, the frequency can be increased without exceeding power consumption.
[0021] In combination with the first aspect, in some embodiments, the total remaining power consumption can offset the overflow power consumption, specifically including: the total remaining power consumption is greater than the overflow power consumption, or the total remaining power consumption minus the overflow power consumption is greater than a preset power consumption value.
[0022] In the above embodiment, the limitation that the total remaining power consumption minus the overflow power consumption is greater than the preset power consumption value can better ensure that the additional power consumption generated when using a required frequency greater than the maximum frequency is less than the total remaining power consumption when performing boost.
[0023] In a second aspect, an embodiment of the present application provides a terminal comprising: one or more processors and a memory; the memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code comprising computer instructions, the one or more processors calling the computer instructions to enable the terminal to execute the method implemented in the first aspect.
[0024] In a third aspect, an embodiment of the present application provides a computer-readable storage medium comprising instructions, which, when executed on a terminal, causes the terminal to execute the method implemented in the first aspect.
[0025] In a fourth aspect, an embodiment of the present application provides a chip system, which is applied to a terminal. The chip system includes one or more processors, which are used to call computer instructions to enable the terminal to execute the method implemented in the first aspect.
[0026] In a fifth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a terminal, enables the terminal to execute the method implemented in the first aspect.
[0027] It is understandable that the terminal provided in the second aspect, the computer storage medium provided in the third aspect, the chip system provided in the fourth aspect, and the computer program product provided in the fifth aspect are all used to execute the methods provided in the embodiments of the present application. Therefore, other beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding methods and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A comparison chart showing the impact of three power allocation methods on frequency points is shown;
[0029] Figure 2 A schematic diagram showing the allocation of power consumption to a core cluster is shown;
[0030] Figure 3 shows another schematic diagram when allocating power consumption to a core cluster;
[0031] Figure 4A and Figure 4B A schematic diagram is shown for determining the demand frequency point;
[0032] Figure 5 is a software system block diagram of a terminal according to an embodiment of the present application;
[0033] Figure 6 An exemplary module interaction diagram involved in implementing the power consumption allocation method is shown;
[0034] Figure 7 An exemplary flow chart for adjusting budgeted power consumption is shown;
[0035] Figure 8 An exemplary flow chart for adjusting budgeted power consumption is shown;
[0036] Figure 9 It is a schematic diagram of the structure of the terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0037] In one approach, Figure 1 As shown in (1), under the influence of the terminal temperature control strategy, when the temperature rises to a certain threshold, the power consumption of each core cluster will be set to a fixed power consumption. And the frequency limiting strategy 1 is implemented: the frequency of each core cluster in a period T (for example, T = 50ms) is limited to the frequency corresponding to the fixed power consumption. When the temperature does not drop, the limited frequency of the core cluster remains unchanged in each period. The fixed power consumption will not be too high, and the limited frequency will not be too high. Its purpose is to limit the speed at which the core cluster processes tasks, reduce the heat generated by the core cluster due to processing tasks, and thus control the terminal temperature.
[0038] Here, the temperature of the terminal includes the temperature of the rear case of the terminal, which can be measured by a temperature sensor of the terminal.
[0039] However, the temperature control strategy only considers the impact of temperature on the power consumption and frequency of the core cluster, without considering the actual load of each core cluster during operation, resulting in inefficient power allocation. When a core cluster is assigned a heavy workload but its frequency is restricted, the core cluster cannot complete the task properly, causing the terminal to overheat and lag.
[0040] It should be noted that a core cluster in a processor may include at least one core. Generally, small cores in a processor may be divided into a core cluster, medium cores may be divided into a core cluster, and large cores may be divided into a core cluster.
[0041] In another approach, Figure 1 As shown in (2), the terminal can use intelligent power allocation (IPA) technology to allocate power consumption and adjust frequency according to a period (e.g., T = 50ms). The process includes: allocating the budget power consumption of each core cluster in the current period based on the actual load of each core cluster in the previous period. And implementing frequency limiting strategy 2: adjusting the frequency of each core cluster in the current period to the required frequency, which does not exceed the maximum frequency corresponding to the budget power consumption. Among them, the required frequency is determined based on the budget load of the core cluster in the current period. If the required frequency determined based on the budget load of the current period is greater than the maximum frequency, the maximum frequency is used as the required frequency of the core cluster. The budgeted load represents the load required to run these tasks in the current period estimated before the core cluster runs the task. It can be used to describe the task volume. The larger the load, the larger the task volume. The predicted required frequency represents a frequency that can complete the task before the core cluster runs the task. The maximum frequency represents the operating frequency at which the core cluster operates continuously within a cycle and fully utilizes the budgeted power consumption. This can be understood as the core cluster being fully loaded within the budgeted power consumption within a cycle. The detailed process for determining the maximum frequency based on the budgeted power consumption can be found in the description of step S104 below and is not repeated here.
[0042] It should be noted that the correspondence between the budgeted load and the predicted demand frequency is recorded in the terminal.
[0043] The process of using IPA to allocate power consumption to each core cluster can refer to Figure 2 Description.
[0044] like Figure 2 As shown, a processor including N core clusters is used as an example. N is an integer greater than or equal to 1. First, the terminal determines the performance frequency point of the i-th core cluster in the current cycle based on the actual load of the i-th core cluster in the previous cycle. As i changes from 1 to N, the terminal can determine the performance frequency point of each of the N core clusters. The actual load of the cluster represents the actual load used when the core cluster runs a task. The correspondence between the actual load and the performance frequency point is recorded in the terminal.
[0045] Continue to refer Figure 2The terminal uses the thermal control center to determine the total power consumption of N core clusters in the current cycle based on the current temperature. The terminal then allocates the total power consumption based on the N performance frequencies to determine the budgeted power consumption of each of the N core clusters in the current cycle. The budgeted power consumption allocated to a core cluster divided by the total power consumption equals the performance frequency of that core cluster divided by the sum of the performance frequencies of the N core clusters.
[0046] However, this solution only considers the actual load of the previous cycle when allocating total power. This results in a core cluster with a higher actual load in the previous cycle being more likely to be allocated more budgeted power in the current cycle. More budgeted power means the core cluster can run at a higher frequency (demand frequency) in the current cycle, which in turn attracts more tasks, generating a higher actual load and further allocating more budgeted power in the next cycle. This cycle repeats itself: for a given total power consumption, some core clusters receive increasing budgeted power, while others receive decreasing budgeted power. This power allocation reaches two extremes: "high" or "low," resulting in each core cluster's demand frequency also reaching two extremes: "very high" or "very low." In practice, it has been found that both very high and very low demand frequencies place the core cluster's frequency-to-energy efficiency ratio (FERER) in a poor range. A core cluster's FERER-to-energy efficiency ratio measures the performance it can achieve per unit of power consumption. This means that if the frequency-point energy efficiency ratio of a core cluster is within a reasonable range, the core cluster performs better. This doesn't mean higher is better, nor lower is better. The higher the sum of the frequency-point energy efficiency ratios of N core clusters, the better the CPU performance.
[0047] In order to solve the problem of poor frequency energy efficiency caused by unreasonable allocation of total power consumption, a power consumption allocation method is provided. In this method, the terminal can improve the above-mentioned IPA to achieve a more reasonable allocation of total power consumption. The process of allocating power consumption to each core cluster in this method can refer to Figure 3 Description.
[0048] like Figure 3 As shown, an example is given in which a processor includes N core clusters. N is an integer greater than or equal to 1. Compared to the aforementioned IPA, the terminal still first determines the performance frequency point of the i-th core cluster in the current cycle based on the actual load of the i-th core cluster in the previous cycle. As i changes from 1 to N, the terminal can determine the performance frequency point of each of the N core clusters. Then, the terminal obtains the total power consumption that can be consumed by the N core clusters in the current cycle based on the current temperature through the temperature control center (thermal). The total power consumption is then allocated according to the N performance frequencies to obtain the budgeted power consumption of each of the N core clusters in the current cycle, and the budgeted power consumption of the N core clusters in the current cycle is obtained.
[0049] Compared with the aforementioned Figure 2 The IPA shown in Figure 3 The difference is that after obtaining the budgeted power consumption of the N clusters in the current cycle, the terminal will also determine whether the budgeted power consumption is reasonable based on the frequency energy efficiency ratio. If it is unreasonable, the budgeted power consumption of some or all core clusters will be adjusted to obtain the required power consumption of the N core clusters in the current cycle (also called the adjusted budgeted power consumption). This adjustment process can be repeated. The condition for ending the cycle can be: the sum of the frequency energy efficiency ratios determined by the N required power consumption is greater than or equal to the preset energy efficiency ratio.
[0050] Among them, the process of judging whether the budgeted power consumption is reasonable includes: first, the terminal determines the maximum frequency of each of the N core clusters under the budgeted power consumption. Here, the power consumption allocated to a core cluster (including budgeted power consumption or required power consumption) can determine the maximum frequency of a core cluster. The terminal then determines the frequency energy efficiency ratio of each core cluster based on the maximum frequency of the N core clusters. Then, the terminal determines the sum of the frequency energy efficiency ratios of the N core clusters. When the sum of the frequency energy efficiency ratios is greater than or equal to the preset energy efficiency ratio, the terminal determines that the budgeted power consumption is reasonable. When the sum of the frequency energy efficiency ratios is less than the preset energy efficiency ratio, the terminal determines that the budgeted power consumption allocated to the N core clusters is unreasonable. It should be noted that the correspondence between the maximum frequency of a core cluster and the frequency energy efficiency ratio is recorded in the terminal.
[0051] When it is determined that the budget power consumption allocated to the N core clusters is unreasonable, the terminal may adjust the budget power consumption in a manner including but not limited to the following two power consumption adjustment manners.
[0052] Power consumption adjustment method 1: First, the terminal adjusts the maximum frequency points of the X target core clusters to obtain X adjusted maximum frequency points. Then, the budget power consumption of the X target core clusters is adjusted based on the X adjusted maximum frequency points. Then, the terminal uses the adjusted budget power consumption of the X target core clusters as the required power consumption of the X target core clusters in the current cycle, and uses the budget power consumption of the NX non-target core clusters as the required power consumption of the NX non-target core clusters in the current cycle. X is an integer less than or equal to N. For the detailed process of power consumption adjustment method 1, please refer to the following Figure 7 The description of is not repeated here.
[0053] In some possible cases, the target core cluster may include a core cluster having a maximum frequency greater than preset frequency 1 among the N core clusters, and / or a core cluster having a maximum frequency less than preset frequency 2 among the N core clusters. The terminal adjusting the maximum frequencies of the X target core clusters includes: the terminal lowering the maximum frequency of the target core cluster having a maximum frequency greater than preset frequency 1, and / or the terminal further increasing the maximum frequency of the target core cluster having a maximum frequency less than preset frequency 2.
[0054] In other possible cases, the target core cluster may further include the highest maximum frequency point and / or the lowest maximum frequency point among the N core clusters. The terminal adjusting the maximum frequency points of the X target core clusters includes: the terminal lowering the highest maximum frequency point and / or the terminal also raising the lowest maximum frequency point.
[0055] Power consumption adjustment method 2: First, the terminal adjusts the maximum frequency points of the X target core clusters to obtain X adjusted maximum frequency points. The terminal then redistributes the total power consumption by using the X adjusted maximum frequency points and the maximum frequency points of the NX non-target core clusters to obtain the adjusted budget power consumption of the N core clusters in the current cycle. Then, the terminal uses the adjusted budget power consumption of the N core clusters as the required power consumption of the N core clusters in the current cycle. For the detailed process of power consumption adjustment method 2, please refer to the following Figure 8 The description of is not repeated here.
[0056] Subsequently, the terminal determines the required frequency point of each core cluster in the current period based on the required power consumption of the N core clusters in the current period.
[0057] In some possible cases, the terminal can implement the aforementioned frequency limiting strategy 2 to determine the required frequency point of each core cluster in the current cycle. For the relevant content of frequency limiting strategy 2, please refer to the above description and will not be repeated here.
[0058] However, if Figure 1 As shown in (2), in frequency limiting strategy 2, there is only one demand frequency point in a cycle. This demand frequency point is determined based on the budget load required by all tasks in a cycle, taking into account the average level of all tasks on the core cluster in a cycle. This demand frequency point is strictly controlled to be less than the maximum frequency point. Although the demand frequency point is always set to be less than or equal to the maximum frequency point, it will not exceed the power consumption of the core cluster in the current cycle, but this single demand frequency point cannot adapt to the performance requirements of the core cluster. The reason for not being able to adapt to the performance requirements is that the tasks on the core cluster may change within a cycle, and there may be some tasks that require a large load. The large load can only be met when the demand frequency point is greater than the maximum frequency point. There may also be some tasks that require a small load. A smaller frequency point can meet the needs of the tasks with a small load.
[0059] In other possible cases, such as Figure 1 As shown in (3), in order to better adapt to the performance requirements of the core cluster within a cycle (e.g., T = 50ms), multiple frequency adjustments can be performed within a cycle. Frequency adjustment timing includes: when a task on the core cluster changes within a cycle, a frequency adjustment is triggered.
[0060] In some possible cases, the first demand frequency point in a cycle may be the demand frequency point determined based on the aforementioned frequency limiting strategy 2. Subsequently, when a task change on the core cluster is detected, a frequency adjustment is triggered to determine a new demand frequency point.
[0061] The frequency adjustment process includes: the terminal determines a predicted required frequency point for the core cluster based on the budgeted load required to complete the task (the changed task). In some possible embodiments, the tasks on the core cluster can be measured by the number of threads, for example, one thread or multiple threads. The specific number of threads can be set based on actual needs and is not limited in this embodiment of the application.
[0062] like Figure 4A (1) and Figure 4A As shown in (2), when the predicted demand frequency (eg, demandFreq1 and demandFreq2) is less than or equal to the maximum frequency of the core cluster, the terminal uses the predicted demand frequency as a demand frequency of the core cluster in the current period (eg, T=50ms).
[0063] When the predicted demand frequency (e.g., demandFreq3) is greater than the maximum frequency of the core cluster, then if the predicted demand frequency is adopted, the terminal will generate overflow power consumption for the remainder of the current cycle. If it is determined that the total remaining power consumption of the current cycle cannot offset the overflow power consumption, the terminal uses the maximum frequency as a demand frequency for the core cluster in the current cycle (e.g., T = 50ms). If it is determined that the total remaining power consumption of the current cycle can offset the overflow power consumption, the terminal uses the predicted demand frequency as a demand frequency for the core cluster in the current cycle (e.g., T = 50ms).
[0064] like Figure 4B As shown, the overflow power consumption of the core cluster is equal to the power consumption required to use the predicted demand frequency during the remaining time of the current cycle minus the power consumption required to use the maximum frequency (maxFreq) during the remaining time. The total remaining power consumption of the core cluster is equal to the power consumption required to use the maximum frequency during the elapsed time of the current cycle minus the power loss (consumed power) of the used demand frequency during the elapsed time.
[0065] like Figure 4A As shown in (3), when the demand frequency (e.g., demandFreq3) is greater than the maximum frequency (maxFreq), the additional power consumption of the demand frequency is boosted by the remaining power consumption of the demand frequencies (including demandFreq1 and demandFreq2) already used in the current cycle.
[0066] It should be noted that the additional power consumption of a demand frequency point is equal to the power loss of the demand frequency point during the frequency point duration minus the power consumption of the demand frequency point. The power consumption of a demand frequency point is equal to the frequency point duration multiplied by the unit power consumption of the maximum frequency point (maxFreq). The unit power consumption of the maximum frequency point is equal to the demand power consumption of the current cycle divided by the cycle duration.
[0067] It should also be noted that the reason why the demand frequency point that has been adopted has residual power consumption (corresponding to the frequency point) is because the loss power consumption of the demand frequency point during the frequency point duration is less than the power consumption that can be consumed by the demand frequency point, resulting in residual power consumption.
[0068] Here, the power loss of a demand frequency point is equal to the unit power consumption of the frequency point × the frequency point operation time (less than or equal to the frequency point duration t1). The method for calculating the frequency point operation time of demand frequency point A can refer to the following formula (1).
[0069] Frequency point running time = frequency point historical running time + (t1 - core cluster idle time) Formula (1)
[0070] The core cluster in formula (1) represents the core cluster holding the demand frequency point A.
[0071] Figure 5 It is a software system block diagram of the terminal in an embodiment of the present application.
[0072] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other via software interfaces. In some embodiments, the system is divided into four layers: application layer, application framework layer, runtime layer, system library layer, and kernel layer, from top to bottom.
[0073] The application layer can include a series of application packages.
[0074] like Figure 5 As shown, the application package may include applications (also referred to as apps) such as camera, calendar, and map.
[0075] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0076] The application framework layer may include a window manager, content provider, etc.
[0077] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.
[0078] The runtime includes the core library and the virtual machine. The runtime is responsible for the scheduling and management of the system.
[0079] The core library consists of two parts: one part is the function that the programming language (for example, Java language) needs to call, and the other part is the core library of the system.
[0080] The application layer and application framework layer run in a virtual machine. The virtual machine executes the application layer and application framework layer programming files (for example, Java files) as binary files. The virtual machine performs functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0081] The system library can include multiple functional modules, such as the surface manager and media libraries.
[0082] The kernel layer is the layer between hardware and software.
[0083] The modules involved in completing the aforementioned power consumption method are mainly located in the kernel layer of the system.
[0084] The core layer includes at least an acquisition module, a power budget decision module and a frequency control module.
[0085] The acquisition module can be used to output the data required for power consumption allocation and required frequency determination, such as total power consumption, required power consumption, and total remaining power consumption.
[0086] The acquisition module includes a total power consumption acquisition module, a required power consumption allocation module, a margin calculation module and a temperature acquisition module.
[0087] The power consumption acquisition module can be used to determine the total power consumption involved above. The determination process can be: the total power consumption acquisition module calls the temperature acquisition module to obtain the temperature of the terminal. The temperature can be the temperature of the back shell of the terminal. The total power consumption corresponding to the temperature of the terminal is then determined based on the temperature and PB mapping table. Among them, the temperature and PB mapping table is based on thermal / performance decisions and PB (Power Budget) decisions. The temperature and PB mapping table reflects the impact of temperature on power consumption. For example, controlling the terminal at a higher temperature can consume more total power consumption than at a lower temperature, but the specific increase in total power consumption is affected by the terminal's heat dissipation capacity and performance.
[0088] The required power consumption allocation module is used to allocate the total power consumption to the N core clusters using the aforementioned power consumption allocation method, thereby obtaining the required power consumption of the N core clusters. When determining the required power consumption, the required power consumption allocation module invokes the energy efficiency ratio decision module described below to determine the sum of the energy efficiency ratios of each core cluster. Based on this sum of the energy efficiency ratios, the module then determines whether to further adjust the budgeted power consumption of the N core clusters.
[0089] The margin calculation module is used to count the total remaining power consumption of the frequency points used by the core cluster in the current cycle.
[0090] The frequency control module is used to adjust the required frequency of each core cluster according to the required power consumption of each core cluster in the current cycle.
[0091] The frequency control module includes a demand frequency control module, an energy efficiency ratio decision module and a performance breakthrough decision module.
[0092] The demand frequency control module is used to determine the demand frequency of the core cluster upon detecting a change in the task on the core cluster (after the change). If the predicted demand frequency is greater than the maximum frequency of the core cluster, the demand frequency control module calls the performance breakthrough decision module to determine whether the total remaining power consumption can offset the overflow power consumption and feeds the result back to the demand frequency control module. Based on the result, the demand frequency control module determines whether the demand frequency upon completion of the task (after the change) is the predicted demand frequency or the maximum frequency.
[0093] about Figure 5 The interaction process between the modules involved in completing the power consumption allocation method can be referred to the following Figure 6 Description.
[0094] Figure 6 The modules involved include Figure 5 The total power consumption acquisition module, energy efficiency ratio decision module, required power consumption allocation module, required frequency control module, margin calculation module, and performance breakthrough decision module are shown in FIG. The process of implementing power consumption allocation and frequency calculation based on each module can be referred to the following description of steps S101 to S110, step S111a, and step S111b.
[0095] S101. The total power consumption acquisition module obtains the total power consumption of N core clusters in the kth cycle based on the temperature.
[0096] The temperature here usually refers to the temperature of the terminal's back shell. There is usually a corresponding relationship between temperature and power budget. This corresponding relationship can be recorded in the terminal's PB (Power Budget) mapping table.
[0097] Here, the kth cycle can be regarded as the current cycle of the terminal involved in the aforementioned content.
[0098] S102. The required power consumption allocation module obtains the performance frequency points of the N core clusters in the k-1th cycle.
[0099] The k-1th cycle is the previous cycle of the kth cycle.
[0100] The performance frequency of one of the N core clusters in the k-1th cycle is the actual operating frequency of that core cluster after it starts operating. The performance frequency is affected by the actual load, and the correspondence between the actual load and the performance frequency is recorded in the terminal. Generally speaking, the greater the actual load, the higher the performance frequency. For a description of the actual load, please refer to the relevant content above and will not be repeated here.
[0101] The demand power consumption allocation module determines the performance frequency point of each core cluster in the k-1th cycle according to the actual load of the N core clusters in the k-1th cycle.
[0102] S103 . The required power consumption allocation module allocates the total power consumption according to the N performance frequency points to obtain the budgeted power consumption of the N core clusters in the kth cycle.
[0103] The required power consumption allocation module can allocate the total power consumption in proportion to the N performance frequencies. This means that the budgeted power consumption allocated to one of the N core clusters divided by the total power consumption equals the performance frequency of the core cluster divided by the sum of the performance frequencies of the N core clusters.
[0104] S104. The required power consumption allocation module determines the maximum frequency point of each of the N core clusters under the budgeted power consumption.
[0105] The maximum frequency of a core cluster indicates the operating frequency when the core cluster runs continuously during the kth cycle and uses up all of its budgeted power consumption. If the core cluster runs continuously during the kth cycle and its operating frequency remains above the maximum frequency, the power consumption of the core cluster will exceed the budgeted power consumption.
[0106] It should be noted here that a core cluster being running indicates that there are tasks being executed on the core cluster.
[0107] In some possible cases, the relationship 1 for determining the maximum frequency point of a core cluster by the budgeted power consumption of the core cluster may refer to the following formula (2).
[0108]
[0109] In formula (2), the number of cores is the number of cores in the core cluster that is required to obtain the maximum frequency point. The cycle duration is the duration of the kth cycle.
[0110] Subsequently, the required power consumption allocation module returns the N maximum frequency points to the energy efficiency ratio decision module, so that the energy efficiency ratio decision module can execute the following step S105 to determine the sum of the frequency energy efficiency ratios of the N core clusters.
[0111] S105. The energy efficiency ratio decision module determines the frequency energy efficiency ratio of each core cluster based on the maximum frequency of each core cluster, and returns the sum of the frequency energy efficiency ratios corresponding to the N frequency energy efficiency ratios to the required power consumption allocation module.
[0112] The sum of the frequency-point energy efficiency ratios in step S105 predicts the performance of the N core clusters under the budgeted power consumption.
[0113] When the sum of the frequency-point energy efficiency ratios is greater than or equal to the preset energy efficiency ratio, it indicates that the budgeted power consumption of the N core clusters obtained can achieve good performance for the N core clusters. Therefore, the budgeted power consumption of the N core clusters can be used as the required power consumption of the N core clusters. For details about this situation, please refer to the previous description and will not be repeated here.
[0114] When the sum of the frequency-point energy efficiency ratios is less than the preset energy efficiency ratio, it indicates that the performance of the N core clusters is poor based on the currently obtained budgeted power consumption of the N core clusters. The required power consumption allocation module can perform the following step S106 to adjust the budgeted power consumption to obtain a budgeted power consumption (also referred to as required power consumption) that makes the sum of the frequency-point energy efficiency ratios greater than the preset energy efficiency ratio.
[0115] S106 . When the sum of the frequency-point energy efficiency ratios is less than the preset energy efficiency ratio, the required power consumption allocation module adjusts the budgeted power consumption of some or all core clusters to obtain the required power consumption of N core clusters.
[0116] In some possible cases, the aforementioned adjustment method 1 may be used to perform step S106. At this time, the process of adjusting the budget power consumption of part or all core clusters may refer to the following: Figure 7 Steps S201 to S205 are shown in FIG.
[0117] S201. Adjust the maximum frequency points of the X target core clusters to obtain an adjusted maximum frequency point.
[0118] In some possible cases, the target core cluster includes a core cluster whose maximum frequency point is greater than a preset frequency point 1 among the N core clusters, and / or a core cluster whose maximum frequency point is less than a preset frequency point 2 among the N core clusters.
[0119] Adjusting the maximum frequencies of the X target core clusters includes: lowering the maximum frequency of the target core cluster whose maximum frequency is greater than the preset frequency 1 by 10%, that is, the maximum frequency after the lowering is equal to the maximum frequency before the lowering multiplied by 1-10%, and / or increasing the maximum frequency of the target core cluster whose maximum frequency is less than the preset frequency 2 by 10%, that is, the maximum frequency after the highering is equal to the maximum frequency before the lowering multiplied by 1+10%.
[0120] In other possible cases, the target core cluster may also include other content. For example, the target core cluster may include the highest maximum frequency point and / or the lowest maximum frequency point among the N core clusters. The method for lowering and raising the maximum frequency point in this case can be referred to the aforementioned related description and will not be repeated here.
[0121] It should be noted that 10% here is just an example, and it can actually be other values, such as 15%, 5%, etc., and the embodiments of the present application are not limited to this.
[0122] S202: Update the frequency energy efficiency ratio using the X adjusted maximum frequency points and NX unadjusted maximum frequency points.
[0123] The updated frequency energy efficiency ratio is equal to the sum of the frequency energy efficiency ratios determined by the X adjusted maximum frequency points plus the sum of the frequency energy efficiency ratios determined by the Nx unadjusted maximum frequency points.
[0124] S203: Whether the sum of the updated frequency-point energy efficiency ratios is greater than or equal to the preset energy efficiency ratio.
[0125] If the updated sum of the frequency energy efficiency ratios is still less than the preset energy efficiency ratio, steps S201 and S202 are executed repeatedly to adjust the maximum frequency of the target core cluster and update the sum of the frequency energy efficiency ratios. The loop ends until the target core cluster no longer exists or the updated sum of the frequency energy efficiency ratios is greater than or equal to the preset energy efficiency ratio.
[0126] When the updated sum of the frequency-point energy efficiency ratios is greater than or equal to the preset energy efficiency ratio, the following steps S204 and S205 are performed.
[0127] S204 . Adjust the budgeted power consumption of the X target core clusters in the kth cycle according to the adjusted maximum frequency points of the X target core clusters.
[0128] The budgeted power consumption of a target core cluster in the kth cycle can be determined based on the aforementioned formula (2) based on the adjusted maximum frequency point of the target core cluster. In this case, the unknown number in formula (2) is the budgeted power consumption of the target core cluster in the kth cycle, and the other parameters in formula (2) are all known numbers.
[0129] S205 . Use the adjusted budget power consumption of the X target core clusters as the required power consumption of the X target core clusters in the kth cycle, and use the budget power consumption of the NX non-target core clusters as the required power consumption of the NX non-target core clusters in the kth cycle.
[0130] In other possible cases, the aforementioned adjustment method 2 may be used to perform step S106. In this case, the process of adjusting the budget power consumption of part or all core clusters may refer to the following Figure 8 Steps S301 to S305 are shown in FIG.
[0131] S301. Adjust the maximum frequency points of the X target core clusters to obtain an adjusted maximum frequency point.
[0132] The content involved in step S301 is the same as that of the aforementioned step S201. Please refer to the aforementioned description of step S205 and will not be repeated here.
[0133] S302 . Redistribute the total power consumption by using the X adjusted maximum frequency points and the maximum frequency points of the N non-target core clusters, and adjust the budgeted power consumption of the N core clusters in the kth cycle.
[0134] The total power consumption is redistributed proportionally using the X adjusted maximum frequencies and the NX maximum frequencies of the non-target core clusters. This allocation process is similar to the aforementioned process of allocating total power consumption proportionally based on the N performance frequencies. The N performance frequencies are replaced with the X adjusted maximum frequencies and the NX maximum frequencies of the non-target core clusters. This is not detailed here.
[0135] S303 . Update the frequency-point energy efficiency ratios corresponding to the N core clusters respectively using the (adjusted) budget power consumptions of the N core clusters.
[0136] The contents involved in step S303 are similar to those involved in the aforementioned steps S104 and S105 , and the budgeted power consumption is updated to the adjusted budgeted power consumption, which will not be described in detail here.
[0137] S304: Whether the sum of the updated frequency-point energy efficiency ratios is greater than or equal to the preset energy efficiency ratio.
[0138] If the updated sum of the frequency EERs is still less than the preset EER, steps S301 through S303 are executed repeatedly, adjusting the maximum frequency of the target core cluster and updating the sum of the frequency EERs. This loop ends until the target core cluster no longer exists or the updated sum of the frequency EERs is greater than or equal to the preset EER.
[0139] If the updated sum of the frequency-point energy efficiency ratios is greater than or equal to the preset energy efficiency ratio, the following step S305 is performed.
[0140] S305 . Use the adjusted budget power consumption of the N core clusters as the required power consumption of the N core clusters in the kth cycle.
[0141] S107 . In the kth cycle, the demand frequency control module detects that the tasks on core cluster 1 have changed.
[0142] In some possible cases, the tasks on the core cluster can be measured by the number of threads, for example, one thread or multiple threads. The specific number of threads can be set according to actual needs, and the embodiments of the present application do not limit this. In this case, a change in the task indicates a change in the number of threads.
[0143] When a task changes, a frequency adjustment is triggered. At this point, the demand frequency control module can execute step S108a to determine a predicted demand frequency for core cluster 1. Furthermore, the margin calculation module is called to execute step S108b below to obtain the remaining power consumption to subsequently determine whether the predicted demand frequency is available.
[0144] S108a. The demand frequency control module determines the predicted demand frequency of core cluster 1 based on the budgeted load required to complete the task.
[0145] Different budgeted loads can correspond to different predicted demand frequencies. The correspondence between budgeted loads and demand frequencies is recorded in the terminal.
[0146] For the description of budgeted load and predicted demand frequency, please refer to the above content and will not be repeated here.
[0147] S108b. The demand frequency control module calls the margin calculation module to count the total remaining power consumption of the j frequency points used by the core cluster 1 in the kth period.
[0148] The total remaining power consumption of core cluster 1 is equal to the power consumption required at the maximum frequency during the kth cycle minus the power loss at the required frequency points (j frequency points) used during the kth cycle. For details on determining the total remaining power consumption, refer to the previous description and are not repeated here.
[0149] Here, the elapsed time is the time from the start of the kth cycle to the current statistical total remaining power consumption.
[0150] S109. The demand frequency control module determines that the predicted demand frequency is greater than the maximum frequency corresponding to the required power consumption.
[0151] When step S109 is executed, the following steps S110 , S111 a , and S111 b are executed.
[0152] It should be noted here that step S109 is not necessarily executed. The demand frequency control module may also be executed to determine that the predicted demand frequency is less than the maximum frequency corresponding to the required power consumption, and then determine the predicted demand frequency as the j+1th demand frequency of core cluster 1 in the kth period.
[0153] S110. The demand frequency control module calls the performance breakthrough decision module to analyze the overflow power consumption on core cluster 1 when the predicted demand frequency is adopted, and analyzes whether the total remaining power consumption can offset the overflow power consumption.
[0154] The overflow power consumption on core cluster 1 is equal to the power consumption required when the predicted demand frequency point is adopted during the remaining time of the kth cycle minus the power consumption required when the maximum frequency point is adopted during the remaining time.
[0155] The total remaining power consumption is equal to the power consumption required when the maximum frequency point is adopted during the elapsed time of the kth cycle minus the power consumption loss (consumed power consumption) of the required frequency point used during the elapsed time.
[0156] For more information about overflow power consumption and total remaining power consumption, please refer to the above Figure 4B The description is not repeated here.
[0157] When the performance breakthrough decision module returns that the total remaining power consumption can offset the overflow power consumption, the following step S111a is executed.
[0158] When the performance breakthrough decision module returns that the total remaining power consumption can offset the overflow power consumption, the following step S111b is executed.
[0159] S111a. When the performance breakthrough decision module returns that the total remaining power consumption can offset the overflow power consumption, the demand frequency control module uses the predicted demand frequency as the j+1th demand frequency of core cluster 1 in the kth cycle.
[0160] S111b. When the performance breakthrough decision module returns that the total remaining power consumption can offset the overflow power consumption, the demand frequency control module uses the maximum frequency as the j+1th demand frequency of core cluster 1 in the kth cycle.
[0161] It should be noted that the aforementioned Figure 6 There is no particular order in which step S108a and step S108b are executed.
[0162] It should also be noted that the correspondence between the maximum frequency and frequency energy efficiency ratio of a core cluster is recorded in the terminal. In some cases, the frequency energy efficiency ratios corresponding to different maximum frequencies are obtained through measurement, and the measurement results are affected by the CPU model and terminal temperature. When the CPU model and terminal temperature are determined, the frequency energy efficiency ratio corresponding to a maximum frequency can be determined based on the correspondence.
[0163] The following first introduces an exemplary terminal provided in an embodiment of the present application.
[0164] Figure 9 It is a schematic diagram of the structure of the terminal provided in an embodiment of the present application.
[0165] The following embodiment is specifically described by taking a terminal as an example. It should be understood that a terminal may have more Figure 9 More or fewer components may be shown, two or more components may be combined, or the components may be arranged differently. Figure 9 The various components shown in the drawings may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.
[0166] The terminal may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0167] It is understood that the structures illustrated in the embodiments of the present application do not constitute specific limitations on the terminal. In other embodiments of the present application, the terminal may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0168] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0169] The controller can be the nerve center and command center of the terminal. It can generate operation control signals based on instruction operation codes and timing signals to complete the control of instruction fetching and execution.
[0170] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0171] The wireless communication function of the terminal can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.
[0172] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the terminal can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0173] The mobile communication module 150 can provide wireless communication solutions including 2G / 3G / 4G / 5G applied on the terminal.
[0174] The wireless communication module 160 can provide wireless communication solutions applied on the terminal, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), etc.
[0175] The terminal implements display functions through a GPU, display screen 194, and an application processor. The GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0176] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
[0177] The terminal can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0178] The sensor module 180 can be used to measure data at the terminal.
[0179] Among them, the temperature sensor 180J is used to detect temperature. In some embodiments, the terminal uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the terminal reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the terminal heats the battery 142 to prevent the terminal from shutting down abnormally due to low temperature. In other embodiments, when the temperature is lower than another threshold, the terminal boosts the output voltage of the battery 142 to prevent abnormal shutdown due to low temperature.
[0180] The buttons 190 include a power button, a volume button, and the like.
[0181] Motor 191 can generate vibration prompts.
[0182] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.
[0183] The SIM card interface 195 is used to connect a SIM card.
[0184] In the embodiment of the present application, the processor 110 can call the computer instructions stored in the internal memory 121 to enable the terminal to execute the method in the embodiment of the present application.
[0185] The present application also provides a chip system, which includes at least one processor for implementing the functions involved in the method executed by the terminal in any of the above embodiments.
[0186] In one possible design, the chip system further includes a memory, which is used to store program instructions and data, and the memory is located inside or outside the processor.
[0187] The chip system can be composed of chips, or can include chips and other discrete devices.
[0188] Optionally, there may be one or more processors in the chip system. The processor may be implemented in hardware or software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented in software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.
[0189] Optionally, the memory in the chip system may be one or more. The memory may be integrated with the processor or may be separated from the processor, which is not limited in the embodiment of the present application.
[0190] Exemplarily, the memory can be a non-transient processor, such as a read-only memory ROM, which can be integrated with the processor on the same chip or can be set on different chips respectively. The embodiments of the present application do not specifically limit the type of memory and the setting method of the memory and the processor.
[0191] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.
[0192] The present application also provides a computer program product, which includes: a computer program (also referred to as code, or instruction), which, when executed, enables a computer to execute the terminal execution method in any of the above embodiments.
[0193] The present application also provides a computer-readable storage medium storing a computer program (also referred to as code or instruction). When the computer program is executed, the computer executes the method executed by the terminal in any of the above embodiments.
[0194] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0195] As used in the above embodiments, the term “when…” may be interpreted to mean “if…” or “after…” or “in response to determining…” or “in response to detecting…”, depending on the context. Similarly, the phrases “upon determining…” or “if (stated condition or event) is detected” may be interpreted to mean “if determining…” or “in response to determining…” or “upon detecting (stated condition or event)” or “in response to detecting (stated condition or event)”, depending on the context.
[0196] The terms used in the embodiments of the present application are for the purpose of describing specific embodiments only and are not intended to limit the present application. As used in the specification and appended claims of this application, the singular expressions "a," "an," "said," "above," "the," and "this" are intended to include plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used in this application refers to and encompasses any and all possible combinations of one or more of the listed items.
[0197] The terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of the technical features indicated. Therefore, features defined as "first" or "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.
[0198] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it 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 device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. 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 hard disk).
[0199] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium, and when executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A power consumption allocation method, characterized in that: Applied to a terminal including a processor, wherein the processor includes N core clusters, the method includes: The terminal having a first temperature determines a total power consumption of the processor in a first period; and a correspondence between the temperature and the total power consumption is recorded in the terminal; The terminal allocates the total power consumption based on the actual load of the N core clusters in the second cycle to obtain the budgeted power consumption of the N core clusters in the first cycle; the second cycle is a cycle before the first cycle; N is an integer greater than 1; The terminal determines the maximum frequency of each of the N core clusters under the budgeted power consumption, and then determines the frequency energy efficiency ratio of each core cluster based on the maximum frequency of the N core clusters; the correspondence between the maximum frequency of a core cluster and the frequency energy efficiency ratio is recorded in the terminal; the frequency energy efficiency ratio of a core cluster is used to indicate the performance of the core cluster within the unit power consumption; When the sum of the frequency point energy efficiency ratios of the N core clusters is less than the preset energy efficiency ratio, the terminal adjusts the budget power consumption of some or all of the core clusters to obtain the required power consumption of the N core clusters in the first period; the sum of the frequency point energy efficiency ratios determined by the N required power consumptions is greater than or equal to the preset energy efficiency ratio.
2. The method according to claim 1, characterized in that The method further comprises: When the sum of the frequency-point energy efficiency ratios of the N core clusters is greater than or equal to the preset energy efficiency ratio, the terminal uses the budgeted power consumption of the N core clusters in the first period as the required power consumption of the N core clusters in the first period.
3. The method according to claim 1, characterized in that The terminal adjusts the budgeted power consumption of some or all core clusters to obtain the required power consumption of the N core clusters in the first period, specifically including: The terminal adjusts the maximum frequency points of X target core clusters to obtain X adjusted maximum frequency points, where X is an integer less than or equal to N; the maximum frequency point of a target core cluster is obtained based on the budgeted power consumption of the target core cluster divided by a first parameter, where the first parameter is equal to the number of cores in the target core cluster multiplied by the duration of the first period; The terminal adjusts the budgeted power consumption of the X target core clusters based on the X adjusted maximum frequency points respectively; The terminal uses the adjusted budget power consumption of the X target core clusters as the required power consumption of the X target core clusters in the first cycle, and uses the budget power consumption of the Nx non-target core clusters as the required power consumption of the Nx non-target core clusters in the first cycle.
4. The method according to claim 1, wherein The terminal adjusts the budgeted power consumption of some or all core clusters to obtain the required power consumption of the N core clusters in the first period, specifically including: The terminal adjusts the maximum frequency points of X target core clusters to obtain X adjusted maximum frequency points, where X is an integer less than or equal to N; the maximum frequency point of a target core cluster is obtained based on the budgeted power consumption of the target core cluster divided by a first parameter, where the first parameter is equal to the number of cores in the target core cluster multiplied by the duration of the first period; The terminal redistributes total power consumption by using the X adjusted maximum frequency points and the maximum frequency points of the N non-target core clusters, and adjusts the budgeted power consumption of the N core clusters in the first period; The terminal uses the adjusted budgeted power consumption of the N core clusters as the required power consumption of the N core clusters in the first period.
5. The method according to claim 3 or 4, characterized in that The target core cluster includes a core cluster whose maximum frequency among the N core clusters is greater than a first preset frequency, and / or a core cluster whose maximum frequency among the N core clusters is less than a second preset frequency, and the terminal adjusting the maximum frequency of the X target core clusters specifically includes: The terminal lowers the maximum frequency of the target core cluster whose maximum frequency is greater than the first preset frequency, and / or, in addition to the lowering, the terminal also increases the maximum frequency of the target core cluster whose maximum frequency is less than the second preset frequency.
6. The method according to claim 3 or 4, characterized in that The terminal allocates the total power consumption based on the actual load of the N core clusters in the second period to obtain the budgeted power consumption of the N core clusters in the first period, specifically including: The terminal determines the performance frequency of each core cluster in the second period based on the actual load of each of the N core clusters in the second period; the correspondence between the actual load and the performance frequency of a core cluster is recorded in the terminal; the performance frequency of a core cluster in the second period is the actual operating frequency of the core cluster after operation; The terminal allocates the total power consumption based on the performance frequencies of the N core clusters to obtain the budgeted power consumption of the N core clusters in the first period; the budgeted power consumption allocated to one core cluster divided by the total power consumption is equal to the performance frequency of one core cluster divided by the sum of the performance frequencies of the N core clusters.
7. The method according to any one of claims 1 to 4, characterized in that After obtaining the required power consumption of the N core clusters in the first cycle, the method further includes: When a task on the first core cluster changes, the terminal determines a predicted demand frequency point of the first core cluster based on a budgeted load required to complete the task; When the predicted demand frequency is less than or equal to the maximum frequency of the first core cluster, the terminal uses the predicted demand frequency as a demand frequency of the first core cluster in the first period.
8. The method according to claim 7, characterized in that The method further comprises: When the predicted demand frequency is greater than the maximum frequency of the first core cluster, the terminal determines overflow power consumption on the first core cluster when the predicted demand frequency is adopted; The terminal determines a demand frequency of the first core cluster in the first period based on the overflow power consumption, the predicted demand frequency and the total remaining power consumption on the first core cluster; wherein the overflow power consumption on the first core cluster is equal to the power consumption required to adopt the predicted demand frequency during the remaining time of the first period minus the power consumption required to adopt the maximum frequency during the remaining time; the total remaining power consumption on the first core cluster is equal to the power consumption required to adopt the maximum frequency during the used time of the first period minus the power consumption consumed during the used time.
9. The method according to claim 8, characterized in that The terminal determines, based on the overflow power consumption, the predicted demand frequency point, and the total remaining power consumption of the first core cluster, a demand frequency point of the first core cluster in the first period, specifically including: When it is determined that the total remaining power consumption can offset the overflow power consumption, the terminal uses the predicted demand frequency as a demand frequency of the first core cluster in the first period; When it is determined that the total remaining power consumption cannot offset the overflow power consumption, the terminal uses the maximum frequency of the first core cluster as a required frequency of the first core cluster in the first period.
10. The method according to claim 9, characterized in that The total remaining power consumption can offset the overflow power consumption, specifically including: The total remaining power consumption is greater than the overflow power consumption, or the total remaining power consumption minus the overflow power consumption is greater than a preset power consumption value.
11. A terminal, characterized in that: include: One or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to cause the terminal to execute the method according to any one of claims 1 to 10.
12. A computer-readable storage medium comprising computer instructions, characterized in that: When the computer instructions are executed on a terminal, the terminal is caused to execute the method according to any one of claims 1 to 10.
13. A chip system, applied to a terminal, characterized in that: The chip system includes one or more processors, and the processors are used to call computer instructions to enable the terminal to execute the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Method and device for determining power consumption limit
CN114730207A
Temperature control method and device, terminal equipment and storage medium
CN117590880A