A method for adaptively adjusting CPU frequency to control system power consumption

The CPU temperature is obtained through the BMC and IPMI protocols, and the CPU frequency is adjusted adaptively by using the fitting curve to solve the problem of unstable CPU frequency adjustment in harsh environments, and the computer can be stable in harsh environments and performance improvements.

CN114020137BActive Publication Date: 2024-11-19SHANDONG CHAOYUE DATA CONTROL ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111269602.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-29
Publication Date
2024-11-19
Estimated Expiration
2041-10-29

AI Technical Summary

Technical Problem

In harsh environments, it is difficult for the existing technology to effectively adjust the CPU frequency, resulting in unstable performance, which may cause lag or downtime, and manual adjustment efficiency is inefficient.

Method used

The CPU temperature is obtained through BMC, the optimal curve of the fitted CPU frequency and temperature is used to adaptively adjust the CPU frequency, and the IPMI protocol and hardware monitoring control chip obtain the temperature in real time, and dynamically balance the CPU frequency.

Benefits of technology

It realizes the stable operation of the computer in harsh environments, improves CPU performance, avoids performance damage and equipment failures, and improves the adaptability and efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114020137B_ABST
    Figure CN114020137B_ABST
Patent Text Reader

Abstract

The invention discloses a method for adaptively adjusting CPU frequency to control system power consumption, and relates to the technical field of computers. The method uses BMC to obtain CPU temperature, and adaptively adjusts CPU frequency by fitting the optimal CPU frequency curve of CPU frequency and temperature; the computer obtains the external temperature through BMC, and sets the optimal CPU frequency according to the optimal CPU frequency curve of CPU frequency and temperature, so as to achieve the stability of the computer in a harsh environment. The invention can adaptively adjust CPU frequency and achieve the stability of the computer in a harsh environment, and has broad application prospects and the value of in-depth research.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of computers, in particular to a method for adaptively adjusting CPU frequency to control system power consumption. Background Art

[0002] With the development of computer technology, higher requirements are placed on the adaptability of computers in harsh environments. In order to better adapt to harsh environments, adjusting the CPU frequency is a very important means of adjustment. Generally, the CPU frequency has an adjustable range. The higher the CPU frequency, the more instructions can be processed per unit time, the faster the computer operation speed, and the higher the performance. But correspondingly, higher frequencies require higher memory frequencies, which bring higher power consumption, increase CPU temperature, and thus limit CPU performance. In harsh external environments, in order to obtain higher computer performance, the CPU needs to work in the best state. Generally, the CPU frequency can be adjusted manually, but the efficiency is low. And inappropriate adjustments will seriously damage the performance of the computer, causing freezes or even downtime. Summary of the invention

[0003] The technical task of the present invention is to provide a method for adaptively adjusting the CPU frequency to control the power consumption of the system in view of the above shortcomings, which can adaptively realize the CPU frequency adjustment and has broad application prospects.

[0004] The technical solution adopted by the present invention to solve its technical problem is:

[0005] A method for adaptively adjusting CPU frequency to control system power consumption, using BMC to obtain CPU temperature, and adaptively adjusting CPU frequency by fitting the optimal CPU frequency curve of CPU frequency and temperature;

[0006] The computer obtains the external temperature through the BMC, and sets the optimal CPU frequency according to the optimal CPU frequency curve of the CPU frequency and temperature, so as to achieve the stability of the computer in a harsh environment.

[0007] The method uses the computer's BMC (baseboard management controller) to obtain the CPU temperature through hardware design, obtains the external temperature through the BMC, and adaptively calculates the optimal CPU frequency based on the optimal CPU frequency curve of CPU frequency and temperature, thereby adjusting the computer CPU frequency so that the computer has the best performance and ensures that the computer can work normally in harsh environments. The method has broad application prospects.

[0008] Furthermore, a CPU frequency adaptive module function is set, which obtains the CPU temperature of the computer through the IPMI protocol, and then adaptively calculates the optimal CPU frequency. Finally, the system adjusts the CPU frequency and feeds it back to the BMC until a dynamic balance is achieved.

[0009] The IPMI protocol is the abbreviation of Intelligent Platform Management Interface. It allows system management software to read sensor data through IPMI. It is an industrial standard used to manage peripheral devices used in enterprise systems based on Intel architecture.

[0010] Preferably, the BMC monitors the computer temperature through a sensor, the BMC is connected to a hardware monitoring control chip, and after the BMC is started, the CPU temperature is obtained in real time through a polling strategy.

[0011] Preferably, the hardware monitoring control chip is W83795, and the BMC is connected to the W83795 hardware monitoring control chip via an I2C bus.

[0012] Preferably, the computer system communicates with the BMC via the IPMI protocol, and acquires the temperature in real time by calling the IPMI command interface.

