CN115562865A - Power consumption limiting method, system, electronic device, and medium - Google Patents

Power consumption limiting method, system, electronic device, and medium Download PDF

Info

Publication number
CN115562865A
CN115562865A CN202211242369.4A CN202211242369A CN115562865A CN 115562865 A CN115562865 A CN 115562865A CN 202211242369 A CN202211242369 A CN 202211242369A CN 115562865 A CN115562865 A CN 115562865A
Authority
CN
China
Prior art keywords
power consumption
value
cpu
limit value
limiting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211242369.4A
Other languages
Chinese (zh)
Inventor
陈孟松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Celestica Technology Consultancy Shanghai Co Ltd
Original Assignee
Celestica Technology Consultancy Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Celestica Technology Consultancy Shanghai Co Ltd filed Critical Celestica Technology Consultancy Shanghai Co Ltd
Priority to CN202211242369.4A priority Critical patent/CN115562865A/en
Publication of CN115562865A publication Critical patent/CN115562865A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides a power consumption limiting method, system, electronic device and medium; the method is used for power consumption limitation of a system and comprises the following steps: determining a system power consumption limiting value of the system according to the type of a CPU in the system, wherein the system power consumption limiting value comprises a system maximum power consumption limiting value and a system minimum power consumption limiting value; determining an initial value of the CPU power consumption limiting value according to the system power consumption limiting value; and circularly executing the following steps: adjusting the running state of the CPU according to the current power consumption limit value of the CPU to enable the real-time power consumption of the CPU to reach the current power consumption limit value of the CPU; reading a current overall system power consumption value of the system; adjusting the CPU power consumption limit value according to the current overall power consumption value of the system and the system power consumption limit value; the invention provides a power consumption limiting method, a system, electronic equipment and a medium, which are used for providing an effective mode for SOC products which do not support NodeManager to limit the overall power consumption of the system.

Description

