A method, device, computer equipment and storage medium for testing power supply function

By automatically acquiring and controlling the power on and off status of the server and smart network card through the detection device, the accuracy and efficiency issues of the smart network card power supply function test are solved, and efficient S5 mode power supply function test is achieved.

CN119011443BActive Publication Date: 2025-09-30INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411110550.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2025-09-30
Estimated Expiration
2044-08-13

AI Technical Summary

Technical Problem

In the prior art, the S5 mode power supply function test of the smart network card relies on manual observation, which is prone to omissions, resulting in inaccurate test results and a waste of time and manpower costs.

Method used

The detection device automatically obtains the power on/off status of the server and smart network card, and issues control instructions to control the server to shut down or start up. It also detects in real time whether the power on/off status of the smart network card remains unchanged and determines whether the power supply function complies with the preset mode.

Benefits of technology

It improves the accuracy of power supply function testing, saves time and labor costs, and ensures the reliability of test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119011443B_ABST
    Figure CN119011443B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computer technology, and discloses a power supply function testing method, device, computer equipment, and storage medium. The method is applied to a detection device, which is respectively connected to a server and a smart network card configured on the server. The method includes: obtaining the power on / off status of the server and the power on / off status of the smart network card; when the power on / off status of the server is the power on state and the power on / off status of the smart network card is the first state, issuing a shutdown control instruction to instruct the server to power off, where the first state is the power on state or the power off state; during the power off and shutdown process of the server, detecting the power on / off status of the smart network card and determining whether the power on / off status of the smart network card is the first state; if the power on / off status of the smart network card is the first state, then the power supply function of the energy storage device in the preset power supply mode is tested. The present invention can solve the problem of inaccurate manual testing of the power supply function of the smart network card, which wastes time and labor costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for testing a power supply function, a computer device, and a storage medium. Background Art

[0002] With the development of Smart NICs, customer applications and demand for them are increasing. When deployed on server systems, Smart NICs share a common power supply system with the server. This means the Smart NIC only powers on when the server is powered on. However, Smart NICs are required to support S5 power supply functionality, meaning they can maintain normal operation even when the server is restarted or shut down, unaffected by the server shutdown or restart.

[0003] In related technologies, testing the S5 mode power supply function of a Smart NIC requires manual intervention by testers. For example, testers need to observe the Smart NIC's KVM interface to see whether the Smart NIC's operating status is affected by server restarts, soft shutdowns, and forced shutdowns, in order to determine whether the Smart NIC's S5 mode power supply function is functioning properly. This method can lead to test omissions if the tester fails to observe in a timely manner, resulting in inaccurate test results and wasting time and manpower. Summary of the Invention

[0004] In view of this, the present invention provides a power supply function testing method, apparatus, computer equipment and storage medium to solve the problem that manual testing of the power supply function of the smart network card is inaccurate, wastes time and manpower costs.

[0005] In a first aspect, the present invention provides a method for testing a power supply function, which is applied to a detection device, the detection device being connected to a server and a smart network card respectively, the smart network card being configured on the server, and the server and the smart network card being powered by an energy storage device according to a preset power supply mode; the preset power supply mode includes not affecting the power supply to the smart network card when the server is powered off; the method comprising: obtaining the power on / off status of the server and the power on / off status of the smart network card; when the power on / off status of the server is the power on state and the power on / off status of the smart network card is the first state, issuing a shutdown control instruction to instruct the server to power off and shut down, the first state being the power on state or the shutdown state; during the process of the server being powered off and shutting down, detecting the power on / off status of the smart network card to determine whether the power on / off status of the smart network card is the first state; if the power on / off status of the smart network card is the first state, the test of the power supply function of the energy storage device in the preset power supply mode is passed.

[0006] Based on the method of the first aspect above, when the server is in the power-on state and the smart network card is in the first state, a shutdown control instruction is issued to instruct the server to power off and shut down. During the process of the server being powered off and shut down, the power on and off state of the smart network card is detected to determine whether the power on and off state of the smart network card is the first state; if the power on and off state of the smart network card is the first state, the power supply function of the energy storage device in the preset power supply mode is tested and passed.

[0007] Because the detection device is connected to the server and the smart network card respectively, that is, the detection device can directly detect the power-on and power-off status of the smart network card and the server, and during the test, it can control the server to power off by issuing a shutdown control instruction. Then, during the process of powering off the server, it is determined whether the power-on and power-off status of the smart network card is in the first state. If the power-on and power-off status of the smart network card remains in the first state, that is, if it is not affected by the power-off of the server, the power supply function of the energy storage device in the preset power supply mode is tested, thereby testing the power supply function of the preset power supply mode of the smart network card and improving the accuracy of the power supply function test. In addition, compared with manual testing of the power supply function of the smart network card, it can save time and labor costs.

[0008] In an optional embodiment, the server includes a first baseboard management controller; the smart network card includes a second baseboard management controller; obtaining the power on / off status of the server and the power on / off status of the smart network card includes: sending a first command to the first baseboard management controller through a command line tool, and sending a second command to the second baseboard management controller, the first command is used to instruct the first baseboard management controller to send the power on / off status of the server to be tested to the detection device, and the second command is used to instruct the second baseboard management controller to send the power on / off status of the smart network card to the detection device; receiving the power on / off status of the server to be tested from the first baseboard management controller, and the power on / off status of the smart network card from the second baseboard management controller.

[0009] Based on the above method, the detection device can obtain the power on / off status of the server and the power on / off status of the smart network card by sending commands, so as to facilitate the subsequent determination of the control commands to be issued based on the power on / off status of the server and the power on / off status of the smart network card.

[0010] In an optional embodiment, the first state is a power-on state; the server further includes a first operating system; the smart network card further includes a second operating system; when the power-on / off state of the server is a power-on state, and the power-on / off state of the smart network card is the first state, a shutdown control instruction is issued to instruct the server to power off and shut down, including: when the power-on / off state of the server is a power-on state, and the power-on / off state of the smart network card is a power-on state, a shutdown control instruction is issued to the first operating system, and the shutdown control instruction is executed under the first operating system, so that the server is powered off and shut down.

[0011] Alternatively, when the server's power-on / off state is in the on state, and the smart network card's power-on / off state is in the on state, a shutdown control instruction is sent to the first baseboard management controller through the command line tool, so that the first baseboard management controller controls the server to power off and shut down; or, when the server's power-on / off state is in the on state, and the smart network card's power-on / off state is in the on state, the shutdown control instruction is transmitted to the interface of the first baseboard management controller, so that the first baseboard management controller controls the server to power off and shut down.

[0012] Based on the above method, the shutdown control command can be sent to the server through different paths to control the server to power off and shut down, thereby improving the success rate of sending the shutdown control command and avoiding the problem of failure of sending the shutdown control command due to failure of a single path.

[0013] In an optional embodiment, during the process of powering off the server, the power on / off status of the smart network card is detected, and whether the power on / off status of the smart network card is the first state is determined, including: during the process of powering off the server, periodically sending a first ping command to the second operating system to detect the power on / off status of the smart network card; receiving a first response message from the second operating system, the first response message including the power on / off status of the smart network card; and based on the first response message, determining whether the power on / off status of the smart network card is the first state.

[0014] Based on the above method, during the process of powering off the server, the first ping command is periodically sent to the second operating system, which can detect the power on / off status of the smart network card and whether the power on / off status is the power on / off status under the second operating system, so as to facilitate the subsequent determination of whether the power supply function of the preset power supply mode has passed the test based on the power on / off status of the smart network card.

[0015] In an optional implementation, if the power-on / off state of the smart network card is the second state, the power supply function of the energy storage device in the preset power supply mode is tested to fail.

[0016] Based on the above method, the power on / off state of the smart network card is the second state, that is, the power on / off state of the smart network card has changed, that is, the power on / off state of the smart network card is affected by the power off of the server. Obviously, the power supply function of the energy storage device in the preset power supply mode fails the test.

[0017] In an optional embodiment, the preset power supply mode also includes not affecting the power supply to the smart network card when the server is powered on; the method also includes: when the power on / off state of the server is the shutdown state, and the power on / off state of the smart network card is the first state, issuing a power on control instruction to instruct the server to power on; during the process of powering on the server, detecting the power on / off state of the smart network card to determine whether the power on / off state of the smart network card is the first state; if the power on / off state of the smart network card is the first state, then the power supply function of the energy storage device in the preset power supply mode is tested and passed.

[0018] Based on the above method, the server can be controlled to power on and start up by issuing a power-on control instruction, and then during the process of powering on the server, it is determined whether the power-on and power-off status of the smart network card is the first state. When the power-on and power-off status of the smart network card remains in the first state, that is, when it is not affected by the power-on and power-off of the server, the power supply function of the energy storage device in the preset power supply mode is tested, thereby realizing the test of the power supply function of the preset power supply mode of the smart network card, improving the accuracy of the power supply function test, and saving time and labor costs.

[0019] In an optional embodiment, the preset power supply mode also includes controlling the smart network card and the server to power off and shut down at the same time, and the method also includes: when the power on / off state of the server is the power on state, and the power on / off state of the smart network card is the power on state, sending a preset instruction to the first baseboard management controller through the command line tool, and the preset instruction is used to instruct the first baseboard management controller to control the server and the smart network card to power off and shut down at the same time.

[0020] During the process of powering off the server and the smart network card at the same time, a second ping command is periodically sent to the first operating system, and a third ping command is periodically sent to the second operating system to detect the power on / off status of the server and the power on / off status of the smart network card; a second response message from the first operating system and a third response message from the second operating system are received, the second response message including the power on / off status of the server, and the third response message including the power on / off status of the smart network card.

[0021] If the server is in the shutdown state and the smart network card is in the shutdown state, the test of the power supply function of the energy storage device in the preset power supply mode passes; if the server is in the power-on state and the smart network card is in the shutdown state, or the server is in the shutdown state and the smart network card is in the power-on state, or the server is in the power-on state and the smart network card is in the power-on state, then the test of the power supply function of the energy storage device in the preset power supply mode fails.

[0022] Based on the above method, the server and the smart network card can be controlled to be powered off and shut down at the same time by issuing a preset instruction. Then, during the process of the server and the smart network card being powered off and shut down at the same time, it is determined whether the power on / off status of the smart network card and the power on / off status of the server are shut down at the same time. If so, the power supply function of the energy storage device in the preset power supply mode is tested to be passed. Otherwise, the power supply function of the energy storage device in the preset power supply mode is tested to be failed, thereby realizing the test of the power supply function of the preset power supply mode of the smart network card, improving the accuracy of the power supply function test, and saving time and labor costs.

[0023] In a second aspect, the present invention provides a detection device, which is respectively connected to a server and a smart network card, the smart network card is configured on the server, and the server and the smart network card are powered by an energy storage device according to a preset power supply mode; the preset power supply mode includes that when the server is powered off, it does not affect the power supply to the smart network card; the device includes: an acquisition module, used to obtain the power on / off status of the server and the power on / off status of the smart network card; a processing module, used to issue a shutdown control instruction to instruct the server to power off and shut down when the power on / off status of the server is the power on state and the power on / off status of the smart network card is the first state, the first state being the power on state or the shutdown state; the processing module is also used to detect the power on / off status of the smart network card during the process of powering off and shutting down the server, and determine whether the power on / off status of the smart network card is the first state; the processing module is also used to test whether the power supply function of the energy storage device in the preset power supply mode is passed if the power on / off status of the smart network card is the first state.

[0024] In a third aspect, the present invention provides a computer device comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the power supply function testing method of the above-mentioned first aspect or any corresponding embodiment thereof.

[0025] In a fourth 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 supply function testing method of the above-mentioned first aspect or any corresponding embodiment thereof.

[0026] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the power supply function testing method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. 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 any creative work.

[0028] Figure 1 is a topological diagram of a power supply function test system 10 according to an embodiment of the present invention;

[0029] Figure 2 is a flow chart of a method for testing a power supply function according to an embodiment of the present invention;

[0030] Figure 3 is a flow chart of another method for testing a power supply function according to an embodiment of the present invention;

[0031] Figure 4 is a structural block diagram of a detection device according to an embodiment of the present invention;

[0032] Figure 5 Schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0033] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying 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 making creative efforts shall fall within the scope of protection of the present invention.

[0034] As described in the background technology, testers need to observe the KVM interface of the smart network card to determine whether the power supply function of the smart network card is normal. If the testers fail to observe in time, test omissions may occur, resulting in inaccurate test results and wasting time and manpower costs.

[0035] To solve the above technical problems, an embodiment of the present invention provides a method for testing the power supply function. The detection device detects the power on / off status of the smart network card and the power on / off status of the server, and issues a control instruction to control the server to power off and shut down. The detection device determines whether the power on / off status of the smart network card has changed, thereby achieving the effect of testing whether the power supply function of the energy storage device in the preset power supply mode has passed.

[0036] Below is Figure 1 Taking the power supply function test system 10 shown as an example, the method provided in the embodiment of the present application is described. Figure 1It is only a schematic diagram and does not constitute a limitation on the applicable scenarios of the technical solution provided in this application.

[0037] like Figure 1 As shown, Figure 1 FIG. 1 is a topology diagram of a power supply function testing system 10 according to an embodiment of the present invention. Figure 1 In the example, the power supply function test system 10 may include a detection device 101 , a server 102 , a smart network card 103 , and an energy storage device 104 .

[0038] The detection device in the embodiment of the present invention, for example, the detection device 101, can be any device with computing and communication capabilities, such as a computer device, a server, or a cloud server.

[0039] The server in the embodiment of the present invention, for example, server 102, can be any type of server, such as a rack server, a cloud server, or a blade server. The server includes a first baseboard management controller (BMC) and a first operating system (OS). The detection device is connected to the first BMC via a network cable on the server's BMC port, and is connected to the first OS via a network cable on the server's OS port.

[0040] The Smart NIC in the embodiments of the present invention, for example, Smart NIC 103, can be any type of Smart NIC. Smart NIC 103 is configured on server 102. The server includes a second baseboard management controller (also known as a second BMC) and a second operating system (also known as a second OS). The detection device is connected to the second BMC via a network cable on the Smart NIC's BMC port, and is connected to the second OS via a network cable on the Smart NIC's OS port.

