Hard disk upgrading method and electronic device
Patent Information
- Application Number
- CN202611241839.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-17
- Publication Date
- 2026-09-22
AI Technical Summary
[0003]本申请提供了一种硬盘升级方法及电子设备,以至少解决相关技术中对NVMe固态硬盘进行升级时,需要知道每个NVMe固态硬盘升级所使用的物理通道,以及挂接于虚拟盘本地卡的NVMe固态硬盘的固件升级效率较低的问题
[0008]本申请还提供了一种计算机程序产品,包括计算机程序,计算机程序被处理器执行时实现上述任一种硬盘升级方法的步骤。
Smart Images

Figure CN122795413A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data storage technology, and in particular to hard disk upgrade methods and electronic devices. Background Technology
[0002] Non-Volatile Memory Express (NVMe) solid-state drives (SSDs) are widely used in computing and storage devices due to their low latency and high bandwidth. Currently, there are two main connection architectures for NVMe SSDs: the first is where the NVMe SSD is directly connected to the PCIe root complex (Peripheral Component Interconnect Express) of the Central Processing Unit (CPU); the second is where the NVMe SSD is connected to a local virtual disk card. In related technologies, when both connection architectures exist for NVMe SSDs in computing devices, out-of-band upgrades are performed on NVMe SSDs with the first connection architecture using an NVMe Management Interface (MI) based on the PCIe bus and encapsulated with the Management Component Transport Protocol (MCTP) as the transport layer. This is known as NVMe-MI over MCTP over PCIe out-of-band upgrades. For NVMe SSDs with the second connectivity architecture, out-of-band upgrades are performed using NVMe-MI, which is based on the Inter-Integrated Circuit (I2C) bus and packaged with MCTP as the transport layer. This means out-of-band upgrades are performed using NVMe-MI over MCTP over I2C. In related technologies, when performing out-of-band upgrades on NVMe SSDs with different connectivity architectures, the Baseboard Management Controller (BMC) needs to know the physical channel used for each NVMe SSD upgrade, and the firmware upgrade efficiency for NVMe SSDs with the second connectivity architecture is relatively low. Summary of the Invention
[0003] This application provides a hard drive upgrade method and electronic device to at least solve the problems in the related art where upgrading an NVMe solid-state drive requires knowing the physical channel used for each NVMe solid-state drive upgrade, and the firmware upgrade efficiency of NVMe solid-state drives connected to a virtual disk local card is low.
[0004] This application provides a method for upgrading a hard drive, including: The processor obtains the endpoint identifiers and physical topology addresses of all devices on the target bus in the Management Component Transport Protocol (MCP) network. The controller, processor, target hard drives connected to the processor, virtual disk local cards, and target hard drives connected to the virtual disk local cards are all within a MCP network. The processor is the management device of the MCP network, and the virtual disk local card is the bridging device of the MCP network. The virtual disk local card integrates a root complex and assigns physical topology addresses to the target hard drives connected to it. The processor assigns endpoint identifiers to all devices in the MCP network. Generate an initial array based on the endpoint identifiers and physical topology addresses of all devices; Obtain the slot number for each target hard drive; Based on the slot number of each target hard drive, update the initial array and generate the target array. Each element in the target array includes a mapping relationship between the endpoint identifier, physical topology address and slot number of a target hard drive. Receive hard drive upgrade tasks; Process hard drive upgrade tasks based on the target array.
[0005] This application also provides a hard disk upgrade device, including: The first acquisition module is used to acquire the endpoint identifiers and physical topology addresses of all devices on the target bus in the Management Component Transport Protocol (MCP) network from the processor. The controller, processor, target hard disks connected to the processor, virtual disk local cards, and target hard disks connected to the virtual disk local cards are all within a MCP network. The processor is the management device of the MCP network, and the virtual disk local card is the bridging device of the MCP network. The virtual disk local card integrates a root complex and assigns physical topology addresses to the target hard disks connected to it. The processor assigns endpoint identifiers to all devices in the MCP network. The generation module is used to generate an initial array based on the endpoint identifiers and physical topology addresses of all devices; The second acquisition module is used to acquire the slot number of each target hard drive; The update module is used to update the initial array and generate the target array based on the slot number of each target hard drive. Each element in the target array includes a mapping relationship between the endpoint identifier, physical topology address and slot number of a target hard drive. The receiving module is used to receive hard drive upgrade tasks; The processing module is used to handle hard disk upgrade tasks based on the target array.
[0006] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the above-described hard disk upgrade methods.
[0007] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described hard disk upgrade methods.
[0008] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described hard disk upgrade methods.
[0009] Through this application, since the controller, processor, target hard drive connected to the processor, virtual disk local card, and target hard drive connected to the virtual disk local card are in an MCTP network, the processor is the management device of the MCTP network, the virtual disk local card is the bridging device of the MCTP network, and the virtual disk local card integrates a root complex, the virtual disk local card can assign physical topology addresses to the target hard drives connected to it, the processor assigns endpoint identifiers to all devices in the MCTP network, and the controller can obtain the endpoint identifiers and physical topology addresses of all devices on the target bus in the MCTP network from the processor. That is, the controller can obtain the endpoint identifiers and physical topology addresses of the target hard drives connected to the processor, and also obtain the endpoint identifiers and physical topology addresses of the target hard drives connected to the virtual disk local card; the controller then obtains the slot number of each target hard drive, and generates a target array based on the slot number, endpoint identifier, and physical topology address of each target hard drive. Then, the controller can process hard drive upgrade tasks based on the target array through NVMe-MI over MCTP over PCIe. Therefore, this technology can solve the technical problem that when performing out-of-band upgrades on target hard drives with different connection architectures, the controller needs to know the physical channel used for each target hard drive upgrade, and the firmware upgrade efficiency of target hard drives connected to the virtual disk local card is low. This technology can achieve the technical effect of improving the uniformity, reliability and stability of BMC code and improving the firmware upgrade efficiency of target hard drives when performing out-of-band upgrades on target hard drives with different connection architectures, without needing to know the physical channel used for each target hard drive upgrade, and directly processing hard drive upgrade tasks based on the target array through NVMe-MI over MCTP over PCIe. Attached Figure Description
[0010] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This is a schematic diagram of the structure of a hard disk upgrade system provided in an embodiment of this application; Figure 2 A schematic flowchart illustrating a hard disk upgrade method provided in an embodiment of this application; Figure 3 A schematic diagram of the I2C bus topology in the management component transport protocol network provided in this application embodiment; Figure 4 A flowchart illustrating yet another hard disk upgrade method provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of a hard disk upgrade device provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0012] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0013] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0014] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0015] NVMe solid-state drives (SSDs) can be simply referred to as NVMe drives. Currently, there are two main connection architectures for NVMe drives. The first architecture involves the NVMe drive being directly connected to the CPU's PCIe Root Complex, managed directly by the CPU and the operating system. Under this architecture, the Basic Input / Output System (BIOS) and the operating system can directly recognize the NVMe drive. This architecture is suitable for general-purpose computing devices, but it has drawbacks such as limited functional expansion, high CPU load, insufficient data security, and latency susceptible to system scheduling, making it unsuitable for dedicated acceleration and secure storage scenarios.
[0016] The second connection architecture connects the NVMe disk to a virtual disk local card, without directly communicating with the CPU, forming an independent "virtual disk local card - NVMe disk" connection architecture. In this architecture, the ownership of the NVMe disk belongs to the virtual disk local card, which handles core tasks such as data read / write, protocol conversion, and function expansion. The CPU only performs simple control plane management and does not participate in the data path interaction of the NVMe disk. This architecture is widely used in intelligent storage accelerator cards, all-flash arrays (AFA), distributed storage nodes, security servers, real-time data acquisition devices, and Field-Programmable Gate Array (FPGA) virtualization scenarios. Its core advantage lies in the ability to implement functions such as encryption / decryption, compression / deduplication, and erasure coding through the virtual disk local card, such as FPGA hardware. It also features stable latency, zero CPU overhead, and strong data isolation, meeting the needs of low-latency, high-security, and highly scalable special-purpose scenarios. A virtual disk local card is a PCIe expansion card installed in a computing device. It is usually based on an FPGA or an application-specific integrated circuit (ASIC) and can mount multiple NVMe disks.
[0017] When both NVMe disks with the first and second connection architectures exist in a computing device, for the first-connection-architecture NVMe disk, since the BIOS can recognize the physical topology address of the NVMe disk (Bus-Device-Function, or BDF) and report it to the BMC through asset information, out-of-band upgrades can be performed using NVMe-MI over MCTP over PCIe. For the second-connection-architecture NVMe disk, since the NVMe disk is not directly connected to the CPU's PCIe bus, the BIOS and operating system cannot recognize the NVMe disk by default, and the BMC cannot perceive the NVMe disk's BDF through the BIOS. Therefore, it is not possible to directly upgrade the NVMe disk using NVMe-MI over MCTP over PCIe. Out-of-band upgrades of NVMe disks under this connection architecture require first interacting with the FPGA on the virtual disk local card to instruct the FPGA to stop operating on the NVMe disk, and then the BMC performs out-of-band upgrades of the NVMe disk through NVMe-MI over MCTP over I2C.
[0018] In computing devices where both NVMe disks with the first and second connection architectures coexist, and out-of-band upgrades of NVMe disks with different connection architectures are required, the BMC needs to know the physical channel used for each NVMe disk upgrade. Furthermore, the firmware upgrade efficiency of NVMe disks with the second connection architecture is lower because they are upgraded via NVMe-MI over MCTP over I2C compared to the NVMe-MI over MCTP over PCIe method.
[0019] To address the aforementioned technical problems, embodiments of this application provide a hard drive upgrade method. Figure 1 This is a schematic diagram of the hard disk upgrade system on which the hard disk upgrade method provided in the embodiments of this application is based, as shown in the figure. Figure 1As shown, the hard drive upgrade system includes a controller, a processor, a target hard drive connected to the processor, a virtual disk local card, and another target hard drive connected to the virtual disk local card. The controller is a BMC (Browser Control Center), the processor is a CPU, the target hard drive is an NVMe disk, and the virtual disk local card is implemented using an FPGA or ASIC. The controller and processor are connected via a PCIe bus. The CPU is connected to the NVMe disk connected to the processor via the PCIe bus, and the CPU is also connected to the virtual disk local card via the PCIe bus. The virtual disk local card integrates a PCIe root complex, which is connected to the NVMe disk connected to the virtual disk local card via the PCIe bus. The BMC, CPU, NVMe disk connected to the CPU, virtual disk local card, and NVMe disk connected to the virtual disk local card are all within an MCTP (Multi-Channel Network). The CPU acts as the management device for the MCTP network, i.e., the MCTP bus owner; the virtual disk local card acts as the bridging device for the MCTP network, i.e., the MCTP bridge; the BMC, the NVMe disk connected to the CPU, and the NVMe disk connected to the virtual disk local card act as MCTP endpoint devices.
[0020] An embodiment of this application provides a hard disk upgrade method, applied to the aforementioned controller. Figure 2 This is a flowchart illustrating the hard disk upgrade method provided in an embodiment of this application, as shown below. Figure 2 As shown, the hard drive upgrade method includes the following steps: Step S201: Obtain the endpoint identifiers and physical topology addresses of all devices on the target bus in the Management Component Transport Protocol (MCP) network from the processor; the controller, processor, target hard disk connected to the processor, virtual disk local card, and target hard disk connected to the virtual disk local card are in a MCP network, the processor is the management device of the MCP network, and the virtual disk local card is the bridging device of the MCP network; the virtual disk local card integrates a root complex, and the virtual disk local card assigns physical topology addresses to the target hard disks connected to it; the processor assigns endpoint identifiers to all devices in the MCP network.
[0021] The target bus is the PCIe bus.
[0022] The processor's manager assigns physical topology addresses to the controller, virtual disk local cards, and target hard drives connected to the processor. The physical topology address of a target hard drive connected to the processor differs from that of a target hard drive connected to a virtual disk local card, ensuring that each physical topology address corresponds to a unique target hard drive. The manager is the BIOS.
[0023] The root complex integrated in the virtual disk local card is a PCIe root complex. Because the virtual disk local card integrates a PCIe root complex, the FPGA firmware on the virtual disk local card can control the PCIe root complex in the virtual disk local card to allocate physical topology addresses to the target hard drives connected to it.
[0024] As the management device of the MCTP network, the processor assigns Endpoint IDs (EIDs) to the controller, processor, target hard drives connected to the processor, and virtual disk local cards through the PCIe-based MCTP discovery process in the MCTP protocol. The virtual disk local card, acting as a bridging device in the MCTP network, forwards MCTP over PCIe messages and sends an Endpoint ID pool (EID pool) request to the processor. In response to the EID pool request, the processor allocates the target EID pool to the virtual disk local card. The virtual disk local card then assigns endpoint IDs to its target hard drives based on the target EID pool.
[0025] The PCIe root complex in the virtual disk local card can also route and process Transaction Layer Packets (TLPs).
[0026] According to the MCTP protocol, the processor, as the management device of the MCTP network, knows the EID and BDF of all devices in the MCTP network.
[0027] Therefore, the BMC can obtain the EID and BDF of all devices on the PCIe bus in the MCTP network from the processor.
[0028] Step S202: Generate an initial array based on the endpoint identifiers and physical topology addresses of all devices.
[0029] Step S203: Obtain the slot number of each target hard drive.
[0030] Step S204: Based on the slot number of each target hard disk, update the initial array and generate a target array. Each element in the target array includes a mapping relationship between the endpoint identifier, physical topology address and slot number of a target hard disk.
[0031] Step S205: Receive the hard drive upgrade task.
[0032] Step S206: Based on the target array, process the hard disk upgrade task.
[0033] Processing hard drive upgrade tasks involves performing out-of-band upgrades on the target hard drive in the hard drive upgrade task.
[0034] Understandably, each element in the target array includes a mapping relationship between the endpoint identifier, physical topology address, and slot number of a target hard drive. Therefore, based on the target array, out-of-band upgrades can be performed on target hard drives connected to the processor and target hard drives connected to the virtual disk local card via NVMe-MI over MCTP over PCIe.
[0035] The hard drive upgrade method provided in this application embodiment addresses the situation where the NVMe solid-state drive in the computing device simultaneously possesses both of the aforementioned connection architectures. Since the controller, processor, target hard drive connected to the processor, virtual disk local card, and target hard drive connected to the virtual disk local card are all within an MCTP network, the processor acts as the management device for the MCTP network, the virtual disk local card acts as the bridging device for the MCTP network, and the virtual disk local card integrates a root complex, allowing it to allocate physical topology addresses for the target hard drives connected to it. The processor allocates endpoint identifiers for all devices in the MCTP network. The controller can obtain the endpoint identifiers and physical topology addresses of all devices on the target bus in the MCTP network from the processor. In other words, the controller can obtain the endpoint identifiers and physical topology addresses of the target hard drives connected to the processor and the target hard drives connected to the virtual disk local card. The controller then obtains the slot number of each target hard drive and generates a target array based on the slot number, endpoint identifier, and physical topology address of each target hard drive. Furthermore, the controller can perform NVMe-MI over MCTP over [the-city / processor] based on the target array. PCIe handles hard drive upgrade tasks, and NVMe-MI over MCTP over PCIe is faster than NVMe-MI over MCTP over I2C. Therefore, it solves the technical problem in related technologies where, when performing out-of-band upgrades on target hard drives with different connection architectures, the controller needs to know the physical channel used for each target hard drive upgrade, and the firmware upgrade efficiency of target hard drives connected to the virtual disk local card is low. This achieves the technical effect of improving BMC code uniformity, reliability, and stability, and ultimately increasing the firmware upgrade efficiency of target hard drives, without needing to know the physical channel used for each target hard drive upgrade.
[0036] In some optional implementations, step S201 above includes: In step S2011, a command to obtain routing table entries is sent to the processor. In response to the command, the processor returns to the controller the endpoint identifiers and physical topology addresses of all devices on the target bus in the management transport component protocol network.
[0037] The command to retrieve routing table entries is called the Get Routing Table Entries command.
[0038] The hard disk upgrade method provided in this application establishes a device address book for the BMC, enabling the BMC to obtain a complete device list and addressing information required for subsequent management operations.
[0039] In some optional implementations, step S202 above includes: Step S2021: Based on the endpoint identifiers and physical topology addresses of all devices, send a command to each device to obtain the supported message types and a command to obtain the globally unique endpoint identifier, thereby obtaining the supported message types and globally unique identifiers for each device.
[0040] The command to retrieve supported message types is `Get Message Type Support`. The command to retrieve the globally unique identifier of an endpoint is `Get Endpoint UUID`.
[0041] Based on the EID and BDF of all devices on the PCIe bus in the MCTP network, BMC sends the Get Message Type Support command and the Get Endpoint UUID command to each PCIe device in the MCTP network to obtain the message types supported by each PCIe device in the MCTP network and the globally unique identifier (Universally UniqueIdentifier, abbreviated as UUID).
[0042] Step S2022: Based on the endpoint identifier, physical topology address, supported message types, and globally unique identifier of each device, an initial array is generated. Each element in the initial array includes a mapping relationship between the endpoint identifier, physical topology address, and globally unique identifier of a target hard disk.
[0043] The hard drive upgrade method provided in this application accurately selects NVMe disks from the device and establishes an initial array containing the mapping relationship of the target hard drive's EID, BDF, and UUID, providing an accurate device list for subsequent matching of the target hard drive's slot number and upgrading the target hard drive.
[0044] In some optional implementations, step S2022 above includes: Step a1: Based on the message types supported by each device, determine the device whose supported message type is target hard disk management message transmitted based on the management component transmission protocol, and the device whose supported message type is target hard disk management message transmitted based on the management component transmission protocol is the target hard disk.
[0045] Specifically, based on the message types supported by each PCIe device in the MCTP network, the PCIe device whose supported message type is NVME Management Messages over MCTP is identified as the target hard drive. The message type code for NVME Management Messages over MCTP is 0x04.
[0046] Step a2: Determine the endpoint identifier, physical topology address, and globally unique identifier of each target hard disk based on the endpoint identifier, physical topology address, and globally unique identifier of each device.
[0047] Understandably, after identifying the PCIe device that supports the message type of target hard disk management messages transmitted based on the Management Component Transport Protocol, the endpoint identifier, physical topology address, and globally unique identifier of the PCIe device that supports the message type of target hard disk management messages transmitted based on the Management Component Transport Protocol are obtained from the endpoint identifier, physical topology address, and globally unique identifier of each PCIe device. In other words, the endpoint identifier, physical topology address, and globally unique identifier of each target hard disk are obtained.
[0048] Step a3: Generate an initial array based on the endpoint identifier, physical topology address, and globally unique identifier of each target hard disk.
[0049] The hard drive upgrade method provided in this application provides an accurate list of devices for matching the slot number of the target hard drive and upgrading the target hard drive by filtering by message type.
[0050] In some optional implementations, step S203 above includes: Step S2031: Based on the inter-integrated circuit bus topology information in the management component transmission protocol network, send a command to obtain the globally unique identifier of the endpoint to multiple target devices on the inter-integrated circuit bus, and obtain the globally unique identifier of each target device.
[0051] in, Figure 3 A schematic diagram of the I2C bus topology in the management component transport protocol network provided in the embodiments of this application is shown below. Figure 3As shown, the BMC is connected to the NVMe disk connected to the CPU and the NVMe disk connected to the local virtual disk card via the I2C bus.
[0052] Based on the I2C bus topology information in the management component transport protocol network, the BMC sends a Get Endpoint UUID command to multiple target devices on the I2C bus via MCTP over I2C to obtain the UUID of each target device. The target devices are the I2C devices.
[0053] Step S2032: Determine the slot number of each target hard disk based on the globally unique identifier of each target device and the initial array.
[0054] The hard drive upgrade method provided in this application obtains the UUID of each I2C device through the I2C channel and matches it with the UUID in the initial array, thereby determining the physical slot number (SLOT number) for each NVMe disk and establishing a "SLOT". EID The complete mapping relationship of "BDF".
[0055] In some optional implementations, step S2032 above includes: Step b1: If the globally unique identifier of the target device is the same as the globally unique identifier of any element in the initial array, determine the slot number of the target device based on the inter-integrated circuit bus topology information, and set the slot number of the target device as the slot number of the target hard disk in the corresponding element of the initial array.
[0056] If the globally unique identifier of the target device is the same as the globally unique identifier of any element in the initial array, it indicates that the target device is the target hard disk. Based on the I2C bus topology information, the I2C bus number and slot number of the target device are determined, and the I2C bus number and slot number of the target device are determined as the I2C bus number and slot number of the target hard disk in the corresponding element in the initial array.
[0057] It should be noted that if the globally unique identifier of an element in the initial array is the same as the globally unique identifier of the target device, then that element is determined to be the corresponding element of the target device in the initial array.
[0058] The hard drive upgrade method provided in this application embodiment uses UUID matching to precisely associate the physical slot number and I2C bus number obtained from the I2C channel with the corresponding NVMe disk in the initial array, thus completing the "SLOT" process. EID BDF The complete mapping of "UUID" provides a precise addressing basis for subsequent user-specified SLOT upgrades.
[0059] In some optional implementations, step S204 above includes: Step S2041: Place the slot number of each target hard disk into the corresponding element in the initial array to generate the target array.
[0060] If the globally unique identifier of an element in the initial array is the same as the globally unique identifier of the target hard disk, then that element is determined to be the corresponding element of the target hard disk in the initial array.
[0061] Understandably, each element in the target array may include an endpoint identifier, physical topology address, globally unique identifier, and a mapping between I2C bus number and slot number for a target hard disk.
[0062] BMC defines the data structure for each element in the target element as follows: Struct NVME_Info { Uint8 EID; Uint16 BDF; Uint8 I2C_Bus; Uint8 Slot; Uint16 UUID; } NVME_Info dev[NUM_MAX].
[0063] In some optional implementations, step S206 above includes: Step S2061: When there is only one target hard disk to be upgraded in the hard disk upgrade task, match the target endpoint identifier and target physical topology address corresponding to the target slot number from the target array based on the target slot number of the target hard disk to be upgraded in the hard disk upgrade task.
[0064] Step S2062: Upgrade the target hard drive to be upgraded based on the target endpoint identifier and the target physical topology address.
[0065] Understandably, the target hard drive to be upgraded is upgraded via NVME-MI over MCTP over PCIE, based on the target endpoint identifier and the target physical topology address.
[0066] The hard drive upgrade method provided in this application embodiment enables precise upgrades of a single hard drive specified by the user: the BMC quickly matches the corresponding EID and BDF from the target array using the SLOT number input by the user, and then performs firmware upgrades on the hard drive via NVME-MI overMCTP over PCIE without interrupting the normal operation of other hard drives.
[0067] In some optional implementations, step S206 above includes: Step c1: When there are at least two target hard drives to be upgraded in the hard drive upgrade task, match the target endpoint identifier and target physical topology address corresponding to each target slot number from the target array based on the target slot numbers of the multiple target hard drives to be upgraded in the hard drive upgrade task.
[0068] Step c2 involves performing parallel upgrades on multiple target hard drives to be upgraded, based on the target endpoint identifier and target physical topology address corresponding to each target slot number.
[0069] Understandably, based on the target endpoint identifier and target physical topology address corresponding to each target slot number, multiple target hard drives to be upgraded are upgraded in parallel through NVME-MI over MCTP over PCIE.
[0070] The hard disk upgrade method provided in this application embodiment enables parallel high-speed firmware upgrade of multiple hard disks: the BMC matches the corresponding EID and BDF in batches from the target array using multiple SLOT numbers, and then performs firmware upgrades on multiple hard disks simultaneously through NVME-MI over MCTP over PCIE, significantly reducing the total time required for batch upgrades.
[0071] In some optional implementations, the above hard disk upgrade method further includes: Step d1: During the hard drive upgrade task, record the upgrade progress of each target hard drive to be upgraded in the hard drive upgrade task.
[0072] Step d2: If the upgrade process of any target hard drive to be upgraded is interrupted due to an abnormality, after the abnormality is recovered, the upgrade of the target hard drive to be upgraded is resumed from the point of interruption based on the recorded upgrade progress of the target hard drive to be upgraded.
[0073] The hard drive upgrade method provided in this application embodiment enables interrupted download of firmware upgrades: the upgrade progress of each hard drive is recorded during the upgrade process, and when an abnormal interruption occurs, the upgrade can continue from the interruption point after recovery, avoiding repeated downloading of the completed firmware data, and greatly saving upgrade time and network bandwidth.
[0074] In some optional implementations, the above hard disk upgrade method further includes: Step e1: Before processing the hard drive upgrade task, perform an integrity check on the upgrade firmware of each target hard drive to be upgraded in the hard drive upgrade task.
[0075] Step e2: For any target hard drive to be upgraded, if the upgrade firmware of the target hard drive passes the integrity verification, then the target hard drive to be upgraded will be upgraded.
[0076] The hard disk upgrade method provided in this application performs integrity verification on the firmware image before the upgrade to ensure that the firmware data is not damaged or tampered with during transmission or storage, thereby avoiding hard disk upgrade failure due to firmware damage and improving the security and reliability of the upgrade process.
[0077] In some optional implementations, the above hard disk upgrade method further includes: Step f1: If any target hard drive in the hard drive upgrade task fails to upgrade, then the upgrade will be re-executed for that target hard drive.
[0078] Step f2: If the number of times the target hard drive to be upgraded is re-executed exceeds the preset threshold, and the target hard drive to be upgraded still fails to upgrade, an alarm is issued.
[0079] The preset number of attempts threshold is set by technical personnel and is not specifically limited here.
[0080] The hard drive upgrade method provided in this application implements an automatic retry and alarm mechanism for upgrade failures: it automatically performs a limited number of retries on the hard drive that fails to upgrade, thereby improving the upgrade success rate; when the number of retries exceeds a preset threshold and still fails, it promptly alarms and notifies maintenance personnel to intervene, thus avoiding the waste of resources by endless retries.
[0081] The embodiments of this application provide a hard disk upgrade method. Figure 4 This is a flowchart illustrating the hard disk upgrade method provided in an embodiment of this application, as shown below. Figure 4 As shown, the hard drive upgrade method includes the following steps: The CPU assigns EIDs to each MCTP Endpoint and MCTP Bridge through the MCTP discovery over PCIe process in the MCTP protocol. Specifically, the CPU sends a Prepare for endpoint discovery message to the BMC and the virtual disk local card to notify them that scanning is about to begin. The CPU sends an Endpoint Discovery Request to the BMC and the virtual disk local card to inquire which endpoints they manage. The BMC and the virtual disk local card send an Endpoint Discovery Response to the CPU, returning a list of endpoints they manage. The CPU sends a Set Endpoint ID request to the BMC to allocate endpoint identifiers to the BMC. The CPU allocates endpoint identifiers and a target endpoint identifier pool (Allocate Endpoint IDs) to the virtual disk local card. Based on the target endpoint identifier pool, the virtual disk local card sends a Set Endpoint ID Request to the NVMe disks connected to it to allocate endpoint identifiers to the NVMe disks connected to it.
[0082] BMC obtains the EID and Physical address (BDF) of all devices from the CPU by using Get Routing Table Entries.
[0083] BMC sends the Get Message Type Support over pcie and Get Endpoint UUID over pcie commands to each device (only the NVMe disk connected to the local card in the virtual disk is shown in the diagram) via EID and BDF to obtain the message type and UUID supported by each device on the PCIe bus in the MCTP network. The EID / BDF / UUID of the device with message type NVMEManagement Messages over MCTP (Type code 0x04) is added to the device (dev) array.
[0084] According to the I2C topology, BMC sends the Get Endpoint UUID command to each I2C device (only the NVMe disk connected to the local card of the virtual disk is shown in the figure) through MCTP over I2C to obtain the UUID. Then it matches it with the UUID of the element in the dev array. If the match is successful, the I2C bus number and slot number of the element are recorded.
[0085] When a user specifies a firmware upgrade for a particular hard drive, the BMC finds the corresponding EID and BDF by matching the SLOT number, and then upgrades it via NVME-MI over MCTP over PCIE.
[0086] When a user needs to upgrade the firmware of all hard drives, BMC will iterate through all elements in the dev array and upgrade each NVMe drive via NVMe-MI over MCTP over PCIE based on EID and BDF.
[0087] The hard drive upgrade method provided in this application, for computing devices with architectures that simultaneously connect NVMe hard drives directly to the CPU and connect them to a virtual disk local card, leverages the MC's support for MCTP bridge and PCIe rootcomplex features. It also utilizes the BMC's ability to obtain the NVMe drive's UUID via MCTP over PCIe and MCTP over I2C, respectively. By matching the UUID, the BDF, EID, and SLOT correspondence of the NVMe drive connected to the virtual disk local card are obtained. This enables seamless upgrades of all NVMe drives using NVME-MI over MCTP over PCIe, eliminating the need to identify whether the hard drive is connected to the CPU or the virtual disk local card's FPGA for different interfaces. This improves the BMC's code uniformity, reliability, and stability. Furthermore, it supports NVME-MI over MCTP over PCIe upgrades for NVMe drives in a specified slot. Because NVME-MI over MCTP over PCIe is faster than NVME-MI over MCTP over I2C, it also improves the efficiency of out-of-band firmware upgrades for NVMe drives.
[0088] Through the above description of the 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 necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0089] Embodiments of this application also provide a hard disk upgrade device, applied to the aforementioned controller, such as... Figure 5 As shown, the hard drive upgrade device includes: The first acquisition module 501 is used to acquire the endpoint identifiers and physical topology addresses of all devices on the target bus in the management component transport protocol network from the processor. The controller, processor, target hard disk connected to the processor, virtual disk local card, and target hard disk connected to the virtual disk local card are in a management component transport protocol network. The processor is the management device of the management component transport protocol network, and the virtual disk local card is the bridging device of the management component transport protocol network. The virtual disk local card integrates a root complex and assigns physical topology addresses to the target hard disks connected to it. The processor assigns endpoint identifiers to all devices in the management component transport protocol network.
[0090] Generation module 502 is used to generate an initial array based on the endpoint identifiers and physical topology addresses of all devices.
[0091] The second acquisition module 503 is used to acquire the slot number of each target hard drive.
[0092] The update module 504 is used to update the initial array based on the slot number of each target hard disk and generate a target array. Each element in the target array includes a mapping relationship between the endpoint identifier, physical topology address and slot number of a target hard disk.
[0093] The receiving module 505 is used to receive hard drive upgrade tasks.
[0094] Processing module 506 is used to process hard disk upgrade tasks based on the target array.
[0095] In some optional implementations, the first acquisition module 501 includes: The sending unit is used to send a command to the processor to retrieve routing table entries. In response to the command, the processor returns to the controller the endpoint identifiers and physical topology addresses of all devices on the target bus in the management transport component protocol network.
[0096] In some alternative implementations, the generation module 502 includes: The first acquisition unit is used to send a command to each device to obtain the supported message types and a command to obtain the globally unique endpoint identifier, based on the endpoint identifiers and physical topology addresses of all devices, so as to obtain the supported message types and globally unique identifiers of each device.
[0097] The generation unit is used to generate an initial array based on the endpoint identifier, physical topology address, supported message types, and globally unique identifier of each device. Each element in the initial array includes a mapping relationship between the endpoint identifier, physical topology address, and globally unique identifier of a target hard disk.
[0098] In some optional implementations, the generation unit includes: The first determining unit is used to determine, based on the message types supported by each device, a device whose supported message type is target hard disk management message transmitted based on the management component transmission protocol, and a device whose supported message type is target hard disk management message transmitted based on the management component transmission protocol, and a target hard disk.
[0099] The second determining unit is used to determine the endpoint identifier, physical topology address, and globally unique identifier of each target hard disk based on the endpoint identifier, physical topology address, and globally unique identifier of each device.
[0100] Generate sub-units to generate an initial array based on the endpoint identifier, physical topology address, and globally unique identifier of each target hard disk.
[0101] In some optional implementations, the second acquisition module 503 includes: The second acquisition unit is used to send a command to acquire the globally unique identifier of the endpoint to multiple target devices on the inter-integrated circuit bus based on the inter-integrated circuit bus topology information in the management component transmission protocol network, and to obtain the globally unique identifier of each target device.
[0102] The third determining unit is used to determine the slot number of each target hard disk based on the globally unique identifier of each target device and the initial array.
[0103] In some optional implementations, the third determining unit includes: The fourth determining unit is used to determine the slot number of the target device based on the inter-integrated circuit bus topology information, when the globally unique identifier of the target device is the same as the globally unique identifier in any element of the initial array, and to determine the slot number of the target device as the slot number of the target hard disk in the corresponding element of the initial array.
[0104] In some alternative implementations, the update module 504 includes: The insertion unit is used to insert the slot number of each target hard drive into the corresponding element in the initial array, thereby generating the target array.
[0105] In some alternative implementations, the processing module 506 includes: The first matching unit is used to match the target endpoint identifier and target physical topology address corresponding to the target slot number from the target array when there is only one target hard disk to be upgraded in the hard disk upgrade task.
[0106] The first upgrade unit is used to upgrade the target hard drive based on the target endpoint identifier and the target physical topology address.
[0107] In some alternative implementations, the processing module 506 includes: The second matching unit is used to match the target endpoint identifier and target physical topology address corresponding to each target slot number from the target array when there are at least two target hard drives to be upgraded in the hard drive upgrade task.
[0108] The second upgrade unit is used to perform parallel upgrades on multiple target hard drives to be upgraded based on the target endpoint identifier and target physical topology address corresponding to each target slot number.
[0109] In some alternative implementations, the hard disk upgrade device further includes: The recording unit is used to record the upgrade progress of each target hard drive in the hard drive upgrade task during the hard drive upgrade process.
[0110] The continuation unit is used to continue the upgrade of any target hard disk to be upgraded from the point of interruption after the upgrade process is abnormally interrupted, based on the recorded upgrade progress of the target hard disk to be upgraded.
[0111] In some alternative implementations, the hard disk upgrade device further includes: The verification unit is used to perform integrity verification on the upgrade firmware of each target hard drive in the hard drive upgrade task before processing the hard drive upgrade task.
[0112] The third upgrade unit is used to upgrade any target hard drive to be upgraded if the upgrade firmware of the target hard drive passes the integrity verification.
[0113] In some alternative implementations, the hard disk upgrade device further includes: The re-execution unit is used to re-execute the upgrade of any target hard drive in the hard drive upgrade task if the upgrade fails.
[0114] The alarm unit is used to issue an alarm if the number of times the target hard drive to be upgraded is re-executed exceeds a preset threshold and the target hard drive to be upgraded still fails to upgrade.
[0115] For a description of the features in the embodiment corresponding to the hard disk upgrade device, please refer to the relevant description in the embodiment corresponding to the hard disk upgrade method, which will not be repeated here.
[0116] Embodiments of this application also provide an electronic device, such as... Figure 6As shown, it includes a processor 601 and a memory 602, in which a computer program is stored. The processor 601 is configured to run the computer program to perform the steps in any of the above embodiments of the hard disk upgrade method.
[0117] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described embodiments of the hard disk upgrade method when it is run.
[0118] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0119] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described hard disk upgrade method embodiments.
[0120] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described hard disk upgrade method embodiments.
[0121] Any of the components, modules, units, parts, methods, and operations described herein can be implemented using software, firmware, hardware (e.g., fixed logic circuitry), manual processing, or any combination thereof. Alternatively or additionally, any functionality described herein can be executed at least in part by one or more hardware logic components, such as, but not limited to, a central processing unit (CPU), a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), an application-specific standard product (ASSP), a system-on-a-chip (SoC), a complex programmable logic device (CPLD), a microprocessor (MCU), etc. The terms "system," "computing device," or "apparatus" as used herein encompass various means, devices, and machines for processing data, including, for example, one or more programmable processors, computers, SoCs, or combinations thereof. The apparatus may also include code that creates an execution environment for the computer program in question, such as code constituting processor firmware, a protocol stack, a database management system, an operating system, a cross-platform runtime environment, a virtual machine, or one or more combinations thereof. The aforementioned computer program (also known as a program, software, software application, app, script, or code) can be written in any form of programming language, including compiled or interpreted languages, declarative or procedural languages, and can be deployed in any form, including as a standalone program or as a module, component, subroutine, object, or other unit suitable for a computing environment.
[0122] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0123] The above provides a detailed description of a hard drive upgrade method and electronic device provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to help understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A hard drive upgrade method, characterized in that, Applied to controllers, including: The processor obtains endpoint identifiers and physical topology addresses for all devices on the target bus in the Management Component Transport Protocol (MCP) network. The controller, the processor, the target hard drive connected to the processor, the virtual disk local card, and the target hard drive connected to the virtual disk local card are all within a MCP network. The processor is the management device of the MCP network, and the virtual disk local card is the bridging device of the MCP network. The virtual disk local card integrates a root complex and assigns physical topology addresses to the target hard drives connected to it. The processor assigns endpoint identifiers to all devices in the MCP network. Generate an initial array based on the endpoint identifiers and physical topology addresses of all the devices; Obtain the slot number of each of the target hard drives; Based on the slot number of each target hard disk, the initial array is updated to generate a target array, wherein each element in the target array includes a mapping relationship between the endpoint identifier, physical topology address and slot number of the target hard disk; Receive hard drive upgrade tasks; Based on the target array, the hard disk upgrade task is processed.
2. The method according to claim 1, characterized in that, The step of obtaining the endpoint identifiers and physical topology addresses of all devices on the target bus in the management transport component protocol network from the processor includes: A command to retrieve routing table entries is sent to the processor, and in response to the command, the processor returns to the controller the endpoint identifiers and physical topology addresses of all devices on the target bus in the Management Transport Component Protocol (MTCP) network.
3. The method according to claim 1, characterized in that, The initial array is generated based on the endpoint identifiers and physical topology addresses of all the devices, including: Based on the endpoint identifiers and physical topology addresses of all the devices, send a command to each device to obtain the supported message types and a command to obtain the globally unique endpoint identifier, thereby obtaining the supported message types and globally unique identifiers of each device. An initial array is generated based on the endpoint identifier, physical topology address, supported message types, and globally unique identifier of each device. Each element in the initial array includes a mapping relationship between the endpoint identifier, physical topology address, and globally unique identifier of the target hard disk.
4. The method according to claim 3, characterized in that, The initial array is generated based on the endpoint identifier, physical topology address, supported message types, and globally unique identifier of each device, including: Based on the message types supported by each device, a device whose supported message type is a target hard disk management message transmitted based on the management component transmission protocol is identified, and the device whose supported message type is a target hard disk management message transmitted based on the management component transmission protocol is the target hard disk. Based on the endpoint identifier, physical topology address, and globally unique identifier of each device, determine the endpoint identifier, physical topology address, and globally unique identifier of each target hard disk; An initial array is generated based on the endpoint identifier, physical topology address, and globally unique identifier of each target hard disk.
5. The method according to claim 1, characterized in that, The step of obtaining the slot number of each target hard drive includes: Based on the inter-integrated circuit bus topology information in the management component transmission protocol network, a command to obtain the globally unique identifier of the endpoint is sent to multiple target devices on the inter-integrated circuit bus to obtain the globally unique identifier of each target device. Based on the globally unique identifier of each target device and the initial array, the slot number of each target hard disk is determined.
6. The method according to claim 5, characterized in that, The step of determining the slot number of each target hard drive based on the globally unique identifier of each target device and the initial array includes: If the globally unique identifier of the target device is the same as the globally unique identifier in any element of the initial array, the slot number of the target device is determined based on the inter-integrated circuit bus topology information, and the slot number of the target device is determined as the slot number of the target hard disk in the corresponding element of the initial array.
7. The method according to claim 1, characterized in that, The step of updating the initial array and generating the target array based on the slot number of each target hard drive includes: The slot number of each target hard drive is placed into the corresponding element in the initial array to generate the target array.
8. The method according to claim 1, characterized in that, The process of handling the hard disk upgrade task based on the target array includes: When there is only one target hard drive to be upgraded in the hard drive upgrade task, the target endpoint identifier and target physical topology address corresponding to the target slot number are matched from the target array based on the target slot number of the target hard drive to be upgraded in the hard drive upgrade task. The target hard disk to be upgraded is upgraded based on the target endpoint identifier and the target physical topology address.
9. The method according to claim 1, characterized in that, The process of handling the hard disk upgrade task based on the target array includes: When there are at least two target hard drives to be upgraded in the hard drive upgrade task, the target endpoint identifier and target physical topology address corresponding to each target slot number are matched from the target array based on the target slot numbers of the multiple target hard drives to be upgraded in the hard drive upgrade task. Based on the target endpoint identifier and target physical topology address corresponding to each target slot number, multiple target hard drives to be upgraded are upgraded in parallel.
10. The method according to claim 1, characterized in that, The method further includes: During the processing of the hard drive upgrade task, the upgrade progress of each target hard drive to be upgraded in the hard drive upgrade task is recorded; If the upgrade process of any target hard drive to be upgraded is interrupted due to an abnormality, after the abnormality is recovered, the upgrade of the target hard drive to be upgraded will continue from the point of interruption based on the recorded upgrade progress of the target hard drive to be upgraded.
11. The method according to claim 1, characterized in that, The method further includes: Before processing the hard drive upgrade task, the integrity of the upgrade firmware of each target hard drive to be upgraded in the hard drive upgrade task is verified. For any target hard drive to be upgraded, if the upgrade firmware of the target hard drive passes the integrity verification, then the target hard drive to be upgraded will be upgraded.
12. The method according to claim 1, characterized in that, The method further includes: If any of the target hard drives in the hard drive upgrade task fails to upgrade, the upgrade will be re-executed for that target hard drive. If the number of times the target hard drive to be upgraded is re-executed exceeds the preset threshold, and the upgrade still fails, an alarm will be issued.
13. The method according to claim 1, characterized in that, The physical topology address of the target hard disk connected to the processor is different from the physical topology address of the target hard disk connected to the virtual disk local card.
14. The method according to claim 1, characterized in that, The processor assigns endpoint identifiers and physical topology addresses to the controller, the virtual disk local card, and the target hard disk connected to the processor; The virtual disk local card sends an endpoint identifier pool request to the processor; in response to the endpoint identifier pool request, the processor allocates a target endpoint identifier pool to the virtual disk local card; the virtual disk local card allocates endpoint identifiers to its target hard drives based on the target endpoint identifier pool.
15. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the hard disk upgrade method as described in any one of claims 1 to 14 when executing the computer program.