Firmware updating method, firmware updating device, equipment and storage medium

By dividing the firmware into multiple logical areas and performing incremental updates, the problems of large, long time and low efficiency of firmware update resources in the prior art are solved, and efficient and low-consumable firmware updates are achieved.

CN120335849BActive Publication Date: 2025-09-02INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510822186.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2025-09-02
Estimated Expiration
2045-06-19

AI Technical Summary

Technical Problem

The existing firmware update method requires downloading a complete firmware installation package, resulting in large network resource usage, high time cost, low update efficiency, and compatibility issues and waste of resources.

Method used

Divide the firmware into multiple logical areas, determine the partition to be updated by comparing the version information, and only send a data difference set for incremental updates to avoid full data transmission.

Benefits of technology

It reduces the amount of data transmission during firmware updates, shortens update time, improves operation and maintenance efficiency, reduces resource consumption, and reduces compatibility risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120335849B_ABST
    Figure CN120335849B_ABST
Patent Text Reader

Abstract

The present application provides a firmware update method, firmware update device, equipment, and storage medium, which can be applied to the field of server technology. The firmware update method includes: obtaining version information of multiple firmware partitions in a first version of firmware installed by a target component, where the multiple firmware partitions are obtained by dividing the firmware into multiple logical areas according to multiple functions of the firmware; comparing the version information of multiple firmware partitions in a current second version of firmware with the version information of multiple firmware partitions in the first version of firmware, and determining a partition to be updated among the multiple firmware partitions of the first version of firmware; determining the data difference between the partition to be updated and the corresponding partition in the second version of firmware, and obtaining an update data set; and sending the update data set to the target component so that the target component updates the first version of firmware according to the update data set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of servers, and in particular to a firmware updating method, firmware updating apparatus, device and storage medium. Background Art

[0002] As server scale and functionality evolve, the frequency of firmware updates increases. Related firmware update methods typically require downloading the complete firmware installation package. However, complete firmware installation packages are large (typically hundreds of megabytes), which consumes significant network resources, is time-consuming, and results in low update efficiency. Summary of the Invention

[0003] In view of the above problems, the present application provides a firmware update method, a firmware update device, a device and a storage medium.

[0004] According to a first aspect of the present application, a method for updating firmware is provided, comprising: obtaining version information of respective multiple firmware partitions in a first version firmware installed by a target component, where the multiple firmware partitions are obtained by dividing the firmware into multiple logical areas according to multiple functions of the firmware; comparing the version information of respective multiple firmware partitions in a currently held second version firmware with the version information of respective multiple firmware partitions in the first version firmware, and determining a partition to be updated among the multiple firmware partitions of the first version firmware; determining a data difference between the partition to be updated and the corresponding firmware partition in the second version firmware, and obtaining an update data set; and sending the update data set to the target component, so that the target component updates the first version firmware according to the update data set.

[0005] The second aspect of the present application provides a firmware updating device, including: an obtaining module, used to obtain the version information of each of multiple firmware partitions in the first version firmware installed by the target component, where the multiple firmware partitions are obtained by dividing the firmware into multiple logical areas according to the multiple functions of the firmware; a comparing module, used to compare the version information of each of the multiple firmware partitions in the current second version firmware with the version information of each of the multiple firmware partitions in the first version firmware, and determine the partition to be updated among the multiple firmware partitions of the first version firmware; a first determining module, used to determine the data difference between the partition to be updated and the corresponding firmware partition in the second version firmware, and obtain an update data set; and a sending module, used to send the update data set to the target component, so that the target component updates the first version firmware according to the update data set.

[0006] The third aspect of the present application provides an electronic device, comprising: one or more processors; a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.

[0007] The fourth aspect of the present application further provides a computer-readable storage medium having a computer program or instructions stored thereon, which implements the steps of the above method when the computer program or instructions are executed by a processor.

[0008] The fifth aspect of the present application further provides a computer program product, comprising a computer program or instructions, which implement the steps of the above method when executed by a processor.

[0009] According to an embodiment of the present application, by dividing the firmware into multiple logical areas according to the multiple functions of the firmware to obtain multiple firmware partitions, the version information of each of the multiple firmware partitions in the current second version firmware is compared with the version information of each of the multiple firmware partitions in the first version firmware to determine the partition to be updated, and then determine the data difference between the partition to be updated and the corresponding firmware partition in the second version firmware to obtain an update data set, and only send the update data set to the target component. Through this incremental update mechanism, rather than a full update mechanism that sends all data to the target component, the data transmission volume during the firmware update can be reduced, the firmware update time can be shortened, the operation and maintenance efficiency can be improved, and the resource consumption can be reduced; by dividing the firmware into multiple logical areas according to the multiple functions of the firmware, different functional modules can be isolated in independent logical areas, thereby effectively reducing compatibility issues caused by functional interaction, version iteration or hardware differences, and improving management efficiency. Therefore, the problem of low efficiency and high resource consumption of full update in the related methods is at least partially solved, and the technical problem of improving update efficiency, reducing time cost and resource consumption is achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The above contents and other objects, features and advantages of the present application will become more apparent through the following description of the embodiments of the present application with reference to the accompanying drawings, in which:

[0011] Figure 1 The present invention provides an application scenario diagram of a firmware update method, a firmware update apparatus, a device, and a storage medium according to an embodiment of the present application.

[0012] Figure 2 A flowchart of a firmware update method according to an embodiment of the present application is shown.

[0013] Figure 3 A system interaction diagram of a firmware update method according to an embodiment of the present application is shown.

