Firmware upgrading method and device, electronic equipment, storage medium and product
Through information grouping, the firmware is grouped and updated, which solves the problem of operation abnormalities caused by restricted firmware memory in the prior art, and achieves the effect of reducing memory overhead during firmware upgrade.
Patent Information
- Application Number
- CN202411353626.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-09-26
AI Technical Summary
In the prior art, due to the memory limitation of the firmware, it is impossible to package multiple firmware into one upgrade package and store them all in memory, resulting in abnormal operation of the firmware.
Through information grouping, firmware is grouped and updated, and different firmware packages are supported to upgrade, reducing the memory overhead of firmware during the upgrade process. The specific steps include obtaining the firmware program information and mirror distribution information of the firmware, grouping the firmware program information based on the mirror distribution information, determining the target firmware grouping information and basic attribute information, forming firmware upgrade package information, and finally determining the firmware upgrade result.
Through group update and upgrade, the memory overhead during firmware upgrade is reduced, the problem of abnormal firmware operation is avoided, and different firmware packages are supported for upgrading.
Smart Images

Figure CN119440572A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of firmware upgrade technology, and in particular to a firmware upgrade method, device, electronic device, storage medium and product. Background Art
[0002] With the rapid development of the server industry, the role of the baseboard management controller (BMC) has become increasingly prominent. As an important component of the server monitoring and management functions, BMC is irreplaceable for the firmware upgrade and maintenance of components.
[0003] At present, in the prior art, for the firmware maintenance of components, multiple firmwares are usually packaged into an upgrade package, and then unified update and maintenance are performed according to the upgrade package. During this update and maintenance method, the upgrade package occupies a large amount of memory. Due to the limited memory of the firmware, it is impossible to store all the packaged upgrade packages in the memory, which causes abnormal firmware operation.
[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 of the invention
[0005] The present invention provides a firmware upgrade method, device, electronic device, storage medium and product, which are used to solve the defect in the prior art that multiple firmware are packaged into an upgrade package, but due to the limited memory of the firmware, the packaged upgrade package cannot be stored in the memory, thus causing abnormal firmware operation. The present invention realizes group update and upgrade of firmware by information grouping, supports upgrading of different firmware packages, and group update and upgrade can reduce the memory overhead of firmware during the upgrade process.
[0006] The present invention provides a firmware upgrade method, comprising the following steps.
[0007] The firmware program information and the firmware image distribution information of the firmware are obtained; wherein the firmware image distribution information is used to indicate the image distribution of the firmware.
[0008] The firmware program information is grouped according to the image distribution of the firmware image distribution information to obtain target firmware grouping information.
[0009] The firmware upgrade package information is determined according to the target firmware grouping information and the basic attribute information of the firmware; wherein the basic attribute information refers to the information describing the properties of the firmware.
[0010] The firmware upgrade result of the firmware is determined according to the firmware upgrade package information.
[0011] According to a firmware upgrade method provided by the present invention, firmware program information is grouped according to the mirror distribution of firmware image distribution information to obtain target firmware grouping information, including: grouping firmware program information according to the mirror distribution of firmware image distribution information to obtain firmware program grouping information; encrypting the firmware program grouping information to obtain firmware grouping encrypted information; determining the target firmware grouping information according to the firmware grouping encrypted information, a hash algorithm and an encryption algorithm.
[0012] According to a firmware upgrade method provided by the present invention, target firmware group information is determined according to firmware group encryption information, a hash algorithm and an encryption algorithm, including: performing hash calculation according to the firmware group encryption information and the hash algorithm to obtain firmware summary data; signing the firmware summary data according to the encryption algorithm to obtain signature bytes; appending the signature bytes to the firmware group encryption information to obtain the target firmware group information.
[0013] According to a firmware upgrade method provided by the present invention, basic attribute information includes firmware model, firmware version, firmware starting position, firmware size and number of firmware groups; determining firmware upgrade package information according to target firmware group information and basic attribute information of firmware, including: parsing target firmware group information to determine whether all firmware components in the target firmware group information have been upgraded; when all firmware components have been upgraded, parsing to obtain firmware upgrade package information; when all firmware components have not been upgraded, determining whether an upgrade is required according to the firmware version; when it is determined that an upgrade is not required, continuing to return to execute the step of determining whether all firmware components in the target firmware group information have been upgraded; when it is determined that an upgrade is required, determining whether all firmware packages have been upgraded according to the firmware model, firmware starting position, firmware size and number of firmware groups; when it is determined that all firmware packages have been upgraded, continuing to return to execute the step of determining whether all firmware components in the target firmware group information have been upgraded; when it is determined that all firmware packages have not been upgraded, continuing to return to execute the step of determining whether all firmware packages have been upgraded according to the firmware model, firmware starting position, firmware size and number of firmware groups.
[0014] According to a firmware upgrade method provided by the present invention, a firmware upgrade result of a firmware is determined according to firmware upgrade package information, including: applying for a first target byte cache, parsing the firmware upgrade package information using an encryption algorithm, obtaining a signature parsing result, and storing the signature parsing result in the first target byte cache; applying for a second target byte cache, parsing the firmware upgrade package information using a hash algorithm, obtaining 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; when the signature parsing result is consistent with the firmware hash value, releasing the first target byte cache and the second target byte cache, applying for a third target byte cache, and determining whether the firmware upgrade package information is decrypted; when the firmware upgrade package information is decrypted, releasing the third target byte cache, and starting the upgrade process according to the upgrade algorithm to obtain the firmware upgrade result.
[0015] A firmware upgrade method provided according to the present invention also includes: when the signature parsing result is inconsistent with the firmware hash value, issuing a verification exception message; wherein the verification exception message is used to indicate that the firmware upgrade has failed.
[0016] The present invention also provides a firmware upgrade device, comprising the following modules.
[0017] The 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 indicate the image distribution of the firmware.
[0018] The information grouping module is used to group the firmware program information according to the image distribution of the firmware image distribution information to obtain target firmware grouping information.
[0019] The information determination module is used to determine the firmware upgrade package information according to the target firmware grouping information and the basic attribute information of the firmware; wherein the basic attribute information refers to the information describing the nature of the firmware.
[0020] The result determination module is used to determine the firmware upgrade result of the firmware according to the firmware upgrade package information.
[0021] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, any of the above-mentioned firmware upgrade methods is implemented.
[0022] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, any of the above-mentioned firmware upgrade methods is implemented.
[0023] The present invention also provides a computer program product, including a computer program, and when the computer program is executed by a processor, any of the above-mentioned firmware upgrade methods is implemented.
[0024] The present invention provides a firmware upgrade method, device, electronic device, storage medium and product, which obtains the 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 image distribution of the firmware image distribution information to obtain the target firmware grouping information; the firmware upgrade package information is determined according to the target firmware grouping information and the basic attribute information of the firmware; wherein the basic attribute information refers to the information describing the nature of the firmware; the firmware upgrade result of the firmware is determined according to the firmware upgrade package information. The technical solution of the present invention is used to solve the defect in the prior art that multiple firmwares are packaged into an upgrade package, and due to the limited memory of the firmware, the packaged upgrade package cannot be stored in the memory, thus causing abnormal firmware operation, and realizes the group update and upgrade of the firmware through information grouping, supports the upgrade of different firmware packages, and the group update and upgrade can reduce the memory overhead of the firmware during the upgrade process. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0026] Figure 1 It is a flowchart of the firmware upgrade method provided by the present invention.
[0027] Figure 2 It is a schematic diagram of determining the firmware upgrade package information provided by the present invention.
[0028] Figure 3 It is a schematic diagram of determining the firmware upgrade result provided by the present invention.
[0029] Figure 4 It is a structural schematic diagram of the firmware upgrading device provided by the present invention.
[0030] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0032] Combine the following Figure 1-Figure 5 The firmware upgrade method provided by the present invention is described. The firmware upgrade method provided by the present invention can be applicable to the situation where the BMC firmware upgrade reduces the memory overhead. The execution subject of the method can be an electronic device or a firmware upgrade device set in the electronic device. The configuration device of the control interface can be implemented by software, hardware or a combination of both. Figure 1 It is a flowchart of the firmware upgrade method provided by the present invention, such as Figure 1 As shown, the method includes step 101, step 102, step 103 and step 104.
[0033] Step 101: Obtain firmware program information and firmware image distribution information of the firmware.
[0034] In this step, the firmware image distribution information is used to indicate the image distribution of the firmware. The firmware may not be of different types, for example, it may be a BMC, which is not limited in this embodiment. The firmware program information is the firmware program of the firmware.
[0035] Specifically, firmware program information of the firmware and firmware image distribution information for indicating image distribution of the firmware are obtained.
[0036] Step 102: Group the firmware program information according to the image distribution of the firmware image distribution information to obtain target firmware grouping information.
[0037] In a specific implementation, the firmware program information is grouped according to the mirror distribution of the firmware image distribution information to obtain the target firmware grouping information. The specific implementation method includes: grouping the firmware program information according to the mirror distribution of the firmware image distribution information to obtain firmware program grouping information; encrypting the firmware program grouping information to obtain firmware grouping encryption information; determining the target firmware grouping information based on the firmware grouping encryption information, a hash algorithm and an 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 encrypted information; and the target firmware grouping information is determined according to the firmware grouping encrypted information, a hash algorithm, and an encryption algorithm.
[0039] In a specific implementation, the specific implementation of determining the target firmware group information based on the firmware group encryption information, the hash algorithm and the encryption algorithm includes: performing a hash calculation based on the firmware group encryption information and the hash algorithm to obtain firmware summary data; signing the firmware summary data based on the encryption algorithm to obtain a signature byte; appending the signature byte to the firmware group encryption information to obtain the target firmware group information.
[0040] In this step, the encryption algorithm may be, for example, a cryptographic system (Rivest-Shamir-Adleman, RSA), which is not limited in this embodiment. RSA is an asymmetric encryption algorithm with two different keys, one is a public key and the other is a private key.
[0041] Specifically, a hash calculation is performed according to the firmware group encryption information and a hash algorithm to obtain firmware summary data; the firmware summary data is signed according to the encryption algorithm to obtain a signature byte; and the signature byte is appended to the firmware group encryption information to obtain the target firmware group information.
[0042] Exemplarily, taking BMC firmware as an 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, for BMC, the firmware program information corresponding to the BMC is grouped according to the corresponding firmware image distribution information to obtain firmware program grouping information, such as uboot.bin, kernel.bin, rofs.bin and rwfs.bin, and then encrypted by the RSA encryption engine to obtain encrypted firmware group encryption information, such as uboot-enc.bin, kernel-enc.bin, rofs-enc.bin and rwfs-enc.bin, and further encrypted by the hash algorithm. The firmware group encrypted information is hashed to obtain firmware summary data, and the firmware summary data is further signed by an encryption algorithm to obtain a signature byte; after the signature byte is appended to the firmware group encrypted information, the target firmware group information is obtained, for example, Bmc-Firmware.bin, and 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, which is not limited in this embodiment.
[0043] The advantage of this setting is that after grouping, subsequent transmission and upgrade can reduce memory consumption.
[0044] Step 103: Determine 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 information describing the properties of the firmware, and the basic attribute information includes the firmware model, firmware version, firmware starting position, firmware size, and the number of firmware groups, which is not limited in this embodiment.
[0046] Specifically, after the firmware program group information is encrypted, the firmware programs corresponding to all the encrypted target firmware group information are 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 analysis.
[0047] Exemplarily, after obtaining the target firmware grouping information of the firmware, for various types of firmware, target firmware grouping information of various types of firmware is obtained. Various types of firmware may be, for example, Bmc, Psu, Bios, and Cpld, etc., which is not limited in this embodiment. Then, the target firmware grouping information of Bmc, Psu, Bios, and Cpld, etc. may be obtained, such as Bmc-Firmware.bin, Psu-Firmware.bin, Bios-Firmware.bin, and Cpld-Firmware.bin, and the data header is further filled with the basic attribute information of the firmware to obtain the merged upgrade information, such as Update-Firmware.bin, which includes Header.bin, Bmc-Firmware.bin, Psu-Firmware.bin, Bios-Firmware.bin, and Cpld-Firmware.bin. in and Cpld-Firmware.bin, wherein Header.bin represents basic attribute information, and Header.bin includes basic information of different types of firmware, such as Bmc-Header, Psu-Header, Bios-Header, and Cpld-Header, and each basic information includes the firmware model, firmware version, firmware starting position, firmware size, and number of firmware groups of the firmware. Taking BMC as an example, Bmc-Header includes BMC firmware model, BMC firmware version, BMC firmware starting position, BMC firmware size, and number of BMC firmware groups, which are not limited in this embodiment.
[0048] The advantage of this setting is that it provides concurrent processing of multiple firmware services, reduces the problem of memory resource shortage caused by the upgrade process, and reduces memory overhead.
[0049] In a specific embodiment, a specific implementation method of determining firmware upgrade package information based on target firmware grouping information and basic attribute information of the firmware includes: parsing the target firmware grouping information to determine whether all firmware components in the target firmware grouping information have been upgraded; when all firmware components have been upgraded, parsing to obtain firmware upgrade package information; when all firmware components have not been upgraded, determining whether an upgrade is required based on the firmware version; when it is determined that an upgrade is not required, continuing to return to execute the step of determining whether all firmware components in the target firmware grouping information have been upgraded; when it is determined that an upgrade is required, determining whether all firmware packages have been upgraded based on the firmware model, the firmware starting position, the firmware size, and the number of firmware groups; when it is determined that all firmware packages have been upgraded, continuing to return to execute the step of determining whether all firmware components in the target firmware grouping information have been upgraded; when it is determined that all firmware packages have not been upgraded, continuing to return to execute the step of determining whether all firmware packages have been upgraded based on the firmware model, the firmware starting position, the firmware size, and the number of firmware groups.
[0050] Specifically, Figure 2 Schematic diagram of determining the firmware upgrade package information provided by the present invention. Figure 2 As shown, the firmware upgrade package information determination includes the following steps.
[0051] Step 201: parse target firmware grouping information.
[0052] Specifically, the number of upgrade components in the target firmware grouping information is parsed.
[0053] Step 202: Determine whether all firmware components in the target firmware grouping information have been upgraded.
[0054] Specifically, determine whether all firmware components have been upgraded according to the number of upgraded components after parsing. If it is determined that all firmware components in the target firmware grouping information have not been upgraded, continue to execute step 203; if it is determined that all firmware components in the target firmware grouping information have been upgraded, continue to execute step 206; Step 203: Determine whether an upgrade is required based on the firmware version.
[0055] Specifically, it is determined whether an upgrade is required according to the firmware version. If it is determined that an upgrade is not required, the process returns to step 202 ; if it is determined that an upgrade is required, the process continues to step 204 .
[0056] Step 204: Obtain the firmware model, firmware starting position, firmware size, and firmware group quantity.
[0057] Specifically, when it is determined that an upgrade is required, the firmware model, the firmware starting position, the firmware size, and the number of firmware groups are obtained.
[0058] Step 205: Determine whether the upgrade is complete.
[0059] Specifically, when it is determined that an upgrade is required, determine whether all firmware packages have been upgraded based on the firmware model, firmware starting position, firmware size and number of firmware groups; when it is determined that all firmware packages have been upgraded, continue to return to execute step 202; when it is determined that all firmware packages have not been upgraded, continue to return to execute step 204.
[0060] Step 206: parse and obtain the firmware upgrade package information.
[0061] Specifically, when all firmware components are upgraded, the firmware upgrade package information is parsed and obtained.
[0062] The advantage of this setting is that after obtaining the firmware model, firmware starting position, firmware size and number of firmware groups, the firmware packages of specific individual components are upgraded one by one. During the upgrade, according to the grouping information of the firmware package of the individual component, the small firmware package data of the individual component groupings are uploaded one by one until the small firmware package data is upgraded. Then, the remaining small firmware packages are uploaded until all firmware packages are upgraded, thereby ensuring that all firmware packages are upgraded and reducing the memory occupied by the upgrade.
[0063] Step 104: Determine the firmware upgrade result of the firmware according to the firmware upgrade package information.
[0064] In a specific embodiment, a specific implementation method of determining a firmware upgrade result of a firmware according to firmware upgrade package information includes: applying for a first target byte cache, parsing the firmware upgrade package information using an encryption algorithm, obtaining a signature parsing result, and storing the signature parsing result in the first target byte cache; applying for a second target byte cache, parsing the firmware upgrade package information using a hash algorithm, obtaining 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; when the signature parsing result is consistent with the firmware hash value, releasing the first target byte cache and the second target byte cache, applying for a third target byte cache, and determining whether the firmware upgrade package information is decrypted; when the firmware upgrade package information is decrypted, releasing the third target byte cache, and starting the upgrade process according to the upgrade algorithm to obtain the firmware upgrade result.
[0065] Specifically, Figure 3 Schematic diagram of determining the firmware upgrade result provided by the present invention. Figure 3 As shown, the firmware upgrade result determination includes the following steps.
[0066] Step 301: Apply for a first target byte cache, parse the firmware upgrade package information using an encryption algorithm, obtain a signature parsing result, and store the signature parsing result in the first target byte cache.
[0067] 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 this embodiment.
[0068] Specifically, apply for the first target byte cache, use the RSA asymmetric encryption algorithm to parse the firmware upgrade package information, obtain the signature parsing result, and store the signature parsing result in the first target byte cache.
[0069] Step 302: Apply for a second target byte cache, parse the firmware upgrade package information using a hash algorithm, obtain a firmware hash value, and store the firmware hash value in the second target byte cache.
[0070] In this step, the second target byte cache may be, for example, a 256-byte cache, which is not limited in this embodiment.
[0071] Specifically, apply for a second target byte cache, use a hash algorithm to parse the firmware upgrade package information, obtain a firmware hash value, and store the firmware hash value in the second target byte cache.
[0072] Step 303: 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.
[0073] Specifically, 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. If the signature parsing result is consistent with the firmware hash value, continue to execute step 305; if the signature parsing result is inconsistent with the firmware hash value, continue to execute step 304.
[0074] Step 304: Issue a verification exception message.
[0075] In this step, the verification exception information is used to indicate that the firmware upgrade has failed.
[0076] Specifically, when the signature parsing result is inconsistent with the firmware hash value, a verification exception message is issued to indicate that the firmware upgrade has failed.
[0077] Step 305: Release the first target byte cache and the second target byte cache.
[0078] Specifically, when the signature parsing 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 continued.
[0079] Step 306: Apply for a third target byte cache.
[0080] In this step, the third target byte cache may be, for example, a 32-byte cache, which is not limited in this embodiment.
[0081] Step 307: Determine whether the firmware upgrade package information has been decrypted.
[0082] Specifically, after applying for the third target byte cache, determine whether the firmware upgrade package information is decrypted. If it is determined that the firmware upgrade package information is decrypted, continue to execute step 309; if it is determined that the firmware upgrade package information is not decrypted, continue to execute step 308.
[0083] Step 308: Obtain cached data and decrypt the cached data.
[0084] Specifically, when it is determined that the firmware upgrade package information has not been 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 to encrypt the firmware upgrade package information, and 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 then the execution of step 307 is continued.
[0085] The advantage of this setting is that there is no need to increase additional memory overhead, and after confirming that the firmware upgrade package information decryption is completed, the subsequent upgrade process can be carried out.
[0086] Step 309: Release the third target byte cache.
[0087] Specifically, when the firmware upgrade package information is decrypted, the third target byte cache is released, and step 310 is continued.
[0088] Step 310: Start the upgrade process according to the upgrade algorithm and obtain the firmware upgrade result.
[0089] The present invention provides a firmware upgrade method, which obtains the 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 image distribution of the firmware image distribution information to obtain the target firmware grouping information; the firmware upgrade package information is determined according to the target firmware grouping information and the basic attribute information of the firmware; wherein the basic attribute information refers to the information describing the nature of the firmware; and the firmware upgrade result of the firmware is determined according to the firmware upgrade package information. The technical solution of the present invention is used to solve the defect in the prior art that by packaging multiple firmware into an upgrade package, due to the limited memory of the firmware, the packaged upgrade package cannot be stored in the memory, thus causing abnormal firmware operation, and realizes the group update and upgrade of the firmware by information grouping, supports the upgrade of different firmware packages, and the group update and upgrade can reduce the memory overhead of the firmware during the upgrade process.
[0090] The firmware upgrade device provided by the present invention is described below. The firmware upgrade device described below and the firmware upgrade method described above can be referenced to each other.
[0091] Figure 4 is a schematic diagram of the structure of the firmware upgrade device provided by the present invention, referring to Figure 4 As shown, the firmware upgrade device 400 includes: an information acquisition module 401 , an information grouping module 402 , an information determination module 403 and a result determination module 404 .
[0092] The information acquisition module 401 is used to acquire 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.
[0093] The information grouping module 402 is used to group the firmware program information according to the image distribution of the firmware image distribution information to obtain target firmware grouping information.
[0094] The information determination module 403 is used to determine the firmware upgrade package information according to the target firmware grouping information and the basic attribute information of the firmware; wherein the basic attribute information refers to the information describing the properties of the firmware.
[0095] The result determination module 404 is used to determine the firmware upgrade result of the firmware according to the firmware upgrade package information.
[0096] In an exemplary embodiment, the information grouping module 402 is specifically used to: group the firmware program information according to the image distribution of the firmware image distribution information to obtain firmware program grouping information; encrypt the firmware program grouping information to obtain firmware grouping encryption information; determine the target firmware grouping information according to the firmware grouping encryption information, the hash algorithm and the encryption algorithm.
[0097] In an exemplary embodiment, the information grouping module 402 is specifically used to: perform hash calculation based on the firmware group encryption information and the hash algorithm to obtain firmware summary data; sign the firmware summary data according to the encryption algorithm to obtain signature bytes; and append the signature bytes to the firmware group encryption information to obtain target firmware group information.
[0098] In an exemplary embodiment, the basic attribute information includes firmware model, firmware version, firmware starting position, firmware size, and firmware group number.
[0099] In an exemplary embodiment, the information determination module 403 is specifically used to: parse the target firmware grouping information to determine whether all firmware components in the target firmware grouping information have been upgraded; if all firmware components have been upgraded, parse to obtain firmware upgrade package information; if all firmware components have not been upgraded, determine whether an upgrade is required based on the firmware version; if it is determined that an upgrade is not required, continue to return to execute the step of determining whether all firmware components in the target firmware grouping information have been upgraded; if it is determined that an upgrade is required, determine whether all firmware packages have been upgraded based on the firmware model, firmware starting position, firmware size and number of firmware groups; if it is determined that all firmware packages have been upgraded, continue to return to execute the step of determining whether all firmware components in the target firmware grouping information have been upgraded; if it is determined that all firmware packages have not been upgraded, continue to return to execute the step of determining whether all firmware packages have been upgraded based on the firmware model, firmware starting position, firmware size and number of firmware groups.
[0100] In an example embodiment, the result determination module 404 is specifically used to: apply for a first target byte cache, parse the firmware upgrade package information using an encryption algorithm, obtain a signature parsing result, and store the signature parsing result in the first target byte cache; apply for a second target byte cache, parse the firmware upgrade package information using a hash algorithm, 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; if the signature parsing result is consistent with the firmware hash value, release the first target byte cache and the second target byte cache, apply for a third target byte cache, and determine whether the firmware upgrade package information is decrypted; if 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 the firmware upgrade result.
[0101] In an exemplary embodiment, the device further includes: an upgrade exception module. The upgrade exception module is used to: when the signature parsing result is inconsistent with the firmware hash value, issue a verification exception message; wherein the verification exception message is used to indicate that the firmware upgrade fails.
[0102] The device of this embodiment can be used to execute the method of any embodiment in the embodiment of the firmware upgrade method side. Its specific implementation process and technical effects are similar to those in the embodiment of the firmware upgrade method side. For details, please refer to the detailed description in the embodiment of the firmware upgrade method side, which will not be repeated here.
[0103] Figure 5 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 communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the firmware upgrade method, which includes: obtaining 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; grouping the firmware program information according to the image distribution of the firmware image distribution information to obtain the target firmware grouping information; determining the firmware upgrade package information according to the target firmware grouping information and the basic attribute information of the firmware; wherein the basic attribute information refers to the information describing the nature of the firmware; and determining the firmware upgrade result of the firmware according to the firmware upgrade package information.
[0104] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0105] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the firmware upgrade method provided by the above methods, which includes: obtaining 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; grouping the firmware program information according to the image distribution of the firmware image distribution information to obtain target firmware grouping information; determining the firmware upgrade package information according to 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; and determining the firmware upgrade result of the firmware according to the firmware upgrade package information.
[0106] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the firmware upgrade method provided by the above-mentioned methods, the method comprising: obtaining 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; grouping the firmware program information according to the image distribution of the firmware image distribution information to obtain target firmware grouping information; determining the firmware upgrade package information according to 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; and determining the firmware upgrade result of the firmware according to the firmware upgrade package information.
[0107] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0108] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0109] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A firmware upgrade method, characterized in that: include: Acquire 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; Grouping the firmware program information according to the image distribution of the firmware image distribution information to obtain target firmware grouping information; Determine the firmware upgrade package information according to 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; A firmware upgrade result of the firmware is determined according to the firmware upgrade package information.
2. The firmware upgrade method according to claim 1, characterized in that: The step of grouping the firmware program information according to the image distribution of the firmware image distribution information to obtain target firmware grouping information includes: Grouping the firmware program information according to the image distribution of the firmware image distribution information to obtain firmware program grouping information; Encrypting the firmware program group information to obtain firmware group encrypted information; The target firmware group information is determined according to the firmware group encryption information, a hash algorithm and an encryption algorithm.
3. The firmware upgrade method according to claim 2, characterized in that: The step of determining the target firmware group information according to the firmware group encryption information, a hash algorithm and an encryption algorithm comprises: Perform hash calculation according to the firmware group encryption information and the hash algorithm to obtain firmware summary data; Sign the firmware summary data according to the encryption algorithm to obtain a signature byte; The signature byte is appended to the firmware group encryption information to obtain the target firmware group information.
4. The firmware upgrade method according to claim 1, characterized in that: The basic attribute information includes firmware model, firmware version, firmware starting position, firmware size and firmware group number; The determining of 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 to determine whether all firmware components in the target firmware grouping information have been upgraded; When all the firmware components are upgraded, the firmware upgrade package information is obtained by parsing; If all the firmware components have not been upgraded, determining whether an upgrade is required according to the firmware version; If it is determined that no upgrade is required, continue to return to the step of determining whether all firmware components in the target firmware grouping information have been upgraded; If it is determined that an upgrade is required, determining whether all firmware packages have been upgraded according to the firmware model, the firmware starting position, the firmware size, and the number of firmware groups; In the case of determining that the upgrade of all the firmware packages is completed, continuing to return to the step of determining whether the upgrade of all the firmware components in the target firmware grouping information is completed; In the case where it is determined that all the firmware packages have not been upgraded, the step of returning to the step of determining whether all the firmware packages have been upgraded according to the firmware model, the firmware starting position, the firmware size and the number of firmware groups is continued.
5. The firmware upgrade method according to claim 1, characterized in that: The step of determining the firmware upgrade result of the firmware according to the firmware upgrade package information includes: Apply for a first target byte cache, parse the firmware upgrade package information using an encryption algorithm, obtain a signature parsing result, and store the signature parsing result in the first target byte cache; Apply for a second target byte cache, parse the firmware upgrade package information using a hash algorithm to obtain a firmware hash value, and store 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; When the signature parsing result is consistent with the firmware hash value, releasing the first target byte cache and the second target byte cache, applying for a third target byte cache, and determining whether the firmware upgrade package information is decrypted; When the decryption of the firmware upgrade package information is completed, the third target byte cache is released, and the upgrade process is started according to the upgrade algorithm to obtain the firmware upgrade result.
6. The firmware upgrade method according to claim 5, characterized in that: The method further comprises: In the case where 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.
7. A firmware upgrade device, characterized in that: include: An information acquisition module, used to acquire 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; An information grouping module, used for grouping the firmware program information according to the image distribution of the firmware image distribution information to obtain target firmware grouping information; An information determination module, used to determine the firmware upgrade package information according to 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; A result determination module is used to determine the firmware upgrade result of the firmware according to the firmware upgrade package information.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the firmware upgrade method according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the firmware upgrade method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the firmware upgrade method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Hard copy control system based on national commercial cipher algorithm
CN107124277A
Automatic packaging device for textile material rolls
CN112173203A
Equipment firmware upgrading method, device and system
CN114268614A
Firmware upgrading method and device based on GPU Box
CN115576585A
Multi-chip multi-channel remote upgrading method and system
CN117492798A