Firmware upgrading method and device, electronic equipment, storage medium and product

By upgrading the firmware through information grouping, the problem of limited firmware memory was solved, and a firmware upgrade method with reduced memory overhead was achieved.

CN119440572BActive Publication Date: 2025-12-16SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411353626.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-12-16
Estimated Expiration
2044-09-26

AI Technical Summary

Technical Problem

In existing technologies, due to the limited memory of firmware, it is impossible to package multiple firmware versions into a single upgrade package and store them all in memory, leading to firmware malfunctions.

Method used

By grouping information, firmware can be updated and upgraded in groups, supporting upgrades of different firmware packages and reducing memory overhead during the upgrade process.

Benefits of technology

It successfully completed firmware upgrades without increasing memory overhead, ensuring stable firmware operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440572B_ABST
    Figure CN119440572B_ABST
Patent Text Reader

Abstract

The application provides a firmware upgrading method and device, electronic equipment, storage medium and product, firmware program information and firmware image distribution information of firmware are acquired; wherein the firmware image distribution information is used for indicating the image distribution of the firmware; the firmware program information is grouped according to the image distribution of the firmware image distribution information, and target firmware grouping information is obtained; firmware upgrading package information is determined according to the target firmware grouping information and basic attribute information of the firmware; wherein the basic attribute information refers to information describing the nature of the firmware; and firmware upgrading results of the firmware are determined according to the firmware upgrading package information. According to the technical scheme of the application, the firmware is grouped and updated, different firmware packages are supported to be upgraded, and the grouping and updating can reduce the memory consumption of the firmware in the upgrading process.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of firmware upgrade, in particular to a firmware upgrade method, device, electronic equipment, storage medium and product. BACKGROUND

[0002] With the rapid development of the server industry, the role of the baseboard management controller (BMC) is becoming more and more prominent. As an important component of server monitoring and management functions, the BMC plays an irreplaceable role in component firmware upgrade and maintenance.

[0003] At present, in the prior art, for the firmware maintenance of the component, a plurality of firmware is usually packaged into an upgrade package, and then unified update and maintenance is performed according to the upgrade package. In such an update and maintenance method, the memory occupied by the upgrade package is large. Since the memory of the firmware is limited, the packaged upgrade package cannot be stored in the memory, thereby causing abnormal operation of the firmware.

[0004] Therefore, there is an urgent need for a firmware upgrade method to reduce the memory overhead of the firmware during the upgrade process. SUMMARY

[0005] The present application provides a firmware upgrade method, device, electronic equipment, storage medium and product, which solves the defect that in the prior art, since the memory of the firmware is limited, the packaged upgrade package cannot be stored in the memory, thereby causing abnormal operation of the firmware, and realizes grouping update and upgrade of the firmware by means of information grouping, supports upgrade of different firmware packages, and the grouping update and upgrade can reduce the memory overhead of the firmware during the upgrade process.

[0006] The present application provides a firmware upgrade method, comprising the following steps.

[0007] Obtaining firmware program information and firmware image distribution information of the firmware; wherein the firmware image distribution information is used to indicate the image distribution of the firmware.

[0008] According to the image distribution of the firmware image distribution information, the firmware program information is grouped, and target firmware grouping information is obtained.

[0009] According to the target firmware grouping information and the basic attribute information of the firmware, firmware upgrade package information is determined; wherein the basic attribute information refers to information describing the properties of the firmware.

[0010] According to the firmware upgrade package information, the firmware upgrade result of the firmware is determined.

[0011] According to the firmware upgrading method provided by the application, the firmware program information is grouped according to the mirror distribution of the firmware mirror distribution information to obtain target firmware grouping information, including: grouping the firmware program information according to the mirror distribution of the firmware mirror distribution information to obtain firmware program grouping information; performing encryption processing on the firmware program grouping information to obtain firmware grouping encryption information; determining the target firmware grouping information according to the firmware grouping encryption information, a hash algorithm and an encryption algorithm.

[0012] According to the firmware upgrading method provided by the application, the target firmware grouping information is determined according to the firmware grouping encryption information, a hash algorithm and an encryption algorithm, including: performing hash calculation according to the firmware grouping encryption information and the hash algorithm to obtain firmware digest data; performing signature on the firmware digest data according to the encryption algorithm to obtain signature bytes; appending the signature bytes to the firmware grouping encryption information to obtain the target firmware grouping information.

