Prediction methods for processors and variables

By introducing induction devices and control logic into the processor, predicting the value of the variable to be predicted in the next cycle of the processor core, solving the problem of failure to consider the operating status of the processor in the prior art, realizing a more accurate adjustment strategy, avoiding the risk of overcurrent or overtemperature.

CN115769172BActive Publication Date: 2025-06-06HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202080102431.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-28
Publication Date
2025-06-06
Estimated Expiration
2040-06-28

Smart Images

  • Figure CN115769172B_ABST
    Figure CN115769172B_ABST
Patent Text Reader

Abstract

A processor and a method for predicting a variable, wherein the processor includes: at least one processor core, control logic and at least one sensing device; the at least one sensing device is used to obtain the measured value of the variable to be predicted of at least one processor core in the current cycle; the control logic is used to determine the predicted value of the variable to be predicted of at least one processor core in the next cycle according to the measured value of the variable to be predicted of at least one processor core in the current cycle. The processor and the prediction method provide a way to determine the predicted value of the variable to be predicted in the next cycle, so that the adjustment strategy determined according to the predicted value of the variable to be predicted in the next cycle can cope with the operating state of the processor in the next cycle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a processor and a variable prediction method. Background Art

[0002] In a processor with Turbo function, there is usually an adjustment strategy based on various variables (such as power consumption and temperature). The adjustment strategy can ensure that the processor will not have abnormal conditions such as overcurrent or overtemperature during operation, thereby ensuring that the processor operates within a safe range.

[0003] For example, the adjustment process of the adjustment strategy based on power consumption includes: determining the relationship between the measured value of the power consumption of each processor core in the processor in the current cycle and the preset waterline, and determining the adjustment strategy of each processor core according to the relationship between the measured value of the power consumption of each processor core in the current cycle and the preset waterline, and adjusting the operating state of the corresponding processor core in the next cycle according to the adjustment strategy of each processor core, thereby ensuring that the processor operates within a safe range. However, since the processor may have unexpected behavior in the next cycle, for example, for a given 32-core processor, if all the processor cores of the processor in the current cycle are in a state of low power consumption, then when the system requests that all the processor cores of the processor enter the Turbo state in the next cycle, since all the processor cores of the processor in the current cycle are in a state of low power consumption, the determined adjustment strategy determines that there is a margin for power consumption and allows all processor cores to enter the Turbo state. Obviously, all the processor cores currently enter the Turbo state, and the processor is at risk of overcurrent.

[0004] Obviously, since the measured value of the power consumption of the processor core in the current cycle does not take into account the operating state of the processor core in the next cycle, the adjustment strategy determined by the above method may not be able to cope with the operating state of the processor in the next cycle, resulting in the risk of overcurrent in the processor, affecting the normal operation of the processor. Similarly, similar problems exist for other variables. Summary of the invention

[0005] The present application provides a processor and a variable prediction method, which are used to solve the problem that the measured value of the variable in the current cycle does not take into account the running state of the processor core in the next cycle, and the adjustment strategy determined according to the measured value of the variable in the current cycle cannot cope with the running state of the processor in the next cycle.

[0006] In a first aspect, a processor is provided, comprising at least one processor core, control logic and at least one sensing device; the at least one sensing device is used to obtain the measured value of the variable to be predicted of the at least one processor core in a current cycle; the control logic is used to determine the predicted value of the variable to be predicted of the at least one processor core in the next cycle based on the measured value of the variable to be predicted of the at least one processor core in the current cycle.

[0007] A method for determining a predicted value of a variable to be predicted of a processor core in the next cycle is provided, so that an adjustment strategy determined based on the predicted value of the variable to be predicted in the next cycle can cope with the operating state of the processor in the next cycle, thereby ensuring that the processor operates within a safe range.

[0008] In one possible implementation, the variable to be predicted is the power consumption of the processor core; determining the predicted value of the variable to be predicted of the at least one processor core in the next cycle based on the measured value of the variable to be predicted of the at least one processor core in the current cycle includes: obtaining the measured values ​​of the frequency and voltage of the at least one processor core in the current cycle; determining the values ​​of the frequency and voltage of the at least one processor core in the next cycle; determining the predicted value of the power consumption of the at least one processor core in the next cycle based on the measured value of the power consumption of the at least one processor core in the current cycle, the measured values ​​of the frequency and voltage of the at least one processor core in the current cycle, and the values ​​of the frequency and voltage of the at least one processor core in the next cycle.

[0009] According to the measured value of the power consumption of at least one processor core in the current cycle, the measured value of the frequency and voltage of at least one processor core in the current cycle, and the value of the frequency and voltage of at least one processor core in the next cycle, the predicted value of the power consumption of at least one processor core in the next cycle is determined, and a method for determining the predicted value of the power consumption of the processor core in the next cycle is provided, and the determination method is simple and easy to execute, which improves the efficiency of determining the predicted value of the power consumption of the processor core in the next cycle. In addition, because when determining the predicted value of the power consumption of at least one processor core in the next cycle, the values ​​of the voltage and power of at least one processor core in the next cycle are taken into account, that is, the working state of at least one processor core in the next cycle is taken into account, therefore, the accuracy of determining the predicted value of the power consumption of the processor core in the next cycle is improved.

[0010] In a possible implementation, the predicted value of the power consumption of the processor core in the next cycle is determined according to the following formula:

[0011]

[0012] Wherein: P(t+1) is the predicted value of the power consumption of the processor core in the next cycle, P(t) is the measured value of the power consumption of the processor core in the current cycle, f(t+1) is the value of the frequency of the processor core in the next cycle, f(t) is the measured value of the frequency of the processor core in the current cycle, V(t+1) is the value of the voltage of the processor core in the next cycle, and V(t) is the measured value of the voltage of the processor core in the current cycle.

[0013] In one possible implementation, the control logic is also used to: obtain a measured value of the temperature of the at least one processor core in a current cycle; obtain a measured value of the temperature of the at least one processor core in a previous cycle; obtain a measured value of the power consumption of the at least one processor core in a previous cycle; and determine a predicted value of the temperature of the at least one processor core in the next cycle based on the measured values ​​of the power consumption and temperature of the at least one processor core in the previous cycle and the current cycle, respectively, and the predicted value of the power consumption of the at least one processor core in the next cycle.

[0014] According to the measured values ​​of the power consumption and temperature of at least one processor core in the previous cycle and the current cycle, respectively, and the predicted value of the power consumption of at least one processor core in the next cycle, the predicted value of the temperature of at least one processor core in the next cycle is determined, and a method for determining the predicted value of the temperature of the processor core in the next cycle is provided. The determination method is simple and easy to execute, and the efficiency of determining the predicted value of the temperature of the processor core in the next cycle is improved. In addition, because the value of the power consumption of at least one processor core in the next cycle is taken into account when determining the predicted value of the temperature of at least one processor core in the next cycle, that is, the working state of at least one processor core in the next cycle is taken into account, the accuracy of determining the predicted value of the temperature of the processor core in the next cycle is improved.

[0015] In a possible implementation, the predicted value of the temperature of the processor core in the next cycle is determined according to the following formula:

[0016]

[0017] Among them, T(t+1) is the predicted value of the temperature of the processor core in the next cycle, T(t) is the measured value of the temperature of the processor core in the current cycle, T(t-1) is the measured value of the temperature of the processor core in the previous cycle, P(t+1) is the predicted value of the power consumption of the processor core in the next cycle, P(t) is the measured value of the power consumption of the processor core in the current cycle, and P(t-1) is the measured value of the power consumption of the processor core in the previous cycle.

[0018] In one possible implementation, determining the predicted value of the variable to be predicted of the at least one processor core in the next cycle based on the measured value of the variable to be predicted of the at least one processor core in the current cycle includes: determining the predicted value of the variable to be predicted of the at least one processor core in the next cycle based on the measured value of the variable to be predicted of the at least one processor core in the current cycle in combination with a correction table.

[0019] In a possible implementation, the variable to be predicted is the power consumption of the processor core, and the correction table includes a first correction table and a second correction table; determining the predicted value of the variable to be predicted of the at least one processor core in the next cycle based on the measured value of the variable to be predicted of the at least one processor core in the current cycle and in combination with a correction table includes: determining a first value of the power consumption of the at least one processor core in the next cycle based on the measured value of the power consumption of the at least one processor core in the current cycle; determining a changing trend of the load of the at least one processor core in the next cycle based on the first correction table; determining a corrected value of the load of the at least one processor core in the next cycle based on the second correction table; and correcting the first value of the power consumption of the at least one processor core based on the changing trend of the load of the at least one processor core and the corrected value of the load of the at least one processor core to obtain a predicted value of the power consumption of the at least one processor core in the next cycle.

[0020] By determining a first value of the power consumption of at least one processor core in the next cycle, determining a change trend and a correction value of the load of at least one processor core in the next cycle according to a first correction table and a second correction table, and correcting the first value of the power consumption of the processor core in the next cycle according to the change trend and the correction value of the load of at least one processor core in the next cycle, a predicted value of the power consumption of at least one processor core in the next cycle is obtained, a method for determining the predicted value of the power consumption of the processor core in the next cycle is provided, and the determination method is simple and easy to execute, thereby improving the efficiency of determining the predicted value of the power consumption of the processor core in the next cycle; in addition, since the first value of the power consumption of at least one processor core in the next cycle is corrected according to the change trend and the correction value of the load of at least one processor core in the next cycle, the predicted value of the power consumption of at least one processor core in the next cycle is obtained, that is, in the process of determining the predicted value of the power consumption of at least one processor core in the next cycle, the influence of the change of the load of at least one processor core in the next cycle on the predicted value of the power consumption of at least one processor core in the next cycle is considered, thereby improving the accuracy of determining the predicted value of the power consumption of at least one processor core in the next cycle.

[0021] In one possible implementation, the control logic is also used to: obtain a measured value of the power consumption of the at least one processor core in a previous cycle; obtain measured values ​​of the temperature of the at least one processor core in the current cycle and the previous cycle respectively; and determine a predicted value of the temperature of the at least one processor core in the next cycle based on the predicted value of the power consumption of the at least one processor core in the next cycle, the measured values ​​of the power consumption of the at least one processor core in the current cycle and the previous cycle, and the measured values ​​of the temperature of the at least one processor core in the current cycle and the previous cycle.

[0022] According to the predicted value of the power consumption of at least one processor core in the next cycle, the measured value of the power consumption of at least one processor core in the current cycle and the previous cycle, and the measured value of the temperature of at least one processor core in the current cycle and the previous cycle, the predicted value of the temperature of at least one processor core in the next cycle is determined, and a method for determining the predicted value of the temperature of the processor core in the next cycle is provided, and the determination method is simple and easy to execute, thereby improving the efficiency of determining the predicted value of the temperature of the processor core in the next cycle. In addition, since the value of the power consumption of the processor core in the next cycle is taken into account when determining the predicted value of the temperature of the processor core in the next cycle, that is, the working state of the processor core in the next cycle is taken into account, the accuracy of determining the predicted value of the temperature of the processor core in the next cycle is improved. In addition, in the process of determining the predicted value of the power consumption of the processor core in the next cycle, the influence of the change of the load of the processor core in the next cycle on the predicted value of the power consumption of the processor core in the next cycle is taken into account, further improving the accuracy of determining the predicted value of the power consumption of the processor core in the next cycle, thereby further improving the accuracy of the predicted value of the temperature of the processor core in the next cycle determined by the predicted value of the power consumption of the processor core in the next cycle.