[0013] Preferably, the ipmitool sensor list 1 command is used to obtain information of each sensor, from which the temperature information of the CPU is extracted.

[0014] Preferably, the CPU frequency adaptation module function adaptively calculates the current optimal CPU frequency according to the acquired CPU temperature. When the current frequency is not equal to the optimal frequency, the average value of the two is taken and fed back to the BMC until the optimal CPU frequency is approached.

[0015] Furthermore, the process of the CPU frequency adaptation module function adaptively calculating the current optimal CPU frequency is as follows:

[0016] 1) Assume that the detected temperature is T0, the corresponding optimal CPU frequency is H0, and the actual frequency is H0';

[0017] 2) Determine whether H0 is equal to H0'. If so, return the value to BMC; if not, the computer will call the frequency setting command to set the current CPU frequency to (HO+H0') / 2, and return this value to BMC;

[0018] 3) Repeat steps 1) and 2) to continuously approach the optimal CPU frequency.

[0019] The present invention also claims a device for adaptively adjusting CPU frequency to control system power consumption, comprising: at least one memory and at least one processor;

[0020] The at least one memory is used to store a machine-readable program;

[0021] The at least one processor is used to call the machine-readable program to execute the above method of adjusting the CPU frequency to control the power consumption of the system.

[0022] The present invention also requires protection of a computer-readable medium having computer instructions stored thereon, which, when executed by a processor, causes the processor to execute the above-mentioned method of adjusting the CPU frequency to control the power consumption of the system.

[0023] Compared with the prior art, the method for adaptively adjusting the CPU frequency control system power consumption of the present invention has the following beneficial effects:

[0024] Through hardware design, the computer's BMC (baseboard management controller) is used to obtain the CPU temperature. The system obtains the CPU temperature through the BMC via the IPMI protocol. By fitting the curve of the optimal CPU frequency between CPU frequency and temperature, the CPU frequency adjustment can be adaptively implemented, which has broad application prospects.

[0025] The computer obtains the external temperature through the BMC to set the optimal CPU frequency and achieve the stability of the computer in harsh environments, which is worthy of in-depth research. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 is a schematic diagram of a method for adaptively adjusting computer frequency using BMC provided by an embodiment of the present invention;

[0027] Figure 2 It is a schematic diagram of a process in which a BMC monitors the temperature of a computer through a sensor provided by an embodiment of the present invention;

[0028] Figure 3 It is a schematic diagram of the CPU frequency adaptive adjustment process provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0029] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0030] A method for adaptively adjusting CPU frequency to control system power consumption, using BMC to obtain CPU temperature, and adaptively adjusting CPU frequency by fitting the optimal CPU frequency curve of CPU frequency and temperature;

[0031] The computer obtains the external temperature through the BMC, and sets the optimal CPU frequency according to the optimal CPU frequency curve of the CPU frequency and temperature, so as to achieve the stability of the computer in a harsh environment.

[0032] In this method, by setting the CPU frequency adaptive module function, the function obtains the computer's CPU temperature through the IPMI protocol, and then adaptively calculates the optimal CPU frequency. Finally, the system adjusts the CPU frequency and feeds it back to the BMC until a dynamic balance is achieved. Figure 1 , which is a diagram of the process of adaptively adjusting computer frequency provided by an embodiment of the present invention.

[0033] The IPMI protocol is the abbreviation of Intelligent Platform Management Interface. It allows system management software to read sensor data through IPMI. It is an industrial standard used to manage peripheral devices used in enterprise systems based on Intel architecture.

[0034] BMC (Baseboard Management Controller) is a baseboard management controller. It can perform firmware upgrades, check machine equipment, and other operations on the machine when the machine is not turned on. BMC centralizes platform management on the controller. Platform management refers to a series of monitoring and control functions. The object of operation is system hardware. For example, it monitors the system's temperature, voltage, fan, power supply, etc., and makes corresponding adjustments to ensure that the system is in a healthy state.

[0035] In this embodiment, the implementation of the method includes the following process:

[0036] 1) BMC monitors computer temperature through sensors.

[0037] The BMC is connected to the hardware monitoring control chip. After the BMC is started, the CPU temperature is obtained in real time through a polling strategy. The hardware monitoring control chip is W83795, and the BMC is connected to the W83795 hardware monitoring control chip through the I2C bus. Figure 2 The figure shows the process of BMC monitoring the computer temperature through sensors.

[0038] 2) Obtaining the CPU temperature under the system.

[0039] The computer system communicates with the BMC through the IPMI protocol and obtains the temperature in real time by calling the IPMI command interface. For example, the ipmitool sensor list 1 command can obtain the information of each sensor, including the temperature information of the CPU, from which we can extract the temperature information of the CPU.

[0040] 3) Adaptive CPU frequency.

