Mirror file transmission method and computing device
By establishing a multi-channel transmission strategy between the BMC and the processor, the problem of long image file transfer time is solved, and efficient image file transfer and loading is achieved.
Patent Information
- Application Number
- CN202211721913.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2042-12-30
AI Technical Summary
In the prior art, the transfer time of the image file is long, which causes the file to be loaded or installed for a long time, mainly due to the bandwidth limitation of the USB DEVICE single channel failure to fully utilize the transmission capability of the hard disk.
By establishing multiple transmission channels between the substrate management controller BMC and the processor, a multi-channel transmission strategy is adopted to divide the image files into multiple data areas, and transmit them to the processor in parallel, and synchronous transmission is performed using multiple types of physical channels.
It improves the transfer efficiency of mirror files, shortens loading or installation time, makes full use of the transmission capabilities of the hard disk, and improves the loading efficiency of the virtual optical drive to the mirror files.
Smart Images

Figure CN116225560B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a mirror file transmission method and computing device. Background Art
[0002] Typically, when a server virtual CD-ROM loads or installs an image file, the server's out-of-band baseboard management controller (BMC) transfers the image file to the server's main system via a single channel of a serial bus USB DEVICE. The main system then loads the image file into the virtual CD-ROM drive for execution.
[0003] However, since the bandwidth of a single channel of a USB DEVICE is generally less than 5 Gbps, the image file transmission time is long, resulting in a long time spent on file loading or installation. Summary of the Invention
[0004] The present application provides a method, apparatus, computing device, computer storage medium, and computer program product for transmitting an image file, which can improve the efficiency of image file transmission.
[0005] In a first aspect, the present application provides an image file transmission method, which is applied to a computing device, wherein the computing device includes a baseboard management controller (BMC), a processor, and a memory. The BMC is connected to the processor via m transmission channels, where m≥2, and the processor is connected to the memory. The method includes: the BMC writes the master boot record (MBR) corresponding to the mounted image file into the memory through the processor, where the MBR includes a boot program and a reserved area; the BMC writes a preset multi-channel transmission strategy into the reserved area of the MBR in the memory through the processor, where the multi-channel transmission strategy is used to indicate that the image file is transmitted in parallel through n transmission channels, where 2≤n≤m; during the process of the processor running the boot program, the BMC transmits the image file to the processor based on the multi-channel transmission strategy of the reserved area.
[0006] In this embodiment, the MBR is a program used to write the boot image file into the memory. The reserved area in the program is empty by default. In this embodiment, by writing the BMC's multi-channel transmission strategy in the reserved area, the image file can be transmitted in parallel through multiple channels based on the strategy when the processor runs the boot program, thereby improving the file transfer rate.
[0007] In some possible implementations, during the processor running the boot program, the BMC transmits the image file to the processor based on the multi-channel transmission strategy of the reserved area, including: the boot program reads the multi-channel transmission strategy of the reserved area; the boot program divides the image file into n data areas according to n transmission channels preset in the multi-channel transmission strategy; the BMC transmits the n data areas to the processor through the n transmission channels respectively according to the guidance of the boot program.
[0008] In this way, using the guidance of the boot program, the image file can be divided according to the number of channels and then transmitted accordingly, which facilitates the efficient transmission of the image file.
[0009] In some possible implementations, the multi-channel transmission strategy includes channel identifiers, channel types, and bandwidth ratios of n transmission channels.
[0010] In some possible implementations, when the BMC transmits the image file to the processor, the process further includes: the boot program dividing the image file into n data areas according to the bandwidth ratio of the n transmission channels, and transmitting each data area through a transmission channel of corresponding bandwidth.
[0011] In this way, appropriate transmission bandwidth can be allocated according to the transmission capacity of each channel, facilitating efficient file transmission.
[0012] In some possible implementations, before the BMC writes the preset multi-channel transmission strategy into the reserved area of the MBR in the memory through the processor, the method further includes: the BMC obtains version information of the firmware BIOS and the image file running on the processor; matches the version information of the BIOS and the image file with a preset version library, the preset version library being used to record the version information of the BIOS and the image file that support the multi-channel transmission strategy; when the version information of the BIOS and the image file are both recorded in the version library, executing the step of writing the preset multi-channel transmission strategy into the reserved area of the MBR in the memory through the processor by the BMC.
[0013] In this way, before transferring files, you can check whether the device supports the current multi-channel transmission strategy to avoid file transfer failures.
[0014] In some possible implementations, during the process of the BMC transmitting the image file to the processor, the method further includes: the BMC detecting the availability of n transmission channels; and when a channel among the n transmission channels is unavailable, adjusting the number of transmission channels in the multi-channel transmission strategy accordingly.
[0015] In this way, the BMC can adaptively adjust the transmission channel according to the available channels, which helps to ensure the successful execution of the multi-channel transmission strategy.
[0016] In the second aspect, an embodiment of the present application provides an image file transmission method, which is applied to a computing device, wherein the computing device includes a baseboard management controller BMC, a processor and a memory, the BMC is connected to the processor through m transmission channels, m≥2, and the processor is connected to the memory, and the method includes: the processor writes the master boot record MBR corresponding to the image file mounted on the BMC into the memory, the MBR is transmitted from the BMC to the processor, and the MBR includes a boot program and a reserved area; the processor writes the multi-channel transmission strategy in the BMC into the reserved area, the multi-channel transmission strategy is used to indicate the parallel transmission of the image file through n transmission channels, 2≤n≤m; during the process of the processor running the boot program, the image file is obtained from the BMC based on the multi-channel transmission strategy of the reserved area.
[0017] In some possible implementations, during the process of the processor running the boot program, the image file is obtained from the BMC based on the multi-channel transmission strategy of the reserved area, including: the boot program reads the multi-channel transmission strategy of the reserved area; the boot program divides the image file into n data areas according to n transmission channels preset in the multi-channel transmission strategy, so that the BMC transmits the n data areas to the processor through the n transmission channels respectively according to the guidance of the boot program.
[0018] In some possible implementations, the multi-channel transmission strategy includes channel identifiers, channel types, and bandwidth ratios of n transmission channels.
[0019] In some possible implementations, when the processor runs the boot program, when obtaining the image file from the BMC based on the multi-channel transmission strategy of the reserved area, it also includes: the boot program divides the image file into n data areas according to the bandwidth ratio of the n transmission channels, and each data area is transmitted through a transmission channel with a corresponding bandwidth.
[0020] In a third aspect, an embodiment of the present application provides an image file transmission device, which is applied to a computing device, wherein the computing device includes a baseboard management controller (BMC), a processor, and a memory, the BMC is connected to the processor via m transmission channels, where m ≥ 2, and the processor is connected to the memory, and the device includes:
[0021] The processing module is used to write the master boot record (MBR) corresponding to the image file mounted on the BMC into the memory through the processor. The MBR includes a boot program and a reserved area. The processing module is also used to write the multi-channel transmission strategy preset by the BMC into the reserved area of the MBR in the memory through the processor. The multi-channel transmission strategy is used to indicate that the image file is transmitted in parallel through n transmission channels, where 2≤n≤m. The transmission module is used to transmit the image file on the BMC to the processor based on the multi-channel transmission strategy in the reserved area during the process of the processor running the boot program.
[0022] In some possible implementations, the processing module is specifically configured to read the multi-channel transmission strategy of the reserved area through a boot program; the boot program divides the image file into n data areas according to n transmission channels preset in the multi-channel transmission strategy; and the transmission module is specifically configured to enable the BMC to transmit the n data areas to the processor through the n transmission channels respectively according to the guidance of the boot program.
[0023] In some possible implementations, the multi-channel transmission strategy includes channel identifiers, channel types, and bandwidth ratios of n transmission channels.
[0024] In some possible implementations, the transmission module is further configured to enable the boot program to divide the image file into n data areas according to a bandwidth ratio of the n transmission channels, and each data area is transmitted through a transmission channel of a corresponding bandwidth.
[0025] In some possible implementations, an acquisition module is further included, which is used to obtain version information of the firmware BIOS and the image file running on the processor; the processing module is also used to match the version information of the BIOS and the image file with a preset version library, which is used to record the version information of the BIOS and the image file that supports the multi-channel transmission strategy; when the version information of the BIOS and the image file are both recorded in the version library, the multi-channel transmission strategy preset by the BMC is executed and written into the reserved area of the MBR in the memory through the processor.
[0026] In some possible implementations, the processing module is further configured to detect the availability of n transmission channels; when a channel among the n transmission channels is unavailable, the number of transmission channels in the multi-channel transmission strategy is adjusted accordingly.
[0027] In a fourth aspect, an embodiment of the present application provides a computing device, which includes a baseboard management controller BMC, a processor and a memory. The BMC is connected to the processor through m transmission channels, m≥2, and the processor is connected to the memory, wherein: the BMC is used to write the master boot record MBR corresponding to the mounted image file into the memory through the processor, and the MBR includes a boot program and a reserved area; the BMC is also used to write a preset multi-channel transmission strategy into the reserved area of the MBR in the memory through the processor, and the multi-channel transmission strategy is used to indicate the parallel transmission of the image file through n transmission channels, 2≤n≤m; the processor is used to obtain the image file from the BMC based on the multi-channel transmission strategy of the reserved area during the running of the boot program.
[0028] In some possible implementations, the processor is specifically configured to run a boot program, so that the boot program reads a multi-channel transmission strategy of a reserved area; the boot program is configured to divide an image file into n data areas according to n transmission channels preset in the multi-channel transmission strategy; and the BMC is specifically configured to transmit the n data areas to the processor through the n transmission channels respectively according to the guidance of the boot program.
[0029] In some possible implementations, the multi-channel transmission strategy includes channel identifiers, channel types, and bandwidth ratios of n transmission channels.
[0030] In some possible implementations, the processor is specifically configured to run a boot program, so that the boot program divides the image file into n data areas according to bandwidth ratios of the n transmission channels, and each data area is transmitted through a transmission channel of a corresponding bandwidth.
[0031] In some possible implementations, the BMC is further used to obtain version information of the firmware BIOS and image files run by the processor; match the version information of the BIOS and image files with a preset version library, which is used to record version information of the BIOS and image files that support a multi-channel transmission strategy; when the version information of the BIOS and image files is recorded in the version library, the BMC uses the preset multi-channel transmission strategy to write the firmware BIOS run by the processor into a reserved area of the MBR in the memory.
[0032] In some possible implementations, the BMC is further used to detect the availability of n transmission channels; when a channel among the n transmission channels is unavailable, the number of transmission channels in the multi-channel transmission strategy is adjusted accordingly.
[0033] In a fifth aspect, the present application provides an electronic device comprising: at least one memory for storing programs; and at least one processor for executing the programs stored in the memory; wherein, when the program stored in the memory is executed, the processor is used to execute the method described in the first aspect or any possible implementation of the first aspect.
[0034] In a sixth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method described in the first aspect or any possible implementation of the first aspect.
[0035] In a seventh aspect, the present application provides a computer program product, characterized in that when the computer program product runs on a processor, the processor executes the method described in the first aspect or any possible implementation of the first aspect.
[0036] In an eighth aspect, the present application provides a chip, characterized in that it includes at least one processor and an interface; at least one processor obtains program instructions or data through the interface; and at least one processor is used to execute program line instructions to implement the method described in the first aspect or any possible implementation of the first aspect.
[0037] It can be understood that the beneficial effects of the second to eighth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 This is a schematic diagram of a scenario of interaction between a PC and a computing device provided in an embodiment of the present application;
[0039] Figure 2 This is a schematic diagram of the hardware structure of a computing device provided in an embodiment of the present application;
[0040] Figure 3 This is a schematic diagram of implementing multi-channel transmission of image files on a computing device provided by an embodiment of the present application;
[0041] Figure 4 This is a flowchart of a mirror file transmission method provided by an embodiment of the present application;
[0042] Figure 5 This is a flowchart of a method for transmitting an image file in a specific embodiment of the present application;
[0043] Figure 6 This is a flowchart of a method for transmitting an image file in a specific example of the present application;
[0044] Figure 7 This is a structural diagram of a mirror file transmission device provided in an embodiment of the present application;
[0045] Figure 8 This is a schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The term "and / or" as used herein describes an association between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. The symbol " / " as used herein indicates that the related objects are in an "or" relationship, for example, A / B means either A or B.
[0047] The terms "first," "second," and the like in the specification and claims herein are used to distinguish between different objects, rather than to describe a specific order of objects. For example, "first channel" and "second channel" are used to distinguish between different transmission channels, rather than to describe a specific order of channels.
[0048] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0049] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more, for example, multiple processing units means two or more processing units, etc.; multiple elements means two or more elements, etc.
[0050] To facilitate understanding of the technical solution of this application, the relevant terms involved in this article are explained below.
[0051] The baseboard management controller (BMC) performs a range of monitoring and control functions for system hardware. For example, it monitors system temperature, voltage, fans, power supplies, and other aspects, making adjustments to ensure a healthy system. It also records various hardware information and logs for user notifications and troubleshooting. The BMC is an independent system that communicates with other server hardware (such as the CPU and memory) through physical channels and interacts with the BIOS and operating system (OS).
[0052] A KVM (keyboard video mouse) is a multi-computer switch. It can control multiple servers using a single keyboard, monitor, and mouse, facilitating centralized management. KVM is a software program provided by the server's baseboard management (BMC). Its functions include simulating a virtual optical drive, floppy drive, or USB flash drive, loading or installing the main system, and controlling the mouse and keyboard on the server's main system interface. When loading or installing the main system, KVM typically uses the Universal Serial Bus (USB) device function to simulate a virtual optical drive, floppy drive, or USB flash drive (collectively, a virtual optical drive).
[0053] USB (universal serial bus) is a universal serial bus. The protocols commonly used by USB include USB2.0 and USB3.0, with bandwidths of 480Mbps and 5Gbps respectively.
[0054] USB device, USB device, that is, a device that uses a USB interface.
[0055] PCIE (Peripheral Component Interface Express): A high-speed bus. Commonly used protocols for PCIE include PCIE 2.0, PCIE 3.0, and PCIE 4.0, with corresponding bandwidths of 5 Gbps, 8 Gbps, and 16 Gbps, respectively, for a single-wire (X1) system.
[0056] The BIOS (basic input / output system) is responsible for setting various system hardware parameters. It is essentially a set of programs (or codes) stored on a ROM chip on the computer's motherboard. The BIOS can interact with the BMC.
[0057] IPMI (intelligent platform management interface): Intelligent platform management interface, an I2C-based serial bus, is also one of the communication channels between BMC and BIOS.
[0058] MBR (main boot record): The master boot record is a section of boot code located at the front of the image file. It is responsible for determining the validity of the partition and locating the partition boot information when the operating system accesses the image file.
[0059] Virtual Drive is a software tool that simulates the operation of optical discs (CD / DVD-ROMs). It works by creating one or more virtual optical drives, storing the application software image on the disc on the hard drive, and generating a virtual drive image file. Later, when you want to launch the application, you don't need to place the physical disc in the drive; simply click the virtual drive letter, and the image file will be immediately loaded into the virtual drive and run.
[0060] Typically, when loading or installing an image file, a user logs into the KVM management interface on a PC (Personal Computer) to remotely control the server's KVM virtual optical drive. This involves the server's out-of-band BMC transferring the image file from a storage area (such as a hard drive) to the server's main system memory via a single-channel virtual optical drive transmission channel simulated by the USB device function. However, the physical single-channel protocol bandwidth of a USB device for transferring image files is relatively small. For example, the theoretical bandwidth of USB 2.0 is 480 Mbps (i.e., 60 MBytes / s), while the theoretical bandwidth of USB 3.0 is 5 Gbps (i.e., 625 MBytes / s). Therefore, using the USB device's single-channel transmission mode to transfer image files is limited by channel bandwidth limitations, resulting in a long transmission time. Furthermore, the transfer efficiency that a hard drive can achieve is around 3000 MBytes / s. This transmission method fails to fully utilize the hard drive's transmission capacity, resulting in a significant gap in transmission efficiency compared to a hard drive.
[0061] In order to improve the efficiency of image file loading and installation, an embodiment of the present application provides an image file transmission method. This method mainly expands the transmission channel of the image file between the BMC chip and the main system, so that the image file can be transmitted synchronously through multiple threads through the expanded multiple channels, thereby improving the transmission efficiency and further improving the efficiency of the virtual optical drive in loading the image file.
[0062] In order to better understand the technical solution of the present application, at least one application scenario of the embodiment of the present application is first introduced below.
[0063] refer to Figure 1 As shown, the user can log in to the out-of-band baseboard management controller BMC21 of the server 20 on the PC10 side, and based on the KVM management interface provided by BMC21, use the keyboard 11, mouse 12, display 13 and other devices of PC10 to remotely control the corresponding computing device 20 to load or install the image file. Among them, the user can input or select the image file (such as the operating system image file) to be run by the computing device 20 based on the KVM management interface logged in on the PC10 side, and send the control information for loading the image file to BMC21. In this way, the out-of-band BMC21 on the computing device 20 side receives the relevant control information from the PC10 side, and can interact with the main system 22 when the computing device 20 is powered on, and transfer the specified image file from the BMC21 side to the memory of the main system 22, so that the virtual optical drive of the server 20 can load the image file in the memory, thereby realizing the loading or installation of the corresponding operating system.
[0064] Illustratively, the computing device 20 may be a personal computer (PC), a server, a workstation, or a hyperterminal, but is not limited thereto.
[0065] For example, Figure 2 FIG. 1 shows a schematic diagram of the hardware structure of a computing device. Figure 2 As shown, the computing device 20 may include an out-of-band BMC 21 and a main system 22, wherein the main system 22 may include a processor 221, a memory 222, and a communication interface 223, etc., and the BMC 21, the memory 222, and the communication interface 223 may all be connected to the processor 221 via a bus 220. It will be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the computing device 20. In other embodiments of the present application, the computing device 20 may include more or fewer components than shown, such as an external storage device (such as a hard disk), a battery module, a fan, a graphics card, etc., and may also combine certain components, or split certain components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0066] The processor 221 may include various processing devices, such as a central processing unit (CPU), a system on chip (SOC), a processor integrated on an SOC, a separate processor chip or controller, etc. The processor 221 may also include a dedicated processing device, such as an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a digital signal processor (DSP), etc. The processor 221 may be a processor group consisting of multiple processors, and the multiple processors are coupled to each other via one or more buses.
[0067] The memory 222 may be coupled to the processor 221. Specifically, the memory 222 may be coupled to the processor 221 via one or more memory controllers. The memory 222 may be used to store computer program instructions, including a computer operating system (OS), firmware, and various programs. For example, but not limited to, the operating system may be iOS, Android, Windows, Harmony OS, or other operating systems. The memory 222 may be a non-volatile memory that is not subject to power failure, such as an embedded multi-media card (EMMC), universal flash storage (UFS) or read-only memory (ROM), or other types of static storage devices that can store static information and instructions. It may also be a volatile memory that is not subject to power failure, such as random access memory (RAM) or other types of dynamic storage devices that can store information and instructions. It may also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other computer-readable storage medium that can be used to carry or store program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 222 may exist independently or be integrated with the processor 221.
[0068] The communication interface 223 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0069] In the present embodiment, bus 220 includes the bus of one or more communication protocols.And bus 220 includes hardware, software or both, couples the parts of computing device 20 to each other.For example, but not limitation, bus 220 may include I2C serial bus, USB serial bus, accelerated graphics port (AGP) or other graphics bus, enhanced industry standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industry standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCIE) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations.It should be understood that, although the present application embodiment describes and shows specific bus, the application considers any suitable bus or interconnection.
[0070] As an example, in this embodiment, the BMC21 of the computing device 20 can communicate with the main system processor 221 through multiple physical channels such as USB device and PCIE bus, and transmit the image file stored on the BMC21 side to the processor (hereinafter also referred to as "CUP") 221 through the USB device channel and / or PCIE channel, so as to be written into the internal memory (hereinafter explained as memory as an example) 222 for execution. It can be understood that the image file on the BMC21 side can be a file pre-stored on a hard disk (not shown in the figure) in the computing device 20, or it can be a file transmitted from the PC10 side to the BMC21 side (stored in the corresponding hard disk) via the network. In addition, illustratively, the image file can include at least one operating system image file, but is not limited thereto.
[0071] In this embodiment, in the storage space of the hard disk where the image file is located, the frontmost storage area stores the corresponding master boot record MBR (about 512 bytes), which can be generated by the disk operating system (DOS) when initializing the hard disk. Its structure can be shown in the following Table 1:
[0072] Table 1
[0073]
[0074] As shown in Table 1 above, the MBR before the image file records information such as the boot program, error information, reserved area Reverse, partition table (i.e., recording information about each storage partition of the hard disk), and end flag (Master Boot Record signature. If the end flag is correct, the hard disk where the current MBR is located can be booted; if the end flag is incorrect, it cannot be booted). When BMC21 transfers the image file (stored in at least one partition of the hard disk) to the main system 22, BMC21 will first transfer the MBR to the main system 22 through the default USB device single channel, and the BIOS firmware program run by CPU22 will write the MBR into memory 222, so that the BIOS jumps to the boot program of the MBR written in memory 222. The boot program then addresses the image file based on the partition table and transfers it from the BMC21 side to memory 222 for execution.
[0075] For example, in the image file transmission scenario, BMC21 can pre-set a multi-channel transmission strategy, which may include the number of multiple transmission channels, channel identifiers, channel types, and the transmission bandwidth ratio of each channel. For example, if 4 channels are set in the strategy, you can refer to Figure 2 As shown, the labels are "USB device1", "USB device2", "PCIE1" and "PCIE2", and the transmission bandwidth ratio of each channel is 1:1:4:4, that is, the USB device 1 channel and the USB device 2 channel can both transmit 1 / 10 of the data volume of the image file, and the PCIE 1 channel and the PCIE 2 channel can both transmit 4 / 10 of the data volume of the image file.
[0076] Next, when the computing device 20 is powered on, the processor 221 runs the BIOS firmware program. When the BIOS is running, the BMC 21 can communicate with the BIOS through the IPMI and send the multi-channel transmission strategy to the BIOS. Figure 3 , BMC21 can pass the master boot record MBR31 before the image file 32 through the USB device single channel (such as Figure 2 ) is transmitted to the main system memory 222. Then, the BIOS writes the obtained multi-channel transmission strategy into the reserved area (REVERSE area, address 0xE2-0xBD) of the MBR31 in the memory 222, so that after the BIOS jumps to the boot program of the MBR31 in the memory 222, the boot program reads the multi-channel transmission strategy of the reserved area (REVERSE area) of the MBR31 in the memory 222, and divides the image file 32 on the BMC21 side (the boot program can address the image file according to the partition table) accordingly (for example, into four data areas of 1:1:4:4) according to the transmission bandwidth ratio in the strategy. Figure 2 The USB device1 channel, USB device2 channel, PCIE1 channel and PCIE2 channel shown in the figure transmit the divided data areas in parallel to the memory 222 for the virtual optical drive to run the image file 32 to load or install the corresponding operating system.
[0077] In this way, various types of physical channels between the BMC 21 and the processor 221 can be fully utilized to expand the image file transmission channel and improve the image file transmission efficiency.
[0078] Next, based on the above description, a mirror file transmission method provided by an embodiment of the present application is introduced. It can be understood that this method is proposed based on the above description, and part or all of the content of the method can be referred to the above description.
[0079] See also Figure 4 , Figure 4 This is a flow chart of a mirror file transmission method provided by the embodiment of the present application. It can be understood that the method can be Figure 1 or Figure 2 The computing device 20 shown in the figure may also be used to execute the process, or other suitable devices, equipment, or platforms with computing and processing capabilities. Figure 4 As shown, the method may include steps S410 to S450:
[0080] In S410 , the BMC of the computing device obtains version information of the current BIOS and image file, and determines that both the BIOS and the image file support a preset multi-channel transmission strategy, which is preset by the BMC.
[0081] In this embodiment, combined with Figure 1 and Figure 2 As shown, the user logs in to the BMC21 of the computing device (hereinafter referred to as the "server") on the PC 20 (the BMC21 can also be powered on and start working when the main system of the server 20 is not powered on), and selects the operating system image file to be loaded or installed by the server 20 through the KVM management interface. The image file can be an existing image file of the BMC21. After being selected by the user, it can be directly transferred by the BMC21 to the main system 22 of the server 20 through the image file transfer method in this embodiment to be loaded into the virtual optical drive for use. Alternatively, the image file can also be an image file stored locally on the PC10. After being selected by the user, it is transferred from the PC10 to the BMC21 via the network, and then transferred by the BMC21 to the main system 22 through the image file transfer method in this embodiment to be loaded into the virtual optical drive for use.
[0082] Among them, when the image file is transmitted from BMC21 to the main system 22, it is implemented based on the multi-channel transmission strategy preset in BMC21. The multi-channel transmission strategy is used to indicate that the image file is transmitted through multiple specified transmission channels according to the pre-allocated bandwidth ratio of each transmission channel. Before BMC21 starts to transmit the image file to the main system 22, it can first execute the above S410 to determine whether the current image file and the version of the BIOS of the server 20 support the multi-channel transmission strategy. In this way, if the current image file and BIOS both support the strategy, BMC21 can interact with the BIOS to divide the image file according to the multi-channel transmission strategy and then transmit it in parallel through multiple channels to improve transmission efficiency.
[0083] In this embodiment, when S410 is executed, the specific process may include:
[0084] Combine Figure 5 As shown, after the server 20 executes step S1 to power on the main system 22, the CPU 221 can execute S2 to load the BIOS. At this time, the BMC 21 can execute S410 to obtain the version number of the BIOS to determine whether the current version of the BIOS supports the multi-channel transmission strategy. In addition, the BMC 21 will also read the version number of the current image file to determine whether the image file can also support the multi-channel transmission strategy. It is understandable that the BIOS version information and image file version information that support the multi-channel transmission strategy can be pre-set in the BMC 21. When the current BIOS and image file version information read by the BMC 21 are pre-recorded information, it is considered that the current BIOS and image file support the subsequent process.
[0085] If both the BIOS and image file versions support the multi-channel transmission strategy, BMC21 can continue to execute the subsequent multi-channel parallel transmission process of the image file. Conversely, if either the BIOS or image file version number does not support it, BMC21 transmits the image file through a single channel (such as a single USB Device channel).
[0086] And, continue to refer to Figure 5 In this embodiment, in order to ensure the integrity of the system logic design and the efficiency of image file transmission, after the BIOS is started, the BMC 21 can perform two task processes in parallel. The first task is the above-mentioned step S410 to confirm the version information of the BIOS and the image file, and the second task is the following step S420:
[0087] At S420 , the BMC writes the MBR corresponding to the image file into the memory through the transmission channel between the BMC and the processor.
[0088] In this embodiment, after the BIOS is started, the BMC 21 can start to transfer the image file to the main system 22. At this time, the MBR of the image file is first transferred, and Figure 5 As shown, the transmission is carried out through the default physical single channel between BMC21 and CPU221. For example, the process of BMC21 starting the single channel transmission of the MBR in front of the image file can be referred to. Figure 6 As shown, CPU 221 receives the MBR and writes it into memory 222
[0089] In this way, when BMC21 confirms through the above S410 that the versions of BIOS and image files support the multi-channel transmission strategy, the image file can be transferred from single channel to multi-channel transmission based on the MBR and multi-channel transmission strategy. Otherwise, Figure 5 In step S3, BMC 21 can maintain a single-channel transmission of the MBR. Once the MBR is written to the memory and the BIOS is loaded, it can directly jump to the boot program in the MBR. The boot program guides BMC 21 to transfer the entire image file to the main system 22 side memory 222 through the default single channel and run it until the operating system is normally started. The structure of the MBR before the image file can be seen in Table 1 above.
[0090] In this embodiment, after determining in S410 that both the image file and the BIOS version support the multi-channel transmission strategy of BMC21, S430 may be executed:
[0091] At S430 , the BMC sends the multi-channel transmission strategy to the BIOS.
[0092] In this embodiment, the multi-channel transmission strategy may include the number of multiple transmission channels, channel identifiers (such as channel numbers), channel types, and channel bandwidth ratios, but is not limited thereto. Figures 4 to 6 , BMC21 can send the policy to BIOS through IPMI if both the image file and BIOS version support the policy.
[0093] Exemplarily, a corresponding multi-channel transmission strategy can be pre-set based on multiple physical channels and types between BMC21 and CPU221. For example, if there are four physical channels between BMC21 and CPU221, namely the first channel, the second channel, the third channel, and the fourth channel, the channel numbers of these four channels are "USB DEVICE1", "USB DEVICE2", "PCIE1", and "PCIE2", respectively, the types of the first channel and the second channel are USB, and the types of the third channel and the fourth channel are PCIE, and the transmission bandwidth ratio allocated according to the bandwidth of these four channels (such as the USB bandwidth is 5Gbps and the PCIE bandwidth is 16Gbps) is 1:1:4:4, then a corresponding multi-channel transmission strategy can be formed based on these four channels and their respective channel numbers, channel types, and bandwidth ratios, instructing the subsequent boot program to transmit the image file from these four channels according to the strategy and the bandwidth ratio.
[0094] In some other examples, the BMC 21 may also adaptively adjust the multi-channel transmission ratio based on the available physical channels between it and the CPU 221. For example, if there are four physical channels between the BMC 21 and the CPU 221, and one of the channels is unavailable (e.g., the channel is damaged or occupied), the BMC 21 may mark the damaged physical channel and use the remaining four available physical channels to readjust the transmission bandwidth ratio based on the types of the four channels to form a new multi-channel transmission strategy. The next time the image file is transmitted, the new multi-channel transmission strategy is used to ensure efficient and reliable transmission.
[0095] S440, the BIOS writes the received multi-channel transmission policy into a reserved area of the MBR in the memory.
[0096] In this embodiment, continue to refer to Figures 4 to 6 As shown, the reserved area REVERSE of the MBR in the memory 221 written by BMC21 through the above S420 has no actual content by default, such as all "0". After the BIOS receives the multi-channel transmission strategy transmitted by BMC21, it can write the strategy into the reserved area REVERSE of the MBR in the memory 221. The format of writing the strategy into the reserved area REVERSE can be as shown in the following Table 2:
[0097] Table 2
[0098] Number of channels Channel 1 Type Channel 1 Marker Channel 1 bandwidth ratio Channel 2 Type Channel 2 Marker Channel 2 bandwidth ratio Channel 3 Type Channel 3 Marker Channel 3 bandwidth ratio …… Channel N type Channel N logo Channel N bandwidth ratio …… ……
[0099] As shown in Table 2 above, the reserved area can arrange the number of channels, the type, identifier, bandwidth ratio of the first channel, the type, identifier, bandwidth ratio of the second channel, ..., etc. in sequence, so that the boot program can sequentially read the contents of the reserved area to allocate the transmission bandwidth of the image file in each channel.
[0100] S450: The BIOS jumps to the boot program of the MBR, so that the boot program performs multi-channel parallel transmission of the image file according to the multi-channel transmission strategy of the reserved area.
[0101] In this embodiment, continue to refer to Figures 4 to 6 As shown, after the BIOS writes the multi-channel transmission strategy into the reserved area of the MBR in the memory 221, the BIOS jumps to the boot program of the MBR and enters the subsequent boot process, that is, the boot program reads the multi-channel transmission strategy in the reserved area of the MBR, parses the number of channels, channel numbers, types and bandwidth ratios therein, and then divides the image file addressed according to the partition table into multiple data areas, and transmits each data area from the multiple channels set by the multi-channel transmission strategy to the memory 221.
[0102] For example, assuming a multi-channel transmission strategy with four channels, and channel identifiers of "USB DEVICE1," "USB DEVICE2," "PCIE1," and "PCIE2," two of which are of "USB" type and two of which are of "PCIE" type, with a bandwidth ratio of "1:1:4:4," the boot program can address the image file based on the MBR partition table and divide it into four data areas A, B, C, and D. The data volume ratio of these four data areas can be 1:1:4:4. The boot program can then, in accordance with this strategy, transfer data areas A through D in parallel from channels "USB DEVICE1," "USB DEVICE2," "PCIE1," and "PCIE2," respectively, writing them to designated addresses in memory 221. This way, after data areas A through D are transferred to memory 221, their original arrangement can be maintained, allowing them to be reassembled into a complete image file.
[0103] In this embodiment, through the interaction between BMC21 and BIOS, it is possible to expand the single transmission channel of the image file based on the original multiple physical channels of BMC21 and the main system 22, that is, after the image file is divided according to the theoretical bandwidth of the expanded channel, it is transmitted synchronously through multiple expanded physical channels in multiple threads, thereby achieving the effect of improving the transmission efficiency of the image file. Therefore, the embodiment of the present application solves the bandwidth limitation of traditional USB single-channel transmission through this transmission method. Moreover, since the hard disk storing the image file has actually reached a transmission rate of 3000MBytes / s, when the transmission is expanded from a single channel to a multi-channel transmission, the transmission performance of the hard disk is also sufficient to support multi-threaded parallel transmission. In this way, the transmission capacity of the hard disk is fully utilized to perform multi-channel synchronous transmission of the image file, which greatly improves the transmission efficiency, thereby shortening the time it takes for the virtual optical drive to load or install the image file.
[0104] Based on the method in the above embodiment, the embodiment of the present application provides a mirror file transmission device. Figure 7 , Figure 7 This is a schematic diagram of the structure of a mirror file transmission device provided by an embodiment of the present application. It can be understood that the device can be applied to Figure 1 or Figure 2 The computing devices shown in, but not limited to.
[0105] like Figure 7 As shown, the image file transmission device 700 may include: an acquisition module 701 and a processing module 702. The acquisition module 701 may be used to acquire the version information of the BIOS and the image file in the computing device 20, and the processing module 702 is used to match the version information of the BIOS and the image file with a preset version library, which is used to record the version information of the BIOS and the image file that supports the multi-channel transmission strategy; and when the version information of the BIOS and the image file is recorded in the version library, the multi-channel transmission strategy preset by the BMC is executed and written into the reserved area of the MBR in the memory through the processor.
[0106] Exemplarily, the processing module 702 can be specifically used to write the master boot record MBR corresponding to the mounted image file into the memory through the processor, and the MBR includes a boot program and a reserved area. In addition, the processing module 702 can also be used to write the preset multi-channel transmission strategy into the reserved area of the MBR in the memory through the firmware BIOS run by the processor when both the version information of the BIOS and the version information of the image file support the preset multi-channel transmission strategy. The multi-channel transmission strategy is used to indicate that the image file is transmitted in parallel from the preset n transmission channels according to the pre-allocated bandwidth ratio, 2≤n≤m. The device 700 also includes a transmission module 703, which can be used to transmit the image file on the BMC to the processor based on the multi-channel transmission strategy of the reserved area during the process of the processor running the boot program. In this way, after the BIOS jumps to the boot program, the processor of the computing device 20 can enable the boot program to transmit the image file from the BMC side to the memory according to the multi-channel transmission strategy of the reserved area.
[0107] In some implementations, the multi-channel transmission strategy includes channel identifiers, channel types, and bandwidth ratios of the n transmission channels.
[0108] In some implementations, the processing module 702 can be specifically configured to read the multi-channel transmission strategy of the reserved area through a boot program; the boot program can divide the image file into n data areas according to n transmission channels preset in the multi-channel transmission strategy; and the transmission module 703 can be specifically configured to enable the BMC to transmit the n data areas to the processor through the n transmission channels respectively according to the guidance of the boot program.
[0109] In some implementations, the transmission module 703 is further configured to enable the boot program to divide the image file into n data areas according to the bandwidth ratio of the n transmission channels, and each data area is transmitted through a transmission channel of a corresponding bandwidth.
[0110] In some possible implementations, the processing module 702 is further configured to detect the availability of n transmission channels; when a channel among the n transmission channels is unavailable, the number of transmission channels in the multi-channel transmission strategy is adjusted accordingly.
[0111] It should be understood that the above-mentioned device is used to execute the method in the above-mentioned embodiment. The implementation principle and technical effect of the corresponding program module in the device are similar to those described in the above-mentioned method. The working process of the device can refer to the corresponding process in the above-mentioned method and will not be repeated here.
[0112] Based on the methods in the above embodiments, embodiments of the present application provide an electronic device. The electronic device may include: at least one memory for storing programs; and at least one processor for executing the programs stored in the memory. When the programs stored in the memory are executed, the processor is configured to execute the methods in the above embodiments.
[0113] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.
[0114] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product, characterized in that when the computer program product runs on a processor, the processor executes the method in the above embodiment.
[0115] Based on the method in the above embodiment, the present application embodiment also provides a chip. Figure 8 , Figure 8 This is a schematic diagram of the structure of a chip provided in an embodiment of the present application. Figure 8 As shown, the chip 800 includes one or more processors 801 and an interface circuit 802. Optionally, the chip 800 may also include a bus 803.
[0116] The processor 801 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 801 or instructions in the form of software. The above-mentioned processor 801 can be a general-purpose processor, a digital communicator (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The various methods and steps disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0117] The interface circuit 802 can be used to send or receive data, instructions or information. The processor 801 can use the data, instructions or other information received by the interface circuit 802 to process it, and can send the processing completion information through the interface circuit 802.
[0118] Optionally, the chip 800 further includes a memory, which may include a read-only memory and a random access memory, and provides operation instructions and data to the processor. Part of the memory may also include a non-volatile random access memory (NVRAM).
[0119] Optionally, the memory stores an executable software module or a data structure, and the processor can perform corresponding operations by calling an operation instruction stored in the memory (the operation instruction may be stored in an operating system).
[0120] Optionally, the interface circuit 802 may be configured to output the execution result of the processor 801 .
[0121] It should be noted that the corresponding functions of the processor 801 and the interface circuit 802 can be implemented through hardware design, software design, or a combination of hardware and software, which is not limited here.
[0122] It should be understood that each step of the above method embodiment can be completed by a hardware-based logic circuit or a software-based instruction in a processor.
[0123] It is understood that the order of execution of the steps in the above embodiments does not necessarily imply a specific order of execution. The order of execution of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. In addition, in some possible implementations, the steps in the above embodiments can be selectively executed according to actual circumstances, and can be executed partially or completely, which is not limited here.
[0124] It is understood that the processor in the embodiments of the present application may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0125] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0126] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted via the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)).
[0127] It will be understood that the various numerical numbers involved in the embodiments of the present application are merely distinctions for the convenience of description and are not intended to limit the scope of the embodiments of the present application.
Claims
1. A method for transmitting an image file, characterized in that: The method is applied to a computing device, the computing device including a baseboard management controller (BMC), a processor, and a memory, the BMC being connected to the processor via m transmission channels, where m is greater than or equal to 2, and the processor being connected to the memory, the method comprising: The BMC writes the master boot record (MBR) corresponding to the mounted image file into the memory through the processor, wherein the MBR includes a boot program and a reserved area; The BMC writes a preset multi-channel transmission strategy into a reserved area of the MBR in the memory through the processor, wherein the multi-channel transmission strategy is used to indicate that the image file is transmitted in parallel through n transmission channels, where 2≤n≤m; During the process of the processor running the boot program, the BMC transmits the image file to the processor based on the multi-channel transmission strategy of the reserved area.
2. The method according to claim 1, characterized in that During the process of the processor running the boot program, the BMC transmits the image file to the processor based on the multi-channel transmission strategy of the reserved area, including: The boot program reads the multi-channel transmission strategy of the reserved area; The boot program divides the image file into n data areas according to n transmission channels preset in the multi-channel transmission strategy; The BMC transmits the n data areas to the processor through the n transmission channels respectively according to the guidance of the boot program.
3. The method according to claim 1 or 2, characterized in that The multi-channel transmission strategy includes channel identifiers, channel types, and bandwidth ratios of the n transmission channels.
4. The method according to claim 3, characterized in that When the BMC transmits the image file to the processor, the method further includes: The boot program divides the image file into n data areas according to the bandwidth ratio of the n transmission channels, and each of the data areas is transmitted through a transmission channel of a corresponding bandwidth.
5. The method according to any one of claims 1 to 4, characterized in that: Before the BMC writes the preset multi-channel transmission strategy into the reserved area of the MBR in the memory through the processor, the method further includes: The BMC obtains version information of the firmware BIOS and the image file running on the processor; Matching the version information of the BIOS and the image file with a preset version library, wherein the preset version library is used to record the version information of the BIOS and the image file that support the multi-channel transmission strategy; When the version information of the BIOS and the image file are both recorded in the version library, the step of writing the preset multi-channel transmission strategy by the BMC into the reserved area of the MBR in the memory through the processor is executed.
6. The method according to any one of claims 1 to 5, characterized in that: During the process of the BMC transmitting the image file to the processor, the method further includes: The BMC detects availability of the n transmission channels; When a channel among the n transmission channels is unavailable, the number of transmission channels in the multi-channel transmission strategy is adjusted accordingly.
7. A mirror file transmission method, characterized in that: The method is applied to a computing device, the computing device including a baseboard management controller (BMC), a processor, and a memory, the BMC being connected to the processor via m transmission channels, where m is greater than or equal to 2, and the processor being connected to the memory, the method comprising: The processor writes a master boot record (MBR) corresponding to the image file mounted on the BMC into the memory, where the MBR is transmitted from the BMC to the processor and includes a boot program and a reserved area; The processor writes the multi-channel transmission strategy in the BMC into the reserved area, where the multi-channel transmission strategy is used to indicate that the image file is transmitted in parallel through n transmission channels, where 2≤n≤m; During the process of running the boot program, the processor obtains the image file from the BMC based on the multi-channel transmission strategy of the reserved area.
8. A computing device, characterized in that The computing device includes a baseboard management controller (BMC), a processor, and a memory. The BMC is connected to the processor via m transmission channels, where m≥2. The processor is connected to the memory, wherein: The BMC is configured to write a master boot record (MBR) corresponding to the mounted image file into the memory through the processor, wherein the MBR includes a boot program and a reserved area; The BMC is further configured to write a preset multi-channel transmission strategy into a reserved area of the MBR in the memory through the processor, wherein the multi-channel transmission strategy is configured to indicate that the image file is transmitted in parallel through n transmission channels, where 2≤n≤m; The processor is configured to obtain the image file from the BMC based on the multi-channel transmission strategy of the reserved area during the execution of the boot program.
9. The computing device according to claim 8, wherein: The processor is specifically configured to: Running the boot program so that the boot program reads the multi-channel transmission strategy of the reserved area; The boot program is configured to divide the image file into n data areas according to n transmission channels preset in the multi-channel transmission strategy; The BMC is specifically configured to transmit the n data areas to the processor through the n transmission channels respectively according to the guidance of the boot program.
10. The computing device according to claim 8 or 9, characterized in that The multi-channel transmission strategy includes channel identifiers, channel types, and bandwidth ratios of the n transmission channels.
11. The computing device according to claim 10, wherein: The processor is specifically configured to: The boot program is run so that the boot program divides the image file into n data areas according to the bandwidth ratio of the n transmission channels, and each of the data areas is transmitted through a transmission channel with a corresponding bandwidth.
12. The computing device according to any one of claims 8 to 11, characterized in that: The BMC is also used to: Obtaining version information of the firmware BIOS running on the processor and the image file; Matching the version information of the BIOS and the image file with a preset version library, wherein the preset version library is used to record the version information of the BIOS and the image file that support the multi-channel transmission strategy; When the version information of the BIOS and the image file are both recorded in the version library, the BMC uses a preset multi-channel transmission strategy to write the firmware BIOS run by the processor into the reserved area of the MBR in the memory.
13. The computing device according to any one of claims 8 to 12, wherein: The BMC is also used for: The BMC detects availability of the n transmission channels; When a channel among the n transmission channels is unavailable, the number of transmission channels in the multi-channel transmission strategy is adjusted accordingly.
14. An electronic device, characterized in that: The electronic device comprises: at least one memory for storing a program; at least one processor, configured to execute the program stored in the memory; When the program stored in the memory is executed, the processor is configured to execute the method according to any one of claims 1 to 7.
15. A computer-readable storage medium storing a computer program, wherein when the computer program is executed on a processor, the processor is caused to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Backup mirror image management system, method and device and medium
CN109992449A
Storage sharing type multi-chip processor system based on bridge chips and starting method thereof
CN112328315A