[0023] In a possible implementation, the first correction table includes T N The first index information and T N The first change trend, where: N The first index information and the T Na first change trend corresponds to a first index information corresponding to the processor core in N consecutive cycles, T is the number of types of change trends of the load of the processor core in one cycle; a first change trend is used to indicate a change trend of the value of the load of the processor core in the first cycle compared to the value of the load of the processor core in the second cycle, wherein the first cycle is the next cycle of the N consecutive cycles indicated by the first index information corresponding to the first change trend, and the second cycle is the last cycle of the N consecutive cycles indicated by the first index information corresponding to the first change trend; the second correction table includes T N The second index information and T N correction value, where: N The second index information and the T N correction values ​​correspond one to one; one second index information is used to indicate the result of an XOR operation between a change trend of the load of the processor core in N consecutive cycles and the value of the load of the processor core in the last cycle of the N consecutive cycles; one correction value is used to indicate the percentage of change of the value of the load of the processor core in the third cycle compared to the value of the load of the processor core in the fourth cycle, wherein the third cycle is the next cycle of the N consecutive cycles indicated by the second index information corresponding to the correction value, and the fourth cycle is the last cycle of the N consecutive cycles indicated by the second index information corresponding to the correction value.

[0024] In one possible implementation, the control logic is also used to determine an adjustment strategy for the at least one processor core based on a predicted value of a variable to be predicted for the at least one processor core in a next cycle, wherein the adjustment strategy is used to indicate an adjustment method for the voltage and / or frequency of the processor core.

[0025] In one possible implementation, determining the adjustment strategy of the at least one processor core based on the predicted value of the variable to be predicted of the at least one processor core in the next cycle includes: generating a frequency adjustment instruction and / or a voltage adjustment instruction for the at least one processor core according to the adjustment strategy of the at least one processor core; the processor also includes at least one frequency and voltage adjustment circuit; the control logic is also used to send the frequency adjustment instruction and / or voltage adjustment instruction of the at least one processor core to the at least one frequency and voltage adjustment circuit; the at least one frequency and voltage adjustment circuit is used to adjust the frequency and / or voltage of the at least one processor core according to the frequency adjustment instruction and / or voltage adjustment instruction of the at least one processor core.

[0026] In a second aspect, a variable prediction method is provided, comprising: obtaining the measured value of the variable to be predicted of the at least one processor core in the current cycle; and determining the predicted value of the variable to be predicted of the at least one processor core in the next cycle based on the measured value of the variable to be predicted of the at least one processor core in the current cycle.

[0027] In one possible implementation, the variable to be predicted is the power consumption of the processor core; determining the predicted value of the variable to be predicted of the at least one processor core in the next cycle based on the measured value of the variable to be predicted of the at least one processor core in the current cycle includes: obtaining the measured values ​​of the frequency and voltage of the at least one processor core in the current cycle; determining the values ​​of the frequency and voltage of the at least one processor core in the next cycle; determining the predicted value of the power consumption of the at least one processor core in the next cycle based on the measured value of the power consumption of the at least one processor core in the current cycle, the measured values ​​of the frequency and voltage of the at least one processor core in the current cycle, and the values ​​of the frequency and voltage of the at least one processor core in the next cycle.

[0028] In a possible implementation, the predicted value of the power consumption of the processor core in the next cycle is determined according to the following formula:

[0029]

[0030] Wherein: P(t+1) is the predicted value of the power consumption of the processor core in the next cycle, P(t) is the measured value of the power consumption of the processor core in the current cycle, f(t+1) is the value of the frequency of the processor core in the next cycle, f(t) is the measured value of the frequency of the processor core in the current cycle, V(t+1) is the value of the voltage of the processor core in the next cycle, and V(t) is the measured value of the voltage of the processor core in the current cycle.

[0031] In one possible implementation, the method further includes: obtaining a measured value of the temperature of the at least one processor core in a current cycle; obtaining a measured value of the temperature of the at least one processor core in a previous cycle; obtaining a measured value of the power consumption of the at least one processor core in a previous cycle; and determining a predicted value of the temperature of the at least one processor core in the next cycle based on the measured values ​​of the power consumption and temperature of the at least one processor core in the previous cycle and the current cycle, respectively, and the predicted value of the power consumption of the at least one processor core in the next cycle.

[0032] In a possible implementation, the predicted value of the temperature of the processor core in the next cycle is determined according to the following formula:

[0033]

[0034] Among them, T(t+1) is the predicted value of the temperature of the processor core in the next cycle, T(t) is the measured value of the temperature of the processor core in the current cycle, T(t-1) is the measured value of the temperature of the processor core in the previous cycle, P(t+1) is the predicted value of the power consumption of the processor core in the next cycle, P(t) is the measured value of the power consumption of the processor core in the current cycle, and P(t-1) is the measured value of the power consumption of the processor core in the previous cycle.

[0035] In one possible implementation, determining the predicted value of the variable to be predicted of the at least one processor core in the next cycle based on the measured value of the variable to be predicted of the at least one processor core in the current cycle includes: determining the predicted value of the variable to be predicted of the at least one processor core in the next cycle based on the measured value of the variable to be predicted of the at least one processor core in the current cycle in combination with a correction table.

[0036] In a possible implementation, the variable to be predicted is the power consumption of the processor core, and the correction table includes a first correction table and a second correction table; determining the predicted value of the variable to be predicted of the at least one processor core in the next cycle based on the measured value of the variable to be predicted of the at least one processor core in the current cycle and in combination with a correction table includes: determining a first value of the power consumption of the at least one processor core in the next cycle based on the measured value of the power consumption of the at least one processor core in the current cycle; determining a changing trend of the load of the at least one processor core in the next cycle based on the first correction table; determining a corrected value of the load of the at least one processor core in the next cycle based on the second correction table; and correcting the first value of the power consumption of the at least one processor core based on the changing trend of the load of the at least one processor core and the corrected value of the load of the at least one processor core to obtain a predicted value of the power consumption of the at least one processor core in the next cycle.

[0037] In one possible implementation, the method further includes: obtaining a measured value of the power consumption of the at least one processor core in a previous cycle; obtaining measured values ​​of the temperature of the at least one processor core in the current cycle and the previous cycle respectively; and determining a predicted value of the temperature of the at least one processor core in the next cycle based on the predicted value of the power consumption of the at least one processor core in the next cycle, the measured values ​​of the power consumption of the at least one processor core in the current cycle and the previous cycle, and the measured values ​​of the temperature of the at least one processor core in the current cycle and the previous cycle.

[0038] In a possible implementation, the first correction table includes T N The first index information and T N The first change trend, where: N The first index information and the T N a first change trend corresponds to a first index information corresponding to the processor core in N consecutive cycles, T is the number of types of change trends of the load of the processor core in one cycle; a first change trend is used to indicate a change trend of the value of the load of the processor core in the first cycle compared to the value of the load of the processor core in the second cycle, wherein the first cycle is the next cycle of the N consecutive cycles indicated by the first index information corresponding to the first change trend, and the second cycle is the last cycle of the N consecutive cycles indicated by the first index information corresponding to the first change trend; the second correction table includes T N The second index information and T N correction value, where: N The second index information and the T N correction values ​​correspond one to one; one second index information is used to indicate the result of an XOR operation between a change trend of the load of the processor core in N consecutive cycles and the value of the load of the processor core in the last cycle of the N consecutive cycles; one correction value is used to indicate the percentage of change of the value of the load of the processor core in the third cycle compared to the value of the load of the processor core in the fourth cycle, wherein the third cycle is the next cycle of the N consecutive cycles indicated by the second index information corresponding to the correction value, and the fourth cycle is the last cycle of the N consecutive cycles indicated by the second index information corresponding to the correction value.

[0039] In one possible implementation, the method further includes: determining an adjustment strategy for the at least one processing core based on a predicted value of a variable to be predicted of the at least one processor core in a next cycle, wherein the adjustment strategy is used to indicate an adjustment method for the voltage and / or frequency of the processor core.

[0040] In one possible implementation, determining the adjustment strategy of the at least one processing core based on the predicted value of the variable to be predicted of the at least one processor core in the next cycle includes: generating frequency adjustment instructions and / or voltage adjustment instructions for the at least one processor core according to the adjustment strategy of the at least one processor core; and adjusting the frequency and / or voltage of the at least one processor core according to the frequency adjustment instructions and / or voltage adjustment instructions of the at least one processor core.

[0041] According to a third aspect, a computer-readable storage medium is provided, comprising a computer program, wherein when the computer program is executed on a computer, the computer is caused to execute the method according to any one of the second aspects.

[0042] According to a fourth aspect, a computer program is provided, which, when executed by a computer, is used to perform any one of the methods according to the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A schematic diagram of the structure of a processor provided in an embodiment of the present application;

[0044] Figure 2 A schematic diagram of a flow chart for determining a predicted value of the power consumption of processor core 0 in the next cycle provided in an embodiment of the present application:

[0045] Figure 3 A schematic diagram of a flow chart for determining a predicted value of the temperature of processor core 0 in the next cycle provided in an embodiment of the present application;

[0046] Figure 4 A schematic flow chart of a variable prediction method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] The technical solution in this application will be described below in conjunction with the accompanying drawings.

[0048] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0049] The terms "first", "second", etc. in the specification embodiments, claims, and drawings of the present application are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, including a series of steps or units. The method, system, product, or device is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0050] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0051] In order to solve the problem that the adjustment strategy determined according to the measured value of the variable in the current cycle cannot cope with the running state of the processor in the next cycle because the measured value of the variable in the current cycle does not take into account the running state of the processor core in the next cycle, the embodiment of the present application provides a processor, Figure 1 This is a schematic diagram of the structure of the processor provided in the embodiment of the present application. Figure 1 As shown, the processor includes 4 processor cores, control logic, 4 sensing devices, 4 frequency voltage regulation circuits, external cache, internal memory, general unit, accelerator, input / output control unit & interface unit. Among them, the 4 processor cores correspond to the 4 sensing devices one by one, and the 4 processor cores correspond to the 4 frequency voltage regulation circuits one by one. The 4 processor cores are processor core 0, processor core 1, processor core 2, and processor core 3.

[0052] Each sensing device is used to obtain the measured value of the variable to be predicted of the corresponding processor core in the current cycle, and transmit the obtained measured value of the variable to be predicted of the corresponding processor core in the current cycle to the control logic.

[0053] The control logic is used to determine the predicted value of the variable to be predicted for each processor core in the next cycle. Specifically, it may include but is not limited to the following two methods:

[0054] First, the control logic determines the predicted value of the variable to be predicted of each processor core in the next cycle according to the measured value of the variable to be predicted of each processor core in the current cycle.

[0055] The second type is that the control logic determines the predicted value of the variable to be predicted for each processor core in the next cycle based on the measured value of the variable to be predicted for each processor core in the current cycle and in combination with a correction table. The correction table is used to indicate the change trend and correction value of the related variables of the variable to be predicted in the next cycle. The related variables of the variable to be predicted refer to the variables that affect the predicted value of the variable to be predicted in the next cycle. For example, if the variable to be predicted is the power consumption or temperature of the processor core, since the change of the load of the processor core will affect the temperature and power consumption of the processor core, the related variables of the power consumption and temperature of the processor core are the load of the processor core.

[0056] The variable to be predicted may be, for example, the power consumption of the processor core, the temperature of the processor core, etc., which is not particularly limited in the embodiment of the present application.

[0057] Next, taking the power consumption of the processor core as an example of the variable to be predicted, the process of determining the predicted value of the power consumption of the processor core 0 in the next cycle is described. Figure 2 A flowchart of determining a predicted value of the power consumption of processor core 0 in the next cycle provided by an embodiment of the present application. Figure 2 As shown, including:

[0058] Step 201: The sensing device in the processor core 0 obtains the measured value of the power consumption of the processor core 0 in the current cycle. Specifically, the following two methods are included:

