Multi-firmware refreshing method, device, electronic device and storage medium

By obtaining the target image file and verifying its signature and hash value, parsing and matching the firmware metadata and hardware data, and writing the target firmware in sequence, the low efficiency and version compatibility issues in multi-firmware flashing are solved, and safe and efficient firmware updates are achieved.

CN120335844BActive Publication Date: 2025-09-23INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing technology is inefficient in the multi-firmware refresh process, lacks a unified integrity verification mechanism for version compatibility issues, has high operation and maintenance costs, and can easily cause the server to enter an inconsistent state.

Method used

By obtaining the target image file and signature file, verifying their hash values, parsing metadata and matching firmware and hardware versions, writing the target firmware in the order of multiple firmware flashes, and supporting rollback operations, version compatibility and security are ensured.

Benefits of technology

Improves the efficiency of multiple firmware updates, ensures the security of the target image file and the version compatibility of the target firmware and hardware configuration, and avoids the risk of device unavailability due to partial firmware update failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120335844B_ABST
    Figure CN120335844B_ABST
Patent Text Reader

Abstract

The present application discloses a multi-firmware refresh method, device, electronic device and storage medium, which relate to the field of computer technology. The method includes a target image file including a firmware file of multiple target firmwares, thereby improving the efficiency of multi-firmware refresh; verifying the signature file and the standard hash value of the target image file; if the verification is successful, matching the firmware metadata in the target image file with the hardware metadata; if the matching is successful, writing the target version firmware file in the target image file into the corresponding target firmware, thereby ensuring the security of the target image file and the version compatibility of the target firmware with the hardware configuration; writing the multiple target version firmware files into the corresponding target firmware in sequence according to the multi-firmware refresh order, thereby solving the version dependency problem during multi-firmware refresh; if the current target version firmware file fails to be written, supporting the rollback of multiple target firmwares, thereby avoiding the risk of device unavailability due to the failure of some firmware updates.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a multi-firmware refresh method, device, electronic device, and storage medium. Background Art

[0002] When refreshing multiple firmwares, a single image is generally used to refresh a single firmware, and the single image is encrypted and security-verified. This method is time-consuming and error-prone. Moreover, due to the version constraints between multiple firmwares, the refresh order and compatibility are manually set by the user. This method lacks intelligent management and cannot effectively ensure the security of firmware refresh. Furthermore, the firmware files corresponding to the multiple scattered firmwares may be tampered with. This method lacks a unified integrity verification mechanism. In addition, if the refresh fails, manual rollback is required, which has high operation and maintenance costs. In addition, this method may cause the server to enter an inconsistent state due to the failure of some firmware refreshes. Summary of the Invention

[0003] The present application provides a multi-firmware refresh method, device, electronic device and storage medium to at least solve the problems of low multi-firmware refresh efficiency, version compatibility issues, lack of a unified integrity verification mechanism and high operation and maintenance costs in the related art.

[0004] This application provides a multi-firmware refresh method, which includes:

[0005] Obtaining a target image file, a signature file, and a standard hash value of the target image file, wherein the target image file includes at least metadata of the target image file and target version firmware files corresponding to multiple target firmwares spliced ​​in a multi-firmware refresh order;

[0006] Verify the signature file and standard hash value of the target image file;

[0007] If the verification fails, a prompt indicating signature verification failure or hash verification failure will be generated;

[0008] If the verification is successful, the metadata of the target image file is parsed to obtain the firmware metadata and hardware metadata corresponding to the multiple target firmwares, and the firmware metadata of the multiple target firmwares are matched with the corresponding hardware metadata;

[0009] If the matching fails, a prompt will be generated indicating that the firmware version is incompatible;

[0010] If the match is successful, the current versions of multiple target firmwares in the target server are obtained and saved, and the multiple target version firmware files are written into the corresponding target firmware in sequence according to the multiple firmware refresh order;

[0011] If the current target version firmware file fails to be written, multiple target firmware files are rolled back according to their current versions, and a write failure prompt is generated;

[0012] If multiple target version firmware files are written successfully, the current versions of the multiple target firmware files are updated to the corresponding target versions.

[0013] The present application also provides a multi-firmware refresh device, which includes:

[0014] A first acquisition module is configured to acquire a target image file, a signature file, and a standard hash value of the target image file, wherein the target image file includes at least metadata of the target image file and target version firmware files corresponding to multiple target firmware files spliced ​​in a multi-firmware refresh order;

[0015] Verification module, used to verify the signature file and standard hash value of the target image file;

[0016] A first prompt module is used to generate a prompt of signature verification failure or hash verification failure if the verification fails;

[0017] A parsing module is used to parse the metadata of the target image file if the verification is successful, and obtain firmware metadata and hardware metadata corresponding to multiple target firmwares;

[0018] A matching module, configured to match firmware metadata of multiple target firmwares with corresponding hardware metadata;

[0019] A second prompt module is used to generate a prompt indicating that the firmware version is incompatible if the matching fails;

[0020] A second acquisition module is used to acquire and save the current versions of multiple target firmware in the target server if the match is successful;

[0021] A writing module is used to write multiple target version firmware files into corresponding target firmware in sequence according to the multiple firmware refresh order;

[0022] A rollback module, configured to roll back multiple target firmware files according to their current versions if the writing of the current target version firmware file fails;

[0023] A third prompt module is used to generate a prompt of write failure;

[0024] The update module is used to update the current versions of the multiple target firmware files to the corresponding target versions if the multiple target version firmware files are all written successfully.

[0025] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for executing the computer program to implement a multi-firmware refresh method comprising at least the following steps:

[0026] Obtaining a target image file, a signature file, and a standard hash value of the target image file, wherein the target image file includes at least metadata of the target image file and target version firmware files corresponding to multiple target firmwares spliced ​​in a multi-firmware refresh order;

[0027] Verify the signature file and standard hash value of the target image file;