Power consumption limiting method, system, electronic device, and medium
Technical Field
The present application relates to a control method, and more particularly, to a power consumption limiting method, system, electronic device, and medium.
Background
As information technology develops toward more intellectualization, higher integration and stronger functions, high power consumption becomes an increasingly prominent problem. The system often exceeds the power supply range due to excessive traffic load, resulting in system anomaly problems. This not only affects the operational requirements of the system, but also causes a waste of power consumption.
Currently, there are many power consumption limiting policies of the existing system, including Node Manager of Intel ME (Management Engine), AMD APML (advanced platform Management link) scheme, and so on. The schemes can be used for controlling the power consumption of the system and avoiding the abnormal problem caused by overhigh power consumption of the system. Most of the existing power consumption limiting strategies limit the power consumption of a system through NodeManger of Intel ME. According to the scheme, a power consumption upper limit value is made into a power consumption strategy through a Baseboard Management Controller (BMC), the power consumption strategy is transmitted to an ME through a Node Manager (Node Manager), namely, a Node Manager command, and the ME stores the power consumption strategy. When the power consumption of the server is too high, the ME adjusts the operating frequency of a Central Processing Unit (CPU), thereby achieving the purpose of limiting the power consumption. However, the Node Manager approach of Intel ME is not applicable to all scenarios. For SOC products (System-on-a-Chip), the CPU is often used as an important device for the SOC products. However, in the SOC, the CPU does not support the nodemager, and the nodemager power consumption management policy of the Intel ME in the prior art is difficult to be applied to SOC-type products. Therefore, a new method is needed to limit the overall power consumption of the SOC product that does not support the NodeManager. The present invention has been made for this purpose.
Disclosure of Invention
In view of the foregoing disadvantages of the prior art, an object of the present application is to provide a power consumption limiting method, system, electronic device, and medium, which are used to solve the technical problem that the overall power consumption of the system cannot be well limited for SOC products that do not support nodemanagers in the prior art.
In a first aspect, the present application provides a power consumption limiting method for limiting power consumption of a system, including: determining a system power consumption limiting value of the system according to the type of a CPU in the system, wherein the system power consumption limiting value comprises a system maximum power consumption limiting value and a system minimum power consumption limiting value; determining an initial value of the CPU power consumption limiting value according to the system power consumption limiting value; and circularly executing the following steps: adjusting the running state of the CPU according to the current power consumption limit value of the CPU to enable the real-time power consumption of the CPU to reach the current power consumption limit value of the CPU; reading a current overall power consumption value of the system; and adjusting the CPU power consumption limiting value according to the current overall power consumption value of the system and the system power consumption limiting value.
According to the method, the power consumption limiting value of the CPU is determined according to the system power consumption limiting value, the running state of the CPU is adjusted, and the limitation of the whole power consumption of the system is achieved.
In one implementation form of the first aspect, the determining an initial value of the CPU power consumption limit value according to the system power consumption limit value comprises: and determining a place value between the system maximum power consumption limiting value and the system minimum power consumption limiting value range, and taking the place value as an initial value of the CPU power consumption limiting value.
In the implementation mode, a branch value is determined between the maximum power consumption limit value of the system and the minimum power consumption limit value range of the system and is used as an initial value of the power consumption limit value of the CPU, so that the power consumption limit value of the CPU is gradually improved, and whether the overall power consumption value of the system exceeds the maximum power consumption limit value or not is detected when the CPU operates at the limit value, so that the overall power consumption is effectively limited. In addition, the method does not need to carry out power consumption limitation through a NodeManager, and can be applied to any scene.
In one implementation manner of the first aspect, the initial value of the CPU power consumption limit is determined as a median of the system maximum power consumption limit and the system minimum power consumption limit.
In the implementation mode, a place value between the maximum power consumption limit value and the minimum power consumption limit value of the system is determined as a median, so that the final power consumption value of the CPU can be rapidly determined, the problem of system abnormity caused by overhigh power consumption value of the CPU suddenly in the adjustment process is avoided, and the integral power consumption limitation of the system can be effectively realized.
In an implementation manner of the first aspect, the adjusting the running state of the CPU according to the current power consumption limit value of the CPU so that the real-time power consumption of the CPU reaches the current power consumption limit value of the CPU includes: sending the current power consumption limit value of the CPU to generate a power consumption management command; and the CPU adjusts the working frequency to execute a power consumption management command until the real-time power consumption of the CPU reaches the current power consumption limit value of the CPU.
In the implementation mode, the power consumption of the CPU is adjusted in real time and the power consumption value of the CPU is limited, so that the problem of system abnormity caused by overlarge load of the CPU is avoided, and the system performance is ensured.
In an implementation manner of the first aspect, adjusting the CPU power consumption limit value according to the current overall power consumption value of the system and the system power consumption limit value includes: when the current integral power consumption value of the system does not reach the maximum power consumption limit value of the system, the CPU power consumption limit value at the current moment and a place value in the range of the maximum power consumption limit value of the system are taken as the adjusted CPU power consumption limit value.
In the implementation mode, the CPU can reduce unnecessary power consumption waste on the premise of ensuring that the whole power consumption reaches the maximum power consumption by continuously increasing the power consumption limit value of the CPU within the range of the maximum power consumption limit value of the system. The purposes of reducing power consumption and reducing cost are met while the operation requirement is ensured.
In an implementation manner of the first aspect, when the current overall power consumption value of the system does not reach the maximum power consumption limit value of the system, a median value of the CPU power consumption limit value at the current moment and the maximum power consumption limit value of the system is used as the adjusted CPU power consumption limit value.
In the implementation mode, the power consumption limit value of the CPU is gradually increased by taking the median every time, so that the CPU can reduce unnecessary power consumption waste and rapidly control the whole power consumption on the premise of ensuring that the whole power consumption reaches the maximum power consumption, and the adjustment mode has high efficiency.
In an implementation manner of the first aspect, adjusting the CPU power consumption limit value according to the current overall power consumption value of the system and the system power consumption limit value further includes: and when the current overall power consumption value of the system reaches the maximum power consumption limit value of the system, ending the circulation, and taking the CPU power consumption limit value at the current moment as the final power consumption limit value of the CPU.
In the implementation mode, after the power consumption limit value of the CPU is continuously adjusted in the above mode, when the current overall power consumption value of the system reaches the maximum power consumption limit value of the system, the circulation is ended, and the power consumption limit value of the CPU at the moment is taken as the final power consumption limit value when the CPU runs in the future. In the method, the limitation of the overall power consumption of the system in the future is realized effectively through the limitation of the power consumption of the CPU, the problem of system abnormity caused by overlarge load is avoided, and the system performance is ensured.
In a second aspect, the present application provides a power consumption limiting system, comprising: the acquisition module is used for acquiring a system power consumption limiting value of the system according to the type of the CPU in the system, wherein the system power consumption limiting value comprises a system maximum power consumption limiting value and a system minimum power consumption limiting value; the management module is used for determining an initial value of the CPU power consumption limiting value according to the system power consumption limiting value; an adjustment module for cyclically performing the steps of: adjusting the running state of the CPU according to the current power consumption limit value of the CPU to enable the real-time power consumption of the CPU to reach the current power consumption limit value of the CPU; reading a current overall power consumption value of the system; and adjusting the CPU power consumption limiting value according to the current overall power consumption value of the system and the system power consumption limiting value.
In the application, the power consumption limiting system acquires the system power consumption limiting value through the acquisition module, the management module determines the initial value of the CPU power consumption limiting value through the system power consumption limiting value acquired by the acquisition module, and the adjustment module adjusts the CPU power consumption limiting value according to the current overall power consumption value of the system and the system power consumption limiting value. The system power consumption limitation in any scene can be met through the three modules, and the problem that the SOC product cannot realize the whole power consumption limitation because the CPU does not support the NodeManager and cannot be adjusted is avoided.
In a third aspect, the present application provides an electronic device, comprising: a processor and a memory; the memory is configured to store a computer program, the processor is communicatively connected to the memory, and the processor is configured to execute the computer program stored in the memory to perform the power consumption limiting method according to the first aspect of the present application.
In the present application, the electronic device can satisfy the system power consumption limitation in any scene by executing the power consumption limitation method described in the first aspect, and avoid that the SOC product cannot realize the whole power consumption limitation because the CPU does not support the NodeManager and cannot be adjusted by the CPU.
In a fourth aspect, the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the power consumption limiting method of the first aspect of the present application.
As described above, the power consumption limiting method, system, electronic device and medium described in the present application have the following beneficial effects: the problem that the whole power consumption limitation of the SOC product cannot be realized due to the fact that the CPU does not support the NodeManager and cannot be adjusted is avoided. The method and the device enable the CPU which does not support the NodeManager to well limit the overall power consumption of the system, and avoid the problem of system abnormity caused by overlarge load. And on the premise of ensuring that the overall power consumption reaches the maximum power consumption, the CPU can also reduce unnecessary power consumption waste. The purposes of reducing power consumption and reducing cost are met while the operation requirement is ensured.
Drawings
Fig. 1 shows a schematic view of an application scenario architecture of an intelligent network card 10 according to an embodiment of the present application.
Fig. 2 is a schematic flowchart illustrating a power consumption limiting method according to an embodiment of the present application.
Fig. 3 is a flowchart illustrating a power consumption limiting method according to another embodiment of the present application.
Fig. 4 is a schematic diagram illustrating an architecture of a power consumption limiting system according to an embodiment of the present application.
Fig. 5 is a schematic diagram illustrating an architecture of an adjusting module 203 according to an embodiment of the present application.
Fig. 6 is a schematic diagram illustrating an architecture of an electronic device 30 according to an embodiment of the present application.
Description of the element reference numerals
10. Intelligent network card
101 CPU
102 BMC
103 FPGA
104 PECI
201. Acquisition module
202. Management module
203. Adjusting module
2031. First adjusting submodule
2032. Acquisition submodule
2033. Judgment submodule
2034. Second adjusting submodule
30. Electronic device
301. Memory device
302. Processor with a memory having a plurality of memory cells
S1 to S4
S31 to S34 steps
Detailed Description
The following description of the embodiments of the present application is provided by way of specific examples, and other advantages and effects of the present application will be readily apparent to those skilled in the art from the disclosure herein. The present application is capable of other and different embodiments and its several details are capable of modifications and/or changes in various respects, all without departing from the spirit of the present application. It should be noted that the features in the following embodiments and examples may be combined with each other without conflict.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present application, and the drawings only show the components related to the present application and are not drawn according to the number, shape and size of the components in actual implementation, and the type, number and proportion of the components in actual implementation may be changed freely, and the layout of the components may be more complicated.
The following embodiments of the present application provide a power consumption limiting method, system, electronic device, and medium, where application scenarios include, but are not limited to, an intelligent network card, a server, a terminal, and a chip, and an application scenario of the intelligent network card will be described as an example below.
As shown in fig. 1, the present embodiment provides an application scene architecture diagram of an intelligent network card 10.
It should be noted that the configuration shown in fig. 1 is merely an example, and is not the only configuration for implementing the present method. As shown in fig. 1, the application scenario is composed of the following parts:
the CPU 101: the functions of the central processing unit and the core hardware unit of the intelligent network card are mainly to explain computer instructions and process data in computer software. The CPU consumes a large amount of power when performing a large number of complex operations.
BMC 102: the baseboard management controller detects the temperature, voltage and other health states of all parts of the intelligent network card, can ensure that a server does not generate over-temperature, and the total power consumption of the control system is not too high.
The FPGA 103: field programmable gate arrays, general purpose devices that can be fully reconfigured by software, used to implement any (digital) logic function or hardware implementation of digital circuitry, often with high power consumption for performance optimization.
The PECI 104: the capability to transmit processor core temperature read by a DTS (Digital Thermal Sensor) in the system host processor can be used to report CPU 101 temperature, and is now commonly built in computers and servers. Components with the capability of PECI 104 support enable products to operate quieter with optimized performance and achieve lower power consumption.
Specifically, in the application scenario of the intelligent network card 10, the BMC 102 determines the minimum power consumption and the maximum power consumption of the intelligent network card according to the type of the CPU 101 of the current intelligent network card. Then, the median of the two is taken as the initial limit value and is marked as the limit value 1. And then issues a command to the RAPL (Running Average Power Limit) register of the CPU 101 through the PECI 104. And reading the current overall power consumption, if the current overall power consumption does not reach the maximum power consumption of the intelligent network card, taking the limit value 1 and the median of the maximum power consumption as the current set value, and so on until the current overall power consumption reaches the maximum power consumption or is close to the maximum power consumption, and then finishing the adjustment.
RAPL denotes the run-time average power limit, which is a component that allows firmware or software applications to monitor CPU power consumption.
The following describes technical solutions in the embodiments of the present application in detail with reference to the drawings in the embodiments of the present application.
As shown in fig. 2, the present embodiment provides a power consumption limiting method, which includes the following steps S1 to S4:
s1: and determining a system power consumption limiting value of the system according to the type of the CPU in the system, wherein the system power consumption limiting value comprises a system maximum power consumption limiting value and a system minimum power consumption limiting value.
Different systems have different capabilities. Due to performance differences, the range of power consumption owned by different systems is also different. The CPU is used as a core hardware unit in the system, and the power consumption limit value of the system can be determined according to the CPU by adopting the prior art. The power consumption limiting value of the CPU is determined according to the system power consumption limiting value, the running state of the CPU is adjusted according to the power consumption limiting value, and the limitation of the whole power consumption of the system is achieved.
S2: and determining an initial value of the CPU power consumption limiting value according to the system power consumption limiting value.
Specifically, a place value is determined between the limited value of the maximum power consumption of the system and the limited value range of the minimum power consumption of the system, the place value is used as an initial value of the limited value of the power consumption of the CPU, and the limited value is marked as 1.
Preferably, a median value between the system maximum power consumption limit value and the system minimum power consumption limit value is used as an initial value of the CPU power consumption limit value. The median value represents that a given group of numbers is arranged from small to large or from large to small, odd numbers take the middle number, and even numbers take the average of the middle two numbers. Thus, the median value here should be the average of both the system maximum power consumption limit and the system minimum power consumption limit.
Such as: the maximum power consumption limit value of the system is Xmax, the minimum power consumption limit value of the system is Xmin, and the initial value Y of the CPU power consumption limit value 1 Comprises the following steps:
Figure BDA0003885182850000071
and it is noted as 1.
This step is beneficial to gradually increasing the power consumption limit value of the CPU, and detecting whether the whole power consumption value of the system exceeds the maximum power consumption limit value when the CPU operates with the limit value, thereby effectively limiting the whole power consumption. In addition, the method can gradually adjust the power consumption limiting value of the CPU only by determining the maximum power consumption limiting value and the minimum power consumption limiting value of the system, so that power consumption limitation is not required by a NodeManager, and the method can be suitable for any scene.
S3: and adjusting the power consumption limit value of the CPU according to the current overall power consumption value of the system.
S4: and finishing the adjustment, and taking the CPU power consumption limit value at the current moment as the final power consumption limit value of the CPU.
After the final power consumption limit value of the CPU is acquired through step S4, the CPU will thereafter operate at the final power consumption limit value.
As shown in fig. 3, step S3 will execute steps S31 to S34 in a loop, and the specific process is as follows:
as an example for the first execution:
s31: adjusting the running state of the CPU according to the current power consumption limit value of the CPU to enable the real-time power consumption of the CPU to reach the current power consumption limit value of the CPU;
specifically, after the initial power consumption limit value of the CPU is determined, a power consumption management command is generated and issued to an RAPL register of the CPU through a PECI command. And then, the CU (controller) adjusts the running frequency of the CPU, and the RAPL monitors the power consumption of the CPU in real time, so that the real-time power consumption of the CPU in running can reach the initial power consumption limit value of the CPU.
In the step, the power consumption of the CPU is adjusted in real time, the power consumption value of the CPU is limited, and the real-time power consumption value of the CPU is monitored by the CU, so that the problem of system abnormity caused by overlarge CPU load is effectively solved, and the running requirement of the system is ensured.
S32: reading a current overall system power consumption value of the system;
specifically, the actual power consumption of the system can be monitored by the BMC in real time. The BMC is used as a substrate management controller and can detect the health states of the system, such as temperature, voltage and the like, so that the system can be prevented from generating over-temperature, and the total power consumption value of the system can be effectively controlled not to exceed the maximum power consumption limit value.
S33: judging whether the current overall power consumption value of the system reaches the maximum power consumption value of the system, and if the current overall power consumption of the system does not reach the maximum power consumption value of the system, executing a step S34; and if the current overall power consumption value of the system reaches the maximum power consumption value of the system, executing the step S4.
Specifically, assuming that the current overall power consumption value of the system read in step S32 is x, step S33 determines the relationship between the current overall power consumption value of the system being x and the maximum power consumption limit value of the system being Xmax. If x = Xmax, step S4 is executed.
If x is close to Xmax, step S4 is also performed.
If x < Xmax, step S34 is executed.
S34: and adjusting the CPU power consumption limit value according to the current overall power consumption value of the system and the system power consumption limit value. Specifically, a place value between the initial power consumption value of the CPU and the maximum power consumption limit value of the system is taken as a new CPU power consumption limit value, and the power consumption limit value of the CPU is improved. Preferably, a median value between the initial power consumption value of the CPU and the maximum power consumption limit value of the system is taken as a new CPU power consumption limit value. Here, the median value is consistent with the concept of the above median value, and is an average of both the initial power consumption value of the CPU and the system maximum power consumption limit value.
Such as: the initial power consumption value of the CPU is Y 1 If the maximum power consumption value of the system is Xmax, then the CPU power consumption limit value Y 2 Comprises the following steps:
Figure BDA0003885182850000081
and step S3 is performed again.
The embodiment of the invention provides a power consumption limiting method, which determines a system power consumption limiting value of a system according to the type of a CPU in the system, wherein the system power consumption limiting value comprises a system maximum power consumption limiting value and a system minimum power consumption limiting value; determining an initial value of the CPU power consumption limiting value according to the system power consumption limiting value; and circularly executing the following steps: adjusting the running state of the CPU according to the current power consumption limit value of the CPU to enable the real-time power consumption of the CPU to reach the current power consumption limit value of the CPU; reading a current overall power consumption value of the system; and adjusting the CPU power consumption limiting value according to the current overall power consumption value of the system and the system power consumption limiting value. The method also provides a good way for SOC products which do not support NoedManager to limit the whole power consumption, thereby not only meeting the operation requirement of the system, but also avoiding the problem of system abnormity caused by overlarge load. And on the premise of ensuring that the overall power consumption reaches the maximum power consumption, the CPU can also reduce unnecessary power consumption waste. The purposes of reducing power consumption and reducing cost are met while the operation requirement is ensured.
The protection scope of the power consumption limiting method described in the embodiment of the present application is not limited to the execution sequence of the steps listed in the embodiment, and all solutions implemented by adding, subtracting, and replacing steps in the prior art according to the principles of the present application are included in the protection scope of the present application.
The embodiment of the present application further provides a power consumption limiting system, where the power consumption limiting system can implement the power consumption limiting method described in the present application, but an implementation apparatus of the power consumption limiting method described in the present application includes, but is not limited to, a structure of the power consumption limiting system listed in this embodiment, and all structural modifications and substitutions in the prior art made according to the principles of the present application are included in the protection scope of the present application.
As shown in fig. 4, the present embodiment provides a power consumption limiting system, which includes an obtaining module 201, a managing module 202, and an adjusting module 203.
Specifically, the obtaining module 201 is configured to obtain a system power consumption limit value of the system according to a type of a CPU in the system, where the system power consumption limit value includes a system maximum power consumption limit value and a system minimum power consumption limit value;
the management module 202 is used for determining an initial value of the CPU power consumption limit value according to the system power consumption limit value;
the adjusting module 203 is configured to perform the following steps in a loop: adjusting the running state of the CPU according to the current power consumption limit value of the CPU to enable the real-time power consumption of the CPU to reach the current power consumption limit value of the CPU;
reading a current overall power consumption value of the system;
and adjusting the CPU power consumption limiting value according to the current overall power consumption value of the system and the system power consumption limiting value.
The specific way for the management module 202 to determine the initial value of the CPU power consumption limit value according to the system power consumption limit value includes: and determining a place value between the limited value range of the maximum power consumption of the system and the limited value range of the minimum power consumption of the system, and taking the place value as an initial value of the limited value of the power consumption of the CPU. Preferably, a median value between the system maximum power consumption limit value and the system minimum power consumption limit value is used as an initial value of the CPU power consumption limit value. Here, the median value is consistent with the concept of the above median value, and is an average of both the initial power consumption value of the CPU and the system maximum power consumption limit value.
The management module 202 determines a place value between the system maximum power consumption limit value and the system minimum power consumption limit value as an initial value of the CPU power consumption limit value. This is beneficial to gradually increasing the power consumption limit value of the CPU, and detecting whether the whole power consumption value of the system exceeds the maximum power consumption limit value when the CPU operates with the limit value, thereby effectively limiting the whole power consumption. In addition, the method does not need to carry out power consumption limitation through the NodeManager, and can be suitable for SOC products which do not support the NodeManager.
As shown in fig. 5, the adjusting module 203 includes:
the first adjusting sub-module 2031 is configured to adjust the operating status of the CPU according to the current power consumption limit value of the CPU, so that the real-time power consumption of the CPU reaches the current power consumption limit value of the CPU.
The obtaining submodule 2032 is configured to obtain a current overall power consumption value of the system.
The determining submodule 2033 is configured to determine whether the current power consumption limit value of the system reaches the maximum power consumption limit value of the system.
The second adjusting submodule 2034 is configured to adjust the CPU power consumption limit value according to the current overall power consumption value of the system and the system power consumption limit value.
Specifically, the specific way for the adjusting module 203 to adjust the CPU power consumption limit value includes:
the first adjusting submodule 2031 adjusts the operating frequency of the CPU according to the current power consumption limit value of the CPU, so that the real-time power consumption of the CPU reaches the current power consumption limit value of the CPU. Specifically, the first adjusting submodule 2031 mainly adjusts the operating frequency of the CPU to make the real-time power consumption of the CPU reach the current power consumption limit value of the CPU.
The obtaining sub-module 2032 reads the current overall power consumption value of the system operating under the CPU power consumption value.
The judgment sub-module 2033 judges the current overall power consumption value of the system at this time. If the overall power consumption of the system reaches the maximum power consumption limit value of the system, the adjusting module 203 finishes the adjustment, and takes the CPU power consumption limit value at the current moment as the final power consumption limit value of the CPU. If the overall power consumption of the system does not reach the maximum power consumption limit value of the system, the second adjusting submodule 2034 selects a place value between the current power consumption limit value and the maximum power consumption limit value of the CPU as a new power consumption limit value of the CPU, and increases the power consumption limit value of the CPU. Preferably, the second adjusting submodule 2034 takes a median between the initial power consumption value of the CPU and the maximum power consumption limit value of the system as a new CPU power consumption limit value. Here, the median value is consistent with the concept of the above median value, and is an average of both the initial power consumption value of the CPU and the system maximum power consumption limit value.
After the adjustment module 203 continuously adjusts the power consumption limit value of the CPU in the above manner, when the current overall power consumption value of the system has reached the maximum power consumption limit value of the system, the loop is ended, and the power consumption limit value of the CPU at this time is taken as the final power consumption limit value when the CPU operates in the future. In the method, the power consumption is not limited by the NodeManager, and the method can be suitable for SOC products which do not support the NodeManager, thereby effectively limiting the overall power consumption of the system.
The operation flow of the power consumption limiting system according to the embodiment of the present invention will be described in detail by way of an example. Such as:
the obtaining module 201 determines that the maximum power consumption limit value of a system is Xmax and the minimum power consumption limit value is Xmin according to the CPU.
The management module 202 will determine the initial power consumption limit value Y of the CPU according to Xmax and Xmin 1 。Y 1 Is a position between the system maximum power consumption limiting value Xmax and the system minimum power consumption limiting value Xmin. Preferably, a median value between the system maximum power consumption limiting value Xmax and the system minimum power consumption limiting value Xmin is used as an initial value of the CPU power consumption limiting value. Namely, it is
Figure BDA0003885182850000101
At this time, the adjustment module 203 will start the loop operation, taking the first time as an example:
the first adjusting submodule 2031 will limit the power consumption according to the CPU 1 Adjusting the running state of the CPU to enable the real-time power consumption of the CPU to reach the current power consumption limit value Y of the CPU 1 . The obtaining sub-module 2032 reads the current overall power consumption value x of the system operating under the CPU power consumption value. The determining sub-module 2033 determines the relationship between the current overall power consumption value x of the system and the maximum power consumption limit value Xmax of the system. If x = Xmax, then the CPU current power consumption limit value Y at the moment 1 Is the final power consumption limit.
It should be noted that if x is close to Xmax, then the current power consumption limit value Y of the CPU is set at this time 1 As well as the final power consumption limit.
If x<Xmax, the second adjusting submodule 2034 will obtain the power consumption value Y of the current power consumption limit value of the CPU 1 And a place value between the maximum power consumption limit value Mmax of the system is used as a new CPU power consumption limit value Y 2 And the power consumption limit value of the CPU is improved. Preferably, the second adjusting submodule 2034 takes the initial power consumption value Y of the CPU 1 And the median value between the maximum power consumption limiting value Xmax of the system is used as a new CPU power consumption limiting value Y 2 . Namely, it is
Figure BDA0003885182850000102
Until the judgment sub-module 2033 judges at Y n Under the condition, the current overall power consumption value x of the system n = Xmax, then Y is n Is the final power consumption value of the CPU.
It is worth mentioning that if x n Approaching to Xmax, then the CPU current power consumption limit value Y n As well as the final power consumption limit.
The power consumption limiting system provided by the embodiment of the invention obtains the system power consumption limiting value of the system through the obtaining module 201, wherein the system power consumption limiting value comprises a system maximum power consumption limiting value and a system minimum power consumption limiting value, then the management module 202 determines the initial value of the CPU power consumption limiting value according to the system power consumption limiting value, the adjusting module 203 adjusts the running state of the CPU according to the current power consumption limiting value of the CPU so that the real-time power consumption of the CPU reaches the current power consumption limiting value of the CPU, and then the CPU power consumption limiting value is adjusted according to the current overall power consumption value of the system and the system power consumption limiting value. Compared with the prior art, the power consumption limiting system also provides a good mode for limiting the overall power consumption for SOC products which do not support NoedManager, the operation requirement of the system can be met, and the problem of system abnormity caused by overlarge load is avoided. On the premise of ensuring that the overall power consumption reaches the maximum power consumption, the CPU can also reduce unnecessary power consumption waste. The purposes of reducing power consumption and reducing cost are met while the operation requirement is ensured.
The application also provides an electronic device. As shown in fig. 6, the present embodiment provides an electronic device 30, where the electronic device 30 includes: a memory 301 configured to store a computer program; and a processor 302 communicatively coupled to the memory 301 and configured to invoke the computer program to perform the power consumption limiting method.
The memory 301 includes: various media capable of storing program codes, such as ROM (Read Only Memory), RAM (Random Access Memory), magnetic disk, usb disk, memory card, or optical disk.
The processor 302 is connected to the memory 301, and is configured to execute the computer program stored in the memory 301, so as to enable the electronic device to execute the above-mentioned power consumption limiting method.
Preferably, the Processor 302 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus, or method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of modules/units is only one type of division of logical functions, and other divisions may be realized in practice, for example, a plurality of modules or units may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be an indirect coupling or communication connection through some interfaces, devices or modules or units, and may be in an electrical, mechanical or other form.
Modules/units described as separate parts may or may not be physically separate, and parts displayed as modules/units may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules/units can be selected according to actual needs to achieve the purposes of the embodiments of the present application. For example, functional modules/units in the embodiments of the present application may be integrated into one processing module, or each module/unit may exist alone physically, or two or more modules/units are integrated into one module/unit.
It will be further appreciated by those of ordinary skill in the art that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the various examples have been described in a functional generic sense in the foregoing description for the purpose of clearly illustrating the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The embodiment of the application also provides a computer readable storage medium. It will be understood by those of ordinary skill in the art that all or part of the steps in the method for implementing the above embodiments may be implemented by a program instructing a processor, and the program may be stored in a computer-readable storage medium, which is a non-transitory (non-transitory) medium, such as a random access memory, a read only memory, a flash memory, a hard disk, a solid state drive, a magnetic tape (magnetic tape), a floppy disk (floppy disk), an optical disk (optical disk), and any combination thereof. The storage medium may be any available medium that can be accessed by a computer or a data storage device including one or more available media integrated servers, data centers, and the like. The usable medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a Digital Video Disk (DVD)), or a semiconductor medium (e.g., a Solid State Disk (SSD)), among others.
Embodiments of the present application may also provide a computer program product comprising one or more computer instructions. When loaded and executed on a computing device, cause the processes or functions described in accordance with embodiments of the application to occur, in whole or in part. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website site, computer, or data center to another website site, computer, or data center by wire (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wirelessly (e.g., infrared, wireless, microwave, etc.).
When the computer program product is executed by a computer, the computer executes the method of the previous method embodiment. The computer program product may be a software installation package, which may be downloaded and executed on a computer in case it is desired to use the method as described above.
The description of the flow or structure corresponding to each of the above drawings has emphasis, and a part not described in detail in a certain flow or structure may refer to the related description of other flows or structures.
The above embodiments are merely illustrative of the principles and utilities of the present application and are not intended to limit the present application. Any person skilled in the art can modify or change the above-described embodiments without departing from the spirit and scope of the present application. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical concepts disclosed in the present application shall be covered by the claims of the present application.

Claims (10)

1. A power consumption limiting method for limiting power consumption of a system, comprising:
determining a system power consumption limiting value of the system according to the type of a CPU in the system, wherein the system power consumption limiting value comprises a system maximum power consumption limiting value and a system minimum power consumption limiting value;
determining an initial value of the CPU power consumption limiting value according to the system power consumption limiting value; and
circularly executing the following steps:
adjusting the running state of the CPU according to the current power consumption limit value of the CPU to enable the real-time power consumption of the CPU to reach the current power consumption limit value of the CPU;
reading a current overall power consumption value of the system;
and adjusting the CPU power consumption limiting value according to the current overall power consumption value of the system and the system power consumption limiting value.
2. The power consumption limiting method of claim 1, wherein the determining an initial value of a CPU power consumption limit value from the system power consumption limit value comprises:
and determining a place value between the system maximum power consumption limiting value and the system minimum power consumption limiting value range, and taking the place value as an initial value of the CPU power consumption limiting value.
3. The power consumption limiting method of claim 2, further characterized in that the initial value of the CPU power consumption limit value is determined as a median of the system maximum power consumption limit value and the system minimum power consumption limit value.
4. The power consumption limiting method of claim 1, wherein adjusting the operating state of the CPU according to the current power consumption limit value of the CPU so that the real-time power consumption of the CPU reaches the current power consumption limit value of the CPU comprises:
sending the current power consumption limit value of the CPU to generate a power consumption management command;
and the CPU adjusts the working frequency to execute a power consumption management command until the real-time power consumption of the CPU reaches the current power consumption limit value of the CPU.
5. The method according to claim 1, wherein adjusting the CPU power consumption limit value according to the current overall system power consumption value and the system power consumption limit value comprises:
when the current integral power consumption value of the system does not reach the maximum power consumption limit value of the system, the CPU power consumption limit value at the current moment and a place value in the range of the maximum power consumption limit value of the system are taken as the adjusted CPU power consumption limit value.
6. The power consumption limiting method of claim 5, wherein when the current overall power consumption value of the system does not reach the maximum power consumption limit value of the system, the CPU power consumption limit value at the current moment and the median of the maximum power consumption limit value of the system are used as the adjusted CPU power consumption limit value.
7. The power consumption limiting method of claim 5, wherein adjusting the CPU power consumption limit value according to the current overall system power consumption value and the system power consumption limit value further comprises:
and when the current overall power consumption value of the system reaches the maximum power consumption limit value of the system, ending the circulation, and taking the CPU power consumption limit value at the current moment as the final power consumption limit value of the CPU.
8. A power consumption limiting system, comprising:
the acquisition module is used for acquiring a system power consumption limiting value of the system according to the type of the CPU in the system, wherein the system power consumption limiting value comprises a system maximum power consumption limiting value and a system minimum power consumption limiting value;
the management module is used for determining an initial value of the CPU power consumption limiting value according to the system power consumption limiting value;
an adjustment module for cyclically executing the steps of:
adjusting the running state of the CPU according to the current power consumption limit value of the CPU to enable the real-time power consumption of the CPU to reach the current power consumption limit value of the CPU;
reading a current overall power consumption value of the system;
and adjusting the CPU power consumption limiting value according to the current overall power consumption value of the system and the system power consumption limiting value.
9. An electronic device, comprising: a processor and a memory;
the memory is configured to store a computer program, the processor is communicatively coupled to the memory, and the processor is configured to execute the computer program stored by the memory to perform the power consumption limiting method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the power consumption limiting method of any one of claims 1 to 7.
CN202211242369.4A 2022-10-11 2022-10-11 Power consumption limiting method, system, electronic device, and medium Pending CN115562865A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211242369.4A CN115562865A (en) 2022-10-11 2022-10-11 Power consumption limiting method, system, electronic device, and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211242369.4A CN115562865A (en) 2022-10-11 2022-10-11 Power consumption limiting method, system, electronic device, and medium

Publications (1)

Publication Number Publication Date
CN115562865A true CN115562865A (en) 2023-01-03

Family

ID=84744228

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211242369.4A Pending CN115562865A (en) 2022-10-11 2022-10-11 Power consumption limiting method, system, electronic device, and medium

Country Status (1)

Country Link
CN (1) CN115562865A (en)

Similar Documents

Publication Publication Date Title
US8918656B2 (en) Power supply engagement and method therefor
US20080281475A1 (en) Fan control scheme
CN106339058A (en) Dynamic power supply management method and system
US20180059754A1 (en) Multi-level data center using consolidated power control
US20170235519A1 (en) Device Management Method, Device, and Device Management Controller
US9037878B2 (en) Server rack system
US20130169816A1 (en) Monitoring and managing device, monitoring and managing system and method of data center
CN104335137A (en) Managing power consumption and performance of computing systems
US20140281647A1 (en) Managing the operation of a computing system
CN106371540B (en) System power management method, chip and electronic equipment
CN111427744A (en) Power consumption management method, equipment and medium for server
CN104335135B (en) Maximum current throttles
CN115551314A (en) Temperature monitoring method, system, device and medium
US10362375B2 (en) Discovering connection of passive cables
US20160156518A1 (en) Server for automatically switching sharing-network
US9927864B2 (en) Multiple link power allocation system
US11119551B2 (en) Power consumption sensing for power over ethernet (PoE) power sourcing equipment (PSE) system
US20180375674A1 (en) Judgement unit and controlling method thereof, power supply device and controlling method thereof
CN111857308A (en) Server power management method and system
CN103500108A (en) System memory access method, node processor and multi-processor system
CN109324676A (en) A kind of method and electric controller of power supply circuit control
CN115562865A (en) Power consumption limiting method, system, electronic device, and medium
US8046602B2 (en) Controlling connection status of network adapters
CN108933687B (en) Power consumption control method and device
CN116841749A (en) Processor operation control method and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination