WO2022156512A1 - 一种固件更新方法、装置、设备及存储介质 - Google Patents

一种固件更新方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2022156512A1
WO2022156512A1 PCT/CN2021/143256 CN2021143256W WO2022156512A1 WO 2022156512 A1 WO2022156512 A1 WO 2022156512A1 CN 2021143256 W CN2021143256 W CN 2021143256W WO 2022156512 A1 WO2022156512 A1 WO 2022156512A1
Authority
WO
WIPO (PCT)
Prior art keywords
firmware
stored
current stage
updated
startup
Prior art date
Application number
PCT/CN2021/143256
Other languages
English (en)
French (fr)
Inventor
王宏伟
Original Assignee
浪潮电子信息产业股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 浪潮电子信息产业股份有限公司 filed Critical 浪潮电子信息产业股份有限公司
Publication of WO2022156512A1 publication Critical patent/WO2022156512A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Definitions

  • the present application relates to the technical field of software management, and more particularly, to a firmware update method, apparatus, device and storage medium.
  • the performance requirements of the basic server are getting higher and higher, so the importance of monitoring the whole machine of the basic server is more prominent.
  • the hardware implements a series of monitoring and control functions.
  • it is usually necessary to erase all the firmware of the BMC stored in the corresponding memory of the BMC, and then reprogram the new firmware, which not only takes a long time, usually 5 to 10 minutes, but also erases for a long time.
  • the stability of the memory will be greatly reduced. Therefore, the way of implementing the BMC update in the present application not only takes a long time to update the firmware, but also leads to poor stability of the memory used for storing the firmware.
  • the purpose of the present application is to provide a firmware update method, apparatus, device and storage medium, which can not only reduce firmware update time, but also improve the stability of a memory for storing firmware.
  • a firmware update method comprising:
  • Reading the pre-stored firmware corresponding to each startup stage is the firmware to be updated, and sequentially determining that each startup stage is the current stage;
  • the firmware to be stored in the current stage is consistent with the firmware to be updated. If the firmware to be stored is inconsistent with the firmware to be updated, the firmware to be updated at the current stage is replaced with the firmware to be stored at the current stage.
  • judging whether the firmware to be stored at the current stage is consistent with the firmware to be updated including:
  • the summary values of the firmware to be stored and the firmware to be updated at the current stage are obtained respectively, and it is determined whether the summary values of the firmware to be stored and the firmware to be updated at the current stage are consistent.
  • the summary values of the firmware to be stored and the firmware to be updated at the current stage are respectively obtained, including:
  • the method further includes:
  • the digest value of the firmware to be updated in the current stage is replaced with the digest value of the firmware to be stored in the current stage.
  • a summary calculation is performed on the firmware to be stored at the current stage to obtain a corresponding summary value, including:
  • the MD5 algorithm is used to perform digest calculation on the firmware to be stored at the current stage, and the corresponding digest value is obtained.
  • the firmware to be updated and the corresponding digest value of the current stage are replaced by the firmware to be stored and the corresponding digest value of the current stage, including:
  • the method further includes:
  • the memory is a ROM.
  • a firmware update device comprising:
  • an acquisition module configured to: determine each startup phase in the startup of the target module, and after the target module is started, acquire the firmware compiled in each startup phase of the target module in the current startup, all of which are firmware to be stored;
  • a reading module used for: reading the pre-stored firmware corresponding to each startup stage is the firmware to be updated, and sequentially determining that each startup stage is the current stage;
  • the update module is used to: after each determination of the current stage, determine whether the firmware to be stored in the current stage is consistent with the firmware to be updated, and if the firmware to be stored in the current stage is consistent with the firmware to be updated, there is no need to update the firmware to be updated in the current stage Firmware, if the firmware to be stored at the current stage is inconsistent with the firmware to be updated, the firmware to be updated at the current stage is replaced with the firmware to be stored at the current stage.
  • a firmware update device comprising:
  • the processor is configured to implement the steps of the firmware updating method according to any one of the above when executing the computer program.
  • a computer-readable storage medium storing a computer program on the computer-readable storage medium, when the computer program is executed by a processor, implements the steps of any of the above firmware updating methods.
  • the present application provides a firmware update method, device, device and storage medium.
  • the method includes: determining each startup stage in the startup of a target module, and after the target module is started, obtaining the current startup status of the target module.
  • the firmware compiled in each start-up stage is the firmware to be stored; the firmware corresponding to each start-up stage that is read in advance is the firmware to be updated, and each start-up stage is determined as the current stage in turn; each time the current stage is determined Then, determine whether the firmware to be stored at the current stage is consistent with the firmware to be updated. If the firmware to be stored at the current stage is consistent with the firmware to be updated, there is no need to update the firmware to be updated at the current stage.
  • the firmware compiled at each startup stage of the module in the current startup process is compared with the pre-stored corresponding firmware for each startup stage, and any startup is performed in the current startup process.
  • the firmware compiled at the stage is inconsistent with the pre-stored firmware corresponding to the arbitrary startup stage
  • the firmware compiled at the arbitrary startup stage in the current startup process is used to replace the pre-stored corresponding firmware, so as to realize the firmware update of the arbitrary startup stage.
  • the present application can respectively verify each startup stage in the startup process of modules such as BMC, and then only need to update the firmware in the corresponding startup stage based on the result of the verification, compared to the prior art, all firmware in the memory is wiped.
  • the update time can be effectively reduced, and the adverse impact on the stability of the memory caused by long-term erasing and programming can be avoided.
  • the method of implementing firmware update in the present application can not only reduce the firmware update time, but also The stability of the memory for storing firmware can be improved.
  • FIG. 1 is a flowchart of a method for updating firmware according to an embodiment of the present application
  • FIG. 2 is a flowchart of BMC startup in a method for updating firmware provided by an embodiment of the present application
  • FIG. 3 is a schematic diagram of firmware verification in a firmware update method provided by an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of a firmware updating apparatus according to an embodiment of the present application.
  • FIG. 1 shows a flowchart of a firmware update method provided by an embodiment of the present application, which may specifically include:
  • S11 Determine each startup stage in the startup of the target module, and after the target module is started, obtain the firmware compiled in each startup stage of the target module in the current startup, which are firmware to be stored.
  • the execution body of the firmware update method provided by the embodiment of the present application may be a corresponding firmware update apparatus.
  • the target module may be BMC, or may be other software or hardware, which are all within the protection scope of the present application.
  • the startup process of the target module may be divided into different stages, and these stages are all corresponding startup stages; the target module is the BMC for illustration, and the startup of the BMC may refer to the Linux system kernel system of the BMC.
  • Linux kernel (Linux-kernel, can be referred to as Linux kernel) startup, as shown in Figure 2, the startup stage included in the BMC startup process can be divided into uboot startup stage - kernel self-extraction stage - kernel boot stage - kernel initialization stage - busybox Initialization phase - app loading phase.
  • the firmware update method of the target module can be implemented according to the firmware updating method disclosed in the present application, and the firmware is the corresponding code or program; Corresponding firmware needs to be compiled in each startup stage of the startup process. Therefore, the embodiment of the present application can obtain firmware compiled by the target module in each startup stage, and then use the obtained firmware to implement firmware update of the target module in the future.
  • the firmware of the target module can be stored in a corresponding memory, and the embodiment of the present application can read the firmware of the target module from the memory, and then use the firmware compiled in the current startup process of the target module to store the target module in the memory. firmware update accordingly.
  • the firmware compiled at the arbitrary startup stage of the target module in the current startup can be compared with the firmware corresponding to the arbitrary startup stage stored in the memory.
  • the result of the consistency comparison indicates that the two are consistent, which means that the firmware of this arbitrary startup phase has not changed in the current startup, so there is no need to update the firmware of this arbitrary startup phase stored in the memory.
  • the correct result indicates that the two are inconsistent, indicating that the firmware of this arbitrary startup stage has changed in the current startup, so it is necessary to replace the arbitrary startup stage stored in the memory with the firmware compiled in this arbitrary startup stage in the current startup. corresponding firmware, so as to realize the update of the corresponding firmware in each startup phase.
  • the firmware compiled at each startup stage of the module in the current startup process is compared with the pre-stored corresponding firmware for each startup stage, and any startup is performed in the current startup process.
  • the firmware compiled at the stage is inconsistent with the pre-stored firmware corresponding to the arbitrary startup stage
  • the firmware compiled at the arbitrary startup stage in the current startup process is used to replace the pre-stored corresponding firmware, so as to realize the firmware update of the arbitrary startup stage.
  • the present application can respectively verify each startup stage in the startup process of modules such as BMC, and then only need to update the firmware in the corresponding startup stage based on the result of the verification, compared to the prior art, all firmware in the memory is wiped.
  • the update time can be effectively reduced, and the adverse impact on the stability of the memory caused by long-term erasing and programming can be avoided.
  • the method of implementing firmware update in the present application can not only reduce the firmware update time, but also The stability of the memory for storing firmware can be improved.
  • a method for updating firmware provided by an embodiment of the present application, for judging whether the firmware to be stored at the current stage is consistent with the firmware to be updated may include:
  • the summary values of the firmware to be stored and the firmware to be updated at the current stage are obtained respectively, and it is determined whether the summary values of the firmware to be stored and the firmware to be updated at the current stage are consistent.
  • the embodiment of the present application can obtain the summary values of the two firmwares, and then realize the two firmwares through the consistency comparison of the summary values. Consistency comparison of the two firmwares, that is, if the digest values of the two firmwares are the same, the two firmwares are the same; otherwise, the two firmwares are different.
  • Consistency comparison of the two firmwares that is, if the digest values of the two firmwares are the same, the two firmwares are the same; otherwise, the two firmwares are different.
  • a firmware update method provided by an embodiment of the present application may include:
  • the method may also include:
  • the digest value of the firmware to be updated in the current stage is replaced with the digest value of the firmware to be stored in the current stage.
  • the present application can program the digest values of the firmware into the memory at the same time each time the firmware is programmed into the memory, so that when needed, the digest values of the firmware can be directly downloaded from the memory.
  • the corresponding digest value is read from memory.
  • the MD5 Message-Digest Algorithm 5, Message Digest Algorithm 5
  • the MD5 algorithm may be used to realize, that is, the digest calculation is performed on the firmware to be stored at the current stage to obtain the corresponding digest value. , which may include: using the MD5 algorithm to perform a digest calculation on the firmware to be stored at the current stage to obtain a corresponding digest value.
  • the MD5 algorithm is used as a cryptographic hash function, and the digest value calculated when the digest value of the firmware is calculated by the MD5 algorithm can effectively reflect the characteristics of the corresponding firmware. Therefore, the embodiment of the present application uses the MD5 algorithm to realize the calculation of the digest value of the firmware, which can improve the utilization of the digest value. Consistency comparison implements the effectiveness of firmware consistency comparison.
  • a firmware update method provided by an embodiment of the present application using the firmware to be stored and the corresponding digest value of the current stage to replace the firmware to be updated and the corresponding digest value of the current stage, may include:
  • the replacement in the embodiment of the present application may be to mark the firmware to be stored with a valid mark, and mark the corresponding firmware to be updated with an invalid mark; If the firmware is incorrectly identified, the embodiment of the present application may directly erase the corresponding firmware to be updated from the memory, and program the firmware to be stored into the memory.
  • the memory can be ROM (Read-Only Memory, read-only memory) to effectively realize the storage of firmware and corresponding digest values; of course, other settings can also be made according to actual needs, all within the protection scope of this application .
  • the method may further include: outputting information that the firmware of the current phase has been updated. Wherein, outputting the corresponding information can output the information to the corresponding terminal, so that the terminal corresponding personnel can know the firmware update situation in time, so as to realize the corresponding use and other operations.
  • the target module is BMC.
  • the embodiment of the present application may perform MD5 consistency check on each startup stage respectively, and then based on the result of the check, only the firmware of the corresponding startup stage can be checked. Update; it is also possible to calculate and obtain the digest value of the firmware of each boot stage in the current boot target module, and then cache the digest value, so that when the consistency check between digest values needs to be performed, the data can be directly obtained from the cache. The desired digest value is sufficient.
  • the technical solution of the present application has strong reproducibility and expansibility, and in some scenarios where the software completion requirements are relatively high, the software can be subjected to staged MD5 consistency check and firmware update.
  • the embodiment of the present application also provides a firmware update device, as shown in FIG. 4 , which may include:
  • the obtaining module 11 is used to: determine each startup stage in the startup of the target module, and after the target module is started, obtain the firmware compiled in each startup stage of the target module in the current startup, which are the firmware to be stored;
  • the reading module 12 is used for: reading the pre-stored firmware corresponding to each startup stage is the firmware to be updated, and sequentially determining that each startup stage is the current stage;
  • the update module 13 is used for: after each determination of the current stage, to determine whether the firmware to be stored in the current stage is consistent with the firmware to be updated, and if the firmware to be stored in the current stage is consistent with the firmware to be updated, there is no need to update the firmware to be updated in the current stage.
  • the firmware is updated. If the firmware to be stored in the current stage is inconsistent with the firmware to be updated, the firmware to be updated in the current stage is replaced with the firmware to be stored in the current stage.
  • the update module may include:
  • the judging unit is configured to obtain the digest values of the firmware to be stored and the firmware to be updated at the current stage respectively, and to judge whether the digest values of the firmware to be stored and the firmware to be updated at the current stage are consistent.
  • the judging unit may include:
  • an obtaining unit used for: obtaining the digest value of the firmware to be updated in the current stage of storage, and performing a digest calculation on the firmware to be stored in the current stage to obtain the corresponding digest value;
  • the update module may be further configured to replace the digest value of the firmware to be updated in the current stage with the digest value of the firmware to be stored in the current stage while replacing the firmware to be updated in the current stage with the firmware to be stored in the current stage.
  • the obtaining unit may include:
  • the calculation unit is used for: using the MD5 algorithm to perform summary calculation on the firmware to be stored at the current stage, to obtain a corresponding summary value.
  • the update module may include:
  • the replacement unit is used for: erasing the firmware to be updated and the corresponding digest value of the current stage stored in the memory, and programming the firmware to be stored and the corresponding digest value of the current stage into the memory; wherein, the memory is used to store the The firmware corresponding to each boot phase and the memory of the corresponding digest value.
  • the output module is configured to: after replacing the firmware to be updated in the current stage with the firmware to be stored in the current stage, output the information that the firmware of the current stage has been updated.
  • the memory may be a ROM.
  • the embodiment of the present application also provides a firmware update device, which may include:
  • the processor is configured to implement the steps of any of the above firmware updating methods when executing the computer program.
  • Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of any of the above firmware update methods can be implemented.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

本申请公开了一种固件更新方法、装置、设备及存储介质,该方法包括:确定目标模块启动中的各启动阶段,在所述目标模块启动后,获取所述目标模块当前次启动中分别在各启动阶段编译得到的固件均为待存储固件;读取预先存储的分别与各启动阶段对应的固件均为待更新固件,并依次确定各启动阶段分别为当前阶段;在每次确定出当前阶段后,判断当前阶段的待存储固件与待更新固件是否一致,如果是,则无需更新当前阶段的待更新固件,否则,利用当前阶段的待存储固件替换当前阶段的待更新固件。本申请实现固件更新的方式不仅能够减少固件更新时间,且能够提高用于存储固件的存储器的稳定性。

Description

一种固件更新方法、装置、设备及存储介质
本申请要求在2021年01月22日提交中国专利局、申请号为202110090699.5、发明名称为“一种固件更新方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及软件管理技术领域,更具体地说,涉及一种固件更新方法、装置、设备及存储介质。
背景技术
互联网时代对基础服务器的性能要求越来越高,因此针对基础服务器整机监控的重要性显得比较突出,这就需要BMC(Baseboard Management Controller,基板管理控制器)这个平台管理系统对整个服务器的软硬件实现一系列的监视和控制功能。而在对BMC更新时,通常需要将所有存放在BMC对应存储器中的BMC的固件擦除,然后重新烧写新的固件,这样不仅时间很长,通常在5至10分钟,而且长时间的擦除和烧写,对于存储器的稳定性会大打折扣。因此,本申请实现BMC更新的方式不仅固件更新时间较长,且会导致用于存储固件的存储器稳定性较差。
发明内容
本申请的目的是提供一种固件更新方法、装置、设备及存储介质,不仅能够减少固件更新时间,且能够提高用于存储固件的存储器的稳定性。
为了实现上述目的,本申请提供如下技术方案:
一种固件更新方法,包括:
确定目标模块启动中的各启动阶段,在所述目标模块启动后,获取所述目标模块当前次启动中分别在各启动阶段编译得到的固件均为待存储固件;
读取预先存储的分别与各启动阶段对应的固件均为待更新固件,并依次确定各启动阶段分别为当前阶段;
在每次确定出当前阶段后,判断当前阶段的待存储固件与待更新固件是否一致,如果当前阶段的待存储固件与待更新固件一致,则无需更新当前阶段的待更新固件,如果当前阶段的待存储固件与待更新固件不一致,利用当前阶段的待存储固件替换当前阶段的待更新固件。
优选的,判断当前阶段的待存储固件与待更新固件是否一致,包括:
分别获取当前阶段的待存储固件及待更新固件的摘要值,并判断当前阶段的待存储固件及待更新固件的摘要值是否一致。
优选的,分别获取当前阶段的待存储固件及待更新固件的摘要值,包括:
获取存储的当前阶段的待更新固件的摘要值,并对当前阶段的待存储固件进行摘要计算得到相应摘要值;
相应的,所述方法还包括:
利用当前阶段的待存储固件替换当前阶段的待更新固件的同时,利用当前阶段的待存储固件的摘要值替换当前阶段的待更新固件的摘要值。
优选的,对当前阶段的待存储固件进行摘要计算得到相应摘要值,包括:
利用MD5算法对当前阶段的待存储固件进行摘要计算,得到相应摘要值。
优选的,利用当前阶段的待存储固件及相应摘要值替换当前阶段的待更新固件及相应摘要值,包括:
擦除存储器中存储的当前阶段的待更新固件及相应摘要值,并将当前阶段的待存储固件及相应摘要值烧写至所述存储器中;其中,所述存储器为用于存储分别与各启动阶段对应的固件及相应摘要值的存储器。
优选的,利用当前阶段的待存储固件替换当前阶段的待更新固件之后,还包括:
输出当前阶段的固件完成更新的信息。
优选的,所述存储器为ROM。
一种固件更新装置,包括:
获取模块,用于:确定目标模块启动中的各启动阶段,在所述目标模块启动后,获取所述目标模块当前次启动中分别在各启动阶段编译得到的固件均为待存储固件;
读取模块,用于:读取预先存储的分别与各启动阶段对应的固件均为待更新固件,并依次确定各启动阶段分别为当前阶段;
更新模块,用于:在每次确定出当前阶段后,判断当前阶段的待存储固件与待更新固件是否一致,如果当前阶段的待存储固件与待更新固件一致,则无需更新当前阶段的待更新固件,如果当前阶段的待存储固件与待更新固件不一致,利用当前阶段的待存储固件替换当前阶段的待更新固件。
一种固件更新设备,包括:
存储器,用于存储计算机程序;
处理器,用于执行所述计算机程序时实现如上任一项所述固件更新方法的步骤。
一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上任一项固件更新方法的步骤。
本申请提供了一种固件更新方法、装置、设备及存储介质,该方法包括:确定目标模块启动中的各启动阶段,在所述目标模块启动后,获取所述目标模块当前次启动中分别在各启动阶段编译得到的固件均为待存储固件;读取预先存储的分别与各启动阶段对应的固件均为待更新固件,并依次确定各启动阶段分别为当前阶段;在每次确定出当前阶段后,判断当前阶段的待存储固件与待更新固件是否一致,如果当前阶段的待存储固件与待更新固件一致,则无需更新当前阶段的待更新固件,如果当前阶段的待存储固件与待更新固件不一致,利用当前阶段的待存储固件替换当前阶段的待更新固件。本申请在BMC等模块每次启动完成后,将模块当前次启动过程中每个启动阶段编译得到的固件与预先存储的每个启动阶段对应固件进行比对,并在当前次启动过程中任意启动阶段编译得到的固件与预先存储的该任意启动阶段对应固件不一致时,利用当前次启动过程中该任意启动阶段编译得到的固件替换预先存储的相应固件,以实现该任意启动阶段的固件更新。可见,本申请能够对BMC等模块启动过程中各启动阶段分别进行校验,进而基于校验的结果仅需对相应启动阶段的固件进行更新,相对于现有技术中将存储器中的固件全部擦除再烧写的方式,能够有效减少更新时间,且避免长时间的擦除及烧写对存储器的稳定性造成不良影响;综上,本申请实现固件更新的方式不仅能够减少固件更新时间,且能够提高用于存储固件的存储器的稳定性。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。
图1为本申请实施例提供的一种固件更新方法的流程图;
图2为本申请实施例提供的一种固件更新方法中BMC启动流程图;
图3为本申请实施例提供的一种固件更新方法中固件校验示意图;
图4为本申请实施例提供的一种固件更新装置的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
请参阅图1,其示出了本申请实施例提供的一种固件更新方法的流程图,具体可以包括:
S11:确定目标模块启动中的各启动阶段,在目标模块启动后,获取目标模块当前次启动中分别在各启动阶段编译得到的固件均为待存储固件。
本申请实施例提供的一种固件更新方法的执行主体可以为对应的固件更新装置。其中,目标模块可以为BMC,也可以为其他软件或者硬件,均在本申请的保护范围之内。需要说明的是,本申请实施例可以将目标模块的启动过程划分为不同的阶段,这些阶段均为相应的启动阶段;以目标模块为BMC进行说明,BMC的启动可以指BMC的Linux系统内核系统(Linux-kernel,可简称为Linux内核)的启动,如图2所示,BMC的启动过程中包含的启动阶段可以分为uboot启动阶段-内核自解压阶段-内核引导阶段-内核初始化阶段-busybox初始化阶段-app加载阶段。
确定出目标模块启动中各启动阶段后,在目标模块每次启动之后均可以 按照本申请公开的固件更新方法实现目标模块的固件更新,固件为相应的代码或者说程序;具体来说,目标模块在启动过程中的每个启动阶段均需要编译相应的固件,因此本申请实施例可以获取目标模块在每个启动阶段编译得到的固件,进而在后续利用获取的固件实现目标模块的固件更新。
S12:读取预先存储的分别与各启动阶段对应的固件均为待更新固件,并依次确定各启动阶段分别为当前阶段。
目标模块的固件可以存储在相应的存储器中,本申请实施例可以从该存储器中读取目标模块的固件,进而在后续利用目标模块当前次启动过程中编译得到的固件对存储器中存储的目标模块的固件进行相应固件更新。
S13:在每次确定出当前阶段后,判断当前阶段的待存储固件与待更新固件是否一致,如果当前阶段的待存储固件与待更新固件一致,则无需更新当前阶段的待更新固件,如果当前阶段的待存储固件与待更新固件不一致,利用当前阶段的待存储固件替换当前阶段的待更新固件。
对于目标模块启动中每个启动阶段的任意启动阶段,可以将目标模块当前次启动中在该任意启动阶段编译得到的固件与存储器中存储的该任意启动阶段对应的固件进行一致性比对,如果一致性比对的结果表示两者是一致的,则说明该任意启动阶段的固件并未在当前次启动中未发生变化,因此无需更新存储器中存储的该任意启动阶段的固件,如果一致性比对的结果表示两者是不一致的,说明该任意启动阶段的固件在当前次启动中发生变化,因此需要利用当前次启动中在该任意启动阶段编译得到的固件替换存储器中存储的该任意启动阶段对应的固件,从而实现每个启动阶段对应固件的更新。
本申请在BMC等模块每次启动完成后,将模块当前次启动过程中每个启动阶段编译得到的固件与预先存储的每个启动阶段对应固件进行比对,并在当前次启动过程中任意启动阶段编译得到的固件与预先存储的该任意启动阶段对应固件不一致时,利用当前次启动过程中该任意启动阶段编译得到的固件替换预先存储的相应固件,以实现该任意启动阶段的固件更新。可见,本申请能够对BMC等模块启动过程中各启动阶段分别进行校验,进而基于校验的结果仅需对相应启动阶段的固件进行更新,相对于现有技术中将存储器中的固件全部擦除再烧写的方式,能够有效减少更新时间,且避免长时间的擦除及烧写对存储器的稳定性造成不良影响;综上,本申请实现固件更新的方 式不仅能够减少固件更新时间,且能够提高用于存储固件的存储器的稳定性。
本申请实施例提供的一种固件更新方法,判断当前阶段的待存储固件与待更新固件是否一致,可以包括:
分别获取当前阶段的待存储固件及待更新固件的摘要值,并判断当前阶段的待存储固件及待更新固件的摘要值是否一致。
为了提高比对同一启动阶段的待存储固件及待更新固件是否一致的比对速度,本申请实施例可以获取这两个固件的摘要值,进而通过摘要值的一致性比对实现这两个固件的一致性比对,也即如果这两个固件的摘要值相同,则说明这两个固件相同,否则说明这两个固件不相同。当然根据实际需要进行的其他设定,也均在本申请的保护范围之内。
本申请实施例提供的一种固件更新方法,分别获取当前阶段的待存储固件及待更新固件的摘要值,可以包括:
获取存储的当前阶段的待更新固件的摘要值,并对当前阶段的待存储固件进行摘要计算得到相应摘要值;
相应的,方法还可以包括:
利用当前阶段的待存储固件替换当前阶段的待更新固件的同时,利用当前阶段的待存储固件的摘要值替换当前阶段的待更新固件的摘要值。
为了进一步方便对于不同固件的摘要值的比对,本申请可以在每次向存储器中烧写固件的同时,将该固件的摘要值也一同烧写至存储器中,从而使得在需要时能够直接从存储器中读取相应的摘要值。另外,本申请实施例在计算固件的摘要值时可以是利用MD5(Message-Digest Algorithm 5,报文摘要算法5)算法实现的,也即对当前阶段的待存储固件进行摘要计算得到相应摘要值,可以包括:利用MD5算法对当前阶段的待存储固件进行摘要计算,得到相应摘要值。MD5算法作为密码散列函数,利用MD5算法计算固件的摘要值时计算所得的摘要值能够有效体现对应固件的特点,因此本申请实施例利用MD5算法实现固件摘要值的计算,能够提高利用摘要值一致性比对实现固件一致性比对时的有效性。
本申请实施例提供的一种固件更新方法,利用当前阶段的待存储固件及相应摘要值替换当前阶段的待更新固件及相应摘要值,可以包括:
擦除存储器中存储的当前阶段的待更新固件及相应摘要值,并将当前阶 段的待存储固件及相应摘要值烧写至存储器中;其中,存储器为用于存储分别与各启动阶段对应的固件及相应摘要值的存储器。
本申请实施例中的替换可以是将待存储固件标上有效的标识,而将相应待更新固件标上无效的标识;但是在另一种优选的实施方式中,为了避免因标识识别错误导致的固件识别错误,本申请实施例可以直接将相应待更新固件从存储器中擦除,而将待存储固件烧写至存储器中。具体来说,存储器可以为ROM(Read-Only Memory,只读存储器),以有效实现固件及相应摘要值的存储;当然也可以根据实际需要进行其他设定,均在本申请的保护范围之内。
本申请实施例提供的一种固件更新方法,利用当前阶段的待存储固件替换当前阶段的待更新固件之后,还可以包括:输出当前阶段的固件完成更新的信息。其中,输出相应信息可以将该信息输出至相应的终端,以使得终端对应人员能够及时获知固件更新的情况,进而实现相应的使用等操作。
在一种具体实施方式中,目标模块为BMC,如图3所示,本申请实施例可以对每个启动阶段分别进行MD5一致性校验,进而基于校验的结果仅对相应启动阶段的固件进行更新;还可以计算得到当前次启动目标模块中每个启动阶段的固件的摘要值后对摘要值进行缓存,从而在需要进行摘要值之间的一致性校验时,直接从缓存中获取所需的摘要值即可。综上,本申请实施例通过对BMC固件的不同启动阶段进行MD5一致性校验,实现进行分阶段固件的擦除和烧写,避免整体固件的擦除和烧写,达到提升BMC固件刷新速度的目的;另外,本申请技术方案具有很强的可复制性和拓展性,在一些对软件完成性要求比较高得场景下,均可对软件进行分阶段的MD5一致性校验及固件更新。
本申请实施例还提供了一种固件更新装置,如图4所示,可以包括:
获取模块11,用于:确定目标模块启动中的各启动阶段,在目标模块启动后,获取目标模块当前次启动中分别在各启动阶段编译得到的固件均为待存储固件;
读取模块12,用于:读取预先存储的分别与各启动阶段对应的固件均为待更新固件,并依次确定各启动阶段分别为当前阶段;
更新模块13,用于:在每次确定出当前阶段后,判断当前阶段的待存储 固件与待更新固件是否一致,如果当前阶段的待存储固件与待更新固件一致,则无需更新当前阶段的待更新固件,如果当前阶段的待存储固件与待更新固件不一致,利用当前阶段的待存储固件替换当前阶段的待更新固件。
本申请实施例提供的一种固件更新装置,更新模块可以包括:
判断单元,用于:分别获取当前阶段的待存储固件及待更新固件的摘要值,并判断当前阶段的待存储固件及待更新固件的摘要值是否一致。
本申请实施例提供的一种固件更新装置,判断单元可以包括:
获取单元,用于:获取存储的当前阶段的待更新固件的摘要值,并对当前阶段的待存储固件进行摘要计算得到相应摘要值;
相应的,更新模块还可以用于:利用当前阶段的待存储固件替换当前阶段的待更新固件的同时,利用当前阶段的待存储固件的摘要值替换当前阶段的待更新固件的摘要值。
本申请实施例提供的一种固件更新装置,获取单元可以包括:
计算单元,用于:利用MD5算法对当前阶段的待存储固件进行摘要计算,得到相应摘要值。
本申请实施例提供的一种固件更新装置,更新模块可以包括:
替换单元,用于:擦除存储器中存储的当前阶段的待更新固件及相应摘要值,并将当前阶段的待存储固件及相应摘要值烧写至存储器中;其中,存储器为用于存储分别与各启动阶段对应的固件及相应摘要值的存储器。
本申请实施例提供的一种固件更新装置,还可以包括:
输出模块,用于:利用当前阶段的待存储固件替换当前阶段的待更新固件之后,输出当前阶段的固件完成更新的信息。
本申请实施例提供的一种固件更新装置,存储器可以为ROM。
本申请实施例还提供了一种固件更新设备,可以包括:
存储器,用于存储计算机程序;
处理器,用于执行计算机程序时实现如上任一项固件更新方法的步骤。
本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时可以实现如上任一项固件更新方法的步骤。
需要说明的是,本申请实施例提供的一种固件更新装置、设备及存储介 质中相关部分的说明请参见本申请实施例提供的一种固件更新方法中对应部分的详细说明,在此不再赘述。另外本申请实施例提供的上述技术方案中与现有技术中对应技术方案实现原理一致的部分并未详细说明,以免过多赘述。
对所公开的实施例的上述说明,使本领域技术人员能够实现或使用本申请。对这些实施例的多种修改对本领域技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。

Claims (10)

  1. 一种固件更新方法,其特征在于,包括:
    确定目标模块启动中的各启动阶段,在所述目标模块启动后,获取所述目标模块当前次启动中分别在各启动阶段编译得到的固件均为待存储固件;
    读取预先存储的分别与各启动阶段对应的固件均为待更新固件,并依次确定各启动阶段分别为当前阶段;
    在每次确定出当前阶段后,判断当前阶段的待存储固件与待更新固件是否一致,如果当前阶段的待存储固件与待更新固件一致,则无需更新当前阶段的待更新固件,如果当前阶段的待存储固件与待更新固件不一致,利用当前阶段的待存储固件替换当前阶段的待更新固件。
  2. 根据权利要求1所述的方法,其特征在于,判断当前阶段的待存储固件与待更新固件是否一致,包括:
    分别获取当前阶段的待存储固件及待更新固件的摘要值,并判断当前阶段的待存储固件及待更新固件的摘要值是否一致。
  3. 根据权利要求2所述的方法,其特征在于,分别获取当前阶段的待存储固件及待更新固件的摘要值,包括:
    获取存储的当前阶段的待更新固件的摘要值,并对当前阶段的待存储固件进行摘要计算得到相应摘要值;
    相应的,所述方法还包括:
    利用当前阶段的待存储固件替换当前阶段的待更新固件的同时,利用当前阶段的待存储固件的摘要值替换当前阶段的待更新固件的摘要值。
  4. 根据权利要求3所述的方法,其特征在于,对当前阶段的待存储固件进行摘要计算得到相应摘要值,包括:
    利用MD5算法对当前阶段的待存储固件进行摘要计算,得到相应摘要值。
  5. 根据权利要求4所述的方法,其特征在于,利用当前阶段的待存储固件及相应摘要值替换当前阶段的待更新固件及相应摘要值,包括:
    擦除存储器中存储的当前阶段的待更新固件及相应摘要值,并将当前阶段的待存储固件及相应摘要值烧写至所述存储器中;其中,所述存储器为用于存储分别与各启动阶段对应的固件及相应摘要值的存储器。
  6. 根据权利要求5所述的方法,其特征在于,利用当前阶段的待存储固件替换当前阶段的待更新固件之后,还包括:
    输出当前阶段的固件完成更新的信息。
  7. 根据权利要求6所述的方法,其特征在于,所述存储器为ROM。
  8. 一种固件更新装置,其特征在于,包括:
    获取模块,用于:确定目标模块启动中的各启动阶段,在所述目标模块启动后,获取所述目标模块当前次启动中分别在各启动阶段编译得到的固件均为待存储固件;
    读取模块,用于:读取预先存储的分别与各启动阶段对应的固件均为待更新固件,并依次确定各启动阶段分别为当前阶段;
    更新模块,用于:在每次确定出当前阶段后,判断当前阶段的待存储固件与待更新固件是否一致,如果当前阶段的待存储固件与待更新固件一致,则无需更新当前阶段的待更新固件,如果当前阶段的待存储固件与待更新固件不一致,利用当前阶段的待存储固件替换当前阶段的待更新固件。
  9. 一种固件更新设备,其特征在于,包括:
    存储器,用于存储计算机程序;
    处理器,用于执行所述计算机程序时实现如权利要求1至7任一项所述固件更新方法的步骤。
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述固件更新方法的步骤。
PCT/CN2021/143256 2021-01-22 2021-12-30 一种固件更新方法、装置、设备及存储介质 WO2022156512A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110090699.5 2021-01-22
CN202110090699.5A CN112835601A (zh) 2021-01-22 2021-01-22 一种固件更新方法、装置、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2022156512A1 true WO2022156512A1 (zh) 2022-07-28

Family

ID=75931090

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/143256 WO2022156512A1 (zh) 2021-01-22 2021-12-30 一种固件更新方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN112835601A (zh)
WO (1) WO2022156512A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115827032A (zh) * 2022-12-12 2023-03-21 深微光电科技(深圳)有限公司 存储器的烧录方法、装置、电子设备及存储介质

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112835601A (zh) * 2021-01-22 2021-05-25 浪潮电子信息产业股份有限公司 一种固件更新方法、装置、设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109446011A (zh) * 2018-11-01 2019-03-08 郑州云海信息技术有限公司 一种硬盘的固件安全测试方法、装置及存储介质
US20200143057A1 (en) * 2018-11-07 2020-05-07 Dell Products L.P. Staging memory for accessory firmware update
CN111324366A (zh) * 2020-02-14 2020-06-23 苏州浪潮智能科技有限公司 一种bmc启动固件回滚方法、装置、bmc及存储介质
CN111880819A (zh) * 2020-07-29 2020-11-03 北京浪潮数据技术有限公司 一种存储设备固件升级方法、系统、设备及计算机介质
CN112835601A (zh) * 2021-01-22 2021-05-25 浪潮电子信息产业股份有限公司 一种固件更新方法、装置、设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109446011A (zh) * 2018-11-01 2019-03-08 郑州云海信息技术有限公司 一种硬盘的固件安全测试方法、装置及存储介质
US20200143057A1 (en) * 2018-11-07 2020-05-07 Dell Products L.P. Staging memory for accessory firmware update
CN111324366A (zh) * 2020-02-14 2020-06-23 苏州浪潮智能科技有限公司 一种bmc启动固件回滚方法、装置、bmc及存储介质
CN111880819A (zh) * 2020-07-29 2020-11-03 北京浪潮数据技术有限公司 一种存储设备固件升级方法、系统、设备及计算机介质
CN112835601A (zh) * 2021-01-22 2021-05-25 浪潮电子信息产业股份有限公司 一种固件更新方法、装置、设备及存储介质

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115827032A (zh) * 2022-12-12 2023-03-21 深微光电科技(深圳)有限公司 存储器的烧录方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN112835601A (zh) 2021-05-25