[0028] If the verification fails, a prompt indicating signature verification failure or hash verification failure will be generated;

[0029] If the verification is successful, the metadata of the target image file is parsed to obtain the firmware metadata and hardware metadata corresponding to the multiple target firmwares, and the firmware metadata of the multiple target firmwares are matched with the corresponding hardware metadata;

[0030] If the matching fails, a prompt will be generated indicating that the firmware version is incompatible;

[0031] If the match is successful, the current versions of multiple target firmwares in the target server are obtained and saved, and the multiple target version firmware files are written into the corresponding target firmware in sequence according to the multiple firmware refresh order;

[0032] If the current target version firmware file fails to be written, multiple target firmware files are rolled back according to their current versions, and a write failure prompt is generated;

[0033] If multiple target version firmware files are written successfully, the current versions of the multiple target firmware files are updated to the corresponding target versions.

[0034] The present application also provides a computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, wherein when the computer program is executed by a processor, at least a multi-firmware refresh method including the following steps is implemented:

[0035] Obtaining a target image file, a signature file, and a standard hash value of the target image file, wherein the target image file includes at least metadata of the target image file and target version firmware files corresponding to multiple target firmwares spliced ​​in a multi-firmware refresh order;

[0036] Verify the signature file and standard hash value of the target image file;

[0037] If the verification fails, a prompt indicating signature verification failure or hash verification failure will be generated;

[0038] If the verification is successful, the metadata of the target image file is parsed to obtain the firmware metadata and hardware metadata corresponding to the multiple target firmwares, and the firmware metadata of the multiple target firmwares are matched with the corresponding hardware metadata;

[0039] If the matching fails, a prompt will be generated indicating that the firmware version is incompatible;

[0040] If the match is successful, the current versions of multiple target firmwares in the target server are obtained and saved, and the multiple target version firmware files are written into the corresponding target firmware in sequence according to the multiple firmware refresh order;

[0041] If the current target version firmware file fails to be written, multiple target firmware files are rolled back according to their current versions, and a write failure prompt is generated;

[0042] If multiple target version firmware files are written successfully, the current versions of the multiple target firmware files are updated to the corresponding target versions.

[0043] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements at least a multi-firmware refresh method comprising the following steps:

[0044] Obtaining a target image file, a signature file, and a standard hash value of the target image file, wherein the target image file includes at least metadata of the target image file and target version firmware files corresponding to multiple target firmwares spliced ​​in a multi-firmware refresh order;

[0045] Verify the signature file and standard hash value of the target image file;

[0046] If the verification fails, a prompt indicating signature verification failure or hash verification failure will be generated;

[0047] If the verification is successful, the metadata of the target image file is parsed to obtain the firmware metadata and hardware metadata corresponding to the multiple target firmwares, and the firmware metadata of the multiple target firmwares are matched with the corresponding hardware metadata;

[0048] If the matching fails, a prompt will be generated indicating that the firmware version is incompatible;

[0049] If the match is successful, the current versions of multiple target firmwares in the target server are obtained and saved, and the multiple target version firmware files are written into the corresponding target firmware in sequence according to the multiple firmware refresh order;

[0050] If the current target version firmware file fails to be written, multiple target firmware files are rolled back according to their current versions, and a write failure prompt is generated;

[0051] If multiple target version firmware files are written successfully, the current versions of the multiple target firmware files are updated to the corresponding target versions.

[0052] Through this application, the target image file includes firmware files of multiple target firmwares, which improves the efficiency of multi-firmware refresh; the signature file and standard hash value of the target image file are verified, and if the verification is successful, the firmware metadata in the target image file is matched with the hardware metadata, and if the match is successful, the target version firmware file in the target image file is written into the corresponding target firmware, ensuring the security of the target image file and the version compatibility of the target firmware and the hardware configuration; multiple target version firmware files are written into the corresponding target firmware in sequence according to the multi-firmware refresh order, solving the version dependency problem during multi-firmware refresh; if the current target version firmware file fails to be written, multiple target firmware rollbacks are supported, avoiding the risk of device unavailability due to failure of some firmware updates. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] 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.

[0054] Figure 1 1 is a flow chart of a multi-firmware refresh method according to an embodiment;

[0055] Figure 2 1. A flowchart of the steps of generating and uploading a target image file in a multi-firmware flashing method according to an embodiment;

[0056] Figure 3 A structural block diagram of a multi-firmware refresh device in one embodiment;

[0057] Figure 4 FIG. 1 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION

[0058] 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.

[0059] 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.

[0060] 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.

[0061] In one embodiment, Figure 1 As shown, a multi-firmware refresh method is provided, and the multi-firmware refresh method includes:

[0062] Obtaining a target image file, a signature file, and a standard hash value of the target image file, wherein the target image file includes at least metadata of the target image file and target version firmware files corresponding to multiple target firmwares spliced ​​in a multi-firmware refresh order;

[0063] Verify the signature file and standard hash value of the target image file;

[0064] If the verification fails, a prompt indicating signature verification failure or hash verification failure will be generated;

[0065] If the verification is successful, the metadata of the target image file is parsed to obtain the firmware metadata and hardware metadata corresponding to the multiple target firmwares, and the firmware metadata of the multiple target firmwares are matched with the corresponding hardware metadata;

[0066] If the matching fails, a prompt will be generated indicating that the firmware version is incompatible;

[0067] If the match is successful, the current versions of multiple target firmwares in the target server are obtained and saved, and the multiple target version firmware files are written into the corresponding target firmware in sequence according to the multiple firmware refresh order;

[0068] If the current target version firmware file fails to be written, multiple target firmware files are rolled back according to their current versions, and a write failure prompt is generated;

[0069] If multiple target version firmware files are written successfully, the current versions of the multiple target firmware files are updated to the corresponding target versions.