[0013] According to the firmware upgrading method provided by the application, the basic attribute information includes firmware model, firmware version, firmware starting position, firmware size and firmware grouping quantity; the firmware upgrading package information is determined according to the target firmware grouping information and the basic attribute information of the firmware, including: analyzing the target firmware grouping information to determine whether all firmware components in the target firmware grouping information are upgraded; in the case that all firmware components are upgraded, the firmware upgrading package information is obtained; in the case that all firmware components are not upgraded, whether upgrading is needed is determined according to the firmware version; in the case that it is determined that upgrading is not needed, the step of determining whether all firmware components in the target firmware grouping information are upgraded is continued to be executed; in the case that it is determined that upgrading is needed, whether all firmware packages are upgraded is determined according to the firmware model, the firmware starting position, the firmware size and the firmware grouping quantity; in the case that it is determined that all firmware packages are upgraded, the step of determining whether all firmware components in the target firmware grouping information are upgraded is continued to be executed; in the case that it is determined that all firmware packages are not upgraded, the step of determining whether all firmware packages are upgraded according to the firmware model, the firmware starting position, the firmware size and the firmware grouping quantity is continued to be executed.

[0014] According to the firmware upgrading method provided by the application, the firmware upgrading result of the firmware is determined according to the firmware upgrading package information, and the method comprises the following steps.

[0015] According to the firmware upgrading method provided by the application, the firmware upgrading result of the firmware is determined according to the firmware upgrading package information, and the method comprises the following steps.

[0016] The application further provides a firmware upgrading device, which comprises the following modules.

[0017] The information obtaining module is used for obtaining firmware program information and firmware image distribution information of the firmware, wherein the firmware image distribution information is used for indicating the image distribution of the firmware.

[0018] The information grouping module is used for grouping the firmware program information according to the image distribution of the firmware image distribution information, so as to obtain target firmware grouping information.

[0019] The information determining module is used for determining the firmware upgrading package information according to the target firmware grouping information and basic attribute information of the firmware, wherein the basic attribute information refers to information for describing the properties of the firmware.

[0020] The result determining module is used for determining the firmware upgrading result of the firmware according to the firmware upgrading package information.

[0021] The application further provides an electronic device, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, and the processor implements any of the above firmware upgrading methods when executing the computer program.

[0022] The application further provides a non-transitory computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement any of the above firmware upgrading methods.

[0023] The application further provides a computer program product comprising a computer program, which, when executed by a processor, implements any of the above firmware upgrading methods.

[0024] The application provides a firmware upgrading method, device, electronic equipment, storage medium and product, which obtains firmware program information and firmware image distribution information of firmware, wherein the firmware image distribution information is used to indicate image distribution of the firmware; the firmware program information is grouped according to the image distribution of the firmware image distribution information to obtain target firmware grouping information; firmware upgrading package information is determined according to the target firmware grouping information and basic attribute information of the firmware; wherein the basic attribute information refers to information describing the nature of the firmware; and firmware upgrading result of the firmware is determined according to the firmware upgrading package information. The technical scheme of the application is used to solve the defect that firmware runs abnormally in the prior art because the memory of the firmware is limited and the packaged upgrading package cannot be completely stored in the memory, and realizes grouping updating and upgrading of the firmware in the manner of information grouping, supports upgrading of different firmware packages, and the grouping updating and upgrading can reduce memory consumption of the firmware in the upgrading process. BRIEF DESCRIPTION OF DRAWINGS

[0025] In order to more clearly illustrate the technical solutions of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of these drawings.

[0026] Figure 1 is a flowchart of the firmware upgrading method provided by the application.

[0027] Figure 2 is a schematic diagram of the firmware upgrading package information provided by the application.

[0028] Figure 3 is a schematic diagram of the firmware upgrading result provided by the application.

[0029] Figure 4 is a structural schematic diagram of the firmware upgrading device provided by the application.

[0030] Figure 5 is a structural schematic diagram of the electronic equipment provided by the application. DETAILED DESCRIPTION

[0031] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0032] The following is combined Figures 1-5 The firmware upgrade method provided by this invention is described below. This firmware upgrade method is applicable to situations where BMC firmware upgrades reduce memory overhead. The execution subject of this method can be an electronic device or a firmware upgrade device installed in the electronic device. The configuration device of the control interface can be implemented by software, hardware, or a combination of both. Figure 1 This is a flowchart illustrating the firmware upgrade method provided by the present invention, as shown below. Figure 1 As shown, the method includes steps 101, 102, 103 and 104.

[0033] Step 101: Obtain firmware program information and firmware image distribution information.

[0034] In this step, the firmware image distribution information is used to represent the image distribution of the firmware. The firmware does not have to be of a different type; for example, it can be BMC firmware. This embodiment does not limit this. The firmware program information is the firmware program of the firmware.

