Firmware upgrading method, electronic equipment, storage medium and program product
By sorting and compressing the BMC firmware upgrade files according to their change weights, and generating incremental firmware upgrade images, the time-consuming BMC firmware upgrade issue is resolved, achieving faster firmware upgrade speeds and shorter upgrade times, improving server product development and user experience.
Patent Information
- Application Number
- CN202511165054.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-20
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-08-20
AI Technical Summary
BMC firmware upgrades take a long time, affecting the speed of server product development and user experience.
By obtaining the original firmware upgrade file of the baseboard management controller, the target files in the read-only partition are arranged in ascending order of change weight to generate a target firmware upgrade image, and a compressed read-only file system is used to generate a read-only partition image and an incremental firmware upgrade image. Finally, the images are compared and uploaded in a non-BMC operating environment for firmware upgrade.
The size of the incremental firmware upgrade image is reduced, the firmware upgrade speed is increased, the firmware upgrade time is shortened, and the server product development rate and user experience are improved.
Smart Images

Figure CN120704722A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of computer hardware management, and in particular to a firmware upgrade method, electronic equipment, storage medium, and program product. Background Art
[0002] As a core component of server management, the Baseboard Management Controller (BMC) is responsible for remote server management and control, hardware status monitoring, and alarm generation. During the R&D and commercial stages of server products, BMC firmware upgrades are crucial for feature debugging, security fixes, and support for new hardware.
[0003] The BMC firmware upgrade method in the related art requires uploading a full firmware upgrade image, which results in a long time consumption for the BMC firmware upgrade. Summary of the Invention
[0004] The present application provides a firmware upgrade method, an electronic device, a storage medium, and a program product to at least solve the problem in the related art that BMC firmware upgrade takes a long time.
[0005] This application provides a firmware upgrade method, including: Get the original firmware upgrade file of the baseboard management controller; Arrange multiple target files in the read-only partition of the original firmware upgrade file in ascending order of change weight to obtain a target firmware upgrade file, wherein the larger the change weight of the target file, the higher the probability of being modified; Based on the target firmware upgrade file, a target firmware upgrade image is generated, wherein a compressed read-only file system is used to generate an image of a read-only partition; Comparing the target firmware upgrade image with the target firmware running image of the baseboard management controller to obtain an incremental firmware upgrade image; The incremental firmware upgrade image is uploaded to the baseboard management controller, so that the baseboard management controller performs a firmware upgrade based on the incremental firmware upgrade image.
[0006] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned firmware upgrade methods when executing the computer program.
[0007] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned firmware upgrade methods are implemented.
[0008] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned firmware upgrade methods when executed by a processor.
[0009] Through the present application, the original firmware upgrade file of the baseboard management controller is obtained; multiple target files in the read-only partition of the original firmware upgrade file are arranged in order of change weight from small to large to obtain the target firmware upgrade file, wherein the larger the change weight of the target file, the higher the probability of being modified, thereby reducing the difference between the target firmware upgrade image and the target firmware running image, thereby reducing the size of the incremental firmware upgrade image; based on the target firmware upgrade file, a target firmware upgrade image is generated, and a read-only partition image is generated using a compressed read-only file system; the target firmware upgrade image is compared with the target firmware running image of the baseboard management controller to obtain an incremental firmware upgrade image; the incremental firmware upgrade image is uploaded to the baseboard management controller, so that the baseboard management controller performs a firmware upgrade based on the incremental firmware upgrade image. Uploading the incremental firmware upgrade image for firmware upgrade and reducing the size of the incremental firmware upgrade image can solve the technical problem of the BMC firmware upgrade taking a long time in the related art, thereby achieving the technical effect of increasing the firmware upgrade speed and shortening the firmware upgrade time. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0011] Figure 1 A flowchart of a firmware upgrade method provided in an embodiment of the present application; Figure 2 A schematic diagram of the arrangement of the BMC firmware image in a 64M Nor Flash provided in an embodiment of the present application; Figure 3 A schematic diagram of file arrangement in a read-only partition in the related art; Figure 4 A schematic diagram of the arrangement of target files in a read-only partition of a target firmware upgrade file provided in an embodiment of the present application; Figure 5 A schematic diagram of a read-only partition image generated after updating the first file in a read-only partition in the related art, where the files in the read-only partition are arranged in alphabetical order of the file names; Figure 6A schematic diagram of a read-only partition image generated after updating the first file in the read-only partition, provided by an embodiment of the present application, when the target files in the read-only partition are arranged in ascending order of change weight; Figure 7 A flowchart of another firmware upgrade method provided in an embodiment of the present application; Figure 8 A flowchart of determining an incremental firmware upgrade mirror block and an erasing method of an incremental firmware running mirror block corresponding to the incremental firmware upgrade mirror block provided in an embodiment of the present application; Figure 9 A schematic diagram of the structure of the target firmware upgrade image provided in an embodiment of the present application; Figure 10 A schematic diagram of the structure of the incremental firmware upgrade image provided in an embodiment of the present application; Figure 11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0012] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0013] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0014] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0015] As a core component of server management, BMC primarily implements remote server management and control, hardware status monitoring, and alerting. BMC firmware upgrades are crucial during both the R&D and commercial stages of server products. Specifically, during R&D, BMC firmware upgrades are used to debug new features; during commercial deployment, BMC firmware upgrades are typically used to patch known security vulnerabilities and support new hardware. Therefore, the speed of BMC firmware upgrades impacts both product development speed and user experience.
[0016] The BMC firmware upgrade process in the related art is as follows: first, a 64-megabyte (M) BMC firmware upgrade image is compiled, and then the BMC firmware upgrade image is uploaded to the BMC operating environment. After the 64M BMC firmware upgrade image is completely uploaded to the BMC operating environment, the data in the non-volatile flash memory (Nor Flash) storing the original BMC operating image is updated. Specifically, the BMC reads the original firmware running image and compares the original firmware running image with the firmware upgrade image data block by data block. Generally, the data block size is fixed at 64 kilobytes (K). If the current data block in the firmware upgrade image is consistent with the corresponding data block in the original firmware running image, the current data block is skipped and the comparison continues with the next data block. If there is any inconsistency between the current data block in the firmware upgrade image and the corresponding data block in the original firmware running image, the corresponding data block in the original firmware running image in the Nor Flash is first erased, and the current data block in the firmware upgrade image is written to the erased location. After traversing and processing 1024 data blocks, the image update is completed, that is, the BMC firmware upgrade is completed, and the BMC is restarted to make the upgraded firmware take effect, that is, the updated image takes effect.
[0017] It is understandable that the BMC firmware upgrade method in the related art requires uploading the full 64M BMC firmware upgrade image each time the BMC firmware is upgraded, even if a small amount of content is modified. In addition, the comparison process between the original running image and the firmware upgrade image is performed on the BMC running environment. These factors result in a longer BMC firmware upgrade time. If it is in the server product R&D stage, it reduces the product R&D speed. If it is in the server product commercial stage, it reduces the user experience.
[0018] In response to the above problems, an embodiment of the present application provides a firmware upgrade method, electronic device, storage medium and program product, the method comprising: obtaining an original firmware upgrade file of a baseboard management controller; arranging multiple target files in a read-only partition of the original firmware upgrade file in ascending order of change weight to obtain a target firmware upgrade file, wherein the greater the change weight of the target file, the higher the probability of being modified; generating a target firmware upgrade image based on the target firmware upgrade file, wherein the image of the read-only partition is generated using a compressed read-only file system; comparing the target firmware upgrade image with the target firmware running image of the baseboard management controller to obtain an incremental firmware upgrade image; uploading the incremental firmware upgrade image to the baseboard management controller, so that the baseboard management controller performs a firmware upgrade based on the incremental firmware upgrade image. The method provided by the above scheme reduces the difference between the target firmware upgrade image and the target firmware running image by arranging multiple target files in the read-only partition of the original firmware upgrade file in order of change weight from small to large, thereby reducing the size of the incremental firmware upgrade image, uploading the incremental firmware upgrade image to the BMC for firmware upgrade and reducing the size of the incremental firmware upgrade image, and the process of comparing the target firmware upgrade image with the target firmware running image is run in a non-BMC operating environment. Therefore, it can solve the technical problem of long BMC firmware upgrade time in related technologies, and achieve the technical effect of improving the firmware upgrade speed and shortening the firmware upgrade time.
[0019] The embodiment of the present application provides a firmware upgrade method, which is applied to a server. Figure 1 A flowchart of the firmware upgrade method provided in the embodiment of the present application is shown in FIG. Figure 1 As shown, the firmware upgrade method includes the following steps: Step S101: obtaining an original firmware upgrade file of a baseboard management controller.
[0020] The original firmware upgrade file is used for BMC firmware upgrades. It includes a universal boot loader partition (uboot partition), a kernel partition (kernel partition), a read-only partition, and a read-write partition. The uboot partition primarily stores BMC startup code, the kernel partition primarily stores kernel files, the read-only partition primarily stores executable program files and configuration files, and the read-write partition is primarily used for dynamically writing data during BMC runtime. When compiling the read-write partition image, it is generally initialized.
[0021] Figure 2 The schematic diagram of the arrangement of the BMC firmware image in the 64M Nor Flash provided in the embodiment of the present application is as follows: Figure 2As shown, the firmware image includes a universal boot loader partition image, a kernel partition image, a read-only partition image, and a read-write partition image. The uboot partition image occupies 1MB of space, the kernel partition image occupies 10MB of space, the read-only partition image occupies 43MB of space, and the read-write partition image occupies 10MB of space. The uboot partition image is a binary file generated based on the BMC boot code, the kernel partition image is a kernel image file compiled from the Linux open source operating system, and the read-only partition image is generated using the compressed read-only file system (SquashFS) based on the files stored in the read-only partition. Firmware images include the target firmware upgrade image, the target firmware running image, and the original firmware running image.
[0022] Step S102 , arranging multiple target files in the read-only partition of the original firmware upgrade file in ascending order of change weights to obtain a target firmware upgrade file, wherein the larger the change weight of the target file, the higher the probability of being modified.
[0023] The read-only partition stores executable program files and configuration files. This means that multiple target files can be executable program files and configuration files stored in the read-only partition. Some of these executable program files are generated by compiling open source code to implement basic functions, while others are generated by business code written by R&D personnel to meet specific business needs. Figure 3 This is a schematic diagram of file arrangement in a read-only partition in the related art, such as Figure 3 As shown, in the related art, the executable program files and configuration files in the read-only partition are arranged in alphabetical order of the file names, such as A, B, C, D, E, F, G, ..., and stored in a directory. When the mksquashfs command in SquashFS is used to create a mirror of the read-only partition, a series of processes will also be performed in the order of these executable program files and configuration files, and finally a complete SquashFS file system image, i.e., the mirror of the read-only partition, is generated.
[0024] This alphabetical arrangement of file names can cause the modified read-only partition image created using the mksquashfs command in SquashFS to have significantly different binary structures than the original read-only partition image if only a few executable program files or configuration files in the read-only partition have been modified. This is because when creating a read-only partition image using the mksquashfs command in SquashFS, the files in the read-only partition are split into fixed-size data blocks, which are then processed sequentially in the order in which the files are arranged to generate the read-only partition image. If the size of some executable program files or configuration files in the directory changes, the generated read-only partition image will experience significant shifts. Binary comparisons focus on the consistency of content at the same location, resulting in significant differences between the generated read-only partition image and the original read-only partition image.
[0025] It is understandable that the arrangement of files in the read-only partition in the related art will cause the image of the read-only partition after the firmware upgrade to be significantly different from the image of the read-only partition before the firmware upgrade. When performing a firmware upgrade, a large number of modifications need to be made to the image of the read-only partition before the firmware upgrade, which reduces the firmware upgrade speed.
[0026] In order to improve the firmware upgrade speed, the embodiment of the present application arranges multiple target files in the read-only partition of the original firmware upgrade file in order of change weight from small to large, so as to reduce the difference between the target firmware upgrade image and the target firmware running image, thereby improving the firmware upgrade speed.
[0027] Figure 4 A schematic diagram of the arrangement of target files in the read-only partition of the target firmware upgrade file provided in the embodiment of the present application is shown as follows: Figure 4 As shown, after arranging the target files in the read-only partition in ascending order of change weight, the arrangement order of the target files in the read-only partition is target files with the first letter B, target files with the first letter F, target files with the first letter C, target files with the first letter G, target files with the first letter A, target files with the first letter E, and target files with the first letter D.
[0028] Figure 5 In the related art, a schematic diagram of a read-only partition image generated after updating the first file in the read-only partition is shown, in which the files in the read-only partition are arranged in alphabetical order of the file names, wherein the grid portion is the difference between the read-only partition image generated after the update and the read-only partition image generated before the update. Figure 6The present invention provides a schematic diagram of a read-only partition image generated after updating the first file in the read-only partition, provided that the target files in the read-only partition are arranged in ascending order of change weight. The grid portion represents the difference between the read-only partition image generated after the update and the read-only partition image generated before the update. It can be seen that the method of arranging the target files in the read-only partition in ascending order of change weight, compared with the method of arranging them in alphabetical order of the file names, greatly reduces the difference between the read-only partition image generated after the update and the read-only partition image generated before the update, and the difference is concentrated at the end of the read-only partition image, thereby improving the firmware upgrade speed.
[0029] Step S103 : generating a target firmware upgrade image based on the target firmware upgrade file, wherein the image of the read-only partition is generated using a compressed read-only file system.
[0030] Step S104 : Compare the target firmware upgrade image with the target firmware running image of the baseboard management controller to obtain an incremental firmware upgrade image.
[0031] It is understandable that the image is generally in binary form, so the target firmware upgrade image is compared with the target firmware running image of the baseboard management controller, that is, the target firmware upgrade image is compared with the target firmware running image of the baseboard management controller in binary form.
[0032] The target firmware running image of the baseboard management controller is generated based on the target firmware running file. Multiple target files in the read-only partition of the original firmware running file corresponding to the original firmware running image of the baseboard management controller are arranged in ascending order of change weight to obtain the target firmware running file. The original firmware running image is the firmware image currently running on the baseboard management controller. It should be noted that the change weight of the target file is continuously updated with each firmware upgrade.
[0033] It is understandable that the incremental firmware upgrade image includes content in the target firmware upgrade image that is different from the target firmware running image of the baseboard management controller.
[0034] Step S105 : uploading the incremental firmware upgrade image to the baseboard management controller, so that the baseboard management controller performs a firmware upgrade based on the incremental firmware upgrade image.
[0035] It can be seen that the comparison process of the target firmware upgrade image and the target firmware running image is run in a non-BMC environment. After the incremental firmware upgrade image is determined, it is uploaded to the BMC, and the BMC performs the firmware upgrade based on the incremental firmware upgrade image.
[0036] The firmware upgrade method provided by the embodiment of the present application obtains the original firmware upgrade file of the baseboard management controller; arranges multiple target files in the read-only partition of the original firmware upgrade file in order of change weight from small to large to obtain the target firmware upgrade file, wherein the larger the change weight of the target file, the higher the probability of being modified, thereby reducing the difference between the target firmware upgrade image and the target firmware running image, thereby reducing the size of the incremental firmware upgrade image; based on the target firmware upgrade file, generates a target firmware upgrade image, and uses a compressed read-only file system to generate an image of the read-only partition; compares the target firmware upgrade image with the target firmware running image of the baseboard management controller to obtain an incremental firmware upgrade image; uploads the incremental firmware upgrade image to the baseboard management controller, so that the baseboard management controller performs a firmware upgrade based on the incremental firmware upgrade image. Uploading the incremental firmware upgrade image for firmware upgrade and reducing the size of the incremental firmware upgrade image can solve the technical problem of the long time-consuming firmware upgrade of the BMC in the related art, thereby achieving the technical effect of improving the firmware upgrade speed and shortening the firmware upgrade time.
[0037] The embodiment of the present application provides a firmware upgrade method, which is applied to a server. Figure 7 A flowchart of the firmware upgrade method provided in the embodiment of the present application is shown in FIG. Figure 7 As shown, the firmware upgrade method includes the following steps: Step S701: Obtain the original firmware upgrade file of the baseboard management controller. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0038] Step S702 , arranging multiple target files in the read-only partition of the original firmware upgrade file in ascending order of change weights to obtain a target firmware upgrade file, wherein the larger the change weight of the target file, the higher the probability of being modified.
[0039] Specifically, the above step S702 includes: Step S7021 : determining a change weight of each target file in a plurality of target files in a read-only partition of an original firmware upgrade file based on a plurality of historical firmware upgrade files of a baseboard management controller.
[0040] Each BMC version release means that the customer needs to upgrade the BMC firmware image once. Therefore, the firmware upgrade file of each historical version release is obtained to determine the change weight of each target file in the read-only partition of the original firmware upgrade file.
[0041] Step S7022: Based on the change weight of each target file in the read-only partition, the target files in the read-only partition of the original firmware upgrade file are arranged in ascending order of change weight to obtain the target firmware upgrade file.
[0042] Step S703: Generate a target firmware upgrade image based on the target firmware upgrade file, wherein a compressed read-only file system is used to generate an image of a read-only partition. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0043] Step S704 : Compare the target firmware upgrade image with the target firmware running image of the baseboard management controller to obtain an incremental firmware upgrade image.
[0044] Specifically, the above step S704 includes: Step S7041: based on the first partition size, the target firmware upgrade image is divided into multiple target firmware upgrade image blocks, and the target firmware operation image is divided into multiple target firmware operation image blocks, wherein the target firmware upgrade image blocks correspond to the target firmware operation image blocks one to one.
[0045] BMC firmware images are typically stored in Nor Flash. A characteristic of Nor Flash is that each data update requires erasing before writing. Erasing must be done in fixed lengths, such as 4KB, 32KB, or 64KB, while writing is done in 256-byte increments. Different erase lengths require different erase times. For example, Table 1 shows a Nor Flash performance indicator.
[0046] Table 1
[0047] As shown in Table 1, when erasing in 4K units, it takes 43ms (milliseconds) to erase one unit; when erasing in 32K units, it takes 190ms to erase one unit; when erasing in 64K units, it takes 340ms to erase one unit; when erasing using the 64M full erase method, it takes 120s (seconds); when programming in 256-byte pages, it takes 0.6ms to write each 256 bytes.
[0048] Table 2 is a comparison of the time taken to erase the entire 64M Nor Flash using different erase lengths.
[0049] Table 2
[0050] As shown in Table 2, when erasing 64M in 4K units, it takes 704s; when erasing 64M in 32K units, it takes 389s; when erasing 64M in 64K units, it takes 348s; and when erasing 64M in 64M units, it takes 120s.
[0051] It can be seen that the time consumed for different erase lengths varies greatly. As mentioned above, when performing a BMC firmware upgrade in the related art, when updating the contents of the Nor Flash, the erase is performed with a fixed data block size (64KB). This method is relatively moderate, neither fast nor slow, and is the result of comprehensive considerations.
[0052] To increase the erasure speed and thus reduce the time required for BMC firmware upgrades, the present embodiment selects the most appropriate erasure method based on the differences between the target firmware upgrade image and the target firmware running image. Specifically, by comparing the target firmware upgrade image and the target firmware running image from a binary perspective, a more appropriate erasure method is selected to produce an incremental firmware upgrade image.
[0053] First, divide the 64M image into 1024 blocks, each 64K in size, that is, the first partition size is 64K.
[0054] Step S7042: For any target firmware upgrade mirror block, based on the second partition size, the target firmware upgrade mirror block is divided into a first part and a second part, and the target firmware operation mirror block corresponding to the target firmware upgrade mirror block is divided into a third part and a fourth part, wherein the first part corresponds to the third part, the second part corresponds to the fourth part, and the second partition size is smaller than the first partition size.
[0055] The second partition size is 32K.
[0056] Step S7043: compare the first part and the third part to obtain a first comparison result.
[0057] Step S7044: compare the second part and the fourth part to obtain a second comparison result.
[0058] Step S7045 : determining an erasing method of the incremental firmware upgrade image block and the incremental firmware running image block corresponding to the incremental firmware upgrade image block based on the first comparison result and the second comparison result.
[0059] Step S7046 : determining the incremental firmware upgrade image based on the incremental firmware upgrade image block and the erasing mode of the incremental firmware running image block corresponding to the incremental firmware upgrade image block.
[0060] Step S705: Upload the incremental firmware upgrade image to the baseboard management controller, so that the baseboard management controller performs a firmware upgrade based on the incremental firmware upgrade image. Figure 1 Step S105 of the illustrated embodiment will not be described in detail here.
[0061] The firmware upgrade method provided in the embodiments of the present application divides the image into coarse-grained blocks using a first partition size, and then further subdivides each block into two parts using a second partition size, achieving a two-level comparison: first coarse-grained, then fine-grained. This approach can accurately locate the minimum range of differences: if only a certain part of a block differs, there is no need to include the entire coarse-grained block in the incremental data; only the difference portion needs to be included. Compared to comparing blocks at a single granularity, this can reduce the transmission and processing of invalid data and improve the efficiency of firmware upgrades.
[0062] In some optional implementations, step S7021 includes: Step a1: determining a historical change rate of each of a plurality of historical target files in a read-only partition of each of the plurality of historical firmware upgrade files based on a plurality of historical firmware upgrade files of a baseboard management controller.
[0063] For any historical firmware upgrade file, determine which historical target files in the read-only partition of the historical firmware upgrade file have changed. Compare each changed historical target file in turn, and determine the historical change rate of the changed historical target file based on the comparison results. It is understood that the historical change rate ranges from 0% to 100%. The historical change rate of each historical target file in the read-only partition of the historical firmware upgrade file can be calculated, and further, the historical change rate of each historical target file in the read-only partition of each historical firmware upgrade file can be calculated.
[0064] Step a2: for any historical target file, add up the multiple historical change rates corresponding to the historical target file to obtain the total historical change rate of the historical target file, so as to obtain the total historical change rate of each historical target file.
[0065] Step a3: determining a change weight of each historical target file based on the sum of the historical change rates of each historical target file.
[0066] For any historical target file, the sum of the historical change rates of the historical target file is used as the change weight of the historical target file.
[0067] It can be understood that a change weight list of historical target files can be generated based on each historical target file and the change weight of each historical target file. The change weight in the list reflects the probability of different historical target files being modified. The larger the change weight, the higher the possibility that the historical target file will be modified in the future.
[0068] Step a4: determining the change weight of each target file in the multiple target files in the read-only partition of the original firmware upgrade file based on the change weight of each historical target file.
[0069] After obtaining the change weight of each historical target file, for any target file in the read-only partition of the original firmware upgrade file, the change weight of the historical target file corresponding to the target file is used as the change weight of the target file. It can be understood that the historical target file corresponding to the target file is the historical target file with the same name as the target file.
[0070] The firmware upgrade method provided in the embodiment of the present application greatly reduces the difference between the target firmware upgrade image and the target firmware running image by sorting the target files according to the change weight, thereby reducing the size of the incremental firmware upgrade image and improving the speed of the firmware upgrade.
[0071] In some optional implementations, step S7045 includes: Step b1: If the first comparison result is that the first part and the third part are different, and the second comparison result is that the second part and the fourth part are different, then it is determined that the target firmware upgrade mirror block is an incremental firmware upgrade mirror block, the target firmware operation mirror block corresponding to the target firmware upgrade mirror block is the incremental firmware operation mirror block corresponding to the incremental firmware upgrade mirror block, and the erasure method of the target firmware operation mirror block corresponding to the target firmware upgrade mirror block is determined to be erasure in units of the first erasure size.
[0072] The first erase size is 64KB. Comparing the first and third parts, and the second and fourth parts, will yield four possible comparison results: 1. The first and third parts differ, and the second and fourth parts differ; 2. The first and third parts are identical, and the second and fourth parts differ; 3. The first and third parts differ, and the second and fourth parts are identical; and 4. The first and third parts are identical, and the second and fourth parts are identical. As can be understood, a difference is considered a difference if only one byte differs.
[0073] When the comparison result is the fourth one, it indicates that the target firmware upgrade image block is not an incremental firmware upgrade image block and does not need to be placed in the incremental firmware upgrade image for firmware upgrade.
[0074] When the comparison result is the first one, it means that the front and back parts of the target firmware upgrade mirror block are different from the corresponding target firmware running mirror block. At this time, it is determined that the target firmware upgrade mirror block is an incremental firmware upgrade mirror block, and the erasure method of the target firmware running mirror block corresponding to the target firmware upgrade mirror block is determined to be erased in units of 64K.
[0075] The firmware upgrade method provided in the embodiment of the present application determines the most efficient erasing method through comparison, thereby improving the efficiency of firmware upgrade.
[0076] In some optional implementations, the above step S7045 includes: Step c1: If the first comparison result shows that the first part and the third part are different, and the second comparison result shows that the second part and the fourth part are the same, then based on the third division size, the first part is divided into multiple fifth parts, and the third part is divided into multiple sixth parts, wherein the fifth part and the sixth part correspond one to one, and the third division size is smaller than the second division size.
[0077] The third partition size is 4KB. If the comparison result is the third one, it indicates that the second portion of the target firmware upgrade image block is not an incremental firmware upgrade image block and does not need to be included in the incremental upgrade image for firmware upgrade. The first portion of the target firmware image block and the third portion of the target firmware runtime image block corresponding to the target firmware image block are further partitioned, that is, the 32KB block is evenly divided into eight 4KB portions.
[0078] Step c2: for any fifth part, compare the fifth part with the corresponding sixth part to obtain a third comparison result.
[0079] Step c3: determining, based on the third comparison result, an erasing method of the incremental firmware upgrade mirror block and the incremental firmware running mirror block corresponding to the incremental firmware upgrade mirror block.
[0080] The firmware upgrade method provided in the embodiment of the present application determines the most efficient erasing method through comparison, thereby improving the efficiency of firmware upgrade.
[0081] In some optional implementations, the above step c3 includes: Step c31: When the third comparison result indicates that the number of target fifth parts in the first part that are different from the corresponding sixth part exceeds a preset number threshold, it is determined that the first part is an incremental firmware upgrade image block, the third part corresponding to the first part is an incremental firmware running image block corresponding to the incremental firmware upgrade image block, and the erasure method of the third part corresponding to the first part is determined to be erasure in units of a second erasure size, wherein the second erasure size is smaller than the first erasure size.
[0082] The second erase size is 32 KB. It is understood that if the number of target fifth parts in the first part that differ from the corresponding sixth part exceeds a preset threshold, erasing in 32 KB units will be faster. That is, the first part is used as an incremental firmware upgrade image block.
[0083] The firmware upgrade method provided in the embodiment of the present application determines the most efficient erasing method through comparison, thereby improving the efficiency of firmware upgrade.
[0084] In some optional implementations, the firmware upgrade method further includes: Step d1: When the third comparison result indicates that the number of target fifth parts that are different from the corresponding sixth part in the first part does not exceed the preset number threshold, determine that the target fifth part is an incremental firmware upgrade image block, and the sixth part corresponding to the target fifth part is the incremental firmware running image block corresponding to the incremental firmware upgrade image block, and determine that the erasure method of the sixth part corresponding to the target fifth part is to erase in units of a third erasure size, wherein the third erasure size is smaller than the second erasure size.
[0085] The third erase size is 4K. It is understood that if the number of target fifth parts that differ from the corresponding sixth part in the first part does not exceed a preset threshold, erasing in 4K units will be faster. That is, the target fifth part is used as an incremental firmware running image block.
[0086] It should be noted that if the first comparison result is that the first part and the third part are the same, and the second comparison result is that the second part and the fourth part are different, that is, in the case where the comparison result is the second type, the process of determining the erasure method of the incremental firmware upgrade mirror block and the incremental firmware running mirror block corresponding to the incremental firmware upgrade mirror block is similar to the process of determining the erasure method of the incremental firmware upgrade mirror block and the incremental firmware running mirror block corresponding to the incremental firmware upgrade mirror block when the comparison result is the third type. See the aforementioned steps c1 to c3, and the relevant description of step d1, which will not be repeated here.
[0087] In order to make the process of determining the incremental firmware upgrade image block and the erasing method of the incremental firmware running image block corresponding to the incremental firmware upgrade image block clearer, Figure 8 Describe, Figure 8 A flowchart of an embodiment of the present application for determining an incremental firmware upgrade mirror block and an erasing method of an incremental firmware running mirror block corresponding to the incremental firmware upgrade mirror block is provided, as shown in FIG. Figure 8 As shown, the process includes: The 64M target firmware upgrade image is divided into 1024 blocks of 64K each, and the 64K data blocks are processed one by one.
[0088] Divide the current 64K data block into two 32K data blocks and process them separately. Determine whether the data contents of the two 32K data blocks are consistent with the corresponding data blocks in the target firmware running image.
[0089] If the data contents of the two 32K data blocks are consistent with the data contents of the corresponding data blocks in the target firmware running image, it is determined that the 64K data block is not an incremental firmware upgrade image block, and the next 64K data block is traversed.
[0090] If the data contents of both 32K data blocks are inconsistent with the corresponding data blocks in the target firmware running image, the current 64K data block is determined to be an incremental firmware upgrade image block, and the corresponding 64K data block in the target firmware running image of the current 64K data block is erased in units of 64K.
[0091] If one of the two 32K data blocks has data content different from the corresponding data block in the target firmware running image, the target 32K data block with different data content from the corresponding data block in the target firmware running image will be divided into 8 4K data blocks and processed separately.
[0092] It is determined whether the number of target 4K data blocks in the eight 4K data blocks having different data contents from corresponding data blocks in the target firmware running image is greater than N.
[0093] If the number of target 4K data blocks in the 8 4K data blocks that have different data contents from the corresponding data blocks in the target firmware running image is greater than N, the target 32K data block is determined as the incremental firmware upgrade image block, and the corresponding 32K data block in the target firmware running image is erased in units of 32K.
[0094] If the number of target 4K data blocks in the 8 4K data blocks whose data contents are different from those of the corresponding data blocks in the target firmware running image is not greater than N, then the target 4K data blocks in the 8 4K data blocks whose data contents are different from those of the corresponding data blocks in the target firmware running image are determined as incremental firmware upgrade image blocks, and the erasure method of the corresponding 4K data blocks in the target firmware running image is to erase them in units of 4K.
[0095] The firmware upgrade method provided in the embodiment of the present application determines the most efficient erasing method through comparison, thereby improving the efficiency of firmware upgrade.
[0096] In some optional implementations, the firmware upgrade method further includes: Step e1: Obtain a first erasing time and a first writing time of data of a second erasure size.
[0097] Step e2: Obtain a second erasing time and a second writing time of data of a third erasure size.
[0098] Among them, according to the different physical characteristics of different Nor Flash models, the time consumption TS1 for erasing 4K data and the programming time TS2 for writing are determined; the time consumption TB1 for erasing 32K data and the programming time TB2 for writing are determined, thereby dynamically calculating the preset quantity threshold.
[0099] In step e3, based on the first erasing time, the first writing time, the second erasing time, and the second writing time, a preset number threshold is determined by the following formula: N=(TB1+TB2) / (TS1+TS2) Wherein, N is a preset number threshold, TB1 is a first erasing time, TB2 is a first writing time, TS1 is a second erasing time, and TS2 is a second writing time.
[0100] Under the physical characteristics of an example model of Nor Flash, it takes 190ms to erase 32K data and 76.8ms to write 32K data, so the total time to erase and write 32K data is 266.8ms. It takes 43ms to erase 4K data and 9.6ms to write 4K data, so the total time to erase and write 4K data is 52.6ms. When N is calculated as 5 by the above formula, that is, when the number of target fifth parts in the first part that are different from the corresponding sixth part is greater than 5, it will be faster to choose the 32K erase method to erase Nor Flash. When the number of target fifth parts is not greater than 5, it will be faster to choose the 4K erase method to erase Nor Flash.
[0101] In some optional implementations, step S7046 includes: Step f1: determining an offset address of an incremental firmware running mirror block corresponding to the incremental firmware upgrade mirror block in a target storage module storing an original firmware running mirror of a baseboard management controller.
[0102] The target storage module is the target Nor Flash.
[0103] Step f2, determining the data header of the incremental firmware upgrade mirror block based on the offset address of the incremental firmware operation mirror block corresponding to the incremental firmware upgrade mirror block in the target storage module of the original firmware operation image of the storage baseboard management controller and the erasing method of the incremental firmware operation mirror block corresponding to the incremental firmware upgrade mirror block.
[0104] Among them, the incremental firmware upgrade image includes an incremental firmware upgrade image block and a data header of the incremental firmware upgrade image block, wherein the data header of the incremental firmware upgrade image block is used to indicate the offset address of the incremental firmware running mirror block corresponding to the incremental firmware upgrade mirror block in the target storage module of the original firmware running image of the storage baseboard management controller, the data block size of the incremental firmware upgrade mirror block and the erasure method of the incremental firmware running mirror block corresponding to the incremental firmware upgrade mirror block.
[0105] For example, the structure of the data header may be as follows: struct data_head { int magic; / / 0x1234abcd int erase_type; / / 4K, 32K, 64K int data_len; / / data block size int data_addr; / / starting offset of data }; Among them, the magic field is used to indicate that this is the starting point of the data header; the erase_type field indicates the erasing method of the incremental firmware running mirror block corresponding to the incremental firmware upgrade mirror block; data_len indicates the data block size of the incremental firmware upgrade mirror block; int data_addr indicates the offset address of the incremental firmware running mirror block corresponding to the incremental firmware upgrade mirror block in the target storage module of the original firmware running image of the storage baseboard management controller, and the value range is 0 to 64M.
[0106] It can be understood that by traversing the 1024 target firmware upgrade mirror blocks, the erasing method of the incremental firmware running mirror block corresponding to each incremental firmware upgrade mirror block and the offset address of the incremental firmware running mirror block corresponding to each incremental firmware upgrade mirror block in the target storage module of the original firmware running image of the storage baseboard management controller are obtained, and then the data header of each incremental firmware upgrade mirror block can be determined to produce the entire incremental firmware upgrade image.
[0107] Step f3: determining the incremental firmware upgrade image based on the incremental firmware upgrade image block and the data header of the incremental firmware upgrade image block.
[0108] For example, Figure 9 A schematic diagram of the structure of the target firmware upgrade image provided in the embodiment of the present application is shown as follows: Figure 9 As shown, the grid portion is an incremental firmware upgrade image block, wherein the sizes of different incremental firmware upgrade image blocks can be 4K, 64K, and 32K. Figure 10 This is a schematic diagram of the structure of the incremental firmware upgrade image provided in the embodiment of the present application, such as Figure 10 As shown, the incremental firmware upgrade image includes multiple data headers and multiple incremental firmware upgrade image blocks corresponding to the multiple data headers. In the incremental firmware upgrade image, they are arranged in the order of data header, incremental firmware upgrade image block corresponding to the data header, data header, and incremental firmware upgrade image block corresponding to the data header, wherein the grid part is the incremental firmware upgrade image block.
[0109] The firmware upgrade method provided in the embodiment of the present application ensures that the storage area that needs to be erased and written can be accurately located when performing a BMC firmware upgrade, thereby improving the accuracy of the BMC firmware upgrade.
[0110] In some optional implementations, the above step S705 includes: Step g1: determining a first upload time for uploading the incremental firmware upgrade image to the baseboard management controller and a second upload time for uploading the target firmware upgrade image to the baseboard management controller based on the local network speed.
[0111] Step g2: obtaining a first upgrade time required for the baseboard management controller to perform a firmware upgrade using the incremental firmware upgrade image.
[0112] It is understandable that, by the above method, the total number of incremental firmware upgrade image blocks in the target firmware upgrade image and the erasing method of the incremental firmware running image block corresponding to each incremental firmware upgrade image block can be obtained, and then the first upgrade time required for firmware upgrade using the incremental firmware upgrade image can be calculated. The calculation formula is as follows: T=T0×N0+T1×N1+T2×N2 Among them, T is the first upgrade time, T0 is the time required to erase a single 4K data, T1 is the time required to erase a single 32K data, T2 is the time required to erase a single 64K data, N0 is the number of incremental firmware running image blocks erased in units of 4K, N1 is the number of incremental firmware running image blocks erased in units of 32K, and N2 is the number of incremental firmware running image blocks erased in units of 64K.
[0113] For example, the number of incremental firmware running mirror blocks erased in 4K units is 202 blocks, the number of incremental firmware running mirror blocks erased in 32K units is 154 blocks, and the number of incremental firmware running mirror blocks erased in 64K units is 312 blocks. It can be calculated from Table 1 that erasing a single 4K data takes 52.6ms, erasing a single 32K data takes 266.8ms, and erasing a single 64K data takes 493.6ms. In this way, the first upgrade time can be calculated to be 247.87s.
[0114] Step g3: obtaining a second upgrade time required for the baseboard management controller to perform a firmware upgrade using the target firmware upgrade image in a full-erase manner.
[0115] For example, Table 1 shows that using a full erase method, the erasing time required for firmware upgrade using the target firmware upgrade image is 120 seconds, and the writing time is 157.3 seconds. The second upgrade time is the total erase and write time, which is 277.3 seconds. A full erase is a 64MB full erase, which means that the original firmware running image is completely erased at once.
[0116] Step g4, when the sum of the first upgrade time and the first upload time is not greater than the sum of the second upgrade time and the second upload time, uploading the incremental firmware upgrade image to the baseboard management controller, so that the baseboard management controller performs firmware upgrade based on the incremental firmware upgrade image.
[0117] The sum of the first upgrade time and the first upload time is the first sum, and the sum of the second upgrade time and the second upload time is the second sum. When the first sum is not greater than the second sum, the firmware upgrade is performed based on the incremental firmware upgrade image.
[0118] Step g5: when the sum of the first upgrade time and the first upload time is greater than the sum of the second upgrade time and the second upload time, uploading the target firmware upgrade image to the baseboard management controller, so that the baseboard management controller performs firmware upgrade based on the target firmware upgrade image.
[0119] When the first sum is greater than the second sum, the firmware upgrade is performed in a full-erase manner based on the target firmware upgrade image.
[0120] The firmware upgrade method provided by the embodiments of this application addresses the inability to estimate the duration of a firmware upgrade in the related art. This method improves the user experience. In a BMC firmware upgrade scenario, the method combines the local network speed to determine the first and second upload times, estimates the first and second upgrade times, and dynamically selects a more efficient firmware upgrade method based on the sum of the first and second sums, further improving the firmware upgrade speed.
[0121] In some optional implementations, the firmware upgrade method further includes: Step h1, while uploading the incremental firmware upgrade image to the baseboard management controller, in parallel execute the step of erasing the target offset address data in the target storage module storing the original firmware running image of the baseboard management controller based on the data header and incremental firmware upgrade image block in the uploaded incremental firmware upgrade image.
[0122] or, While uploading the target firmware upgrade image to the baseboard management controller, the steps of erasing the data in the target storage module storing the original firmware running image of the baseboard management controller and writing the uploaded target firmware upgrade image to the corresponding position of the target storage module are performed in parallel.
[0123] In the related art, when upgrading the BMC firmware, uploading the BMC firmware upgrade image and updating the Nor Flash storing the original firmware running image are performed serially. This method causes the firmware upgrade to take a long time and be slow.
[0124] Since the total time consumed for erasing Nor Flash is greater than the time consumed for uploading the image in most cases, the embodiment of the present application improves the speed of firmware upgrade by uploading the BMC firmware upgrade image and updating the NorFlash storing the original firmware running image in parallel.
[0125] When performing firmware upgrade based on the incremental firmware upgrade image, when uploading the first data header and the incremental firmware upgrade image block corresponding to the first data header, the content of the corresponding position in the Nor Flash storing the original firmware running image of the baseboard management controller begins to be erased. While uploading the incremental firmware upgrade image, the content of the corresponding position in the Nor Flash storing the original firmware running image of the baseboard management controller is erased, and the two are carried out simultaneously.
[0126] When performing a firmware upgrade based on the target firmware upgrade image, as soon as the first data block is uploaded, a full-erase command is issued to the Nor Flash, which stores the original firmware running image of the baseboard management controller. This allows the full Nor Flash erase to proceed simultaneously with the writing of the BMC's 64MB target firmware upgrade image to the Nor Flash. This parallel processing method further improves the speed of BMC firmware upgrades.
[0127] For example, if the local network speed is 2M / s and the firmware upgrade is performed based on the target firmware upgrade image, it can be calculated that the time taken to upload the target firmware upgrade image is 32s, the second upgrade time is 277.3s, and the total time taken for the non-parallel method is 309.3s. The parallel solution proposed in the embodiment of the present application can complete the entire upgrade in only 277.3s. The parallel processing of this part alone can increase the upgrade speed by about 10%.
[0128] The firmware upgrade method provided in the embodiment of the present application further reduces the time for BMC firmware upgrade and improves the efficiency of BMC firmware upgrade by processing image upload and image erasure in parallel.
[0129] In some optional implementations, step S7021 includes: Step i1: receiving the user-defined change rate of each target file in the read-only partition uploaded by the user.
[0130] Among them, the user can be the R&D personnel of the BMC firmware. The R&D personnel determine the custom change rate of each target file in the read-only partition based on the high-frequency modification requirements fed back by BMC users. For any target file, the higher the modification requirement of the target file, the higher the custom change rate of the target file.
[0131] Step i2: determining the change weight of each target file in the read-only partition of the original firmware upgrade file based on multiple historical firmware upgrade files of the baseboard management controller and the user-defined change rate of each target file in the read-only partition uploaded by the user.
[0132] Specifically, based on multiple historical firmware upgrade files of the baseboard management controller, the historical change rate of each historical target file in the multiple historical target files in the read-only partition of each historical firmware upgrade file in the multiple historical firmware upgrade files is determined; for any historical target file, the multiple historical change rates corresponding to the historical target file are added to obtain the sum of the historical change rates of the historical target file to obtain the sum of the historical change rates of each historical target file; based on the sum of the historical change rates of each historical target file, the change weight of each historical target file is determined; based on the change weight of each historical target file and the custom change rate of each target file in the read-only partition uploaded by the user, the change weight of each target file in the multiple target files in the read-only partition of the original firmware upgrade file is determined.
[0133] Based on the change weight of each historical target file and the user-defined change rate of each target file in the read-only partition uploaded by the user, the change weight of each target file in the read-only partition of the original firmware upgrade file is determined, including: For any target file, based on the name of the target file, the change weight of the target historical target file with the same name as the target file is filtered out from the change weights of the historical target files, and the change weight of the target historical target file is used as the initial change weight of the target file. The initial change weight of the target file and the custom change rate of the target file are added to obtain the change weight of the target file.
[0134] The firmware upgrade method provided in the embodiment of the present application incorporates change weights into both historical change rates and custom change rates, avoiding the problem that relying solely on historical change rates may ignore new requirements, or relying solely on subjective judgment may deviate from actual upgrade rules. This makes the change weights more suitable for the actual scenario of firmware upgrades, further reduces the difference between the target firmware upgrade image and the target firmware running image, and further reduces the size of the incremental firmware upgrade image, thereby improving the firmware upgrade speed.
[0135] The firmware upgrade method provided in the embodiment of the present application reduces the difference between the target firmware upgrade image and the target firmware running image, dynamically selects a faster method for erasing the incremental firmware running image block, and comprehensively selects the fastest firmware upgrade method based on the actual network conditions when uploading the image. It can also accurately estimate the time required for this firmware upgrade, and while improving the firmware upgrade speed, it can also prompt the user of the firmware upgrade time, thereby improving the development efficiency and customer experience of server products.
[0136] The firmware upgrade method provided by the embodiments of the present application can ensure that the slowest average firmware upgrade speed is achieved by using a full erase method. Compared with the firmware upgrade methods in related technologies, the firmware upgrade speed is improved by about 10%. The embodiments of the present application move the image comparison operation originally performed in the BMC operating environment to the image creation stage, and use a binary comparison method to concentrate the differences and only update the different data blocks. The smaller the size of the incremental firmware upgrade image, the more significant the improvement in firmware upgrade speed.
[0137] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0138] The embodiment of the present application also provides an electronic device, such as Figure 11 As shown, it includes a processor 1101 and a memory 1102, wherein the memory 1102 stores a computer program, and the processor 1101 is configured to run the computer program to execute the steps in any of the above firmware upgrade method embodiments.
[0139] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above-mentioned firmware upgrade method embodiments when running.
[0140] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0141] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned firmware upgrade method embodiments are implemented.
[0142] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned firmware upgrade method embodiments are implemented.
[0143] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may 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.
[0144] The above is a detailed introduction to a firmware upgrade method, electronic device, storage medium and program product provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A firmware upgrade method, characterized in that: include: Get the original firmware upgrade file of the baseboard management controller; Arranging the multiple target files in the read-only partition of the original firmware upgrade file in ascending order of change weight to obtain a target firmware upgrade file, wherein the larger the change weight of the target file, the higher the probability of being modified; Based on the target firmware upgrade file, a target firmware upgrade image is generated, wherein the image of the read-only partition is generated using a compressed read-only file system; Comparing the target firmware upgrade image with the target firmware running image of the baseboard management controller to obtain an incremental firmware upgrade image; The incremental firmware upgrade image is uploaded to a baseboard management controller, so that the baseboard management controller performs a firmware upgrade based on the incremental firmware upgrade image.
2. The method according to claim 1, characterized in that The step of arranging the plurality of target files in the read-only partition of the original firmware upgrade file in ascending order of change weights to obtain a target firmware upgrade file comprises: Determining a change weight of each of a plurality of target files in a read-only partition of the original firmware upgrade file based on a plurality of historical firmware upgrade files of the baseboard management controller; Based on the change weight of each target file in the read-only partition, the target files in the read-only partition of the original firmware upgrade file are arranged in ascending order of the change weight to obtain a target firmware upgrade file.
3. The method according to claim 2, characterized in that The determining, based on the multiple historical firmware upgrade files of the baseboard management controller, a change weight of each target file in the multiple target files in the read-only partition of the original firmware upgrade file includes: determining, based on a plurality of historical firmware upgrade files of the baseboard management controller, a historical change rate of each of a plurality of historical target files in a read-only partition of each of the plurality of historical firmware upgrade files; For any historical target file, multiple historical change rates corresponding to the historical target file are added together to obtain the sum of the historical change rates of the historical target file, thereby obtaining the sum of the historical change rates of each historical target file; Determining a change weight of each historical target file based on the sum of the historical change rates of each historical target file; Based on the change weight of each historical target file, a change weight of each target file in the read-only partition of the original firmware upgrade file is determined.
4. The method according to claim 1, wherein The step of comparing the target firmware upgrade image with the target firmware running image of the baseboard management controller to obtain an incremental firmware upgrade image includes: Based on the first partition size, the target firmware upgrade image is divided into a plurality of target firmware upgrade image blocks, and the target firmware operation image is divided into a plurality of target firmware operation image blocks, wherein the target firmware upgrade image blocks correspond to the target firmware operation image blocks in a one-to-one manner; For any target firmware upgrade image block, based on a second partition size, dividing the target firmware upgrade image block into a first part and a second part, and dividing the target firmware running image block corresponding to the target firmware upgrade image block into a third part and a fourth part, wherein the first part corresponds to the third part, the second part corresponds to the fourth part, and the second partition size is smaller than the first partition size; Comparing the first part and the third part to obtain a first comparison result; comparing the second part and the fourth part to obtain a second comparison result; Determining, based on the first comparison result and the second comparison result, a method for erasing the incremental firmware upgrade mirror block and the incremental firmware running mirror block corresponding to the incremental firmware upgrade mirror block; The incremental firmware upgrade image is determined based on the incremental firmware upgrade image block and an erasing mode of an incremental firmware running image block corresponding to the incremental firmware upgrade image block.
5. The method according to claim 4, characterized in that The determining, based on the first comparison result and the second comparison result, a method for erasing the incremental firmware upgrade mirror block and the incremental firmware running mirror block corresponding to the incremental firmware upgrade mirror block includes: If the first comparison result is that the first part and the third part are different, and the second comparison result is that the second part and the fourth part are different, then it is determined that the target firmware upgrade mirror block is an incremental firmware upgrade mirror block, the target firmware running mirror block corresponding to the target firmware upgrade mirror block is the incremental firmware running mirror block corresponding to the incremental firmware upgrade mirror block, and the erasure method of the target firmware running mirror block corresponding to the target firmware upgrade mirror block is determined to be erasure in units of the first erasure size.
6. The method according to claim 4, characterized in that The determining, based on the first comparison result and the second comparison result, a method for erasing the incremental firmware upgrade mirror block and the incremental firmware running mirror block corresponding to the incremental firmware upgrade mirror block includes: If the first comparison result shows that the first part and the third part are different, and the second comparison result shows that the second part and the fourth part are the same, then, based on a third partition size, dividing the first part into a plurality of fifth parts, and dividing the third part into a plurality of sixth parts, wherein the fifth parts and the sixth parts are in one-to-one correspondence, and the third partition size is smaller than the second partition size; For any fifth part, compare the fifth part with the corresponding sixth part to obtain a third comparison result; Based on the third comparison result, a method for erasing the incremental firmware upgrade mirror block and the incremental firmware running mirror block corresponding to the incremental firmware upgrade mirror block is determined.
7. The method according to claim 6, characterized in that The determining, based on the third comparison result, a method for erasing the incremental firmware upgrade mirror block and the incremental firmware running mirror block corresponding to the incremental firmware upgrade mirror block includes: When the third comparison result indicates that the number of target fifth parts in the first part that are different from the corresponding sixth part exceeds a preset number threshold, it is determined that the first part is an incremental firmware upgrade image block, the third part corresponding to the first part is an incremental firmware running image block corresponding to the incremental firmware upgrade image block, and the erasure method of the third part corresponding to the first part is determined to be erasure in units of a second erasure size, wherein the second erasure size is smaller than the first erasure size.
8. The method according to claim 7, characterized in that The method further comprises: When the third comparison result indicates that the number of target fifth parts in the first part that are different from the corresponding sixth part does not exceed a preset number threshold, it is determined that the target fifth part is an incremental firmware upgrade image block, the sixth part corresponding to the target fifth part is the incremental firmware running image block corresponding to the incremental firmware upgrade image block, and the erasure method of the sixth part corresponding to the target fifth part is determined to be erasure in units of a third erasure size, wherein the third erasure size is smaller than the second erasure size.
9. The method according to claim 8, characterized in that The method further comprises: Obtaining a first erasing time and a first writing time of data of a second erasing size; Obtaining a second erasing time and a second writing time of data of a third erasing size; Based on the first erasing time, the first writing time, the second erasing time, and the second writing time, the preset number threshold is determined by the following formula: N=(TB1+TB2) / (TS1+TS2) Wherein, N is the preset number threshold, TB1 is the first erasing time, TB2 is the first writing time, TS1 is the second erasing time, and TS2 is the second writing time.
10. The method according to claim 4, characterized in that The determining the incremental firmware upgrade image based on the incremental firmware upgrade image block and the erasing mode of the incremental firmware running image block corresponding to the incremental firmware upgrade image block includes: Determine an offset address of an incremental firmware running mirror block corresponding to the incremental firmware upgrade mirror block in a target storage module storing an original firmware running mirror of the baseboard management controller; Determine a data header of the incremental firmware upgrade mirror block based on an offset address of the incremental firmware running mirror block corresponding to the incremental firmware upgrade mirror block in the target storage module storing the original firmware running image of the baseboard management controller and an erasure mode of the incremental firmware running mirror block corresponding to the incremental firmware upgrade mirror block; The incremental firmware upgrade image is determined based on the incremental firmware upgrade image block and a data header of the incremental firmware upgrade image block.
11. The method according to claim 1, wherein The step of uploading the incremental firmware upgrade image to a baseboard management controller so that the baseboard management controller performs a firmware upgrade based on the incremental firmware upgrade image includes: Determining, based on a local network speed, a first upload time for uploading the incremental firmware upgrade image to the baseboard management controller and a second upload time for uploading the target firmware upgrade image to the baseboard management controller; Obtaining a first upgrade time required for the baseboard management controller to perform a firmware upgrade using the incremental firmware upgrade image; Obtaining a second upgrade time required for the baseboard management controller to perform a firmware upgrade using the target firmware upgrade image in a full-erase manner; When the sum of the first upgrade time and the first upload time is not greater than the sum of the second upgrade time and the second upload time, uploading the incremental firmware upgrade image to the baseboard management controller, so that the baseboard management controller performs a firmware upgrade based on the incremental firmware upgrade image; When the sum of the first upgrade time and the first upload time is greater than the sum of the second upgrade time and the second upload time, the target firmware upgrade image is uploaded to the baseboard management controller, so that the baseboard management controller performs a firmware upgrade based on the target firmware upgrade image.
12. The method according to claim 11, characterized in that The method further comprises: While uploading the incremental firmware upgrade image to the baseboard management controller, in parallel, executing the step of erasing data at a target offset address in a target storage module storing an original firmware running image of the baseboard management controller based on a data header and an incremental firmware upgrade image block in the uploaded incremental firmware upgrade image; or, While uploading the target firmware upgrade image to the baseboard management controller, the steps of completely erasing the data in the target storage module storing the original firmware running image of the baseboard management controller and writing the uploaded target firmware upgrade image to the corresponding position of the target storage module are performed in parallel.
13. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the firmware upgrade method according to any one of claims 1 to 12 when executing the computer program.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the firmware upgrade method according to any one of claims 1 to 12.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the firmware upgrade method according to any one of claims 1 to 12 are implemented.
Citation Information
Patent Citations
Server power supply firmware upgrading method, device and equipment and readable storage medium
CN111538516A
Substrate management controller upgrading method and device and medium thereof
CN117170701A
Server firmware upgrading method and device, storage medium and electronic equipment
CN117608618A
Mainboard firmware upgrading method, device and equipment based on substrate management controller
CN117873520A
Basic input and output system firmware upgrading method, product, equipment and medium
CN118567692A