[0041] The energy storage device in the embodiment of the present invention, for example, the energy storage device 104, can be any power supply device or power supply. The server 102 and the smart network card 103 are powered by the energy storage device 104 according to a preset power supply mode.

[0042] It is understandable that the detection device 101, the server 102, and the smart network card 103 can be connected to a Dynamic Host Configuration Protocol (DHCP) public domain network.

[0043] In one example, the detection device is connected to the server and the smart network card respectively.

[0044] Specifically, the detection device establishes a communication connection with the server and the smart network card in response to the tester inputting the IP address of the server OS port, the IP address of the server BMC port, the IP address of the smart network card OS port, and the IP address of the smart network card BMC port.

[0045] Figure 1 The power supply function test system 10 shown is only used as an example and is not intended to limit the technical solution of this application. Those skilled in the art should understand that in the specific implementation process, the power supply function test system 10 may also include other devices without limitation.

[0046] According to an embodiment of the present invention, an embodiment of a method for testing a power supply function 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.

[0047] In the case where the preset power supply mode includes powering off the server without affecting the power supply to the smart network card, a power supply function test method is provided in this embodiment, which can be used for the above-mentioned detection device. Figure 2 FIG. 1 is a flow chart of a method for testing a power supply function according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0048] S201: Obtain the power on / off status of the server and the power on / off status of the smart network card.

[0049] The power on / off state includes a power on state or a power off state.

[0050] In some optional embodiments, the detection device sends a first command to the first baseboard management controller and a second command to the second baseboard management controller through a command line tool; receives the power on / off status of the server to be tested from the first baseboard management controller, and the power on / off status of the smart network card from the second baseboard management controller.

[0051] The command line tool may be the ipmitool tool.

[0052] In the embodiment of the present invention, the first command is used to instruct the first baseboard management controller to send the power on / off status of the server to be tested to the detection device.

[0053] In the embodiment of the present invention, the second command is used to instruct the second baseboard management controller to send the power on / off status of the smart network card to the detection device.

[0054] It can be understood that the first command or the second command can be an ipmitool chassis status command.

[0055] S202: When the power-on / off state of the server is the power-on state and the power-on / off state of the smart network card is the first state, a shutdown control instruction is issued to instruct the server to power off.

[0056] The first state is a power-on state or a power-off state.

[0057] In one example, when the server's power-on / off state is on and the smart network card's power-on / off state is on, the detection device sends a shutdown control instruction to the first operating system and executes the shutdown control instruction under the first operating system, causing the server to power off.

[0058] In another example, when the server's power-on / off status is on and the smart network card's power-on / off status is on, the detection device sends a shutdown control instruction to the first baseboard management controller through a command line tool, so that the first baseboard management controller controls the server to power off.

[0059] In another example, when the server's power-on / off state is on and the smart network card's power-on / off state is on, the detection device transmits a shutdown control instruction to the interface of the first baseboard management controller so that the first baseboard management controller controls the server to power off.

[0060] The interface of the first baseboard management controller is a resful interface.

[0061] Optionally, when the power-on / off state of the server is the on state, and the power-on / off state of the smart network card is the first state, the detection device may further issue a restart control instruction to instruct the server to power off and restart.

[0062] S203: During the process of powering off the server, detecting the power on / off state of the smart network card and determining whether the power on / off state of the smart network card is the first state.

[0063] In some optional embodiments, the detection device periodically sends a first ping command to the second operating system during the process of powering off the server to detect the power on / off status of the smart network card; receives a first response message from the second operating system; and based on the first response message, determines whether the power on / off status of the smart network card is the first state.

[0064] The first response information includes the power on / off status of the smart network card.

[0065] Optionally, the detection device periodically sends the first ping command to the second operating system during the process of powering off the server, and can also detect whether the smart network card loses packets and the working status of the hardware device.

[0066] For example, the hardware device may be an optical port or an FPGA. The working status of the hardware device includes: whether the optical port is connected; whether the data transmission speed of the optical port is less than a preset threshold; and whether the FPGA version is consistent with the preset version.

[0067] It is understandable that whether the smart network card loses packets and the working status of the hardware device can also reflect whether the power-on / off state of the smart network card is the first state.

[0068] S204: If the power on / off state of the smart network card is the first state, the power supply function of the energy storage device in the preset power supply mode is tested to be successful.

[0069] Among them, the preset power supply mode may be the S5 power supply mode.

[0070] Optionally, if the power-on / off state of the smart network card is the second state, the detection device tests that the power supply function of the energy storage device in the preset power supply mode fails.

[0071] It can be understood that when the first state is the power-on state, the second state is the power-off state; or, when the first state is the power-off state, the second state is the power-on state.