[0035] Specifically, it obtains firmware program information and firmware image distribution information used to represent the image distribution of the firmware.

[0036] Step 102: Group the firmware program information according to the image distribution of the firmware image distribution information to obtain the target firmware group information.

[0037] In one specific implementation, the method of grouping firmware program information according to the mirror distribution of firmware image distribution information to obtain target firmware group information includes: grouping firmware program information according to the mirror distribution of firmware image distribution information to obtain firmware program group information; encrypting firmware program group information to obtain firmware group encrypted information; and determining target firmware group information based on firmware group encrypted information, hash algorithm, and encryption algorithm.

[0038] Specifically, the firmware program information is grouped according to the image distribution of the firmware image distribution information to obtain firmware program grouping information; the firmware program grouping information is encrypted by an Advanced Encryption Standard (AES) encryption engine to obtain firmware grouping encryption information; and the target firmware grouping information is determined according to the firmware grouping encryption information, a hash algorithm, and an encryption algorithm.

[0039] In a specific embodiment, the specific embodiment of determining the target firmware grouping information according to the firmware grouping encryption information, the hash algorithm, and the encryption algorithm includes: performing hash calculation according to the firmware grouping encryption information and the hash algorithm to obtain firmware digest data; performing signature on the firmware digest data according to the encryption algorithm to obtain a signature segment; and appending the signature segment to the firmware grouping encryption information to obtain the target firmware grouping information.

[0040] In this step, the encryption algorithm may be, for example, a Rivest-Shamir-Adleman (RSA) cryptographic system, which is not limited in the present embodiment. RSA is a kind of asymmetric encryption algorithm, which has two different keys, one is a public key and the other is a private key.

[0041] Specifically, the firmware program grouping information is encrypted by an Advanced Encryption Standard (AES) encryption engine to obtain firmware grouping encryption information; and the target firmware grouping information is determined according to the firmware grouping encryption information, a hash algorithm, and an encryption algorithm.

[0042] For example, the firmware program information is grouped according to the image distribution of the firmware image distribution information to obtain firmware program grouping information, for example, the firmware program grouping information of the Bmc can be uboot.bin, kernel.bin, rofs.bin and rwfs.bin, and then the firmware program grouping information is encrypted by the RSA encryption engine to obtain encrypted firmware grouping information, for example, the encrypted firmware grouping information can be uboot-enc.bin, kernel-enc.bin, rofs-enc.bin and rwfs-enc.bin, the firmware grouping encrypted information is further calculated by the hash algorithm to obtain firmware digest data, and the firmware digest data is further signed by the encryption algorithm to obtain the signature bytes; the signature bytes are appended to the firmware grouping encrypted information to obtain the target firmware grouping information, for example, the target firmware grouping information can be Bmc-Firmware.bin, and the Bmc-Firmware.bin includes uboot-enc.bin, signature.bin, kernel-enc.bin, signature.bin, rofs-enc.bin, signature.bin and rwfs-enc.bin, signature.bin, and the embodiment is not limited in this regard.

[0043] The advantage of such a setting is that after grouping, the subsequent transmission and upgrading can reduce the memory consumption.

[0044] Step 103, determining the firmware upgrade package information according to the target firmware grouping information and the basic attribute information of the firmware.

[0045] In this step, the basic attribute information refers to the information describing the nature of the firmware, and the basic attribute information includes the firmware model, the firmware version, the firmware starting position, the firmware size and the firmware grouping number, and the embodiment is not limited in this regard.

[0046] Specifically, after the grouping and encryption of the firmware program grouping information is completed, all the grouped and encrypted target firmware grouping information corresponding to the firmware program is merged into an upgrade package, and the basic attribute information of the firmware is filled in to obtain the merged upgrade information, and then the firmware upgrade package information is determined based on the merged upgrade information.

[0047] For example, after obtaining the target firmware grouping information of the firmware, the target firmware grouping information of different types of firmware is obtained. The different types of firmware can be Bmc, Psu, Bios, and Cpld, etc., which are not limited in the embodiment. Then, the target firmware grouping information of Bmc, Psu, Bios, and Cpld, etc. can be Bmc-Firmware.bin, Psu-Firmware.bin, Bios-Firmware.bin, and Cpld-Firmware.bin, etc. Further, the basic attribute information of the firmware is used to fill the data header to obtain the merging upgrade information, which can be Update-Firmware.bin. The Update-Firmware.bin includes Header.bin, Bmc-Firmware.bin, Psu-Firmware.bin, Bios-Firmware.bin, and Cpld-Firmware.bin. The Header.bin represents the basic attribute information, and the Header.bin includes the basic information of different types of firmware, which can be Bmc-Header, Psu-Header, Bios-Header, and Cpld-Header. Each basic information includes the firmware type, firmware version, firmware starting position, firmware size, and firmware grouping number, etc. Taking the Bmc as an example, the Bmc-Header includes the BMC firmware type, BMC firmware version, BMC firmware starting position, BMC firmware size, and BMC firmware grouping number, etc., which are not limited in the embodiment.