[0059] In the first method, the sensing device obtains the power consumption value of the processor core 0 at any time or a specified time in the current cycle, and determines the obtained power consumption value as the measured value of the power consumption of the processor core 0 in the current cycle. The specified time can be, for example, an intermediate time or a starting time in the current cycle, etc., and this application does not specifically limit this.

[0060] Second, the sensing device obtains the power consumption values ​​of the processor core 0 at multiple moments in the current cycle, calculates an average value of the power consumption values ​​at multiple moments, and determines the average value as the measured value of the power consumption of the processor core 0 in the current cycle, wherein the multiple moments in the current cycle can be set based on experience, and the present application does not make any special limitation on this.

[0061] The sensing device for acquiring power consumption may be, for example, a power sensor, etc., which is not particularly limited in the embodiment of the present application.

[0062] It should be noted that the above method of obtaining the measured value of the power consumption of processor 0 in the current cycle is only exemplary and is not intended to limit the present application.

[0063] Step 202 : The sensing device in the processor core 0 sends the measured value of the power consumption of the processor core 0 in the current cycle to the control logic.

[0064] Step 203: The control logic determines the predicted value of the power consumption of the processor core 0 in the next cycle. Specifically, the following two methods can be used to determine the predicted value.

[0065] The first method is to determine the predicted value of the power consumption of the processor core 0 in the next cycle based on the measured value of the power consumption of the processor core 0 in the current cycle. The specific process includes:

[0066] First, obtain the measured values ​​of the frequency and voltage of the processor core 0 in the current cycle.

[0067] The measured value of the frequency of processor core 0 in the current cycle may be the value of the frequency of processor core 0 at any moment or a specified moment in the current cycle. The measured value of the frequency of processor core 0 in the current cycle may also be the average value of the frequency of processor core 0 at multiple moments in the current cycle, etc. This application does not make any special limitation on this.

[0068] Similarly, the measured value of the voltage of processor core 0 in the current cycle may be the value of the voltage of processor core 0 at any moment in the current cycle or a specified moment. The measured value of the voltage of processor core 0 in the current cycle may also be the average value of the values ​​of the voltage of processor core 0 at multiple moments in the current cycle, etc. This application does not impose any special limitations on this.

[0069] Then, the frequency and voltage values ​​of the processor core 0 in the next cycle are determined. For example, the frequency and voltage values ​​of the processor core 0 in the next cycle can be determined respectively by a control algorithm or an operating system.

[0070] Finally, the predicted value of the power consumption of the processor core 0 in the next cycle is determined based on the measured value of the power consumption of the processor core 0 in the current cycle, the measured values ​​of the frequency and voltage of the processor core 0 in the current cycle, and the values ​​of the frequency and voltage of the processor core 0 in the next cycle. For example, the predicted value of the power consumption of the processor core 0 in the next cycle can be determined by the following formula:

[0071]

[0072] Where: P(t+1) is the predicted value of the power consumption of processor core 0 in the next cycle, P(t) is the measured value of the power consumption of processor core 0 in the current cycle, f(t+1) is the value of the frequency of processor core 0 in the next cycle, f(t) is the measured value of the frequency of processor core 0 in the current cycle, V(t+1) is the value of the voltage of processor core 0 in the next cycle, and V(t) is the measured value of the voltage of processor core 0 in the current cycle.

[0073] As can be seen from the above, the measured values ​​of the frequency, voltage and power consumption of the processor core 0 in the current cycle are determined, the values ​​of the frequency and voltage of the processor core 0 in the next cycle are determined, and the predicted value of the power consumption of the processor core 0 in the next cycle can be determined according to the above-mentioned measured values ​​and determined values. A method for determining the predicted value of the power consumption of the processor core 0 in the next cycle is provided, and the determination method is simple and easy to execute, which improves the efficiency of determining the predicted value of the power consumption of the processor core 0 in the next cycle. In addition, because the values ​​of the voltage and power of the processor core 0 in the next cycle are taken into account when determining the predicted value of the power consumption of the processor core 0 in the next cycle, that is, the working state of the processor core 0 in the next cycle is taken into account, therefore, the accuracy of determining the predicted value of the power consumption of the processor core 0 in the next week is improved.

[0074] The second method: determining the predicted value of the power consumption of the processor core 0 in the next cycle based on the measured value of the power consumption of the processor core 0 in the current cycle in combination with a correction table, wherein the correction table includes a first correction table and a second correction table, the first correction table is used to predict the change trend of the load of the processor core in the next cycle, and the second correction table is used to predict the correction value of the load of the processor core in the next cycle. The specific process includes:

[0075] First, a first value of the power consumption of the processor core 0 in the next cycle is determined according to the measured value of the power consumption of the processor core 0 in the current cycle. Since the principle of this step is the same as the principle of determining the predicted value of the power consumption of the processor core 0 in the next cycle in the first method, that is, the first value here is the predicted value of the power consumption of the processor core 0 in the next cycle in the first method, it will not be repeated here.

[0076] Then, the change trend of the load of the processor core 0 in the next cycle is determined according to the first correction table.

[0077] The first correction table includes T N The first index information and T N The first change trend, among which, T N The first index information and T N The first change trends correspond one to one.

[0078] A first index information is used to indicate a change trend of the load of the processor core in N consecutive cycles. A change trend of the load of the processor core in N consecutive cycles refers to a combination of N change trends of the load of the processor core. The N change trends correspond to the N consecutive cycles one by one. A change trend is used to indicate the change trend of the load of the processor core in the corresponding cycle. The change trend of the load of the processor core in the corresponding cycle is the change trend of the value of the load of the processor core in the corresponding cycle compared to the value of the load of the processor core in the previous cycle of the corresponding cycle. T is the number of types of change trends of the load of the processor core in one cycle. For example, if the change trend of the load of the processor core in one cycle includes three situations of increasing, decreasing, and unchanged, that is, it includes three types, then the value of T is 3. For another example, if the change trend of the load of the processor core in one cycle includes two situations of increasing and decreasing, that is, it includes two types, then the value of T is 2. It should be noted that the N change trends are combined in the order of the corresponding N consecutive cycles. The value of N can be set according to design requirements, and this application does not make any special restrictions on this.

[0079] Since the change trend of the processor core load in one cycle includes T types, that is, one change trend has T types, therefore, there are T combinations of N change trends. N Then, the number of first index information is T N indivual.

[0080] A first change trend is used to indicate a change trend of a value of the load of the processor core in the first cycle compared to a value of the load of the processor core in the second cycle, wherein the first cycle is the next cycle of the N consecutive cycles indicated by the first index information corresponding to the first change trend, and the second cycle is the last cycle of the N consecutive cycles indicated by the first index information corresponding to the first change trend. In other words, a first change trend is used to indicate a change trend of the load of the processor core in the next cycle of the N consecutive cycles indicated by the corresponding first index information. For example, if the value of N is 8, and if the 8 consecutive cycles are the 5th to 12th cycles, the first cycle is the 13th cycle, and the second cycle is the 12th cycle. The first change trend, for example, includes three situations of increasing, decreasing, and unchanged. The first change trend also includes two situations of increasing or equal to, and decreasing, and the present application does not make special limitations on this.

[0081] It should be noted that the construction principle of the first correction table will be explained below, so it will not be repeated here.

[0082] Based on this, the principle of determining the changing trend of the load of processor core 0 in the next cycle is: obtain the changing trend of the load of processor core 0 in N consecutive cycles, where the last cycle of the N consecutive cycles is the current cycle; use the changing trend of the load of processor core 0 in N consecutive cycles as the first index information to be compared, match the first index information to be compared with the first index information in the first correction table, and determine the first changing trend corresponding to the first index information matching the first index information to be compared as the changing trend of the load of processor core 0 in the next cycle.

[0083] The process of obtaining the changing trend of the load of processor core 0 in N consecutive cycles includes: obtaining the values ​​of power consumption, frequency, and voltage of processor core 0 in each cycle in N consecutive cycles, calculating the product of the value of the frequency of processor core 0 in one cycle and the square of the value of the voltage of processor core 0 in the cycle, and representing the value of the load of processor core 0 in the cycle by the ratio of the value of the power consumption of processor core 0 in the cycle to the product. In other words, the ratio can be determined to be the value of the load of processor core 0 in the cycle. Through the above principle, the value of the load of processor core 0 in each cycle can be obtained. Compare the value of the load of processor core 0 in each cycle with the value of the previous cycle to obtain the changing trend of the load of processor core 0 in each cycle; combine the changing trend of the load of processor core 0 in each cycle in the order from small to large according to the corresponding cycle, and obtain the first index information to be compared.

[0084] Then, the correction value of the load of the processor core 0 in the next cycle is determined according to the second correction table. The second correction table includes T N The second index information and T N Correction value, where: T N The second index information and T N The correction values ​​correspond one to one.

[0085] A second index information is used to indicate the result obtained by performing an XOR operation on the value of the load of the processor core in the last cycle of the N consecutive cycles. Since the change trend of the load of the processor core in the N consecutive cycles has been described above, it will not be repeated here. It should be noted that the representation method of the value of the load of the processor core in the last cycle of the N consecutive cycles and the representation method of the change trend of the load of the processor core in the N consecutive cycles need to be the same, so that an XOR operation can be performed. For example, if the change trend of the load of the processor core in the N consecutive cycles is represented by a set of number series, the set of number series includes 8 digits and each digit has a value of 0 or 1, then the value of the load of the processor core in the last cycle of the N consecutive cycles must also be converted into a set of number series consisting of 8 digits and each digit has a value of 1 or 0, so as to facilitate the XOR operation. It should be noted that the conversion method can adopt, for example, a hash algorithm, etc., and this application does not make any special restrictions on this.

[0086] Since the load of the processor core changes in N consecutive cycles, the trend is T N Therefore, the number of second index information obtained after XOR operation is also T N N and T have been explained above and will not be described again here.

[0087] A correction value is used to indicate a percentage change of a value of the load of the processor core in a third cycle compared to a value of the load of the processor core in a fourth cycle, wherein the third cycle is a next cycle of the N consecutive cycles indicated by the second index information corresponding to the correction value, and the fourth cycle is a last cycle of the N consecutive cycles indicated by the second index information corresponding to the correction value. The percentage change of the value of the load of the processor core in the third cycle compared to the value of the load of the processor core in the fourth cycle is a ratio of a difference between the value of the load of the processor core in the third cycle and the value of the load of the processor core in the fourth cycle to the value of the load of the processor core in the fourth cycle.

[0088] It should be noted that the construction principle of the second correction table will be explained below, so it will not be repeated here.

[0089] Based on this, the principle for determining the correction value of the load of processor core 0 in the next cycle is: obtain the changing trend of the load of processor core 0 in N consecutive cycles, where the last cycle of the N consecutive cycles is the current cycle; obtain the value of the load of processor core 0 in the current cycle; perform an XOR operation on the changing trend of the load of processor core 0 in N consecutive cycles and the value of the load of processor core 0 in the current cycle to obtain second index information to be compared, match the second index information to be compared with the second index information in the second correction table, and determine the correction value corresponding to the second index information that matches the second index information to be compared as the correction value of the load of processor core 0 in the next cycle.

[0090] Since the principle of obtaining the change trend of the load of the processor core 0 in N consecutive cycles and the principle of determining the load have been explained above, they will not be repeated here.

[0091] Finally, according to the change trend of the load of processor core 0 in the next cycle and the correction value of the load of processor core 0 in the next cycle, the first value of the power consumption of processor core 0 in the next cycle is corrected to obtain the predicted value of the power consumption of processor core 0 in the next cycle. Specifically, the predicted value of the power consumption of processor core 0 in the next cycle is determined by the following formula:

[0092] P(t+1)=P(t+1) / *(1±ΔA(t+1))