[0014] Figure 4 A schematic diagram of a verification process according to an embodiment of the present application is shown.

[0015] Figure 5 The figure shows a structural block diagram of a firmware updating device according to an embodiment of the present application.

[0016] Figure 6 A block diagram of an electronic device suitable for implementing a firmware update method according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0017] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present application. In the detailed description below, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present application. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessarily confusing the concepts of the present application.

[0018] The terms used herein are only for describing specific embodiments and are not intended to limit the present application. The terms "comprise," "include," etc. used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0019] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0020] When expressions such as "at least one of A, B, and C, etc." are used, they should generally be interpreted in accordance with the meaning commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0021] The relevant firmware update method usually requires downloading the complete firmware installation package even if the difference between the new and old versions of the firmware is small, that is, it is necessary to download the entire content of the new version of the firmware and perform a full update.

[0022] Taking the Baseboard Management Controller (BMC) firmware as an example, BMC firmware is a core component of server hardware management, responsible for monitoring system health, remote control, and fault diagnosis. When users need to update the BMC firmware, they usually need to download the complete firmware image file from a designated channel (such as the server manufacturer's official website or internal firmware management system). This firmware image file is a complete, independent file that contains all the code, configuration information, and related drivers required for the normal operation of the BMC. After the download is complete, the user will use a specific tool or command line to write this complete firmware image to the BMC to complete the firmware update. This method is simple but inefficient, especially in large-scale deployments.

[0023] Because complete firmware installation packages are large, downloading them wastes bandwidth and occupies significant network resources, leading to excessive resource consumption and lengthy download and write times. This results in high time costs and low update efficiency. Furthermore, compatibility issues may exist between different versions. Differential updates require strict version matching and are prone to update failures due to version jumps (e.g., skipping multiple intermediate versions and directly updating from an older version to a newer version spanning multiple generations).

[0024] Furthermore, full updates of large-scale server clusters consume significant bandwidth and storage resources, increasing operational costs and wasting resources. Specifically, regardless of the actual code changes, even if only a few are made, the entire data must be transferred during the update. This leads to high resource consumption in large-scale deployments.

[0025] Furthermore, the large size of the firmware installation package makes the update process susceptible to network fluctuations. Full updates carry a high risk of failure, such as interruptions or failures, leading to system instability. Furthermore, full updates introduce significant code changes, increasing system compatibility risks, especially in environments with multiple versions.

[0026] In view of this, an embodiment of the present application provides a method for updating firmware, including: obtaining version information of each of multiple firmware partitions in a first version firmware installed by a target component, where the multiple firmware partitions are obtained by dividing the firmware into multiple logical areas according to multiple functions of the firmware; comparing the version information of each of multiple firmware partitions in a currently held second version firmware with the version information of each of multiple firmware partitions in the first version firmware, and determining a partition to be updated among the multiple firmware partitions of the first version firmware; determining the data difference between the partition to be updated and the corresponding firmware partition in the second version firmware, and obtaining an update data set; and sending the update data set to the target component so that the target component updates the first version firmware according to the update data set.

[0027] Figure 1 The present invention provides an application scenario diagram of a firmware update method, a firmware update apparatus, a device, and a storage medium according to an embodiment of the present application.

[0028] like Figure 1 As shown, the application scenario according to this embodiment may include a server 101 and a target component 102 .

[0029] like Figure 1 As shown, server 101 may store a second version of firmware. This second version of firmware may include multiple firmware partitions, each with its own version information. For example, the multiple firmware partitions include firmware partition 1, firmware partition 2, ..., firmware partition N (N is a natural number). The multiple firmware partitions may be obtained by dividing the firmware into multiple logical areas based on the firmware's multiple functions.

[0030] The target component 102 may have a first version of firmware installed. Similarly, the first version of firmware may include multiple firmware partitions, such as firmware partition 1, firmware partition 2, ..., and firmware partition N, each having its own version information. Similarly, the firmware partitions may be obtained by dividing the firmware into multiple logical areas based on its multiple functions. The firmware may have a unified partitioning standard; that is, the firmware partitioning standard in the server 101 and the target component 102 may be the same. The firmware in the target component 102 may have been (previously) obtained, for example, downloaded, from the server 101.

[0031] For example, target component 102 may send version information of each of multiple firmware partitions in the first version of firmware to server 101 (e.g., periodically or upon request from server 101). Server 101 may perform a firmware update method, including: obtaining version information of each of multiple firmware partitions in the first version of firmware installed by target component 102; comparing version information of each of multiple firmware partitions in the currently-available second version of firmware with version information of each of multiple firmware partitions in the first version of firmware to determine a partition to be updated among the multiple firmware partitions in the first version of firmware; determining data differences between the partition to be updated and the corresponding firmware partition in the second version of firmware to obtain an update data set; and sending the update data set to target component 102. After receiving the update data set, target component 102 may update the first version of firmware based on the update data set.

[0032] The following, combined Figures 2 to 4 The method for updating the firmware of the embodiment of the present application is described in detail. In the description, for ease of understanding, reference will be made to Figure 1 The scenarios described serve as examples.

[0033] Figure 2 A flowchart of a firmware update method according to an embodiment of the present application is shown.

[0034] like Figure 2 As shown, the firmware update method of this embodiment includes operations S210 to S240. The method can be performed by, for example Figure 1 The server 101 shown executes.

[0035] In operation S210, the version information of each of the multiple firmware partitions in the first version firmware installed by the target component is obtained. The multiple firmware partitions are obtained by dividing the firmware into multiple logical areas according to the multiple functions of the firmware. The target component is, for example, Figure 1 Target component 102 is shown.

[0036] For example, the firmware can be divided into multiple logical areas according to its multiple functions to obtain multiple firmware partitions. Each firmware partition can correspond to a specific functional module, such as firmware partition 1 can correspond to the boot loader module, firmware partition 2 can correspond to the operating system kernel module, etc.

[0037] Taking the target component including the baseboard management controller (BMC) as an example, the firmware installed in the baseboard management controller may include firmware partitions corresponding to the following functional modules: a boot loader module, which may be responsible for hardware initialization, loading the operating system and other functions; an operating system kernel module, which may be responsible for managing hardware resources such as the central processing unit (CPU), memory, and devices, and providing basic services for applications; a hardware driver module, which may be responsible for network driver, sensor driver and other functions; an IPMI stack module, which may be responsible for out-of-band management of servers and network devices; a configuration parameter module, which may be responsible for managing operating parameters and other functions; and a user interaction interface (WebUI) module, which may be responsible for visual display and other functions.

[0038] For example, the version information may include the version number of the firmware partition. The first version of firmware may be the firmware before the update. Accordingly, the version information of each of the multiple firmware partitions in the first version of firmware may include the version number of the version before the update. When each version of firmware is released, a corresponding configuration file may be generated, and the version number of each firmware partition may be recorded in the configuration file. A hash value may also be generated for each firmware partition, and the hash value of each firmware partition may be recorded in the configuration file.

[0039] In operation S220, the version information of each of the multiple firmware partitions in the current second version firmware is compared with the version information of each of the multiple firmware partitions in the first version firmware to determine a partition to be updated among the multiple firmware partitions in the first version firmware.

[0040] The second version of the firmware may be updated firmware. Accordingly, the version information of each of the multiple firmware partitions in the second version of the firmware may include the version number of the updated version. Since a firmware update may only update part of the data, the version information of only some of the firmware partitions may change after the update. For example, after the firmware update, only the version numbers of some of the firmware partitions change from 1.0 to 1.1, while the version numbers of other firmware partitions remain unchanged.

[0041] Comparing the version information of each of the multiple firmware partitions in the current second version firmware with the version information of each of the multiple firmware partitions in the first version firmware may include: comparing the version numbers of each of the multiple firmware partitions in the second version firmware with the version numbers of the corresponding firmware partitions in the first version firmware. Here, the so-called "corresponding" may mean that they correspond to the same functional modules. For example, the version number of firmware partition 1 in the second version firmware may be compared with the version number of firmware partition 1 in the first version firmware (both of these firmware partitions correspond to, for example, boot loader modules), the version number of firmware partition 2 in the second version firmware may be compared with the version number of firmware partition 2 in the first version firmware (both of these firmware partitions correspond to, for example, operating system kernel modules), and so on.

[0042] The partitions to be updated may include one or more firmware partitions in the first version of the firmware whose version information is inconsistent with that of the corresponding firmware partitions in the second version of the firmware. For example, the version number of firmware partition 1 in the first version of the firmware is 1.0, while the version number of firmware partition 1 in the second version of the firmware is 1.1. Since the version number of firmware partition 1 in the first version of the firmware is inconsistent with the version number of the corresponding firmware partition in the second version of the firmware, the partitions to be updated may include firmware partition 1 in the first version of the firmware.

[0043] The version information for the partition to be updated in the first and second versions of the firmware is inconsistent, indicating that the data in the partition to be updated has been updated. On the other hand, the version information for the other firmware partitions in the first version of the firmware, except for the partition to be updated, is consistent with the version information for the corresponding firmware partitions in the second version of the firmware, indicating that their data has not changed. Therefore, only the partition to be updated can be updated, and the other firmware partitions in the first version of the firmware, except for the partition to be updated, do not need to be updated.

[0044] By dividing the firmware into multiple partitions, you can improve the flexibility and efficiency of the update process and reduce compatibility risks. Dividing the firmware into multiple partitions also modularizes the update process. Problems in one partition will not affect other partitions, simplifying firmware management and facilitating problem location.

[0045] In operation S230 , the data difference between the partition to be updated and the corresponding firmware partition in the second version of the firmware is determined to obtain an update data set.

[0046] For example, not all data in the partition to be updated may be updated, but only part of the data may be updated. Therefore, the data difference between the partition to be updated and the corresponding firmware partition in the second version of the firmware can be determined, and the data in the second version of the firmware that differs from the first version of the firmware is the updated data.

[0047] In operation S240 , the update data set is sent to the target component, so that the target component updates the first version firmware according to the update data set.

[0048] For example, only the update data set can be sent to the target component instead of all the data of the second version firmware, so that the target component can be incrementally updated based only on the update data in the update data set instead of requiring a full update based on all the data of the second version firmware.

[0049] For example, if a transmission interruption occurs while sending an updated data set to a target component, the target component can record the offset of the last successfully received data block. The next time the target component requests to send the updated data set, it can use this offset to request the server to send the remaining data blocks starting from the position corresponding to the offset. For example, if the server sends the updated data set to the target component and the target component only successfully receives the first five data blocks (assuming a total of 5MB), and the transmission of the sixth data block is interrupted due to factors such as the communication link, the target component can record the offset as 5MB. The next time the target component requests to send the updated data set, it can request the data blocks after the 5th MB, thereby avoiding repeated transmission of the first five received data blocks.

[0050] According to an embodiment of the present application, the firmware is divided into multiple logical areas according to the multiple functions of the firmware to obtain multiple firmware partitions, the version information of each of the multiple firmware partitions in the current second version firmware is compared with the version information of each of the multiple firmware partitions in the first version firmware to determine the partition to be updated, and then the data difference between the partition to be updated and the corresponding firmware partition in the second version firmware is determined to obtain an update data set, and only the update data set is sent to the target component. Through this incremental update mechanism, rather than a full update mechanism that sends all data to the target component, the amount of data transmitted during firmware updates can be reduced, the firmware update time can be shortened, the operation and maintenance efficiency can be improved, and resource consumption can be reduced. Moreover, by dividing the firmware into multiple logical areas according to the multiple functions of the firmware, different functional modules can be isolated in independent logical areas, thereby effectively reducing compatibility issues caused by functional interaction, version iteration or hardware differences, and improving management efficiency.

[0051] According to an embodiment of the present application, determining the data difference between the partition to be updated and the corresponding firmware partition in the second version of the firmware to obtain the update data set may be performed as follows.

[0052] The first data set corresponding to the partition to be updated may be divided into a plurality of first data units according to a predetermined unit, and the second data set corresponding to the corresponding firmware partition may be divided into a plurality of second data units according to the predetermined unit.

[0053] For example, the first data set may include all data corresponding to the partition to be updated, and the second data set may include all data corresponding to the corresponding firmware partition in the second version of the firmware. The predetermined unit may include a predetermined number of characters. The first data set may be divided into a sequence including multiple first data units, and the second data set may be divided into a sequence including multiple second data units according to the predetermined unit.

[0054] The first data set and the second data set are divided into multiple data units (i.e., multiple data blocks) through predetermined units. Each data unit includes multiple characters. An overall comparison can be performed based on multiple data blocks instead of processing each character individually, which can reduce the amount of calculation and improve calculation efficiency.

[0055] Longest matching sequences at different positions may be determined in the plurality of second data units, each longest matching sequence including consecutive second data units at a corresponding position and matching a sequence of consecutive first data units in the plurality of first data units.

[0056] For example, the first data set is {A, B, C, D}, which includes multiple first data units A, B, C, and D; the second data set is {A, B, Y, D}, which includes multiple second data units including A, B, Y, and D. By matching multiple second data units with multiple first data units, it can be determined that: among the multiple second data units, for the position where A is located, the longest matching sequence, that is, the sequence of consecutive second data units that matches the sequence of the maximum possible number of consecutive first data units in the first data set, can be {A, B} (in this case, the step of determining the longest matching sequence for the position where B is located can be skipped); in addition, for the position where D is located, the longest matching sequence can be {D}.

[0057] The updated data set may be determined based on the result of determining the longest matching sequence.

[0058] The data content of the second data unit in the longest matching sequence is the same as the data content of the corresponding first data unit, that is, the data content of the corresponding first data unit has not been updated. However, the content of the data other than the longest matching sequence in the multiple second data units is different from that of the multiple first data units, that is, the data content other than the longest matching sequence is updated data. Therefore, the updated data set can include the data other than the longest matching sequence in the multiple second data units.

[0059] By dividing the first and second data sets into multiple data units based on predetermined units and performing searches and matches only locally, rather than globally, based on these multiple data units, computational effort can be reduced and efficiency improved. By gradually determining the longest matching sequence at different locations, duplicate matches can be avoided, improving matching efficiency. By determining the updated data set based on the results of determining the longest matching sequence, the data differences between the first and second data sets can be accurately and efficiently determined, thereby identifying the data that needs to be updated. This allows only the data that needs to be updated to be sent, reducing data transmission volume, increasing update speed, and lowering storage requirements, making it suitable for environments with limited storage resources.

[0060] According to an embodiment of the present application, determining the longest matching sequence may include: matching multiple first data units with multiple second data units based on first hash values ​​corresponding to each of the multiple first data units and second hash values ​​corresponding to each of the multiple second data units to determine the longest matching sequence.

[0061] For example, the hash values ​​of multiple first data units and multiple second data units can be calculated respectively to obtain the first hash value and the second hash value. When the first hash value and the second hash value are the same, it means that the data content of the first data unit corresponding to the first hash value and the second data unit corresponding to the second hash value are the same, that is, the above-mentioned first data unit matches the above-mentioned second data unit. The second hash value of each second data unit included in the longest matching sequence is respectively the same as the hash value of the consecutive first data units in the multiple first data units. The first hash value and the second hash value can be used to efficiently and accurately determine the longest matching sequence.

[0062] According to an embodiment of the present application, the above-mentioned firmware update method may further include: determining the minimum difference between the second data set and the first data set based on the determined longest matching sequence; generating an updated data set based on the minimum difference, wherein the updated data set includes the minimum difference and the corresponding position of the minimum difference.

[0063] For example, the minimum difference may include data in the second data set other than the longest matching sequence corresponding to each first data unit. Still taking the above-mentioned first data set as {A, B, C, D} and the second data set as {A, B, Y, D} as an example, since the longest matching sequence includes {A, B} and {D}, the minimum difference between the second data set and the first data set includes data unit {Y}. Accordingly, the updated data set includes data unit {Y} and the position of the data unit in the second data set.

[0064] The updated data set only includes the minimum difference between the second data set and the first data set, rather than all the data in the second data set, and includes the corresponding position of the minimum difference in the second data set, so that the target component can be updated efficiently and accurately based on the minimum difference and corresponding position between the second data set and the first data set.

[0065] According to an embodiment of the present application, the firmware update method may further include: determining the size of the predetermined unit according to the function corresponding to the partition to be updated.

[0066] The data characteristics of firmware partitions corresponding to different functions may differ, and accordingly, different sizes of predetermined units may be suitable. For example, the frequency of local modification of the boot loader module's data may be low. Therefore, if the partition to be updated includes the firmware partition corresponding to the boot loader module, a larger predetermined unit can be determined to reduce matching overhead, and the size of the predetermined unit can be within a first numerical range. On the other hand, data in the configuration parameter module is updated more frequently. Therefore, if the partition to be updated includes the firmware partition corresponding to the configuration parameter module, a smaller predetermined unit can be determined to improve update accuracy. The size of the predetermined unit can be within a second numerical range, where the first numerical range is larger than the second numerical range.

[0067] Using a fixed, smaller predetermined unit size can lead to invalid matches for firmware partitions with infrequent data updates, increasing computational overhead. Using a fixed, larger predetermined unit size can affect data matching accuracy for firmware partitions with frequent data updates. By dynamically determining the predetermined unit size based on the function of the partition to be updated—for example, setting a larger predetermined unit size for infrequently updated firmware partitions and a smaller predetermined unit size for frequently updated ones—compared to a fixed predetermined unit size, matching accuracy can be improved and computational overhead reduced.

[0068] According to an embodiment of the present application, the update data set may include multiple update data subsets, wherein each of the multiple update data subsets includes corresponding verification information.

[0069] After generating the update data set, the server can divide the update data set into multiple update data subsets. Verification information corresponding to each of the multiple update data subsets can be generated. The verification information can include a digital signature. For example, the server can use a private key to digitally sign each of the multiple update data subsets to obtain verification information corresponding to each of the multiple update data subsets. The multiple update data subsets and the verification information corresponding to each of the multiple update data subsets can be sent together to the target component.

[0070] By dividing the update data set into multiple update data subsets and generating corresponding verification information for each update data subset, the target component can verify only the currently received update data subset, thereby improving verification efficiency and reducing computational overhead. Furthermore, by generating corresponding verification information only for each update data subset, even if the data in some update data subsets is tampered with, the tampered update data subset can be quickly located without re-downloading the entire update data set, thus improving update efficiency.

[0071] According to an embodiment of the present application, sending the update data set to the target component may include: sending multiple update data subsets to the target component respectively, so that the target component verifies the currently received update data subset based on verification information of the currently received update data subset.

[0072] For example, multiple update data subsets can be sent to the target component separately, i.e., in a fragmented transmission. The target component performs verification based on the verification information of the currently received update data subset. For example, the target component can perform real-time verification for each update data subset received, rather than waiting for the entire update data subset to be received before performing a unified verification. Furthermore, encrypted transmission can be used to ensure the security of the transmission process.

[0073] By transmitting multiple update data subsets in segments, the target component performs verification each time it receives an update data subset. Compared with performing unified verification after receiving all update data subsets, problems with update data subsets can be discovered in a timely manner, avoiding wasting time and bandwidth.

[0074] For example, based on the verification information of the currently received update data subset, the target component may verify the validity of the digital signature of the update data subset using the server's public key. If the digital signature verification fails, it indicates that the data in the update data subset may have been tampered with. In this case, the target component may refuse to install the update data subset and may also generate an alert to prompt personnel to conduct an inspection.

[0075] For example, verification information can be generated for the entire update data set, such as a hash value corresponding to the update data set. Alternatively, the target component can verify the entire update data set based on the verification information after receiving the entire update data subset. By generating verification information only for the update data set, rather than for all firmware data, the target component only needs to verify the data that needs to be updated, eliminating the need to verify the entire firmware data. This reduces computational overhead and improves verification efficiency.

[0076] For example, verification information can be generated for the entire update data set, and verification information can be generated for multiple update data subsets separately. Verification can then be performed based on the verification information for the entire update data set and the multiple update data subsets. This dual verification of the update data set and the update data subsets can improve verification accuracy and enhance data security.

[0077] Furthermore, since different devices may have time synchronization errors, a tolerance window of reasonable size (for example, ±5 minutes) can be set according to actual needs to avoid misjudgments caused by slight time deviations between different devices.

[0078] According to an embodiment of the present application, the firmware update method also includes: the storage area of ​​the firmware partition in the preset storage space includes a main storage sub-area and a backup sub-area; wherein the main storage sub-area is used to store the firmware partition updated according to the update data set, and the backup sub-area is used to store the firmware partition of the first version firmware, so that when the target component fails to update the firmware partition of the first version firmware according to the update data set, it rolls back to the firmware partition of the first version firmware in the backup sub-area.

[0079] For example, the storage area in the preset storage space can be divided into two areas, resulting in a primary storage sub-area and a backup sub-area. Multiple firmware partitions in the first version of firmware installed by the target component can be stored in the backup sub-area. After the target component updates the to-be-updated partitions of the first version of firmware based on the update data set and obtains the updated firmware partitions, the updated firmware partitions can be stored in the primary storage sub-area, providing an independent low-latency recovery channel for rollback operations, ensuring that the device can quickly return to normal status.

[0080] By storing the updated firmware partition and multiple firmware partitions in the first version of the firmware in different sub-areas of the preset storage space, system availability can be guaranteed in the event of a firmware update failure, wherein the firmware update failure may be caused by a failure in the update data subset verification, a power outage, etc. Specifically, writing the updated firmware partition to the main storage sub-area will not affect the operation of multiple firmware partitions in the first version of the firmware in the spare sub-area. Therefore, in the event of an update failure, it is possible to force the multiple firmware partitions in the first version of the firmware in the spare sub-area to re-run, that is, roll back to the firmware partition of the first version of the firmware in the spare sub-area, thereby ensuring that the firmware can always be started from an available firmware version, thereby ensuring that the firmware is always in a workable state. In the event of a successful update, it can be run directly according to the updated firmware partition.

[0081] The rollback mechanism ensures rapid system recovery in the event of a firmware update failure, improving system stability. By performing rollbacks on a per-firmware partition basis, rather than a full disk rollback, computing overhead can be reduced.

[0082] Figure 3 A system interaction diagram of a firmware update method according to an embodiment of the present application is shown.

[0083] Figure 4 A schematic diagram of a verification process according to an embodiment of the present application is shown.

[0084] The target component may include, for example, a baseboard management controller (Baseboard Management Controller, referred to as BMC).

[0085] In operation S310 , a baseboard management controller may request a server to update firmware.

[0086] For example, the baseboard management controller can send the version information of multiple firmware partitions in the first version of firmware installed by the baseboard management controller to the server. Specifically, the baseboard management controller can send the configuration file of the first version of firmware to the server. The configuration file can include the version numbers of the multiple firmware partitions and the hash values ​​pre-generated for the multiple firmware partitions.

[0087] In operation S320 , after obtaining version information of each of the multiple firmware partitions in the first version firmware, the server may generate an update data set, where the update data set may include multiple update data subsets.

[0088] The first data set may be divided into a plurality of first data units, and the second data set may be divided into a plurality of second data units according to predetermined units, and the longest matching sequences at different positions may be determined in the plurality of second data units.

[0089] Determining the longest matching sequence at different locations in the plurality of second data units may, for example, include: using x as a pointer, searching for the longest matching sequence within a sliding window around the corresponding x pointer in the sequence of the plurality of second data units. The sliding window size may be, for example, [x-64, x+64]. Searching and matching within the sliding window, rather than a global search, reduces computational effort. By determining the longest matching sequence at the current location each time, a global optimum can be approached by ensuring a local optimum. Gradually advancing the match using the x pointer avoids repeated comparisons.

[0090] In operation S330, the server may send multiple update data subsets to the baseboard management controller separately. By sending only the update data set instead of the complete firmware installation package, the update efficiency can be improved and the update time can be reduced through incremental updates. For example, testing has found that the data transmission volume of the related method of sending the complete firmware installation package is 128MB, the update time takes 15 to 30 minutes, and the compatibility depends on the firmware version. However, by sending only the update data set, the data transmission volume can be reduced to 1 to 10MB, the update time can be shortened to 5 to 10 minutes, and cross-version upgrades can be supported.

[0091] In operation S340 , after receiving the update data subset, the baseboard management controller may verify and update the firmware.

[0092] like Figure 4 As shown, the verification process may include an integrity check. For example, after receiving the update data set, the baseboard management controller may merge the update data set with the other firmware partitions in the multiple firmware partitions of the first version firmware except the partition to be updated to generate a new firmware partition. The hash value of the new firmware partition can be calculated and compared with the hash value pre-stored in the configuration file. When the hash value of the new firmware partition is the same as the hash value of the corresponding partition in the second version firmware, it means that the data of the new firmware partition is complete and has not been tampered with, so it can pass the integrity check, wherein the correct hash value of each firmware partition can be pre-stored in the configuration file. Through the validity check, it can be verified whether the firmware data has been tampered with due to transmission, storage, etc., thereby ensuring the integrity of the updated firmware.

[0093] The verification process may also include validity verification. For example, the server may use a private key to verify the signature of the update data subset. After receiving the update data subset, the baseboard management controller may use the server's public key to verify the validity of the signature of the update data subset.

[0094] The verification process may also include a compatibility check. For example, when merging a new data set with multiple firmware partitions of the first version of the firmware, excluding the partition to be updated, the dependencies between the firmware partitions can be determined. Firmware partitions with dependencies can be merged sequentially in a preset order. For example, if it is determined that the bootloader module depends on the operating system kernel module, the firmware partitions corresponding to the two modules can be merged sequentially in a preset order. The merging order can be verified to see if it corresponds to the preset order. If not, the compatibility check fails.

[0095] According to an embodiment of the present application, a central server can determine and transmit an update data set. However, if a large number of devices require simultaneous updates, the central server may be overloaded. Alternatively, the central server may first push the update data set to a pre-set edge server cluster. Multiple edge server nodes in the edge server cluster can cache the update data set. When a device requests an update, the update data set can be downloaded directly from the edge node closest to the device without having to access the central server. Furthermore, multiple edge server nodes in the edge server cluster can transmit the update data set to each other via a peer-to-peer (P2P) protocol, thereby reducing the pressure on the central server.

[0096] Based on the above firmware update method, this application also provides a firmware update device. Figure 5 The device is described in detail.

[0097] Figure 5 The figure shows a structural block diagram of a firmware updating device according to an embodiment of the present application.

[0098] like Figure 5 As shown, the firmware updating apparatus 500 of this embodiment includes an obtaining module 510 , a comparing module 520 , a first determining module 530 and a sending module 540 .

[0099] Obtaining module 510 is configured to obtain version information for each of multiple firmware partitions in the first version of the firmware installed by the target component. The multiple firmware partitions are obtained by dividing the firmware into multiple logical areas based on the firmware's multiple functions. In one embodiment, obtaining module 510 can be configured to perform operation S210 described above, and will not be further described here.

[0100] Comparison module 520 is configured to compare the version information of each of the multiple firmware partitions in the current second version of the firmware with the version information of each of the multiple firmware partitions in the first version of the firmware, thereby determining the partitions to be updated among the multiple firmware partitions in the first version of the firmware. In one embodiment, comparison module 520 may be configured to perform operation S220 described above, which will not be further described here.

[0101] The first determination module 530 is used to determine the data difference between the partition to be updated and the corresponding firmware partition in the second version firmware to obtain the update data set. In one embodiment, the first determination module 530 can be used to perform the operation S230 described above, which will not be repeated here.

[0102] The sending module 540 is configured to send the update data set to the target component so that the target component updates the first version of the firmware according to the update data set. In one embodiment, the sending module 540 may be configured to execute the operation S240 described above, which will not be described in detail here.

[0103] According to an embodiment of the present application, the first determination module includes a first division submodule, a second division submodule, a first determination submodule, and a second determination submodule.

[0104] The first division submodule is used to divide the first data set corresponding to the partition to be updated into multiple first data units according to predetermined units; the second division submodule is used to divide the second data set corresponding to the corresponding firmware partition into multiple second data units according to predetermined units; the first determination submodule is used to determine the longest matching sequence at different positions in the multiple second data units, each longest matching sequence includes consecutive second data units at the corresponding position and matches the sequence of consecutive first data units in the multiple first data units; the second determination submodule is used to determine the update data set based on the result of determining the longest matching sequence.

[0105] According to an embodiment of the present application, the first determining submodule includes a matching unit.

[0106] The matching unit is configured to match the plurality of first data units with the plurality of second data units according to the first hash values ​​corresponding to the plurality of first data units and the second hash values ​​corresponding to the plurality of second data units, so as to determine the longest matching sequence.

[0107] According to an embodiment of the present application, the firmware updating device further includes a second determining module and a generating module.

[0108] The second determination module is used to determine the minimum difference between the second data set and the first data set based on the determined longest matching sequence; the generation module is used to generate an updated data set based on the minimum difference, wherein the updated data set includes the minimum difference and the position corresponding to the minimum difference.

[0109] According to an embodiment of the present application, the firmware updating apparatus further includes a third determining module configured to determine the size of the predetermined unit according to a function corresponding to the partition to be updated.

[0110] According to an embodiment of the present application, the sending module includes a sending submodule for sending multiple update data subsets to the target component respectively, so that the target component verifies the currently received update data subset based on the verification information of the currently received update data subset.

[0111] According to embodiments of the present application, any multiple modules among the obtaining module 510, the comparing module 520, the first determining module 530, and the sending module 540 may be combined into a single module, or any one of these modules may be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of other modules and implemented in a single module. According to embodiments of the present application, at least one of the obtaining module 510, the comparing module 520, the first determining module 530, and the sending module 540 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or may be implemented in hardware or firmware through any other reasonable means of circuit integration or packaging, or may be implemented in any one of the three implementation methods of software, hardware, and firmware, or any appropriate combination of any of these. Alternatively, at least one of the obtaining module 510 , the comparing module 520 , the first determining module 530 and the sending module 540 may be at least partially implemented as a computer program module, which may perform corresponding functions when executed.

[0112] Figure 6 A block diagram of an electronic device suitable for implementing a firmware update method according to an embodiment of the present application is schematically shown.

[0113] like Figure 6 As shown, an electronic device 600 according to an embodiment of the present application includes a processor 601, which can perform various appropriate actions and processes based on a program stored in a read-only memory (ROM) 602 or a program loaded from a storage unit 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a dedicated microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present application.

[0114] Various programs and data required for the operation of the electronic device 600 are stored in RAM 603. The processor 601, ROM 602, and RAM 603 are connected to each other via a bus 604. The processor 601 performs various operations of the method flow according to the embodiment of the present application by executing the programs in ROM 602 and / or RAM 603. It should be noted that the program can also be stored in one or more memories other than ROM 602 and RAM 603. The processor 601 can also perform various operations of the method flow according to the embodiment of the present application by executing the programs stored in one or more memories.

[0115] According to an embodiment of the present application, electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to bus 604. Electronic device 600 may also include one or more of the following components connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including devices such as a cathode ray tube (CRT), liquid crystal display (LCD), and speakers; a storage section 608 including a hard disk; and a communication section 609 including a network interface card such as a LAN card or modem. Communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. Removable media 611, such as a magnetic disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed in drive 610 as needed, so that computer programs read from the removable media can be installed into storage section 608 as needed.

[0116] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently and not be incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, and when the one or more programs are executed, the method according to the embodiments of this application is implemented.

[0117] According to an embodiment of the present application, a computer-readable storage medium may be a non-volatile computer-readable storage medium, and may include, for example, but not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present application, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present application, a computer-readable storage medium may include the ROM 602 and / or RAM 603 described above and / or one or more memories other than ROM 602 and RAM 603.

[0118] The embodiments of the present application also include a computer program product, which includes a computer program containing program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the method provided in the embodiments of the present application.

[0119] The computer program executes the above functions defined in the system / device of the embodiment of the present application when the computer program is executed by the processor 601. According to the embodiment of the present application, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0120] In one embodiment, the computer program may be stored on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may be transmitted and distributed in the form of a signal on a network medium, downloaded and installed via the communication portion 609, and / or installed from a removable medium 611. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to wireless, wired, or any suitable combination thereof.