[0048] The advantage of the above setting is that the firmware multi-service concurrent processing is provided, the memory resource shortage problem caused by the upgrade process is reduced, and the memory overhead is reduced.

[0049] In a specific embodiment, the specific implementation of determining the firmware upgrade package information according to the target firmware grouping information and the basic attribute information of the firmware includes: parsing the target firmware grouping information, determining whether all firmware components in the target firmware grouping information are upgraded; in the case that all firmware components are upgraded, obtaining the firmware upgrade package information; in the case that all firmware components are not upgraded, determining whether upgrading is needed according to the firmware version; in the case that it is determined that upgrading is not needed, returning to execute the step of determining whether all firmware components in the target firmware grouping information are upgraded; in the case that it is determined that upgrading is needed, determining whether all firmware packages are upgraded according to the firmware model, the firmware starting position, the firmware size and the firmware grouping quantity; in the case that it is determined that all firmware packages are upgraded, returning to execute the step of determining whether all firmware components in the target firmware grouping information are upgraded; in the case that it is determined that all firmware packages are not upgraded, returning to execute the step of determining whether all firmware packages are upgraded according to the firmware model, the firmware starting position, the firmware size and the firmware grouping quantity.

[0050] Specifically, Figure 2 is a schematic diagram of the firmware upgrade package information provided by the application, as shown in Figure 2 The determination of the firmware upgrade package information includes the following steps.

[0051] Step 201, parsing the target firmware grouping information.

[0052] Specifically, the number of upgraded components in the target firmware grouping information is parsed.

[0053] Step 202, determining whether all firmware components in the target firmware grouping information are upgraded.

[0054] Specifically, whether all firmware components are upgraded is determined according to the number of upgraded components after parsing, in the case that it is determined that all firmware components in the target firmware grouping information are not upgraded, step 203 is executed; in the case that it is determined that all firmware components in the target firmware grouping information are upgraded, step 206 is executed.

[0055] Step 203, determining whether upgrading is needed according to the firmware version.

[0056] Specifically, whether upgrading is needed is determined according to the firmware version, in the case that it is determined that upgrading is not needed, step 202 is executed; in the case that it is determined that upgrading is needed, step 204 is executed.

[0057] Step 204, obtaining the firmware model, the firmware starting position, the firmware size and the firmware grouping quantity.

[0058] Specifically, in the case that it is determined that upgrading is needed, the firmware model, the firmware starting position, the firmware size and the firmware grouping quantity are obtained.

[0059] Step 205, determine whether the upgrade is completed.

[0060] Specifically, in the case of determining that the upgrade is needed, it is determined whether all firmware packages are upgraded according to the firmware model, the firmware starting position, the firmware size and the firmware grouping number; in the case of determining that all firmware packages are upgraded, it is continued to return to execute step 202; in the case of determining that all firmware packages are not upgraded, it is continued to return to execute step 204.

[0061] Step 206, parse the firmware upgrade package information.

[0062] Specifically, in the case of determining that all firmware components are upgraded, the firmware upgrade package information is parsed.

[0063] The advantage of such setting is that after obtaining the firmware model, the firmware starting position, the firmware size and the firmware grouping number, the firmware package of a specific single component is started to be upgraded one by one, and when upgrading, the small firmware package data of each component grouping is uploaded one by one according to the grouping information of the firmware package of the single component, until the small firmware package data is upgraded, the uploading of the remaining small firmware package is performed, until all firmware packages are upgraded, which guarantees that all firmware packages are upgraded and reduces the memory occupied by the upgrade.

[0064] Step 104, determine the firmware upgrade result of the firmware according to the firmware upgrade package information.