[0070] In a specific implementation, this embodiment defines an image file format that includes metadata and a target version firmware file partition. A digital signature and a standard hash value can also be added to the image file format. This image file format supports compatibility packaging of firmware from multiple manufacturers. After this embodiment generates prompts such as signature verification failure, hash verification failure, write failure, version error, and incompatible firmware versions, the multi-firmware refresh process is stopped. If the firmware version matches successfully, a server snapshot is created and the current version of the target firmware is backed up to a temporary storage area; the target firmware is written one by one in the order of multiple firmware refreshes, such as refreshing the baseboard management controller first and then updating the basic input and output system, and a read-back check is performed each time a target firmware is completed. If all target firmwares are successfully verified, the backup is deleted and the refreshed version of the corresponding target firmware is submitted.

[0071] Specifically, the target image file includes firmware files of multiple target firmwares, which improves the efficiency of multi-firmware refresh; the signature file and standard hash value of the target image file are verified, and if the verification is successful, the firmware metadata in the target image file is matched with the hardware metadata, and if the match is successful, the target version firmware file in the target image file is written into the corresponding target firmware, ensuring the security of the target image file and the version compatibility of the target firmware and the hardware configuration; multiple target version firmware files are written into the corresponding target firmware in sequence according to the multi-firmware refresh order, which solves the version dependency problem during multi-firmware refresh; if the current target version firmware file fails to be written, multiple target firmware rollbacks are supported to avoid the risk of device unavailability due to failure of some firmware updates.

[0072] In one embodiment, verifying the signature file and the standard hash value of the target image file includes:

[0073] Verify the signature file according to the public key and obtain the signature verification result;

[0074] If the signature verification result is verification failure, a prompt indicating signature verification failure is generated;

[0075] If the signature verification result is successful, the current hash value of the target image file is calculated and compared with the standard hash value to obtain the hash verification result;

[0076] If the hash verification result is a verification failure, a prompt indicating that the hash verification failed is generated;

[0077] If the hash verification result is successful, then the target image file is determined to have been successfully verified.

[0078] In one embodiment, the firmware metadata includes at least a target version of the corresponding target firmware, and the hardware metadata includes at least a version range of the corresponding target firmware. Matching the firmware metadata of the plurality of target firmwares with the corresponding hardware metadata includes:

[0079] Match target versions of multiple target firmwares to corresponding version ranges;

[0080] If the target versions of the multiple target firmwares are not within the corresponding version range, it is determined that the version matching of the multiple target firmwares fails;

[0081] If the target versions of the multiple target firmwares are within the corresponding version range, it is determined that the matching of the multiple target firmware versions is successful.

[0082] In a specific implementation, this embodiment checks the compatibility of the firmware module with the current hardware configuration, including: ① version matching: comparing the version number of the firmware module with the version number recommended by the hardware manufacturer. If the firmware version is too old or too new, it may not be compatible with the current hardware configuration; ② hardware model matching: checking whether the list of hardware models supported by the firmware module contains the model of the current hardware. If not, the firmware module may not be compatible with the current hardware; ③ configuration parameter matching: comparing the configuration parameters of the firmware module with the actual configuration parameters of the hardware. If there are mismatched configuration parameters, the firmware may not run correctly or the performance may degrade; ④ interface and performance matching: checking whether the firmware module supports the interface specifications and performance parameters of the hardware. For example, if the hardware supports a high-speed serial bus interface, but the firmware module only supports a low-speed serial bus interface, there may be a compatibility issue.

[0083] Specifically, the compatibility of the target firmware and hardware configuration is ensured through version matching, hardware model matching, configuration parameter matching, and interface and performance matching.

[0084] In one embodiment, rolling back multiple target firmwares according to current versions of the multiple target firmwares includes:

[0085] According to the current versions of the multiple target firmwares, obtaining the current version firmware files corresponding to the multiple target firmwares;

[0086] Write multiple current version firmware files into the corresponding target firmware in sequence according to the multiple firmware refresh order;

[0087] If multiple current version firmware files are written successfully, it is determined that the rollback of multiple target firmwares is successful.

[0088] In a specific implementation, if the current target version firmware file fails to be written, the successfully written target firmware and the current target firmware are rolled back according to the snapshot in the multi-firmware refresh order, and the refresh is stopped. Finally, a refresh log can be generated to record the status, time consumption, and error code of each target firmware.

[0089] Specifically, the target version firmware files are written to the corresponding target firmware in the order of multiple firmware updates, and a readback check is performed after each target firmware is completed. If the current target firmware fails to be written, multiple target firmwares are rolled back to avoid the risk of device unavailability due to partial firmware update failure.

[0090] In one embodiment, Figure 2 As shown, before obtaining the target image file and the signature file and standard hash value of the target image file, the multi-firmware flashing method further includes:

[0091] Obtain target versions and version constraints corresponding to multiple target firmwares;

[0092] According to target versions corresponding to the multiple target firmwares, obtaining target version firmware files corresponding to the multiple target firmwares;

[0093] Based on target versions and version constraints corresponding to multiple target firmwares, determining whether the target server meets the multiple firmware refresh requirements;

[0094] If the target server does not meet the multi-firmware flash requirements, a version error prompt will be generated;

[0095] If the target server meets the multi-firmware refresh requirement, a target image file is generated according to the version constraints corresponding to the multiple target firmwares and the target version firmware files, wherein the target image file includes at least a target image header and a target image content, the target image header includes at least metadata of the target image file, and the target image content includes at least target version firmware files corresponding to the multiple target firmwares spliced ​​in the multi-firmware refresh order;

[0096] Calculate the standard hash value of the target image file and sign the standard hash value with the private key to obtain a signature file;

[0097] Upload the target image file, its signature file, and standard hash value to the target server.