[0121] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from a removable medium 611. When the computer program is executed by the processor 601, the above-mentioned functions defined in the system of the embodiment of the present application are performed. According to the embodiment of the present application, the systems, devices, means, modules, units, etc. described above can be implemented by computer program modules.

[0122] According to an embodiment of the present application, the program code for executing the computer program provided by the embodiment of the present application can be written in any combination of one or more programming languages. Specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect via the Internet).

[0123] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0124] Those skilled in the art will appreciate that the features described in the various embodiments of this application may be combined and / or coupled in various ways, even if such combinations or couplings are not explicitly described in this application. In particular, the features described in the various embodiments of this application may be combined and / or coupled in various ways without departing from the spirit and teachings of this application. All such combinations and / or couplings fall within the scope of this application.

[0125] The embodiments of the present application have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present application. Although each embodiment has been described separately above, this does not mean that the measures in each embodiment cannot be advantageously used in combination. Without departing from the scope of the present application, those skilled in the art may make various substitutions and modifications, and these substitutions and modifications should all fall within the scope of the present application.

Claims

1. A method for updating firmware, characterized in that: The method comprises: Obtaining version information of respective firmware partitions in a first version of firmware installed by a target component, wherein the plurality of firmware partitions are obtained by dividing the firmware into a plurality of logical areas according to a plurality of functions of the firmware; comparing version information of each of the multiple firmware partitions in the current second version of the firmware with version information of each of the multiple firmware partitions in the first version of the firmware, to determine a partition to be updated among the multiple firmware partitions in the first version of the firmware, wherein the multiple firmware partitions in the second version of the firmware and the multiple firmware partitions in the first version of the firmware each correspond to the same functional module; Determine data differences between the partition to be updated and a corresponding firmware partition in the second version of the firmware to obtain an update data set; and Sending the update data set to the target component, so that the target component updates the first version of the firmware according to the update data set; Determining the data difference between the partition to be updated and the corresponding firmware partition in the second version of the firmware to obtain the update data set includes: Dividing the first data set corresponding to the partition to be updated into a plurality of first data units according to a predetermined unit; dividing the second data set corresponding to the corresponding firmware partition into a plurality of second data units according to the predetermined unit; Determining, among the plurality of second data units, longest matching sequences at different positions, each longest matching sequence including consecutive second data units at a corresponding position and matching a sequence of consecutive first data units among the plurality of first data units; The updated data set is determined according to the result of determining the longest matching sequence.