[0065] In a specific embodiment, the specific embodiment of determining the firmware upgrade result of the firmware according to the firmware upgrade package information comprises: applying a first target byte cache, parsing the firmware upgrade package information by using an encryption algorithm to obtain a signature analysis result, and storing the signature analysis result in the first target byte cache; applying a second target byte cache, parsing the firmware upgrade package information by using a hash algorithm to obtain a firmware hash value, and storing the firmware hash value in the second target byte cache; determining whether the signature analysis result in the first target byte cache is consistent with the firmware hash value in the second target byte cache; in the case of consistency between the signature analysis result and the firmware hash value, releasing the first target byte cache and the second target byte cache, applying a third target byte cache, and determining whether the firmware upgrade package information is decrypted; in the case of completing the decryption of the firmware upgrade package information, releasing the third target byte cache, and starting the upgrade process according to an upgrade algorithm to obtain the firmware upgrade result.

[0066] Specifically, Figure 3 is a schematic diagram of the firmware upgrade result determination provided by the present application, as shown in Figure 3 The firmware upgrade result determination comprises the following steps.

[0067] Step 301, a first target byte cache is applied, a signature analysis result is obtained by using an encryption algorithm to analyze the firmware upgrade package information, and the signature analysis result is stored in the first target byte cache.

[0068] In this step, the first target byte cache may be, for example, a 256-byte cache, and the encryption algorithm may be, for example, an RSA asymmetric encryption algorithm, which is not limited in the embodiment.

[0069] Specifically, a first target byte cache is applied, a signature analysis result is obtained by using an RSA asymmetric encryption algorithm to analyze the firmware upgrade package information, and the signature analysis result is stored in the first target byte cache.

[0070] Step 302, a second target byte cache is applied, a firmware hash value is obtained by using a hash algorithm to analyze the firmware upgrade package information, and the firmware hash value is stored in the second target byte cache.

[0071] In this step, the second target byte cache may be, for example, a 256-byte cache, which is not limited in the embodiment.

[0072] Specifically, a second target byte cache is applied, a firmware hash value is obtained by using a hash algorithm to analyze the firmware upgrade package information, and the firmware hash value is stored in the second target byte cache.

[0073] Step 303, it is determined whether the signature analysis result in the first target byte cache is consistent with the firmware hash value in the second target byte cache.

[0074] Specifically, it is determined whether the signature analysis result in the first target byte cache is consistent with the firmware hash value in the second target byte cache, in the case that the signature analysis result is consistent with the firmware hash value, step 305 is executed; in the case that the signature analysis result is not consistent with the firmware hash value, step 304 is executed.

[0075] Step 304, verification exception information is sent out.

[0076] In this step, the verification exception information is used to indicate that the firmware upgrade fails.

[0077] Specifically, in the case that the signature analysis result is not consistent with the firmware hash value, the verification exception information is sent out to indicate that the firmware upgrade fails.

[0078] Step 305, the first target byte cache and the second target byte cache are released.

[0079] Specifically, in the case that the signature analysis result is consistent with the firmware hash value, the first target byte cache and the second target byte cache are released, and step 306 is executed.

[0080] Step 306, apply the third target byte cache.

[0081] In this step, the third target byte cache may be a 32-byte cache, for example, and the present embodiment does not limit this.

[0082] Step 307, determine whether the firmware upgrade package information is decrypted.

[0083] Specifically, after the third target byte cache is applied, it is determined whether the firmware upgrade package information is decrypted. If it is determined that the firmware upgrade package information is decrypted, step 309 is performed. If it is determined that the firmware upgrade package information is not decrypted, step 308 is performed.

[0084] Step 308, obtain cache data and decrypt the cache data.

[0085] Specifically, if it is determined that the firmware upgrade package information is not decrypted, the cache data of the third target byte is obtained to the third target byte cache, and the cache data of the third target byte is decrypted for the encrypted firmware upgrade package information. The encrypted firmware upgrade package information is added to the third target byte cache, and then the decrypted cache data is written to the storage location of the data before decryption, and step 307 is returned to continue to be performed.

[0086] The advantage of this setting is that no additional memory overhead is required, and after the firmware upgrade package information is decrypted, the subsequent upgrade process can be performed.

[0087] Step 309, release the third target byte cache.

[0088] Specifically, if the firmware upgrade package information is decrypted, the third target byte cache is released, and step 310 is performed.

[0089] Step 310, start the upgrade process according to the upgrade algorithm to obtain the firmware upgrade result.

