Method, device and equipment for measuring power consumption of processor and readable storage medium
The processor load increase rate and power consumption value are determined by preset power consumption gradients, and fine-grained measurement is carried out, which solves the problem of insufficient processor power consumption evaluation, and realizes efficient resource utilization and stable system operation.
Patent Information
- Application Number
- CN202510897251.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-06-30
AI Technical Summary
The prior art cannot effectively evaluate the actual power consumption of the processor and the resource utilization rate is low.
The processor load increase rate is determined by preset power consumption gradient, the power consumption values of each processor to be tested are obtained, and the fine-grained power consumption measurement is performed based on these values to determine the processor load and maximum power consumption values.
It realizes an accurate evaluation of processor power consumption, improves resource utilization, optimizes the internal resource configuration and allocation of computer rooms, and ensures that the system is stable and performs in line with expectations.
Smart Images

Figure CN120407338A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a method, device, equipment, and readable storage medium for measuring the power consumption of a processor. Background Art
[0002] As the most critical and power-consuming component in a server, the power consumption of the processor has extremely strict and clear regulations.
[0003] Currently, the commonly used server power consumption testing methods mainly include two types. One is to conduct strict and comprehensive stress tests on each key and important component of the server one by one. Based on the test data of each item, evaluate the actual power consumption level presented by the server under the real operating state. The other is to select different numbers of components for matching according to various components supported by the server, such as memory, network card, hard disk, Redundant Array of Independent Disks (Raid) card, intelligent network card, etc., so as to evaluate the server power consumption for multiple different server configurations. Both methods focus on the change of the overall power consumption of the server under high load conditions. It is impossible to evaluate the actual power consumption of the processor, and the resource utilization rate is low. Summary of the Invention
[0004] This application provides a method, device, equipment, and readable storage medium for measuring the power consumption of a processor, so as to at least solve the problem in the related technology that the actual power consumption of the processor cannot be evaluated and the resource utilization rate is low.
[0005] This application provides a method for measuring the power consumption of a processor, including: Determine the processor load increase rate according to a preset power consumption gradient; Obtain the power consumption values of each processor to be tested set according to the preset power consumption gradient; Measure the power consumption of the processor according to the power consumption values of each processor to be tested and the processor load increase rate, and obtain a measurement result; 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 result.
[0006] This application also provides a device for measuring the power consumption of a processor, including: A load increase rate determination module, configured to determine the processor load increase rate according to a preset power consumption gradient; A to-be-tested power consumption value acquisition module, configured to obtain the power consumption values of each processor to be tested set according to the preset power consumption gradient; A measurement result acquisition module, configured to measure the power consumption of the processor according to the power consumption values of each processor to be tested and the processor load increase rate, and obtain a measurement result; 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 processor power consumption value to be tested according to the measurement result.
[0007] This application also provides an electronic device, including: a memory for storing a computer program; a processor for implementing the steps of any of the above-mentioned processor power consumption measurement methods when executing the computer program.
[0008] This application also provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above-mentioned processor power consumption measurement methods are implemented.
[0009] This application also provides a computer program product, including 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 methods are implemented.
[0010] Through this application, since the power consumption values of each processor to be tested are set according to a preset power consumption gradient, the processor load increase rate is determined according to the preset power consumption gradient, and fine-grained processor power consumption measurement is performed according to the power consumption values of each processor to be tested and the processor load increase rate, the processor load and the processor maximum power consumption value corresponding to each power consumption value to be tested are obtained, thereby providing data with important reference value for the deployment work of the online computer room, effectively improving the utilization rate of the computer room power supply, and being able to optimize the resource allocation inside the computer room, so as to realize the reasonable configuration and efficient utilization of resources. The maximum power consumption operating conditions of the processor are comprehensively and thoroughly investigated to deeply explore whether it meets the established design scheme to ensure the stable operation of the system and the performance that meets expectations. Therefore, the technical problems of being unable to evaluate the actual power consumption situation of the processor and low resource utilization rate can be solved, and the technical effects of accurately evaluating the actual power consumption situation of the processor and improving the resource utilization rate are achieved. Description of the Drawings
[0011] In order to more clearly illustrate the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0012] Figure 1 It is an implementation flowchart of a processor power consumption measurement method provided by an embodiment of the present application; Figure 2 It is an implementation flowchart of another processor power consumption measurement method provided by an embodiment of the present application; Figure 3Block diagram of a processor power consumption measurement device provided by an embodiment of the present application. Detailed implementation manners
[0013] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.
[0014] It should be noted that in the description of the present application, the terms "include", "comprise" or any other variation thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0015] In order to enable those skilled in the art of the present technology to better understand the solution of the present application, the present application will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.
[0016] In combination 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.
[0017] An embodiment of the present application provides a processor power consumption measurement method. The method will be described in detail in combination with the execution flow of the processor power consumption measurement method.
[0018] See Figure 1 , Figure 1 which is an implementation flowchart of a processor power consumption measurement method provided by an embodiment of the present application. The method may include the following steps.
[0019] S101: Determine the processor load increase rate according to a preset power consumption gradient.
[0020] When it is necessary to measure the processor power consumption, a power consumption gradient is preset in advance. For example, the power consumption gradient can be set to 10% of the preset maximum power consumption value. After the power consumption gradient is set, the processor load increase rate is determined according to the preset power consumption gradient. The processor load increase rate can be set to 10% of the processor maximum load.
[0021] If the processor is a central processing unit (CPU), the processor load increase rate will be 10% of the total number of CPU cores.
[0022] S102: Obtain the power consumption values of each processor to be tested set according to a preset power consumption gradient.
[0023] After determining the processor load increase rate according to the preset power consumption gradient, obtain the power consumption values of each processor to be tested set according to the preset power consumption gradient.
[0024] 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.
[0025] S103: Perform processor power consumption measurement according to the power consumption values of each processor to be tested and the processor load increase rate to obtain a measurement result.
[0026] After obtaining the power consumption values of each processor to be tested, perform processor power consumption measurement according to the power consumption values of each processor to be tested and the processor load increase rate to obtain a measurement result. By initially adjusting the processor load according to the processor load increase rate, and then further fine-tuning the processor load obtained from the initial adjustment according to whether the measured actual processor power consumption value 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, thereby obtaining the respective processor loads corresponding to when the actual processor power consumption value reaches the power consumption values of each processor to be tested.
[0027] S104: 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 result.
[0028] The measurement result includes the respective processor loads corresponding to when the actual processor power consumption value reaches the power consumption values of each processor to be tested. After obtaining the measurement result, 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 result. Provide data with important reference value for the deployment work of the online computer room, effectively improve the utilization rate of the computer room power supply, and can further optimize the resource allocation inside the computer room, thereby realizing the reasonable configuration and efficient utilization of resources.
[0029] With this application, since the power consumption values of each processor to be tested are set according to a preset power consumption gradient, and the processor load increase rate is determined according to the preset power consumption gradient, fine-grained processor power consumption measurement is performed based on the power consumption values of each processor to be tested and the processor load increase rate, and the processor load and the maximum processor power consumption value corresponding to each power consumption value of the processor to be tested are obtained, thereby providing data with important reference value for the deployment work of the online computer room, effectively improving the utilization rate of the computer room power supply, and being able to optimize the resource allocation inside the computer room, so as to achieve the reasonable configuration and efficient utilization of resources. It realizes a complete and comprehensive understanding of the maximum power consumption operating conditions of the processor, and deeply explores whether it meets the established design scheme to ensure the stable operation of the system and the performance that meets expectations. Therefore, it can solve the technical problems of being unable to evaluate the actual power consumption of the processor and low resource utilization rate, and achieves the technical effect of accurately evaluating the actual power consumption of the processor and improving the resource utilization rate.
[0030] See Figure 2 , Figure 2 FIG. is a flowchart of another method for measuring processor power consumption provided by an embodiment of the present application. The method may include the following steps.
[0031] S201: Determine the processor load increase rate according to a preset power consumption gradient.
[0032] An Advanced RISC Machine (ARM) platform server CPU power consumption test environment can be pre-built. In this environment, the server needs to be fully inserted with memory, and other components can exist or not. At the same time, the dedicated network interface of the Baseboard Management Controller (BMC) should be able to achieve stable and normal connectivity, and the server system should also be able to successfully and accurately obtain an Internet Protocol (IP) address. In addition, the BMC should also have the function of supporting automatic speed regulation of the server fan to ensure the heat dissipation requirements and stability of the server during operation. On the tested server after completion of the build, run a CPU stress tool that can perform the maxpower maximum power consumption function.
[0033] When processor power consumption measurement is required, determine the processor load increase rate according to a preset power consumption gradient.
[0034] S202: Obtain the power consumption values of each processor to be tested set according to a preset power consumption gradient.
[0035] S203: Perform processor power consumption measurement according to the power consumption values of each processor to be tested and the processor load increase rate, and obtain the measurement result.
[0036] S204: Obtain the minimum processor power consumption value among the power consumption values of each processor to be tested.
[0037] The power consumption values of each processor to be tested are distributed according to a preset power consumption gradient. The power consumption values of each processor to be tested are approximately an integer multiple of the preset power consumption gradient apart from each other. Obtain the minimum processor power consumption value among the power consumption values of each processor to be tested.
[0038] S205: Determine the initial processor load according to the minimum processor power consumption value.
[0039] After obtaining the minimum processor power consumption value among the power consumption values of each processor to be tested, determine the initial processor load according to 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.
[0040] S206: Adjust the initial processor load so that the processor reaches the minimum processor power consumption value, and determine the minimum processor power consumption value as the current processor power consumption value, and determine the processor load when reaching the current processor power consumption value as the current processor load.
[0041] After determining the initial processor load according to the minimum processor power consumption value, adjust the initial processor load so that the processor reaches the minimum processor power consumption value, and determine the minimum processor power consumption value as the current processor power consumption value, and determine the processor load when reaching the current processor power consumption value as the current processor load.
[0042] S207: Increase the current processor load according to the processor load increase rate to obtain the current increased processor load.
[0043] After determining the minimum processor power consumption value as the current processor power consumption value and determining the processor load when reaching the current processor power consumption value as the current processor load, increase the current processor load according to 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 increased processor load obtained by increasing the current processor load according to the processor load increase rate is 20% of the maximum processor load. The load situation of the server can be closely observed by using the top command under the operating system (OS).
[0044] S208: Adjust the current increased processor load so that the processor reaches the sum value of the current processor power consumption value and the preset power consumption gradient until the sum value reaches the maximum processor power consumption value among the power consumption values of each processor to be tested.
[0045] 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 value of the current processor power consumption value and the preset power consumption gradient until the sum value reaches the maximum processor power consumption value among the processor power consumption values to be tested. And relevant instructions can be issued through the Intelligent Platform Management Interface tool (ipmitool) to obtain the accurate current power consumption value of the processor. By gradually testing the actual processor loads corresponding to the processor power consumption values to be tested according to the processor power consumption values to be tested and the processor load increase rate, the fine-grained measurement of the processor power consumption is realized, and the accurate evaluation of the actual situation of the processor power consumption is realized.
[0046] Continuing the above example, if the current increased processor load is 20% of the maximum processor load, then the sum value 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% - 21% of the preset maximum power consumption value. And so on for other adjustment links. The power consumption adjustment target can be set within the preset upper and lower threshold ranges of the sum value of the current processor power consumption value and the preset power consumption gradient, thereby improving the flexibility of the processor power consumption measurement and adjustment.
[0047] In a specific implementation manner of the present application, step S208 may include the following steps: Step 1: Determine whether the sum value reaches the maximum processor power consumption value among the processor power consumption values to be tested. If not, execute Step 2; if so, execute Step 3. Step 2: Determine the sum value as the new current processor power consumption value, determine the processor load when reaching the minimum processor power consumption value as the current processor load, and return to execute the step of determining the processor load when reaching the current processor power consumption value as the current processor load. Step 3: Determine the measurement result according to the corresponding relationship between the current processor loads and the current processor power consumption values.
[0048] For convenience of description, the above three steps can be combined for explanation.
[0049] After adjusting the current increased post - processor load to make the processor reach the sum value of the current processor power consumption value and the preset power consumption gradient, it is judged whether the sum value reaches the maximum processor power consumption value among the processor power consumption values to be tested. If not, it means that the processor power consumption measurement needs to be continued. The sum value is determined as the new current processor power consumption value, the processor load when the minimum processor power consumption value is reached is determined as the current processor load, and the step of determining the processor load when the current processor power consumption value is reached as the current processor load is returned for execution, so as to perform the processor power consumption measurement for the next preset power consumption gradient. If so, it means that the processor power consumption measurement is completed, and the measurement result is determined according to the corresponding relationship between each current processor load and each current processor power consumption value. By gradually testing the actual processor loads corresponding to each processor power consumption value to be tested according to each processor power consumption value to be tested and the processor load increase rate, the fine - grained measurement of the processor power consumption is realized, and the accurate evaluation of the actual situation of the processor power consumption is realized.
[0050] 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: Step 1: Collect the current fan speed. Step 2: Record the current processor power consumption value, the current processor load, and the current fan speed. Correspondingly, the step of returning to execute the step of determining the processor load when the current processor power consumption value is reached as the current processor load includes: Return to execute the step of collecting the current fan speed.
[0051] For the convenience of description, the above - mentioned several steps can be combined for explanation.
[0052] After determining the processor load when the minimum processor power consumption value is reached as the current processor load, collect the current fan speed, record the current processor power consumption value, the current processor load, and the current fan speed, and when it is determined that the sum value of the processor power consumption value and the preset power consumption gradient does not reach the maximum processor power consumption value among the processor power consumption values to be tested, return to execute the step of collecting the current fan speed, so as to perform the processor power consumption measurement for the next preset power consumption gradient. By recording the current processor power consumption value, the current processor load, and the current fan speed obtained by performing the processor power consumption measurement according to the preset power consumption gradient, the comprehensive measurement of the processor power consumption is realized, and the system resource utilization rate is improved.
[0053] 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 processor power consumption values to be tested, the method may further include the following steps: Step 1: Collect the current fan speed and lower the current fan speed. Step 2: Read the processor temperature, processor power consumption value, and fan speed at a preset time interval. Step 3: Determine whether the system control processor has been downclocked based on the read processor temperature. If not, return to execute the step of collecting the current fan speed and lowering the current fan speed. If so, execute Step 4. Step 4: Obtain the processor power consumption value and fan speed before lowering the current fan speed.
[0054] For ease of description, the above four steps can be combined for explanation.
[0055] When it is determined that the sum value reaches the maximum processor power consumption value among the processor power consumption values to be tested, collect the current fan speed and lower the current fan speed, read the processor temperature, processor power consumption value, and fan speed at a preset time interval, and determine whether the system control processor (SCP) has been downclocked based on the read processor temperature. If not, return to execute the step of collecting the current fan speed and lowering the current fan speed. If so, obtain the processor power consumption value and fan speed before lowering the current fan speed. By determining the downclocking situation of the system control processor, the accuracy and comprehensiveness of the measurement of processor power consumption are further improved.
[0056] In a specific implementation manner of the present application, after obtaining the processor power consumption value and fan speed before lowering the current fan speed, the method may further include the following steps: Step 1: Determine whether the processor power consumption value before lowering the current fan speed reaches the maximum processor power consumption value among the processor power consumption values to be tested. If not, execute Step 2. If so, do not perform any processing. Step 2: Output a prompt message for adjusting the heat dissipation control strategy to adjust the heat dissipation control strategy based on the prompt message for adjusting the heat dissipation control strategy and the fan speed before lowering the current fan speed.
[0057] For ease of description, the above two steps can be combined for explanation.
[0058] After obtaining the processor power consumption value and the fan speed before reducing the current fan speed, it is determined whether the processor power consumption value before reducing the current fan speed reaches the maximum processor power consumption value among the processor power consumption values to be tested. If not, a heat dissipation control strategy adjustment prompt message is output, 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 reducing the current fan speed, realizing the optimized adjustment of the heat dissipation control strategy. If so, no other processing is required. By determining that the processor power consumption value before reducing the current fan speed does not reach the maximum processor power consumption value among the processor power consumption values to be tested after the system control processor is downclocked, a heat dissipation control strategy adjustment prompt message is output to prompt the operation and maintenance personnel to adjust the heat dissipation control strategy in time, so as to ensure the stable and efficient operation of the entire system.
[0059] By carefully detecting the change of CPU power consumption, it is judged whether it can meet the pre-set upper limit standard. If it fails to meet, it is necessary to further optimize and adjust the heat dissipation control strategy, and the hardware design scheme can also be improved and perfected. Any possible subtle problems and deficiencies cannot be overlooked to ensure the stable and efficient operation of the entire system.
[0060] In a specific embodiment of the present application, after determining the measurement result according to the corresponding relationship between each current processor load and each current processor power consumption value, the method may further include the following steps: Judge whether each current processor load and each current processor power consumption value satisfy the linear change law according to the corresponding relationship between each current processor load and each current processor power consumption value.
[0061] After determining the measurement result according to the corresponding relationship between each current processor load and each current processor power consumption value, judge whether each current processor load and each current processor power consumption value satisfy the linear change law according to the corresponding relationship between each current processor load and each current processor power consumption value, thereby further improving the comprehensiveness of processor power consumption measurement.
[0062] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0063] The embodiment of the present application also provides a processor power consumption measurement device.
[0064] See Figure 3 , Figure 3 For the structural block diagram of a processor power consumption measurement device provided by an embodiment of the present application, the device may include: The load increase rate determination module 31 is configured to determine the processor load increase rate according to a preset power consumption gradient; The to-be-tested power consumption value acquisition module 32 is configured to acquire each to-be-tested processor power consumption value set according to the preset power consumption gradient; The measurement result acquisition module 33 is configured to perform processor power consumption measurement according to each to-be-tested processor power consumption value and the processor load increase rate, and obtain a measurement result; The load and maximum power consumption value determination module 34 is configured to determine the processor load and the processor maximum power consumption value corresponding to each to-be-tested processor power consumption value according to the measurement result.
[0065] Through this application, since each to-be-tested processor power consumption value is set according to the preset power consumption gradient, the processor load increase rate is determined according to the preset power consumption gradient, and fine-grained processor power consumption measurement is performed according to each to-be-tested processor power consumption value and the processor load increase rate, the processor load and the processor maximum power consumption value corresponding to each to-be-tested processor power consumption value are obtained, thereby providing data with important reference value for the deployment work of the online computer room, effectively improving the utilization rate of the computer room power supply, being able to optimize the resource allocation inside the computer room, and thus realizing the reasonable configuration and efficient utilization of resources. The maximum power consumption operation status of the processor is comprehensively and thoroughly investigated to deeply explore whether it conforms to the established design scheme to ensure the stable operation of the system and meet the expected performance. Therefore, the technical problems of being unable to evaluate the actual power consumption situation of the processor and low resource utilization rate can be solved, and the technical effects of accurately evaluating the actual power consumption situation of the processor and improving the resource utilization rate are achieved.
[0066] In a specific implementation manner of this application, the measurement result acquisition module 33 may include: The minimum processor power consumption value acquisition sub-module is configured to acquire the minimum processor power consumption value among each to-be-tested processor power consumption value; The initial processor load determination sub-module is configured to determine the initial processor load according to the minimum processor power consumption value; The current power consumption value and current load determination sub-module is configured to adjust the initial processor load to make the processor reach the minimum processor power consumption value, and determine the minimum processor power consumption value as the current processor power consumption value, and determine the processor load when reaching the current processor power consumption value as the current processor load; The currently increased processor load acquisition sub-module is configured to increase the current processor load according to the processor load increase rate to obtain the currently increased processor load; The load adjustment sub-module is configured to adjust the currently increased processor load to make the processor reach the sum value of the current processor power consumption value and the preset power consumption gradient until the sum value reaches the maximum processor power consumption value among each to-be-tested processor power consumption value.
[0067] In a specific embodiment of the present application, the load adjustment sub-module may include: A judgment unit, configured to judge whether the sum value reaches the maximum processor power consumption value among the power consumption values of each processor to be tested; A return execution unit, 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 each processor to be tested, determine the sum value as the new current processor power consumption value, determine the processor load when reaching the minimum processor power consumption value as the current processor load, and return to execute the step of determining the processor load when reaching the current processor power consumption value as the current processor load; A measurement result determination unit, configured to, when it is determined that the sum value reaches the maximum processor power consumption value among the power consumption values of each processor to be tested, determine the measurement result according to the corresponding relationship between each current processor load and each current processor power consumption value.
[0068] In a specific embodiment of the present application, the device may further include: A fan speed acquisition module, configured to acquire the current fan speed after determining the processor load when reaching the minimum processor power consumption value as the current processor load; A recording module, configured 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 to execute the step of acquiring the current fan speed.
[0069] In a specific embodiment of the present application, the device may further include: A speed reduction module, configured to, when it is determined that the sum value reaches the maximum processor power consumption value among the power consumption values of each processor to be tested, acquire the current fan speed and reduce the current fan speed; A reading module, configured to read the processor temperature, the processor power consumption value, and the fan speed at a preset time interval; A first judgment module, configured to judge whether the system control processor is downclocked according to the read processor temperature; A return execution module, configured to, when it is determined according to the read processor temperature that the system control processor is not downclocked, return to execute the step of acquiring the current fan speed and reducing the current fan speed; A pre-downclock power consumption value and fan speed acquisition module, configured to, when it is determined according to the read processor temperature that the system control processor is downclocked, acquire the processor power consumption value and the fan speed before reducing the current fan speed.
[0070] In a specific embodiment of the present application, the device may further include: A second judgment module, configured to determine whether the processor power consumption value before the current fan speed is lowered reaches the maximum processor power consumption value among the processor power consumption values to be tested, after obtaining the processor power consumption value and the fan speed before the current fan speed is lowered; A heat dissipation control strategy adjustment module, configured to output a heat dissipation control strategy adjustment prompt message 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 processor power consumption values to be tested, so as to 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.
[0071] In a specific embodiment of the present application, the device may further include: A third judgment module, configured to determine whether the current processor loads and the current processor power consumption values satisfy a linear change rule according to the correspondence between the current processor loads and the current processor power consumption values, after determining the measurement result according to the correspondence between the current processor loads and the current processor power consumption values.
[0072] For the description of the features in the embodiments corresponding to the processor power consumption measurement device, reference may be made to the relevant description in the embodiments corresponding to the processor power consumption measurement method, which will not be elaborated here one by one.
[0073] An embodiment of the present application further provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the embodiments of the above-mentioned processor power consumption measurement method.
[0074] 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 in any one of the embodiments of the above-mentioned processor power consumption measurement method when running.
[0075] In an exemplary embodiment, the above-mentioned computer-readable storage medium may include, but is not limited to: various media such as a USB flash drive, a read-only memory (ROM for short), a random access memory (RAM for short), a mobile hard disk, a magnetic disk, or an optical disc that can store a computer program.
[0076] An embodiment of the present application further provides a computer program product. The above-mentioned computer program product includes a computer program, and the computer program realizes the steps in any one of the embodiments of the above-mentioned processor power consumption measurement method when executed by a processor.
[0077] Embodiments of the present application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps in any of the above embodiments of the processor power consumption measurement method are implemented.
[0078] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0079] The above has introduced in detail a method, apparatus, device, and readable storage medium for measuring processor power consumption provided by the present application. Specific examples are used herein to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the present application.
Claims
1. A method for measuring the power consumption of a processor, characterized in that Including: Determine the processor load increase rate according to a preset power consumption gradient; Obtain the power consumption values of each processor to be tested set according to the preset power consumption gradient; Perform processor power consumption measurement according to the power consumption values of each processor to be tested and the processor load increase rate, and obtain a measurement result; Determine the processor load and the maximum processor power consumption value corresponding to each power consumption value of the processor to be tested according to the measurement result.
2. The processor power consumption measurement method according to claim 1, wherein Performing processor power consumption measurement according to the power consumption values of each processor to be tested and the processor load increase rate includes: Obtain the minimum processor power consumption value among the power consumption values of each processor to be tested; Determine the initial processor load according to the minimum processor power consumption value; Adjust the initial processor load so that the processor reaches the 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 reaching the current processor power consumption value as the current processor load; Increase the current processor load according to the processor load increase rate to obtain the current increased processor load; Adjust the current increased processor load so that the processor reaches the sum value of the current processor power consumption value and the preset power consumption gradient until the sum value reaches the maximum processor power consumption value among the power consumption values of each processor to be tested.
3. The processor power consumption measurement method according to claim 2, characterized in that, Adjusting the current increased processor load so that the processor reaches the sum value of the current processor power consumption value and the preset power consumption gradient until the sum value reaches the maximum processor power consumption value among the power consumption values of each processor to be tested, and obtaining a measurement result includes: Judge whether the sum value reaches the maximum processor power consumption value among the power consumption values of each processor to be tested; If not, determine the sum value as the new current processor power consumption value, determine the processor load when reaching the minimum processor power consumption value as the current processor load, and return to execute the step of determining the processor load when reaching the current processor power consumption value as the current processor load; If so, determine the measurement result according to the corresponding relationship between each current processor load and each current processor power consumption value.
4. The processor power consumption measurement method according to claim 3, wherein After determining the processor load when reaching the minimum processor power consumption value as the current processor load, it further includes: Collect the current fan speed; Record the current processor power consumption value, the current processor load, and the current fan speed; Correspondingly, returning to execute the step of determining the processor load when reaching the current processor power consumption value as the current processor load includes: Return to execute the step of collecting the current fan speed.
5. The processor power consumption measurement method according to claim 3, wherein When it is determined that the sum value reaches the maximum processor power consumption value among the power consumption values of each processor to be tested, it further includes: Collect the current fan speed and lower the current fan speed; Read the processor temperature, the processor power consumption value, and the fan speed at preset time intervals; Judge whether the system control processor is downclocked according to the read processor temperature; If not, return to execute the step of collecting the current fan speed and lowering the current fan speed; If so, obtain the processor power consumption value and the fan speed before the current fan speed is reduced.
6. The processor power consumption measurement method according to claim 5, wherein After obtaining the processor power consumption value and the fan speed before the current fan speed is reduced, it further includes: Determine whether the processor power consumption value before the current fan speed is reduced reaches the maximum processor power consumption value among the processor power consumption values to be tested. If not, output a heat dissipation control strategy adjustment prompt message to 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 reduced.
7. The processor power consumption measurement method according to any one of claims 3 to 6, characterized in that After determining the measurement result according to the correspondence between each current processor load and each current processor power consumption value, it further includes: Judge whether each current processor load and each current processor power consumption value satisfy the linear change rule according to the correspondence between each current processor load and each current processor power consumption value.
8. A processor power consumption measurement device, characterized in that, It includes: A load increase rate determination module for determining the processor load increase rate according to a preset power consumption gradient. A power consumption value to be tested acquisition module for acquiring each processor power consumption value to be tested set according to the preset power consumption gradient. A measurement result acquisition module for performing processor power consumption measurement according to each processor power consumption value to be tested and the processor load increase rate to obtain a measurement result. A load and maximum power consumption value determination module for determining the processor load and the processor maximum power consumption value corresponding to each processor power consumption value to be tested according to the measurement result.
9. An electronic device, characterized in that, It includes: A memory for storing a computer program. A processor for implementing the steps of the processor power consumption measurement method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of the processor power consumption measurement method according to any one of claims 1 to 7 when executed by the processor.
Citation Information
Patent Citations
Method and device for detecting power consumption of internal equipment of server, equipment and storage medium
CN114329897A
Server power consumption control method and device, computer equipment and storage medium
CN116841378A
Load balancing method and device, electronic equipment and storage medium
CN118860662A
Priority determination of computer resources based on configured dynamic logic
US20210042162A1
Quantum dynamic network sever load management system
US20230306296A1