[0093] Among them, P(t+1) is the predicted value of the power consumption of processor core 0 in the next cycle, P(t+1) / is the first value of the power consumption of processor core 0 in the next cycle, ΔA(t+1) is the correction value of the load of processor core 0 in the next cycle. It should be noted that if the load of processor core 0 in the next cycle tends to decrease or remain unchanged, a minus sign is placed before ΔA(t+1); if the load of processor core 0 in the next cycle tends to increase, a plus sign is placed before ΔA(t+1).

[0094] As can be seen from the above, a first value of the power consumption of the processor core 0 in the next cycle is determined, and a change trend and a correction value of the load of the processor core 0 in the next cycle are determined according to the first correction table and the second correction table, and the first value of the power consumption of the processor core 0 in the next cycle is corrected according to the change trend and the correction value of the load of the processor core 0 in the next cycle to obtain a predicted value of the power consumption of the processor core 0 in the next cycle. A method for determining the predicted value of the power consumption of the processor core 0 in the next cycle is provided, and the determination method is simple and easy to execute, thereby improving the efficiency of determining the predicted value of the power consumption of the processor core 0 in the next cycle; in addition, because the voltage and power consumption of the processor core 0 are considered when determining the first value of the power consumption of the processor core 0 in the next cycle, the power consumption of the processor core 0 is corrected according to the change trend and the correction value of the load of the processor core 0 in the next cycle, so as to obtain a predicted value of the power consumption of the processor core 0 in the next cycle. The value of the rate in the next cycle, that is, the working state of the processor core 0 in the next cycle is taken into consideration. Therefore, the accuracy of determining the first value is improved, and then the accuracy of determining the predicted value of the power consumption of the processor core 0 in the next cycle is improved; in addition, since the first value of the power consumption of the processor core 0 in the next cycle is corrected according to the change trend of the load of the processor core 0 in the next cycle and the correction value, the predicted value of the power consumption of the processor core 0 in the next cycle is obtained, that is, in the process of determining the predicted value of the power consumption of the processor core 0 in the next cycle, the influence of the change of the load of the processor core 0 in the next cycle on the predicted value of the power consumption of the processor core 0 in the next cycle is taken into consideration, thereby further improving the accuracy of determining the predicted value of the power consumption of the processor core 0 in the next cycle.

[0095] It should be noted that the above method of determining the predicted value of the power consumption of the processor core 0 in the next cycle is only exemplary and is not intended to limit the present application.

[0096] It should be noted that the principle of calculating the predicted value of the power consumption of other processor cores in the next cycle is the same as above and will not be repeated here.

[0097] Next, the first correction table will be described by taking an example.

[0098] If the value of N is 8, the change trend of the load of the processor core in one cycle includes two types: increasing, decreasing or unchanged, that is, the value of T is 2, and the change trend of the load of the processor core in one cycle is represented by 0 or 1. If the change trend of the load of the processor core in one cycle is 0, the value of the load of the processor core in this cycle is less than or equal to the value of the load of the processor core in the previous cycle of this cycle (that is, the change trend of the load of the processor core in this cycle is decreasing or unchanged); if the change trend of the load of the processor core in one cycle is 1, the value of the load of the processor core in this cycle is greater than the value of the load of the processor core in the previous cycle of this cycle (that is, the change trend of the load of the processor core in this cycle is increasing).

[0099] Then, the number of first index information is 28 The first index information consists of 8 digits, each digit has a value of 1 or 0, and is used to indicate a change trend of the load of the processor core in 8 consecutive cycles. The 8 digits in the first index information correspond one-to-one to the 8 consecutive cycles, and each digit represents a change trend of the load of the processor core in its corresponding cycle.

[0100] The first change trend also includes two situations: increasing, decreasing or unchanged. The first change trend is represented by 0 or 1. If the first change trend is 0, the value of the load of the processor core in the first cycle is less than or equal to the value of the load of the processor core in the second cycle (that is, the first change trend is decreasing or unchanged). If the first change trend is 1, the value of the load of the processor core in the first cycle is greater than the value of the load of the processor core in the second cycle (that is, the first change trend is increasing). Since the number of first index information is 2 8 Therefore, the number of the first trend change is also 2 8 The first change trend consists of a digit, and the value of the digit is 1 or 0.

[0101] Table 1 is a first correction table provided in an embodiment of the present application.

[0102] First index information The first trend of change 00000000 0 …… …… 00110010 1 …… …… 01100101 0 …… …… 10011001 1 …… …… 11111110 1 11111111 0

[0103] Table 1

[0104] Next, the process of generating the first correction table shown in Table 1 is described.

[0105] Specifically, since the first index information consists of 8 digits, each digit has a value of 1 or 0, therefore, 2 8 The first index information is: 00000000, 00000001, 00000010, 00000011, ..., 11111110, 11111111. 8 The first index information constitutes the first column of the first correction table. The initial value of the first change trend corresponding to each first index information is set to obtain the second column of the first correction table. The initial value of the first change trend corresponding to the first index information can be set to 0 or 1, etc., and this application does not make any special limitation on this. It should be noted that in other embodiments of the present application, the initial value of the first change trend corresponding to the first index information may not be set.

[0106] The first correction table of the initial state is trained to obtain the first correction table shown in Table 1. The specific process includes: obtaining a large amount of training data, and training the first correction table of the initial state with the large amount of training data to obtain the first correction table shown in Table 1.

[0107] Next, the process of acquiring a training data and training the first correction table in the initial state by using the training data is described.

[0108] The power consumption, frequency, and voltage of the processor core are obtained in each of 10 consecutive cycles (i.e., a training data), and the product of the value of the frequency of the processor core in one cycle and the square of the value of the voltage of the processor core in the cycle is calculated. The value of the load of the processor core in the cycle is represented by the ratio of the value of the power consumption of the processor core in the cycle to the product. In other words, the ratio can be determined to be the value of the load of the processor core in the cycle. Through the above principle, the value of the load of the processor core in each cycle can be obtained.

[0109] Compare the value of the load of the processor core in the i-th cycle with the value of the load of the processor core in the i-1th cycle to obtain a change trend of the load of the processor core, which corresponds to the i-th cycle. If the value of the load of the processor core in the i-th cycle is greater than the value of the load of the processor core in the i-1th cycle, the change trend of the load of the processor core in the i-th cycle is represented by 1. If the value of the load of the processor core in the i-th cycle is less than or equal to the value of the load of the processor core in the i-1th cycle, the change trend of the load of the processor core in the i-th cycle is represented by 0, 2≤i≤10. Based on this, 9 change trends of the load of the processor core can be obtained, and the 9 change trends of the load of the processor core correspond one-to-one to 9 cycles from the 2nd cycle to the 10th cycle in 10 consecutive cycles.

[0110] The 9 change trends of the processor core load are combined in the order of the corresponding cycle numbers from small to large to obtain a sequence. The first 8 digits of the sequence are taken, and the first 8 digits are matched with the first index information in the first correction table of the initial state, and the first change trend corresponding to the first index information matching the first 8 digits is updated to the 9th digit of the sequence. In this way, the training of the first correction table of the initial state by the training data is completed.

[0111] It should be noted that the above process is repeated, and training is performed using other training data to obtain the first correction table shown in Table 1.

[0112] Next, the principle of determining the change trend of the load of the processor core in the next cycle based on the first correction table shown in Table 1 is described.

[0113] If the current cycle is the sth cycle in the operation of the processor core, the power consumption, voltage, and frequency of the processor core in each cycle from the sth cycle to the s-8th cycle are obtained. Then, according to the power consumption, voltage, and frequency of the processor core in each cycle, the value of the load of the processor core in each cycle is determined. It should be noted that since the principle of determining the value of the load of the processor core in a cycle has been explained above, it will not be repeated here.

[0114] Compare the value of the load of the processor core in the jth cycle with the value of the load of the processor core in the j-1th cycle to obtain a change trend of the load of the processor core, which corresponds to the jth cycle. If the value of the load of the processor core in the jth cycle is greater than the value of the load of the processor core in the j-1th cycle, the change trend of the load of the processor core in the jth cycle is represented by 1. If the value of the load of the processor core in the jth cycle is less than or equal to the value of the load of the processor core in the j-1th cycle, the change trend of the load of the processor core in the jth cycle is represented by 0, s-7≤j≤s. Based on this, 8 change trends of the load of the processor core are obtained, and the 8 change trends of the load of the processor core correspond one-to-one to the 8 cycles from the sth cycle to the s-7th cycle.

[0115] The eight change trends of the load of the processor core are combined in the order of the corresponding cycle numbers from small to large to obtain the first index information to be compared. The first index information to be compared is matched with the first index information in Table 1, and the first change trend corresponding to the first index information matching the first index information to be compared is determined as the change trend of the load of the processor core in the next cycle (i.e., the s+1th cycle).

[0116] It should be noted that if the change trend of the processor core load in the next cycle is 0, the value of the processor core load in the next cycle is less than or equal to the value of the processor core load in the current cycle; if the change trend of the processor core load in the next cycle is 1, the value of the processor core load in the next cycle is greater than the value of the processor core load in the current cycle.

[0117] For example, the first index information to be compared is 01100101. It can be seen from Table 1 that the change trend corresponding to the first index information matching the first index information to be compared is 0, that is, the change trend of the load of the processor core in the next cycle is 0, that is, the value of the load of the processor core in the next cycle is less than or equal to the value of the load of the processor core in the current cycle.

[0118] In another embodiment of the present application, the value of the load of the processor core in each cycle during the operation of the processor core is calculated, and the changing trend of the load of the processor core in each cycle is determined based on the value of the load of the processor core in each cycle, and the changing trend of the load of the processor core in the most recent 8 consecutive cycles is determined based on the changing trend of the load of the processor core in each cycle, and the changing trend of the load of the processor core in the most recent 8 consecutive cycles is always saved, so that when determining the changing trend of the load of the processor core in the next cycle based on Table 1, since the changing trend of the load of the processor core in the most recent 8 consecutive cycles is always saved, the changing trend of the load of the processor core in the most recent 8 consecutive cycles can be directly used as the first index information to be compared, so as to determine the changing trend of the load of the processor core in the next cycle based on the first index information to be compared, thereby improving the efficiency of determining the changing trend of the load of the processor core in the next cycle.

[0119] For example, if the current cycle is the 14th cycle during the operation of the processor core, then in the current cycle, the change trend of the load of the processor core from the 7th cycle to the 14th cycle will be saved, so the change trend of the load of the processor core from the 7th cycle to the 14th cycle can be used as the first index information to be compared to determine the change trend of the load of the processor core in the next cycle (i.e., the 15th cycle). After the next cycle (the 15th cycle) arrives, the power consumption, frequency, and voltage values ​​of the processor core in the next cycle are measured, and the value of the load of the processor core in the next cycle is determined according to the power consumption, frequency, and voltage values ​​of the processor core in the next cycle, and the value of the load of the processor core in the next cycle is compared with the value of the load of the processor core in the current cycle to determine the change trend of the load of the processor core in the next cycle, and the first digit of the first index information to be compared is deleted, and the change trend of the load of the processor core in the next cycle is added to the first index information to be compared after the first digit is deleted to obtain a new first index information to be compared, and the change trend of the load of the processor core in the next cycle is determined according to the new first index information to be compared.

[0120] In order to further improve the accuracy of the first correction table, after the next cycle arrives, the power consumption, frequency, and voltage values ​​of the processor core in the next cycle are obtained, and the value of the processor core load in the next cycle is determined according to the power consumption, frequency, and voltage values ​​of the processor core in the next cycle. According to the size relationship between the value of the processor core load in the next cycle and the value of the processor core load in the current cycle, the change trend of the processor core load in the next cycle is determined, and it is judged whether the change trend of the processor core load in the next cycle is the same as the first change trend corresponding to the first index information matching the first index information to be compared in Table 1. If they are the same, the first change trend corresponding to the first index information matching the first index information to be compared is not corrected. If they are not the same, the first change trend corresponding to the first index information matching the first index information to be compared is corrected by the change trend of the processor core load in the next cycle. In summary, after the next cycle arrives, the first change trend corresponding to the first correction table is corrected by the measured value, which further improves the accuracy of the first correction table.