[0098] In a specific embodiment, this embodiment obtains target versions, manufacturer IDs and dependency tables corresponding to multiple target firmwares; parses the dependency table to obtain version constraints of each target firmware, such as "the version of the baseboard management controller must be greater than or equal to 2.1 to be compatible with the basic input and output system version 3.0". If the target version and current version of the baseboard management controller both conflict with the constrained version in the version constraint, or the target version and current version of the basic input and output system both conflict with the constrained version in the version constraint, a version error is prompted; based on the target versions corresponding to the multiple target firmwares, target version firmware files corresponding to the multiple target firmwares are obtained; global metadata is generated, including the version number of the image file, the creation time of the image file, the target server model, the firmware module index table (including the starting offset, length, check value), etc.; the refresh order of multiple firmwares is determined according to the version constraint, and each firmware file is spliced ​​into a continuous binary stream according to the refresh order of multiple firmwares, and the partition information is recorded in the metadata; an asymmetric encryption algorithm is used to sign the metadata and the image content.

[0099] Specifically, multiple firmware files are integrated into a single image file, and multiple firmware updates can be completed in a single operation, which improves the efficiency of multiple firmware updates. Before synthesizing the image file, the target server is judged whether it meets the multiple firmware update requirements based on the target versions and version constraints corresponding to multiple target firmwares, ensuring the version compatibility of all firmwares. The hash value of the target image header and the target image content as a whole is calculated and signed to ensure the security of the target image file.

[0100] In one embodiment, based on target versions and version constraints corresponding to multiple target firmwares, determining whether a target server meets the multiple firmware update requirements includes:

[0101] According to the version constraint conditions corresponding to the multiple target firmwares, obtaining the multiple constraint firmwares and the constraint versions corresponding to the multiple constraint firmwares;

[0102] Get the target version and current version of multiple constraint firmwares according to the firmware name;

[0103] comparing target versions and current versions of multiple constraint firmware with corresponding constraint versions;

[0104] If the target versions and current versions of the multiple constraint firmwares are inconsistent with the corresponding constraint versions, it is determined that the target server does not meet the multiple firmware refresh requirements;

[0105] If the target versions or current versions of the multiple constrained firmware are consistent with the corresponding constrained versions, it is determined that the target server meets the multiple firmware refresh requirement.

[0106] Specifically, before synthesizing the image file, the target versions and current versions of the plurality of constraint firmware are compared with the corresponding constraint versions, thereby ensuring the version compatibility of all firmware.

[0107] In a specific implementation, for example, if the baseboard management controller's target version is 3.0.0 and it depends on a basic input / output system (BIOS) version 2.0.0 and a complex programmable logic device (CPLD) version 2.0.0, the required baseboard management controller version is 2.0.0 and the CPLD version is 2.0.0; if the baseboard management controller's target version is 3.0.0 and it depends on a baseboard management controller (BMC) version 3.0.0, if the current versions of the BMC, CPLD, and BIOS are 2.0.0, then the target server is determined to meet the multiple-firmware refresh requirements; otherwise, the target server is determined to not meet the multiple-firmware refresh requirements.

[0108] In one embodiment, generating a target image file according to version constraints corresponding to a plurality of target firmwares and a target version firmware file includes:

[0109] Obtaining a multiple firmware refresh sequence based on version constraints corresponding to multiple target firmwares;

[0110] According to the multi-firmware refresh order, the target version firmware files corresponding to the multiple target firmwares are spliced ​​into the target image content;

[0111] Generate metadata of the target image file according to the firmware metadata, hardware metadata corresponding to the multiple target firmwares and the partition information of the target version firmware file in the target image content, and use the metadata of the target image file as the target image header;

[0112] Generate a target image file based on the target image content and target image header.

[0113] In a specific implementation, for example, if the baseboard management controller's target version is 3.0.0 and it depends on a BIOS version 2.0.0 and a CPLD version 2.0.0, the required baseboard management controller versions are 2.0.0 and CPLD version 2.0.0; if the baseboard management controller's target version is 3.0.0 and it depends on a baseboard management controller version 3.0.0, then if the current versions of the baseboard management controller, CPLD, and BIOS are 2.0.0, the multi-firmware refresh order is: baseboard management controller 2.0.0 → 3.0.0 → BIOS 2.0.0 → 3.0.0.

[0114] In one embodiment, obtaining target versions and current versions of multiple constraint firmwares according to the firmware name includes:

[0115] According to the firmware names corresponding to the multiple target firmwares, the firmware in the target server is divided into target firmware and other firmware;

[0116] According to the firmware names of the plurality of constraint firmwares, the plurality of constraint firmwares are divided into target constraint firmware and other constraint firmwares, wherein the firmware name of the target constraint firmware is consistent with the firmware name of the target firmware in the target server, and the names of the other constraint firmwares are consistent with the firmware names of the other firmware in the target server;

[0117] If the constraint firmware is the target constraint firmware, then obtain the target version and current version of the constraint firmware;

[0118] If the constraint firmware is other constraint firmware, obtain the current version of the constraint firmware;

[0119] Compare the target and current versions of multiple constraint firmware with the corresponding constraint versions, including:

[0120] If the constraint firmware is the target constraint firmware, then the target version and the current version of the constraint firmware are compared with the corresponding constraint versions respectively;

[0121] If the constraint firmware is another constraint firmware, the current version of the constraint firmware is compared with the corresponding constraint version.

[0122] In a specific implementation, for example, the target version of the baseboard management controller is 3.0.0, and it depends on the basic input and output system version 2.0.0 and the complex programmable logic device version 2.0.0; the target version of the basic input and output system is 3.0.0, and it depends on the baseboard management controller version 3.0.0, then the baseboard management controller and the basic input and output system are determined to be the target constraint firmware, and the complex programmable logic device is determined to be other constraint firmware, that is, the target constraint firmware is the constraint firmware that needs to be upgraded, and the other constraint firmware is the constraint firmware that does not need to be upgraded and has a version dependency relationship with the target constraint firmware.

[0123] Specifically, according to the version constraint conditions, not only the version constraint relationship between multiple target firmwares needs to be considered, but also the version constraint relationship between the target firmware and other firmwares needs to be considered, thereby ensuring the version compatibility during the multi-firmware refresh process.