[0090] The application provides a firmware upgrading method, which comprises the following steps: obtaining firmware program information and firmware image distribution information of firmware; the firmware image distribution information is used for indicating the image distribution of the firmware; grouping the firmware program information according to the image distribution of the firmware image distribution information to obtain target firmware grouping information; determining firmware upgrading package information according to the target firmware grouping information and basic attribute information of the firmware; the basic attribute information refers to information for describing the properties of the firmware; and determining the firmware upgrading result of the firmware according to the firmware upgrading package information. The technical scheme of the application is used to solve the defect that the firmware runs abnormally in the prior art because the memory of the firmware is limited and the packaged upgrading package cannot be completely stored in the memory, realizes grouping updating and upgrading of the firmware through the information grouping mode, supports upgrading of different firmware packages, and the grouping updating and upgrading can reduce the memory cost of the firmware in the upgrading process.

[0091] The firmware upgrading device provided by the application is described below, and the firmware upgrading device described below can be correspondingly referred to the firmware upgrading method described above.

[0092] Figure 4 Fig. 1 is a structural schematic diagram of the firmware upgrading device provided by the application, as shown in Fig. 1, the firmware upgrading device 400 comprises an information obtaining module 401, an information grouping module 402, an information determining module 403 and a result determining module 404. Figure 4

[0093] The information obtaining module 401 is used for obtaining firmware program information and firmware image distribution information of firmware; the firmware image distribution information is used for indicating the image distribution of the firmware.

[0094] The information grouping module 402 is used for grouping the firmware program information according to the image distribution of the firmware image distribution information to obtain target firmware grouping information.

[0095] The information determining module 403 is used for determining firmware upgrading package information according to the target firmware grouping information and basic attribute information of the firmware; the basic attribute information refers to information for describing the properties of the firmware.

[0096] The result determining module 404 is used for determining the firmware upgrading result of the firmware according to the firmware upgrading package information.

[0097] In an example embodiment, the information grouping module 402 is specifically used for grouping the firmware program information according to the image distribution of the firmware image distribution information to obtain firmware program grouping information; performing encryption processing on the firmware program grouping information to obtain firmware grouping encryption information; and determining the target firmware grouping information according to the firmware grouping encryption information, a hash algorithm and an encryption algorithm. ​

[0098] In an example embodiment, the information grouping module 402 is specifically configured to: perform hash calculation on the firmware grouping encrypted information and the hash algorithm to obtain firmware digest data; perform signature on the firmware digest data according to the encryption algorithm to obtain a signature byte; and append the signature byte to the firmware grouping encrypted information to obtain the target firmware grouping information.

[0099] In an example embodiment, the basic attribute information includes firmware model, firmware version, firmware starting position, firmware size, and firmware grouping quantity.

[0100] In an example embodiment, the information determination module 403 is specifically configured to: parse the target firmware grouping information to determine whether all firmware components in the target firmware grouping information are upgraded; in the case that all firmware components are upgraded, parse to obtain the firmware upgrade package information; in the case that all firmware components are not upgraded, determine whether upgrade is needed according to the firmware version; in the case that it is determined that upgrade is not needed, continue to return to execute the step of determining whether all firmware components in the target firmware grouping information are upgraded; in the case that it is determined that upgrade is needed, determine whether all firmware packages are upgraded according to the firmware model, the firmware starting position, the firmware size, and the firmware grouping quantity; in the case that it is determined that all firmware packages are upgraded, continue to return to execute the step of determining whether all firmware components in the target firmware grouping information are upgraded; in the case that it is determined that all firmware packages are not upgraded, continue to return to execute the step of determining whether all firmware packages are upgraded according to the firmware model, the firmware starting position, the firmware size, and the firmware grouping quantity.

[0101] In an example embodiment, the result determination module 404 is specifically configured to: apply a first target byte cache, parse the firmware upgrade package information by using the encryption algorithm to obtain a signature parsing result, and store the signature parsing result in the first target byte cache; apply a second target byte cache, parse the firmware upgrade package information by using the hash algorithm to obtain a firmware hash value, and store the firmware hash value in the second target byte cache; determine whether the signature parsing result in the first target byte cache is consistent with the firmware hash value in the second target byte cache; in the case that the signature parsing result is consistent with the firmware hash value, release the first target byte cache and the second target byte cache, apply a third target byte cache, and determine whether the firmware upgrade package information is decrypted; in the case that the firmware upgrade package information is decrypted, release the third target byte cache, and start the upgrade process according to the upgrade algorithm to obtain a firmware upgrade result.

[0102] In an example embodiment, the apparatus further includes an upgrade exception module. The upgrade exception module is configured to: in the case that the signature parsing result is not consistent with the firmware hash value, issue a verification exception information; wherein the verification exception information is used to indicate that the firmware upgrade fails.

[0103] The apparatus of this embodiment can be used to execute the method of any embodiment in the firmware upgrade method side embodiment. Its specific implementation process and technical effects are similar to those in the firmware upgrade method side embodiment. For details, please refer to the detailed description in the firmware upgrade method side embodiment, which will not be repeated here.

