CN108958782A - A kind of firmware upgrade method and device - Google Patents
A kind of firmware upgrade method and device Download PDFInfo
- Publication number
- CN108958782A CN108958782A CN201810805403.1A CN201810805403A CN108958782A CN 108958782 A CN108958782 A CN 108958782A CN 201810805403 A CN201810805403 A CN 201810805403A CN 108958782 A CN108958782 A CN 108958782A
- Authority
- CN
- China
- Prior art keywords
- firmware
- slot
- target
- slots
- firmware slot
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
- G06F8/654—Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
本申请公开了一种固件升级方法及装置,包括:获取目标固态硬盘SSD的固件槽位数目;若所述固件槽位数目大于2,则从备选固件槽位中确定目标固件槽位;其中,所述备选固件槽位为除固件槽位1之外的固件槽位;将目标镜像文件复制到所述目标固件槽位上,利用所述目标固件槽位完成固件升级。由此可见,利用本申请实施例提供的方案,当存在多个固件槽位时,并不是如现有技术中那样每次都利用固件槽位1进行固件升级,而是从除固件槽位1之外的固件槽位中选择一个目标固件槽位,利用该目标固件槽位进行固件升级。从而避免了每次固件升级都利用固件槽位1进行升级,一旦该次固件升级失败,则有一定风险导致固件损坏,最终致使该目标固态硬盘SSD不可用的问题。
The present application discloses a firmware upgrade method and device, including: obtaining the number of firmware slots of the target solid-state hard drive SSD; if the number of firmware slots is greater than 2, determining the target firmware slot from the alternative firmware slots; wherein , the candidate firmware slot is a firmware slot other than firmware slot 1; copy the target image file to the target firmware slot, and use the target firmware slot to complete the firmware upgrade. It can be seen that, using the solution provided by the embodiment of the present application, when there are multiple firmware slots, instead of using firmware slot 1 for firmware upgrade every time as in the prior art, the Select a target firmware slot from other firmware slots, and use this target firmware slot to upgrade the firmware. This avoids the problem that firmware slot 1 is used for each firmware upgrade. Once the firmware upgrade fails, there is a certain risk that the firmware will be damaged, and eventually the target solid state drive SSD will be unavailable.
Description
技术领域technical field
本申请涉及计算机领域,特别是涉及一种固件升级方法及装置。The present application relates to the field of computers, in particular to a method and device for upgrading firmware.
背景技术Background technique
随着计算机技术的发展,市场上出现了固态硬盘(Solid State Drives,SSD),SSD在出厂时,其内部芯片默认搭载着厂商开发的固件程序,以满足客户端相关驱动程序对SSD的读写访问。With the development of computer technology, Solid State Drives (SSD) have appeared on the market. When the SSD leaves the factory, its internal chip is equipped with a firmware program developed by the manufacturer by default to meet the requirements of the client-related driver program for reading and writing the SSD. access.
但是,在实际使用过程中,有时需要对SSD的固件程序进行升级操作,将SSD的固件程序升级到新版本,以修复旧版本固件中存在的相关bug、优化固件性能或满足新的功能新需求等。However, in actual use, sometimes it is necessary to upgrade the firmware program of the SSD, and upgrade the firmware program of the SSD to a new version to fix related bugs in the old version firmware, optimize firmware performance or meet new functions and new requirements Wait.
对SSD进行固件升级时,需要将固件镜像文件拷贝到指定的固件槽位(英文:Firmware Slot)上,以完成固件升级。其中,固件槽位是用于存放镜像文件的地方。When upgrading the firmware of the SSD, the firmware image file needs to be copied to the designated firmware slot (English: Firmware Slot) to complete the firmware upgrade. Among them, the firmware slot is a place for storing image files.
一些SSD可以有多个固件槽位,即可以搭载多个固件。客户端可以指定本次固件升级需要使用哪个固件槽位,即将目标镜像文件存放在哪个固件槽位上,以完成固件升级。Some SSDs can have multiple firmware slots, that is, they can carry multiple firmwares. The client can specify which firmware slot needs to be used for this firmware upgrade, that is, which firmware slot the target image file should be stored in to complete the firmware upgrade.
目前一般都默认利用固件槽位1进行升级。但是如果每次固件升级都利用固件槽位1进行升级,一旦该次固件升级失败,则有一定风险导致固件损坏,最终致使该SSD不可用。At present, firmware slot 1 is generally used for upgrading by default. However, if firmware slot 1 is used for each firmware upgrade, once the firmware upgrade fails, there is a certain risk that the firmware will be damaged and eventually the SSD will be unusable.
因此,需要提供一种方案,能够避免固件升级失败导致的SSD不可用的问题。Therefore, it is necessary to provide a solution that can avoid the problem that the SSD is unavailable due to firmware upgrade failure.
发明内容Contents of the invention
本申请所要解决的技术问题是如何避免固件升级失败导致的SSD不可用的问题,提供一种固件升级方法及装置。The technical problem to be solved in this application is how to avoid the problem of unusable SSD caused by firmware upgrade failure, and provide a firmware upgrade method and device.
第一方面,本申请实施例提供一种固件升级方法,包括:In the first aspect, the embodiment of the present application provides a firmware upgrade method, including:
获取目标固态硬盘SSD的固件槽位数目;Obtain the number of firmware slots of the target solid state drive SSD;
若所述固件槽位数目大于2,则从备选固件槽位中确定目标固件槽位;其中,所述备选固件槽位为除固件槽位1之外的固件槽位;If the number of the firmware slots is greater than 2, then determine the target firmware slot from the alternative firmware slots; wherein, the alternative firmware slots are firmware slots other than firmware slot 1;
利用所述目标固件槽位完成固件升级。Firmware upgrade is completed by using the target firmware slot.
可选的,所述从备选固件槽位中确定目标固件槽位,包括:Optionally, the determining the target firmware slot from the candidate firmware slots includes:
获取所述目标固态硬盘SSD当前运行的固件所在的第一固件槽位;Obtain the first firmware slot where the firmware currently running on the target solid-state disk SSD is located;
从所述备选槽位中去除所述第一固件槽位中的其它固件槽位中确定所述目标固件槽位。The target firmware slot is determined from other firmware slots except the first firmware slot from the candidate slots.
可选的,若所述固件槽位数目为2,所述方法还包括:Optionally, if the number of firmware slots is 2, the method further includes:
获取所述目标固态硬盘SSD当前运行的固件所在的第二固件槽位;Obtain the second firmware slot where the firmware currently running on the target solid state disk SSD is located;
若所述第二固件槽位为固件槽位1,则将所述固件槽位2确定为所述目标固件槽位;If the second firmware slot is firmware slot 1, then determine the firmware slot 2 as the target firmware slot;
若所述第二固件槽位为固件槽位2,则获取所述固件槽位1的读写属性;If the second firmware slot is firmware slot 2, then obtain the read-write attribute of the firmware slot 1;
若所述固件槽位1的读写属性为可读可写,则将所述固件槽位1确定为所述目标固件槽位。If the read/write attribute of the firmware slot 1 is readable and writable, then determine the firmware slot 1 as the target firmware slot.
可选的,所述方法还包括:Optionally, the method also includes:
若所述固件槽位1的读写属性为只读,则将所述固件槽位2确定为所述目标固件槽位。If the read-write attribute of the firmware slot 1 is read-only, then determine the firmware slot 2 as the target firmware slot.
可选的,若所述固件槽位数目为1,所述方法还包括:Optionally, if the number of firmware slots is 1, the method further includes:
获取所述固件槽位1的读写属性;Obtain the read-write attribute of the firmware slot 1;
若所述固件槽位1的读写属性为可读可写,则将所述固件槽位1确定为所述目标固件槽位。If the read/write attribute of the firmware slot 1 is readable and writable, then determine the firmware slot 1 as the target firmware slot.
可选的,所述目标固态硬盘SSD包括:Optionally, the target solid-state disk SSD includes:
非易失性内存主机控制器接口规范NVMe固态硬盘SSD。Non-Volatile Memory Host Controller Interface Specification NVMe Solid State Drive SSD.
第二方面,本申请实施例提供一种固件升级装置,包括:In a second aspect, the embodiment of the present application provides a firmware upgrade device, including:
第一获取单元,用于获取目标固态硬盘SSD的固件槽位数目;The first obtaining unit is used to obtain the number of firmware slots of the target solid state disk SSD;
第一确定单元,用于若所述固件槽位数目大于2,则从备选固件槽位中确定目标固件槽位;其中,所述备选固件槽位为除固件槽位1之外的固件槽位;The first determining unit is used to determine the target firmware slot from the candidate firmware slots if the number of the firmware slots is greater than 2; wherein the candidate firmware slots are firmware other than firmware slot 1 slot;
升级单元,用于利用所述目标固件槽位完成固件升级。The upgrade unit is configured to use the target firmware slot to complete firmware upgrade.
可选的,所述第一确定单元,具体用于:Optionally, the first determining unit is specifically used for:
获取所述目标固态硬盘SSD当前运行的固件所在的第一固件槽位;Obtain the first firmware slot where the firmware currently running on the target solid-state disk SSD is located;
从所述备选槽位中去除所述第一固件槽位中的其它固件槽位中确定所述目标固件槽位。The target firmware slot is determined from other firmware slots except the first firmware slot from the candidate slots.
可选的,若所述固件槽位数目为2,所述装置还包括:Optionally, if the number of firmware slots is 2, the device further includes:
第二获取单元,用于获取所述目标固态硬盘SSD当前运行的固件所在的第二固件槽位;The second obtaining unit is used to obtain the second firmware slot where the firmware currently running on the target solid state disk SSD is located;
第二确定单元,用于若所述第二固件槽位为固件槽位1,则将所述固件槽位2确定为所述目标固件槽位;The second determining unit is configured to determine the firmware slot 2 as the target firmware slot if the second firmware slot is firmware slot 1;
第三获取单元,用于若所述第二固件槽位为固件槽位2,则获取所述固件槽位1的读写属性;A third acquiring unit, configured to acquire the read-write attribute of the firmware slot 1 if the second firmware slot is firmware slot 2;
第三确定单元,用于若所述固件槽位1的读写属性为可读可写,则将所述固件槽位1确定为所述目标固件槽位。The third determining unit is configured to determine the firmware slot 1 as the target firmware slot if the read/write attribute of the firmware slot 1 is readable and writable.
可选的,所述装置还包括:Optionally, the device also includes:
第四确定单元,用于若所述固件槽位1的读写属性为只读,则将所述固件槽位2确定为所述目标固件槽位。The fourth determining unit is configured to determine the firmware slot 2 as the target firmware slot if the read-write attribute of the firmware slot 1 is read-only.
可选的,若所述固件槽位数目为1,所述装置还包括:Optionally, if the number of firmware slots is 1, the device further includes:
第四获取单元,用于获取所述固件槽位1的读写属性;A fourth acquiring unit, configured to acquire the read-write attribute of the firmware slot 1;
第五确定单元,用于若所述固件槽位1的读写属性为可读可写,则将所述固件槽位1确定为所述目标固件槽位。The fifth determining unit is configured to determine the firmware slot 1 as the target firmware slot if the read/write attribute of the firmware slot 1 is readable and writable.
可选的,所述目标固态硬盘SSD包括:Optionally, the target solid-state disk SSD includes:
非易失性内存主机控制器接口规范NVMe固态硬盘SSD。Non-Volatile Memory Host Controller Interface Specification NVMe Solid State Drive SSD.
与现有技术相比,本申请实施例具有以下优点:Compared with the prior art, the embodiment of the present application has the following advantages:
本申请实施例提供的固件升级方法及装置,包括:获取目标固态硬盘SSD的固件槽位数目;若所述固件槽位数目大于2,则从备选固件槽位中确定目标固件槽位;其中,所述备选固件槽位为除固件槽位1之外的固件槽位;将目标镜像文件复制到所述目标固件槽位上,利用所述目标固件槽位完成固件升级。由此可见,利用本申请实施例提供的固件升级方法及装置,当存在多个固件槽位时,并不是如现有技术中那样每次都利用固件槽位1进行固件升级,而是从除固件槽位1之外的固件槽位中选择一个目标固件槽位,利用该目标固件槽位进行固件升级。从而避免了每次固件升级都利用固件槽位1进行升级,一旦该次固件升级失败,则有一定风险导致固件损坏,最终致使该目标固态硬盘SSD不可用的问题。The firmware upgrade method and device provided in the embodiments of the present application include: obtaining the number of firmware slots of the target solid-state hard drive SSD; if the number of firmware slots is greater than 2, then determining the target firmware slot from the alternative firmware slots; wherein , the candidate firmware slot is a firmware slot other than firmware slot 1; copy the target image file to the target firmware slot, and use the target firmware slot to complete the firmware upgrade. It can be seen that, using the firmware upgrade method and device provided by the embodiment of the present application, when there are multiple firmware slots, the firmware upgrade is not performed every time using firmware slot 1 as in the prior art. Select a target firmware slot from the firmware slots other than firmware slot 1, and use the target firmware slot to upgrade the firmware. This avoids the problem that firmware slot 1 is used for each firmware upgrade. Once the firmware upgrade fails, there is a certain risk that the firmware will be damaged, and eventually the target solid state drive SSD will be unavailable.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments described in this application. Those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1为本申请实施例提供的一种固件升级方法的流程示意图;FIG. 1 is a schematic flow diagram of a firmware upgrade method provided in an embodiment of the present application;
图2为本申请实施例提供的一种确定目标固件槽位的方法的流程示意图;FIG. 2 is a schematic flowchart of a method for determining a target firmware slot provided by an embodiment of the present application;
图3为本申请实施例提供的又一种确定目标固件槽位的方法的流程示意图;FIG. 3 is a schematic flowchart of another method for determining a target firmware slot provided by an embodiment of the present application;
图4为本申请实施例提供的一种固件升级的装置的结构示意图。FIG. 4 is a schematic structural diagram of a device for upgrading firmware provided by an embodiment of the present application.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiment of the application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiment of the application. Obviously, the described embodiment is only It is a part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.
本申请的发明人经过研究发现,在SSD的使用过程中,有时需要对SSD的固件程序进行升级操作,将SSD的固件程序升级到新版本,以修复旧版本固件中存在的相关bug、优化固件性能或满足新的功能新需求等。The inventor of the present application found through research that during the use of the SSD, sometimes it is necessary to upgrade the firmware program of the SSD to a new version, so as to repair related bugs existing in the old version firmware and optimize the firmware. performance or to meet new functional requirements, etc.
对SSD进行固件升级时,需要将固件镜像文件拷贝到指定的固件槽位(英文:Firmware Slot)上,以完成固件升级。其中,固件槽位是用于存放镜像文件的地方。When upgrading the firmware of the SSD, the firmware image file needs to be copied to the designated firmware slot (English: Firmware Slot) to complete the firmware upgrade. Among them, the firmware slot is a place for storing image files.
一些SSD可以有多个固件槽位,即可以搭载多个固件。客户端可以指定本次固件升级需要使用哪个固件槽位,即将目标镜像文件存放在哪个固件槽位上,以完成固件升级。Some SSDs can have multiple firmware slots, that is, they can carry multiple firmwares. The client can specify which firmware slot needs to be used for this firmware upgrade, that is, which firmware slot the target image file should be stored in to complete the firmware upgrade.
但是,目前一般都默认利用固件槽位1进行升级。但是如果每次固件升级都利用固件槽位1进行升级,一旦该次固件升级失败,则有一定风险导致固件损坏,最终致使该SSD不可用。However, at present, firmware slot 1 is generally used for upgrading by default. However, if firmware slot 1 is used for each firmware upgrade, once the firmware upgrade fails, there is a certain risk that the firmware will be damaged and eventually the SSD will be unusable.
鉴于此,本申请实施例提供一种固件升级方法及装置,包括:获取目标固态硬盘SSD的固件槽位数目;若所述固件槽位数目大于2,则从备选固件槽位中确定目标固件槽位;其中,所述备选固件槽位为除固件槽位1之外的固件槽位;将目标镜像文件复制到所述目标固件槽位上,利用所述目标固件槽位完成固件升级。由此可见,利用本申请实施例提供的固件升级方法及装置,当存在多个固件槽位时,并不是如现有技术中那样每次都利用固件槽位1进行固件升级,而是从除固件槽位1之外的固件槽位中选择一个目标固件槽位,利用该目标固件槽位进行固件升级。从而避免了每次固件升级都利用固件槽位1进行升级,一旦该次固件升级失败,则有一定风险导致固件损坏,最终致使该目标固态硬盘SSD不可用的问题。In view of this, the embodiment of the present application provides a firmware upgrade method and device, including: obtaining the number of firmware slots of the target solid-state hard disk SSD; if the number of firmware slots is greater than 2, then determining the target firmware from the alternative firmware slots Slot; wherein, the alternative firmware slot is a firmware slot other than firmware slot 1; the target image file is copied to the target firmware slot, and the firmware upgrade is completed using the target firmware slot. It can be seen that, using the firmware upgrade method and device provided by the embodiment of the present application, when there are multiple firmware slots, the firmware upgrade is not performed every time using firmware slot 1 as in the prior art. Select a target firmware slot from the firmware slots other than firmware slot 1, and use the target firmware slot to upgrade the firmware. This avoids the problem that firmware slot 1 is used for each firmware upgrade. Once the firmware upgrade fails, there is a certain risk that the firmware will be damaged, and eventually the target solid state drive SSD will be unavailable.
下面结合附图,详细说明本申请的各种非限制性实施方式。Various non-limiting implementations of the present application will be described in detail below with reference to the accompanying drawings.
示例性方法exemplary method
参见图1,该图为本申请实施例提供的一种固件升级方法的流程示意图。Referring to FIG. 1 , this figure is a schematic flowchart of a firmware upgrade method provided by an embodiment of the present application.
本申请实施例提供的固件升级方法,例如可以通过以下步骤S101-S103实现。The firmware upgrade method provided in the embodiment of the present application can be implemented, for example, through the following steps S101-S103.
S101:获取目标固态硬盘SSD的固件槽位数目。S101: Obtain the number of firmware slots of the target solid state disk SSD.
需要说明的是,本申请实施例不具体限定所述目标固态硬盘(Solid StateDrives,SSD),作为一种示例,所述目标固态硬盘SSD可以为:非易失性内存主机控制器接口规范(Non-Volatile Memory express,NVMe)固态硬盘SSD(简称:NVMe SSD)。It should be noted that the embodiment of the present application does not specifically limit the target solid state disk (Solid State Drives, SSD). As an example, the target solid state disk SSD may be: non-volatile memory host controller interface specification (Non -Volatile Memory express, NVMe) solid-state drive SSD (abbreviation: NVMe SSD).
需要说明的是,本申请实施例不具体限定获取所述目标固态硬盘的固件槽位数目的具体实现方式,作为一种示例,可以读取所述目标固态硬盘的出厂配置文件,以获取所述目标固态硬盘的固件槽位数目。It should be noted that the embodiment of the present application does not specifically limit the specific implementation manner of obtaining the number of firmware slots of the target solid-state hard disk. As an example, the factory configuration file of the target solid-state hard disk can be read to obtain the The number of firmware slots of the target SSD.
S102:若所述固件槽位数目大于2,则从备选固件槽位中确定目标固件槽位,其中,所述备选固件槽位为除固件槽位1之外的固件槽位。S102: If the number of firmware slots is greater than 2, determine a target firmware slot from candidate firmware slots, wherein the candidate firmware slots are firmware slots other than firmware slot 1.
需要说明的是,目标固态硬盘出厂时,会为该目标固态硬盘的固件槽位赋予一个编号。一般而言,固件槽位的编号从1开始编号。例如,目标固态硬盘有3个固件槽位,则固件槽位的编号分别为1、2和3。又如,目标固态硬盘仅有1个固件槽位,则固件槽位的编号为1。It should be noted that, when the target solid-state hard drive leaves the factory, a serial number will be assigned to the firmware slot of the target solid-state hard drive. Generally speaking, the firmware slots are numbered starting from 1. For example, if the target SSD has 3 firmware slots, the numbers of the firmware slots are 1, 2, and 3 respectively. For another example, if the target solid state disk has only one firmware slot, the number of the firmware slot is 1.
需要说明的是,本申请实施例中提及的固件槽位1,是指固件槽位编号为1的固件槽位。以此类推,固件槽位编号为2的固件槽位称为固件槽位2,固件槽位编号为3的固件槽位称为固件槽位3。It should be noted that the firmware slot 1 mentioned in the embodiment of the present application refers to the firmware slot numbered 1. By analogy, the firmware slot numbered 2 is called firmware slot 2, and the firmware slot numbered 3 is called firmware slot 3.
需要说明的是,本申请实施例中提及的备选固件槽位,是指,所述目标固态硬盘的固件槽位中,除了固件槽位1之外的固件槽位。举例说明,目标固态硬盘有3个固件槽位,则备选固件槽位为固件槽位2和固件槽位3。It should be noted that the alternative firmware slots mentioned in the embodiments of the present application refer to firmware slots other than firmware slot 1 among the firmware slots of the target solid state disk. For example, if the target SSD has 3 firmware slots, the candidate firmware slots are firmware slot 2 and firmware slot 3.
可以理解的是,在实际应用中,固件升级不可避免的可能会出现升级失败的情况,因此,为了使得在固件升级失败之后,目标固态硬盘还可以运行前一个版本的固件,因此,在本申请实施例中,可以保留前一个版本的固件。It can be understood that in practical applications, firmware upgrades may inevitably fail. Therefore, in order to make the target solid-state hard drive still run the previous version of firmware after the firmware upgrade fails, therefore, in this application In an embodiment, the previous version of firmware may be retained.
具体地,步骤S102在具体实现时,可以通过如下步骤S201-S202实现。Specifically, step S102 may be implemented through the following steps S201-S202 during specific implementation.
S201:获取所述目标固态硬盘SSD当前运行的固件所在的第一固件槽位。S201: Obtain the first firmware slot where the firmware currently running on the target solid state disk SSD is located.
需要说明的是,目标固态硬盘在同一时刻只可以运行一个固件,而一个固件只能完整的存放在一个固件槽位中,因此,所述第一固件槽位仅包括一个固件槽位。It should be noted that the target solid state disk can only run one firmware at a time, and one firmware can only be completely stored in one firmware slot. Therefore, the first firmware slot only includes one firmware slot.
需要说明的是,本申请实施例不具体限定获取所述第一固件槽位的具体实现方式。It should be noted that the embodiment of the present application does not specifically limit the specific implementation manner of obtaining the first firmware slot.
S202:从所述备选槽位中去除所述第一固件槽位中的其它固件槽位中确定所述目标固件槽位。S202: Determine the target firmware slot from other firmware slots except the first firmware slot from the candidate slots.
可以理解的是,若利用所述第一固件槽位完成固件升级,则覆盖了所述目标固态硬盘SSD当前运行的固件,因此,在本申请实施例中,从所述备选槽位中去除所述第一固件槽位中的其它固件槽位中确定所述目标固件槽位,以达到保留前一个版本的固件槽位的目的。It can be understood that if the firmware upgrade is completed by using the first firmware slot, the firmware currently running on the target solid state disk SSD will be overwritten. Therefore, in the embodiment of the present application, the The target firmware slot is determined among the other firmware slots in the first firmware slot, so as to achieve the purpose of retaining the firmware slot of the previous version.
举例说明:目标固态硬盘有4个固件槽位,当前运行的固件所在的第一固件槽位为固件槽位2,则从固件槽位3和固件槽位4中确定目标固件槽位,例如,将固件槽位3确定为目标固件槽位。又如,将固件槽位4确定为目标固件槽位。For example: the target SSD has 4 firmware slots, and the first firmware slot where the currently running firmware is located is firmware slot 2, then determine the target firmware slot from firmware slot 3 and firmware slot 4, for example, Determine firmware slot 3 as the target firmware slot. As another example, firmware slot 4 is determined as the target firmware slot.
S103:利用所述目标固件槽位完成固件升级。S103: Complete firmware upgrade by using the target firmware slot.
确定所述目标固件槽位之后,可以将待升级固件的镜像文件复制到所述目标固件槽位中,利用所述目标固件完成固件升级。After the target firmware slot is determined, the image file of the firmware to be upgraded can be copied to the target firmware slot, and the target firmware is used to complete the firmware upgrade.
由此可见,利用本申请实施例提供的固件升级方法,当存在多个固件槽位时,并不是如现有技术中那样每次都利用固件槽位1进行固件升级,而是从除固件槽位1之外的固件槽位中选择一个目标固件槽位,利用该目标固件槽位进行固件升级。从而避免了每次固件升级都利用固件槽位1进行升级,一旦该次固件升级失败,则有一定风险导致固件损坏,最终致使该目标固态硬盘SSD不可用的问题。It can be seen that, using the firmware upgrade method provided by the embodiment of the present application, when there are multiple firmware slots, instead of using firmware slot 1 to perform firmware upgrade every time as in the prior art, Select a target firmware slot from the firmware slots other than bit 1, and use the target firmware slot to upgrade the firmware. This avoids the problem that firmware slot 1 is used for each firmware upgrade. Once the firmware upgrade fails, there is a certain risk that the firmware will be damaged, and eventually the target solid state drive SSD will be unavailable.
考虑到实际应用中,所述固件槽位的数目可能为2,也可能为1,以下分别介绍当固件槽位为2和固件槽位为1时的如何确定目标固件槽位。Considering that in practical applications, the number of firmware slots may be 2 or 1, the following describes how to determine the target firmware slot when the number of firmware slots is 2 and the number of firmware slots is 1.
当所述固件槽位的数目为2时,可以通过如下步骤S301-S305确定所述目标固件槽位。When the number of firmware slots is 2, the target firmware slot can be determined through the following steps S301-S305.
S301:获取所述目标固态硬盘当前运行的固件所在的第二固件槽位。若所述第二固件槽位为固件槽位1,则执行步骤S302,否则,执行步骤S303。S301: Obtain the second firmware slot where the firmware currently running on the target solid state disk is located. If the second firmware slot is firmware slot 1, execute step S302; otherwise, execute step S303.
需要说明的是,获取所述第二固件槽位的具体实现,与获取所述第一固件槽位的具体实现类似,此处不再赘述。It should be noted that the specific implementation of acquiring the second firmware slot is similar to the specific implementation of acquiring the first firmware slot, and will not be repeated here.
可以理解的是,所述固件槽位的数目为2,则说明所述目标固态硬盘仅包括固件槽位1和固件槽位2,若所述第二固件槽位不是固件槽位1,则所述第二固件槽位为固件槽位2。It can be understood that if the number of firmware slots is 2, it means that the target solid-state hard disk only includes firmware slot 1 and firmware slot 2, and if the second firmware slot is not firmware slot 1, then the The second firmware slot mentioned above is firmware slot 2.
S302:将所述固件槽位2确定为所述目标固件槽位。S302: Determine the firmware slot 2 as the target firmware slot.
可以理解的是,当所述第二固件槽位为固件槽位1时,将所述固件槽位2确定为目标固件槽位,可以保留前一版本的固件。一旦固件升级失败,目标固态硬盘还可以运行固件槽位1中的固件。It can be understood that, when the second firmware slot is firmware slot 1, the firmware slot 2 is determined as the target firmware slot, and the firmware of the previous version may be retained. Once the firmware upgrade fails, the target SSD can still run the firmware in firmware slot 1.
S303:获取所述固件槽位1的读写属性。若所述固件槽位1的读写属性为可读可写,执行步骤S304,若所述固件槽位1的读写属性为只读,执行步骤S305。S303: Obtain the read-write attribute of the firmware slot 1. If the read-write attribute of the firmware slot 1 is readable and writable, execute step S304, and if the read-write attribute of the firmware slot 1 is read-only, execute step S305.
S304:将所述固件槽位1确定为所述目标固件槽位。S304: Determine the firmware slot 1 as the target firmware slot.
S305:将所述固件槽位2确定为所述目标固件槽位。S305: Determine the firmware slot 2 as the target firmware slot.
关于S303-S305需要说明的是,当所述第二固件槽位为固件槽位2时,若固件槽位1的读写属性为可读可写,则说明固件槽位1可以用于固件升级,此时,将固件槽位1确定为目标固件槽位,保留前一版本的固件(即固件槽位2中的固件)。若固件槽位1的读写属性为只读,则说明固件槽位1不能用于固件升级,此时,将固件槽位2确定为目标固件槽位,虽然不能保留前一版本的固件,但是,在一定程度上可以保证固件得以升级。What needs to be explained about S303-S305 is that when the second firmware slot is firmware slot 2, if the read-write attribute of firmware slot 1 is readable and writable, it means that firmware slot 1 can be used for firmware upgrade , at this time, the firmware slot 1 is determined as the target firmware slot, and the firmware of the previous version (that is, the firmware in the firmware slot 2) is retained. If the read-write attribute of firmware slot 1 is read-only, it means that firmware slot 1 cannot be used for firmware upgrade. At this time, determine firmware slot 2 as the target firmware slot. Although the previous version of firmware cannot be retained, , to a certain extent, it can guarantee that the firmware can be upgraded.
需要时说明的是,本申请实施例不具体限定获取所述固件槽位1的读写属性的具体实现方式,作为一种示例,可以读取所述目标固态硬盘的出厂配置文件,以获取所述固件槽位1的读写属性。When necessary, it should be noted that the embodiment of the present application does not specifically limit the specific implementation manner of obtaining the read-write attribute of the firmware slot 1. As an example, the factory configuration file of the target solid-state hard disk can be read to obtain the Describe the read and write attributes of firmware slot 1.
当所述固件槽位的数目为1时,则说明所述目标固态硬盘仅包括固件槽位1。此时在固件槽位1可以用于固件升级的情况下,将固件槽位1确定为所述目标固件槽位,否则,在固件槽位1不可以用于固件升级的情况,则无法进行固件升级。When the number of the firmware slots is 1, it means that the target solid state disk only includes firmware slot 1. Now, under the condition that firmware slot 1 can be used for firmware upgrade, firmware slot 1 is determined as the target firmware slot, otherwise, in the case that firmware slot 1 cannot be used for firmware upgrade, the firmware cannot be performed. upgrade.
具体地,获取所述固件槽位1的读写属性之后,若所述固件槽位1的读写属性为可读可写,则将所述固件槽位1确定为所述目标固件槽位。若所述固件槽位1的读写属性为只读,则明该目标固态硬盘不支持固件升级,此时,可以提示用户目标固态硬盘无法升级固件。Specifically, after the read-write attribute of the firmware slot 1 is acquired, if the read-write attribute of the firmware slot 1 is readable and writable, the firmware slot 1 is determined as the target firmware slot. If the read-write attribute of the firmware slot 1 is read-only, it means that the target solid-state hard drive does not support firmware upgrade. At this time, the user may be prompted that the target solid-state hard drive cannot upgrade the firmware.
示例性设备exemplary device
参见图4,该图为本申请实施例提供的一种固件升级的装置的结构示意图。Referring to FIG. 4 , this figure is a schematic structural diagram of a device for upgrading firmware provided by an embodiment of the present application.
所述装置400例如可以具体包括:第一获取单元410、第一确定单元420和升级单元430。For example, the apparatus 400 may specifically include: a first acquiring unit 410 , a first determining unit 420 and an upgrading unit 430 .
第一获取单元410,用于获取目标固态硬盘SSD的固件槽位数目;The first acquiring unit 410 is used to acquire the number of firmware slots of the target solid state disk SSD;
第一确定单元420,用于若所述固件槽位数目大于2,则从备选固件槽位中确定目标固件槽位;其中,所述备选固件槽位为除固件槽位1之外的固件槽位;The first determining unit 420 is configured to determine the target firmware slot from the candidate firmware slots if the number of the firmware slots is greater than 2; wherein, the candidate firmware slots are other than firmware slot 1 firmware slot;
升级单元430,用于利用所述目标固件槽位完成固件升级。The upgrading unit 430 is configured to use the target firmware slot to complete firmware upgrading.
可选的,所述第一确定单元420,具体用于:Optionally, the first determining unit 420 is specifically configured to:
获取所述目标固态硬盘SSD当前运行的固件所在的第一固件槽位;Obtain the first firmware slot where the firmware currently running on the target solid state disk SSD is located;
从所述备选槽位中去除所述第一固件槽位中的其它固件槽位中确定所述目标固件槽位。The target firmware slot is determined from other firmware slots except the first firmware slot from the candidate slots.
可选的,若所述固件槽位数目为2,所述装置400还包括:Optionally, if the number of firmware slots is 2, the device 400 further includes:
第二获取单元,用于获取所述目标固态硬盘SSD当前运行的固件所在的第二固件槽位;The second obtaining unit is used to obtain the second firmware slot where the firmware currently running on the target solid state disk SSD is located;
第二确定单元,用于若所述第二固件槽位为固件槽位1,则将所述固件槽位2确定为所述目标固件槽位;The second determining unit is configured to determine the firmware slot 2 as the target firmware slot if the second firmware slot is firmware slot 1;
第三获取单元,用于若所述第二固件槽位为固件槽位2,则获取所述固件槽位1的读写属性;A third acquiring unit, configured to acquire the read-write attribute of the firmware slot 1 if the second firmware slot is firmware slot 2;
第三确定单元,用于若所述固件槽位1的读写属性为可读可写,则将所述固件槽位1确定为所述目标固件槽位。The third determining unit is configured to determine the firmware slot 1 as the target firmware slot if the read/write attribute of the firmware slot 1 is readable and writable.
可选的,所述装置400还包括:Optionally, the device 400 also includes:
第四确定单元,用于若所述固件槽位1的读写属性为只读,则将所述固件槽位2确定为所述目标固件槽位。The fourth determining unit is configured to determine the firmware slot 2 as the target firmware slot if the read-write attribute of the firmware slot 1 is read-only.
可选的,若所述固件槽位数目为1,所述装置400还包括:Optionally, if the number of firmware slots is 1, the device 400 further includes:
第四获取单元,用于获取所述固件槽位1的读写属性;A fourth acquiring unit, configured to acquire the read-write attribute of the firmware slot 1;
第五确定单元,用于若所述固件槽位1的读写属性为可读可写,则将所述固件槽位1确定为所述目标固件槽位。The fifth determining unit is configured to determine the firmware slot 1 as the target firmware slot if the read/write attribute of the firmware slot 1 is readable and writable.
可选的,所述目标固态硬盘SSD包括:Optionally, the target solid-state disk SSD includes:
非易失性内存主机控制器接口规范NVMe固态硬盘SSD。Non-Volatile Memory Host Controller Interface Specification NVMe Solid State Drive SSD.
由于所述装置400是与以上方法实施例提供的固件升级方法对应的装置,故关于所述装置400的各个单元的具体实现,可以参考以上方法实施例的描述,此处不再赘述。Since the device 400 is a device corresponding to the firmware upgrade method provided by the above method embodiment, for the specific implementation of each unit of the device 400, reference may be made to the description of the above method embodiment, which will not be repeated here.
由此可见,利用本申请实施例提供的固件升级方法,当存在多个固件槽位时,并不是如现有技术中那样每次都利用固件槽位1进行固件升级,而是从除固件槽位1之外的固件槽位中选择一个目标固件槽位,利用该目标固件槽位进行固件升级。从而避免了每次固件升级都利用固件槽位1进行升级,一旦该次固件升级失败,则有一定风险导致固件损坏,最终致使该目标固态硬盘SSD不可用的问题。It can be seen that, using the firmware upgrade method provided by the embodiment of the present application, when there are multiple firmware slots, instead of using firmware slot 1 to perform firmware upgrade every time as in the prior art, Select a target firmware slot from the firmware slots other than bit 1, and use the target firmware slot to upgrade the firmware. This avoids the problem that firmware slot 1 is used for each firmware upgrade. Once the firmware upgrade fails, there is a certain risk that the firmware will be damaged, and eventually the target solid state drive SSD will be unavailable.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请的真正范围和精神由下面的权利要求指出。Other embodiments of the present application will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the application, these modifications, uses or adaptations follow the general principles of the application and include common knowledge or conventional technical means in the technical field not disclosed in this disclosure . The specification and examples are to be considered exemplary only, with a true scope and spirit of the application indicated by the following claims.
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求来限制It should be understood that the present application is not limited to the precise constructions which have been described above and shown in the accompanying drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims
以上所述仅为本申请的较佳实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above descriptions are only preferred embodiments of the application, and are not intended to limit the application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the application shall be included in the protection of the application. within range.
Claims (12)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810805403.1A CN108958782A (en) | 2018-07-20 | 2018-07-20 | A kind of firmware upgrade method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810805403.1A CN108958782A (en) | 2018-07-20 | 2018-07-20 | A kind of firmware upgrade method and device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN108958782A true CN108958782A (en) | 2018-12-07 |
Family
ID=64482145
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201810805403.1A Pending CN108958782A (en) | 2018-07-20 | 2018-07-20 | A kind of firmware upgrade method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN108958782A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116339786A (en) * | 2023-03-29 | 2023-06-27 | 山东云海国创云计算装备产业创新中心有限公司 | A method, device and device for starting baseline firmware upgrade |
| WO2025166946A1 (en) * | 2024-02-05 | 2025-08-14 | 苏州元脑智能科技有限公司 | Firmware mode switching method and apparatus, electronic device, and storage medium |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106293507A (en) * | 2015-06-26 | 2017-01-04 | 三星电子株式会社 | There is electronic equipment and the method for operation electronic equipment of external memory storage |
| CN108170446A (en) * | 2016-12-07 | 2018-06-15 | 北京忆恒创源科技有限公司 | Firmware confirms command handling method and system |
-
2018
- 2018-07-20 CN CN201810805403.1A patent/CN108958782A/en active Pending
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106293507A (en) * | 2015-06-26 | 2017-01-04 | 三星电子株式会社 | There is electronic equipment and the method for operation electronic equipment of external memory storage |
| CN108170446A (en) * | 2016-12-07 | 2018-06-15 | 北京忆恒创源科技有限公司 | Firmware confirms command handling method and system |
Non-Patent Citations (1)
| Title |
|---|
| NVM EXPRESS ORG: ""8.1 Firmware Update Process"", 《HTTP://NVMEXPRESS.ORG/WP-CONTENT/UPLOADS/NVM_EXPRESS_1_2_1_GOLD_20160603.PDF》 * |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116339786A (en) * | 2023-03-29 | 2023-06-27 | 山东云海国创云计算装备产业创新中心有限公司 | A method, device and device for starting baseline firmware upgrade |
| WO2025166946A1 (en) * | 2024-02-05 | 2025-08-14 | 苏州元脑智能科技有限公司 | Firmware mode switching method and apparatus, electronic device, and storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10296423B2 (en) | System and method for live virtual incremental restoring of data from cloud storage | |
| US8312259B1 (en) | System and method for booting a computer from backup | |
| US8041991B2 (en) | System and method for recovering solid state drive data | |
| JP5636034B2 (en) | Mediation of mount times for data usage | |
| CN1296835C (en) | Apparatus and method for controlling booting operation of computer system | |
| US8266611B2 (en) | Hard disk drive with disk embedded DOS boot image and firmware download method | |
| US8447916B2 (en) | Interfaces that facilitate solid state storage configuration | |
| TWI450194B (en) | Method and system for processing operating system, computer readable storage medium storing the method | |
| CN107463467B (en) | Method and system capable of quickly restoring virtualization platform | |
| CN102955706B (en) | A kind of installation method of dual operating systems and guiding loading method | |
| TWI676933B (en) | Firmware updating method | |
| CN103514015A (en) | Method and device for booting operation system from storage medium | |
| CN102436383A (en) | Firmware program processing method and equipment | |
| WO2016177067A1 (en) | Mobile phone memory expanding method and terminal | |
| US20110231621A1 (en) | System recovery method, and storage medium controller and storage system using the same | |
| WO2017000567A1 (en) | Bootrom upgrading method and device | |
| KR102429346B1 (en) | Memory Upgrade System And Method | |
| CN108958782A (en) | A kind of firmware upgrade method and device | |
| CN103106086B (en) | Operating system disposal route and system | |
| US10162573B2 (en) | Storage management system, storage management method, storage medium and information processing system | |
| CN118796288A (en) | Method, device, computer equipment and storage medium for performing hardware initialization operation | |
| CN118656101A (en) | Baseboard management controller firmware upgrade method, device, equipment and medium | |
| US20170357657A1 (en) | Systems and methods for implementing dynamic file systems | |
| TWI518594B (en) | Computer system and activation method for computer system | |
| CN110825421A (en) | Firmware upgrading method and system and readable storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181207 |