[0121] For example, in the current cycle, the first index information to be compared is 11111110. In Table 1, the first change trend corresponding to the first index information that matches the first index information to be compared is 1. If when the next cycle comes, the value of the load of the processor core in the next cycle is less than the value of the load of the processor core in the current cycle, that is, the actual change trend of the load of the processor core in the next cycle is 0, then in Table 1, the first change trend corresponding to the first index information that matches the first index information to be compared is corrected from 1 to 0.

[0122] The revised Table 1 is shown below. The bold items in the revised Table 1 are the first index information matching the first index information to be compared and the corresponding first change trend.

[0123] First index information Changing Trends 00000000 0 …… …… 00110010 1 …… …… 01100101 0 …… …… 10011001 1 …… …… 11111110 0 11111111 0

[0124] Next, the second correction table will be described by taking an example.

[0125] If the value of N is 8, the change trend of the load of the processor core in the corresponding cycle includes two types: increasing, decreasing or unchanged, that is, the value of T is 2, and the change trend of the load of the processor core in one cycle is represented by 0 or 1. If the change trend of the load of the processor core in one cycle is 0, then the value of the load of the processor core in this cycle is less than or equal to the value of the load of the processor core in the previous cycle of this cycle (that is, the change trend of the load of the processor core in this cycle is decreasing or unchanged); if the change trend of the load of the processor core in one cycle is 1, then the value of the load of the processor core in this cycle is greater than the value of the load of the processor core in the previous cycle of this cycle (that is, the change trend of the load of the processor core in this cycle is increasing).

[0126] Then, the number of changes in the load of the processor core in 8 consecutive cycles is 2 8 , where each change trend of the load of the processor core in 8 consecutive cycles is composed of 8 digits, each digit is 1 or 0, the 8 digits correspond to 8 consecutive cycles one by one, and each digit represents the change trend of the load of the processor core in its corresponding cycle. The value of the load of the processor core in the last cycle of 8 consecutive cycles is also converted into an 8-bit number through a hash algorithm, and the value of each digit is 1 or 0. On this basis, the number of second index information obtained after performing an XOR operation on the change trend of the load of the processor core in 8 consecutive cycles and the value of the load of the processor core in the last cycle of 8 consecutive cycles is also 2 8 , wherein the second index information consists of 8 digits, and the value of each digit is 1 or 0.

[0127] Table 2 is a second correction table provided in an embodiment of the present application.

[0128] Second index information Correction value 00000000 0 …… …… 00110100 8% …… …… 01100101 1% …… …… 11011010 5% …… …… 11111110 15% 11111111 2%

[0129] Next, the process of generating Table 2 is described.

[0130] Generate the second correction table of the initial state. Specifically, since the second index information consists of 8 digits, each digit has a value of 1 or 0, therefore, 2 8 The second index information is: 00000000, 00000001, 00000010, 00000011, ..., 11111110, 11111111. 8 The second index information constitutes the first column of the second correction table. The initial value of the correction value corresponding to each second index information is set to obtain the second column of the second correction table. The initial value of the correction value corresponding to the second index information can be set to any value, and the present application does not make any special limitation on this. It should be noted that in other embodiments of the present application, the initial value of the correction value corresponding to the second index information may not be set.

[0131] The second correction table of the initial state is trained to obtain the second correction table shown in Table 2. The specific process includes: obtaining a large amount of training data, and training the second correction table of the initial state with the large amount of training data to obtain the second correction table shown in Table 2.

[0132] Next, the process of acquiring a training data and training the second correction table in the initial state by using the training data is described.

[0133] Obtain the power consumption, frequency, and voltage of the processor core in each of 10 consecutive cycles (i.e., a training data), calculate the product of the value of the processor core frequency in one cycle and the square of the value of the processor core voltage in the cycle, and characterize the value of the processor core load in the cycle by the ratio of the value of the processor core power consumption in the cycle to the product, that is, the ratio can be determined as the value of the processor core load in the cycle. Through the above principle, the value of the processor core load in each cycle can be obtained.

[0134] Compare the value of the load of the processor core in the i-th cycle with the value of the load of the processor core in the i-1th cycle to obtain a change trend of the load of the processor core, which corresponds to the i-th cycle. If the value of the load of the processor core in the i-th cycle is greater than the value of the load of the processor core in the i-1th cycle, the change trend of the load of the processor core in the i-th cycle is represented by 1. If the value of the load of the processor core in the i-th cycle is less than or equal to the value of the load of the processor core in the i-1th cycle, the change trend of the load of the processor core in the i-th cycle is represented by 0, 2≤i≤9. Based on this, 8 change trends of the load of the processor core are obtained, and the 8 change trends of the load of the processor core correspond one-to-one to 8 cycles from the 2nd cycle to the 9th cycle in 10 consecutive cycles.

[0135] The eight changing trends of the load of the processor core are combined in the order of the corresponding cycle numbers from small to large to obtain a first sequence, that is, a changing trend of the load of the processor core in eight consecutive cycles, the first sequence includes eight digits, and the value of each digit is 0 or 1. The value of the load of the processor core in the ninth cycle of ten consecutive cycles is converted into a second sequence by hash arithmetic, the second sequence includes eight digits, and the value of each digit is 1 or 0. The third sequence is obtained by performing an XOR operation on the first sequence and the second sequence. The ratio of the difference between the value of the load of the processor core in the tenth cycle of ten consecutive cycles and the value of the load of the processor core in the ninth cycle to the value of the load of the processor core in the ninth cycle is determined as the percentage of the value of the load of the processor core in the tenth cycle compared to the value of the load of the processor core in the ninth cycle.

[0136] The third sequence is matched with each second index information in the second correction table of the initial state, and the correction value corresponding to the second index information matching the third sequence is updated to the percentage of the value of the processor core load in the 10th cycle compared to the value of the processor core load in the 9th cycle.

[0137] It should be noted that the above process is repeated, and training is performed using other training data to obtain the second correction table shown in Table 2.

[0138] Next, the principle of determining the correction value of the load of the processor core in the next cycle based on the second correction table shown in Table 2 is described.

[0139] If the current cycle is the sth cycle in the operation of the processor core, the power consumption, voltage, and frequency of the processor core in each cycle from the sth cycle to the s-8th cycle are obtained. Then, according to the power consumption, voltage, and frequency of the processor core in each cycle, the value of the load of the processor core in each cycle is determined. It should be noted that since the principle of determining the value of the load of the processor core in a cycle has been explained above, it will not be repeated here.

[0140] Compare the value of the load of the processor core in the jth cycle with the value of the load of the processor core in the j-1th cycle to obtain a change trend of the load of the processor core, which corresponds to the jth cycle. If the value of the load of the processor core in the jth cycle is greater than the value of the load of the processor core in the j-1th cycle, the change trend of the load of the processor core is represented by 1. If the value of the load of the processor core in the jth cycle is less than or equal to the value of the load of the processor core in the j-1th cycle, the change trend of the load of the processor core is represented by 0, s-7≤j≤s. Based on this, 8 change trends of the load of the processor core are obtained, and the 8 change trends of the load of the processor core correspond one-to-one to the 8 cycles from the sth cycle to the s-7th cycle.

[0141] The eight changing trends of the load of the processor core are combined in the order of the corresponding cycle numbers from small to large to obtain a fourth sequence, and the value of the load of the processor core in the sth cycle is converted into a fifth sequence by a hash algorithm. The fourth sequence and the fifth sequence are XORed to obtain the second index information to be compared. The second index information to be compared is matched with the second index information in Table 2, and the correction value corresponding to the second index information matching the second index information to be compared is determined as the correction value of the load of the processor core in the next cycle (i.e., the s+1th cycle).

[0142] For example, the change trend of the load of the processor core in 8 consecutive cycles (i.e., the s-7th cycle to the sth cycle) is 00110010, the hash value of the value of the load of the processor core in the sth cycle is 00000110, and the second index information to be compared obtained after performing an XOR operation on the above two values ​​is 00110100. It can be seen from Table 2 that the correction value corresponding to the second index information matching the second index information to be compared is 8%, that is, the correction value of the load of the processor core in the next cycle is 8%, that is, the percentage change of the value of the load of the processor core in the next cycle compared to the value of the load of the processor core in the current cycle is 8%.

[0143] In another embodiment of the present application, the value of the load of the processor core in each cycle is calculated in each cycle during the operation of the processor core, and the changing trend of the load of the processor core in each cycle is determined according to the value of the load of the processor core in each cycle, and the changing trend of the load of the processor core in the most recent 8 consecutive cycles is determined according to the changing trend of the load of the processor core in each cycle, and the changing trend of the load of the processor core in the most recent 8 consecutive cycles is always saved, so that when determining the correction value of the load of the processor core in the next cycle based on Table 2, since the changing trend of the load of the processor core in the most recent 8 consecutive cycles is always saved, the changing trend of the load of the processor core in the most recent 8 consecutive cycles can be directly used as the fourth sequence, and a hash operation is performed on the value of the load of the processor core in the current cycle to obtain a fifth sequence, and an XOR operation is performed on the fourth sequence and the fifth sequence to obtain a second index information to be compared, so as to determine the correction value of the load of the processor core in the next cycle according to the second index information to be compared, and since the changing trend of the load of the processor core in the most recent 8 consecutive cycles is saved in advance, there is no need to recalculate, thereby improving the efficiency of determining the correction value of the load of the processor core in the next cycle.

[0144] For example, if the current cycle is the 16th cycle in the operation of the processor core, then in the current cycle, the change trend of the load of the processor core from the 9th cycle to the 16th cycle will be saved. Therefore, the hash value of the value of the load of the processor core in the 16th cycle can be calculated, and the hash value and the change trend of the load of the processor core from the 9th cycle to the 16th cycle can be XORed to obtain the second index information to be compared, so as to determine the correction value of the load of the processor core in the next cycle (i.e., the 17th cycle) according to the second index information to be compared. After the next cycle arrives, measure the power consumption, frequency, and voltage of the processor core in the next cycle, determine the value of the processor core load in the next cycle based on the power consumption, frequency, and voltage of the processor core in the next cycle, compare the value of the processor core load in the next cycle with the value of the processor core load in the current cycle to determine the change trend of the processor core load in the next cycle (i.e., the 17th cycle), delete the first digit of the change trend of the processor core load from the 9th cycle to the 16th cycle, and add the change trend of the processor core load in the next cycle to the change trend of the processor core load from the 9th cycle to the 16th cycle with the first digit deleted to obtain the change trend of the processor core load from the 10th cycle to the 17th cycle, and determine the second index information to be compared based on the change trend of the processor core load from the 10th cycle to the 17th cycle, and determine the correction value of the processor core load in the next cycle based on the second index information to be compared.

[0145] In order to further improve the accuracy of the second correction table, after the next cycle arrives, the values ​​of the power consumption, frequency, and voltage of the processor core in the next cycle are obtained, and the value of the load of the processor core in the next cycle is determined according to the values ​​of the power consumption, frequency, and voltage of the processor core in the next cycle. The percentage of the value of the load of the processor core in the next cycle compared to the value of the load of the processor core in the current cycle is calculated according to the value of the load of the processor core in the next cycle and the value of the load of the processor core in the current cycle, and it is determined whether the calculated percentage is the same as the correction value corresponding to the second index information matching the second index information to be compared. If they are the same, the correction value corresponding to the second index information matching the second index information to be compared is not corrected. If they are not the same, the correction value corresponding to the second index information matching the second index information to be compared is corrected by the calculated percentage.