[0041] The CPU frequency adaptation module function adaptively calculates the current optimal CPU frequency based on the obtained CPU temperature. When the current frequency is not equal to the optimal frequency, the average value of the two is taken and fed back to the BMC until the optimal CPU frequency is approached.

[0042] refer to Figure 3 As shown, the process of the CPU frequency adaptive module function adaptively calculating the current optimal CPU frequency is as follows:

[0043] 1) Assume that the detected temperature is T0, the corresponding optimal CPU frequency is H0, and the actual frequency is H0';

[0044] 2) Determine whether H0 is equal to H0'. If so, return the value to BMC; if not, the computer will call the frequency setting command to set the current CPU frequency to (HO+H0') / 2, and return this value to BMC;

[0045] 3) Repeat steps 1) and 2) to continuously approach the optimal CPU frequency.

[0046] The method uses the computer's BMC (baseboard management controller) to obtain the CPU temperature through hardware design, obtains the external temperature through the BMC, and adaptively calculates the optimal CPU frequency based on the optimal CPU frequency curve of CPU frequency and temperature, thereby adjusting the computer CPU frequency so that the computer has the best performance and ensures that the computer can work normally in harsh environments. The method has broad application prospects.

[0047] An embodiment of the present invention further provides a device for adaptively adjusting CPU frequency to control system power consumption, comprising: at least one memory and at least one processor;

[0048] The at least one memory is used to store a machine-readable program;

[0049] The at least one processor is used to call the machine-readable program to execute the method for adjusting the CPU frequency to control the power consumption of the system described in the above embodiment of the present invention.

[0050] The embodiment of the present invention further provides a computer-readable medium, on which computer instructions are stored, and when the computer instructions are executed by a processor, the processor executes the method for adjusting the CPU frequency to control the power consumption of the system described in the above embodiment of the present invention. Specifically, a system or device equipped with a storage medium can be provided, on which a software program code that implements the functions of any of the above embodiments is stored, and a computer (or CPU or MPU) of the system or device reads and executes the program code stored in the storage medium.

[0051] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.

[0052] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.

[0053] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.

[0054] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or written to a memory provided in an expansion unit connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or the expansion unit is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.

[0055] The present invention is shown and described in detail above through the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art can know that the code review methods in the above different embodiments can be combined to obtain more embodiments of the present invention, and these embodiments are also within the protection scope of the present invention.

Claims

1. A method for adaptively adjusting CPU frequency to control system power consumption, characterized in that ,Use BMC to obtain CPU temperature, and adaptively adjust CPU frequency by fitting the optimal CPU frequency curve of CPU frequency and temperature; The computer obtains the external temperature through the BMC, and sets the optimal CPU frequency according to the optimal CPU frequency curve of the CPU frequency and temperature, so as to achieve the stability of the computer in a harsh environment; Set the CPU frequency adaptive module function, which obtains the computer's CPU temperature through the IPMI protocol, then adaptively calculates the optimal CPU frequency, and finally implements the system to adjust the CPU frequency and feeds it back to the BMC until dynamic balance is achieved; The CPU frequency adaptive module function adaptively calculates the current optimal CPU frequency based on the obtained CPU temperature. When the current frequency is not equal to the optimal frequency, the average of the two is taken and fed back to the BMC until the optimal CPU frequency is approached. The process of the CPU frequency adaptive module function adaptively calculating the current optimal CPU frequency is as follows: 1) Assuming the detected temperature is T0, the corresponding optimal CPU frequency is H0, and the actual frequency is H0'; 2) Determine whether H0 is equal to H0'. If so, return the value to BMC; if not, the computer will call the frequency setting command to set the current CPU frequency to (HO+H0') / 2, and return this value to BMC; 3) Repeat steps 1) and 2) to continuously approach the optimal CPU frequency; The BMC monitors the computer temperature through a sensor. The BMC is connected to a hardware monitoring control chip. After the BMC is started, the CPU temperature is obtained in real time through a polling strategy.

2. The method for adaptively adjusting CPU frequency to control system power consumption according to claim 1, characterized in that: The hardware monitoring control chip is W83795, and the BMC is connected to W83795 via an I2C bus.

3. The method for adaptively adjusting CPU frequency to control system power consumption according to claim 1, characterized in that: The computer system communicates with the BMC through the IPMI protocol and obtains the real-time temperature by calling the IPMI command interface.

4. The method for adaptively adjusting CPU frequency to control system power consumption according to claim 3, characterized in that: Use the ipmitool sensor list 1 command to obtain the information of each sensor and extract the CPU temperature information from it.

5. A device for adaptively adjusting CPU frequency to control system power consumption, characterized in that: include: at least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is configured to call the machine-readable program to execute the method according to any one of claims 1 to 4.

6. A computer-readable medium, characterized in that The computer readable medium stores computer instructions, and when the computer instructions are executed by a processor, the processor executes the method according to any one of claims 1 to 4.