[0124] In a specific implementation, this embodiment takes updating the basic input and output system, baseboard management controller, and complex programmable logic device of a general server as an example:

[0125] 1.1 Import the basic input and output system_target version firmware file, baseboard management controller_target version firmware file, and complex programmable logic device_target version firmware file through the image generator;

[0126] 1.2 Parse the firmware header of the target version firmware file to obtain metadata containing version constraints;

[0127] 1.3 Encapsulate the modules in the order of baseboard management controller → basic input and output system → complex programmable logic device, calculate the standard hash value of the metadata and the entire encapsulated module using a secure hash algorithm, and sign the standard hash value using an asymmetric encryption algorithm;

[0128] 1.4 Output the target image file including the target version firmware files of the baseboard management controller, basic input and output system, and complex programmable logic device according to the image file format of metadata, firmware module partition, digital signature, and standard hash value.

[0129] 2.1 The administrator uploads the target image file to the target server and executes the refresh command;

[0130] 2.2 After the refresh agent verifies the signature and hash value, it determines whether the target server meets the refresh requirements;

[0131] 2.3 If satisfied, refresh the baseboard management controller, basic input and output system, and complex programmable logic device in sequence, and perform read-back verification after each refresh to ensure data consistency;

[0132] 2.4 After all are successful, the server automatically restarts and loads the new version of the target firmware;

[0133] 2.5 If any node in the refresh process fails, the target firmware that has been successfully refreshed and the target firmware that has failed to be refreshed will be automatically rolled back to the original version according to the multi-firmware refresh sequence.

[0134] Among them, the image generator runs on the management terminal, is used to provide a graphical user interface and command line interface, and supports firmware file import, metadata editing and image generation; the refresh agent is deployed on the target server and is used for image parsing, security verification and firmware flashing operations; the central controller (optional) is used for data center-level management, supporting batch image distribution and status monitoring.

[0135] It should be understood that although Figure 1 、 Figure 2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1 、 Figure 2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0136] In one embodiment, Figure 3 As shown, a multi-firmware refresh device is provided, and the multi-firmware refresh device includes:

[0137] A first acquisition module is configured to acquire a target image file, a signature file, and a standard hash value of the target image file, wherein the target image file includes at least metadata of the target image file and target version firmware files corresponding to multiple target firmware files spliced ​​in a multi-firmware refresh order;

[0138] Verification module, used to verify the signature file and standard hash value of the target image file;

[0139] A first prompt module is used to generate a prompt of signature verification failure or hash verification failure if the verification fails;

[0140] A parsing module is used to parse the metadata of the target image file if the verification is successful, and obtain firmware metadata and hardware metadata corresponding to multiple target firmwares;

[0141] A matching module, configured to match firmware metadata of multiple target firmwares with corresponding hardware metadata;

[0142] A second prompt module is used to generate a prompt indicating that the firmware version is incompatible if the matching fails;

[0143] A second acquisition module is used to acquire and save the current versions of multiple target firmware in the target server if the match is successful;

[0144] A writing module is used to write multiple target version firmware files into corresponding target firmware in sequence according to the multiple firmware refresh order;

[0145] A rollback module, configured to roll back multiple target firmware files according to their current versions if the writing of the current target version firmware file fails;

[0146] A third prompt module is used to generate a prompt of write failure;

[0147] The update module is used to update the current versions of the multiple target firmware files to the corresponding target versions if the multiple target version firmware files are all written successfully.

[0148] In one embodiment, the verification module is specifically configured to:

[0149] Verify the signature file according to the public key and obtain the signature verification result;

[0150] If the signature verification result is verification failure, a prompt indicating signature verification failure is generated;

[0151] If the signature verification result is successful, the current hash value of the target image file is calculated and compared with the standard hash value to obtain the hash verification result;

[0152] If the hash verification result is a verification failure, a prompt indicating that the hash verification failed is generated;

[0153] If the hash verification result is successful, then the target image file is determined to have been successfully verified.

[0154] In one embodiment, the firmware metadata includes at least a target version of the corresponding target firmware, and the hardware metadata includes at least a version range of the corresponding target firmware. The matching module is specifically configured to:

[0155] Match target versions of multiple target firmwares to corresponding version ranges;

[0156] If the target versions of the multiple target firmwares are not within the corresponding version range, it is determined that the version matching of the multiple target firmwares fails;

[0157] If the target versions of the multiple target firmwares are within the corresponding version range, it is determined that the versions of the multiple target firmwares are successfully matched.

[0158] In one embodiment, the rollback module is specifically configured to:

[0159] According to the current versions of the multiple target firmwares, obtaining the current version firmware files corresponding to the multiple target firmwares;

[0160] Write multiple current version firmware files into the corresponding target firmware in sequence according to the multiple firmware refresh order;

[0161] If multiple current version firmware files are written successfully, it is determined that the rollback of multiple target firmwares is successful.

[0162] In one embodiment, the multi-firmware updating apparatus further includes:

[0163] A third acquisition module is used to obtain target versions and version constraints corresponding to multiple target firmware;

[0164] A fourth acquisition module is used to acquire target version firmware files corresponding to the multiple target firmwares according to the target versions corresponding to the multiple target firmwares;

[0165] A judgment module, configured to judge whether a target server meets the multi-firmware refresh requirement based on target versions and version constraints corresponding to multiple target firmwares;

[0166] a fourth prompt module, configured to generate a version error prompt if the target server does not meet the multiple firmware update requirements;

[0167] a generation module configured to generate a target image file based on version constraints corresponding to the multiple target firmwares and target version firmware files if the target server meets the multi-firmware refresh requirement, wherein the target image file includes at least a target image header and target image content, the target image header includes at least metadata of the target image file, and the target image content includes at least target version firmware files corresponding to the multiple target firmwares spliced ​​in the multi-firmware refresh order;

[0168] A calculation module, used to calculate the standard hash value of the target image file;

