Firmware upgrade method, device, storage medium, electronic device and computer program product
The board management controller receives and verifys firmware upgrade requests, automatically identifys and upgrades the server hardware equipment, solves the problem of low efficiency during firmware upgrades, and realizes automatic batch upgrade without downtime, improving efficiency and reliability.
Patent Information
- Application Number
- CN202410858379.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2044-06-28
AI Technical Summary
In the prior art, the server hardware equipment firmware upgrade is too low, and the machine shutdown operation is required and the process is cumbersome.
Receive firmware upgrade requests from the management client through the substrate management controller, establish a network connection, detect the environment status, parse and verify the firmware file, determine the equipment to be upgraded based on the file identification, and perform data interaction based on the PLDM protocol to upgrade, support automation and Massive upgrade.
It realizes automated and batch firmware upgrades without downtime, improves firmware upgrade efficiency, and reduces operating steps and error rates.
Smart Images

Figure CN118394388B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the server field, and specifically, to a firmware upgrade method, device, storage medium, electronic device, and computer program product. Background Art
[0002] Currently, servers are typically connected to multiple hardware devices, such as network cards and hard drives. Firmware, as software embedded in hardware devices, is crucial for implementing device functions and improving server performance. However, traditional firmware upgrade methods have many limitations, such as requiring the server to be shut down during the upgrade process, requiring on-site operation at the server, and cumbersome operations, requiring manual firmware backup and downloading.
[0003] Therefore, in the related art, there is a problem of low efficiency when performing firmware upgrades on hardware devices on a server.
[0004] In the related art, there is no effective solution to the problem of low efficiency when performing firmware upgrades on hardware devices on servers. Summary of the Invention
[0005] The embodiments of the present application provide a firmware upgrade method, apparatus, storage medium, electronic device, and computer program product to at least solve the problem of low efficiency in firmware upgrade of hardware devices on a server in the related art.
[0006] According to one embodiment of the present application, a firmware upgrade method is applied to a baseboard management controller, the baseboard management controller is connected to a server, the server is connected to multiple devices, the multiple devices all support a first communication protocol, and the server manages the multiple devices through the baseboard management controller, including: receiving a firmware upgrade request sent by a management client to the server, wherein the firmware upgrade request includes a firmware upgrade file, verification information of the firmware upgrade file, and a first file identifier of the firmware upgrade file, and the firmware upgrade file is used to perform a device upgrade; determining a device to be upgraded from the multiple devices according to the first file identifier of the firmware upgrade file; and sending the firmware upgrade file to the device to be upgraded so that the device to be upgraded performs a firmware upgrade, wherein the baseboard management controller and the device to be upgraded perform data exchange based on the first communication protocol.
[0007] In an exemplary embodiment, before receiving a firmware upgrade request sent by the management client to the server, the method further includes: initiating a network connection request to the multiple devices through a first link, wherein the first link is established based on the first communication protocol, and the devices on the first link include the baseboard management controller and the multiple devices; for each of the multiple devices, upon determining that response information of each device to the network connection request is received, establishing a network connection with each device; obtaining device information of each device with which the network connection has been established, and assigning a device identifier to each device based on different device information, wherein the device identifier of each device is unique.
[0008] In an exemplary embodiment, after receiving a firmware upgrade request sent by the management client to the server, the method further includes: performing an upgrade environment detection on the server, wherein the upgrade environment detection includes at least one of the following: detecting whether the operating status of the server is normal; detecting whether the operating temperature of the server is within a preset temperature range; detecting whether the power supply of the server is normal; detecting whether the network connection of the server is normal; and if it is determined that the server has not passed the upgrade environment detection, ending the firmware upgrade and responding to the management client with an upgrade failure message.
[0009] In an exemplary embodiment, the method further includes: when it is determined that the server passes the upgrade environment detection, parsing the firmware upgrade file and verification information of the firmware upgrade file from the firmware upgrade request; performing validity verification and integrity verification on the firmware upgrade file based on the verification information; when it is determined that the firmware upgrade file fails the validity verification and the integrity verification, ending the firmware upgrade and responding with an upgrade failure message to the management client.
[0010] In an exemplary embodiment, determining a device to be upgraded from the multiple devices based on the first file identifier of the firmware upgrade file includes: obtaining a first device identifier of a target device, wherein the target device is any device among the devices that establish a network connection with the baseboard management controller; and determining the target device as the device to be upgraded when it is determined that the first device identifier is consistent with the first file identifier.
[0011] In an exemplary embodiment, the firmware upgrade file is sent to the device to be upgraded so that the device to be upgraded performs a firmware upgrade, including: when the firmware upgrade file includes multiple sub-firmware upgrade files, traversing each sub-firmware upgrade file in the firmware upgrade file, wherein each sub-firmware upgrade file is used to upgrade a device; determining the target sub-firmware upgrade file currently being traversed from the multiple sub-firmware upgrade files, obtaining the second file identifier of the target sub-firmware upgrade file, and sending a device upgrade notification to the target device to be upgraded according to the second file identifier of the target sub-firmware upgrade file, wherein the second device identifier of the target device to be upgraded is the same as the second device identifier of the target sub-firmware upgrade file. , the device upgrade notification is used to notify the device to enter the upgrade state; according to the second file identifier of the target sub-firmware upgrade file, the target sub-firmware upgrade file is sent to the target device to be upgraded, so that the target device to be upgraded performs file verification on the target sub-firmware upgrade file; when it is determined that the upgrade response result of the target device to be upgraded is received, the next target sub-firmware upgrade file to be traversed is upgraded, wherein the upgrade response result is sent by the target device to be upgraded after completing the file verification of the target sub-firmware upgrade file and completing the upgrade; the device upgrade status is determined according to the multiple upgrade response results received, and the device upgrade status is responded to the management client.
[0012] In an exemplary embodiment, the method further includes: receiving a firmware upgrade query request sent by the management client to the server; calling a query interface of the server to obtain a completion progress of the firmware upgrade request; and responding to the management client with the completion progress.
[0013] In an exemplary embodiment, after sending the firmware upgrade file to the device to be upgraded so that the device to be upgraded performs the firmware upgrade, the method further includes: sending a first loading command to the device that has completed the upgrade, wherein the first loading command is used to instruct the device that has completed the upgrade to load the upgraded firmware file upon the next restart; or, sending a second loading command to the device that has completed the upgrade, wherein the second loading command is used to instruct the device that has completed the upgrade to restart and load the upgraded firmware file after restarting.
[0014] In an exemplary embodiment, sending the firmware upgrade file to the device to be upgraded includes: using a public key to asymmetrically encrypt the firmware upgrade file to obtain an encrypted firmware upgrade file; and sending the encrypted firmware upgrade file to the device to be upgraded.
[0015] In an exemplary embodiment, the method further includes: receiving a decryption response result of the device to be upgraded, wherein the decryption response result is sent after the device to be upgraded completes decrypting the encrypted firmware upgrade file using a private key, and the private key is only used to decrypt the file encrypted using the public key.
[0016] In an exemplary embodiment, after sending the firmware upgrade file to the device to be upgraded, the method further includes: if it is determined that the upgrade of the device to be upgraded has failed, resending the firmware upgrade file to the device to be upgraded within a preset time period so that the device to be upgraded performs the firmware upgrade; if it is determined that one of the preset conditions is met, stopping sending the firmware upgrade file, wherein the preset conditions include: the number of sending times reaches a preset maximum number of sending times, and the current moment has exceeded the preset time period.
[0017] According to another embodiment of the present application, a firmware upgrade device is provided, including: a receiving module for receiving a firmware upgrade request sent by a management client to the server, wherein the firmware upgrade request includes a firmware upgrade file, verification information of the firmware upgrade file, and a first file identifier of the firmware upgrade file, and the firmware upgrade file is used to perform a device upgrade; a determination module for determining a device to be upgraded from the multiple devices according to the first file identifier of the firmware upgrade file; an upgrading module for sending the firmware upgrade file to the device to be upgraded so that the device to be upgraded performs a firmware upgrade, wherein the baseboard management controller and the device to be upgraded perform data interaction based on the first communication protocol.
[0018] In an exemplary embodiment, the firmware upgrade device further includes: a connection module, used to initiate a network connection request to the multiple devices through a first link, wherein the first link is established based on the first communication protocol, and the devices on the first link include the baseboard management controller and the multiple devices; for each of the multiple devices, upon determining that response information of each device to the network connection request is received, establishing a network connection with each device; obtaining device information of each device with which a network connection has been established, and assigning a device identifier to each device based on different device information, wherein the device identifier of each device is unique.
[0019] In an exemplary embodiment, the firmware upgrade device further includes: a detection module for performing an upgrade environment detection on the server, wherein the upgrade environment detection includes at least one of the following: detecting whether the operating status of the server is normal; detecting whether the operating temperature of the server is within a preset temperature range; detecting whether the power supply of the server is normal; detecting whether the network connection of the server is normal; and if it is determined that the server has not passed the upgrade environment detection, terminating the firmware upgrade and responding to the management client with an upgrade failure message.
[0020] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the steps of any one of the above method embodiments when run.
[0021] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0022] According to another embodiment of the present application, a computer program product is provided, including a computer program, which implements the steps in the above method embodiment when executed by a processor.
[0023] This application can receive a firmware upgrade request sent by a management client to a server, obtain the firmware upgrade file used to upgrade the device, as well as the firmware upgrade file verification information and file identifier from the firmware upgrade request, determine the device to be upgraded from multiple devices based on the file identifier of the firmware upgrade file, and then send the firmware upgrade file to the device to be upgraded for upgrade. Therefore, the problem of low efficiency when performing firmware upgrades on hardware devices on a server in the related art can be solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 This is a hardware structure block diagram of a server device for a firmware upgrade method according to an embodiment of the present application;
[0025] Figure 2 is a flowchart of a firmware upgrade method according to an embodiment of the present application;
[0026] Figure 3 is a schematic flow chart of a firmware upgrade method according to an embodiment of the present application (I);
[0027] Figure 4 is a schematic flow chart (II) of a firmware upgrade method according to an embodiment of the present application;
[0028] Figure 5is a schematic diagram of a firmware upgrade method according to an embodiment of the present application (1);
[0029] Figure 6 Schematic diagram (2) of a firmware upgrade method according to an embodiment of the present application;
[0030] Figure 7 It is a structural block diagram of a firmware upgrade device according to an embodiment of the present application. DETAILED DESCRIPTION
[0031] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0032] It should be noted that the terms "first", "second", etc. in the description and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0033] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 This is a hardware structure diagram of a server device of a firmware upgrade method according to an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. The server device may also include a transmission device 106 and an input / output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0034] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the firmware upgrade method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above-mentioned firmware upgrade method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories can be connected to the server 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 a combination thereof.
[0035] Transmission device 106 is used to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by a communication provider of the server device. In one embodiment, transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0036] In this embodiment, a firmware upgrade method is provided, which is applied to a baseboard management controller, wherein the baseboard management controller is connected to a server, the server is connected to multiple devices, and the multiple devices all support a first communication protocol. The server manages the multiple devices through the baseboard management controller. Figure 2 is a flowchart of a firmware upgrade method according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0037] Step S202: receiving a firmware upgrade request sent by the management client to the server, wherein the firmware upgrade request includes a firmware upgrade file, verification information of the firmware upgrade file, and a first file identifier of the firmware upgrade file, wherein the firmware upgrade file is used to upgrade the device;
[0038] Optionally, in the above step S202, the management client may be a client remotely connected to the server, or may be a local management tool locally connected to the server.
[0039] Step S204, determining a device to be upgraded from the multiple devices according to the first file identifier of the firmware upgrade file;
[0040] Step S206: sending the firmware upgrade file to the device to be upgraded, so that the device to be upgraded performs firmware upgrade, wherein the baseboard management controller and the device to be upgraded perform data exchange based on the first communication protocol.
[0041] It should be noted that in this embodiment, the first communication protocol is PLDM (Platform Level Data Model), an open standard for monitoring and managing computer hardware. This standard supports MCTP (Message Coordination and Transport Protocol) and PCIE (Peripheral Component Interconnect Express). Transmitting the PLDM protocol over PCIE via MCTP improves device compatibility, data transmission capabilities, and scalability, ensuring data transmission stability and accuracy.
[0042] Through the above steps, the server can receive a firmware upgrade request sent by the management client to the server, obtain the firmware upgrade file used to upgrade the device, as well as the firmware upgrade file verification information and file identifier from the firmware upgrade request, determine the device to be upgraded from multiple devices based on the file identifier of the firmware upgrade file, and then send the firmware upgrade file to the device to be upgraded for upgrading. This solves the problem of low efficiency in firmware upgrades for hardware devices on the server in the related art.
[0043] In an exemplary embodiment, before executing the above step S202 to receive the firmware upgrade request sent by the management client to the server, the method also includes: initiating a network connection request to the multiple devices through a first link, wherein the first link is established based on the first communication protocol, and the devices on the first link include the baseboard management controller and the multiple devices; for each of the multiple devices, upon determining that response information of each device to the network connection request is received, establishing a network connection with each device; obtaining device information of each device to which the network connection has been established, and assigning a device identifier to each device based on different device information, wherein the device identifier of each device is unique.
[0044] Optionally, in the above embodiment, the first link is a PCIE link, and multiple devices include but are not limited to network cards, raid cards and other devices that support the PCIE protocol, wherein the BMC (Baseboard Management Controller) is also a device on the PCIE link. The above devices are automatically registered on the PCIE link after the server is powered on. The BMC will send a connection request to the PCIE device registered on the PCIE link. For the device that responds to the BMC's connection request, the BMC starts to read the basic information of the device and assigns a unique device identifier EID (endpoint ID) to the device.
[0045] In an exemplary embodiment, after executing the above step S202 to receive the firmware upgrade request sent by the management client to the server, the method also includes: performing an upgrade environment detection on the server, and the upgrade environment detection includes at least one of the following: detecting whether the operating status of the server is normal; detecting whether the operating temperature of the server is within a preset temperature range; detecting whether the power supply of the server is normal; detecting whether the network connection of the server is normal; if it is determined that the server has not passed the upgrade environment detection, ending the firmware upgrade and responding to the management client with an upgrade failure message.
[0046] Optionally, in the above embodiment, before performing the firmware upgrade, the BMC will perform a series of environmental checks, including but not limited to the server's operating status, network fluctuations, power supply stability, temperature control, etc., to ensure a smooth upgrade process.
[0047] Through the above embodiments, the probability of server failure during the upgrade process can be reduced, and the success rate of the firmware upgrade can be greatly improved.
[0048] In an exemplary embodiment, the method further includes: when it is determined that the server passes the upgrade environment detection, parsing the firmware upgrade file and verification information of the firmware upgrade file from the firmware upgrade request; performing validity verification and integrity verification on the firmware upgrade file based on the verification information; when it is determined that the firmware upgrade file fails the validity verification and the integrity verification, ending the firmware upgrade and responding with an upgrade failure message to the management client.
[0049] Optionally, in the above embodiment, after the BMC completes and passes the upgrade environment test, it begins verifying the firmware upgrade file to verify its integrity and validity, thereby ensuring the legitimacy of the received firmware upgrade file. This specific verification process can be implemented using a hash check, CRC (Cyclic Redundancy Check), or other verification methods, and is not limited to this embodiment of the present application.
[0050] In an exemplary embodiment, the above-mentioned step S204 determines the specific execution process of the device to be upgraded from the multiple devices based on the first file identifier of the firmware upgrade file, including: obtaining the first device identifier of the target device, wherein the target device is any device among the devices that establish a network connection with the baseboard management controller; when it is determined that the first device identifier is consistent with the first file identifier, the target device is determined as the device to be upgraded.
[0051] Optionally, in the above embodiment, the BMC interacts with the connected PCIE devices via the PCIE protocol, reads the device identifier of each device, and checks whether the file identifier in the firmware upgrade file is consistent with the device identifier. If they are consistent, it indicates that the device's firmware needs to be upgraded, and the device is added to the list of devices to be upgraded. If they are inconsistent, the device is not upgraded, and the next device is checked to see if it needs to be upgraded.
[0052] Through the above embodiment, when sending a firmware upgrade file, there is no need to specify an upgrade device for the firmware upgrade file, and the BMC can automatically match the corresponding device to be upgraded according to the file identifier.
[0053] In an exemplary embodiment, the process of sending the firmware upgrade file to the device to be upgraded in the above step S206 so that the device to be upgraded performs a firmware upgrade specifically includes the following: when the firmware upgrade file includes multiple sub-firmware upgrade files, traversing each sub-firmware upgrade file in the firmware upgrade file, wherein each sub-firmware upgrade file is used to upgrade a device; determining the target sub-firmware upgrade file currently being traversed from the multiple sub-firmware upgrade files, obtaining the second file identifier of the target sub-firmware upgrade file, and sending a device upgrade notification to the target device to be upgraded according to the second file identifier of the target sub-firmware upgrade file, wherein the second device identifier of the target device to be upgraded is the same as the second device identifier of the target device to be upgraded; The second file identifier of the target sub-firmware upgrade file is the same, and the device upgrade notification is used to notify the device to enter the upgrade state; the target sub-firmware upgrade file is sent to the target device to be upgraded according to the second file identifier of the target sub-firmware upgrade file, so that the target device to be upgraded performs a file verification on the target sub-firmware upgrade file; when it is determined that the upgrade response result of the target device to be upgraded is received, the next target sub-firmware upgrade file to be traversed is upgraded, wherein the upgrade response result is sent by the target device to be upgraded after completing the file verification of the target sub-firmware upgrade file and completing the upgrade; the device upgrade status is determined according to the multiple upgrade response results received, and the device upgrade status is responded to the management client.
[0054] Optionally, in the above embodiment, the firmware upgrade file may include upgrade files for multiple devices at the same time, and the devices may be upgraded in batches. The BMC may determine all devices to be upgraded based on the firmware upgrade file, and then send an upgrade notification to each device to be upgraded in turn. After receiving the upgrade notification, the device to be upgraded begins to enter the upgrade state, and the corresponding firmware upgrade file is sent to the device to be upgraded. After receiving the upgrade file, the device to be upgraded performs a legitimacy check, and starts upgrading after the check passes. After the upgrade is completed, the device to be upgraded sends a response result to the BMC, and the BMC starts upgrading the next device to be upgraded until all devices to be upgraded have completed the upgrade.
[0055] Through the above embodiments, the server firmware can be upgraded automatically and in batches without the need to manually upgrade each device one by one, thus reducing the number of operation steps in the firmware upgrade process and lowering the error rate of the firmware upgrade.
[0056] In an exemplary embodiment, the method further includes: receiving a firmware upgrade query request sent by the management client to the server; calling a query interface of the server to obtain a completion progress of the firmware upgrade request; and responding to the management client with the completion progress.
[0057] Optionally, in the above embodiment, the management client may actively call the query interface to obtain the device upgrade progress in real time, or the BMC may feed back the upgrade result to the management client after the upgrade is completed.
[0058] In an exemplary embodiment, after executing the above step S206 to send the firmware upgrade file to the device to be upgraded so that the device to be upgraded performs the firmware upgrade, the method further includes: sending a first loading command to the device that has completed the upgrade, wherein the first loading command is used to instruct the device that has completed the upgrade to load the upgraded firmware file at the next restart; or, sending a second loading command to the device that has completed the upgrade, wherein the second loading command is used to instruct the device that has completed the upgrade to restart and load the upgraded firmware file after restarting.
[0059] Optionally, in the above embodiment, after all devices to be upgraded have completed upgrading, the new firmware may be loaded when the server is restarted next time, or the BMC may notify the devices to be upgraded to restart immediately and then load the new firmware.
[0060] Through the above embodiments, the firmware can be upgraded while the server is running normally, without shutting down the server for upgrading, thereby improving the efficiency of the firmware upgrade.
[0061] In an exemplary embodiment, the specific execution process of the above-mentioned step S206 of sending the firmware upgrade file to the device to be upgraded includes: using the public key to asymmetrically encrypt the firmware upgrade file to obtain the encrypted firmware upgrade file; and sending the encrypted firmware upgrade file to the device to be upgraded.
[0062] In an exemplary embodiment, the method further includes: receiving a decryption response result of the device to be upgraded, wherein the decryption response result is sent after the device to be upgraded completes decrypting the encrypted firmware upgrade file using a private key, and the private key is only used to decrypt the file encrypted using the public key.
[0063] Optionally, in the above embodiment, in order to prevent the firmware upgrade file from being maliciously tampered with during transmission, the firmware upgrade file can be encrypted before sending. The encryption method can be asymmetric encryption or symmetric encryption, which can be adjusted according to the actual application situation.
[0064] Through the above embodiments, it is ensured that the firmware upgrade file is subject to strict security verification during the transmission process, so that only legal and untampered firmware can be installed.
[0065] In an exemplary embodiment, after executing the above-mentioned step S206 to send the firmware upgrade file to the device to be upgraded, the method further includes: if it is determined that the upgrade of the device to be upgraded fails, resending the firmware upgrade file to the device to be upgraded within a preset time period so that the device to be upgraded performs the firmware upgrade; if it is determined that one of the preset conditions is met, stopping sending the firmware upgrade file, wherein the preset conditions include: the number of sending times reaches the preset maximum number of sending times, and the current moment has exceeded the preset time period.
[0066] Optionally, in the above embodiment, for example, a preset time period of 5 minutes can be set, and the preset maximum number of sending times can be 5 words. Then, within 5 minutes after the upgrade of the device to be upgraded fails, the firmware upgrade file is resent and the upgrade is attempted again until the upgrade is successful. If the upgrade is still not successful after 5 minutes or after 5 sending times, the sending is stopped and it is determined that the upgrade has failed.
[0067] Obviously, the embodiments described above are only part of the embodiments of this application, not all of them. In order to better understand the above firmware upgrade method, the above process is described below in conjunction with the embodiments, but it is not intended to limit the technical solutions of the embodiments of this application. Specifically:
[0068] In an optional embodiment, Figure 3 : is a schematic flow chart of a firmware upgrade method according to an embodiment of the present application, which specifically includes the following steps:
[0069] Step S301: After the server is powered on, the BMC searches for PCIE devices on the server's PCIE link through the MCTP protocol and the PCIE protocol and obtains device information.
[0070] Step S302: The remote management client or the local management tool sends a firmware upgrade request to the BMC via an HTTP-based interface (e.g., a Web interface or a Redfish interface).
[0071] Step S303: After receiving the firmware upgrade request, the BMC begins preparing the upgrade environment, reading and parsing the firmware upgrade file, obtaining the device identification information in the PCIE device through the MCTP protocol and the PCIE protocol, matching the identification information of the firmware file, searching for upgradeable devices, obtaining all devices to be upgraded, and starting the upgrade process;
[0072] Step S304: After all devices to be upgraded are upgraded, the new firmware can be loaded after the next server restart. Alternatively, the device can be notified to restart and load the new firmware immediately through the MCTP protocol and PCIE protocol to complete the firmware upgrade operation.
[0073] Optionally, in the above step S303, after obtaining all the devices to be upgraded, the upgrade process is started as follows: Figure 4 As shown, the specific steps include:
[0074] Step S401: The BMC notifies the PCIE device to be upgraded to enter the upgrade state;
[0075] Step S402: The PCIE device to be upgraded enters upgrade mode and starts receiving firmware upgrade files;
[0076] Step S403: The PCIE device to be upgraded starts upgrading after completing verification of the received firmware upgrade file;
[0077] Step S404: The PCIE device upgrade is completed, and the upgrade result is responded to the BMC, and step S401 is executed. The BMC continues to notify the next PCIE device to be upgraded to enter the upgrade state until all the devices to be upgraded have completed the upgrade.
[0078] Through the above embodiments, automated firmware upgrade file preparation, transmission and verification can be achieved, reducing the operational difficulty and error rate of firmware upgrades, and firmware upgrades can be performed while the server is running normally, without the need to shut down the server for upgrades, greatly improving the efficiency of firmware upgrades.
[0079] In an optional embodiment, Figure 5 Schematic diagram of the connection between the BMC and the PCIE device in the embodiment of the present application, a schematic diagram of the structure of the system of the firmware upgrade method, such as Figure 5 As shown in the figure, the server's PCH (Platform Controller Hub) and CPU (Central Processing Unit) communicate with PCIE devices through the PCIE bus. A PCIE switch is a device used to expand the PCIE bus architecture, allowing multiple PCIE devices to share a single PCIE port. The BMC can monitor and manage PCIE devices by connecting to the PCH and CPU, or directly connecting to the PCIE switch through a dedicated PCIE port.
[0080] In an optional embodiment, based on the above Figure 5 The connection relationship between BMC and PCIE devices is as follows: Figure 6As shown, the remote management client or local management tool sends a firmware upgrade request to the BMC through the Web interface or Redfish interface. After receiving the firmware upgrade request, the BMC calls the firmware upgrade thread inside the BMC. The firmware upgrade thread calls the MCTP driver inside the BMC. The MCTP driver connects to the PCH and CPU through the PCIE protocol to send an upgrade notification to the PCIE device. After the PCIE device upgrade is completed, the upgrade results are fed back to the remote management client or local management tool layer by layer.
[0081] Through the above embodiment, the use of the MCTP protocol and the PCIE protocol supported by the PLDM protocol for firmware upgrade ensures the reliability and accuracy of data transmission. The BMC can monitor abnormal conditions during the upgrade process, so that upgrade failures can be discovered and handled in a timely manner. The firmware upgrade process can also be remotely triggered and managed through the remote management client, eliminating the need for on-site firmware upgrades on the server, thereby reducing server maintenance costs.
[0082] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the existing technology, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0083] This embodiment also provides a firmware upgrade device, which is used to implement the above-mentioned embodiments and preferred implementations. Details already described will not be repeated here. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the systems described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0084] Figure 7 is a structural block diagram of a firmware upgrade device according to an embodiment of the present application, such as Figure 6 As shown, the device includes:
[0085] a receiving module 72 configured to receive a firmware upgrade request sent by a management client to the server, wherein the firmware upgrade request includes a firmware upgrade file, verification information of the firmware upgrade file, and a first file identifier of the firmware upgrade file, wherein the firmware upgrade file is used to upgrade the device;
[0086] a determination module 74, configured to determine a device to be upgraded from the plurality of devices according to the first file identifier of the firmware upgrade file;
[0087] The upgrading module 76 is configured to send the firmware upgrading file to the device to be upgraded so that the device to be upgraded performs the firmware upgrading, wherein the baseboard management controller and the device to be upgraded perform data exchange based on the first communication protocol.
[0088] The above-mentioned device can receive a firmware upgrade request sent by a management client to a server, obtain the firmware upgrade file used to upgrade the device, as well as the firmware upgrade file verification information and file identifier from the firmware upgrade request, determine the device to be upgraded from multiple devices based on the file identifier of the firmware upgrade file, and then send the firmware upgrade file to the device to be upgraded for upgrade. This solves the problem of low efficiency in firmware upgrades for hardware devices on a server in the related art.
[0089] In an exemplary embodiment, the firmware upgrade device further includes: a connection module, used to initiate a network connection request to the multiple devices through a first link, wherein the first link is established based on the first communication protocol, and the devices on the first link include the baseboard management controller and the multiple devices; for each of the multiple devices, upon determining that response information of each device to the network connection request is received, establishing a network connection with each device; obtaining device information of each device with which a network connection has been established, and assigning a device identifier to each device based on different device information, wherein the device identifier of each device is unique.
[0090] In an exemplary embodiment, the firmware upgrade device further includes: a detection module for performing an upgrade environment detection on the server, wherein the upgrade environment detection includes at least one of the following: detecting whether the operating status of the server is normal; detecting whether the operating temperature of the server is within a preset temperature range; detecting whether the power supply of the server is normal; detecting whether the network connection of the server is normal; and if it is determined that the server has not passed the upgrade environment detection, terminating the firmware upgrade and responding to the management client with an upgrade failure message.
[0091] In an exemplary embodiment, the firmware upgrade device further includes: a verification module for parsing the firmware upgrade file and verification information of the firmware upgrade file from the firmware upgrade request when it is determined that the server passes the upgrade environment detection; performing validity verification and integrity verification on the firmware upgrade file based on the verification information; and terminating the firmware upgrade and responding to the management client with upgrade failure information when it is determined that the firmware upgrade file fails the validity verification and the integrity verification.
[0092] In an exemplary embodiment, the determination module 74 is also used to: obtain a first device identifier of a target device, wherein the target device is any device among the devices that establish a network connection with the baseboard management controller; and when it is determined that the first device identifier is consistent with the first file identifier, determine the target device as the device to be upgraded.
[0093] In an exemplary embodiment, the upgrade module 76 is further used to: when the firmware upgrade file includes multiple sub-firmware upgrade files, traverse each sub-firmware upgrade file in the firmware upgrade file, wherein each sub-firmware upgrade file is used to upgrade a device; determine the target sub-firmware upgrade file currently being traversed from the multiple sub-firmware upgrade files, obtain the second file identifier of the target sub-firmware upgrade file, and send a device upgrade notification to the target device to be upgraded according to the second file identifier of the target sub-firmware upgrade file, wherein the second device identifier of the target device to be upgraded is the same as the second file identifier of the target sub-firmware upgrade file, and the device The standby upgrade notification is used to notify the device to enter the upgrade state; the target sub-firmware upgrade file is sent to the target device to be upgraded according to the second file identifier of the target sub-firmware upgrade file, so that the target device to be upgraded performs file verification on the target sub-firmware upgrade file; when it is determined that the upgrade response result of the target device to be upgraded is received, the next target sub-firmware upgrade file to be traversed is upgraded, wherein the upgrade response result is sent by the target device to be upgraded after completing the file verification of the target sub-firmware upgrade file and completing the upgrade; the device upgrade status is determined according to the multiple upgrade response results received, and the device upgrade status is responded to the management client.
[0094] In an exemplary embodiment, the firmware upgrade device is further used to: receive a firmware upgrade query request sent by the management client to the server; call the query interface of the server to obtain the completion progress of the firmware upgrade request; and respond to the management client with the completion progress.
[0095] In an exemplary embodiment, the upgrade module 76 is further used to: send a first loading command to the device that has completed the upgrade, wherein the first loading command is used to instruct the device that has completed the upgrade to load the upgraded firmware file upon the next restart; or, send a second loading command to the device that has completed the upgrade, wherein the second loading command is used to instruct the device that has completed the upgrade to restart and load the upgraded firmware file after restarting.
[0096] In an exemplary embodiment, the upgrade module 76 is further configured to: use a public key to asymmetrically encrypt the firmware upgrade file to obtain an encrypted firmware upgrade file; and send the encrypted firmware upgrade file to the device to be upgraded.
[0097] In an exemplary embodiment, the upgrade module 76 is also used to: receive a decryption response result of the device to be upgraded, wherein the decryption response result is sent after the device to be upgraded uses a private key to decrypt the encrypted firmware upgrade file, and the private key is only used to decrypt the file encrypted using the public key.
[0098] In an exemplary embodiment, the upgrade module 76 is further used to: if it is determined that the upgrade of the device to be upgraded has failed, resend the firmware upgrade file to the device to be upgraded within a preset time period so that the device to be upgraded can perform a firmware upgrade; if it is determined that one of the preset conditions is met, stop sending the firmware upgrade file, wherein the preset conditions include: the number of sending times reaches the preset maximum number of sending times, and the current moment has exceeded the preset time period.
[0099] It should be noted that the above modules can be implemented through software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0100] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above method embodiments when run.
[0101] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:
[0102] S1, receiving a firmware upgrade request sent by a management client to the server, wherein the firmware upgrade request includes a firmware upgrade file, verification information of the firmware upgrade file, and a first file identifier of the firmware upgrade file, and the firmware upgrade file is used to upgrade a device;
[0103] S2, determining a device to be upgraded from the multiple devices according to the first file identifier of the firmware upgrade file;
[0104] S3: Send the firmware upgrade file to the device to be upgraded, so that the device to be upgraded performs firmware upgrade, wherein the baseboard management controller and the device to be upgraded perform data exchange based on the first communication protocol.
[0105] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0106] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0107] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program:
[0108] S1, receiving a firmware upgrade request sent by a management client to the server, wherein the firmware upgrade request includes a firmware upgrade file, verification information of the firmware upgrade file, and a first file identifier of the firmware upgrade file, and the firmware upgrade file is used to upgrade a device;
[0109] S2, determining a device to be upgraded from the multiple devices according to the first file identifier of the firmware upgrade file;
[0110] S3: Send the firmware upgrade file to the device to be upgraded, so that the device to be upgraded performs firmware upgrade, wherein the baseboard management controller and the device to be upgraded perform data exchange based on the first communication protocol.
[0111] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0112] Optionally, in this embodiment, the computer program may be configured to perform the following steps:
[0113] S1, receiving a firmware upgrade request sent by a management client to the server, wherein the firmware upgrade request includes a firmware upgrade file, verification information of the firmware upgrade file, and a first file identifier of the firmware upgrade file, and the firmware upgrade file is used to upgrade a device;
[0114] S2, determining a device to be upgraded from the multiple devices according to the first file identifier of the firmware upgrade file;
[0115] S3: Send the firmware upgrade file to the device to be upgraded, so that the device to be upgraded performs firmware upgrade, wherein the baseboard management controller and the device to be upgraded perform data exchange based on the first communication protocol.
[0116] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail here.
[0117] Obviously, those skilled in the art should understand that the modules or steps of the present application described above can be implemented using a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented using program codes executable by the computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be performed in a different order than herein, or they can be made into individual integrated circuit modules, or multiple modules or steps can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0118] The above description is merely a preferred embodiment of the present application and is not intended to limit the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application shall be included within the scope of protection of the present application.
Claims
1. A firmware upgrade method, characterized in that: Applied to a baseboard management controller, the baseboard management controller is connected to a server, the server is connected to a plurality of devices, the plurality of devices all support a first communication protocol, and the server manages the plurality of devices through the baseboard management controller, including: Receive a firmware upgrade request sent by a management client to the server, wherein the firmware upgrade request includes a firmware upgrade file, verification information of the firmware upgrade file, and a first file identifier of the firmware upgrade file, and the firmware upgrade file is used to perform a device upgrade; Determine a device to be upgraded from the multiple devices according to the first file identifier of the firmware upgrade file; Sending the firmware upgrade file to the device to be upgraded so that the device to be upgraded performs firmware upgrade, wherein the baseboard management controller and the device to be upgraded perform data exchange based on the first communication protocol; The method of sending the firmware upgrade file to the device to be upgraded so that the device to be upgraded performs a firmware upgrade comprises: when the firmware upgrade file includes multiple sub-firmware upgrade files, traversing each sub-firmware upgrade file in the firmware upgrade file, wherein each sub-firmware upgrade file is used to perform a device upgrade on a device; determining a target sub-firmware upgrade file currently being traversed from the multiple sub-firmware upgrade files, obtaining a second file identifier of the target sub-firmware upgrade file, and sending a device upgrade notification to the target device to be upgraded according to the second file identifier of the target sub-firmware upgrade file, wherein the second device identifier of the target device to be upgraded is identical to the second file identifier of the target sub-firmware upgrade file. The target sub-firmware upgrade file is the same as the target sub-firmware upgrade file, and the device upgrade notification is used to notify the device to enter the upgrade state; according to the second file identifier of the target sub-firmware upgrade file, the target sub-firmware upgrade file is sent to the target device to be upgraded, so that the target device to be upgraded performs file verification on the target sub-firmware upgrade file; when it is determined that the upgrade response result of the target device to be upgraded is received, the next target sub-firmware upgrade file to be traversed is upgraded, wherein the upgrade response result is sent by the target device to be upgraded after completing the file verification of the target sub-firmware upgrade file and completing the upgrade; determine the device upgrade status according to the multiple upgrade response results received, and respond to the management client about the device upgrade status; Wherein, before receiving the firmware upgrade request sent by the management client to the server, the method further includes: initiating a network connection request to the multiple devices through a first link, wherein the first link is established based on the first communication protocol, and the devices on the first link include the baseboard management controller and the multiple devices; for each of the multiple devices, upon determining that response information of each device to the network connection request is received, establishing a network connection with each device; obtaining device information of each device with which the network connection has been established, and assigning a device identifier to each device based on different device information, wherein the device identifier of each device is unique; The method further comprises: receiving a firmware upgrade query request sent by the management client to the server; calling a query interface of the server to obtain a completion progress of the firmware upgrade request; and responding to the management client with the completion progress; After receiving the firmware upgrade request sent by the management client to the server, the method further includes: Performing an upgrade environment detection on the server, wherein the upgrade environment detection includes at least one of the following: Detecting whether the operating status of the server is normal; Detecting whether the operating temperature of the server is within a preset temperature range; Detecting whether the power supply of the server is normal; Detecting whether the network connection of the server is normal; If it is determined that the server fails the upgrade environment detection, terminate the firmware upgrade and respond to the management client with upgrade failure information; When it is determined that the server passes the upgrade environment detection, parsing the firmware upgrade file and verification information of the firmware upgrade file from the firmware upgrade request; Performing validity verification and integrity verification on the firmware upgrade file based on the verification information; When it is determined that the firmware upgrade file fails to pass the validity check and the integrity check, the firmware upgrade is terminated, and an upgrade failure message is responded to the management client.
2. The method according to claim 1, characterized in that Determining a device to be upgraded from the multiple devices according to the first file identifier of the firmware upgrade file includes: Obtaining a first device identifier of a target device, wherein the target device is any device among the devices that establish a network connection with the baseboard management controller; When it is determined that the first device identifier is consistent with the first file identifier, the target device is determined as the device to be upgraded.
3. The method according to claim 1, characterized in that: After sending the firmware upgrade file to the device to be upgraded so that the device to be upgraded performs firmware upgrade, the method further includes: Sending a first loading command to the device that has completed the upgrade, wherein the first loading command is used to instruct the device that has completed the upgrade to load the upgraded firmware file when it is restarted next time; Or, a second loading command is sent to the device that has completed the upgrade, wherein the second loading command is used to instruct the device that has completed the upgrade to restart and load the upgraded firmware file after restarting.
4. The method according to claim 1, characterized in that: Sending the firmware upgrade file to the device to be upgraded includes: Asymmetrically encrypt the firmware upgrade file using a public key to obtain an encrypted firmware upgrade file; The encrypted firmware upgrade file is sent to the device to be upgraded.
5. The method according to claim 4, characterized in that The method further comprises: Receive a decryption response result of the device to be upgraded, wherein the decryption response result is sent after the device to be upgraded uses a private key to decrypt the encrypted firmware upgrade file, and the private key is only used to decrypt the file encrypted using the public key.
6. The method according to claim 1, characterized in that After sending the firmware upgrade file to the device to be upgraded, the method further includes: If it is determined that the upgrade of the device to be upgraded fails, resending the firmware upgrade file to the device to be upgraded within a preset time period, so that the device to be upgraded performs a firmware upgrade; When it is determined that one of the preset conditions is met, the sending of the firmware upgrade file is stopped, wherein the preset condition includes: the number of sending times reaches a preset maximum number of sending times, and the current time has exceeded the preset time period.
7. A firmware upgrade device, characterized in that: include: A receiving module, configured to receive a firmware upgrade request sent by a management client to a server, wherein the firmware upgrade request includes a firmware upgrade file, verification information of the firmware upgrade file, and a first file identifier of the firmware upgrade file, and the firmware upgrade file is used to perform a device upgrade; A determination module, configured to determine a device to be upgraded from a plurality of devices according to a first file identifier of the firmware upgrade file; An upgrade module, used for sending the firmware upgrade file to the device to be upgraded, so that the device to be upgraded performs a firmware upgrade, wherein the baseboard management controller and the device to be upgraded perform data exchange based on a first communication protocol; The upgrade module is further used to, when the firmware upgrade file includes multiple sub-firmware upgrade files, traverse each sub-firmware upgrade file in the firmware upgrade file, wherein each sub-firmware upgrade file is used to perform a device upgrade on a device; determine the target sub-firmware upgrade file currently being traversed from the multiple sub-firmware upgrade files, obtain the second file identifier of the target sub-firmware upgrade file, and send a device upgrade notification to the target device to be upgraded according to the second file identifier of the target sub-firmware upgrade file, wherein the second device identifier of the target device to be upgraded is the same as the second file identifier of the target sub-firmware upgrade file, and the device upgrade notification is used to Notify the device to enter the upgrade state; send the target sub-firmware upgrade file to the target device to be upgraded according to the second file identifier of the target sub-firmware upgrade file, so that the target device to be upgraded performs file verification on the target sub-firmware upgrade file; when it is determined that the upgrade response result of the target device to be upgraded is received, upgrade the next target sub-firmware upgrade file to be traversed, wherein the upgrade response result is sent by the target device to be upgraded after completing the file verification of the target sub-firmware upgrade file and completing the upgrade; determine the device upgrade status according to the multiple upgrade response results received, and respond to the management client about the device upgrade status; A connection module, configured to initiate a network connection request to the multiple devices through a first link, wherein the first link is established based on the first communication protocol, and the devices on the first link include the baseboard management controller and the multiple devices; for each of the multiple devices, upon determining that response information of each device to the network connection request is received, establish a network connection with each device; obtain device information of each device with which the network connection has been established, and assign a device identifier to each device based on different device information, wherein the device identifier of each device is unique; The firmware upgrade device is also used to receive a firmware upgrade query request sent by the management client to the server; call the query interface of the server to obtain the completion progress of the firmware upgrade request; and respond to the management client with the completion progress; a detection module, configured to perform an upgrade environment detection on the server, wherein the upgrade environment detection includes at least one of the following: detecting whether the operating state of the server is normal; detecting whether the operating temperature of the server is within a preset temperature range; detecting whether the power supply of the server is normal; detecting whether the network connection of the server is normal; and if it is determined that the server fails the upgrade environment detection, terminating the firmware upgrade and responding to the management client with upgrade failure information; The detection module is also used to parse the firmware upgrade file and the verification information of the firmware upgrade file from the firmware upgrade request when it is determined that the server has passed the upgrade environment detection; perform validity verification and integrity verification on the firmware upgrade file based on the verification information; and terminate the firmware upgrade and respond to the management client with upgrade failure information when it is determined that the firmware upgrade file has not passed the validity verification and the integrity verification.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 6 when executed by a processor.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.
