CN114020306A - Method and device for updating hard disk firmware, electronic equipment and storage medium - Google Patents

Method and device for updating hard disk firmware, electronic equipment and storage medium Download PDF

Info

Publication number
CN114020306A
CN114020306A CN202111144007.7A CN202111144007A CN114020306A CN 114020306 A CN114020306 A CN 114020306A CN 202111144007 A CN202111144007 A CN 202111144007A CN 114020306 A CN114020306 A CN 114020306A
Authority
CN
China
Prior art keywords
target
firmware
storage area
version number
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
Application number
CN202111144007.7A
Other languages
Chinese (zh)
Inventor
罗晓龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202111144007.7A priority Critical patent/CN114020306A/en
Publication of CN114020306A publication Critical patent/CN114020306A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates 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

The application discloses a method and a device for updating hard disk firmware, electronic equipment and a storage medium. The method comprises the following steps: receiving a firmware updating instruction sent by host equipment, wherein the firmware updating instruction carries a target firmware; querying a target slot corresponding to target firmware from a solid state disk, wherein the target slot comprises a plurality of storage areas; traversing a header file corresponding to a storage area in a target slot, determining a target storage area meeting a preset writing condition, and writing a target firmware into the target storage area to obtain an updated target slot; and after the solid state disk is powered on and started, the target firmware is operated based on the updated target slot. According to the embodiment of the application, whether the target storage area meeting the writing condition is met or not can be quickly determined by traversing the header file corresponding to the storage area in the target slot, the target firmware is directly written into the target storage area, the storage areas do not need to be checked one by one, and the firmware updating efficiency is improved.

Description