[0169] Signature module, used to sign the standard hash value according to the private key to obtain the signature file;

[0170] The transmission module is used to upload the target image file, the signature file and the standard hash value of the target image file to the target server.

[0171] In one embodiment, the judgment module is specifically configured to:

[0172] According to the version constraint conditions corresponding to the multiple target firmwares, obtaining the multiple constraint firmwares and the constraint versions corresponding to the multiple constraint firmwares;

[0173] Get the target version and current version of multiple constraint firmwares according to the firmware name;

[0174] comparing target versions and current versions of multiple constraint firmware with corresponding constraint versions;

[0175] If the target versions and current versions of the multiple constraint firmwares are inconsistent with the corresponding constraint versions, it is determined that the target server does not meet the multiple firmware refresh requirements;

[0176] If the target versions or current versions of the multiple constrained firmware are consistent with the corresponding constrained versions, it is determined that the target server meets the multiple firmware refresh requirement.

[0177] In one embodiment, the generation module is specifically configured to:

[0178] Obtaining a multiple firmware refresh sequence based on version constraints corresponding to multiple target firmwares;

[0179] According to the multi-firmware refresh order, the target version firmware files corresponding to the multiple target firmwares are spliced ​​into the target image content;

[0180] Generate metadata of the target image file according to the firmware metadata, hardware metadata corresponding to the multiple target firmwares and the partition information of the target version firmware file in the target image content, and use the metadata of the target image file as the target image header;

[0181] Generate a target image file based on the target image content and target image header.

[0182] For the specific definition of the multi-firmware refresh device, please refer to the definition of the multi-firmware refresh method above, which will not be repeated here. Each module in the above-mentioned multi-firmware refresh device can be implemented in whole or in part by software, hardware, or a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the electronic device in the form of hardware, or can be stored in the memory of the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0183] In one embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are performed:

[0184] Obtaining a target image file, a signature file, and a standard hash value of the target image file, wherein the target image file includes at least metadata of the target image file and target version firmware files corresponding to multiple target firmwares spliced ​​in a multi-firmware refresh order;

[0185] Verify the signature file and standard hash value of the target image file;

[0186] If the verification fails, a prompt indicating signature verification failure or hash verification failure will be generated;

[0187] If the verification is successful, the metadata of the target image file is parsed to obtain the firmware metadata and hardware metadata corresponding to the multiple target firmwares, and the firmware metadata of the multiple target firmwares are matched with the corresponding hardware metadata;

[0188] If the matching fails, a prompt will be generated indicating that the firmware version is incompatible;

[0189] If the match is successful, the current versions of multiple target firmwares in the target server are obtained and saved, and the multiple target version firmware files are written into the corresponding target firmware in sequence according to the multiple firmware refresh order;

[0190] If the current target version firmware file fails to be written, multiple target firmware files are rolled back according to their current versions, and a write failure prompt is generated;

[0191] If multiple target version firmware files are written successfully, the current versions of the multiple target firmware files are updated to the corresponding target versions.

[0192] When the program instructions are read and executed by one or more processors, they can also perform operations corresponding to the various steps in the above method embodiments. Please refer to the above description and will not be repeated here. Figure 4 , which exemplarily shows the architecture of an electronic device, which may specifically include a processor 410, a video display adapter 411, a disk drive 412, an input / output interface 413, a network interface 414, and a memory 420. The processor 410, video display adapter 411, disk drive 412, input / output interface 413, network interface 414, and memory 420 may be communicatively connected via a communication bus 430.

[0193] Among them, the processor 410 can be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in this application.

[0194] The memory 420 can be implemented in the form of a read-only memory (ROM), a random access memory (RAM), a static storage device, a dynamic storage device, etc. The memory 420 can store an operating system 421 for controlling the operation of the electronic device 400, and a basic input and output system (BIOS) 422 for controlling the low-level operations of the electronic device 400. In addition, a web browser 423, a data storage management 424, and an icon font processing system 425, etc. can also be stored. The above-mentioned icon font processing system 425 can be an application program that specifically implements the operations of the aforementioned steps in the embodiment of the present application. In short, when the technical solution provided by the present application is implemented by software or firmware, the relevant program code is stored in the memory 420 and is called and executed by the processor 410.

[0195] The input / output interface 413 is used to connect to input / output modules to enable information input and output. The input / output modules can be configured as components within the device (not shown) or externally connected to the device to provide corresponding functions. Input devices may include a keyboard, mouse, touch screen, microphone, and various sensors, while output devices may include a display, speaker, vibrator, indicator light, and the like.

[0196] The network interface 414 is used to connect to a communication module (not shown) to enable communication between the device and other devices. The communication module can communicate via a wired method (such as USB, network cable, etc.) or a wireless method (such as mobile network, WiFi, Bluetooth, etc.).

[0197] The bus 430 comprises a pathway for transmitting information between the various components of the device, such as the processor 410 , the video display adapter 411 , the disk drive 412 , the input / output interface 413 , the network interface 414 , and the memory 420 .

[0198] In addition, the electronic device 400 may also obtain information on specific collection conditions from a virtual resource object collection condition information database (not shown in the figure) for use in condition determination.

[0199] It should be noted that although the electronic device 400 shown above only includes a processor 410, a video display adapter 411, a disk drive 412, an input / output interface 413, a network interface 414, a memory 420, a bus 430, etc., in a specific implementation, the electronic device may also include other components necessary for normal operation. In addition, it will be understood by those skilled in the art that the above device may only include the components necessary to implement the solution of the present application, and does not necessarily include all the components shown in the figure.

[0200] Through the description of the above implementation methods, it can be seen that those skilled in the art can clearly understand that the present application can be implemented by means of software plus the necessary general hardware platform. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling an electronic device (which can be a personal computer, a cloud server, or a network device, etc.) to execute the methods of each embodiment of the present application or certain parts of the embodiments.