[0072] Based on the above-mentioned method S201-S204, the detection device is connected to the server and the smart network card respectively, that is, the detection device can directly detect the power on / off status of the smart network card and the power on / off status of the server, and during the test process, it can control the server to power off by issuing a shutdown control instruction, and then during the process of the server being powered off and shut down, determine whether the power on / off status of the smart network card is the first state, and when the power on / off status of the smart network card remains in the first state, that is, when it is not affected by the power off of the server, test the power supply function of the energy storage device in the preset power supply mode. The power supply function of the preset power supply mode of the smart network card is tested, and the accuracy of the power supply function test is improved. In addition, compared with manual testing of the power supply function of the smart network card, time and labor costs can be saved.

[0073] Optionally, the preset power supply mode also includes not affecting the power supply to the smart network card when the server is powered on.

[0074] In some optional embodiments, when the power-on / off state of the server is the shutdown state and the power-on / off state of the smart network card is the first state, the detection device issues a power-on control instruction to instruct the server to power on; during the process of powering on the server, the power-on / off state of the smart network card is detected to determine whether the power-on / off state of the smart network card is the first state; if the power-on / off state of the smart network card is the first state, the power supply function of the energy storage device in the preset power supply mode is tested and passed.

[0075] Optionally, the preset power supply mode also includes controlling the smart network card and the server to be powered off and shut down at the same time.

[0076] In some optional embodiments, when the power on / off status of the server is in the on state and the power on / off status of the smart network card is in the on state, the detection device sends a preset instruction to the first baseboard management controller through a command line tool; in the process of powering off the server and the smart network card at the same time, a second ping command is periodically sent to the first operating system, and a third ping command is periodically sent to the second operating system to detect the power on / off status of the server and the power on / off status of the smart network card; and a second response message from the first operating system and a third response message from the second operating system are received.

[0077] If the server is in a shutdown state and the smart network card is in a shutdown state, the detection device tests whether the power supply function of the energy storage device in the preset power supply mode is passed.

[0078] If the server is in the on state and the smart network card is in the off state, or the server is in the off state and the smart network card is in the on state, or the server is in the on state and the smart network card is in the on state, the detection device fails to test the power supply function of the energy storage device in the preset power supply mode.

[0079] The second response information includes the power on / off status of the server, and the third response information includes the power on / off status of the smart network card.

[0080] In the embodiment of the present invention, the preset instruction is used to instruct the first baseboard management controller to control the server and the smart network card to power off at the same time. For example, the preset instruction can be ipmitool -I lanplus -H<host_bmc_ip> -U<host_bmc_user> -P<host_bmc_user_passwd> raw 0x3a 0xf50x00. Among them, I lanplus specifies the use of LAN Plus interface.<host_bmc_ip> It is the IP address of the server's BMC port.<host_bmc_user> is the user name of the server's first BMC.<host_bmc_user_passwd> The raw command is used to send raw IPMI commands.

[0081] Optionally, the preset power supply mode also includes controlling the smart network card and the server to be powered on at the same time.

[0082] In some optional embodiments, when the power on / off state of the server is the power off state, and the power on / off state of the smart network card is the power off state, the detection device sends a preset power on instruction to the first baseboard management controller through a command line tool; in the process of powering on the server and the smart network card at the same time, a ping command is periodically sent to the first operating system, and a ping command is periodically sent to the second operating system to detect the power on / off state of the server and the power on / off state of the smart network card; and a fourth response message from the first operating system and a fifth response message from the second operating system are received.

[0083] If the server is in the power-on state and the smart network card is in the power-on state, the detection device tests that the power supply function of the energy storage device in the preset power supply mode passes.

[0084] If the server is in the on state and the smart network card is in the off state, or the server is in the off state and the smart network card is in the on state, or the server is in the off state and the smart network card is in the off state, the detection device tests that the power supply function of the energy storage device in the preset power supply mode fails.

[0085] The fourth response information includes the power on / off status of the server, and the fifth response information includes the power on / off status of the smart network card.

[0086] In the embodiment of the present invention, the preset power-on instruction is used to instruct the first baseboard management controller to control the server and the smart network card to power on at the same time. For example, the preset power-on instruction can be ipmitool -I lanplus -H<host_bmc_ip> -U<host_bmc_user> -P<host_bmc_user_passwd> chassis power on. I lanplus specifies the use of the LAN Plus interface.<host_bmc_ip> It is the IP address of the server's BMC port.<host_bmc_user> is the user name of the server's first BMC.<host_bmc_user_passwd> This is the password for the server's first BMC. chassis power on controls the server's power status, turning it on.

[0087] Optionally, the preset power supply mode also includes forcing the server and smart network card to power on and off.

[0088] In some optional embodiments, when the power on / off state of the server is the power off state, and the power on / off state of the smart network card is the power off state, the detection device sends a forced power on instruction to the first baseboard management controller through a command line tool; during the process of forcibly powering on the server, a ping command is periodically sent to the first operating system, and a ping command is periodically sent to the second operating system to detect the power on / off state of the server and the power on / off state of the smart network card.