Method and device for updating hard disk firmware, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for updating a hard disk firmware, an electronic device, and a storage medium.
Background
The SSD firmware is typically stored in eprom or flash and may be upgraded by a special refresh procedure. When the SSD system starts, the solidified program of the processor loads the boot loader, which initializes the hardware and then loads the firmware. If the current firmware program has problems, the system cannot be started normally, and the phenomenon of disc loss occurs.
For managing the firmware, different vendors have different management modes, such as a mode of storing only the latest version of firmware and a mode of storing multiple versions of firmware. For the former, if a problem occurs when upgrading firmware, the SSD will not be used normally. In the latter case, when upgrading the firmware, a correct position needs to be selected to replace the original firmware, so as to ensure that the latest effective firmware can be found when the system is started.
Either way, the upgrade first requires erasing a space and then writing the new firmware. This process can take a relatively long time and, once aborted, cannot be started properly on the next power up. When starting, the latest effective firmware needs to be found from the epom or the flash and loaded, and for the condition that multiple versions of firmware exist, the bootloader needs to check the effectiveness of each firmware and find out the firmware updated at the last time, so that the whole process is time-consuming.
Disclosure of Invention
In order to solve the technical problems or at least partially solve the technical problems, the application provides a method and a device for updating hard disk firmware, an electronic device and a storage medium.
According to an aspect of the embodiments of the present application, there is provided a method for updating a hard disk firmware, which is applied to a solid state disk, and the method includes:
receiving a firmware updating instruction sent by host equipment, wherein the firmware updating instruction carries a target firmware;
querying a target slot corresponding to the target firmware from the solid state disk, wherein the target slot comprises a plurality of storage areas;
traversing a header file corresponding to a storage area in the target slot, determining a target storage area meeting a preset writing condition, and writing the target firmware into the target storage area to obtain an updated target slot;
and after the solid state disk is powered on and started, the target firmware is operated based on the updated target slot.
Further, the traversing a header file corresponding to a storage area in the target slot, determining a target storage area meeting a preset writing condition, and writing the target firmware into the target storage area includes:
traversing a storage area in the target slot, and determining first state information of the storage area;
determining the storage area with the first state information in an idle state as a target storage area meeting a preset writing condition;
inquiring a header file corresponding to each storage area, and determining a historical maximum version number corresponding to the target firmware;
determining the current maximum version number of the header file stored in the target storage area according to the historical maximum version number;
and writing the target firmware into the target storage area, and storing the current maximum version number into a header file corresponding to the target storage area.
Further, in the case that there is no storage area in the target slot where the first state information is in an idle state, the method further includes:
inquiring a header file corresponding to each storage area, and determining a historical maximum version number and a historical minimum version number corresponding to the target firmware;
determining the current maximum version number of the header file stored in the target storage area according to the historical maximum version number;
erasing the firmware stored in the storage area corresponding to the historical minimum version number, and determining the storage area after the firmware is erased as a target storage area meeting preset writing conditions;
and writing the target firmware into the target storage area, and storing the current maximum version number into a header file corresponding to the target storage area.
Further, after writing the target firmware into the target storage area and storing the current maximum version number to the header file corresponding to the target storage area, the method further includes:
acquiring verification data corresponding to the target firmware;
and writing the check data into the header file and using the check data as a file type code of the header file.
Further, after the solid state disk is powered on and started, the target firmware is loaded and run based on the updated target slot, including:
receiving a power-on starting instruction;
after the solid state disk is started according to the power-on starting instruction, inquiring header files corresponding to each storage area in the updated target slot to obtain the current maximum version number and the verification data corresponding to the target firmware;
determining the current maximum version number as an effective maximum version number under the condition that the verification data passes verification;
and controlling the target firmware to run according to the effective maximum version number.
Further, after the solid state disk is powered on and started, the method further includes:
inquiring a header file corresponding to each storage area to obtain historical firmware which is not completely written into the storage area;
and continuing to execute the write operation of the historical firmware.
Further, after the target firmware is loaded and run based on the updated target socket, the method further includes:
traversing the updated second state information of each storage area in the target slot after the solid state disk is powered on;
under the condition that the updated target slot does not have a storage area with the second state information in an idle state, inquiring a header file corresponding to each storage area, and determining the current minimum version number of the target firmware;
and erasing the firmware stored in the storage area corresponding to the current minimum version number.
According to another aspect of the embodiments of the present application, there is provided an apparatus for updating a hard disk firmware, including:
the system comprises a receiving module, a sending module and a processing module, wherein the receiving module is used for receiving a firmware updating instruction sent by host equipment, and the firmware updating instruction carries target firmware;
the query module is used for querying a target slot corresponding to the target firmware from a solid state disk, wherein the target slot comprises a plurality of storage areas;
the traversal module is used for traversing the header file corresponding to the storage area in the target slot, determining the target storage area meeting preset writing conditions, and writing the target firmware into the target storage area to obtain an updated target slot;
and the execution module is used for running the target firmware based on the updated target slot after the solid state disk is powered on and started.
According to another aspect of the embodiments of the present application, there is also provided a storage medium including a stored program that executes the above steps when the program is executed.
According to another aspect of the embodiments of the present application, there is also provided an electronic apparatus, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus; wherein: a memory for storing a computer program; a processor for executing the steps of the method by running the program stored in the memory.
Embodiments of the present application also provide a computer program product containing instructions, which when run on a computer, cause the computer to perform the steps of the above method.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages: according to the embodiment of the application, whether the target storage area meeting the writing condition is met or not can be quickly determined by traversing the header file corresponding to the storage area in the target slot, the target firmware is directly written into the target storage area, the storage areas do not need to be checked one by one, and the firmware updating efficiency is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
Fig. 1 is a flowchart of a method for updating hard disk firmware according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a method for updating hard disk firmware according to another embodiment of the present application;
fig. 3 is a flowchart of a method for updating hard disk firmware according to another embodiment of the present application;
fig. 4 is a block diagram of an apparatus for updating hard disk firmware according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments, and the illustrative embodiments and descriptions thereof of the present application are used for explaining the present application and do not constitute a limitation to the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another similar entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The embodiment of the application provides a method and a device for updating hard disk firmware, electronic equipment and a storage medium. The method provided by the embodiment of the invention can be applied to any required electronic equipment, for example, the electronic equipment can be electronic equipment such as a server and a terminal, and the method is not particularly limited herein, and is hereinafter simply referred to as electronic equipment for convenience in description.
According to an aspect of the embodiments of the present application, an embodiment of a method for updating a hard disk firmware is provided. Fig. 1 is a flowchart of a method for updating hard disk firmware according to an embodiment of the present application, and as shown in fig. 1, the method includes:
step S11, a firmware update instruction sent by the host device is received, where the firmware update instruction carries the target firmware.
In this embodiment, the host device determines, according to the configuration of the device, a FIRMWARE that needs to be updated in the solid state disk, where the FIRMWARE is also called FIRMWARE, and is a program that is stored in an EEPROM (electrically erasable programmable storage non-read only chip) chip in the device and can be updated by a user through a specific refresh program. Its function is equal to BIOS of main board, and its interior is written by using assembly language. After the host device determines the firmware to be updated, a firmware update instruction is sent to the solid state disk, wherein the firmware update instruction carries the target firmware and the identification (and slot number) of the target firmware in the storage slot of the solid state disk.
In the embodiment of the application, after the solid state disk obtains the target firmware issued by the host device, the solid state disk detects the validity of the target firmware, and if the target firmware is valid, corresponding write-in operation is executed on the target firmware.
Step S12, a target slot corresponding to the target firmware is queried from the solid state disk, where the target slot includes a plurality of storage areas.
The embodiment of the application is characterized in that a plurality of slots (slots) are arranged in the solid state disk, each slot is used for storing the same type of firmware, each slot also comprises a plurality of storage areas (regions), and the storage areas are used for storing the firmware with different version numbers. It should be noted that, except for the first storage area to which factory firmware is written, the other storage areas are all in an empty state where they are erased when the default is not upgraded. When data is written therein, a fixed-length header file is written foremost by default. The header file contains the version number and integrity check data for the firmware. When the firmware is written, the version number is written into a header file, and the integrity check data of the data is written into the magic number. And after the firmware is completely written, replacing the magic number with real integrity check data.
In the embodiment of the present application, a process of querying a target slot corresponding to a target firmware from a solid state disk is as follows: and acquiring a corresponding target slot from the solid state disk according to a storage slot identifier issued by the host equipment, wherein the target slot comprises a plurality of storage areas, and each storage area is stored with historical firmware of the same type as the target firmware, and each historical firmware corresponds to a historical version number.
Step S13, traversing the header file corresponding to the storage area in the target slot, determining the target storage area satisfying the preset writing condition, and writing the target firmware into the target storage area to obtain the updated target slot.
In this embodiment of the present application, traversing a header file corresponding to a storage area in a target slot, determining a target storage area satisfying a preset writing condition, and writing target firmware in the target storage area, includes the following steps a1-a 5:
step A1, traverse the storage area in the target slot, determine the first status information of the storage area.
Step a2, determining the storage area with the first state information being in idle state as the target storage area satisfying the preset writing condition.
Step A3, querying the header files corresponding to each storage area, and determining the historical maximum version number corresponding to the target firmware.
Step A4, determining the current maximum version number of the header file stored in the target storage area according to the historical maximum version number.
Step A5, writing the target firmware into the target storage area, and storing the current maximum version number into the header file corresponding to the target storage area.
In the embodiment of the application, after a target slot corresponding to a target firmware is determined, traversing first state information of each storage area in the target slot, wherein the first state information can be a storage state and an idle state, and when the first state information is the storage state, it indicates that the firmware is written in the storage area; when the first state information is in an idle state, it indicates that the firmware is not written in the storage area.
In the embodiment of the application, a storage area in which first state information in a target slot is in an idle state is obtained, and the storage area in which the first state information is in the idle state is determined as the target storage area meeting a preset writing condition. And if a plurality of idle-state storage areas exist in the target slot, randomly writing the target firmware into one idle-state storage area.
In this embodiment of the present application, before writing the target firmware into the target storage area, a target version number corresponding to the target firmware needs to be determined, and the specific process is as follows: and inquiring the header files corresponding to the storage areas, determining the historical maximum version number N corresponding to the target firmware, and determining N +1 as the current maximum version number. And then writing the current maximum version number into a header file, writing the target firmware into a target storage area, and obtaining an updated target slot after the target firmware is written.
In this embodiment, in the case that there is no storage area in the target slot for which the first state information is in an idle state, the method further includes the following steps B1-B4:
step B1, querying the header files corresponding to each storage area, and determining the historical maximum version number and the historical minimum version number corresponding to the target firmware.
And step B2, determining the current maximum version number of the header file stored in the target storage area according to the historical maximum version number.
And step B3, erasing the firmware stored in the storage area corresponding to the historical minimum version number, and determining the storage area after the firmware is erased as a target storage area meeting preset writing conditions.
And step B4, writing the target firmware into the target storage area, and storing the current maximum version number into the header file corresponding to the target storage area.
In this embodiment of the present application, if a storage area in which the first state information is in an idle state does not exist in the target slot, it is determined that all storage areas in the target slot have been written with firmware, at this time, a header file corresponding to each storage area is queried, a historical maximum version number and a historical minimum version number corresponding to the target firmware are determined, then the firmware in the storage area corresponding to the historical minimum version number is erased, so that the storage area corresponding to the historical minimum version number is in the idle state, then a current maximum version number is determined according to the historical maximum version number, the current maximum version number is written into the header file of the storage area corresponding to the historical minimum version number, and the target firmware is written into the storage area (i.e., the target storage area) corresponding to the historical minimum version number.
In this embodiment of the present application, after writing the target firmware into the target storage area and storing the current maximum version number in the header file corresponding to the target storage area, the method further includes: and acquiring the check data corresponding to the target firmware, writing the check data into the header file, and using the check data as the file type code of the header file.
The verification data is used as the file type code of the header file, and is used for subsequent verification when the target firmware is loaded and operated according to the file type code.
Step S14, after the solid state disk is powered on and started, the target firmware is executed based on the updated target slot.
In this embodiment of the application, in step S14, after the solid state disk is powered on and started, the step of loading and running the target firmware based on the updated target slot includes the following steps C1-C4:
and step C1, receiving a power-on starting instruction.
And step C2, after the solid state disk is started according to the power-on starting instruction, inquiring header files corresponding to each storage area in the updated target slot to obtain the current maximum version number and the verification data corresponding to the target firmware.
And step C3, determining the current maximum version number as the valid maximum version number under the condition that the check data passes.
Step C4, the control target firmware runs according to the valid maximum version number.
In the embodiment of the application, after the solid state disk is powered on and started, the target slot is read, then the header files corresponding to each storage area in the target slot are inquired, the current maximum version number M is read, and data integrity check is performed according to the file type code. And if the verification is passed, continuously checking the validity of the firmware, and if the verification is passed, loading the firmware to realize that the control target firmware runs according to the valid maximum version number.
Otherwise, reading the header file with the version number of M-1 and continuing the operation. If the firmware does not pass the search, the header file with the version number of M-2 is continuously searched, and the operation is repeated until the valid firmware is found. By checking the version and data integrity of the header file corresponding to each storage area, the latest version number can be searched preferentially, and the validity of each firmware does not need to be checked again every time, so that the loading time is saved.
According to the embodiment of the application, whether the target storage area meeting the writing condition is met or not can be quickly determined by traversing the header file corresponding to the storage area in the target slot, the target firmware is directly written into the target storage area, the storage areas do not need to be checked one by one, and the firmware updating efficiency is improved.
In this embodiment of the present application, after the solid state disk is powered on and started, as shown in fig. 2, the method further includes the following steps:
step S21, querying the header files corresponding to each storage area to obtain the historical firmware that is not completely written into the storage area.
In step S22, the history firmware writing operation is continued.
In the embodiment of the application, during the firmware upgrading and updating process, abnormal events such as power failure occur, which causes the firmware upgrading and updating failure, or incomplete writing of the firmware, and the like. Because the header file of the storage area exists, the history firmware which is not written correctly can be rapidly scanned and identified after the solid state disk is powered on again, a latest version number (maximum version number) which is normally used by the history firmware is determined to temporarily run, and meanwhile, the writing operation of the history firmware is continuously executed.
According to the embodiment of the application, the version number is written into the header file corresponding to the storage area, so that the latest version number which can be normally used at present can be quickly positioned when the firmware is not completely written due to an emergency, the firmware with the latest version number is used for temporarily running, and meanwhile, the writing operation of the historical firmware is continuously executed.
In this embodiment of the application, after the target firmware is loaded and run based on the updated target socket, as shown in fig. 3, the method further includes:
step S31, after the solid state disk is powered on, traversing the updated second state information of each storage area in the target slot.
Step S32, when there is no storage area in the updated target slot where the second state information is in an idle state, querying a header corresponding to each storage area, and determining a current minimum version number of the target firmware.
In step S33, the firmware stored in the storage area corresponding to the current minimum version number is erased.
In the embodiment of the application, after the solid state disk is powered on and operated, whether the updated storage area of the target slot in the solid state disk is written into the header file is inquired. And if the header files are written in, inquiring the header files corresponding to each storage area, determining the current minimum version number of the target firmware, and erasing the firmware stored in the storage area corresponding to the current minimum version number.
According to the embodiment of the application, after the solid state disk is powered on and operated each time, the pre-erasing judgment is made, and the unused old version firmware is pre-erased, so that when the host equipment issues the firmware updating command again, the firmware can be directly written in due to the fact that the space of the storage area is cleared through the pre-erasing, and the writing time is saved.
Fig. 4 is a block diagram of an apparatus for updating hard disk firmware provided in an embodiment of the present application, where the apparatus may be implemented as part or all of an electronic device through software, hardware, or a combination of the two. As shown in fig. 4, the apparatus includes:
the receiving module 41 is configured to receive a firmware update instruction sent by the host device, where the firmware update instruction carries a target firmware.
And the query module 42 is configured to query a target slot corresponding to the target firmware from the solid state disk, where the target slot includes a plurality of storage areas.
And the traversing module 43 is configured to traverse a header file corresponding to a storage area in the target slot, determine a target storage area meeting a preset writing condition, and write the target firmware into the target storage area to obtain an updated target slot.
And the execution module 44 is configured to run the target firmware based on the updated target slot after the solid state disk is powered on and started.
In this embodiment of the present application, the traversing module 43 is configured to traverse a storage area in a target slot, and determine first state information of the storage area; determining a storage area with the first state information in an idle state as a target storage area meeting a preset writing condition; inquiring a header file corresponding to each storage area, and determining a historical maximum version number corresponding to the target firmware; determining the current maximum version number of the header file stored in the target storage area according to the historical maximum version number; and writing the target firmware into a target storage area, and storing the current maximum version number into a header file corresponding to the target storage area.
In this embodiment of the present application, the apparatus for updating hard disk firmware further includes: the processing module is used for inquiring the header files corresponding to each storage area and determining the historical maximum version number and the historical minimum version number corresponding to the target firmware; determining the current maximum version number of the header file stored in the target storage area according to the historical maximum version number; erasing the firmware stored in the storage area corresponding to the historical minimum version number, and determining the storage area after the firmware is erased as a target storage area meeting preset writing conditions; and writing the target firmware into a target storage area, and storing the current maximum version number into a header file corresponding to the target storage area.
In this embodiment of the present application, the apparatus for updating hard disk firmware further includes: the storage module is used for acquiring the verification data corresponding to the target firmware; and writing the check data into the header file and using the check data as a file type code of the header file.
In this embodiment of the present application, the execution module 44 is configured to receive a power-on start instruction; after the solid state disk is started according to the power-on starting instruction, inquiring header files corresponding to each storage area in the updated target slot to obtain the current maximum version number and the verification data corresponding to the target firmware; determining the current maximum version number as the effective maximum version number under the condition that the verification data passes the verification; the control target firmware runs according to the valid maximum version number.
In this embodiment of the present application, the apparatus for updating hard disk firmware further includes: the detection module is used for inquiring the header files corresponding to each storage area to obtain the historical firmware which is not completely written into the storage area; and continuing to execute the write operation of the historical firmware.
In this embodiment of the present application, the apparatus for updating hard disk firmware further includes: the checking module is used for traversing the updated second state information of each storage area in the target slot after the solid state disk is powered on; under the condition that no storage area with second state information in an idle state exists in the updated target slot, inquiring a header file corresponding to each storage area, and determining the current minimum version number of the target firmware; and erasing the firmware stored in the storage area corresponding to the current minimum version number.
An embodiment of the present application further provides an electronic device, as shown in fig. 5, the electronic device may include: the system comprises a processor 1501, a communication interface 1502, a memory 1503 and a communication bus 1504, wherein the processor 1501, the communication interface 1502 and the memory 1503 complete communication with each other through the communication bus 1504.
A memory 1503 for storing a computer program;
the processor 1501 is configured to implement the steps of the above embodiments when executing the computer program stored in the memory 1503.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In another embodiment provided by the present application, a computer-readable storage medium is further provided, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer, the instructions cause the computer to perform the method for updating hard disk firmware described in any of the above embodiments.
In another embodiment provided by the present application, there is also provided a computer program product containing instructions, which when run on a computer, causes the computer to execute the method for updating hard disk firmware described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk), among others.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.
The above description is merely exemplary of the present application and is presented to enable those skilled in the art to understand and practice the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for updating hard disk firmware is applied to a solid state disk, and comprises the following steps:
receiving a firmware updating instruction sent by host equipment, wherein the firmware updating instruction carries a target firmware;
querying a target slot corresponding to the target firmware from the solid state disk, wherein the target slot comprises a plurality of storage areas;
traversing a header file corresponding to a storage area in the target slot, determining a target storage area meeting a preset writing condition, and writing the target firmware into the target storage area to obtain an updated target slot;
and after the solid state disk is powered on and started, the target firmware is operated based on the updated target slot.
2. The method according to claim 1, wherein traversing a header file corresponding to a storage area in the target slot, determining a target storage area satisfying a preset writing condition, and writing the target firmware into the target storage area comprises:
traversing a storage area in the target slot, and determining first state information of the storage area;
determining the storage area with the first state information in an idle state as a target storage area meeting a preset writing condition;
inquiring a header file corresponding to each storage area, and determining a historical maximum version number corresponding to the target firmware;
determining the current maximum version number of the header file stored in the target storage area according to the historical maximum version number;
and writing the target firmware into the target storage area, and storing the current maximum version number into a header file corresponding to the target storage area.
3. The method of claim 2, wherein in the absence of a storage area in the target slot for which the first state information is idle, the method further comprises:
inquiring a header file corresponding to each storage area, and determining a historical maximum version number and a historical minimum version number corresponding to the target firmware;
determining the current maximum version number of the header file stored in the target storage area according to the historical maximum version number;
erasing the firmware stored in the storage area corresponding to the historical minimum version number, and determining the storage area after the firmware is erased as a target storage area meeting preset writing conditions;
and writing the target firmware into the target storage area, and storing the current maximum version number into a header file corresponding to the target storage area.
4. The method of claim 3, wherein after writing the target firmware into the target storage area and storing the current maximum version number in a header file corresponding to the target storage area, the method further comprises:
acquiring verification data corresponding to the target firmware;
and writing the check data into the header file and using the check data as a file type code of the header file.
5. The method of claim 1, wherein after the solid state disk is powered on and started, performing a load operation on the target firmware based on the updated target slot comprises:
receiving a power-on starting instruction;
after the solid state disk is started according to the power-on starting instruction, inquiring header files corresponding to each storage area in the updated target slot to obtain the current maximum version number and the verification data corresponding to the target firmware;
determining the current maximum version number as an effective maximum version number under the condition that the verification data passes verification;
and controlling the target firmware to run according to the effective maximum version number.
6. The method according to claim 1, wherein after the solid state disk is powered on and started, the method further comprises:
inquiring a header file corresponding to each storage area to obtain historical firmware which is not completely written into the storage area;
and continuing to execute the write operation of the historical firmware.
7. The method of claim 1, wherein after loading the target firmware based on the updated target socket, the method further comprises:
traversing the updated second state information of each storage area in the target slot after the solid state disk is powered on;
under the condition that the updated target slot does not have a storage area with the second state information in an idle state, inquiring a header file corresponding to each storage area, and determining the current minimum version number of the target firmware;
and erasing the firmware stored in the storage area corresponding to the current minimum version number.
8. An apparatus for updating firmware of a hard disk, comprising:
the system comprises a receiving module, a sending module and a processing module, wherein the receiving module is used for receiving a firmware updating instruction sent by host equipment, and the firmware updating instruction carries target firmware;
the query module is used for querying a target slot corresponding to the target firmware from a solid state disk, wherein the target slot comprises a plurality of storage areas;
the traversal module is used for traversing the header file corresponding to the storage area in the target slot, determining the target storage area meeting preset writing conditions, and writing the target firmware into the target storage area to obtain an updated target slot;
and the execution module is used for running the target firmware based on the updated target slot after the solid state disk is powered on and started.
9. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program is operative to perform the method steps of any of the preceding claims 1 to 7.
10. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus; wherein:
a memory for storing a computer program;
a processor for performing the method steps of any of claims 1-7 by executing a program stored on a memory.
CN202111144007.7A 2021-09-28 2021-09-28 Method and device for updating hard disk firmware, electronic equipment and storage medium Pending CN114020306A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111144007.7A CN114020306A (en) 2021-09-28 2021-09-28 Method and device for updating hard disk firmware, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111144007.7A CN114020306A (en) 2021-09-28 2021-09-28 Method and device for updating hard disk firmware, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114020306A true CN114020306A (en) 2022-02-08