Similar Documents

Publication Publication Date Title
US20110320794A1 (en) Flash System And Method For Updating The Flash System
WO2022156512A1 (zh) 一种固件更新方法、装置、设备及存储介质
US11995427B2 (en) Method, apparatus, device, and storage medium for upgrading vehicle-mounted Tbox
CN101807152B (zh) 自我验证选择只读存储器的基本输出入系统及其验证方法
WO2016179957A1 (zh) 一种应用程序的修复方法、装置和存储介质
CN113767365A (zh) 通信模块软件升级方法、系统及通信模块
TWI805946B (zh) 內嵌式系統及控制非揮發性記憶體之方法
EP4075309A1 (en) Secure boot device
CN112433769A (zh) 一种bmc启动方法、装置、计算机设备及存储介质
CN110737449A (zh) 用于处理设备固件的方法、装置和机器可读存储介质
CN116932010B (zh) 系统固件升级方法、装置及服务器
CN113110891B (zh) 固态硬盘的固件加载方法、装置、计算机设备及存储介质
CN111124509B (zh) 一种服务器启动方法与装置
CN109375953B (zh) 一种操作系统启动方法及装置
TWI663509B (zh) 系統資訊管理方法
CN111142922A (zh) 应用程序更新方法、装置、终端及服务器
CN113220319A (zh) 一种数据更新方法、装置及车辆
CN117608627A (zh) 升级固件的方法、电子设备和存储介质
CN116126379A (zh) 一种bios固件升级方法、装置、设备及存储介质
JP6708596B2 (ja) 電子制御装置及び制御プログラム検証方法
CN117687695A (zh) 信息处理方法、装置、电子设备及存储介质
CN116755735A (zh) 嵌入式软件在线升级方法、装置、腹膜透析仪、存储介质
CN112667444A (zh) 一种系统升级方法、存储介质及终端设备
CN115291957B (zh) 多处理器主板的初始化方法和装置
US20230418591A1 (en) Firmware update method of a flash bootloader in a micro controller unit for a vehicle

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21920883

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21920883

Country of ref document: EP

Kind code of ref document: A1