[0104] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 5 As shown, the electronic device may include a processor 510, a communications interface 520, a memory 530, and a communication bus 540, wherein the processor 510, communications interface 520, and memory 530 communicate with each other via the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute a firmware upgrade method, which includes: acquiring firmware program information and firmware image distribution information; wherein the firmware image distribution information represents the image distribution of the firmware; grouping the firmware program information according to the image distribution of the firmware image distribution information to obtain target firmware group information; determining firmware upgrade package information based on the target firmware group information and the basic attribute information of the firmware; wherein the basic attribute information refers to information describing the properties of the firmware; and determining the firmware upgrade result based on the firmware upgrade package information.

[0105] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0106] In another aspect, the present application also provides a computer program product, which comprises a computer program, the computer program being stored in a non-transitory computer readable storage medium, and the computer program, when executed by a processor, enables a computer to perform the firmware upgrade method provided by the above-mentioned methods, and the method comprises: obtaining firmware program information and firmware image distribution information of a firmware; wherein the firmware image distribution information is used to indicate an image distribution of the firmware; performing information grouping on the firmware program information according to the image distribution of the firmware image distribution information to obtain target firmware grouping information; determining firmware upgrade package information according to the target firmware grouping information and basic attribute information of the firmware; wherein the basic attribute information refers to information describing the nature of the firmware; and determining a firmware upgrade result of the firmware according to the firmware upgrade package information.

[0107] In another aspect, the present application also provides a non-transitory computer readable storage medium, which stores a computer program, and the computer program, when executed by a processor, enables a computer to perform the firmware upgrade method provided by the above-mentioned methods, and the method comprises: obtaining firmware program information and firmware image distribution information of a firmware; wherein the firmware image distribution information is used to indicate an image distribution of the firmware; performing information grouping on the firmware program information according to the image distribution of the firmware image distribution information to obtain target firmware grouping information; determining firmware upgrade package information according to the target firmware grouping information and basic attribute information of the firmware; wherein the basic attribute information refers to information describing the nature of the firmware; and determining a firmware upgrade result of the firmware according to the firmware upgrade package information.

[0108] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., they can be located in one place, or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment scheme according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0109] From the above description of the embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software plus necessary general hardware platforms, and of course, can also be realized by hardware. Based on such understanding, the above technical solutions, essentially or in terms of the contribution to the prior art, can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in the various embodiments or some parts of the embodiments.

[0110] It should be pointed out finally that the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit the same; and although the present application has been described in detail with reference to the foregoing embodiments, it should be appreciated by those skilled in the art that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features thereof can be replaced equivalently; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A firmware upgrade method, characterized in that, include: Obtain firmware program information and firmware image distribution information of the firmware; wherein, the firmware image distribution information is used to represent the image distribution of the firmware; The firmware program information is grouped according to the mirror distribution of the firmware mirror distribution information to obtain target firmware group information; the step of grouping the firmware program information according to the mirror distribution of the firmware mirror distribution information to obtain target firmware group information includes: grouping the firmware program information according to the mirror distribution of the firmware mirror distribution information to obtain firmware program group information; encrypting the firmware program group information to obtain firmware group encrypted information; and determining the target firmware group information based on the firmware group encrypted information, a hash algorithm, and an encryption algorithm. Firmware upgrade package information is determined based on the target firmware grouping information and the basic attribute information of the firmware; wherein, the basic attribute information refers to information describing the properties of the firmware; Determining the firmware upgrade result based on the firmware upgrade package information includes: allocating a first target byte cache, parsing the firmware upgrade package information using an encryption algorithm to obtain a signature parsing result, and storing the signature parsing result in the first target byte cache; allocating a second target byte cache, parsing the firmware upgrade package information using a hash algorithm to obtain a firmware hash value, and storing the firmware hash value in the second target byte cache; determining whether the signature parsing result in the first target byte cache is consistent with the firmware hash value in the second target byte cache; if the signature parsing result is consistent with the firmware hash value... Release the first target byte cache and the second target byte cache, request the third target byte cache, and determine whether the firmware upgrade package information has been decrypted. If the firmware upgrade package information has been decrypted, release the third target byte cache and start the upgrade process according to the upgrade algorithm to obtain the firmware upgrade result. If it is determined that the firmware upgrade package information has not been decrypted, obtain the cached data of the third target byte into the third target byte cache, decrypt the cached data of the third target byte to encrypt the firmware upgrade package information, add the encrypted firmware upgrade package information to the third target byte cache, and then write the decrypted cached data back to the storage location of the data before decryption, and continue to determine whether the firmware upgrade package information has been decrypted.