[0201] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0202] Obtaining a target image file, a signature file, and a standard hash value of the target image file, wherein the target image file includes at least metadata of the target image file and target version firmware files corresponding to multiple target firmwares spliced ​​in a multi-firmware refresh order;

[0203] Verify the signature file and standard hash value of the target image file;

[0204] If the verification fails, a prompt indicating signature verification failure or hash verification failure will be generated;

[0205] If the verification is successful, the metadata of the target image file is parsed to obtain the firmware metadata and hardware metadata corresponding to the multiple target firmwares, and the firmware metadata of the multiple target firmwares are matched with the corresponding hardware metadata;

[0206] If the matching fails, a prompt will be generated indicating that the firmware version is incompatible;

[0207] If the match is successful, the current versions of multiple target firmwares in the target server are obtained and saved, and the multiple target version firmware files are written into the corresponding target firmware in sequence according to the multiple firmware refresh order;

[0208] If the current target version firmware file fails to be written, multiple target firmware files are rolled back according to their current versions, and a write failure prompt is generated;

[0209] If multiple target version firmware files are written successfully, the current versions of the multiple target firmware files are updated to the corresponding target versions.

[0210] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0211] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0212] The above embodiments merely illustrate several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make numerous variations and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application.

[0213] In one embodiment, a computer program product is provided, wherein a computer program is stored on the product, and when the computer program is executed by a processor, the following steps are performed:

[0214] Obtaining a target image file, a signature file, and a standard hash value of the target image file, wherein the target image file includes at least metadata of the target image file and target version firmware files corresponding to multiple target firmwares spliced ​​in a multi-firmware refresh order;

[0215] Verify the signature file and standard hash value of the target image file;

[0216] If the verification fails, a prompt indicating signature verification failure or hash verification failure will be generated;

[0217] If the verification is successful, the metadata of the target image file is parsed to obtain the firmware metadata and hardware metadata corresponding to the multiple target firmwares, and the firmware metadata of the multiple target firmwares are matched with the corresponding hardware metadata;

[0218] If the matching fails, a prompt will be generated indicating that the firmware version is incompatible;

[0219] If the match is successful, the current versions of multiple target firmwares in the target server are obtained and saved, and the multiple target version firmware files are written into the corresponding target firmware in sequence according to the multiple firmware refresh order;

[0220] If the current target version firmware file fails to be written, multiple target firmware files are rolled back according to their current versions, and a write failure prompt is generated;

[0221] If multiple target version firmware files are written successfully, the current versions of the multiple target firmware files are updated to the corresponding target versions.

[0222] In one embodiment, a computer program product is provided, including a non-volatile computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the following steps:

[0223] Obtaining a target image file, a signature file, and a standard hash value of the target image file, wherein the target image file includes at least metadata of the target image file and target version firmware files corresponding to multiple target firmwares spliced ​​in a multi-firmware refresh order;

[0224] Verify the signature file and standard hash value of the target image file;

[0225] If the verification fails, a prompt indicating signature verification failure or hash verification failure will be generated;

[0226] If the verification is successful, the metadata of the target image file is parsed to obtain the firmware metadata and hardware metadata corresponding to the multiple target firmwares, and the firmware metadata of the multiple target firmwares are matched with the corresponding hardware metadata;

[0227] If the matching fails, a prompt will be generated indicating that the firmware version is incompatible;

[0228] If the match is successful, the current versions of multiple target firmwares in the target server are obtained and saved, and the multiple target version firmware files are written into the corresponding target firmware in sequence according to the multiple firmware refresh order;

[0229] If the current target version firmware file fails to be written, multiple target firmware files are rolled back according to their current versions, and a write failure prompt is generated;

[0230] If multiple target version firmware files are written successfully, the current versions of the multiple target firmware files are updated to the corresponding target versions.

[0231] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program. The computer program can be stored in a computer program product. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods.

[0232] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0233] The above embodiments merely illustrate several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make numerous variations and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application.

Claims

1. A multi-firmware refresh method, characterized in that: The method comprises: Obtaining a target image file and a signature file and a standard hash value of the target image file, wherein the target image file includes at least metadata of the target image file and target version firmware files corresponding to multiple target firmwares spliced ​​in a multi-firmware refresh order, the multiple target version firmware files corresponding to the multiple target firmwares one-to-one, and each target version firmware file is used to upgrade the corresponding target firmware to a target version; Verify the signature file and standard hash value of the target image file; If the verification fails, a prompt indicating signature verification failure or hash verification failure will be generated; If the verification is successful, parsing the metadata of the target image file to obtain firmware metadata and hardware metadata corresponding to the multiple target firmwares, and matching the firmware metadata of the multiple target firmwares with the corresponding hardware metadata; If the matching fails, a prompt will be generated indicating that the firmware version is incompatible; If the match is successful, the current versions of the multiple target firmwares in the target server are obtained and saved, and the multiple target version firmware files are sequentially written into the corresponding target firmware according to the multiple firmware refresh order; If the current target version firmware file fails to be written, the multiple target firmware files are rolled back according to the current versions of the multiple target firmware files, and a write failure prompt is generated; If the multiple target version firmware files are all written successfully, then the current versions of the multiple target firmware files are updated to the corresponding target versions; Before obtaining the target image file, the method further includes: In response to the multiple target firmwares including a first firmware and a second firmware, obtaining a first version dependency condition of the first firmware and a second version dependency condition of the second firmware, wherein the first version dependency condition includes a first constrained version of the second firmware and a second constrained version of the third firmware, the second version dependency condition includes a third constrained version of the first firmware, and the third firmware is a non-target firmware in the target server; Obtaining a first current version and a first target version of the first firmware, a second current version and a second target version of the second firmware, and a third current version of the third firmware; Comparing the third current version with the second constrained version, comparing the second current version and the second target version with the first constrained version respectively, and comparing the first current version and the first target version with the third constrained version respectively; In response to the third current version being consistent with the second constraint version, the second current version being consistent with the first constraint version, and the first target version being consistent with the third constraint version, determining the multi-firmware refresh order includes first updating the first firmware from the first current version to the first target version, and then updating the second firmware from the second current version to the second target version.

