PCIe card power-on and power-off control method and device
By monitoring the equipment information of the PCIe card and automatically performing power-up and down operations using the power control chip, the problem of cumbersome power-up and down of PCIe card in the prior art is solved, which improves work efficiency and reduces operation and maintenance costs.
Patent Information
- Application Number
- CN202411580262.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-25
AI Technical Summary
In the prior art, the process of powering on and off the PCIe card is relatively cumbersome and requires manual operation, resulting in high operation and maintenance costs and low working efficiency.
By monitoring the device information of the PCIe card, including slot information and status information, the preset conditions determine whether power is required to be powered on and off, and the powered on and off is automatically performed based on the target power control chip corresponding to the slot information.
The automatic power-on-off control of PCIe cards is realized, which reduces the power-on-off time, improves the working efficiency of PCIe cards and reduces the operation and maintenance costs.
Smart Images

Figure CN119512344A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and more particularly to a method and device for controlling power on and off of a PCIe card. Background Art
[0002] With the rapid development of the server industry, the application of artificial intelligence is becoming more and more extensive. Customers' application scenarios and needs are becoming more and more diverse. In order to meet customer needs and improve product competitiveness, rapid response and rapid R&D have become the main development model at present.
[0003] When a PCIe card is in use, it often needs to be powered on and off. In the prior art, the process of powering on and off a PCIe card is relatively cumbersome. For example, it is usually necessary to go to the computer room manually to operate, which is time-consuming and laborious, and the operation and maintenance cost is high, resulting in low working efficiency of the PCIe card. Therefore, how to provide a control method for powering on and off a PCIe card to solve the problem of low working efficiency of the PCIe card is of great practical significance. Summary of the invention
[0004] The embodiments of the present application provide a method and device for controlling power on and off of a PCIe card, which can improve the working efficiency of the PCIe card.
[0005] To achieve the above purpose, the technical solution of the embodiment of the present application is implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides a method for controlling power on and off of a PCIe card, the method comprising:
[0007] Monitor the device information of the PCIe card; the device information includes the slot information and status information of the PCIe card; the slot information is used to identify the slot where the PCIe card is located; each slot is provided with a corresponding power control chip;
[0008] Determine whether the PCIe card needs to be powered on or off according to the status information and preset conditions;
[0009] If the judgment result is yes, the PCIe card is powered on and off based on the target power control chip corresponding to the slot information.
[0010] The PCIe card power-on and power-off control method provided in the embodiment of the present application monitors the device information of the PCIe card during the power-on and power-off control of the PCIe card; the device information includes the slot information and status information of the PCIe card; the slot information is used to identify the slot where the PCIe card is located; each slot is provided with a corresponding power control chip; according to the status information and preset conditions, it is judged whether the PCIe card needs to be powered on and off; if the judgment result is yes, the PCIe card is powered on and off based on the target power control chip corresponding to the slot information, and the device information of the PCIe card can be monitored, and the PCIe card is powered on and off based on the target power control chip corresponding to the slot information. The method realizes automatic control of the power-on and power-off operation of the PCIe card, reduces the power-on and power-off time of the PCIe card, and can effectively improve the working efficiency of the PCIe card.
[0011] In an optional embodiment, the preset condition includes a first judgment sub-condition; the state information includes a card identifier, operation mode information, and actual performance information of the PCIe card; the operation mode information includes a working mode and an energy-saving mode; the first judgment sub-condition includes target performance information and a performance value relationship of the PCIe card;
[0012] The determining, according to the status information and the preset condition, whether the PCIe card needs to be powered on or off includes:
[0013] If the working mode information of the PCIe card is a working mode, a first comparison result is determined according to the actual performance information of the PCIe card and the first judgment sub-condition; the first comparison result indicates whether the actual performance information and the target performance information satisfy the performance value relationship;
[0014] Based on the first comparison result, it is determined whether the PCIe card needs to be powered on or off.
[0015] In the method of this embodiment, the preset condition includes a first judgment sub-condition; the state information includes a card identifier, operation mode information, and actual performance information of the PCIe card; the operation mode information includes a working mode and an energy-saving mode; the first judgment sub-condition includes the target performance information of the PCIe card and a performance numerical relationship; if the operation mode information of the PCIe card is the working mode, a first comparison result is determined according to the actual performance information of the PCIe card and the first judgment sub-condition; the first comparison result indicates whether the actual performance information and the target performance information satisfy the performance numerical relationship; based on the first comparison result, it is determined whether the PCIe card needs to be powered on or off, and the working mode can be determined according to the state information when the power on or off of the PCIe card is controlled, and then the first comparison result is determined according to the actual performance information of the PCIe card and the first judgment sub-condition, and based on the first comparison result, it is determined whether the PCIe card needs to be powered on or off, wherein the first comparison result indicates whether the PCIe card fails, and whether the PCIe card needs to be powered on or off is accurately identified in the working mode, and the power on or off time of the PCIE card is further reduced, which can effectively improve the working efficiency of the PCIe card.
[0016] In an optional embodiment, the performance numerical relationship includes that the actual performance information is less than the target performance information; and judging whether the PCIe card needs to be powered on or off based on the first comparison result includes:
[0017] If the first comparison result is satisfied, determining that the PCIe card needs to be powered on or off;
[0018] If the first comparison result is not satisfied, it is determined that the PCIe card does not need to be powered on or off.
[0019] In the method of this embodiment, the performance numerical relationship includes that the actual performance information is less than the target performance information; if the first comparison result is satisfied, it is determined that the PCIe card needs to be powered on and off; if the first comparison result is not satisfied, it is determined that the PCIe card does not need to be powered on and off, thereby providing a mechanism for efficiently identifying whether a PCIe card needs to be powered on and off in a working mode, further reducing the time for powering on and off the PCIe card, and effectively improving the working efficiency of the PCIe card.
[0020] In an optional embodiment, the preset condition includes a second judgment sub-condition; the state information includes a card identifier and actual version information of the PCIe card; the second judgment sub-condition includes a target version information and a version number relationship of the PCIe card;
[0021] The determining, according to the status information and the preset condition, whether the PCIe card needs to be powered on or off includes:
[0022] Determining a second comparison result according to the actual version information of the PCIe card and the second judgment sub-condition; the second comparison result indicates whether the actual version information and the target version information satisfy the version number relationship;
[0023] Based on the second comparison result, it is determined whether the PCIe card needs to be powered on or off.
[0024] In the method of this embodiment, the preset condition includes a second judgment sub-condition; the status information includes a card identifier and actual version information of the PCIe card; the second judgment sub-condition includes the target version information and the version number relationship of the PCIe card; a second comparison result is determined according to the actual version information of the PCIe card and the second judgment sub-condition; the second comparison result indicates whether the actual version information and the target version information satisfy the version number relationship; based on the second comparison result, it is judged whether the PCIe card needs to be powered on and off, wherein the second comparison result indicates whether the PCIe card firmware is the latest version, and can efficiently detect whether the PCIe card firmware needs to be updated, realize accurate identification of whether the PCIe card needs to be powered on and off, and can support efficient firmware update of PCIe devices, further reduce the power on and off time of PCIe cards, and effectively improve the work efficiency of PCIe cards.
[0025] In an optional embodiment, the version number relationship includes that the actual version information and the target version information change from being different to being the same; and judging whether the PCIe card needs to be powered on and off based on the second comparison result includes:
[0026] If the second comparison result is satisfied, determining that the PCIe card needs to be powered on or off;
[0027] If the second comparison result is not satisfied, it is determined that the PCIe card does not need to be powered on or off.
[0028] In the method of this embodiment, the version number relationship includes that the actual version information and the target version information change from being different to being the same; if the second comparison result is satisfied, it is determined that the PCIe card needs to be powered on and off; if the second comparison result is not satisfied, it is determined that the PCIe card does not need to be powered on and off, thereby providing a mechanism for efficiently identifying whether a PCIe card needs to be powered on and off based on the version number relationship, more efficiently supporting PCIe devices to complete firmware updates, further reducing the power on and off time of PCIe cards, and effectively improving the work efficiency of PCIe cards.
[0029] In an optional embodiment, the performing power on and off operations on the PCIe card based on the target power control chip corresponding to the slot information includes:
[0030] Acquire an extended chip address of a target power control chip corresponding to the slot information;
[0031] Generate a target IPMI instruction according to the extended chip address; the target IPMI instruction includes a first target IPMI instruction and a second target IPMI instruction;
[0032] According to the first target IPMI instruction, controlling the power supply of the slot where the PCIe card is located to power off the PCIe card;
[0033] According to the second target IPMI instruction, the power supply of the slot where the PCIe card is located is controlled to power on the PCIe card.
[0034] The method of this embodiment obtains the extended chip address of the target power control chip corresponding to the slot information; generates a target IPMI instruction according to the extended chip address; the target IPMI instruction includes a first target IPMI instruction and a second target IPMI instruction; according to the first target IPMI instruction, controls the power supply of the slot where the PCIe card is located to realize the power-off operation of the PCIe card; according to the second target IPMI instruction, controls the power supply of the slot where the PCIe card is located to realize the power-on operation of the PCIe card, thereby providing a mechanism for powering on the PCIe card through the IPMI instruction, realizing automatic generation of IPMI instructions to control the PCIe card to power on, further reducing the power-on and power-off time of the PCIe card, and effectively improving the working efficiency of the PCIe card.
[0035] In an optional embodiment, monitoring the device information of the PCIe card includes:
[0036] In response to the target monitoring instruction, the device information of the PCIe card is detected; wherein the target monitoring instruction is generated based on the target control operation; the target control operation includes the secure channel protocol SSH remote access operation and the BMC KVM remote graphical interface operation.
[0037] The method of this embodiment detects the device information of the PCIe card by responding to a target monitoring instruction; wherein the target monitoring instruction is generated based on a target control operation; the target control operation includes a secure channel protocol SSH remote access operation and a BMC KVM remote graphical interface operation, thereby realizing remote management of the power on and off control of the PCIe card, enabling more accurate and efficient control of the power on and off of the PCIe card, and improving the working efficiency of the PCIe card.
[0038] In a second aspect, an embodiment of the present application further provides a control device for powering on and off a PCIe card, including:
[0039] An information acquisition module, used for monitoring the device information of the PCIe card; the device information includes the slot information and status information of the PCIe card; the slot information is used for identifying the slot where the PCIe card is located; each slot is provided with a corresponding power control chip;
[0040] An information analysis module, used to determine whether the PCIe card needs to be powered on or off according to the status information and preset conditions;
[0041] The control execution module is used to perform power on and off operations on the PCIe card based on the target power control chip corresponding to the slot information if the judgment result is yes.
[0042] In an optional embodiment, the preset condition includes a first judgment sub-condition; the state information includes a card identifier, operation mode information, and actual performance information of the PCIe card; the operation mode information includes a working mode and an energy-saving mode; the first judgment sub-condition includes target performance information and a performance value relationship of the PCIe card; the information analysis module is specifically used to:
[0043] If the working mode information of the PCIe card is a working mode, a first comparison result is determined according to the actual performance information of the PCIe card and the first judgment sub-condition; the first comparison result indicates whether the actual performance information and the target performance information satisfy the performance value relationship;
[0044] Based on the first comparison result, it is determined whether the PCIe card needs to be powered on or off.
[0045] In an optional embodiment, the performance numerical relationship includes that the actual performance information is less than the target performance information; and the information analysis module is specifically configured to:
[0046] If the first comparison result is satisfied, determining that the PCIe card needs to be powered on or off;
[0047] If the first comparison result is not satisfied, it is determined that the PCIe card does not need to be powered on or off.
[0048] In an optional embodiment, the preset condition includes a second judgment sub-condition; the state information includes a card identifier and actual version information of the PCIe card; the second judgment sub-condition includes a target version information and a version number relationship of the PCIe card;
[0049] The information analysis module is specifically used for:
[0050] Determining a second comparison result according to the actual version information of the PCIe card and the second judgment sub-condition; the second comparison result indicates whether the actual version information and the target version information satisfy the version number relationship;
[0051] Based on the second comparison result, it is determined whether the PCIe card needs to be powered on or off.
[0052] In an optional embodiment, the version number relationship includes that the actual version information and the target version information change from being different to being the same; and the information analysis module is specifically used to:
[0053] If the second comparison result is satisfied, determining that the PCIe card needs to be powered on or off;
[0054] If the second comparison result is not satisfied, it is determined that the PCIe card does not need to be powered on or off.
[0055] In an optional embodiment, the control execution module is specifically used to:
[0056] Acquire an extended chip address of a target power control chip corresponding to the slot information;
[0057] Generate a target IPMI instruction according to the extended chip address; the target IPMI instruction includes a first target IPMI instruction and a second target IPMI instruction;
[0058] According to the first target IPMI instruction, controlling the power supply of the slot where the PCIe card is located to power off the PCIe card;
[0059] According to the second target IPMI instruction, the power supply of the slot where the PCIe card is located is controlled to power on the PCIe card.
[0060] In an optional embodiment, the information acquisition module is specifically used to:
[0061] In response to the target monitoring instruction, the device information of the PCIe card is detected; wherein the target monitoring instruction is generated based on the target control operation; the target control operation includes the secure channel protocol SSH remote access operation and the BMC KVM remote graphical interface operation.
[0062] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for controlling power on and power off of a PCIe card of the first aspect is implemented.
[0063] In a fourth aspect, an embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the computer program is executed by the processor, the processor implements the PCIe card power-on and power-off control method of the first aspect.
[0064] The technical effects brought about by any one of the implementation methods in the second to fourth aspects can refer to the technical effects brought about by the corresponding implementation method in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. 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 paying creative labor.
[0066] Figure 1 A flowchart of a method for controlling power on and off a PCIe card provided in an embodiment of the present application;
[0067] Figure 2 One of the flowcharts of determining whether a PCIe card needs to be powered on or off in a method for controlling power on or off of a PCIe card provided in an embodiment of the present application;
[0068] Figure 3 A schematic diagram of a flow chart of a method for controlling power on and off of a PCIe card provided in an embodiment of the present application for determining whether a PCIe card needs to be powered on or off based on a performance value relationship;
[0069] Figure 4 A second flow chart of determining whether a PCIe card needs to be powered on or off in a method for controlling power on or off of a PCIe card provided in an embodiment of the present application;
[0070] Figure 5 A schematic diagram of a flow chart of a method for controlling power on and off of a PCIe card provided in an embodiment of the present application for determining whether a PCIe card needs to be powered on and off based on a version number relationship;
[0071] Figure 6 A schematic diagram of a process of powering on and off a PCIe card according to a method for controlling powering on and off a PCIe card provided in an embodiment of the present application;
[0072] Figure 7 A schematic diagram of the structure of a control device for powering on and off a PCIe card provided in an embodiment of the present application;
[0073] Figure 8A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0074] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0075] It should be noted that the terms "including" and "having" and their variations involved in the documents of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0076] The following are explanations of some of the terms that appear in the text:
[0077] (1) PCIe (Peripheral Component Interconnect Express): PCIe is a computer bus interface standard used for data transmission between expansion cards and computer motherboards. PCIe is widely used in various hardware devices such as GPU cards, network cards, and storage devices.
[0078] (2) IPMI (Intelligent Platform Management Interface): IPMI is a new generation universal interface standard that makes hardware management "intelligent". IPMI is a standardized standard, and the most important physical component is the BMC. The biggest advantage of IPMI is that it is independent of the CPU BIOS and OS, so users can monitor the server as long as the power is turned on, whether the server is turned on or off.
[0079] (3) BMC (Baseboard Management Controller): BMC is a dedicated controller used to monitor and manage servers.
[0080] (4) SSH (Secure Shell): SSH is a network security protocol that requires encryption and authentication and is used for remote access and file transfer.
[0081] (5) I2C (Inter-Integrated Circuit): I2C is a bidirectional two-wire synchronous serial bus that only requires two wires to transmit information between devices connected to the bus.
[0082] With the rapid development of the server industry, the application of artificial intelligence is becoming more and more extensive. Customers' application scenarios and needs are becoming more and more diverse. In order to meet customer needs and improve product competitiveness, rapid response and rapid R&D have become the main development model at present.
[0083] When a PCIe card is in use, it often needs to be powered on and off. In the prior art, the process of powering on and off a PCIe card is relatively cumbersome. For example, it is usually necessary to go to the computer room manually to operate, which is time-consuming and laborious, and the operation and maintenance cost is high, resulting in low working efficiency of the PCIe card. Therefore, how to provide a control method for powering on and off a PCIe card to solve the problem of low working efficiency of the PCIe card is of great practical significance.
[0084] To solve the existing technical problems, the embodiment of the present application provides a method and device for controlling power on and off of a PCIe card. During the process of controlling power on and off of a PCIe card, device information of the PCIe card is monitored; the device information includes slot information and status information of the PCIe card; the slot information is used to identify the slot where the PCIe card is located; each slot is provided with a corresponding power control chip; based on the status information and preset conditions, it is determined whether the PCIe card needs to be powered on and off; if the determination result is yes, the PCIe card is powered on and off based on a target power control chip corresponding to the slot information. The method and device can monitor the device information of the PCIe card, and based on the target power control chip corresponding to the slot information, the PCIe card is powered on and off, thereby realizing automatic control of power on and off of the PCIe card, reducing the power on and off time of the PCIe card, and effectively improving the working efficiency of the PCIe card.
[0085] In order to make the invention purpose, technical scheme and advantages of the embodiments of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
[0086] The technical solution provided in the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0087] The PCIe card power-on and power-off control method provided in the embodiment of the present application can be applied to a server or in a server. The following embodiments of the present application are described by taking the PCIe card power-on and power-off control method applied to a server as an example.
[0088] The present application embodiment provides a method for controlling power on and off of a PCIe card, such as Figure 1 As shown, the following steps are included:
[0089] Step S101, monitoring device information of a PCIe card; the device information includes slot information and status information of the PCIe card.
[0090] The slot information is used to identify the slot where the PCIe card is located; each slot is provided with a corresponding power control chip.
[0091] In specific implementation, the server monitors the device information of the PCIe card; the device information includes the slot information and status information of the PCIe card. The slot information is used to identify the slot where the PCIe card is located; each slot is provided with a corresponding power control chip.
[0092] In some embodiments of the present application, the slot information of the PCIe card is obtained through the operating system or the BMC.
[0093] In some optional embodiments, the process of monitoring the device information of the PCIe card in step S101 is specifically as follows:
[0094] Respond to the target monitoring instruction and detect the device information of the PCIe card; wherein the target monitoring instruction is generated based on the target control operation; the target control operation includes the secure channel protocol SSH remote access operation and the BMC KVM remote graphical interface operation.
[0095] In some embodiments of the present application, the PCIe card can be powered on and off through SSH remote access or BMC KVM remote graphical interface, without going to the computer room for operation, thus saving labor costs.
[0096] Step S102: judging whether the PCIe card needs to be powered on or off according to the status information and preset conditions.
[0097] During specific implementation, the server determines whether the PCIe card needs to be powered on or off based on the status information and preset conditions.
[0098] In some optional embodiments, the preset condition includes a first judgment sub-condition; the state information includes a card identifier, operation mode information, and actual performance information of the PCIe card; the operation mode information includes a working mode and an energy-saving mode; the first judgment sub-condition includes target performance information and a performance value relationship of the PCIe card;
[0099] In the above step S102, the process of determining whether the PCIe card needs to be powered on or off according to the status information and the preset conditions is as follows: Figure 2 As shown, this can be achieved by following the steps below:
[0100] Step S201, if the working mode information of the PCIe card is the working mode, determine a first comparison result according to the actual performance information of the PCIe card and the first judgment sub-condition; the first comparison result represents whether the actual performance information and the target performance information satisfy the performance value relationship.
[0101] In specific implementation, if the working mode information of the PCIe card is the working mode, the server determines the first comparison result based on the actual performance information of the PCIe card and the first judgment sub-condition; the first comparison result represents whether the actual performance information and the target performance information satisfy the performance numerical relationship.
[0102] In some embodiments of the present application, the actual performance information includes the bandwidth and rate of the PCIe card; the target performance information includes the maximum bandwidth and maximum rate of the PCIe card.
[0103] Step S202: Based on the first comparison result, determine whether the PCIe card needs to be powered on or off.
[0104] In a specific implementation, the server determines whether the PCIe card needs to be powered on or off based on the first comparison result.
[0105] In some embodiments of the present application, there are multiple pieces of actual performance information; the first comparison result represents whether each piece of actual performance information satisfies a performance numerical relationship with the corresponding target performance information.
[0106] Exemplarily, the actual performance information includes the bandwidth and rate of the PCIe card; the target performance information includes the maximum bandwidth and maximum rate of the PCIe card; the first comparison result can indicate whether the bandwidth satisfies the performance numerical relationship with the corresponding maximum bandwidth, and whether the rate satisfies the performance numerical relationship with the corresponding maximum bandwidth.
[0107] In some embodiments of the present application, the PCIe card can be made to operate according to the target performance information, so that the device can work according to the supportable target performance information, such as the maximum bandwidth rate, so that the performance can be fully utilized.
[0108] In the method of this embodiment, the preset condition includes a first judgment sub-condition; the state information includes a card identifier, operation mode information, and actual performance information of the PCIe card; the operation mode information includes a working mode and an energy-saving mode; the first judgment sub-condition includes the target performance information of the PCIe card and the performance numerical relationship; if the working mode information of the PCIe card is the working mode, a first comparison result is determined according to the actual performance information of the PCIe card and the first judgment sub-condition; the first comparison result indicates whether the actual performance information and the target performance information satisfy the performance numerical relationship; based on the first comparison result, it is determined whether the PCIe card needs to be powered on and off, and the working mode can be determined according to the state information when the power on and off of the PCIe card is controlled, and then the first comparison result is determined according to the actual performance information of the PCIe card and the first judgment sub-condition, and based on the first comparison result, it is determined whether the PCIe card needs to be powered on and off, wherein the first comparison result indicates whether the PCIe card has a fault, and whether the PCIe card needs to be powered on and off can be accurately identified in the working mode, and the power on and off time of the PCIe card is further reduced, which can effectively improve the working efficiency of the PCIe card.
[0109] In one embodiment, the performance value relationship includes that the actual performance information is less than the target performance information; in step S202, based on the first comparison result, it is determined whether the PCIe card needs to be powered on or off, such as Figure 3 As shown, this can be achieved by following the steps below:
[0110] Step S301: If the first comparison result is satisfied, it is determined that the PCIe card needs to be powered on or off.
[0111] During specific implementation, the first comparison result represents whether the actual performance information and the target performance information satisfy a performance numerical relationship; the performance numerical relationship includes that the actual performance information is less than the target performance information; the first comparison result represents whether the actual performance information and the target performance information satisfy a performance numerical relationship; if the first comparison result is satisfied, the server determines that the PCIe card needs to be powered on and off.
[0112] Step S302: If the first comparison result is not satisfied, it is determined that the PCIe card does not need to be powered on or off.
[0113] During specific implementation, the first comparison result represents whether the actual performance information and the target performance information satisfy a performance numerical relationship; the performance numerical relationship includes that the actual performance information is less than the target performance information; the first comparison result represents whether the actual performance information and the target performance information satisfy a performance numerical relationship; if the first comparison result is not satisfied, the server determines that the PCIe card does not need power on and off operations.
[0114] In the method of this embodiment, the performance numerical relationship includes that the actual performance information is less than the target performance information; if the first comparison result is satisfied, it is determined that the PCIe card needs to be powered on and off; if the first comparison result is not satisfied, it is determined that the PCIe card does not need to be powered on and off, thereby providing a mechanism for efficiently identifying whether the PCIe card needs to be powered on and off in a working mode, further reducing the time for powering on and off the PCIe card, and effectively improving the working efficiency of the PCIe card.
[0115] In some optional embodiments, the preset condition includes a second judgment sub-condition; the state information includes a card identifier and actual version information of the PCIe card; the second judgment sub-condition includes a target version information and a version number relationship of the PCIe card;
[0116] In the above step S102, the process of determining whether the PCIe card needs to be powered on or off according to the status information and the preset conditions is as follows: Figure 4 As shown, this can be achieved by following the steps below:
[0117] Step S401, determining a second comparison result according to the actual version information of the PCIe card and the second judgment sub-condition; the second comparison result indicates whether the actual version information and the target version information satisfy a version number relationship.
[0118] In specific implementation, the server determines the second comparison result according to the actual version information of the PCIe card and the second judgment sub-condition; the second comparison result indicates whether the actual version information and the target version information satisfy the version number relationship.
[0119] Step S402: Based on the second comparison result, determine whether the PCIe card needs to be powered on or off.
[0120] In specific implementation, the server determines whether the PCIe card needs to be powered on or off based on the second comparison result.
[0121] In the method of this embodiment, the preset condition includes a second judgment sub-condition; the status information includes a card identifier and actual version information of the PCIe card; the second judgment sub-condition includes the target version information of the PCIe card and the version number relationship; according to the actual version information of the PCIe card and the second judgment sub-condition, a second comparison result is determined; the second comparison result indicates whether the actual version information and the target version information satisfy the version number relationship; based on the second comparison result, whether the PCIe card needs to be powered on and off is judged, wherein the second comparison result indicates whether the PCIe card firmware is the latest version, and it is possible to efficiently detect whether the PCIe card firmware needs to be updated, and accurately identify whether the PCIe card needs to be powered on and off, and it is possible to support efficient firmware updates for PCIe devices, further reduce the power on and off time of the PCIe card, and effectively improve the work efficiency of the PCIe card.
[0122] In one embodiment, the version number relationship includes the actual version information and the target version information changing from being different to being the same; in step S402, based on the second comparison result, determining whether the PCIe card needs to be powered on and off, such as Figure 5 As shown, this can be achieved by following the steps below:
[0123] Step S501: If the second comparison result is satisfied, it is determined that the PCIe card needs to be powered on or off.
[0124] During specific implementation, the second comparison result indicates whether the actual version information and the target version information satisfy the version numbering relationship; the version numbering relationship includes the actual version information and the target version information changing from different to the same; the second comparison result indicates whether the actual version information and the target version information satisfy the version numbering relationship; if the second comparison result is satisfied, the server determines that the PCIe card needs power on and off operations.
[0125] In some embodiments of the present application, it is possible to determine whether the actual version information and the target version information have changed from being different to being the same by monitoring whether the actual version information at the current moment is the same as the target version information, and monitoring whether the actual version information at the previous moment is the same as the target version information.
[0126] In some embodiments of the present application, the following further includes: when it is monitored that the actual version information of the PCIe card is different from the target version information, the firmware of the PCIe card is updated.
[0127] In specific implementation, when it is monitored that the actual version information of the PCIe card is different from the target version information, the firmware of the PCIe card is updated; when it is monitored that the actual version information and the target version information satisfy the version numbering relationship, it is determined that the PCIe card needs to be powered on and off; wherein, the version numbering relationship includes the actual version information and the target version information changing from different to the same.
[0128] Step S502: If the second comparison result is not satisfied, it is determined that the PCIe card does not need to be powered on or off.
[0129] During specific implementation, the second comparison result indicates whether the actual version information and the target version information satisfy the version numbering relationship; the version numbering relationship includes the actual version information and the target version information changing from different to the same; the second comparison result indicates whether the actual version information and the target version information satisfy the version numbering relationship; if the second comparison result is not satisfied, the server determines that the PCIe card does not need power on and off operations.
[0130] In the method of this embodiment, the version number relationship includes that the actual version information and the target version information change from being different to being the same; if the second comparison result is satisfied, it is determined that the PCIe card needs to be powered on and off; if the second comparison result is not satisfied, it is determined that the PCIe card does not need to be powered on and off, thereby providing a mechanism for efficiently identifying whether the PCIe card needs to be powered on and off based on the version number relationship, more efficiently supporting PCIe devices to complete firmware updates, further reducing the power on and off time of the PCIe card, and effectively improving the work efficiency of the PCIe card.
[0131] Step S103: If the judgment result is yes, the PCIe card is powered on and off based on the target power control chip corresponding to the slot information.
[0132] In specific implementation, if the judgment result is yes, the server performs power on and off operations on the PCIe card based on the target power control chip corresponding to the slot information.
[0133] In some embodiments of the present application, the method for controlling power on and off of a PCIe card further includes, after step S103, prohibiting power on and off of the PCIe card if the judgment result is no.
[0134] In some embodiments of the present application, the PCIe card is powered on and off, including generating an IPMI instruction and modifying the power enable signal of the slot where the PCIe card is located, so as to realize powering off and then powering on the PCIe card.
[0135] In some embodiments of the present application, powering off and then powering on the PCIe card can implement a cold restart, thereby ensuring that the PCIe card recovers from a failure and operates normally, or enabling a firmware update to take effect.
[0136] In some embodiments of the present application, the IPMI instruction is used by the BMC to modify the IO pin level of the IO expansion chip; the BMC transmits the IPMI instruction to the IO expansion chip through the I2C signal.
[0137] In some embodiments of the present application, when the server is running a service, a PCIe card has a fault and needs debugging or a firmware upgrade, after-sales or operation and maintenance personnel can obtain the device information of the PCIe card through the operating system, and control the power supply of the slot where the PCIe card is located through the BMC out-of-band management tool IPMI command to realize the power on and off function of the PCIe card. Among them, the device information of the PCIe card includes the PCIe card status and firmware information; the PCIe card status may include status information; and the firmware information includes slot information.
[0138] In some embodiments of the present application, a certain PCIe slot can be powered on and off without affecting the operating status of the entire machine, and PCIe card faults can be debugged or firmware upgraded without affecting the business.
[0139] In some optional embodiments, in step S103, the process of powering on and off the PCIe card based on the target power control chip corresponding to the slot information is as follows: Figure 6 As shown, this can be achieved by following the steps below:
[0140] Step S601, obtaining an extended chip address of a target power control chip corresponding to the slot information.
[0141] In specific implementation, the server obtains the expansion chip address of the target power control chip corresponding to the slot information, wherein the expansion chip address is the address of the IO expansion chip used to control the target power control chip; the signal of the pin of the IO expansion chip used to control the target power control chip is the enable signal of the target power control chip.
[0142] Step S602, generating a target IPMI instruction according to the extended chip address; the target IPMI instruction includes a first target IPMI instruction and a second target IPMI instruction.
[0143] During specific implementation, the server generates a target IPMI instruction according to the extended chip address; the target IPMI instruction includes a first target IPMI instruction and a second target IPMI instruction.
[0144] Step S603: According to the first target IPMI instruction, the power supply of the slot where the PCIe card is located is controlled to power off the PCIe card.
[0145] During specific implementation, the server controls the power supply of the slot where the PCIe card is located according to the first target IPMI instruction to power off the PCIe card.
[0146] In some embodiments of the present application, there is a power control chip for each slot. These chips are used to determine the power on and off of the PCIe card slot, control the different power signals of the PCIe card, and implement independent power control chip control for each PCIe card slot, which is more efficient.
[0147] In some embodiments of the present application, PCIe signals are used for PCIe card identification and operation signals; I2C signals are used for mainboard BMC to manage the power supply and monitoring signals of PCIe cards.
[0148] In some embodiments of the present application, the signal of the IO expansion chip pin is the enable signal of the power control chip; the BMC controls the high and low levels of the IO pin of the IO expansion chip through the I2C signal to enable / disable the power control chip. In this embodiment, each PCIe slot has an independent power control chip, thereby realizing independent power on and off of the PCIe card.
[0149] In some embodiments of the present application, when the BMC hangs or restarts, the IO level of the IO expansion chip remains unchanged, the enable signal remains unchanged, and the power supply of the PCIe card remains unchanged, providing a fault-tolerant mechanism for controlling the power on and off of the PCIe card, making the operation of the PCIe card more stable.
[0150] Step S604: According to the second target IPMI instruction, the power supply of the slot where the PCIe card is located is controlled to power on the PCIe card.
[0151] In specific implementation, after the server controls the power supply of the slot where the PCIe card is located to power on the PCIe card, the server further controls the power supply of the slot where the PCIe card is located to power off the PCIe card according to the first target IPMI instruction.
[0152] The method of this embodiment obtains the extended chip address of the target power control chip corresponding to the slot information; generates a target IPMI instruction according to the extended chip address; the target IPMI instruction includes a first target IPMI instruction and a second target IPMI instruction; according to the first target IPMI instruction, controls the power supply of the slot where the PCIe card is located to realize the power-off operation of the PCIe card; according to the second target IPMI instruction, controls the power supply of the slot where the PCIe card is located to realize the power-on operation of the PCIe card, thereby providing a mechanism for powering on the PCIe card through the IPMI instruction, realizing automatic generation of IPMI instructions to control the PCIe card to power on, further reducing the power-on and power-off time of the PCIE card, and effectively improving the working efficiency of the PCIe card.
[0153] The PCIe card power-on and power-off control method provided in the embodiment of the present application monitors the device information of the PCIe card during the process of controlling the power-on and power-off of the PCIe card; the device information includes the slot information and status information of the PCIe card; the slot information is used to identify the slot where the PCIe card is located; each slot is provided with a corresponding power control chip; according to the status information and preset conditions, it is judged whether the PCIe card needs to be powered on and off; if the judgment result is yes, the PCIe card is powered on and off based on the target power control chip corresponding to the slot information, the device information of the PCIe card can be monitored, and the PCIe card is powered on and off based on the target power control chip corresponding to the slot information, so as to realize automatic control of the power-on and power-off operations of the PCIe card, reduce the power-on and power-off time of the PCIe card, and effectively improve the working efficiency of the PCIe card.
[0154] Based on the same inventive concept, a PCIe card power-on and power-off control device is also provided in the embodiment of the present application. Since the device corresponds to the PCIe card power-on and power-off control method provided in the embodiment of the present application, and the principle of solving the problem by the device is similar to that of the method, the implementation of the device can refer to the implementation of the above method, and the repeated parts will not be repeated.
[0155] Figure 7 A schematic diagram of the structure of a control device for powering on and off a PCIe card provided in an embodiment of the present application is shown. Figure 7 As shown, the PCIe card power-on and power-off control device includes an information acquisition module 701 , an information analysis module 702 and a control execution module 703 .
[0156] The information acquisition module 701 is used to monitor the device information of the PCIe card; the device information includes the slot information and status information of the PCIe card; the slot information is used to identify the slot where the PCIe card is located; each slot is provided with a corresponding power control chip;
[0157] The information analysis module 702 is used to determine whether the PCIe card needs to be powered on or off according to the status information and preset conditions;
[0158] The control execution module 703 is used to, if the judgment result is yes, perform power on and off operations on the PCIe card based on the target power control chip corresponding to the slot information.
[0159] In an optional embodiment, the preset condition includes a first judgment sub-condition; the state information includes a card identifier, operation mode information, and actual performance information of the PCIe card; the operation mode information includes a working mode and an energy-saving mode; the first judgment sub-condition includes target performance information and a performance value relationship of the PCIe card; the information analysis module 702 is specifically used to:
[0160] If the working mode information of the PCIe card is the working mode, a first comparison result is determined according to the actual performance information of the PCIe card and the first judgment sub-condition; the first comparison result indicates whether the actual performance information and the target performance information satisfy a performance value relationship;
[0161] Based on the first comparison result, it is determined whether the PCIe card needs to be powered on or off.
[0162] In an optional embodiment, the performance value relationship includes that the actual performance information is less than the target performance information; the information analysis module 702 is specifically configured to:
[0163] If the first comparison result is satisfied, it is determined that the PCIe card needs to be powered on or off;
[0164] If the first comparison result is not satisfied, it is determined that the PCIe card does not need to be powered on or off.
[0165] In an optional embodiment, the preset condition includes a second judgment sub-condition; the state information includes a card identifier and actual version information of the PCIe card; the second judgment sub-condition includes a target version information and a version number relationship of the PCIe card;
[0166] The information analysis module 702 is specifically used for:
[0167] Determine a second comparison result according to the actual version information of the PCIe card and the second judgment sub-condition; the second comparison result indicates whether the actual version information and the target version information satisfy the version number relationship;
[0168] Based on the second comparison result, it is determined whether the PCIe card needs to be powered on or off.
[0169] In an optional embodiment, the version number relationship includes that the actual version information and the target version information change from being different to being the same; the information analysis module 702 is specifically used to:
[0170] If the second comparison result is satisfied, it is determined that the PCIe card needs to be powered on or off;
[0171] If the second comparison result is not satisfied, it is determined that the PCIe card does not need to be powered on or off.
[0172] In an optional embodiment, the control execution module 703 is specifically configured to:
[0173] Obtaining an extended chip address of a target power control chip corresponding to the slot information;
[0174] Generate a target IPMI instruction according to the extended chip address; the target IPMI instruction includes a first target IPMI instruction and a second target IPMI instruction;
[0175] According to the first target IPMI instruction, the power supply of the slot where the PCIe card is located is controlled to power off the PCIe card;
[0176] According to the second target IPMI instruction, the power supply of the slot where the PCIe card is located is controlled to realize the power-on operation of the PCIe card.
[0177] In an optional embodiment, the information acquisition module 701 is specifically used to:
[0178] Respond to the target monitoring instruction and detect the device information of the PCIe card; wherein the target monitoring instruction is generated based on the target control operation; the target control operation includes the secure channel protocol SSH remote access operation and the BMC KVM remote graphical interface operation.
[0179] Based on the same inventive concept as the above method embodiment, an electronic device is also provided in the embodiment of the present application. The electronic device can be used to control the power on and off of a PCIe card. In the embodiment of the present application, the electronic device can be a server or a terminal device. In one embodiment, the electronic device can be a server. In this embodiment, the structure of the electronic device can be as follows: Figure 8 As shown, it includes a memory 801 , a communication module 803 and one or more processors 802 .
[0180] The memory 801 is used to store computer programs executed by the processor 802. The memory 801 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required for running the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.
[0181] The memory 801 may be a volatile memory, such as a random-access memory (RAM); the memory 801 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), or the memory 801 may be any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 801 may be a combination of the above memories.
[0182] The processor 802 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 802 is used to implement the above-mentioned PCIe card power-on and power-off control method when calling the computer program stored in the memory 801 .
[0183] The communication module 803 is used to communicate with the server and other terminal devices.
[0184] The specific connection medium between the memory 801, the communication module 803 and the processor 802 is not limited in the embodiment of the present application. Figure 8 In the embodiment, the memory 801 and the processor 802 are connected via a bus 804. The bus 804 is Figure 8 The connections between other components are shown in bold lines, and are not intended to be limiting. Bus 804 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 8Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0185] According to one aspect of the present application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the control method for powering on and off the PCIe card in the above-mentioned embodiment. The program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0186] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A method for controlling power on and off of a PCIe card, characterized in that: The method comprises: Monitor the device information of the PCIe card; the device information includes the slot information and status information of the PCIe card; the slot information is used to identify the slot where the PCIe card is located; each slot is provided with a corresponding power control chip; Determine whether the PCIe card needs to be powered on or off according to the status information and preset conditions; If the judgment result is yes, the PCIe card is powered on and off based on the target power control chip corresponding to the slot information.
2. The method according to claim 1, characterized in that: The preset condition includes a first judgment sub-condition; the state information includes a card identification, operation mode information, and actual performance information of the PCIe card; the operation mode information includes a working mode and an energy-saving mode; the first judgment sub-condition includes a target performance information of the PCIe card and a performance value relationship; The determining, according to the status information and the preset condition, whether the PCIe card needs to be powered on or off includes: If the working mode information of the PCIe card is a working mode, a first comparison result is determined according to the actual performance information of the PCIe card and the first judgment sub-condition; the first comparison result indicates whether the actual performance information and the target performance information satisfy the performance value relationship; Based on the first comparison result, it is determined whether the PCIe card needs to be powered on or off.
3. The method according to claim 2, characterized in that The performance numerical relationship includes that the actual performance information is less than the target performance information; and judging whether the PCIe card needs to be powered on or off based on the first comparison result includes: If the first comparison result is satisfied, determining that the PCIe card needs to be powered on or off; If the first comparison result is not satisfied, it is determined that the PCIe card does not need to be powered on or off.
4. The method according to claim 1, characterized in that: The preset condition includes a second judgment sub-condition; the state information includes a card identifier and actual version information of the PCIe card; the second judgment sub-condition includes a target version information and a version number relationship of the PCIe card; The determining, according to the status information and the preset condition, whether the PCIe card needs to be powered on or off includes: Determining a second comparison result according to the actual version information of the PCIe card and the second judgment sub-condition; the second comparison result indicates whether the actual version information and the target version information satisfy the version number relationship; Based on the second comparison result, it is determined whether the PCIe card needs to be powered on or off.
5. The method according to claim 4, characterized in that The version number relationship includes that the actual version information and the target version information change from being different to being the same; and judging whether the PCIe card needs to be powered on and off based on the second comparison result includes: If the second comparison result is satisfied, determining that the PCIe card needs to be powered on or off; If the second comparison result is not satisfied, it is determined that the PCIe card does not need to be powered on or off.
6. The method according to claim 1, characterized in that The powering on and off operations on the PCIe card based on the target power control chip corresponding to the slot information include: Acquire an extended chip address of a target power control chip corresponding to the slot information; Generate a target IPMI instruction according to the extended chip address; the target IPMI instruction includes a first target IPMI instruction and a second target IPMI instruction; According to the first target IPMI instruction, controlling the power supply of the slot where the PCIe card is located to power off the PCIe card; According to the second target IPMI instruction, the power supply of the slot where the PCIe card is located is controlled to power on the PCIe card.
7. The method according to claim 1, characterized in that The monitoring of the device information of the PCIe card includes: In response to the target monitoring instruction, the device information of the PCIe card is detected; wherein the target monitoring instruction is generated based on the target control operation; the target control operation includes the secure channel protocol SSH remote access operation and the BMC KVM remote graphical interface operation.
8. A control device for powering on and off a PCIe card, characterized in that: The device comprises: An information acquisition module, used for monitoring the device information of the PCIe card; the device information includes the slot information and status information of the PCIe card; the slot information is used for identifying the slot where the PCIe card is located; each slot is provided with a corresponding power control chip; An information analysis module, used to determine whether the PCIe card needs to be powered on or off according to the status information and preset conditions; The control execution module is used to perform power on and off operations on the PCIe card based on the target power control chip corresponding to the slot information if the judgment result is yes.
9. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program executable on the processor, and when the computer program is executed by the processor, the method according to any one of claims 1 to 7 is implemented.