[0089] If the server is in the power-on state and the smart network card is in the power-off state, the detection device tests that the power supply function of the energy storage device in the preset power supply mode passes.

[0090] If the server is in the on-state and the smart network card is in the on-state, or the server is in the off-state and the smart network card is in the on-state, or the server is in the off-state and the smart network card is in the off-state, the detection device fails to test the power supply function of the energy storage device in the preset power supply mode.

[0091] As you can understand, servers equipped with Smart NICs have a startup priority feature. This feature prioritizes the Smart NIC from being powered on automatically when the server is powered on after being powered on, rather than being powered off. If the Smart NIC is powered off under the second operating system, the server will not be allowed to power on. However, if the Smart NIC is powered on under the second operating system, the server will be allowed to power on. Therefore, the preset power mode setting forces the server and Smart NIC to power on and off.

[0092] It is understandable that the preset power supply mode may further include more scenario modes, which are associated with customer needs and are not limited.

[0093] In this embodiment, another method for testing the power supply function is provided, which can be used for the above-mentioned detection device. Figure 3 FIG. 1 is a flow chart of another method for testing a power supply function according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:

[0094] S301: Obtain the power on / off status of the server and the power on / off status of the smart network card.

[0095] S302: Determine whether the server is in the power-on state.

[0096] S303: If the server is not in the power-on state, a power-on control instruction is issued to instruct the server to power on, and the process jumps to S306.

[0097] S304: If the server is in the power-on state, determine whether the smart network card is in the power-on state.

[0098] S305: If the smart network card is in the shutdown state, a power-on control instruction is issued to instruct the smart network card to power on and determine whether the smart network card remains in the power-on state; if so, jump to S308; if not, jump to S309.

[0099] S306: If the smart network card is in the power-on state, a shutdown control instruction is issued to instruct the server to power off.

[0100] S307: Determine whether the smart network card is in the power-on state.

[0101] S308: If yes, the power supply function of the energy storage device in the preset power supply mode is tested to be passed.

[0102] S309: If not, the power supply function of the energy storage device in the preset power supply mode is tested and fails.

[0103] In this embodiment, a power supply function test device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments. The details that have been described will not be repeated here. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.

[0104] This embodiment provides a detection device, such as Figure 4 As shown, Figure 41 is a structural block diagram of a detection device according to an embodiment of the present invention; the detection device is connected to a server and a smart network card respectively, the smart network card is configured on the server, and the server and the smart network card are powered by an energy storage device according to a preset power supply mode; the preset power supply mode includes not affecting the power supply to the smart network card when the server is powered off; the detection device includes: an acquisition module 401, which is used to obtain the power on / off status of the server and the power on / off status of the smart network card.

[0105] The processing module 402 is configured to issue a shutdown control instruction to instruct the server to power off when the server is in the power-on state and the smart network card is in the first state, wherein the first state is the power-on state or the power-off state.

[0106] The processing module 402 is further configured to detect the power-on / off state of the smart network card during the process of powering off the server, and determine whether the power-on / off state of the smart network card is the first state.

[0107] The processing module 402 is further configured to test whether the power supply function of the energy storage device in the preset power supply mode passes if the power on / off state of the smart network card is the first state.

[0108] In some optional embodiments, the server includes a first baseboard management controller; the smart network card includes a second baseboard management controller; the acquisition module 401 is specifically used to send a first command to the first baseboard management controller through a command line tool, and to send a second command to the second baseboard management controller, the first command is used to instruct the first baseboard management controller to send the power on / off status of the server to be tested to the detection device, and the second command is used to instruct the second baseboard management controller to send the power on / off status of the smart network card to the detection device; the acquisition module 401 is specifically used to receive the power on / off status of the server to be tested from the first baseboard management controller, and the power on / off status of the smart network card from the second baseboard management controller.

[0109] In some optional implementations, the first state is a power-on state; the server further includes a first operating system; and the smart network card further includes a second operating system; the processing module 402 is specifically configured to, when the power-on / off state of the server is the power-on state and the power-on / off state of the smart network card is the power-on state, send a shutdown control instruction to the first operating system, and execute the shutdown control instruction in the first operating system to power off the server;

[0110] Alternatively, the processing module 402 is further specifically configured to, when the power-on / off state of the server is the power-on state and the power-on / off state of the smart network card is the power-on state, send a shutdown control instruction to the first baseboard management controller through a command line tool, so that the first baseboard management controller controls the server to power off and shut down;

[0111] Alternatively, the processing module 402 is further specifically used to transmit a shutdown control instruction to the interface of the first baseboard management controller when the power on / off state of the server is the power on state and the power on / off state of the smart network card is the power on state, so that the first baseboard management controller controls the server to power off and shut down.

