A server power supply detection method, device, electronic equipment and storage medium
By switching power supply groups to perform stress testing during changes in server load status, the problem of inaccurate detection of server redundant power supplies is solved, achieving more accurate detection results and higher server stability.
Patent Information
- Application Number
- CN202510935176.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-08
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2045-07-08
AI Technical Summary
In the prior art, the detection results of redundant power supplies for servers are inaccurate, resulting in power supplies that pass the detection still having a failure risk, which may cause server service interruption.
A server power detection method is adopted to ensure that the test results are consistent with the actual power supply operating status by stress testing the server from idle state to fully loaded state and then to idle state, combined with switching and testing of the power group.
The accuracy of server redundant power supply detection is improved, the risk of server business interruption caused by inaccurate detection is avoided, and the stability of the server is improved.
Smart Images

Figure CN120429183B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of server technology, and in particular to a method, device, electronic device, and storage medium for detecting a server power supply. Background Art
[0002] A server power supply is a core component that ensures stable server operation. It provides stable voltage and current, preventing damage to hardware caused by voltage fluctuations, surges, or power outages. Enterprise-class servers are often equipped with redundant power supplies, with multiple power supplies sharing power for the server. If one power supply fails, the remaining power supplies seamlessly take over, ensuring business continuity and improving system fault tolerance. Therefore, it is essential to test or diagnose the performance of redundant server power supplies.
[0003] In the related art, power switching is usually performed when the server is fully pressurized to test the server's redundant power supply, but this detection method is inconsistent with the actual operating status of the power supply. Therefore, the detection results of the server's redundant power supply are inaccurate, and the power supply that passes the test still has the risk of failure, causing the risk of server business interruption. Summary of the Invention
[0004] The present application provides a method for detecting server power supplies to at least solve the problem in the related art that the detection results of server redundant power supplies are inaccurate, so that power supplies that pass the detection still have the risk of failure, causing the risk of server business interruption.
[0005] The present application provides a method for detecting a server power supply, which is applied to a server, wherein the power supply of the server includes a first power supply group and a second power supply group; the server includes at least one component to be stress tested; the method includes: in a current test round, when it is determined that the power-on states of the first power supply group and the second power supply group are both in normal states, powering off the first power supply group and using the second power supply group to supply power to perform a first stress test on at least one of the components, wherein the first stress test is a stress test from an idle state to a fully loaded state; after the first stress test is completed, powering off the second power supply group and using the first power supply group to supply power to perform a second stress test on at least one of the components, wherein the second stress test is a stress test from the fully loaded state to the idle state.
[0006] When the second stress test is completed, the second power group is powered on and the power-on status of the first power group and the second power group is detected; when it is determined that the power-on status of the first power group and the second power group are both in the normal state, after waiting for a first preset time, enter the next test round, wherein the power supply sequence of the next test round is opposite to the power supply sequence of the current test round; and after the test is completed, the first power group is powered on and the power-on status of the first power group and the second power group is detected; when it is determined that the power-on status of the first power group and the second power group are both in the normal state, end the operation.
[0007] The present application also provides a server power supply detection device, which is applied to a server, wherein the server power supply includes a first power supply group and a second power supply group; the server includes at least one component to be subjected to a stress test; the server power supply detection device includes:
[0008] a power switching module, configured to, when determining that both the first power group and the second power group are in normal power-on states, power off the first power group and use the second power group to supply power, so as to perform a first stress test on at least one of the components, wherein the first stress test is a stress test from an idle state to a fully loaded state;
[0009] The power switching module is further configured to, after the first stress test is completed, power off the second power group and use the first power group to supply power, so as to perform a second stress test on at least one of the components, wherein the second stress test is a stress test from the full load state to the idle state;
[0010] a detection module, configured to power on the second power group after the second stress test is completed, and detect the power-on status of the first power group and the second power group;
[0011] The power switching module is further configured to, when determining that the power-on states of the first power group and the second power group are both in the normal state, wait for a first preset time before entering a next test round, wherein the power supply sequence of the power supplies in the next test round is opposite to the power supply sequence of the power supplies in the current test round;
[0012] The detection module is also used to power on the first power group after the test is completed, and detect the power-on status of the first power group and the second power group; and when it is determined that the power-on status of the first power group and the second power group are both in normal state, end the operation.
[0013] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned server power supply detection methods when executing the computer program.
[0014] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned server power supply detection methods are implemented.
[0015] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned server power supply detection methods when executed by a processor.
[0016] Through the present application, the server first allows the first power supply group to supply power alone, and then performs a stress test on at least one component of the server, so that the load state of each component is pulled from the idle state to the full load state. After the full load state is stable for a certain period of time, it is switched to the second power supply group for independent power supply. After the full load state continues to be stable for a certain period of time, the stress test is stopped, and the load state of at least one component of the server is switched from the full load state to the idle state. Finally, the redundant power supply is restored and the power-on status of the power supply is checked. After waiting for a certain period of time in the idle state, the two power supply groups are switched to the independent power supply order and tested again. That is, the second power supply group is first allowed to supply power alone. When it is in a stable full load state, it is switched to the first power supply group for independent power supply until the redundant power supply is finally restored. The power-on status of the power supply is checked and the operation ends.
[0017] Since each power supply group can perform power supply testing when the load state of at least one component of the server changes from no-load to full-load, and from full-load to no-load, this stress testing method is consistent with the actual operating state of the power supply, thereby improving the accuracy of the detection results of the server's redundant power supply, avoiding failure of the power supply that has passed the test, and thus avoiding the risk of server business interruption, thereby improving the stability of the server. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0019] Figure 1 A topological diagram of a server power supply detection system provided in an embodiment of the present application;
[0020] Figure 2 A flow chart of a method for detecting a server power supply provided in an embodiment of the present application;
[0021] Figure 3 A conceptual diagram of the test steps provided for the embodiments of the present application;
[0022] Figure 4 A flow chart of another server power supply detection method provided in an embodiment of the present application;
[0023] Figure 5 A structural block diagram of a server power supply detection device provided in an embodiment of the present application;
[0024] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0026] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0027] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0028] In conjunction with a specific application environment architecture or a specific hardware architecture on which execution of a server power supply detection method depends, the specific application environment architecture or the specific hardware architecture is described herein.
[0029] The embodiments of the present application are applied to a scenario where redundant power supplies are detected when multiple power supplies are used to power a server.
[0030] Typically, the power supplies are divided into two groups based on the server's power redundancy. For example, the power supply groups include PSU0 and PSU1. Each power supply group contains the minimum number of power supplies required for normal server operation. That is, when a server is powered by only one power supply group, it is in a non-redundant state. If the server's power redundancy is N+N, the power supplies are divided equally into two groups. If the server's power redundancy is N+1, the first and second power supplies are divided into two groups, and the remaining power supplies are shared by both groups.
[0031] In related technologies, power switching is usually performed when the server is fully stressed to test the server's redundant power supply. However, this detection method does not match the actual operating status of the power supply, resulting in inaccurate detection results for the server's redundant power supply. This in turn causes the power supply that has passed the test to still have a failure risk, causing the risk of server service interruption. In addition, for multi-node servers, stress testing is usually only performed on the master node to test the server's redundant power supply, but the slave nodes are not stress tested at the same time. This results in lower current and power consumption at the slave nodes, which in turn leads to lower pressure on the power supply, failing to reach the ultimate pressure of the power supply test, resulting in insufficient stress testing of the power supply, inaccurate detection results for the server's redundant power supply, and the tested power supply cannot meet actual needs.
[0032] To address the aforementioned technical issues, embodiments of the present application provide a server power supply detection method. When a server's power supply is non-redundant, the method loads the server from idle to fully loaded. After the full load persists for a certain period, the method switches the server to non-redundant power supply from another power supply group. After the full load persists for a certain period, the server is switched from fully loaded to idle, and then the server resumes redundant power supply. This method can improve the accuracy of server redundant power supply detection results.
[0033] Below is Figure 1 Taking the server power supply detection system shown as an example, the method provided in the embodiment of the present application is described. Figure 1 It is only a schematic diagram and does not constitute a limitation on the applicable scenarios of the technical solution provided in this application.
[0034] like Figure 1 As shown, Figure 1 This is a topological diagram of the server power supply detection system provided in an embodiment of the present application. Figure 1 In the embodiment, the server power detection system 100 may include a server 101 , a first power group 102 , a second power group 103 and a power distribution unit 104 .
[0035] The server 101 can be any device with computing and communication capabilities, such as a cloud server, a tower server, a rack server, or a blade server.
[0036] The first power supply group 102 or the second power supply group 103 in the embodiment of the present application can be used to provide a stable power supply for the server 101. The first power supply group 102 or the second power supply group 103 can be a redundant power supply of the server.
[0037] The power distribution unit 104 (PDU) in the embodiment of the present application is a device for controlling and managing multiple power supplies output to a server.
[0038] Figure 1 The server power supply detection system 100 shown is for example only and is not intended to limit the technical solution of the present application. Those skilled in the art should understand that in a specific implementation, the server power supply detection system 100 may also include other devices without limitation.
[0039] The embodiment of the present application provides a method for detecting a server power supply, which is applied to Figure 1 The server shown, such as Figure 2 As shown, Figure 2 This is a flow chart of a server power supply detection method provided in an embodiment of the present application. The server power supply detection method includes the following steps:
[0040] S201 : When it is determined that both the first power supply group and the second power supply group are in normal power-on state, the first power supply group is powered off, and the second power supply group is used to supply power, so as to perform a first stress test on at least one component.
[0041] The components to be stress-tested include one or more of the server's hard disk, memory, and central processing unit (CPU).
[0042] The first stress test is a stress test from an idle state to a fully loaded state.
[0043] In some optional embodiments, when the power-on states of the first power group and the second power group are both in normal states, the first power group is powered off and the second power group is used to supply power to start stress testing at least one component until the load state of each component is pulled from an idle state to a full load state after a first time period; when the load state of each component is in a full load state and the maintenance time is equal to the second time period, the first stress test on at least one component is terminated.
[0044] The first time period is a preset memory stress test duration, for example, 3 minutes.
[0045] The second time period can be set according to actual needs and is not limited. For example, the second time period can be 5 minutes.
[0046] For example, after the first power supply group (PSU0) and the second power supply group (PSU1) are powered on, they are in an idle state (idle state) and wait for 1 minute; when the server determines that the power-on states of the first power supply group and the second power supply group are both in normal state, the first power supply group is powered off, and the second power supply group is used for power supply, and the first stress test of one or more components such as CPU, hard disk, memory, etc. is started to be executed in parallel in the background.
[0047] Specifically, assuming all of the above components are included, the server executes a CPU stress test command using the CPU stress test tool mprime to perform a first stress test on the CPU; executes a hard disk stress test command using the hard disk stress test tool fio to perform a first stress test on the hard disk; and executes a memory stress test command using the memory stress test tool stressapptest to perform a first stress test on the memory. After the first time period, the memory stress test completes (the memory stress test tool allocates memory), and the hard disk and processor stress test processes terminate. At this point, the memory, hard disk, and processor are all loaded from idle to full capacity.
[0048] The CPU stress test command can be . / mprime -t 3&.
[0049] The hard disk stress test command can be . / fio --filename= / dev / disk name-rw randrw --numjobs=4 -bs= 128k --iodepth=32 -rwmixread=30 -rwmixwrite=70 -name=file-runtime hard disk stress test duration-ioengine=libaio --direct=1 --buffered=0 --norandommap--time_based&. The hard disk stress test command includes the hard disk drive name and hard disk stress test duration.
[0050] The memory stress test command can be . / stressapptest -s memory stress test duration --remote_numa -v 20&. The memory stress test command includes the memory stress test duration.
[0051] In some optional embodiments, before the server powers off the first power supply group and uses the second power supply group to perform a first stress test on at least one component, the server may also set the stress test duration of the memory to a first time period; and set the stress test duration of the hard disk to twice the first time period.
[0052] It is understandable that compared with the hard disk and CPU, the memory takes the longest time to load from an idle state to a fully loaded state. Therefore, the stress test duration for loading the memory, hard disk, and CPU from an idle state to a fully loaded state shall be based on the actual duration of the memory stress test. In addition, there is no limit on the CPU stress test duration. The hard disk stress test duration is a multiple of the memory stress test duration, for example, twice, to ensure that the hard disk stress test is always in operation during the memory stress test duration, avoiding the scenario where the hard disk stress test ends early and the complete mixed load stress test cannot be covered.
[0053] S202: After the first stress test is completed, the second power supply group is powered off, and the first power supply group is used to supply power to perform a second stress test on at least one component.
[0054] The second stress test is a stress test from a full-load state to an idle state.
[0055] In some optional embodiments, after the first stress test is completed, the first power group is powered on, and it is detected whether the power-on state of the first power group is in a normal state; when the power-on state of the first power group is in a normal state, the second power group is powered off, and the first power group is used to supply power, and the load state of each component is in a full load state and maintained for a time equal to the second time period, until after a third time period, when the load state of each component is pulled from a full load state to an idle state, the second stress test on at least one component is terminated.
[0056] In one example, the server obtains the power supply status, input current, output current, input power and output power of the first power supply group; detects whether the power supply status is a preset status; if the power supply status is the preset status, determines whether the input current is greater than a first threshold, whether the output current is greater than a second threshold, whether the input power is greater than a third threshold and whether the output power is greater than a fourth threshold; if the power supply status is the preset status, and the input current is greater than the first threshold, the output current is greater than the second threshold, the input power is greater than the third threshold and the output power is greater than the fourth threshold, detects whether the deviation ratios of the input current, output current, input power and output power are within a preset range; if so, obtains the system event log of the server; detects whether the power-off release information and alarm information of the first power supply group are recorded in the system event log; if the system event log records the power-off release information and the system event log does not record the alarm information, determines that the first power supply group has restored the power-on status.
[0057] The power supply status includes an online status (Presence detected) and an AC power supply interruption (PowerSupply AC lost). The preset status may be an online status.
[0058] The server may obtain status information of the first power supply group through a status detection command and determine the power supply status based on the status information. The status detection command may be an ipmitool sdr elist |grep -i psu command. The status information may be as follows:
[0059] Redundant_PSU| 5Fh | ok| 10.17 | Fully Redundant
[0060] PSU0_Temp| 60h | ok| 10.1 | 38 degrees C
[0061] PSU1_Temp| 61h | ok| 10.2 | 38 degrees C
[0062] PSU0_Inlet_Temp| 62h | ok| 10.3 | 31 degrees C
[0063] PSU1_Inlet_Temp| 63h | ok| 10.4 | 31 degrees C
[0064] PSU0_IIn| 64h | ok| 10.5 | 3.12 Amps
[0065] PSU1_IIn| 65h | ok| 10.6 | 3 Amps
[0066] PSU0_IOut| 66h | ok| 10.7 | 54 Amps
[0067] PSU1_IOut| 67h | ok| 10.8 | 52 Amps
[0068] PSU0_PIn| 68h | ok| 10.9 | 696 Watts
[0069] PSU1_PIn| 69h | ok| 10.10 | 672 Watts
[0070] PSU0_POut| 6Ah | ok| 10.11 | 660 Watts
[0071] PSU1_POut| 6Bh | ok| 10.12 | 636 Watts
[0072] PSU0_Supply| 6Eh | ok| 10.15 | Presence detected
[0073] PSU1_Supply| 6Fh | ok| 10.16 | Presence detected
[0074] The power supply status information includes various performance indicators (e.g., input current, output current, input power, and output power) for the first and second power supply groups. For example, PSU0_Temp indicates the temperature of the first power supply group. "|60h | ok| 10.1 | 38 degrees C" indicates that the temperature of the first power supply group is 38 degrees C. PSU1_IIn indicates the input current of the second power supply group. "|65h | ok| 10.6 | 3 Amps" indicates that the input current of the second power supply group is 3 Amps. PSU0_Supply indicates the power supply status of the first power supply group. "|6Eh | ok| 10.15 | Presence detected" indicates that the power supply status of the first power supply group is the preset state.
[0075] The first threshold, the second threshold, the third threshold, and the fourth threshold can be set according to actual needs. For example, the first threshold, the second threshold, the third threshold, and the fourth threshold can all be 0.
[0076] The deviation ratio may be a deviation ratio between the performance index value of the first power supply group and the average performance index value of the two power supply groups. For example, the deviation ratio of the input current of the first power supply group may be obtained by first calculating the difference between the input current of the first power supply group and the average input current of the two power supply groups, and then calculating the ratio between the difference and the average input current.
[0077] The preset range can be set according to actual needs, for example, the preset range can be ±10%.
[0078] The system event log can be the Security-Enhanced Linux (SEL) log of the server's baseboard management controller. The system event log can be as follows:
[0079] 7f | 04 / 06 / 2025 | 01:24:38 | Power Supply PSU1_Supply | Power SupplyAC lost | Asserted
[0080] 80 | 04 / 06 / 2025 | 01:24:41 | Power Supply Redundant_PSU | FullyRedundant | Deasserted
[0081] 81 | 04 / 06 / 2025 | 01:24:41 | Power Supply Redundant_PSU | RedundancyLost | Asserted
[0082] 82 | 04 / 06 / 2025 | 01:33:00 | Power Supply PSU1_Supply | Power SupplyAC lost | Deasserted
[0083] 83 | 04 / 06 / 2025 | 01:33:03 | Power Supply Redundant_PSU | FullyRedundant | Asserted
[0084] 84 04 / 06 / 2025 | 01:33:03 | Power Supply Redundant_PSU | RedundancyLost | Deasserted
[0085] The system event log includes the power-off release information "Power Supply PSU1_Supply | PowerSupply AC lost | Deasserted" or the power-off information "Power Supply PSU1_Supply | PowerSupply AC lost | Asserted".
[0086] It is understandable that after the power supply changes from the powered-on state to the powered-off state, the SEL log records the power-off information caused by the AC power supply interruption. When the power supply recovers from the powered-off state to the powered-on state, the SEL log records the power-off release information, and there is no power supply high temperature alarm information or other alarm records.
[0087] In summary, the power-on state of the first power group must meet the following conditions in a normal state: the power supply state of the first power group is a preset state, the input current is greater than the first threshold, the output current is greater than the second threshold, the input power is greater than the third threshold, the output power is greater than the fourth threshold, the system event log records the power-off release information, and the system event log does not record the alarm information.
[0088] S203: After the second pressure test is completed, the second power supply group is powered on, and the power-on status of the first power supply group and the second power supply group are detected.
[0089] In some optional embodiments, when the second stress test is completed, the server powers on the second power supply group, obtains the power supply status, input current, output current, input power and output power of each of the first power supply group and the second power supply group; detects whether the power supply status of each of the first power supply group and the second power supply group is a preset state; if the power supply status of each of the first power supply group and the second power supply group is a preset state, then determines whether the input current of each of the first power supply group and the second power supply group is greater than the first threshold, whether the output current is greater than the second threshold, whether the input power is greater than the third threshold and whether the output power is greater than the fourth threshold; if the power supply status of each of the first power supply group and the second power supply group is a preset state , and their respective input currents are greater than the first threshold, the output currents are greater than the second threshold, the input powers are greater than the third threshold, and the output powers are greater than the fourth threshold, then detect whether the deviation ratios of the input current, output current, input power, and output power of the first power group and the second power group are all within a preset range; if so, obtain the system event log of the server; detect whether the power-off release information and alarm information of the first power group and the second power group are recorded in the system event log; if the system event log records the power-off release information of the first power group and the second power group, and the system event log does not record the alarm information, then determine that the power-on status of the first power group and the second power group is normal.
[0090] Optionally, before detecting the power-on status of the first power group and the second power group, the server may further detect the power-off status of the first power group and the second power group.
[0091] For example, taking the server detecting the power-off status of the first power group as an example, when the first power group is powered off, the server obtains the power supply status, input current, output current, input power and output power of the first power group; detects whether the power supply status is an AC power supply interruption status; if the power supply status is an AC power supply interruption status, determines whether the input current is equal to the first threshold, whether the output current is equal to the second threshold, whether the input power is equal to the third threshold and whether the output power is equal to the fourth threshold; if the power supply status is an AC power supply interruption status, and the input current is equal to the first threshold, the output current is equal to the second threshold, the input power is equal to the third threshold and the output power is equal to the fourth threshold, then obtains the system event log of the server; detects whether the power-off information and alarm information of the first power group are recorded in the system event log; if the system event log records the power-off information and the system event log does not record the alarm information, it is determined that the power-off status of the first power group is normal.
[0092] It can be understood that the server determines whether the health status of the first power group and the second power group is normal by detecting the power-off status of the first power group and the second power group. The first power group and the second power group can be detected more comprehensively, thereby improving the accuracy of the detection results of the server redundant power supply.
[0093] It is understandable that the process of the server detecting the power-off status of the second power supply group is similar to the process of detecting the power-off status of the first power supply group, and is not described in detail here.
[0094] S204: When it is determined that the power-on states of the first power group and the second power group are both in normal states, wait for a first preset time and then enter the next test round.
[0095] The power supply sequence of the next test round is opposite to the power supply sequence of the current test round.
[0096] Specifically, when it is determined that both the first power group and the second power group are powered on normally, after waiting for a first preset time, the second power group is powered off and the first power group is used to supply power to perform a first stress test on the at least one component. After the first stress test is completed, the first power group is powered off and the second power group is used to supply power to perform a second stress test on the at least one component.
[0097] In one example, when the power-on states of the first power group and the second power group are both in normal states, the second power group is powered off and the first power group is used to supply power to start stress testing at least one component until the load state of each component is pulled from the idle state to the full load state after a first time period; when the load state of each component is in the full load state and the maintenance time is equal to the second time period, the first stress test on at least one component is terminated; when the first stress test is completed, the second power group is powered on and it is detected whether the power-on state of the second power group is in normal state; when the power-on state of the second power group is in normal state, the first power group is powered off and the second power group is used to supply power, and when the load state of each component is in the full load state and the maintenance time is equal to the second time period, until after a third time period, when the load state of each component is pulled from the full load state to the idle state, the second stress test on at least one component is terminated.
[0098] S205 , after the test is completed, power on the first power group, and detect the power-on status of the first power group and the second power group.
[0099] The specific process of detecting the power-on status of the first power group and the second power group is shown in S203 and will not be described in detail here.
[0100] S206: When it is determined that the power-on states of the first power group and the second power group are both in normal states, the operation ends.
[0101] It can be understood that when it is determined that the power-on status of the first power group and the second power group are both in normal status, it means that after the first stress test and the second stress test are performed on the first power group and the second power group, there is no server downtime problem in the first power group and the second power group during the switching process, and the health status of the first power group and the second power group are both normal.
[0102] The power supply test steps S201 to S206 can be performed as follows: Figure 3 As shown, Figure 3 A conceptual diagram of the test steps provided for an embodiment of the present application. Figure 3 In the first diagram, the second power supply unit (PSU1) supplies power independently, followed by the first power supply unit (PSU0). In the second diagram, the first power supply unit (PSU0) supplies power independently, followed by the second power supply unit (PSU1).
[0103] Based on the above Figure 2 In the method shown, the server first uses the first power supply group to provide independent power, then performs a stress test on at least one component of the server, causing the load state of each component to increase from an idle state to a fully loaded state. After the full load state remains stable for a certain period of time, the second power supply group is switched to provide independent power. After the full load state remains stable for a certain period of time, the stress test is stopped, and the load state of at least one component of the server is switched from a fully loaded state to an idle state. Finally, redundant power supply is restored, and the power-on status of the power supplies is checked. After waiting in the idle state for a certain period of time, the two power supply groups are tested again in a different independent power supply order, i.e., the second power supply group is first provided with independent power, and when the full load state is stable, the first power supply group is switched to provide independent power, until redundant power supply is restored, the power-on status of the power supplies is checked, and the operation ends.
[0104] Since each power supply group can perform power supply detection when the load state of at least one component of the server changes from no-load state to full-load state, and from full-load state to no-load state, this method is consistent with the actual operating state of the power supply, thereby improving the accuracy of the detection results of the server's redundant power supply, avoiding failure of the power supply that has passed the detection, and thus avoiding the risk of server business interruption, thereby improving the stability of the server.
[0105] above Figure 2The method is applicable to scenarios where multiple power supplies are used to power a server. In the case where the server is a master node, the master node and multiple slave nodes share a first power supply group and a second power supply group. The slave nodes are slave servers managed by the master node, each of which includes at least one component to be tested. The server can also perform, during the current test round and the next test round, first and second stress tests on the components to be tested included in the master node, as well as first and second stress tests on the components to be tested included in each slave node.
[0106] In one example, during the current test round and the next test round, in addition to performing the first stress test and the second stress test on the components to be tested included in the master node, the server can also obtain the address of each slave node among the multiple slave nodes before performing the first stress test and the second stress test on the components to be tested included in each slave node respectively; generate a stress test command for each slave node based on the address of each slave node, and execute the stress test command to call up the stress test process of the components to be tested included in each slave node, and perform stress testing on the components to be tested included in each slave node.
[0107] Specifically, if Figure 4 As shown, Figure 4 This is a flow chart of another server power detection method provided in an embodiment of the present application. The server performs the following steps on a master node and multiple slave nodes:
[0108] S401, in the current test round, when it is determined that the power-on states of the first power group and the second power group are both in normal states, the first power group is powered off, and the second power group is used to supply power to perform a first stress test on at least one component included in the master node and the components to be tested included in each slave node.
[0109] Specifically, the server obtains the address of each slave node among multiple slave nodes; generates a stress test command for each slave node based on the address of each slave node; when the power-on status of the first power group and the second power group are both in normal status, powers off the first power group, and uses the second power group to supply power, executes the stress test commands of multiple slave nodes, so as to call up the stress test process of the components to be tested included in each slave node, and starts stress testing at least one component included in the master node and the components to be tested included in each slave node, until after the first time period, the load status of at least one component included in the master node and the components to be tested included in each slave node are pulled from the idle state to the full load state; when the load status of each component and each slave component is in the full load state and the maintenance time is equal to the second time period, ends the first stress test on at least one component and at least one slave component.
[0110] The stress test command for each slave node includes the address of each slave node. For example, the CPU stress test command for a slave node may be ssh $ip "cd / root;. / mprime -t 3&".
[0111] It can be understood that the host can obtain the network port address of each slave node through the companion test machine, log in to the corresponding slave node through the encrypted network protocol (Secure Shell, ssh) to execute the stress test command of each slave node.
[0112] S402, when the first stress test is completed, the second power supply group is powered off, and the first power supply group is used to supply power to perform a second stress test on at least one component included in the master node and the component to be tested included in each slave node.
[0113] Specifically, the specific execution process of S402 is similar to that of S202 and will not be described in detail here.
[0114] S403: After the second pressure test is completed, the second power supply group is powered on, and the power-on status of the first power supply group and the second power supply group are detected.
[0115] Specifically, the specific execution process of S403 is similar to that of S203 and will not be described in detail here.
[0116] S404: When it is determined that the power-on states of the first power group and the second power group are both in normal states, wait for a first preset time and then enter the next test round.
[0117] The power supply sequence of the next test round is opposite to the power supply sequence of the current test round.
[0118] Specifically, the specific execution process of S404 is similar to that of S204 and S205, and will not be described in detail here.
[0119] S405 , after the test is completed, power on the first power group, and detect the power-on status of the first power group and the second power group.
[0120] Specifically, the specific execution process of S405 is similar to that of S206 and will not be described in detail here.
[0121] S406: When it is determined that the power-on states of the first power group and the second power group are both in normal states, the operation ends.
[0122] Specifically, the specific execution process of S406 is similar to that of S207 and will not be described in detail here.
[0123] Based on the above Figure 4 In the method shown, the master node controls the power on and off of the power supply and is responsible for stress testing all nodes. Specifically, when the master node first allows the first power supply group to supply power independently, the master node is responsible for initiating the stress test for each component of all nodes and increasing the load state of each component from idle to full load. After the full load state persists for a certain period of time, the master node controls the switch to the second power supply group for independent power supply. After the full load state continues for a certain period of time, the master node stops the stress test for all nodes, switches the load state of each component from full load to idle, and the master node restores redundant power supply. The master node then checks the power-on status of the power supply. After waiting for a certain period of time in the idle state, the two power supply groups switch to independent power supply order and test again. Specifically, the master node first allows the second power supply group to supply power independently, then switches to the first power supply group for independent power supply, and finally restores redundant power supply. The master node then checks the power-on status of the power supply.
[0124] Since the master node in a multi-node server can control the components of all nodes to simultaneously perform stress tests from no-load to full-load, and from full-load to no-load states, the current and power consumption of the slave nodes can be made consistent with the actual operating state, ensuring the test pressure on the power supply, reaching the limit pressure of the power supply test, making the power supply fully stress-tested, improving the accuracy of the detection results of the server's redundant power supply, and ensuring that the tested power supply meets actual needs.
[0125] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0126] The embodiment of the present application also provides a detection device for a server power supply, such as Figure 5 As shown, Figure 5This is a structural block diagram of a server power supply detection device provided in an embodiment of the present application; applied to a server, the server power supply includes a first power supply group and a second power supply group; the server includes at least one component to be stress tested; the server power supply detection device includes:
[0127] The power switching module 501 is configured to, in the current test round, when it is determined that both the first power group and the second power group are powered on normally, power off the first power group and use the second power group to supply power, so as to perform a first stress test on at least one component, where the first stress test is a stress test from an idle state to a fully loaded state;
[0128] The power switching module 501 is further configured to, after the first stress test is completed, power off the second power supply group and use the first power supply group to supply power, so as to perform a second stress test on at least one component, where the second stress test is a stress test from a full load state to an idle state;
[0129] A detection module 502 is configured to power on the second power supply group after the second stress test is completed, and detect the power-on status of the first power supply group and the second power supply group;
[0130] The power switching module 501 is further configured to, when determining that both the first power group and the second power group are powered on normally, wait for a first preset time before entering the next test round, wherein the power supply sequence of the power supplies in the next test round is opposite to the power supply sequence of the power supplies in the current test round;
[0131] The detection module 502 is used to power on the first power group after the test is completed, detect the power-on status of the first power group and the second power group; and end the operation when it is determined that the power-on status of the first power group and the second power group are both in normal state.
[0132] In some optional embodiments, the power switching module 501 is specifically used to power off the first power group when the power-on states of the first power group and the second power group are both in normal states, and use the second power group to supply power to start stress testing at least one component until the load state of each component is pulled from the idle state to the full load state after the first time period; when the load state of each component is in the full load state and the maintenance time is equal to the second time period, the first stress test on at least one component is ended.
[0133] In some optional embodiments, the power switching module 501 is further specifically used to power on the first power group after the first stress test is completed, and detect whether the power-on state of the first power group is in a normal state; when the power-on state of the first power group is in a normal state, power off the second power group, and use the first power group to supply power, and after the load state of each component is in a full load state and maintained for a time equal to the second time period, until after a third time period, when the load state of each component is pulled from a full load state to an idle state, the second stress test on at least one component is terminated.
[0134] In some optional embodiments, the detection module 502 is specifically used to obtain the power supply status, input current, output current, input power and output power of the first power supply group; detect whether the power supply status is a preset state; if the power supply status is the preset state, determine whether the input current is greater than the first threshold, whether the output current is greater than the second threshold, whether the input power is greater than the third threshold and whether the output power is greater than the fourth threshold; if the input current is greater than the first threshold, the output current is greater than the second threshold, the input power is greater than the third threshold and the output power is greater than the fourth threshold, detect whether the deviation ratios of the input current, output current, input power and output power are within a preset range; if so, obtain the system event log of the server; detect whether the power-off release information and alarm information of the first power supply group are recorded in the system event log; if the system event log records the power-off release information and the system event log does not record the alarm information, determine that the first power supply group has restored the power-on state.
[0135] In some optional embodiments, when there are multiple components, the multiple components include at least a hard disk and a memory; before the first power supply group is powered off and the second power supply group is used to supply power to perform a first stress test on at least one component, the power switching module 501 is also used to set the stress test duration of the memory to a first time period; and set the stress test duration of the hard disk to a multiple of the first time period.
[0136] In some optional embodiments, when the server is a master node, the master node and multiple slave nodes share the first power group and the second power group; the power switching module 501 is also used to, in addition to performing the first stress test and the second stress test on the components to be tested included in the master node during the current test round and the next test round, also include performing the first stress test and the second stress test on the components to be tested included in each slave node respectively, wherein the slave node is a slave server managed by the master node, and each slave node includes at least one component to be tested.
[0137] In some optional embodiments, during the current test round and the next test round, in addition to performing the first stress test and the second stress test on the components to be tested included in the master node, it also includes before performing the first stress test and the second stress test on the components to be tested included in each slave node, the power switching module 501 is also used to obtain the address of each slave node in the multiple slave nodes; generate a stress test command for each slave node based on the address of each slave node, and execute the stress test command to perform the first stress test and the second stress test on the components to be tested included in each slave node, respectively, to start the stress test process of the components to be tested included in each slave node, and perform stress test on the components to be tested included in each slave node.
[0138] For the description of the features in the embodiment corresponding to the detection device of the server power supply, reference can be made to the relevant description of the embodiment corresponding to the detection method of the server power supply, which will not be repeated here.
[0139] The embodiment of the present application also provides an electronic device, such as Figure 6 As shown, Figure 6 The hardware structure diagram of an electronic device provided in an embodiment of the present application is shown. The electronic device includes a processor 10 and a memory 20. The memory 20 stores a computer program. The processor 10 is configured to run the computer program to perform the steps of any of the above-mentioned server power supply detection method embodiments.
[0140] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps of any of the above-mentioned server power supply detection method embodiments when running.
[0141] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0142] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned server power supply detection method embodiments are implemented.
[0143] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned server power supply detection method embodiments are implemented.
[0144] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0145] The above describes in detail the server power supply detection method, device, electronic device, and storage medium provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core concept of the present application. It should be noted that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A method for detecting a server power supply, characterized in that: Applied to a server, the power supply of the server includes a first power supply group and a second power supply group; the server includes at least one component to be stress tested; the method includes: In the current test round, when it is determined that both the first power group and the second power group are in normal power-on states, the first power group is powered off and the second power group is used for power supply to perform a first stress test on at least one of the components, where the first stress test is a stress test from an idle state to a fully loaded state; After the first stress test is completed, the second power supply group is powered off, and the first power supply group is used to supply power to perform a second stress test on at least one of the components, where the second stress test is a stress test from the full load state to the idle state; After the second stress test is completed, the second power supply group is powered on, and the power-on status of the first power supply group and the second power supply group are detected; When it is determined that the power-on states of the first power group and the second power group are both in the normal state, after waiting for a first preset time, entering the next test round, wherein the power supply sequence of the power supplies in the next test round is opposite to the power supply sequence of the power supplies in the current test round; After the test is completed, the first power supply group is powered on, and the power-on status of the first power supply group and the second power supply group is detected; When it is determined that the power-on states of the first power group and the second power group are both in normal states, ending the operation; When the server is a master node, and the master node and multiple slave nodes share the first power supply group and the second power supply group, in the current test round and the next test round, in addition to performing the first stress test and the second stress test on the components to be tested included in the master node, it also includes performing the first stress test and the second stress test on the components to be tested included in each of the slave nodes, respectively, wherein the slave nodes are slave servers managed by the master node, and each of the slave nodes includes at least one component to be tested.
2. The method according to claim 1, characterized in that When it is determined that both the first power supply group and the second power supply group are powered on normally, the first power supply group is powered off, and the second power supply group is used to supply power, so as to perform a first stress test on at least one of the components, comprising: When both the first power group and the second power group are in the normal state, the first power group is powered off, and the second power group is used for power supply to start stress testing the at least one component until the load state of each component is increased from the idle state to the full load state after a first time period; When the load state of each of the components is in the full load state and the maintenance time is equal to the second time period, the first pressure test on at least one of the components is terminated.
3. The method according to claim 2, characterized in that After the first stress test is completed, the second power supply group is powered off, and the first power supply group is used to supply power to perform a second stress test on at least one of the components, including: After the first stress test is completed, the first power supply group is powered on, and a power-on state of the first power supply group is detected to determine whether the power-on state of the first power supply group is in the normal state; When the power-on state of the first power group is in the normal state, the second power group is powered off and the first power group is used to supply power. After the load state of each of the components is in the full load state and maintained for a time equal to the second time period, until after a third time period, when the load state of each of the components is pulled from the full load state to the idle state, the second stress test on at least one of the components is terminated.
4. The method according to claim 3, characterized in that The detecting whether the power-on state of the first power supply group is in the normal state includes: Obtaining a power supply status, input current, output current, input power, and output power of the first power supply group; detecting whether the power supply state is a preset state; If the power supply state is the preset state, determining whether the input current is greater than a first threshold, whether the output current is greater than a second threshold, whether the input power is greater than a third threshold, and whether the output power is greater than a fourth threshold; If the input current is greater than the first threshold, the output current is greater than the second threshold, the input power is greater than the third threshold, and the output power is greater than the fourth threshold, detecting whether the deviation ratios of the input current, the output current, the input power, and the output power are within a preset range; If so, obtaining the system event log of the server; Detecting whether power-off release information and alarm information of the first power group are recorded in the system event log; If the system event log records the power-off release information and the system event log does not record the alarm information, it is determined that the first power supply group has restored the power-on state.
5. The method according to claim 2, characterized in that When the component includes multiple components, the multiple components include at least a hard disk and a memory; before powering off the first power supply group and using the second power supply group to supply power to perform the first stress test on at least one of the components, the method further includes: Setting the memory stress test duration to the first time period; The stress test duration of the hard disk is set to a multiple of the first time period.
6. The method according to claim 1, characterized in that In the current test round and the next test round, in addition to performing the first stress test and the second stress test on the components to be tested included in the master node, before respectively performing the first stress test and the second stress test on the components to be tested included in each of the slave nodes, the method further includes: Obtaining an address of each of the plurality of slave nodes; A stress test command is generated for each slave node based on the address of each slave node, and when the first stress test and the second stress test are respectively performed on the components to be tested included in each slave node, the stress test command is executed to call up the stress test process of the components to be tested included in each slave node, and stress test is performed on the components to be tested included in each slave node.
7. A server power supply detection device, characterized in that: Applied to a server, the power supply of the server includes a first power supply group and a second power supply group; the server includes at least one component to be subjected to stress testing; The server power supply detection device includes: a power switching module, configured to, in a current test round, when determining that both the first power group and the second power group are in normal power-on states, power off the first power group and use the second power group to supply power, so as to perform a first stress test on at least one of the components, wherein the first stress test is a stress test from an idle state to a fully loaded state; The power switching module is further configured to, after the first stress test is completed, power off the second power group and use the first power group to supply power, so as to perform a second stress test on at least one of the components, wherein the second stress test is a stress test from the full load state to the idle state; a detection module, configured to power on the second power group after the second stress test is completed, and detect the power-on status of the first power group and the second power group; The power switching module is further configured to, when determining that the power-on states of the first power group and the second power group are both in the normal state, wait for a first preset time before entering the next test round, wherein the power supply sequence of the power supplies in the next test round is opposite to the power supply sequence of the power supplies in the current test round; The detection module is further configured to, after the test is completed, power on the first power group and detect the power-on status of the first power group and the second power group; and terminate the operation when it is determined that the power-on status of the first power group and the second power group are both in normal state; The power switching module is also used for, when the server is a master node and the master node and multiple slave nodes share the first power group and the second power group, in the current test round and the next test round, in addition to performing the first stress test and the second stress test on the components to be tested included in the master node, it also includes performing the first stress test and the second stress test on the components to be tested included in each of the slave nodes respectively, wherein the slave node is a slave server managed by the master node, and each of the slave nodes includes at least one component to be tested.
8. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the server power supply detection method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the server power supply detection method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Power supply test and device thereof, electronic equipment and storage medium
CN115964242A