2. The method according to claim 1, characterized in that Determining the longest matching sequence includes: The plurality of first data units are matched with the plurality of second data units according to first hash values ​​corresponding to each of the plurality of first data units and second hash values ​​corresponding to each of the plurality of second data units to determine the longest matching sequence.

3. The method according to claim 2, characterized in that The method further comprises: determining a minimum difference between the second data set and the first data set based on the determined longest matching sequence; The updated data set is generated according to the minimum difference, wherein the updated data set includes the minimum difference and a position corresponding to the minimum difference.

4. The method according to claim 1, wherein The method further comprises: The size of the predetermined unit is determined according to a function corresponding to the partition to be updated.

5. The method according to claim 1, wherein The update data set includes a plurality of update data subsets, wherein each of the plurality of update data subsets includes corresponding verification information; The sending the updated data set to the target component comprises: The multiple update data subsets are sent to the target component respectively, so that the target component verifies the currently received update data subset based on the verification information of the currently received update data subset.

6. The method according to claim 1, characterized in that The method further comprises: The storage area of ​​the firmware partition in the preset storage space includes a main storage sub-area and a spare sub-area; Among them, the main storage sub-area is used to store the firmware partition updated according to the update data set, and the backup sub-area is used to store the firmware partition of the first version firmware, so that when the target component fails to update the firmware partition of the first version firmware according to the update data set, it can roll back to the firmware partition of the first version firmware in the backup sub-area.

