Processor power consumption measurement method, device, equipment and readable storage medium
By presetting the power consumption gradient to determine the processor load increase rate and power consumption value, and performing fine-grained measurement, the problem of insufficient processor power consumption evaluation is solved, and efficient resource utilization and stable system operation are achieved.
Patent Information
- Application Number
- CN202510897251.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-06-30
AI Technical Summary
Existing technologies cannot effectively evaluate the actual power consumption of processors, and resource utilization is low.
The processor load increase rate is determined by presetting the power consumption gradient, the power consumption value of each processor to be tested is obtained, and fine-grained power consumption measurement is performed based on these values to determine the processor load and maximum power consumption value.
It achieves accurate assessment of processor power consumption, improves resource utilization, optimizes resource allocation and power utilization within the computer room, and ensures stable system operation and performance that meets expectations.
Smart Images

Figure CN120407338B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, device, and readable storage medium for measuring processor power consumption. Background Art
[0002] As the most critical and largest energy-consuming component in a server, the processor has extremely strict and clear regulations on its power consumption.
[0003] Currently, there are two main methods commonly used to test server power consumption. One involves rigorous and comprehensive stress testing of each key and important server component. Based on the test data, the actual power consumption level of the server under real-world operating conditions is evaluated. The other method uses a combination of various components supported by the server, such as memory, network cards, hard drives, redundant array of independent disks (RAID) cards, and smart network cards, to evaluate the power consumption of various server configurations. Both methods focus on the overall power consumption of the server under high load. This fails to assess the actual power consumption of the processor, resulting in low resource utilization. Summary of the Invention
[0004] The present application provides a method, apparatus, device and readable storage medium for measuring processor power consumption, so as to at least solve the problem in the related art that the actual power consumption of the processor cannot be evaluated and the resource utilization is low.
[0005] This application provides a method for measuring processor power consumption, comprising:
[0006] determining a processor load increase rate according to a preset power consumption gradient;
[0007] Obtaining power consumption values of each processor to be tested set according to the preset power consumption gradient;
[0008] Measuring the power consumption of the processors according to the power consumption values of the processors to be tested and the processor load increase rate, and obtaining a measurement result;
[0009] The processor load and the maximum power consumption value of the processor corresponding to each power consumption value of the processor to be tested are determined according to the measurement results.
[0010] The present application also provides a processor power consumption measurement device, comprising:
[0011] A load increase rate determination module, configured to determine a processor load increase rate according to a preset power consumption gradient;
[0012] A power consumption value acquisition module to be tested, used to obtain the power consumption value of each processor to be tested set according to the preset power consumption gradient;
[0013] A measurement result obtaining module is used to measure the power consumption of the processor according to the power consumption value of each processor to be tested and the processor load increase rate to obtain a measurement result;
[0014] The load and maximum power consumption value determination module is used to determine the processor load and the processor maximum power consumption value corresponding to each power consumption value of the processor to be tested according to the measurement results.
[0015] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned methods for measuring processor power consumption when executing the computer program.
[0016] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods for measuring processor power consumption are implemented.
[0017] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned processor power consumption measurement methods when executed by a processor.
[0018] Through this application, since the power consumption value of each processor to be tested is set according to the preset power consumption gradient, and the processor load increase rate is determined according to the preset power consumption gradient, a fine-grained processor power consumption measurement is performed according to the power consumption value of each processor to be tested and the processor load increase rate, and the processor load and the maximum power consumption value of the processor corresponding to the power consumption value of each processor to be tested are obtained, thereby providing data with important reference value for the deployment of the online computer room, effectively improving the utilization rate of the computer room power supply, and optimizing the resource allocation within the computer room, so as to achieve reasonable configuration and efficient utilization of resources. A complete and comprehensive survey of the maximum power consumption operating status of the processor is achieved, and an in-depth exploration is made into whether it complies with the established design plan to ensure the stable operation of the system and the expected performance. Therefore, the technical problem of being unable to evaluate the actual power consumption of the processor and the low resource utilization can be solved, and the technical effect of accurately evaluating the actual power consumption of the processor and improving resource utilization is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0020] Figure 1 A flowchart of a method for measuring processor power consumption according to an embodiment of the present application;
[0021] Figure 2 A flowchart of another method for measuring processor power consumption according to an embodiment of the present application;
[0022] Figure 3 This is a structural block diagram of a processor power consumption measurement device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only 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 making creative efforts are within the scope of protection of this application.
[0024] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0025] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0026] In conjunction with the specific application environment architecture or specific hardware architecture on which the execution of the processor power consumption measurement method depends, the specific application environment architecture or specific hardware architecture is described herein.
[0027] An embodiment of the present application provides a method for measuring processor power consumption, and the method is described in detail in conjunction with the execution flow of the method for measuring processor power consumption.
[0028] See also Figure 1 , Figure 1 This is a flowchart of an implementation method for measuring processor power consumption provided in an embodiment of the present application. The method may include the following steps.
[0029] S101: Determine a processor load increase rate according to a preset power consumption gradient.
[0030] When processor power consumption needs to be measured, a power consumption gradient is pre-set. For example, the power consumption gradient can be set to 10% of a preset maximum power consumption value. After the power consumption gradient is set, the processor load increase rate is determined based on the preset power consumption gradient. The processor load increase rate can be set to 10% of the processor's maximum load.
[0031] The processor may be a central processing unit (CPU), and the processor load increase rate will be 10% of the total number of CPU cores.
[0032] S102: Obtain power consumption values of each processor to be tested according to a preset power consumption gradient.
[0033] After determining the processor load increase rate according to the preset power consumption gradient, the power consumption value of each processor to be tested set according to the preset power consumption gradient is obtained.
[0034] Continuing with the above example, when the power consumption gradient is set to 10% of the preset maximum power consumption value, the power consumption values of each processor to be tested set according to the preset power consumption gradient may include 10% of the preset maximum power consumption value, 20% of the preset maximum power consumption value, 30% of the preset maximum power consumption value, ..., 100% of the preset maximum power consumption value.
[0035] S103: measuring the power consumption of the processors according to the power consumption value of each processor to be tested and the processor load increase rate, and obtaining a measurement result.
[0036] After obtaining the power consumption values of each processor to be tested, the processor power consumption is measured based on the power consumption values of each processor to be tested and the processor load increase rate to obtain a measurement result. The processor load is initially adjusted based on the processor load increase rate, and then the initially adjusted processor load is further fine-tuned based on whether the actual processor power consumption value measured reaches the corresponding power consumption value of the processor to be tested, so that the actual processor power consumption value reaches the corresponding power consumption value of the processor to be tested. This results in the corresponding processor load when the actual processor power consumption value reaches the power consumption value of each processor to be tested.
[0037] S104: Determine the processor load and the maximum power consumption value of the processor corresponding to each power consumption value of the processor to be tested according to the measurement result.
[0038] The measurement results include the corresponding processor loads when the actual processor power consumption reaches the power consumption values of each processor under test. After obtaining the measurement results, the corresponding processor loads and maximum processor power consumption values for each processor under test are determined based on the measurement results. This provides valuable reference data for online computer room deployment, effectively improving power utilization in the computer room and further optimizing resource allocation within the computer room, thereby achieving rational resource allocation and efficient utilization.
[0039] Through this application, since the power consumption value of each processor to be tested is set according to the preset power consumption gradient, and the processor load increase rate is determined according to the preset power consumption gradient, a fine-grained processor power consumption measurement is performed according to the power consumption value of each processor to be tested and the processor load increase rate, and the processor load and the maximum power consumption value of the processor corresponding to the power consumption value of each processor to be tested are obtained, thereby providing data with important reference value for the deployment of the online computer room, effectively improving the utilization rate of the computer room power supply, and optimizing the resource allocation within the computer room, so as to achieve reasonable configuration and efficient utilization of resources. A complete and comprehensive survey of the maximum power consumption operating status of the processor is achieved, and an in-depth exploration is made into whether it complies with the established design plan to ensure the stable operation of the system and the expected performance. Therefore, the technical problem of being unable to evaluate the actual power consumption of the processor and the low resource utilization can be solved, and the technical effect of accurately evaluating the actual power consumption of the processor and improving resource utilization is achieved.
[0040] See also Figure 2 , Figure 2 This is a flowchart of another method for measuring processor power consumption provided in an embodiment of the present application. The method may include the following steps.
[0041] S201: Determine a processor load increase rate according to a preset power consumption gradient.
[0042] A pre-built CPU power consumption test environment for an Advanced RISC Machine (ARM) platform server can be established. In this environment, the server must be fully populated with memory, while other components may or may not be present. Furthermore, the dedicated network interface of the Baseboard Management Controller (BMC) must be able to maintain stable and normal connectivity, and the server system must be able to successfully and accurately obtain an Internet Protocol (IP) address. Furthermore, the BMC should support automatic fan speed control to ensure cooling requirements and stability during server operation. On the completed server under test, a CPU stress test tool with maxpower enabled is run.
[0043] When the processor power consumption needs to be measured, the processor load increase rate is determined according to a preset power consumption gradient.
[0044] S202: Obtain power consumption values of each processor to be tested according to a preset power consumption gradient.
[0045] S203: measuring the power consumption of the processors according to the power consumption values of the processors to be tested and the processor load increase rate, and obtaining a measurement result.
[0046] S204: Obtain the minimum processor power consumption value among the power consumption values of the processors to be tested.
[0047] The power consumption values of the processors to be tested are distributed according to a preset power consumption gradient. The power consumption values of the processors to be tested differ from each other by an integer multiple of the preset power consumption gradient. The minimum power consumption value of the processors to be tested is obtained.
[0048] S205: Determine an initial processor load according to the minimum processor power consumption value.
[0049] After obtaining the minimum processor power consumption value among the power consumption values of the processors to be tested, the initial processor load is determined based on the minimum processor power consumption value. For example, when the minimum processor power consumption value is 10% of the preset maximum power consumption value, the initial processor load is 10% of the maximum processor load.
[0050] S206: Adjusting the initial processor load so that the processor reaches a minimum processor power consumption value, determining the minimum processor power consumption value as the current processor power consumption value, and determining the processor load when the current processor power consumption value is reached as the current processor load.
[0051] After determining the initial processor load based on the minimum processor power consumption value, the initial processor load is adjusted so that the processor reaches the minimum processor power consumption value, and the minimum processor power consumption value is determined as the current processor power consumption value, and the processor load when the current processor power consumption value is reached is determined as the current processor load.
[0052] S207: Increase the current processor load according to the processor load increase rate to obtain the current increased processor load.
[0053] After determining the minimum processor power consumption value as the current processor power consumption value and the processor load when the current processor power consumption value is reached as the current processor load, the current processor load is increased by the processor load increase rate to obtain the current increased processor load. For example, if the current processor load is 10% of the maximum processor load and the processor load increase rate is 10% of the maximum processor load, then the current processor load is increased by the processor load increase rate to obtain a current increased processor load of 20% of the maximum processor load. You can use the top command in the operating system (OS) to closely monitor the server load.
[0054] S208: Adjusting the current increased processor load so that the processor reaches the sum of the current processor power consumption value and the preset power consumption gradient, until the sum reaches the maximum processor power consumption value among the power consumption values of the processors to be tested.
[0055] After increasing the current processor load according to the processor load increase rate to obtain the current increased processor load, the current increased processor load is adjusted so that the processor reaches the sum of the current processor power consumption value and the preset power consumption gradient, until the sum reaches the maximum processor power consumption value among the power consumption values of the processors under test. The Intelligent Platform Management Interface tool (ipmitool) can then be used to issue relevant instructions to obtain the current precise power consumption value of the processor. By gradually testing the actual processor load corresponding to each power consumption value of the processor under test according to the power consumption value and the processor load increase rate, fine-grained measurement of processor power consumption is achieved, enabling accurate assessment of the actual power consumption of the processor.
[0056] Continuing with the above example, if the current increased processor load is 20% of the maximum processor load, then the sum of the current processor power consumption value and the preset power consumption gradient is 20% of the preset maximum power consumption value. Specifically, it can be about 20% of the preset maximum power consumption value, such as 19% to 21% of the preset maximum power consumption value. The other adjustment links are similar. The power consumption adjustment target can be set to be within the preset upper and lower threshold range of the sum of the current processor power consumption value and the preset power consumption gradient, thereby improving the flexibility of processor power consumption measurement and adjustment.
[0057] In a specific implementation of the present application, step S208 may include the following steps:
[0058] Step 1: Determine whether the sum value reaches the maximum processor power consumption value among the power consumption values of the processors to be tested. If not, execute step 2; if so, execute step 3;
[0059] Step 2: Determine the sum value as the new current processor power consumption value, determine the processor load when the minimum processor power consumption value is reached as the current processor load, and return to the step of determining the processor load when the current processor power consumption value is reached as the current processor load;
[0060] Step 3: Determine the measurement result based on the corresponding relationship between each current processor load and each current processor power consumption value.
[0061] For the convenience of description, the above three steps can be combined for explanation.
[0062] After adjusting the current increased processor load so that the processor reaches the sum of the current processor power consumption value and the preset power consumption gradient, it is determined whether the sum reaches the maximum processor power consumption value among the power consumption values of the processors to be tested. If not, it indicates that it is necessary to continue the processor power consumption measurement, determine the sum as the new current processor power consumption value, determine the processor load when the minimum processor power consumption value is reached as the current processor load, and return to the step of determining the processor load when the current processor power consumption value is reached as the current processor load, thereby performing the next processor power consumption measurement of the preset power consumption gradient. If so, it indicates that the processor power consumption measurement is completed, and the measurement result is determined based on the corresponding relationship between each current processor load and each current processor power consumption value. By gradually testing the actual processor load corresponding to each power consumption value of the processor to be tested according to the power consumption value of each processor to be tested and the processor load increase rate, a fine-grained measurement of the processor power consumption is achieved, and an accurate assessment of the actual power consumption of the processor is achieved.
[0063] In a specific embodiment of the present application, after determining the processor load when the minimum processor power consumption value is reached as the current processor load, the method may further include the following steps:
[0064] Step 1: Collect the current fan speed;
[0065] Step 2: Record the current processor power consumption, current processor load, and current fan speed;
[0066] Accordingly, returning to the step of determining the processor load when the current processor power consumption value is reached as the current processor load includes:
[0067] Return to the step of collecting the current fan speed.
[0068] For the convenience of description, the above steps can be combined for explanation.
[0069] After determining the processor load at the time of reaching the minimum processor power consumption value as the current processor load, the current fan speed is collected and the current processor power consumption value, the current processor load, and the current fan speed are recorded. If it is determined that the sum of the processor power consumption value and the preset power consumption gradient does not reach the maximum processor power consumption value among the power consumption values of the processors to be tested, the process returns to the step of collecting the current fan speed, thereby measuring the processor power consumption at the next preset power consumption gradient. By recording the current processor power consumption value, the current processor load, and the current fan speed obtained from measuring the processor power consumption according to the preset power consumption gradient, a comprehensive measurement of the processor power consumption is achieved, thereby improving system resource utilization.
[0070] In a specific embodiment of the present application, when it is determined that the sum value reaches the maximum processor power consumption value among the power consumption values of the processors to be tested, the method may further include the following steps:
[0071] Step 1: Collect the current fan speed and reduce the current fan speed;
[0072] Step 2: Read the processor temperature, processor power consumption, and fan speed at preset time intervals;
[0073] Step 3: Determine whether the system control processor is underclocked based on the read processor temperature. If not, return to the step of collecting the current fan speed and lowering the current fan speed. If so, execute step 4.
[0074] Step 4: Obtain the processor power consumption value and fan speed before reducing the current fan speed.
[0075] For the convenience of description, the above four steps can be combined for explanation.
[0076] When the sum reaches the maximum power consumption value of all processors under test, the current fan speed is collected and adjusted downward. The processor temperature, processor power consumption, and fan speed are read at preset intervals. Based on the read processor temperature, the system determines whether the system control processor (SCP) is experiencing a frequency reduction. If not, the system returns to the step of collecting the current fan speed and adjusting it downward. If so, the system obtains the processor power consumption value and fan speed before the fan speed reduction. By determining whether the system control processor is experiencing frequency reduction, the accuracy and comprehensiveness of processor power consumption measurements are further improved.
[0077] In a specific embodiment of the present application, after obtaining the processor power consumption value and the fan speed before lowering the current fan speed, the method may further include the following steps:
[0078] Step 1: Determine whether the power consumption value of the processor before reducing the current fan speed reaches the maximum power consumption value of the processors to be tested. If not, execute step 2; if yes, do not process.
[0079] Step 2: Outputting heat dissipation control strategy adjustment prompt information, so as to adjust the heat dissipation control strategy according to the heat dissipation control strategy adjustment prompt information and the fan speed before lowering the current fan speed.
[0080] For the convenience of description, the above two steps can be combined for explanation.
[0081] After obtaining the processor power consumption value and fan speed before the current fan speed is lowered, determine whether the processor power consumption value before the current fan speed is lowered reaches the maximum processor power consumption value among the power consumption values of the processors to be tested. If not, output a heat dissipation control strategy adjustment prompt message, so that the operation and maintenance personnel can adjust the heat dissipation control strategy according to the heat dissipation control strategy adjustment prompt message and the fan speed before the current fan speed is lowered, and optimize the heat dissipation control strategy. If so, no other processing is required. After the system control processor is frequency-reduced, when it is determined that the processor power consumption value before the current fan speed is lowered does not reach the maximum processor power consumption value among the power consumption values of the processors to be tested, output a heat dissipation control strategy adjustment prompt message to promptly prompt the operation and maintenance personnel to adjust the heat dissipation control strategy, thereby ensuring that the entire system can operate stably and efficiently.
[0082] By carefully monitoring changes in CPU power consumption, we can determine whether it meets pre-set standards for online performance. If not, we need to further optimize the thermal management strategy and improve the hardware design. We can also improve and refine the hardware design, and we must not overlook any minor issues or deficiencies to ensure the stable and efficient operation of the entire system.
[0083] In a specific embodiment of the present application, after determining the measurement result based on the correspondence between each current processor load and each current processor power consumption value, the method may further include the following steps:
[0084] According to the corresponding relationship between each current processor load and each current processor power consumption value, it is determined whether each current processor load and each current processor power consumption value satisfy a linear variation rule.
[0085] After determining the measurement results based on the correspondence between each current processor load and each current processor power consumption value, it is determined whether each current processor load and each current processor power consumption value satisfy the linear change law based on the correspondence between each current processor load and each current processor power consumption value, thereby further improving the comprehensiveness of the processor power consumption measurement.
[0086] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0087] An embodiment of the present application also provides a device for measuring processor power consumption.
[0088] See also Figure 3 , Figure 3This is a structural block diagram of a processor power consumption measurement device provided in an embodiment of the present application. The device may include:
[0089] A load increase rate determination module 31 is configured to determine a processor load increase rate according to a preset power consumption gradient;
[0090] The power consumption value acquisition module 32 to be tested is used to obtain the power consumption value of each processor to be tested according to a preset power consumption gradient;
[0091] The measurement result obtaining module 33 is used to measure the power consumption of the processor according to the power consumption value of each processor to be tested and the processor load increase rate to obtain a measurement result;
[0092] The load and maximum power consumption value determination module 34 is used to determine the processor load and the processor maximum power consumption value corresponding to each power consumption value of the processor to be tested according to the measurement results.
[0093] Through this application, since the power consumption value of each processor to be tested is set according to the preset power consumption gradient, and the processor load increase rate is determined according to the preset power consumption gradient, a fine-grained processor power consumption measurement is performed according to the power consumption value of each processor to be tested and the processor load increase rate, and the processor load and the maximum power consumption value of the processor corresponding to the power consumption value of each processor to be tested are obtained, thereby providing data with important reference value for the deployment of the online computer room, effectively improving the utilization rate of the computer room power supply, and optimizing the resource allocation within the computer room, so as to achieve reasonable configuration and efficient utilization of resources. A complete and comprehensive survey of the maximum power consumption operating status of the processor is achieved, and an in-depth exploration is made into whether it complies with the established design plan to ensure the stable operation of the system and the expected performance. Therefore, the technical problem of being unable to evaluate the actual power consumption of the processor and the low resource utilization can be solved, and the technical effect of accurately evaluating the actual power consumption of the processor and improving resource utilization is achieved.
[0094] In a specific embodiment of the present application, the measurement result obtaining module 33 may include:
[0095] The minimum processor power consumption value acquisition submodule is used to obtain the minimum processor power consumption value among the power consumption values of the processors to be tested;
[0096] an initial processor load determination submodule, configured to determine an initial processor load according to a minimum processor power consumption value;
[0097] a current power consumption value and current load determination submodule, configured to adjust the initial processor load so that the processor reaches a minimum processor power consumption value, determine the minimum processor power consumption value as the current processor power consumption value, and determine the processor load when the current processor power consumption value is reached as the current processor load;
[0098] The current increased post-processor load obtaining submodule is used to increase the current processor load according to the processor load increase rate to obtain the current increased post-processor load;
[0099] The load adjustment submodule is used to adjust the current increased processor load so that the processor reaches the sum of the current processor power consumption value and the preset power consumption gradient, until the sum reaches the maximum processor power consumption value among the power consumption values of the processors to be tested.
[0100] In a specific embodiment of the present application, the load adjustment submodule may include:
[0101] a judging unit, configured to judge whether the sum value reaches a maximum processor power consumption value among the power consumption values of the processors to be tested;
[0102] The execution unit is returned, configured to, when it is determined that the sum value does not reach the maximum processor power consumption value among the power consumption values of the processors to be tested, determine the sum value as the new current processor power consumption value, determine the processor load when the minimum processor power consumption value is reached as the current processor load, and return to the step of determining the processor load when the current processor power consumption value is reached as the current processor load;
[0103] The measurement result determining unit is configured to determine the measurement result according to the corresponding relationship between each current processor load and each current processor power consumption value when the determined sum value reaches the maximum processor power consumption value among the power consumption values of the processors to be tested.
[0104] In a specific embodiment of the present application, the device may further include:
[0105] A fan speed collection module is used to collect the current fan speed after the processor load when the minimum processor power consumption value is reached is determined as the current processor load;
[0106] A recording module is used to record the current processor power consumption value, the current processor load and the current fan speed;
[0107] The return execution unit is specifically a unit that returns the step of executing the step of collecting the current fan speed.
[0108] In a specific embodiment of the present application, the device may further include:
[0109] The speed reduction module is used to collect the current fan speed and reduce the current fan speed when the determined sum value reaches the maximum processor power consumption value among the power consumption values of the processors to be tested;
[0110] A reading module is used to read the processor temperature, processor power consumption value and fan speed according to a preset time interval;
[0111] A first judgment module is used to judge whether the system control processor is frequency-reduced according to the read processor temperature;
[0112] The return execution module is used to return to the step of collecting the current fan speed and reducing the current fan speed when it is determined based on the read processor temperature that the system control processor has not experienced frequency reduction;
[0113] The power consumption value and fan speed obtaining module before reduction is used to obtain the processor power consumption value and fan speed before reducing the current fan speed when it is determined that the system control processor has reduced frequency according to the read processor temperature.
[0114] In a specific embodiment of the present application, the device may further include:
[0115] A second judgment module is used to determine whether the processor power consumption value before the current fan speed is lowered reaches the maximum processor power consumption value among the power consumption values of the processors to be tested after obtaining the processor power consumption value and the fan speed before the current fan speed is lowered;
[0116] The heat dissipation control strategy adjustment module is used to output heat dissipation control strategy adjustment prompt information when it is determined that the processor power consumption value before the current fan speed is lowered does not reach the maximum processor power consumption value among the power consumption values of the processors to be tested, so as to adjust the heat dissipation control strategy according to the heat dissipation control strategy adjustment prompt information and the fan speed before the current fan speed is lowered.
[0117] In a specific embodiment of the present application, the device may further include:
[0118] The third judgment module is used to determine whether the current processor load and the current processor power consumption value satisfy the linear change law based on the correspondence between the current processor load and the current processor power consumption value after determining the measurement result based on the correspondence between the current processor load and the current processor power consumption value.
[0119] For the description of the features in the embodiment corresponding to the processor power consumption measuring device, reference can be made to the relevant description of the embodiment corresponding to the processor power consumption measuring method, which will not be repeated here.
[0120] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps of any of the above-mentioned processor power consumption measurement method embodiments.
[0121] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above-mentioned processor power consumption measurement method embodiments when running.
[0122] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0123] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned processor power consumption measurement method embodiments are implemented.
[0124] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned processor power consumption measurement method embodiments are implemented.
[0125] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0126] The above is a detailed introduction to the processor power consumption measurement method, device, equipment and readable storage medium provided by this application. This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the scope of protection of this application.
Claims
1. A method for measuring processor power consumption, characterized in that: include: determining a processor load increase rate according to a preset power consumption gradient; Obtaining power consumption values of each processor to be tested set according to the preset power consumption gradient; Obtaining the minimum processor power consumption value among the power consumption values of the processors to be tested; determining an initial processor load based on the minimum processor power consumption value; By adjusting the initial processor load so that the processor reaches the minimum processor power consumption value, determining the minimum processor power consumption value as the current processor power consumption value, and determining the processor load when the current processor power consumption value is reached as the current processor load; Increasing the current processor load according to the processor load increase rate to obtain a current increased processor load; Adjusting the current increased processor load so that the processor reaches a sum of the current processor power consumption value and the preset power consumption gradient; Determine whether the sum value reaches the maximum processor power consumption value among the power consumption values of the processors to be tested; If not, determining the sum as a new current processor power consumption value, determining the processor load when the minimum processor power consumption value is reached as the current processor load, and collecting the current fan speed; Recording the current processor power consumption value, the current processor load, and the current fan speed; and returning to execute the step of collecting the current fan speed; If so, determining the measurement result according to the corresponding relationship between the load of each current processor and the power consumption value of each current processor; Determine the processor load and the maximum power consumption value of the processor corresponding to each power consumption value of the processor to be tested according to the measurement results; When it is determined that the sum reaches the maximum processor power consumption value among the power consumption values of the processors to be tested, the method further includes: Collecting the current fan speed and reducing the current fan speed; Read processor temperature, processor power consumption, and fan speed at preset time intervals; Determine whether the system control processor is underclocked based on the processor temperature read; If not, returning to the step of collecting the current fan speed and lowering the current fan speed; If yes, obtaining the processor power consumption value and fan speed before lowering the current fan speed; Determining whether the power consumption value of the processor before lowering the current fan speed reaches a maximum power consumption value of the processors to be tested; If not, heat dissipation control strategy adjustment prompt information is output, so as to adjust the heat dissipation control strategy according to the heat dissipation control strategy adjustment prompt information and the fan speed before the current fan speed is lowered.
2. The method for measuring processor power consumption according to claim 1, wherein: After determining the measurement result according to the corresponding relationship between the current processor load and the current processor power consumption value, the method further includes: According to the corresponding relationship between each current processor load and each current processor power consumption value, it is determined whether each current processor load and each current processor power consumption value satisfy a linear variation rule.
3. A processor power consumption measuring device, characterized in that: include: A load increase rate determination module, configured to determine a processor load increase rate according to a preset power consumption gradient; A power consumption value acquisition module to be tested, used to obtain the power consumption value of each processor to be tested set according to the preset power consumption gradient; The measurement result acquisition module includes: The minimum processor power consumption value acquisition submodule is used to obtain the minimum processor power consumption value among the power consumption values of the processors to be tested; an initial processor load determination submodule, configured to determine an initial processor load according to a minimum processor power consumption value; a current power consumption value and current load determination submodule, configured to adjust the initial processor load so that the processor reaches a minimum processor power consumption value, determine the minimum processor power consumption value as the current processor power consumption value, and determine the processor load when the current processor power consumption value is reached as the current processor load; The current increased post-processor load obtaining submodule is used to increase the current processor load according to the processor load increase rate to obtain the current increased post-processor load; The load adjustment submodule includes: a judging unit, configured to judge whether the sum value reaches a maximum processor power consumption value among the power consumption values of the processors to be tested; The execution unit is returned, configured to, when it is determined that the sum value does not reach the maximum processor power consumption value among the power consumption values of the processors to be tested, determine the sum value as the new current processor power consumption value, determine the processor load when the minimum processor power consumption value is reached as the current processor load, and return to the step of determining the processor load when the current processor power consumption value is reached as the current processor load; a measurement result determining unit, configured to determine a measurement result according to a corresponding relationship between each current processor load and each current processor power consumption value when the determined sum value reaches a maximum processor power consumption value among the power consumption values of the processors to be tested; A load and maximum power consumption value determination module, configured to determine the processor load and the processor maximum power consumption value corresponding to each power consumption value of the processor to be tested according to the measurement results; A fan speed collection module is used to collect the current fan speed after the processor load when the minimum processor power consumption value is reached is determined as the current processor load; A recording module is used to record the current processor power consumption value, the current processor load and the current fan speed; The return execution unit is specifically a unit that returns the step of executing the step of collecting the current fan speed; The speed reduction module is used to collect the current fan speed and reduce the current fan speed when the determined sum value reaches the maximum processor power consumption value among the power consumption values of the processors to be tested; A reading module is used to read the processor temperature, processor power consumption value and fan speed according to a preset time interval; A first judgment module is used to judge whether the system control processor is frequency-reduced according to the read processor temperature; The return execution module is used to return to the step of collecting the current fan speed and reducing the current fan speed when it is determined based on the read processor temperature that the system control processor has not experienced frequency reduction; The power consumption value and fan speed obtaining module before the reduction is used to obtain the processor power consumption value and fan speed before the current fan speed is reduced when it is determined based on the read processor temperature that the system control processor has reduced the frequency; A second judgment module is used to determine whether the processor power consumption value before the current fan speed is lowered reaches the maximum processor power consumption value among the power consumption values of the processors to be tested after obtaining the processor power consumption value and the fan speed before the current fan speed is lowered; The heat dissipation control strategy adjustment module is used to output heat dissipation control strategy adjustment prompt information when it is determined that the processor power consumption value before the current fan speed is lowered does not reach the maximum processor power consumption value among the power consumption values of the processors to be tested, so as to adjust the heat dissipation control strategy according to the heat dissipation control strategy adjustment prompt information and the fan speed before the current fan speed is lowered.
4. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the method for measuring processor power consumption as claimed in any one of claims 1 to 2 when executing the computer program.
5. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the method for measuring processor power consumption according to any one of claims 1 to 2 are implemented.
Citation Information
Patent Citations
Method and device for detecting power consumption of internal equipment of server, equipment and storage medium
CN114329897A