[0112] In some optional embodiments, the processing module 402 is further specifically used to periodically send a first ping command to the second operating system to detect the power-on / off status of the smart network card during the process of powering off the server; the processing module 402 is further specifically used to receive a first response message from the second operating system, the first response message including the power-on / off status of the smart network card; the processing module 402 is further specifically used to determine whether the power-on / off status of the smart network card is the first state based on the first response message.

[0113] In some optional implementations, the processing module 402 is further configured to test whether the power supply function of the energy storage device in the preset power supply mode fails if the power on / off state of the smart network card is the second state.

[0114] In some optional embodiments, the preset power supply mode also includes not affecting the power supply to the smart network card when the server is powered on; the processing module 402 is also used to issue a power-on control instruction to instruct the server to power on when the power-on / off state of the server is the power-off state and the power-on / off state of the smart network card is the first state; the processing module 402 is also used to detect the power-on / off state of the smart network card during the power-on / off process of the server, and determine whether the power-on / off state of the smart network card is the first state; the processing module 402 is also used to test whether the power supply function of the energy storage device in the preset power supply mode is passed if the power-on / off state of the smart network card is the first state.

[0115] In some optional embodiments, the preset power supply mode also includes controlling the smart network card and the server to power off and shut down at the same time. The processing module 402 is also used to send a preset instruction to the first baseboard management controller through a command line tool when the power on / off state of the server is on and the power on / off state of the smart network card is on. The preset instruction is used to instruct the first baseboard management controller to control the server and the smart network card to power off and shut down at the same time.

[0116] The processing module 402 is also used to periodically send a second ping command to the first operating system and a third ping command to the second operating system when the server and the smart network card are powered off at the same time, so as to detect the power on / off status of the server and the smart network card.

[0117] The processing module 402 is further configured to receive a second response message from the first operating system and a third response message from the second operating system, wherein the second response message includes the power on / off status of the server, and the third response message includes the power on / off status of the smart network card.

[0118] The processing module 402 is further configured to test whether the power supply function of the energy storage device in the preset power supply mode passes if the server is in the shutdown state and the smart network card is in the shutdown state.

[0119] The processing module 402 is also used to test whether the power supply function of the energy storage device in the preset power supply mode fails if the server is in the power-on state and the smart network card is in the power-off state, or the server is in the power-off state and the smart network card is in the power-on state, or the server is in the power-on state and the smart network card is in the power-on state.

[0120] The further functional description of each of the above modules is the same as that of the above corresponding embodiments and will not be repeated here.

[0121] The detection device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0122] The embodiment of the present invention also provides a computer device having the above Figure 4 The detection device shown.

[0123] See also Figure 5 , Figure 5 is a structural diagram of a computer device provided by an optional embodiment of the present invention, such as Figure 5 As shown, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Equally, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.

[0124] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.

[0125] The memory 20 stores instructions that can be executed by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0126] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0127] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0128] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 20 can be connected via a bus or other means. Figure 5 The bus connection is taken as an example.

[0129] The input device 30 can receive input digital or character information and generate key signal input related to user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a trackpad, a touch pad, an indicator stick, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 can include a display device, an auxiliary lighting device (e.g., an LED), and a tactile feedback device (e.g., a vibration motor). The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display, and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0130] The computer device further includes a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0131] The embodiment of the present invention also provides a computer-readable storage medium. The above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, 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 drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. 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.

[0132] Part of the present application 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 application through the operation of the computer. Those skilled in the art should understand that the form in which the computer program instruction exists in a computer-readable medium includes but is not limited to a source file, an executable file, an installation package file, etc. 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 can be any available computer-readable storage medium or communication medium that can be accessed by the computer.

[0133] Although the embodiments of the present invention have been described with reference to 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. Such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for testing power supply function, characterized in that: Applied to a detection device, the detection device is connected to a server and a smart network card respectively, the smart network card is configured on the server, and the server and the smart network card are powered by an energy storage device according to a preset power supply mode; The preset power supply mode includes not affecting the power supply to the smart network card when the server is powered off; the method includes: Obtaining the power on / off status of the server and the power on / off status of the smart network card; When the power-on / off state of the server is the power-on state and the power-on / off state of the smart network card is the first state, issuing a shutdown control instruction to instruct the server to power off and shut down, wherein the first state is the power-on state or the power-off state; During the process of powering off the server, detecting the power-on / off state of the smart network card and determining whether the power-on / off state of the smart network card is the first state; If the power-on / off state of the smart network card is the first state, the power supply function of the energy storage device in the preset power supply mode is tested to be successful.

2. The method according to claim 1, characterized in that The server includes a first baseboard management controller; the smart network card includes a second baseboard management controller; and obtaining the power on / off status of the server and the power on / off status of the smart network card includes: Sending a first command to the first baseboard management controller and a second command to the second baseboard management controller through a command line tool, wherein the first command is used to instruct the first baseboard management controller to send the power on / off status of the server to the detection device, and the second command is used to instruct the second baseboard management controller to send the power on / off status of the smart network card to the detection device; Receive the power on / off status of the server from the first baseboard management controller and the power on / off status of the smart network card from the second baseboard management controller.