7. A firmware update device, characterized in that: The device comprises: an obtaining module, configured to obtain version information of respective firmware partitions in a first version of firmware installed by a target component, wherein the plurality of firmware partitions are obtained by dividing the firmware into a plurality of logical areas according to a plurality of functions of the firmware; a comparison module, configured to compare version information of each of the multiple firmware partitions in the currently available second version firmware with version information of each of the multiple firmware partitions in the first version firmware, to determine a partition to be updated among the multiple firmware partitions in the first version firmware, wherein the multiple firmware partitions in the second version firmware and the multiple firmware partitions in the first version firmware each correspond to the same functional module; a first determining module, configured to determine a data difference between the partition to be updated and a corresponding firmware partition in the second version of the firmware, to obtain an update data set; and a sending module, configured to send the update data set to the target component, so that the target component updates the first version of the firmware according to the update data set; The first determining module includes: A first division submodule, configured to divide the first data set corresponding to the partition to be updated into a plurality of first data units according to a predetermined unit; a second division submodule, configured to divide the second data set corresponding to the corresponding firmware partition into a plurality of second data units according to the predetermined unit; A first determining submodule is configured to determine, among the plurality of second data units, the longest matching sequences at different positions, each longest matching sequence including consecutive second data units at corresponding positions and matching a sequence of consecutive first data units among the plurality of first data units; The second determining submodule is configured to determine the updated data set according to a result of determining the longest matching sequence.

8. An electronic device comprising: one or more processors; A memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Firmware updating method, device, system and equipment and storage medium

    CN118819583A