Power measurement system, method, storage medium and program product
By setting resistance on each power rail of the CPU and collecting voltage and current data, the problem of inaccurate CPU power calculation in the prior art is solved, and accurate measurement of the total CPU power is achieved.
Patent Information
- Application Number
- CN202411150093.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-08-21
AI Technical Summary
In the prior art, CPU power calculation is inaccurate, and only the power of the core power rail is considered, resulting in the final determined CPU power inaccurate.
By setting the resistor on each power rail, the sampler collects the voltage value of the resistor and the potential value of the central processor, calculates the current value and voltage value on the power rail, and calculates the total power value of the central processor using the power processor.
Ensures accurate calculation of all power values of power of the power of the power of the power of the power of the CPU is improved.
Smart Images

Figure CN118672862B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a power measurement system, method, storage medium and program product. Background Art
[0002] In today's big data era, the central processing unit (CPU), as the brain of computer devices, undertakes core responsibilities such as interpreting instructions, executing computing tasks, and coordinating system resources. Its performance directly affects the computing speed, responsiveness, and energy efficiency of the entire computer device.
[0003] The performance of the CPU is limited by its own power threshold. That is, when the CPU determines that its own power reaches the power threshold, it will reduce the power by reducing the frequency. However, after the CPU frequency is reduced, the computer equipment will run slower. The current way to detect CPU power is generally that the voltage regulator (Voltage Regulator Module) collects the voltage and current information on the core power rail and sends it to the CPU. Then, the CPU calculates the power based on the collected voltage and current information.
[0004] However, in the related art, only the power of the core power rail is calculated, so that the CPU power finally determined is inaccurate. Summary of the invention
[0005] In view of this, the present invention provides a power measurement system, method, storage medium and program product to solve the problem of inaccurate calculation of CPU power value.
[0006] In a first aspect, the present invention provides a power measurement system, the power measurement system comprising a central processing unit, at least one power supply, a visual monitoring device, at least one sampler and at least one resistor, the visual monitoring device comprising a power processor, the central processing unit and each of the power supplies are electrically connected to form a power rail corresponding to each of the power supplies, and each of the power rails is provided with one of the resistors;
[0007] The power processor is used to send a sampling control instruction to each of the samplers in a current polling cycle;
[0008] The sampler is used to collect voltage data from a target power rail corresponding to the sampling control instruction when receiving the sampling control instruction, wherein the voltage data includes a first potential value, a second potential value, and a third potential value; obtain the resistance value of a target resistor distributed on the target power rail; determine a current value corresponding to the target power rail according to the first potential value, the second potential value, and the resistance value of the target resistor; determine a voltage value corresponding to the target power rail according to the third potential value and a preset potential value; send the current value and voltage value corresponding to the target power rail to the power processor, wherein the first potential value is the potential value of a first end of the target resistor, the second potential value is the potential value of a second end of the target resistor, and the third potential value is the potential value of the central processor on the target power rail;
[0009] The power processor is further used to determine the power value corresponding to the target power rail based on the current value and voltage value corresponding to the target power rail; and determine the total power value of the central processor in the current polling cycle based on the power value corresponding to each of the power rails.
[0010] The power measurement system provided by the present invention has the following advantages:
[0011] By setting a resistor on each power rail, the sampler can collect the voltage value of the resistor and the potential value of the central processor, and then calculate the current value on the power rail through the voltage value and resistance value of the resistor, and determine the voltage value corresponding to the power rail according to the potential value of the central processor. Finally, the sampler sends the calculated voltage value and current value of the power rail to the power processor, and the power processor calculates the total power value of the central processor. In this way, the corresponding power value can be calculated for each power rail, so that the final determined total power value takes into account the power values of all power rails, which is more in line with actual requests and more accurate.
[0012] In an optional implementation, when the number of the sampler is one, the sampler includes at least one switch, and the sampler is electrically connected to each of the power rails respectively;
[0013] The sampler is specifically used for:
[0014] Parsing the sampling control instruction to obtain identification information of the target power rail;
[0015] Determining, according to the identification information of the target power rail, a target switch corresponding to the target power rail in at least one of the switches;
[0016] The target switch is adjusted to a target state to collect voltage data of the target power rail.
[0017] Specifically, in the case of only one sampler, limited hardware resources can be effectively utilized by switching.
[0018] In an optional implementation, when there are multiple samplers, the number of the samplers is the same as the number of the power rails, and each of the samplers is electrically connected to one of the power rails;
[0019] Target samplers, specifically for:
[0020] The voltage data is collected from a power rail connected to the target sampler, wherein the target sampler is a sampler that receives the sampling control instruction.
[0021] Specifically, each power rail has a dedicated sampler that can independently and accurately collect voltage data on the power rail. In addition, the sampler for each power rail is independent, which facilitates troubleshooting and maintenance.
[0022] In an optional embodiment, the sampler includes a first interface and a second interface;
[0023] The first end of the first resistor is electrically connected to the first power supply and the first interface of the first sampler respectively, wherein the first resistor is a resistor on the first power rail among at least one of the resistors, the first power rail is any power rail, the first power supply is a power supply on the first power rail among at least one of the power supplies, and the first sampler is a sampler connected to the first power rail among at least one of the samplers;
[0024] The second end of the first resistor is electrically connected to the second interface of the central processing unit and the first sampler respectively;
[0025] The sampler is specifically used for:
[0026] The first potential value is collected from its own first interface, and the second potential value is collected from its own second interface.
[0027] Specifically, each power rail has a dedicated sampler that can independently and accurately collect voltage data on that power rail.
[0028] In an optional implementation, each of the samplers is electrically connected to the power processor via the same I2C bus;
[0029] The power processor is specifically used for:
[0030] In the current polling cycle, obtaining a sampling order corresponding to each of the samplers;
[0031] According to the sampling order corresponding to each of the samplers, the sampling control instruction is sent to each of the samplers in sequence, wherein after receiving the voltage value and current value fed back by a sampler, the sampling control instruction is sent to another sampler, until the voltage value and current value fed back by all the samplers are received, it is determined that the collection operation of the current polling cycle is completed.
[0032] Specifically, all samplers share the same I2C bus, and the power processor sends sampling control instructions to the samplers one by one according to the sampling order. This design improves the accuracy and efficiency of power management, simplifies hardware layout, and reduces costs.
[0033] In an optional embodiment, the visual monitoring device further includes a display module;
[0034] The sampler is also used for:
[0035] while sending the voltage value and the current value corresponding to the target power rail, sending the communication address of the sampler to the power processor;
[0036] The power processor is further used for:
[0037] Determine, according to the communication address of the sampler, identification information of a target power rail corresponding to the communication address of the sampler;
[0038] Generate a data table corresponding to the current polling cycle according to the identification information of each power rail, the voltage value, current value and power value corresponding to each power rail, and the total power value of the central processor in the current polling cycle;
[0039] Sending a data table corresponding to the current polling cycle to a display module;
[0040] The display module is used to display the data table corresponding to the current polling cycle.
[0041] Specifically, each sampler sends its own communication address while sending voltage and current values, which enables the power processor to identify the target power rail corresponding to each sampler and accurately associate data with the power rail. In addition, the real-time display of the data table allows technicians to understand the power situation of each power rail in a timely manner so that related problems can be solved in a timely manner.
[0042] In an optional implementation manner, the power processor is further used for:
[0043] Determine whether the total power value of the central processor in the current polling cycle is within a preset range;
[0044] When it is determined that the total power value of the central processor in the current polling cycle is within the preset range, setting the target parameter of the current polling cycle to a first preset threshold value;
[0045] or,
[0046] When it is determined that the total power value of the central processor in the current polling cycle is not within the preset range, setting the target parameter of the current polling cycle to a second preset threshold;
[0047] Starting from the current polling cycle, after executing the acquisition operation of multiple consecutive polling cycles, when it is determined that the target parameter of each of the multiple polling cycles is the second preset threshold, sending a first alarm prompt information to the display module, wherein the first alarm prompt information is used to indicate that the power measurement system has a fault;
[0048] The display module is also used to display the first alarm prompt information.
[0049] Specifically, if the total power value of multiple consecutive polling cycles exceeds the preset range, it is considered that the power measurement system may be faulty. In addition, through clear alarm prompt information, technicians can quickly locate the problem and shorten the troubleshooting time.
[0050] In an optional implementation, the power measurement system further includes a voltage regulator;
[0051] The power processor is further used for:
[0052] When an analysis instruction is obtained, power logs corresponding to the central processing unit at multiple times are obtained from the voltage regulator, wherein the analysis instruction includes a target time, the target time is the time when the total power value of the central processing unit is calculated in the current polling cycle, and the power log includes a voltage value and a current value corresponding to at least one power rail;
[0053] According to the target time, selecting a target power log matching the target time from power logs corresponding to the central processor at multiple times;
[0054] According to the target power log and a data table corresponding to the current polling cycle, it is determined whether the communication between the central processing unit and the voltage regulator is abnormal.
[0055] Specifically, by acquiring power logs corresponding to the central processor at multiple times from the voltage regulator and selecting a target power log matching the target time, the abnormal situation can be accurately detected.
[0056] In an optional implementation manner, the power processor is specifically used to:
[0057] According to each power rail in the target power log, selecting a standard voltage value and a standard current value corresponding to each power rail in the target power log from a data table corresponding to the current polling cycle;
[0058] Determine a voltage difference value corresponding to each power rail in the target power log according to a voltage value corresponding to each power rail in the target power log and a standard voltage value;
[0059] Determine a current difference value corresponding to each power rail in the target power log according to the current value corresponding to each power rail in the target power log and the standard current value;
[0060] determining whether there is a problem with a second power rail according to a voltage difference value and a current difference value corresponding to the second power rail, wherein the second power rail is any power rail of at least one power rail included in the target power log;
[0061] When it is determined that there is a problem with any power rail in the target power log, it is determined that the communication between the central processing unit and the voltage regulator is abnormal.
[0062] Specifically, by calculating the voltage difference value and the current difference value to determine whether there is a problem with any power rail in the target power log, and then judging whether there is an abnormality in the communication between the central processing unit and the voltage regulator, the problem can be accurately located, improving the troubleshooting efficiency.
[0063] In an optional implementation manner, the power processor is further used for:
[0064] Acquiring a storage mode of the power processor;
[0065] When it is determined that the storage mode of the power processor is local storage, determining whether a presence signal of a storage device is detected;
[0066] After detecting the presence signal of the storage device, obtaining the remaining storage space of the storage device and the amount of data in the data table corresponding to the current polling cycle;
[0067] Determining whether to perform a data write operation according to the remaining storage space of the storage device and the amount of data in the data table corresponding to the current polling cycle;
[0068] When it is determined to execute the data write operation, the amount of data in the data table corresponding to the current polling cycle is written into the storage device.
[0069] Specifically, by detecting the presence signal of the storage device, it can be ensured that the data write operation is performed only when the storage device is available, and data loss caused by the storage device being disconnected can be avoided. In addition, by obtaining the remaining storage space of the storage device and the amount of data in the current data table, it can be determined whether to perform the data write operation, and data overflow or loss caused by insufficient space can be avoided.
[0070] In an optional implementation manner, the power processor is further used for:
[0071] When it is determined that the storage mode of the power processor is cloud storage, detecting whether the network communication of the power processor is normal;
[0072] When the network communication of the power processor is normal, acquiring the address information of the target cloud platform;
[0073] Determining whether the cloud platform address configuration of the power processor is correct according to the address information of the target cloud platform;
[0074] When it is determined that the cloud platform address configuration of the power processor is correct, the data table corresponding to the current polling cycle is sent to the target cloud platform for storage.
[0075] Specifically, the data table of each polling cycle is stored in the target cloud platform, so that the technicians can download the data from the target cloud platform when performing data analysis on the cause of the failure, which is more convenient.
[0076] In an optional implementation manner, the power calculation module is further used to:
[0077] Get time setting information;
[0078] Determining whether there is a problem with the time setting information according to the time setting information and the preset time configuration rule;
[0079] When it is determined that there is a problem with the time setting information, generating a second alarm prompt information and sending it to the display module;
[0080] The display module is also used to display the second alarm prompt information.
[0081] Specifically, by ensuring the accuracy of the time setting information, the overall reliability of the system can be improved. In particular, various analysis operations in this solution rely on accurate timestamps, and the verification of the time setting information can make the analysis operations more accurate.
[0082] In a second aspect, the present invention provides a power measurement method, which is applied to the power measurement system as described in the first aspect, wherein the power measurement system includes a central processor, at least one power supply, a visual monitoring device, at least one sampler and at least one resistor, wherein the visual monitoring device includes a power processor, wherein the central processor is electrically connected to each of the power supplies to form a power rail corresponding to each of the power supplies, and each of the power rails is provided with one of the resistors, wherein the method includes:
[0083] The power processor sends a sampling control instruction to each of the samplers in a current polling cycle;
[0084] When receiving the sampling control instruction, the sampler collects voltage data from the target power rail corresponding to the sampling control instruction, wherein the voltage data includes a first potential value, a second potential value, and a third potential value; obtains the resistance value of the target resistor distributed on the target power rail; determines the current value corresponding to the target power rail according to the first potential value, the second potential value, and the resistance value of the target resistor; determines the voltage value corresponding to the target power rail according to the third potential value and a preset potential value; sends the current value and voltage value corresponding to the target power rail to the power processor, wherein the first potential value is the potential value of the first end of the target resistor, the second potential value is the potential value of the second end of the target resistor, and the third potential value is the potential value of the central processor on the target power rail;
[0085] The power processor determines the power value corresponding to the target power rail according to the current value and voltage value corresponding to the target power rail; and determines the total power value of the central processor in the current polling cycle according to the power value corresponding to each of the power rails.
[0086] In a third aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the power measurement method of the first aspect or any corresponding embodiment thereof.
[0087] In a fourth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the power measurement method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0088] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0089] Figure 1 is a schematic structural diagram of a power measurement system according to an embodiment of the present invention;
[0090] Figure 2 is a schematic structural diagram of another power measurement system according to an embodiment of the present invention;
[0091] Figure 3 is a circuit diagram of a power measurement system according to an embodiment of the present invention;
[0092] Figure 4 is a schematic diagram of a display data table according to an embodiment of the present invention;
[0093] Figure 5 is a schematic diagram of a process for warning a power measurement system failure according to an embodiment of the present invention;
[0094] Figure 6 is a schematic diagram of another display data table according to an embodiment of the present invention;
[0095] Figure 7 is a schematic diagram of a process of storing data according to an embodiment of the present invention;
[0096] Figure 8 is a schematic diagram of a flow chart of time correction according to an embodiment of the present invention;
[0097] Fig. 9 4 is a flow chart of a power measurement method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0098] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0099] The embodiment of the present invention provides a power measurement system, which monitors the voltage and current values on each power rail by adding a sampler and a resistor, and determines the total power value of the central processing unit through a power processor, so that the calculated total power value conforms to the actual situation and is more accurate.
[0100] The power measurement system may include a central processing unit (CPU) 10, at least one power supply 20, a visual monitoring device 30, at least one sampler 40, and at least one resistor 50. The power measurement system may be applied to a storage array, a notebook computer, a server, and the like.
[0101] The visual monitoring device 30 may include a power processor 301, a central processor 10 and each power supply 20 are electrically connected to form a power rail corresponding to each power supply 20, and each power rail is provided with a resistor 50. The power rail may be a PVCCIN (Processor Voltage Core Core Input) power rail, a PVNN_PCH (Processor Voltage Non-North_PCH) power rail, a P1V8 (Processor 1.8V) power rail, a P1V05 (Processor 1.05V) power rail, a P3V3_AUX power rail, etc.
[0102] The power processor 301 is used to:
[0103] In the current polling cycle, a sampling control instruction is sent to each sampler 40 respectively.
[0104] The sampler 40 is used to:
[0105] When receiving the sampling control instruction, voltage data is collected from the target power rail corresponding to the sampling control instruction. The resistance value of the target resistor 50 distributed on the target power rail is obtained. According to the first potential value, the second potential value and the resistance value of the target resistor 50, the current value corresponding to the target power rail is determined. According to the third potential value and the preset potential value, the voltage value corresponding to the target power rail is determined. The current value and the voltage value corresponding to the target power rail are sent to the power processor 301.
[0106] The power processor 301 is used to:
[0107] According to the current value and voltage value corresponding to the target power rail, the power value corresponding to the target power rail is determined. According to the power value corresponding to each power rail, the total power value of the central processor 10 in the current polling cycle is determined.
[0108] The voltage data may include a first potential value, a second potential value, and a third potential value. The first potential value may be the potential value of the first end of the target resistor 50, the second potential value may be the potential value of the second end of the target resistor 50, and the third potential value may be the potential value of the CPU 10 end on the target power rail. The preset potential value is a ground potential value, which may be 0.
[0109] Specifically, the number of the samplers 40 may be one or more. Figure 1 As shown, when the number of samplers 40 is one, the sampler 40 may include at least one switch and multiple interfaces. The multiple interfaces may include a first type interface, a second type interface, and a third type interface. The first type interface is used to connect the first end of the resistor 50, the second type interface is used to connect the second end of the resistor 50, and the third type interface is used to connect the central processor 10. The number of switches may be the same as the number of power rails (power supply 20 or resistor 50). Accordingly, the sampler 40 may be electrically connected to each power rail, as shown below. Figure 1 Taking the first power rail (which can be any power rail) in the example, the specific connection method between the sampler 40 and the power rail is described:
[0110] The resistor 50 in the first power rail may be referred to as a first resistor 50, and the power source 20 in the first power rail may be referred to as a first power source 20. The first end of the first resistor 50 (eg, Figure 1 A1 or A2 in the figure) is electrically connected to the first power supply 20, and is electrically connected to an interface corresponding to the first power rail in the first type interface of the first sampler 40. The second end of the first resistor 50 (for example, Figure 1 B1 or B2 in the figure) can be electrically connected to the central processor 10, and to the interface corresponding to the first power rail in the second type interface of the first sampler 40. The central processor 10 is connected to the load end of the first power supply 20 (for example, Figure 1 C1 or C2 in the first sampler 40 is electrically connected to an interface in the third type of interface in the first sampler 40 corresponding to the first power rail, and is electrically connected to one interface in the third type of interface in the first sampler 40.
[0111] The sampler 40 may be directly electrically connected to the visualization monitoring device 30 . More specifically, the sampler 40 may be electrically connected to the power processor 301 in the visualization monitoring device 30 .
[0112] Accordingly, after receiving the power-on signal (Ready) from the central processor 10, the power processor 301 can periodically send a sampling control instruction to the sampler 40. The sampler 40 stores the correspondence between the identification information of the power rail and the identification information of the switch. Accordingly, after receiving the sampling control instruction, the sampler 40 can parse the sampling control instruction to obtain the identification information of the target power rail. Further, the sampler 40 determines the identification information of the target switch corresponding to the identification information of the target power rail in the above-mentioned correspondence according to the identification information of the target power rail, that is, determines the target switch. Finally, the sampler 40 can adjust the target switch to the target state so as to open the corresponding link, collect the first potential value through the interface corresponding to the target power rail in the first type of interface, collect the second potential value through the interface corresponding to the target power rail in the second type of interface, and collect the third potential value through the interface corresponding to the target power rail in the third type of interface.
[0113] In order to avoid excessive working pressure of the power processor 301, the sampler 40 can first calculate the current value and the voltage value, that is, calculate the difference between the first potential value and the second potential value to obtain the voltage value across the target resistor 50, and further calculate the ratio between the voltage value across the target resistor 50 and the resistance value of the target resistor 50 to obtain the current value of the target power rail. At the same time, the sampler 40 can also calculate the difference between the third potential value and the preset potential value to obtain the voltage value of the target power rail, or, when the preset potential value is the ground potential value, directly determine the third potential value as the voltage value of the target power rail.
[0114] When the number of samplers 40 is multiple, such as Figure 2 As shown, each sampler 40 may include a first interface, a second interface, and a third interface. Taking the first power rail as an example, the first end of the first resistor 50 (eg, Figure 2 A1 or A2 in the figure) can be electrically connected to the first power supply 20 and the first interface of the first sampler 40 respectively. The second end of the first resistor 50 (for example, Figure 2 B1 or B2 in the figure) can be electrically connected to the central processor 10 and the second interface of the first sampler 40 respectively. The third interface of the sampler 40 (for example, Figure 2 C1 or C2) is electrically connected to the central processing unit 10.
[0115] In some optional implementations, each sampler 40 may be electrically connected to the power processor 301 via the same I2C bus, such as Figure 3As shown in the circuit structure of the power measurement system in FIG, the I2C bus includes a serial data line (SDA) and a serial clock line (SCL), wherein SDA is used to transmit data, such as the above-mentioned sampling control instructions, the voltage value and current value of the power rail, etc., and SCL is used to transmit the clock signal. PVCCIN_CPU can be used to represent the load end connected to the PVCCIN power supply 20 in the central processor 10, and P3V3_AUX_CPU is used to represent the load end connected to the P3V3_AUX power supply 20 in the central processor 10. IN- represents the second interface, IN+ represents the first interface, VBUS represents the third interface, and R shunt Indicates resistance 50, U 1 represents the potential value of the first end of the resistor 50, U 2 represents the potential value of the second end of the resistor 50, U ’ 1 represents the actual potential value of the first end of the resistor 50, U ’ 2 represents the actual potential value of the second end of the resistor 50. By transmitting the voltage signal across the resistor 50 to the sampler 40 in the form of a Calvin trace, the sampling error can be reduced.
[0116] Accordingly, after receiving the power-on signal from the central processor 10, the power processor 301 can obtain the sampling sequence corresponding to each sampler 40 in each polling cycle (hereinafter, the current polling cycle is used as an example for explanation). According to the sampling sequence corresponding to each sampler 40, the power processor 301 sends a sampling control instruction to each sampler 40 in sequence. After receiving the voltage value and current value fed back by a sampler 40, the power processor 301 sends a sampling control instruction to another sampler 40, until the power processor 301 receives the voltage value and current value fed back by all the samplers 40, it determines that the collection operation of the current polling cycle is completed, and starts the data collection operation of the next polling cycle.
[0117] The power measurement system provided in this embodiment sets a resistor 50 on each power rail, so that the sampler 40 can collect the voltage value of the resistor 50 and the potential value of the central processing unit 10, and then calculate the current value on the power rail through the voltage value and resistance value of the resistor 50, and determine the voltage value corresponding to the power rail according to the potential value of the central processing unit 10. Finally, the sampler 40 sends the calculated voltage value and current value of the power rail to the power processor 301, and the power processor 301 calculates the total power value of the central processing unit 10. In this way, the corresponding power value can be calculated for each power rail, so that the total power value finally determined takes into account the power values of all power rails, which is more in line with actual requests and more accurate.
[0118] In some optional implementations, the above-mentioned visual monitoring device 30 may further include a display module, which may be an external display or a terminal that establishes a communication connection with the power processor 301. Accordingly, the power measurement system may further implement the following functions:
[0119] First, display the data collected in each polling cycle.
[0120] While sending the voltage value and current value corresponding to the target power rail, the sampler 40 may also send its own communication address to the power processor 301. The power processor 301 may determine the identification information of the target power rail corresponding to the communication address of the sampler 40 based on the communication address of the sampler 40. The identification information of the target power rail may be the name of the target power rail. Then, the power processor 301 may generate a data table corresponding to the current polling cycle based on the identification information of each power rail, the voltage value, current value and power value corresponding to each power rail, and the total power value of the central processor 10 in the current polling cycle, and send it to the display module. The display module is used to display the data table corresponding to the current polling cycle, such as Figure 4 The display module can display the time when the total power value of the central processing unit 10 is calculated in the current polling cycle, which can be specifically "XXXX year XX month XX day XX hour XX minute XX second".
[0121] Second, it warns of a power measurement system failure.
[0122] like Figure 5 As shown, the power processor 301 can determine whether the total power value of the central processor 10 in the current polling cycle is within a preset range. When it is determined that the total power value of the central processor 10 in the current polling cycle is within the preset range, the target parameter of the current polling cycle is set to the first preset threshold. Alternatively, when it is determined that the total power value of the central processor 10 in the current polling cycle is not within the preset range, the target parameter of the current polling cycle is set to the second preset threshold. Starting from the current polling cycle, after performing the acquisition operation of multiple consecutive polling cycles, when it is determined that the target parameter of each polling cycle in the multiple polling cycles is the second preset threshold, the first alarm prompt information is sent to the display module. Among them, the first alarm prompt information is used to indicate that the power measurement system has a fault. When the display module receives the first alarm prompt information, it can be displayed. When the target parameter of any polling cycle in the multiple polling cycles is not the second preset threshold, a data table can be generated in the above manner and sent to the display module for display.
[0123] Third, analyzing whether the communication between the central processing unit 10 and the voltage regulator is abnormal. Accordingly, the power measurement system may further include a voltage regulator (Voltage Regulator Module, VRM).
[0124] like Figure 6 As shown, when the display module displays the data table corresponding to each polling cycle, it can also display a time calibration button, a data storage button and a data comparison button. The technician can click the data comparison button on the display module. Accordingly, after detecting the click operation, the display module can generate an analysis instruction and transmit it to the power processor 301. When the power processor 301 obtains the analysis instruction, the power logs corresponding to the central processor 10 at multiple times can be obtained from the voltage regulator. Among them, the analysis instruction includes a target time, which is the time when the total power value of the central processor 10 is calculated in the current polling cycle, and the power log includes the voltage value and current value corresponding to at least one power rail. According to the target time, the target power log matching the target time is selected from the power logs corresponding to the central processor 10 at multiple times. According to the target power log and the data table corresponding to the current polling cycle, it is determined whether the communication between the central processor 10 and the voltage regulator is abnormal.
[0125] The power processor 301 may perform the following specific steps to determine whether the communication between the central processor 10 and the voltage regulator is abnormal:
[0126] Step 1: According to each power rail in the target power log, select a standard voltage value and a standard current value corresponding to each power rail in the target power log from a data table corresponding to the current polling cycle.
[0127] Step 2: Determine the voltage difference value corresponding to each power rail in the target power log according to the voltage value corresponding to each power rail in the target power log and the standard voltage value.
[0128] Step three, according to the current value corresponding to each power rail in the target power log and the standard current value, determine the current difference value corresponding to each power rail in the target power log.
[0129] Step 4: Determine whether there is a problem with the second power rail according to the voltage difference value and the current difference value corresponding to the second power rail.
[0130] The second power rail may be any power rail of at least one power rail included in the target power log.
[0131] Step 5: When it is determined that there is a problem with any power rail in the target power log, it is determined that the communication between the central processor 10 and the voltage regulator is abnormal.
[0132] In some optional implementations, since the data formats of the moments in the power log and the moments in the data table are different, the data formats of the moments in the power log and the moments in the data table may be unified before performing the matching operation.
[0133] In some optional implementations, according to the target time, a target power log matching the target time is selected from the power logs corresponding to the central processor 10 at multiple times. It can be determined whether there is a power log that is completely consistent with the year, month, day, hour, minute, and second included in the target time. If so, the power log can be determined as the target power log. If not, it can be determined whether there is at least one candidate power log that is completely consistent with the year, month, day, hour, and minute included in the target time. If so, the most urgent candidate power log for the target time can be selected from the at least one candidate power log as the target power log.
[0134] Fourth, store data.
[0135] Technicians can also click Figure 6 The display module can detect the technician's click operation and generate a corresponding storage instruction, which is transmitted to the power processor 301. Accordingly, when the power memory receives the storage instruction, it can execute the following steps: Figure 7 Steps shown:
[0136] Step 1: Obtain the storage mode of the power processor 301.
[0137] Step 2: When it is determined that the storage mode of the power processor 301 is local storage, it is determined whether a presence signal of the storage device is detected.
[0138] The storage device may be a disk, a USB flash drive, or the like.
[0139] Step three: when the storage device presence signal is not detected, a third alarm prompt message is sent to the display module.
[0140] Step 4: After the presence signal of the storage device is detected, the remaining storage space of the storage device and the amount of data in the data table corresponding to the current polling cycle are obtained.
[0141] Step 5: Determine whether to perform a data write operation based on the remaining storage space of the storage device and the amount of data in the data table corresponding to the current polling cycle.
[0142] Step six: when it is determined to execute the data write operation, the amount of data in the data table corresponding to the current polling cycle is written into the storage device.
[0143] Step seven: when it is determined that the data writing operation is not to be performed, a fourth warning prompt information is sent to the display module.
[0144] The fourth warning prompt information is used to indicate that the capacity of the storage device is insufficient.
[0145] Step eight, when it is determined that the storage mode of the power processor 301 is cloud storage, check whether the network communication of the power processor 301 is normal.
[0146] Step nine: when the network communication of the power processor 301 is normal, a fifth alarm prompt message is sent to the display module.
[0147] Step ten: when the network communication of the power processor 301 is normal, obtain the address information of the target cloud platform.
[0148] Step eleven: determine whether the cloud platform address configuration of the power processor 301 is correct based on the address information of the target cloud platform.
[0149] Step 12: When it is determined that the cloud platform address configuration of the power processor 301 is correct, the data table corresponding to the current polling cycle is sent to the target cloud platform for storage.
[0150] Step thirteen: when it is determined that the cloud platform address configuration of the power processor 301 is incorrect, a sixth alarm prompt message is sent to the display module.
[0151] Fifth, time correction.
[0152] Technicians can click Figure 6 The display module can detect the technician's click operation and generate a corresponding time calibration instruction, which is transmitted to the power processor 301. Accordingly, when the power memory receives the time calibration instruction, it can execute the following operations: Figure 8 Steps shown:
[0153] Step 1: parse the time calibration instruction to obtain time setting information.
[0154] The time setting information may include “XXXX year XX month XX day XX hour XX minute XX second” set by the technician.
[0155] Step 2: Determine whether there is a problem with the time setting information according to the time setting information and the preset time rule.
[0156] The power processor 301 can make judgments according to year, month, day, hour, minute and second, that is, whether the year input by the technician is less than or equal to the current year, whether the month is between "1-12", whether the date is between "1-31", whether the hour is between "1-24", whether the minute is between "1-60", and whether the second is between "1-60". If the above judgment result is "no", the second alarm prompt information can be sent to the display module, which is displayed by the display module. If all the above judgment results are "yes", the next step of judgment can be performed, that is, if the month is "1, 3, 4, 7, 8, 10, 12", determine whether the date is between "1-31", if the month is "5, 6, 9, 11", determine whether the date is between "1-30", if the year is an integer multiple of 4 and the month is "2", determine whether the date is between "1-29", if the year is not an integer multiple of 4 and the month is "2", determine whether the date is between "1-28". If yes, it can be determined that August 8, 2024 14:35:56 is set correctly, and the time setting operation is performed according to the time setting information, and the display module displays it. If not, the second alarm prompt information can be sent to the display module, and the display module displays the second alarm prompt information.
[0157] In some optional embodiments, the above-mentioned visual monitoring device 30 can be configured with a clock (Real-Time Clock, RTL). Since the RTL is powered by a battery, in order to prevent the phenomenon of disordered timestamp sending due to failure to replace the battery in time after the battery is exhausted, the visual monitoring device 30 can be provided with a time detection function, that is, when the power processor 301 detects that the time has stopped, it sends the seventh alarm prompt information to the display module.
[0158] In some optional implementations, the power processor 301 can send the calculated total power value of the central processor 10 in the current polling cycle (referred to as the first total power value) to the central processor 10, and the central processor 10 can compare the first total power value with the latest total power value (the second total power value) received from the VRM module. Since the VRM module considers only the core power rail when measuring the second total power value, if the first total power value is less than or equal to the second total power value, it means that the VRM module may detect an error, and the central processor 10 can first perform corresponding processing based on the first total power value, that is, determine whether the first total power value is greater than the preset power threshold. If so, a frequency reduction operation can be performed. In this way, the central processor 10 can correctly perform the frequency reduction operation without having to perform the frequency reduction operation according to the second total power value in an error situation, which affects the execution of the task by the central processor 10.
[0159] According to an embodiment of the present invention, a power measurement method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0160] In this embodiment, a power measurement method is provided, which can be used in the above-mentioned power measurement system. Fig. 9 is a flow chart of a power measurement method according to an embodiment of the present invention. Fig. 9 As shown, the process includes the following steps:
[0161] Step S901 : the power processor 301 sends a sampling control instruction to each sampler 40 in the current polling cycle.
[0162] Step S902 : when receiving the sampling control instruction, the sampler 40 collects voltage data from the target power rail corresponding to the sampling control instruction.
[0163] The voltage data includes a first potential value, a second potential value and a third potential value. The resistance value of the target resistor 50 distributed on the target power rail is obtained.
[0164] In step S903 , the sampler 40 determines a current value corresponding to the target power rail according to the first potential value, the second potential value and the resistance value of the target resistor 50 .
[0165] In step S904 , the sampler 40 determines a voltage value corresponding to the target power rail according to the third potential value and the preset potential value.
[0166] In step S905 , the sampler 40 sends the current value and the voltage value corresponding to the target power rail to the power processor 301 .
[0167] The first potential value is the potential value of the first end of the target resistor 50 , the second potential value is the potential value of the second end of the target resistor 50 , and the third potential value is the potential value of the CPU 10 on the target power rail.
[0168] Step S906 : the power processor 301 determines a power value corresponding to the target power rail according to the current value and the voltage value corresponding to the target power rail.
[0169] Step S907 : the power processor 301 determines the total power value of the CPU 10 in the current polling cycle according to the power value corresponding to each power rail.
[0170] The specific processing of step S901 to step S907 can refer to the above description and will not be repeated here.
[0171] The power measurement method provided in this embodiment sets a resistor 50 on each power rail, so that the sampler 40 can collect the voltage value of the resistor 50 and the potential value of the central processing unit 10, and then calculate the current value on the power rail through the voltage value and resistance value of the resistor 50, and determine the voltage value corresponding to the power rail according to the potential value of the central processing unit 10. Finally, the sampler 40 sends the calculated voltage value and current value of the power rail to the power processor 301, and the power processor 301 calculates the total power value of the central processing unit 10. In this way, the corresponding power value can be calculated for each power rail, so that the total power value finally determined takes into account the power values of all power rails, which is more in line with actual requests and more accurate.
[0172] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0173] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0174] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A power measurement system, characterized in that: The power measurement system includes a central processor, at least one power supply, a visual monitoring device, at least one sampler and at least one resistor, wherein the visual monitoring device includes a power processor, the central processor is electrically connected to each of the power supplies to form a power rail corresponding to each of the power supplies, and each of the power rails is provided with one of the resistors; when there are multiple samplers, the number of the samplers is the same as the number of the power rails, and each of the samplers is electrically connected to one of the power rails; The power processor is used to send a sampling control instruction to each of the samplers in a current polling cycle; The sampler is used to collect voltage data from a target power rail connected to itself when the number of the samplers is multiple and the sampling control instruction is received, wherein the voltage data includes a first potential value, a second potential value and a third potential value; obtain the resistance value of a target resistor distributed on the target power rail; determine a current value corresponding to the target power rail according to the first potential value, the second potential value and the resistance value of the target resistor; determine a voltage value corresponding to the target power rail according to the third potential value and a preset potential value; send the current value and voltage value corresponding to the target power rail to the power processor, wherein the first potential value is the potential value of the first end of the target resistor, the second potential value is the potential value of the second end of the target resistor, and the third potential value is the potential value of the central processor on the target power rail; The power processor is further used to determine the power value corresponding to the target power rail based on the current value and voltage value corresponding to the target power rail; and determine the total power value of the central processor in the current polling cycle based on the power value corresponding to each of the power rails.
2. The power measurement system according to claim 1, characterized in that: When the number of the sampler is one, the sampler includes at least one switch, and the sampler is electrically connected to each of the power rails respectively; The sampler is specifically used for: Parsing the sampling control instruction to obtain identification information of the target power rail; Determining, according to the identification information of the target power rail, a target switch corresponding to the target power rail in at least one of the switches; The target switch is adjusted to a target state to collect voltage data of the target power rail.
3. The power measurement system according to claim 1, characterized in that: The sampler comprises a first interface and a second interface; The first end of the first resistor is electrically connected to the first power supply and the first interface of the first sampler respectively, wherein the first resistor is a resistor on the first power rail among at least one of the resistors, the first power rail is any power rail, the first power supply is a power supply on the first power rail among at least one of the power supplies, and the first sampler is a sampler connected to the first power rail among at least one of the samplers; The second end of the first resistor is electrically connected to the second interface of the central processing unit and the first sampler respectively; The sampler is specifically used for: The first potential value is collected from its own first interface, and the second potential value is collected from its own second interface.
4. The power measurement system according to claim 1, characterized in that: Each of the samplers is electrically connected to the power processor via the same I2C bus; The power processor is specifically used for: In the current polling cycle, obtaining a sampling order corresponding to each of the samplers; According to the sampling order corresponding to each of the samplers, the sampling control instruction is sent to each of the samplers in sequence, wherein after receiving the voltage value and current value fed back by a sampler, the sampling control instruction is sent to another sampler, until the voltage value and current value fed back by all the samplers are received, it is determined that the collection operation of the current polling cycle is completed.
5. The power measurement system according to claim 1, characterized in that: The visual monitoring device also includes a display module; The sampler is also used for: while sending the voltage value and the current value corresponding to the target power rail, sending the communication address of the sampler to the power processor; The power processor is further used for: Determine, according to the communication address of the sampler, identification information of a target power rail corresponding to the communication address of the sampler; Generate a data table corresponding to the current polling cycle according to the identification information of each power rail, the voltage value, current value and power value corresponding to each power rail, and the total power value of the central processor in the current polling cycle; Sending a data table corresponding to the current polling cycle to a display module; The display module is used to display the data table corresponding to the current polling cycle.
6. The power measurement system according to claim 5, characterized in that: The power processor is further used for: Determine whether the total power value of the central processor in the current polling cycle is within a preset range; When it is determined that the total power value of the central processor in the current polling cycle is within the preset range, setting the target parameter of the current polling cycle to a first preset threshold value; or, When it is determined that the total power value of the central processor in the current polling cycle is not within the preset range, setting the target parameter of the current polling cycle to a second preset threshold; Starting from the current polling cycle, after executing the acquisition operation of multiple consecutive polling cycles, when it is determined that the target parameter of each of the multiple polling cycles is the second preset threshold, sending a first alarm prompt information to the display module, wherein the first alarm prompt information is used to indicate that the power measurement system has a fault; The display module is also used to display the first alarm prompt information.
7. The power measurement system according to claim 5, characterized in that: The power measurement system also includes a voltage regulator; The power processor is further used for: When an analysis instruction is obtained, power logs corresponding to the central processing unit at multiple times are obtained from the voltage regulator, wherein the analysis instruction includes a target time, the target time is the time when the total power value of the central processing unit is calculated in the current polling cycle, and the power log includes a voltage value and a current value corresponding to at least one power rail; According to the target time, selecting a target power log matching the target time from power logs corresponding to the central processor at multiple times; According to the target power log and a data table corresponding to the current polling cycle, it is determined whether the communication between the central processing unit and the voltage regulator is abnormal.
8. The power measurement system according to claim 7, characterized in that: The power processor is specifically used for: According to each power rail in the target power log, selecting a standard voltage value and a standard current value corresponding to each power rail in the target power log from a data table corresponding to the current polling cycle; Determine a voltage difference value corresponding to each power rail in the target power log according to a voltage value corresponding to each power rail in the target power log and a standard voltage value; Determine a current difference value corresponding to each power rail in the target power log according to the current value corresponding to each power rail in the target power log and the standard current value; determining whether there is a problem with a second power rail according to a voltage difference value and a current difference value corresponding to the second power rail, wherein the second power rail is any power rail of at least one power rail included in the target power log; When it is determined that there is a problem with any power rail in the target power log, it is determined that the communication between the central processing unit and the voltage regulator is abnormal.
9. The power measurement system according to any one of claims 1 to 6, characterized in that: The power processor is further used for: Acquiring a storage mode of the power processor; When it is determined that the storage mode of the power processor is local storage, determining whether a presence signal of a storage device is detected; After detecting the presence signal of the storage device, obtaining the remaining storage space of the storage device and the amount of data in the data table corresponding to the current polling cycle; Determining whether to perform a data write operation according to the remaining storage space of the storage device and the amount of data in the data table corresponding to the current polling cycle; When it is determined to execute the data write operation, the amount of data in the data table corresponding to the current polling cycle is written into the storage device.
10. The power measurement system according to claim 9, characterized in that: The power processor is further used for: When it is determined that the storage mode of the power processor is cloud storage, detecting whether the network communication of the power processor is normal; When the network communication of the power processor is normal, acquiring the address information of the target cloud platform; Determining whether the cloud platform address configuration of the power processor is correct according to the address information of the target cloud platform; When it is determined that the cloud platform address configuration of the power processor is correct, the data table corresponding to the current polling cycle is sent to the target cloud platform for storage.
11. The power measurement system according to claim 5, characterized in that: The power calculation module is also used for: Get time setting information; Determining whether there is a problem with the time setting information according to the time setting information and the preset time configuration rule; When it is determined that there is a problem with the time setting information, generating a second alarm prompt information and sending it to the display module; The display module is also used to display the second alarm prompt information.
12. A power measurement method, characterized in that: The method is applied to the power measurement system according to any one of claims 1 to 11, the power measurement system comprising a central processing unit, at least one power supply, a visual monitoring device, at least one sampler and at least one resistor, the visual monitoring device comprising a power processor, the central processing unit is electrically connected to each of the power supplies to form a power rail corresponding to each of the power supplies, each of the power rails is distributed with one of the resistors, when the number of the samplers is multiple, the number of the samplers is the same as the number of the power rails, and each of the samplers is electrically connected to one of the power rails; the method comprises: The power processor sends a sampling control instruction to each of the samplers in a current polling cycle; When the number of the samplers is multiple and the sampling control instruction is received, the sampler collects voltage data from a target power rail connected to itself, wherein the voltage data includes a first potential value, a second potential value, and a third potential value; obtains the resistance value of a target resistor distributed on the target power rail; determines a current value corresponding to the target power rail according to the first potential value, the second potential value, and the resistance value of the target resistor; determines a voltage value corresponding to the target power rail according to the third potential value and a preset potential value; sends the current value and voltage value corresponding to the target power rail to the power processor, wherein the first potential value is the potential value of a first end of the target resistor, the second potential value is the potential value of a second end of the target resistor, and the third potential value is the potential value of the central processor on the target power rail; The power processor determines the power value corresponding to the target power rail according to the current value and voltage value corresponding to the target power rail; and determines the total power value of the central processor in the current polling cycle according to the power value corresponding to each of the power rails.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the power measurement method described in claim 12.
14. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the power measurement method as claimed in claim 12.
Citation Information
Patent Citations
Device and method for metering electric energy
CN102147430A
Signal processing device
CN114137297A
Power regulation and control method and device of multi-core processor, computer equipment and medium
CN117093065A
Impedance matching method and apparatus for radio frequency heating smoking set, and electronic device
WO2023173787A1