[0146] For example, in the current cycle, the second index information to be compared is 11011010. In Table 2, the correction value corresponding to the second index information that matches the second index information to be compared is 5%. If when the next cycle comes, the value of the load of the processor core in the next cycle is 8% of the value of the load of the processor core in the current cycle, then in Table 2, the correction value corresponding to the second index information that matches the second index information to be compared is corrected from 5% to 8%.

[0147] The revised Table 2 is as follows, and the bold items in the revised Table 2 are correction values ​​corresponding to the second index information matching the second index information to be compared.

[0148] Second index information Correction value 00000000 0 …… …… 00110100 8% …… …… 01100101 1% …… …… 11011010 8% …… …… 11111110 15% 11111111 2%

[0149] It should be noted that the generation method of the first correction table and the second correction table and the representation method of the first correction table and the second correction table are only exemplary and are not used to limit the present application. For example, the first correction table and the second correction table can also be a model obtained by training a neural network, etc.

[0150] Next, taking the temperature of a processor core as an example of a variable to be predicted, the process of determining a predicted value of the temperature of processor core 0 in the next cycle is described. Figure 3 A flow chart of determining a predicted value of the temperature of processor core 0 in the next cycle provided by an embodiment of the present application. Figure 3 As shown, including:

[0151] Step 301, the sensing device in the processor core 0 obtains the measured value of the temperature of the processor core 0 in the current cycle. Since the principle of obtaining the measured value of the temperature of the processor core 0 in the current cycle is the same as the principle of obtaining the measured value of the power consumption of the processor core 0 in the current cycle, it will not be repeated here. It should be noted that the sensing device can be, for example, a temperature sensor (T-sensor), etc., and this embodiment of the application does not specifically limit this.

[0152] Step 302 : The sensing device in the processor core 0 sends the measured value of the temperature of the processor core 0 in the current cycle to the control logic.

[0153] Step 303: The control logic determines a predicted value of the temperature of the processor core 0 in the next cycle. Specifically, the following two methods may be used to determine the predicted value.

[0154] The first method is to determine the predicted value of the temperature of the processor core 0 in the next cycle based on the measured value of the temperature of the processor core 0 in the current cycle. The specific process includes:

[0155] First, obtain the measured values ​​of the power consumption of processor core 0 in the current cycle and the previous cycle, and the predicted value of the power consumption of processor core 0 in the next cycle. Since the principle of obtaining the measured value of the power consumption of processor core 0 in the current cycle has been explained above, it will not be repeated here. Since the principle of obtaining the measured value of the power consumption of processor core 0 in the previous cycle is the same as the principle of obtaining the measured value of the power consumption of processor core 0 in the current cycle in the above text, it will not be repeated here. Since the principle of obtaining the predicted value of the power consumption of processor core 0 in the next cycle has been explained above, it will not be repeated here.

[0156] Then, the measured value of the temperature of the processor core 0 in the previous cycle is obtained. Since the principle of this step is the same as the principle of obtaining the measured value of the temperature of the processor core 0 in the current cycle, it will not be repeated here.

[0157] Finally, the predicted value of the temperature of the processor core 0 in the next cycle is determined based on the measured values ​​of the power consumption and temperature of the processor core 0 in the previous cycle and the current cycle, and the predicted value of the power consumption of the processor core 0 in the next cycle. Since the increment of power consumption and the increment of temperature in a short period of time are positively correlated, the predicted value of the temperature of the processor core 0 in the next cycle can be determined by the following formula:

[0158]

[0159] Among them, T(t+1) is the predicted value of the temperature of processor core 0 in the next cycle, T(t) is the measured value of the temperature of processor core 0 in the current cycle, T(t-1) is the measured value of the temperature of processor core 0 in the previous cycle, P(t+1) is the predicted value of the power consumption of processor core 0 in the next cycle, P(t) is the measured value of the power consumption of processor core 0 in the current cycle, and P(t-1) is the measured value of the power consumption of processor core 0 in the previous cycle.

[0160] It should be noted that the above process of determining the predicted value of the temperature of the processor core 0 in the next cycle is only exemplary and is not intended to limit the present application.

[0161] As can be seen from the above, the measured values ​​of the power consumption of the processor core 0 in the current cycle and the previous cycle, the predicted value of the power consumption of the processor core 0 in the next cycle, the measured values ​​of the temperature of the processor core 0 in the current cycle and the previous cycle are obtained, and the predicted value of the temperature of the processor core 0 in the next cycle can be determined according to the above-obtained measured values ​​and predicted values. A method for determining the predicted value of the temperature of the processor core 0 in the next cycle is provided, and the determination method is simple and easy to execute, which improves the efficiency of determining the predicted value of the temperature of the processor core 0 in the next cycle. In addition, because the predicted value of the power consumption of the processor core 0 in the next cycle is taken into account when determining the predicted value of the temperature of the processor core 0 in the next cycle, that is, the working state of the processor core 0 in the next cycle is taken into account, therefore, the accuracy of determining the predicted value of the temperature of the processor core 0 in the next week is improved.

[0162] The second method: determining the predicted value of the temperature of the processor core 0 in the next cycle based on the measured value of the temperature of the processor core 0 in the current cycle in combination with a correction table, wherein the correction table includes a first correction table and a second correction table, the first correction table is used to predict the change trend of the load of the processor core in the next cycle, and the second correction table is used to predict the correction value of the load of the processor core in the next cycle. The specific process includes:

[0163] First, the power consumption of the processor core 0 in the current cycle and the previous cycle is obtained. Since the principle of this step has been explained above, it will not be repeated here.

[0164] Then, the temperature measurement value of the processor core 0 in the previous cycle is obtained. Since the principle of obtaining the temperature measurement value of the processor core 0 in the previous cycle is the same as the principle of obtaining the temperature measurement value of the processor core 0 in the current cycle, it will not be repeated here.

[0165] Then, the first value of the power consumption of the processor core 0 in the next cycle is determined according to the measured value of the power consumption of the processor core 0 in the current cycle. Since the principle of this step has been explained above, it will not be repeated here.

[0166] Next, the change trend of the load of the processor core 0 in the next cycle is determined according to the first correction table, and the correction value of the load of the processor core 0 in the next cycle is determined according to the second correction table.

[0167] Since the first correction table and the second correction table, and the principle of determining the change trend and correction value of the load of the processor core 0 in the next cycle have been described above, they will not be repeated here.

[0168] Next, the first value of the power consumption of the processor core 0 in the next cycle is corrected according to the change trend of the load of the processor core 0 in the next cycle and the correction value, so as to obtain the predicted value of the power consumption of the processor core 0 in the next cycle. The principle of this step has been explained above, so it will not be repeated here.

[0169] Finally, the predicted value of the temperature of the processor core 0 in the next cycle is determined based on the predicted value of the power consumption of the processor core 0 in the next cycle, the measured values ​​of the power consumption of the processor core 0 in the current cycle and the previous cycle, and the measured values ​​of the temperature of the processor core 0 in the current cycle and the previous cycle. Specifically, the predicted value of the temperature of the processor core 0 in the next cycle is determined according to the following formula:

[0170]

[0171] Among them, T(t+1) is the predicted value of the temperature of processor core 0 in the next cycle, T(t) is the measured value of the temperature of processor core 0 in the current cycle, T(t-1) is the measured value of the temperature of processor core 0 in the previous cycle, P(t+1) is the predicted value of the power consumption of processor core 0 in the next cycle, P(t) is the measured value of the power consumption of processor core 0 in the current cycle, and P(t-1) is the measured value of the power consumption of processor core 0 in the previous cycle.

[0172] As can be seen from the above, by determining the first value of the power consumption of the processor core 0 in the next cycle, and determining the change trend and correction value of the load of the processor core 0 in the next cycle according to the first correction table and the second correction table, and correcting the first value of the power consumption of the processor core 0 in the next cycle according to the change trend and correction value of the load of the processor core 0 in the next cycle, so as to obtain the predicted value of the power consumption of the processor core 0 in the next cycle, and determining the predicted value of the temperature of the processor core 0 in the next cycle according to the predicted value of the power consumption of the processor core 0 in the next cycle, a method for determining the predicted value of the temperature of the processor core 0 in the next cycle is provided, and the determination method is simple and easy to execute, which improves the efficiency of determining the predicted value of the temperature of the processor core 0 in the next cycle. In addition, because when determining the predicted value of the temperature of the processor core 0 in the next cycle, the value of the power consumption of the processor core 0 in the next cycle is taken into account, that is, the working state of the processor core 0 in the next cycle is taken into account, therefore, the accuracy of determining the predicted value of the temperature of the processor core 0 in the next week is improved. In addition, in the process of determining the predicted value of the power consumption of processor core 0 in the next cycle, the impact of the change in the load of processor core 0 in the next cycle on the predicted value of the power consumption of processor core 0 in the next cycle is taken into consideration, thereby further improving the accuracy of determining the predicted value of the power consumption of processor core 0 in the next cycle, thereby further improving the accuracy of the predicted value of the temperature of processor core 0 in the next cycle determined by the predicted value of the power consumption of processor core 0 in the next cycle.

[0173] It should be noted that the above method of calculating the predicted value of the temperature of the processor core 0 in the next cycle is only exemplary and is not intended to limit the present application.

[0174] It should be noted that the principle for determining the predicted values ​​of the temperatures of the other processor cores in the next cycle is as described above and will not be repeated here.

[0175] It should be noted that, for other variables to be predicted, the principle of determining the predicted value of the variable to be predicted of the processor core in the next cycle is similar to the above principle, so it will not be repeated here.

[0176] Furthermore, after determining the predicted value of the variable to be predicted of the processor core in the next cycle, the control logic can also determine the adjustment strategy of each processor core according to the predicted value of the variable to be predicted of each processor core in the next cycle, and the adjustment strategy is used to indicate the adjustment method of the voltage and / or frequency of the processor core. Specifically, the control logic generates frequency adjustment instructions and / or voltage adjustment instructions for the corresponding processor core according to the adjustment strategy of each processor core. By generating the adjustment strategy of each processor core, the voltage and / or frequency of the corresponding processor core can be adjusted in the next cycle through the adjustment strategy of each processor core to ensure that the processor operates within a safe range.

[0177] On this basis, the control logic is also used to send the frequency adjustment instruction and / or voltage adjustment instruction of each processor core to the frequency and voltage adjustment circuit of the corresponding processor core;

[0178] Each frequency and voltage adjustment circuit adjusts the frequency and / or voltage of the corresponding processor core according to the frequency adjustment instruction and / or voltage adjustment instruction of the corresponding processor core.

[0179] For example, if the variable to be predicted is the temperature of the processor core, and the predicted value of the temperature of the processor core in the next cycle is greater than a preset level, the control logic calls a regulation strategy for reducing the power consumption of the processor core, and when the next cycle arrives, a voltage regulation instruction is generated according to the regulation strategy for reducing the power consumption of the processor core, and the voltage regulation instruction is sent to the frequency and voltage regulation circuit of the processor core. The frequency and voltage regulation circuit adjusts the voltage of the processor core according to the voltage regulation instruction to reduce the temperature of the processor core by reducing the voltage of the processor core, thereby ensuring that the temperature of the processor core is below the preset level, and further ensuring that the processor operates at a normal temperature.

[0180] It should be noted that the control logic can determine the adjustment strategy of each processor core according to the predicted value of the variable to be predicted of each processor core in the next cycle. The control logic can also determine the adjustment strategy of each processor core by comprehensively considering the predicted value of the variable to be predicted of each processor core in the next cycle.