3. The method according to claim 2, characterized in that The first state is a power-on state; the server further includes a first operating system; the smart network card further includes a second operating system; when the power-on / off state of the server is a power-on state and the power-on / off state of the smart network card is the first state, issuing a shutdown control instruction to instruct the server to power off and shut down, including: When the power-on / off state of the server is the power-on state and the power-on / off state of the smart network card is the power-on state, sending a shutdown control instruction to the first operating system, and executing the shutdown control instruction in the first operating system to power off the server; Alternatively, when the power-on / off state of the server is the power-on state, and the power-on / off state of the smart network card is the power-on state, a shutdown control instruction is sent to the first baseboard management controller through the command line tool, so that the first baseboard management controller controls the server to power off and shut down; Alternatively, when the server is in the on state and the smart network card is in the on state, a shutdown control instruction is transmitted to the interface of the first baseboard management controller so that the first baseboard management controller controls the server to power off and shut down.

4. The method according to claim 3, characterized in that During the process of powering off the server, detecting the power-on / off state of the smart network card and determining whether the power-on / off state of the smart network card is the first state includes: During the process of powering off the server, periodically sending a first ping command to the second operating system to detect the power-on / power-off status of the smart network card; receiving a first response message from the second operating system, where the first response message includes a power-on / power-off status of the smart network card; Based on the first response information, it is determined whether the power-on / power-off state of the smart network card is the first state.

5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: If the power-on / off state of the smart network card is the second state, the power supply function of the energy storage device in the preset power supply mode is tested and fails. The second state is a state in which the power-on / off state of the smart network card changes, or a state in which the power-on / off state of the smart network card is affected by the power-off of the server.

6. The method according to any one of claims 1 to 4, characterized in that The preset power supply mode also includes not affecting the power supply to the smart network card when the server is powered on; the method further includes: When the power-on / off state of the server is the power-off state, and the power-on / off state of the smart network card is the first state, issuing a power-on control instruction to instruct the server to power on; During the process of powering on the server, detecting the power-on / off state of the smart network card and determining whether the power-on / off state of the smart network card is the first state; If the power-on / off state of the smart network card is the first state, the power supply function of the energy storage device in the preset power supply mode is tested to be successful.

7. The method according to any one of claims 1 to 4, characterized in that The preset power supply mode further includes controlling the smart network card and the server to be powered off and shut down simultaneously, and the method further includes: When the power-on / off state of the server is the power-on state, and the power-on / off state of the smart network card is the power-on state, sending a preset instruction to the first baseboard management controller through a command line tool, wherein the preset instruction is used to instruct the first baseboard management controller to control the server and the smart network card to power off and shut down at the same time; During the process of simultaneously powering off the server and the smart network card, periodically sending a second ping command to the first operating system and periodically sending a third ping command to the second operating system to detect the power on / off status of the server and the power on / off status of the smart network card; receiving a second response message from the first operating system and a third response message from the second operating system, wherein the second response message includes the power on / off status of the server, and the third response message includes the power on / off status of the smart network card; If the server is in a shutdown state and the smart network card is in a shutdown state, then the power supply function of the energy storage device in the preset power supply mode is tested to be passed; If the server is in the powered-on state and the smart network card is in the powered-off state, or the server is in the powered-off state and the smart network card is in the powered-on state, or the server is in the powered-on state and the smart network card is in the powered-on state, the power supply function of the energy storage device in the preset power supply mode is tested and fails.

8. A detection device, characterized in that: The detection device is connected to the server and the smart network card respectively, the smart network card is configured on the server, and the server and the smart network card are powered by the energy storage device according to a preset power supply mode; The preset power supply mode includes not affecting the power supply to the smart network card when the server is powered off; The device comprises: an acquisition module, configured to acquire the power on / off status of the server and the power on / off status of the smart network card; a processing module, configured to, when the power-on / off state of the server is the power-on state and the power-on / off state of the smart network card is the first state, issue a shutdown control instruction to instruct the server to power off and shut down, wherein the first state is the power-on state or the power-off state; The processing module is further configured to detect the power-on / off state of the smart network card during the process of powering off the server, and determine whether the power-on / off state of the smart network card is the first state; The processing module is further configured to test whether the power supply function of the energy storage device in the preset power supply mode passes if the power on / off state of the smart network card is the first state.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the power supply function testing method according to any one of claims 1 to 7 by executing the computer instructions.

10. 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 supply function testing method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Intelligent network card management method and device, electronic equipment and computer storage medium

    CN114117562A

  • Intelligent network card power supply state control method and device, electronic equipment and storage medium

    CN115941464A