2. The method according to claim 1, characterized in that The verifying of the signature file and the standard hash value of the target image file includes: Verify the signature file according to the public key to obtain a signature verification result; If the signature verification result is a verification failure, a prompt indicating that the signature verification failed is generated; If the signature verification result is successful, then calculating the current hash value of the target image file and comparing the current hash value with the standard hash value to obtain a hash verification result; If the hash verification result is a verification failure, a prompt indicating that the hash verification failed is generated; If the hash verification result is successful, it is determined that the target image file is successfully verified.

3. The method according to claim 1, characterized in that The firmware metadata includes at least a target version of the corresponding target firmware, the hardware metadata includes at least a version range of the corresponding target firmware, and matching the firmware metadata of the multiple target firmwares with the corresponding hardware metadata includes: matching target versions of the plurality of target firmwares with corresponding version ranges; If the target versions of the plurality of target firmwares are not within the corresponding version range, determining that the version matching of the plurality of target firmwares fails; If the target versions of the multiple target firmwares are within the corresponding version range, it is determined that the versions of the multiple target firmwares are successfully matched.

4. The method according to claim 1, characterized in that The step of rolling back the multiple target firmwares according to the current versions of the multiple target firmwares includes: According to the current versions of the multiple target firmwares, obtaining the current version firmware files corresponding to the multiple target firmwares; Writing multiple current version firmware files into corresponding target firmware in sequence according to the multiple firmware refresh order; If the multiple current version firmware files are all written successfully, it is determined that the rollback of the multiple target firmware files is successful.

5. The method according to claim 1, characterized in that: Before obtaining the target image file and the signature file and standard hash value of the target image file, the method further includes: Obtain target versions and version constraints corresponding to the multiple target firmwares; According to the target versions corresponding to the multiple target firmwares, obtaining the target version firmware files corresponding to the multiple target firmwares; Based on the target versions and version constraints corresponding to the multiple target firmwares, determining whether the target server meets the multiple firmware refresh requirements; If the target server does not meet the multi-firmware refresh requirement, a version error prompt is generated; If the target server meets the multi-firmware refresh requirement, generating the target image file according to the version constraints corresponding to the multiple target firmwares and the target version firmware files, wherein the target image file at least includes a target image header and target image content, the target image header at least includes metadata of the target image file, and the target image content at least includes the target version firmware files corresponding to the multiple target firmwares spliced ​​in the multi-firmware refresh order; Calculate and obtain a standard hash value of the target image file, and sign the standard hash value according to a private key to obtain a signature file; The target image file, the signature file of the target image file, and the standard hash value are uploaded to the target server.

6. The method according to claim 5, characterized in that The determining whether the target server meets the multiple firmware refresh requirement based on the target versions and version constraints corresponding to the multiple target firmwares includes: Acquire, according to the version constraint conditions corresponding to the multiple target firmwares, multiple constraint firmwares and constraint versions corresponding to the multiple constraint firmwares; According to the firmware names, obtaining target versions and current versions of the plurality of constraint firmwares; comparing the target versions and current versions of the plurality of constraint firmwares with corresponding constraint versions; If the target versions and current versions of the plurality of constrained firmware are inconsistent with the corresponding constrained versions, determining that the target server does not meet the multi-firmware refresh requirement; If the target versions or current versions of the multiple constrained firmware are consistent with the corresponding constrained versions, it is determined that the target server meets the multiple firmware refresh requirement.

7. The method according to claim 5, characterized in that Generating the target image file according to the version constraints corresponding to the multiple target firmwares and the target version firmware file includes: According to the version constraints corresponding to the multiple target firmwares, obtaining the multiple firmware refresh order; splicing the target version firmware files corresponding to the multiple target firmwares into the target image content according to the multiple firmware refresh order; Generate metadata of the target image file according to the firmware metadata, hardware metadata corresponding to the multiple target firmware files and partition information of the target version firmware file in the target image content, and use the metadata of the target image file as the target image header; The target image file is generated according to the target image content and the target image header.

8. A multi-firmware refresh device for implementing the method according to claim 1, characterized in that: The device comprises: a first acquisition module, configured to acquire a target image file and a signature file and a standard hash value of the target image file, wherein the target image file includes at least metadata of the target image file and target version firmware files corresponding to multiple target firmwares spliced ​​in a multi-firmware refresh order, the multiple target version firmware files corresponding to the multiple target firmwares in a one-to-one manner, and the target version firmware files are used to upgrade the corresponding target firmware to a target version; A verification module, configured to verify the signature file and the standard hash value of the target image file; A first prompt module is used to generate a prompt of signature verification failure or hash verification failure if the verification fails; a parsing module, configured to parse the metadata of the target image file if the verification is successful, and obtain firmware metadata and hardware metadata corresponding to the multiple target firmware files; a matching module, configured to match the firmware metadata of the plurality of target firmwares with the corresponding hardware metadata; A second prompt module is used to generate a prompt indicating that the firmware version is incompatible if the matching fails; A second acquisition module is configured to acquire and save the current versions of the multiple target firmwares in the target server if the match is successful; A writing module, configured to write multiple target version firmware files into corresponding target firmware in sequence according to the multiple firmware refresh order; A rollback module, configured to roll back the multiple target firmware files according to their current versions if the writing of the current target version firmware file fails; A third prompt module is used to generate a prompt of write failure; The updating module is configured to update the current versions of the multiple target firmware files to corresponding target versions if the multiple target version firmware files are all written successfully.

9. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the multi-firmware refresh method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the multi-firmware refresh method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Firmware updating method and device and computer readable storage medium

    CN109992288A

  • Multi-firmware upgrading method and device

    CN110119280A

  • Server firmware upgrading method and device, storage medium and electronic equipment

    CN117608618A