[0181] From the above, it can be seen that since the adjustment strategy is determined by the predicted value of the processor core's variable to be predicted in the next cycle, and the predicted value of the processor core's variable to be observed in the next cycle takes into account the operating state of the processor core in the next cycle, the adjustment strategy also takes into account the impact of the operating state of the processor core in the next cycle, so that when the frequency and / or voltage of the processor core in the next cycle are adjusted according to the adjustment strategy, the adjustment strategy can cope with the working state of the processor in the next cycle, thereby enabling the processor to operate normally and avoid the risk of overcurrent.

[0182] It should be noted that the structure of the above processor is only exemplary and is not intended to limit the present application.

[0183] For example, the processor may further include more or fewer processor cores, that is, the processor includes at least one processor core.

[0184] The processor may also include more or fewer sensing devices. For example, the number of sensing devices is the same as the number of processor cores in the processor, and the sensing devices correspond to the processor cores one by one, and the predicted value of the variable to be predicted of the corresponding processor core in the next cycle is obtained through each sensing device. For another example, the number of sensing devices is one, and the processor cores in the processor share the sensing device. The sensing device can obtain the measured value of the variable to be predicted of all processor cores of the processor in the current cycle, that is, all processor cores in the processor can be regarded as a whole to obtain the measured value of the variable to be predicted of the whole in the current cycle, so as to predict the predicted value of the variable to be predicted of the whole in the next cycle based on the above principle; or the one sensing device can also obtain the measured value of the variable to be predicted of each processor core in the processor in the current cycle, so as to determine the predicted value of the variable to be predicted in the next cycle respectively based on the above principle. Since there is only one sensing device, the measured value of the variable to be predicted of different processor cores in the current cycle can be obtained in time-sharing. For another example, a part of the processor cores in the processor can share a sensing device, and another part of the processor cores can share another sensing device, and the embodiment of the present application does not make special restrictions on this.

[0185] The processor may also include more or fewer frequency and voltage regulating circuits. For example, the number of frequency and voltage regulating circuits is the same as the number of processor cores in the processor, and the frequency and voltage regulating circuits correspond to the processor cores one by one, so that the frequency and voltage regulating circuits regulate the frequency and / or voltage of the corresponding processor core. For another example, the number of frequency and voltage regulating circuits is one, and the processor cores in the processor share the frequency and voltage regulating circuit, and the frequency and voltage can regulate the frequency and / or voltage of each processor core in time sharing. For another example, a part of the processor cores in the processor share one frequency and voltage regulating circuit, and another part of the processor cores in the processor share another frequency and voltage regulating circuit.

[0186] In other embodiments of the present application, the processor may also include more or fewer components, and the embodiments of the present application do not specifically limit this.

[0187] In other embodiments of the present application, the predicted values ​​of the variables to be predicted of each component in the processor other than the processor core in the next cycle can also be determined based on the above principle. Each component in the processor other than the processor core can share a sensing device and a frequency voltage regulating circuit, or can be provided with a sensing device and a frequency voltage regulating circuit for each component, etc., which is not particularly limited in the embodiments of the present application.

[0188] Figure 4The flowchart of a variable prediction method provided in the embodiment of the present application is shown in FIG. The execution subject of the method may be, for example, a sensing device and control logic in a processor, and the embodiment of the present application does not specifically limit this. Figure 4 As shown, the method comprises the following steps:

[0189] Step 401, obtaining a measured value of a variable to be predicted of the at least one processor core in a current cycle;

[0190] Step 402: Determine a predicted value of the variable to be predicted of the at least one processor core in the next cycle according to the measured value of the variable to be predicted of the at least one processor core in the current cycle.

[0191] In a possible implementation, the variable to be predicted is the power consumption of the processor core; determining the predicted value of the variable to be predicted of the at least one processor core in the next cycle based on the measured value of the variable to be predicted of the at least one processor core in the current cycle includes: obtaining the measured values ​​of the frequency and voltage of the at least one processor core in the current cycle; determining the values ​​of the frequency and voltage of the at least one processor core in the next cycle; determining the predicted value of the power consumption of the at least one processor core in the next cycle based on the measured value of the power consumption of the at least one processor core in the current cycle, the measured values ​​of the frequency and voltage of the at least one processor core in the current cycle, and the values ​​of the frequency and voltage of the at least one processor core in the next cycle.

[0192] In a possible implementation, the predicted value of the power consumption of the processor core in the next cycle is determined according to the following formula:

[0193]

[0194] Wherein: P(t+1) is the predicted value of the power consumption of the processor core in the next cycle, P(t) is the measured value of the power consumption of the processor core in the current cycle, f(t+1) is the value of the frequency of the processor core in the next cycle, f(t) is the measured value of the frequency of the processor core in the current cycle, V(t+1) is the value of the voltage of the processor core in the next cycle, and V(t) is the measured value of the voltage of the processor core in the current cycle.

[0195] In a possible implementation, the method further includes: obtaining a measured value of the temperature of the at least one processor core in a current cycle; obtaining a measured value of the temperature of the at least one processor core in a previous cycle; obtaining a measured value of the power consumption of the at least one processor core in a previous cycle; and determining a predicted value of the temperature of the at least one processor core in the next cycle based on the measured values ​​of the power consumption and temperature of the at least one processor core in the previous cycle and the current cycle, respectively, and the predicted value of the power consumption of the at least one processor core in the next cycle.

[0196] In a possible implementation, the predicted value of the temperature of the processor core in the next cycle is determined according to the following formula:

[0197]

[0198] Among them, T(t+1) is the predicted value of the temperature of the processor core in the next cycle, T(t) is the measured value of the temperature of the processor core in the current cycle, T(t-1) is the measured value of the temperature of the processor core in the previous cycle, P(t+1) is the predicted value of the power consumption of the processor core in the next cycle, P(t) is the measured value of the power consumption of the processor core in the current cycle, and P(t-1) is the measured value of the power consumption of the processor core in the previous cycle.

[0199] In one possible implementation, determining the predicted value of the variable to be predicted of the at least one processor core in the next cycle based on the measured value of the variable to be predicted of the at least one processor core in the current cycle includes: determining the predicted value of the variable to be predicted of the at least one processor core in the next cycle based on the measured value of the variable to be predicted of the at least one processor core in the current cycle in combination with a correction table.

[0200] In a possible implementation, the variable to be predicted is the power consumption of the processor core, and the correction table includes a first correction table and a second correction table; determining the predicted value of the variable to be predicted of the at least one processor core in the next cycle based on the measured value of the variable to be predicted of the at least one processor core in the current cycle and in combination with a correction table includes: determining a first value of the power consumption of the at least one processor core in the next cycle based on the measured value of the power consumption of the at least one processor core in the current cycle; determining a changing trend of the load of the at least one processor core in the next cycle based on the first correction table; determining a corrected value of the load of the at least one processor core in the next cycle based on the second correction table; and correcting the first value of the power consumption of the at least one processor core based on the changing trend of the load of the at least one processor core and the corrected value of the load of the at least one processor core to obtain a predicted value of the power consumption of the at least one processor core in the next cycle.

[0201] In a possible implementation, the method further includes: obtaining a measured value of the power consumption of the at least one processor core in a previous cycle; obtaining measured values ​​of the temperature of the at least one processor core in the current cycle and the previous cycle respectively; and determining a predicted value of the temperature of the at least one processor core in the next cycle based on the predicted value of the power consumption of the at least one processor core in the next cycle, the measured values ​​of the power consumption of the at least one processor core in the current cycle and the previous cycle, and the measured values ​​of the temperature of the at least one processor core in the current cycle and the previous cycle.

[0202] In a possible implementation manner, the first correction table includes T N The first index information and T N The first change trend, where: N The first index information and the T N a first change trend corresponds to a first index information corresponding to the processor core in N consecutive cycles, T is the number of types of change trends of the load of the processor core in one cycle; a first change trend is used to indicate a change trend of the value of the load of the processor core in the first cycle compared to the value of the load of the processor core in the second cycle, wherein the first cycle is the next cycle of the N consecutive cycles indicated by the first index information corresponding to the first change trend, and the second cycle is the last cycle of the N consecutive cycles indicated by the first index information corresponding to the first change trend; the second correction table includes T N The second index information and T N correction value, where: NThe second index information and the T N correction values ​​correspond one to one; one second index information is used to indicate the result of an XOR operation between a change trend of the load of the processor core in N consecutive cycles and the value of the load of the processor core in the last cycle of the N consecutive cycles; one correction value is used to indicate the percentage of change of the value of the load of the processor core in the third cycle compared to the value of the load of the processor core in the fourth cycle, wherein the third cycle is the next cycle of the N consecutive cycles indicated by the second index information corresponding to the correction value, and the fourth cycle is the last cycle of the N consecutive cycles indicated by the second index information corresponding to the correction value.

[0203] In a possible implementation, the method further includes: determining an adjustment strategy for the at least one processing core based on a predicted value of a variable to be predicted of the at least one processor core in a next cycle, wherein the adjustment strategy is used to indicate an adjustment method for the voltage and / or frequency of the processor core.

[0204] In one possible implementation, determining the adjustment strategy of the at least one processing core based on the predicted value of the variable to be predicted of the at least one processor core in the next cycle includes: generating a frequency adjustment instruction and / or a voltage adjustment instruction for the at least one processor core according to the adjustment strategy of the at least one processor core; and adjusting the frequency and / or voltage of the at least one processor core according to the frequency adjustment instruction and / or the voltage adjustment instruction of the at least one processor core.

[0205] The implementation principle and technical effect of the above method of the present application are similar to the principles and technical effects of the steps executed in the sensing device, control logic, and frequency and voltage regulation circuit in the above processor, and will not be repeated here.

[0206] The present application also provides a computer-readable storage medium, comprising a computer program, wherein when the computer program is executed on a computer, the computer executes the technical solution of any one of the above-mentioned method embodiments.

[0207] The present application also provides a computer program, which, when executed by a computer, is used to execute the technical solution of any one of the above-mentioned method embodiments.

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

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

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

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

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