2. The firmware upgrade method according to claim 1, characterized in that, Determining the target firmware group information based on the firmware group encryption information, hash algorithm, and encryption algorithm includes: The firmware digest data is obtained by performing a hash calculation based on the firmware group encryption information and the hash algorithm. The firmware digest data is signed according to the encryption algorithm to obtain signature bytes; The signature bytes are appended to the firmware packet encryption information to obtain the target firmware packet information.

3. The firmware upgrade method according to claim 1, characterized in that, The basic attribute information includes firmware model, firmware version, firmware start location, firmware size, and number of firmware groups; The step of determining the firmware upgrade package information based on the target firmware grouping information and the basic attribute information of the firmware includes: Parse the target firmware group information to determine whether all firmware components in the target firmware group information have been upgraded. Once all firmware components have been upgraded, the firmware upgrade package information is obtained by parsing. If all firmware components have not been upgraded, determine whether an upgrade is needed based on the firmware version. If it is determined that no upgrade is needed, continue to return to the step of determining whether all firmware components in the target firmware group information have been upgraded. If an upgrade is determined to be necessary, it is determined whether all firmware packages have been upgraded successfully based on the firmware model, the firmware start position, the firmware size, and the number of firmware groups. If it is determined that all firmware packages have been upgraded, continue to return to the step of determining whether all firmware components in the target firmware group information have been upgraded. If it is determined that all firmware packages have not been upgraded, the process continues to return to the step of determining whether all firmware packages have been upgraded based on the firmware model, the firmware start position, the firmware size, and the number of firmware groups.

4. The firmware upgrade method according to claim 1, characterized in that, The method further includes: If the signature parsing result is inconsistent with the firmware hash value, a verification exception message is issued; wherein, the verification exception message is used to indicate that the firmware upgrade has failed.

5. A firmware upgrade device, characterized in that, include: An information acquisition module is used to acquire firmware program information and firmware image distribution information of the firmware; wherein, the firmware image distribution information is used to represent the image distribution of the firmware; The information grouping module is used to group the firmware program information according to the mirror distribution of the firmware mirror distribution information to obtain target firmware group information; the step of grouping the firmware program information according to the mirror distribution of the firmware mirror distribution information to obtain target firmware group information includes: grouping the firmware program information according to the mirror distribution of the firmware mirror distribution information to obtain firmware program group information; encrypting the firmware program group information to obtain firmware group encrypted information; and determining the target firmware group information according to the firmware group encrypted information, a hash algorithm, and an encryption algorithm. The information determination module is used to determine firmware upgrade package information based on the target firmware grouping information and the basic attribute information of the firmware; wherein, the basic attribute information refers to information describing the properties of the firmware; The result determination module is used to determine the firmware upgrade result of the firmware based on the firmware upgrade package information. The determination of the firmware upgrade result based on the firmware upgrade package information includes: requesting a first target byte cache, parsing the firmware upgrade package information using an encryption algorithm to obtain a signature parsing result, and storing the signature parsing result in the first target byte cache; requesting a second target byte cache, parsing the firmware upgrade package information using a hash algorithm to obtain a firmware hash value, and storing the firmware hash value in the second target byte cache; determining whether the signature parsing result in the first target byte cache is consistent with the firmware hash value in the second target byte cache; and determining whether the signature parsing result is consistent with the firmware hash value. In the case of failure to decrypt the firmware upgrade package information, the first target byte cache and the second target byte cache are released, a third target byte cache is requested, and it is determined whether the firmware upgrade package information has been decrypted. If the firmware upgrade package information has been decrypted, the third target byte cache is released, and the upgrade process is started according to the upgrade algorithm to obtain the firmware upgrade result. If it is determined that the firmware upgrade package information has not been decrypted, the cached data of the third target byte is obtained into the third target byte cache, and the cached data of the third target byte is decrypted to encrypt the firmware upgrade package information. The encrypted firmware upgrade package information is added to the third target byte cache, and then the decrypted cached data is written back to the storage location of the data before decryption. Then, the process of determining whether the firmware upgrade package information has been decrypted is continued.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the firmware upgrade method as described in any one of claims 1 to 4.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the firmware upgrade method as described in any one of claims 1 to 4.

8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the firmware upgrade method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Hard copy control system based on national commercial cipher algorithm

    CN107124277A

  • Automatic packaging device for textile material rolls

    CN112173203A