Family

ID=80055032

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111144007.7A Pending CN114020306A (en) 2021-09-28 2021-09-28 Method and device for updating hard disk firmware, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114020306A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105278876A (en) * 2015-09-23 2016-01-27 华为技术有限公司 Data wiping method and device of solid state device
CN107066300A (en) * 2017-04-21 2017-08-18 杭州宏杉科技股份有限公司 The firmware upgrade method and storage device of a kind of storage device
US20180349129A1 (en) * 2017-06-01 2018-12-06 Electronics And Telecommunications Research Institute Apparatus for supporting firmware update and method for the same
CN110347414A (en) * 2019-07-15 2019-10-18 西安易朴通讯技术有限公司 Firmware update, device, equipment and computer readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105278876A (en) * 2015-09-23 2016-01-27 华为技术有限公司 Data wiping method and device of solid state device
CN107066300A (en) * 2017-04-21 2017-08-18 杭州宏杉科技股份有限公司 The firmware upgrade method and storage device of a kind of storage device
US20180349129A1 (en) * 2017-06-01 2018-12-06 Electronics And Telecommunications Research Institute Apparatus for supporting firmware update and method for the same
CN110347414A (en) * 2019-07-15 2019-10-18 西安易朴通讯技术有限公司 Firmware update, device, equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN103299276B (en) The software upgrading process of embedded equipment
US20070055969A1 (en) System and method for updating firmware
CN105094927B (en) A kind of device firmware upgrade method and apparatus
KR102107843B1 (en) Firmware updating method and electronic device using the same
CN107783776B (en) Processing method and device of firmware upgrade package and electronic equipment
CN102422265A (en) Bios image manager
US7039796B2 (en) Method and system of locating a position in memory at which to store incoming firmware image
CN109582332B (en) System upgrading method and device for Internet camera
US20230057089A1 (en) Upgrade method, computer system, and remote upgrade device implementing efficient remote upgrade
CN112015447B (en) System updating method and device of electronic equipment, electronic equipment and storage medium
CN111562934A (en) Software system upgrading method based on hot patch, terminal and storage medium
CN108153548A (en) A kind of EMMC firmware upgrade methods and device
CN114185571A (en) Firmware upgrading method and device of CPLD, terminal and readable storage medium
US20060026415A1 (en) Method of updating a portion BIOS
CN108170456B (en) Firmware upgrading method and device for electronic equipment
US20080201572A1 (en) Method and system for uniformizing product data embedded in a computer platform
CN114020306A (en) Method and device for updating hard disk firmware, electronic equipment and storage medium
CN109491951B (en) Data configuration method and computing equipment
CN115437668A (en) Development and design method and system for tool for batch production of SSD
CN112667444A (en) System upgrading method, storage medium and terminal equipment
CN109254800B (en) Equipment information processing method, electronic equipment and server
CN114020681A (en) Method, device and system for distributing logical drive letter, electronic equipment and storage medium
CN106547589A (en) A kind of upgrade-system and upgrade method
CN112559349A (en) Program running method and device
CN114625399A (en) System upgrading method and related device, equipment and 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