[0213] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially 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, which is stored in a storage medium, including several instructions to enable a computer device (personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code. The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A processor, It is characterized in that comprising at least one processor core, control logic and at least one sensing device; The at least one sensing device is used to obtain a measurement value of a variable to be predicted of the at least one processor core in a current cycle; The control logic is used to determine the predicted value of the variable to be predicted of the at least one processor core in the next cycle according to the measured value of the variable to be predicted of the at least one processor core in the current cycle; The variable to be predicted is the power consumption of the processor core; The step of determining the predicted value of the variable to be predicted of the at least one processor core in the next cycle according to the measured value of the variable to be predicted of the at least one processor core in the current cycle comprises: Obtaining measured values ​​of the frequency and voltage of the at least one processor core in a current cycle; Determine the value of the frequency and voltage of the at least one processor core in the next cycle; A predicted value of the power consumption of the at least one processor core in the next cycle is determined based on the measured value of the power consumption of the at least one processor core in the current cycle, the measured values ​​of the frequency and voltage of the at least one processor core in the current cycle, and the values ​​of the frequency and voltage of the at least one processor core in the next cycle.

2. The processor according to claim 1, It is characterized in that The predicted value of the power consumption of the processor core in the next cycle is determined according to the following formula: Wherein: P(t+1) is the predicted value of the power consumption of the processor core in the next cycle, P(t) is the measured value of the power consumption of the processor core in the current cycle, f(t+1) is the value of the frequency of the processor core in the next cycle, f(t) is the measured value of the frequency of the processor core in the current cycle, V(t+1) is the value of the voltage of the processor core in the next cycle, and V(t) is the measured value of the voltage of the processor core in the current cycle.

3. A processor according to claim 1 or 2, It is characterized in that The control logic is also used to: Obtaining a measured value of a temperature of the at least one processor core in a current cycle; Obtaining a measurement value of the temperature of the at least one processor core in a previous cycle; Obtaining a measured value of power consumption of the at least one processor core in a previous cycle; The predicted value of the temperature of the at least one processor core in the next cycle is determined based on the measured values ​​of the power consumption and temperature of the at least one processor core in the previous cycle and the current cycle respectively, and the predicted value of the power consumption of the at least one processor core in the next cycle.

4. The processor according to claim 3, It is characterized in that The predicted value of the temperature of the processor core in the next cycle is determined according to the following formula: Among them, T(t+1) is the predicted value of the temperature of the processor core in the next cycle, T(t) is the measured value of the temperature of the processor core in the current cycle, T(t-1) is the measured value of the temperature of the processor core in the previous cycle, P(t+1) is the predicted value of the power consumption of the processor core in the next cycle, P(t) is the measured value of the power consumption of the processor core in the current cycle, and P(t-1) is the measured value of the power consumption of the processor core in the previous cycle.

5. The processor according to claim 1, It is characterized in that The step of determining the predicted value of the variable to be predicted of the at least one processor core in the next cycle according to the measured value of the variable to be predicted of the at least one processor core in the current cycle comprises: The predicted value of the variable to be predicted of the at least one processor core in the next cycle is determined according to the measured value of the variable to be predicted of the at least one processor core in the current cycle in combination with a correction table.

6. The processor according to claim 5, It is characterized in that The variable to be predicted is the power consumption of the processor core, and the correction table includes a first correction table and a second correction table; The step of determining the predicted value of the variable to be predicted of the at least one processor core in the next cycle according to the measured value of the variable to be predicted of the at least one processor core in the current cycle in combination with a correction table comprises: Determine a first value of the power consumption of the at least one processor core in the next cycle according to a measured value of the power consumption of the at least one processor core in the current cycle; determining a change trend of the load of the at least one processor core in the next cycle according to the first correction table; determining a correction value of the load of the at least one processor core in the next cycle according to the second correction table; The first value of the power consumption of the at least one processor core is corrected according to the change trend of the load of the at least one processor core and the correction value of the load of the at least one processor core to obtain a predicted value of the power consumption of the at least one processor core in the next cycle.

7. The processor according to claim 6, It is characterized in that The control logic is also used to: Obtaining a measured value of power consumption of the at least one processor core in a previous cycle; Obtaining measurement values ​​of the temperature of the at least one processor core in the current cycle and the previous cycle respectively; Determine a predicted value of the temperature of the at least one processor core in the next cycle based on the predicted value of the power consumption of the at least one processor core in the next cycle, the measured values ​​of the power consumption of the at least one processor core in the current cycle and the previous cycle, and the measured values ​​of the temperature of the at least one processor core in the current cycle and the previous cycle.

8. A processor according to claim 6 or 7, It is characterized in that The first correction table includes T N The first index information and T N The first trend of change is: The T N The first index information and the T N The first change trends correspond one to one; The first index information is used to indicate a change trend of the load of the processor core in N consecutive cycles, where T is the number of types of change trends of the load of the processor core in one cycle; A first change trend is used to indicate a change trend of a value of the load of the processor core in a first cycle compared to a value of the load of the processor core in a second cycle, wherein the first cycle is a next cycle of the N consecutive cycles indicated by the first index information corresponding to the first change trend, and the second cycle is a last cycle of the N consecutive cycles indicated by the first index information corresponding to the first change trend; The second correction table includes T N The second index information and T N correction values, where: The T N The second index information and the T N The correction values ​​correspond one to one; The second index information is used to indicate a result obtained by performing an XOR operation on a change trend of the load of the processor core in N consecutive cycles and a value of the load of the processor core in the last cycle of the N consecutive cycles; A correction value is used to indicate the percentage change of the value of the load of the processor core in a third cycle compared to the value of the load of the processor core in a fourth cycle, wherein the third cycle is the next cycle of the N consecutive cycles indicated by the second index information corresponding to the correction value, and the fourth cycle is the last cycle of the N consecutive cycles indicated by the second index information corresponding to the correction value.

9. The processor according to any one of claims 1 to 2 and 4 to 7, It is characterized in that The control logic is also used to: An adjustment strategy for the at least one processor core is determined according to a predicted value of a variable to be predicted for the at least one processor core in a next cycle, wherein the adjustment strategy is used to indicate an adjustment method for a voltage and / or frequency of the processor core.

10. The processor according to claim 9, It is characterized in that The step of determining the adjustment strategy of the at least one processor core according to the predicted value of the variable to be predicted of the at least one processor core in the next cycle includes: generating a frequency adjustment instruction and / or a voltage adjustment instruction for the at least one processor core according to the adjustment strategy for the at least one processor core; The processor also includes at least one frequency voltage adjustment circuit; The control logic is further used to send a frequency adjustment instruction and / or a voltage adjustment instruction of the at least one processor core to the at least one frequency and voltage adjustment circuit; The at least one frequency and voltage adjustment circuit is used to adjust the frequency and / or voltage of the at least one processor core according to the frequency adjustment instruction and / or voltage adjustment instruction of the at least one processor core.

11. A method for predicting a variable, It is characterized in that include: Obtaining a measured value of a variable to be predicted of at least one processor core in a current cycle; Determining a predicted value of the variable to be predicted of the at least one processor core in a next cycle according to a measured value of the variable to be predicted of the at least one processor core in a current cycle; The variable to be predicted is the power consumption of the processor core; The step of determining the predicted value of the variable to be predicted of the at least one processor core in the next cycle according to the measured value of the variable to be predicted of the at least one processor core in the current cycle comprises: Obtaining measured values ​​of the frequency and voltage of the at least one processor core in a current cycle; Determine the value of the frequency and voltage of the at least one processor core in the next cycle; A predicted value of the power consumption of the at least one processor core in the next cycle is determined based on the measured value of the power consumption of the at least one processor core in the current cycle, the measured values ​​of the frequency and voltage of the at least one processor core in the current cycle, and the values ​​of the frequency and voltage of the at least one processor core in the next cycle.

12. The method according to claim 11, It is characterized in that The predicted value of the power consumption of the processor core in the next cycle is determined according to the following formula: Wherein: P(t+1) is the predicted value of the power consumption of the processor core in the next cycle, P(t) is the measured value of the power consumption of the processor core in the current cycle, f(t+1) is the value of the frequency of the processor core in the next cycle, f(t) is the measured value of the frequency of the processor core in the current cycle, V(t+1) is the value of the voltage of the processor core in the next cycle, and V(t) is the measured value of the voltage of the processor core in the current cycle.

13. The method according to claim 11 or 12, It is characterized in that The method further comprises: Obtaining a measured value of a temperature of the at least one processor core in a current cycle; Obtaining a measurement value of the temperature of the at least one processor core in a previous cycle; Obtaining a measured value of power consumption of the at least one processor core in a previous cycle; The predicted value of the temperature of the at least one processor core in the next cycle is determined based on the measured values ​​of the power consumption and temperature of the at least one processor core in the previous cycle and the current cycle respectively, and the predicted value of the power consumption of the at least one processor core in the next cycle.

14. The method according to claim 13, It is characterized in that The predicted value of the temperature of the processor core in the next cycle is determined according to the following formula: Among them, T(t+1) is the predicted value of the temperature of the processor core in the next cycle, T(t) is the measured value of the temperature of the processor core in the current cycle, T(t-1) is the measured value of the temperature of the processor core in the previous cycle, P(t+1) is the predicted value of the power consumption of the processor core in the next cycle, P(t) is the measured value of the power consumption of the processor core in the current cycle, and P(t-1) is the measured value of the power consumption of the processor core in the previous cycle.

15. The method according to claim 11, It is characterized in that The step of determining the predicted value of the variable to be predicted of the at least one processor core in the next cycle according to the measured value of the variable to be predicted of the at least one processor core in the current cycle comprises: The predicted value of the variable to be predicted of the at least one processor core in the next cycle is determined according to the measured value of the variable to be predicted of the at least one processor core in the current cycle in combination with a correction table.

16. The method according to claim 15, It is characterized in that The variable to be predicted is the power consumption of the processor core, and the correction table includes a first correction table and a second correction table; The step of determining the predicted value of the variable to be predicted of the at least one processor core in the next cycle according to the measured value of the variable to be predicted of the at least one processor core in the current cycle in combination with a correction table comprises: Determine a first value of the power consumption of the at least one processor core in the next cycle according to a measured value of the power consumption of the at least one processor core in the current cycle; determining a change trend of the load of the at least one processor core in the next cycle according to the first correction table; determining a correction value of the load of the at least one processor core in the next cycle according to the second correction table; The first value of the power consumption of the at least one processor core is corrected according to the change trend of the load of the at least one processor core and the correction value of the load of the at least one processor core to obtain a predicted value of the power consumption of the at least one processor core in the next cycle.

17. The method according to claim 16, It is characterized in that The method further comprises: Obtaining a measured value of power consumption of the at least one processor core in a previous cycle; Obtaining measurement values ​​of the temperature of the at least one processor core in the current cycle and the previous cycle respectively; Determine a predicted value of the temperature of the at least one processor core in the next cycle based on the predicted value of the power consumption of the at least one processor core in the next cycle, the measured values ​​of the power consumption of the at least one processor core in the current cycle and the previous cycle, and the measured values ​​of the temperature of the at least one processor core in the current cycle and the previous cycle.

18. The method according to claim 16 or 17, It is characterized in that The first correction table includes T N The first index information and T N The first trend of change is: The T N The first index information and the T N The first change trends correspond one to one; The first index information is used to indicate a change trend of the load of the processor core in N consecutive cycles, where T is the number of types of change trends of the load of the processor core in one cycle; A first change trend is used to indicate a change trend of a value of the load of the processor core in a first cycle compared to a value of the load of the processor core in a second cycle, wherein the first cycle is a next cycle of the N consecutive cycles indicated by the first index information corresponding to the first change trend, and the second cycle is a last cycle of the N consecutive cycles indicated by the first index information corresponding to the first change trend; The second correction table includes T N The second index information and T N correction values, where: The T N The second index information and the T N The correction values ​​correspond one to one; The second index information is used to indicate a result obtained by performing an XOR operation on a change trend of the load of the processor core in N consecutive cycles and a value of the load of the processor core in the last cycle of the N consecutive cycles; A correction value is used to indicate the percentage change of the value of the load of the processor core in a third cycle compared to the value of the load of the processor core in a fourth cycle, wherein the third cycle is the next cycle of the N consecutive cycles indicated by the second index information corresponding to the correction value, and the fourth cycle is the last cycle of the N consecutive cycles indicated by the second index information corresponding to the correction value.

19. The method according to any one of claims 11 to 12, 14 to 17, It is characterized in that The method further comprises: An adjustment strategy for the at least one processing core is determined according to a predicted value of a variable to be predicted for the at least one processor core in a next cycle, wherein the adjustment strategy is used to indicate an adjustment method for a voltage and / or frequency of the processor core.

20. The method according to claim 19, It is characterized in that The step of determining the adjustment strategy of the at least one processing core according to the predicted value of the variable to be predicted of the at least one processor core in the next cycle includes: generating a frequency adjustment instruction and / or a voltage adjustment instruction for the at least one processor core according to the adjustment strategy for the at least one processor core; The frequency and / or voltage of the at least one processor core is adjusted according to the frequency adjustment instruction and / or the voltage adjustment instruction of the at least one processor core.

21. A computer-readable storage medium comprising a computer program, wherein when the computer program is executed on a computer, the computer is caused to execute the method according to any one of claims 11 to 20.

22. A computer program, when executed by a computer, for executing the method according to any one of claims 11 to 20.

Citation Information

Patent Citations

  • Method for saving power consumption of processing unit

    CN1991687A