CN114464231B - Firmware storage method and system - Google Patents

Firmware storage method and system Download PDF

Info

Publication number
CN114464231B
CN114464231B CN202210046120.XA CN202210046120A CN114464231B CN 114464231 B CN114464231 B CN 114464231B CN 202210046120 A CN202210046120 A CN 202210046120A CN 114464231 B CN114464231 B CN 114464231B
Authority
CN
China
Prior art keywords
firmware
slot
nandflash
parts
divided
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.)
Active
Application number
CN202210046120.XA
Other languages
Chinese (zh)
Other versions
CN114464231A (en
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 CN202210046120.XA priority Critical patent/CN114464231B/en
Publication of CN114464231A publication Critical patent/CN114464231A/en
Application granted granted Critical
Publication of CN114464231B publication Critical patent/CN114464231B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C14/00Digital stores characterised by arrangements of cells having volatile and non-volatile storage properties for back-up when the power is down
    • G11C14/0009Digital stores characterised by arrangements of cells having volatile and non-volatile storage properties for back-up when the power is down in which the volatile element is a DRAM cell
    • G11C14/0018Digital stores characterised by arrangements of cells having volatile and non-volatile storage properties for back-up when the power is down in which the volatile element is a DRAM cell whereby the nonvolatile element is an EEPROM element, e.g. a floating gate or metal-nitride-oxide-silicon [MNOS] transistor

Landscapes

  • Engineering & Computer Science (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The invention provides a firmware storage method and a firmware storage system, wherein the method comprises the steps of programming factory firmware to a preset slot stored in a hard disk nandflash, wherein the slot is divided into two parts of a table tennis; and in the running process of the firmware, when a preset timing strategy is met, moving the firmware to another part based on the part of the current storage position of the firmware. According to the invention, the slot is arranged on the nandflash, is divided into two parts of the ping-pong, and is provided with the timer, so that when the firmware runs, the firmware is subjected to the moving operation between the two parts of the ping-pong and the ping-pong, the problem that the hard disk is not electrified for a long time to lose data is solved, the loss risk of the firmware is effectively reduced, and the complex hardware design caused by the storage of EEPRON and the like is avoided, so that the cost is saved.

Description

Firmware storage method and system
Technical Field
The invention relates to the technical field of firmware storage, in particular to a firmware storage method and a firmware storage system.
Background
With the advent of the age of artificial intelligence and digitization, the storage volume of data has exploded, and the demand of SSD (solid state disk), i.e. solid state electronic storage array hard disk, has also increased rapidly. The SSD has an independent controller, hardware unit and firmware, which determines the functional integrity of the SSD, which is the soul of the SSD, so preserving the effectiveness of the firmware is necessary.
The existing firmware of the SSD is generally stored in EEPRON (Electrically Erasable Programmable read only memory, charged erasable programmable read only memory) or norflash (nonvolatile flash memory), which is a nonvolatile medium, and can store data for a long period of time, but this is equivalent to adding a piece of hardware in the SSD, and increases the cost and design complexity of the SSD.
Therefore, a technical means of storing firmware on nandflash (a nonvolatile flash technology) of an SSD has appeared, but data may be lost if the nandflash is not powered on for a long time because of the physical characteristics of the nandflash.
Disclosure of Invention
The invention provides a firmware storage method and a firmware storage system, which are used for solving the problem that the existing nandflash storage data has a loss risk.
In order to achieve the above purpose, the present invention adopts the following technical scheme:
the first aspect of the present invention provides a firmware storage method, the method comprising the steps of:
writing the factory firmware on a preset slot stored in a hard disk nandflash, wherein the slot is divided into two parts of a table tennis;
and in the running process of the firmware, when a preset timing strategy is met, moving the firmware to another part based on the part of the current storage position of the firmware.
Further, a plurality of slots are arranged, each slot is divided into two parts of ping pong, and each part is divided into two parts of main part and standby part.
Further, when the factory firmware is programmed, writing the factory firmware into one slot, and setting the written slot into a read-only mode.
Further, when the firmware moving operation is performed, each slot storing the firmware is moved under the current slot, and if the operation fails, the risk of firmware loss is reported.
Further, the specific process of moving the firmware to another part based on the part to which the current storage position of the firmware belongs is as follows:
judging whether the nandflash of the other part is erased or not;
if not, executing an erasing operation, and then writing the firmware into the other part;
if yes, the firmware is directly written into the other part.
Further, the moving the firmware to another part further comprises:
the pointer of the current firmware in the metadata is changed to point to the other part.
Further, when the firmware is written into the other part, the main part and the standby part are written simultaneously.
A second aspect of the present invention provides a firmware storage system, the system comprising:
the firmware programming unit is used for programming the factory firmware to a preset slot stored in the hard disk nandflash, and the slot is divided into two parts of a table tennis;
and the firmware moving unit is used for moving the firmware to another part based on the part of the current storage position of the firmware when the preset timing strategy is met in the firmware operation process.
Further, the system further comprises a configuration unit, wherein the configuration unit is used for setting a plurality of slots on the nandflash, each slot is divided into two parts of ping pong, and each part is divided into two parts of main part and standby part.
A third aspect of the invention stores a computer storage medium having stored therein computer instructions which, when run on a system, cause the system to perform the steps of the method.
The firmware storage system according to the second aspect of the present invention can implement the methods in the first aspect and the implementation manners of the first aspect, and achieve the same effects.
The effects provided in the summary of the invention are merely effects of embodiments, not all effects of the invention, and one of the above technical solutions has the following advantages or beneficial effects:
1. according to the invention, the slot is arranged on the nandflash, is divided into two parts of the ping-pong, and is provided with the timer, so that when the firmware runs, the firmware is subjected to the moving operation between the two parts of the ping-pong and the ping-pong, the problem that the hard disk is not electrified for a long time to lose data is solved, the loss risk of the firmware is effectively reduced, and the complex hardware design caused by the storage of EEPRON and the like is avoided, so that the cost is saved.
2. In the embodiment of the invention, the main and standby strategies are set in the ping and pong parts, namely, the main and standby firmware files are provided in the processes of firmware programming, upgrading and moving, so that the stability of data is ensured.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic diagram of an embodiment of the method of the present invention;
FIG. 2 is a schematic diagram of a slot structure configured in an embodiment of the method of the present invention;
fig. 3 is a schematic diagram of an embodiment of the system of the present invention.
Detailed Description
In order to clearly illustrate the technical features of the present solution, the present invention will be described in detail below with reference to the following detailed description and the accompanying drawings. The following disclosure provides many different embodiments, or examples, for implementing different structures of the invention. In order to simplify the present disclosure, components and arrangements of specific examples are described below. Furthermore, the present invention may repeat reference numerals and/or letters in the various examples. This repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed. It should be noted that the components illustrated in the figures are not necessarily drawn to scale. Descriptions of well-known components and processing techniques and processes are omitted so as to not unnecessarily obscure the present invention.
As shown in fig. 1, an embodiment of the present invention provides a firmware storage method, which includes the following steps:
s1, programming factory firmware to a preset slot stored in a hard disk nandflash, wherein the slot is divided into two parts of a table tennis;
s2, when a preset timing strategy is met in the running process of the firmware, the firmware is moved to another part based on the part of the current storage position of the firmware.
As shown in fig. 2, in step S2, a plurality of slots are set, each slot is divided into two parts of ping pong, and each part is divided into two parts of primary and secondary parts.
When the SSD is in industrialization, the factory firmware is programmed into the nandflash of the SSD, in order to prevent the subsequent firmware from being updated online to damage the factory firmware, the slot1 is set to be read-only, and the position of the slot2 or the slot3 can be updated online. Slot is respectively positioned on different die (memory chips) of the same block of nandflash.
When the firmware is written or updated online, the same slot can be written with two copies on the nandflash, the two copies are used as backups, when the SSD is electrified, a bootstrap program can firstly read from the slot main firmware position, if the read is successful, the firmware is loaded, and if the read fails, the same slot backup position is read.
Different channels in the same block are used as backups for slot firmware.
In step S2, the specific process of moving the firmware to another part based on the part to which the current storage location of the firmware belongs is as follows:
judging whether the nandflash of the other part is erased or not;
if not, executing an erasing operation, and then writing the firmware into the other part;
if yes, the firmware is directly written into the other part.
And when the firmware is written into the other part, the main part and the standby part are simultaneously written.
When the firmware moving operation is carried out, each slot in which the firmware is stored is moved under the current slot, and if the operation fails, the risk of losing the firmware is reported.
In one implementation manner of the embodiment of the present invention, after the firmware is moved to another part, the method further includes:
the pointer of the current firmware in the metadata is changed to point to the other part. When the SSD is powered up again, the firmware is read from the pointer location in the metadata.
As shown in fig. 3, the firmware storage system provided in the embodiment of the present invention includes a firmware writing unit 1 and a firmware moving unit 2.
The firmware programming unit 1 is used for programming factory firmware to a preset slot stored in the nandflash, and the slot is divided into two parts of table tennis; the firmware moving unit 2 is used for moving the firmware to another part based on the part of the current storage position of the firmware when the preset timing strategy is met in the firmware operation process.
The system further comprises a configuration unit 3, wherein the configuration unit 3 is used for setting a plurality of slots on the nandflash, each slot is divided into two parts of ping pong, and each part is divided into two parts of main part and standby part.
When the SSD is in industrialization, the factory firmware is programmed into the nandflash of the SSD, in order to prevent the subsequent firmware from being updated online to damage the factory firmware, the slot1 is set to be read-only, and the position of the slot2 or the slot3 can be updated online. Slot is respectively positioned on different die (memory chips) of the same block of nandflash.
When the firmware is written or updated online, the same slot can be written with two copies on the nandflash, the two copies are used as backups, when the SSD is electrified, a bootstrap program can firstly read from the slot main firmware position, if the read is successful, the firmware is loaded, and if the read fails, the same slot backup position is read.
When the firmware runs, for example, the timer is 10 days, when the timer expires, the firmware firstly judges which part of ping pong is the current position, if so, the firmware judges whether nandflash of the pong position is erased, if not, the firmware is written into the pong position, the pointer of the current firmware in the metadata is changed, and when the SSD is powered on again, the firmware is read from the pointer position in the metadata.
The firmware moving operation traverses each slot, if the slot has firmware, the step (3) is carried out; if the recovery operation fails, an alarm needs to be reported, and the firmware of the SSD is at risk of being lost.
The embodiment of the invention also provides a computer storage medium, wherein computer instructions are stored in the computer storage medium, and when the computer instructions run on a system, the system is caused to execute the steps of the method.
While the foregoing description of the embodiments of the present invention has been presented in conjunction with the drawings, it should be understood that it is not intended to limit the scope of the invention, but rather, it is intended to cover all modifications or variations within the scope of the invention as defined by the claims of the present invention.

Claims (5)

1. A method of firmware storage, the method comprising the steps of:
writing the factory firmware on a preset slot stored in a hard disk nandflash, wherein the slot is divided into two parts of a table tennis;
during the running process of the firmware, when a preset timing strategy is met, the firmware is moved to another part based on the part of the current storage position of the firmware;
the number of slots is multiple, each slot is divided into two parts of ping-pong, and each part is divided into two parts of main part and standby part;
when the SSD is in factory, writing factory firmware into nandflash of the SSD, setting slot1 as read-only, and setting the position of slot2 or slot3 as online upgrade; the slots are respectively positioned on different memory chips of the same block of the nandflash;
when the firmware is written or updated online, the same slot is written with two copies as backup on nandflash, when SSD is electrified, a bootstrap program firstly reads from the slot main firmware position, if the read is successful, the firmware is loaded, and if the read is failed, the same slot backup position is read again;
when the firmware moving operation is carried out, each slot in which the firmware is stored is moved under the current slot, and if the operation fails, the risk of losing the firmware is reported.
2. The firmware storage method as claimed in claim 1, wherein the specific process of moving the firmware to another part based on the part to which the current storage location of the firmware belongs is:
judging whether the nandflash of the other part is erased or not;
if not, executing an erasing operation, and then writing the firmware into the other part;
if yes, the firmware is directly written into the other part.
3. The firmware storage method as claimed in claim 2, wherein said moving the firmware to another part further comprises:
the pointer of the current firmware in the metadata is changed to point to the other part.
4. A firmware storage system, the system comprising:
the firmware programming unit is used for programming the factory firmware to a preset slot stored in the hard disk nandflash, and the slot is divided into two parts of a table tennis;
the firmware moving unit is used for moving the firmware to another part based on the part of the current storage position of the firmware when the preset timing strategy is met in the firmware operation process;
the configuration unit is used for setting a plurality of slots on the nandflash, each slot is divided into two parts of ping pong, and each part is divided into two parts of main part and standby part;
the number of slots is multiple, each slot is divided into two parts of ping-pong, and each part is divided into two parts of main part and standby part;
when the SSD is in factory, writing factory firmware into nandflash of the SSD, setting slot1 as read-only, and setting the position of slot2 or slot3 as online upgrade; the slots are respectively positioned on different memory chips of the same block of the nandflash;
when the firmware is written or updated online, the same slot is written with two copies as backup on nandflash, when SSD is electrified, a bootstrap program firstly reads from the slot main firmware position, if the read is successful, the firmware is loaded, and if the read is failed, the same slot backup position is read again;
when the firmware moving operation is carried out, each slot in which the firmware is stored is moved under the current slot, and if the operation fails, the risk of losing the firmware is reported.
5. A computer storage medium having stored therein computer instructions which, when run on the system of claim 4, cause the system to perform the steps of the method of any of claims 1-3.
CN202210046120.XA 2022-01-14 2022-01-14 Firmware storage method and system Active CN114464231B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210046120.XA CN114464231B (en) 2022-01-14 2022-01-14 Firmware storage method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210046120.XA CN114464231B (en) 2022-01-14 2022-01-14 Firmware storage method and system

Publications (2)

Publication Number Publication Date
CN114464231A CN114464231A (en) 2022-05-10
CN114464231B true CN114464231B (en) 2024-02-13

Family

ID=81408967

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210046120.XA Active CN114464231B (en) 2022-01-14 2022-01-14 Firmware storage method and system

Country Status (1)

Country Link
CN (1) CN114464231B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117707436B (en) * 2024-02-05 2024-05-03 苏州元脑智能科技有限公司 Firmware mode switching method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101183337A (en) * 2007-12-12 2008-05-21 中兴通讯股份有限公司 Space management techniques based on NAND FLASH mobile terminal storage medium
CN107315616A (en) * 2017-06-30 2017-11-03 郑州云海信息技术有限公司 A kind of loading method of firmware, device and electronic equipment
CN108170368A (en) * 2016-12-07 2018-06-15 北京忆恒创源科技有限公司 The method and system of online upgrading firmware
CN110597457A (en) * 2019-08-06 2019-12-20 深圳市金泰克半导体有限公司 Solid state disk, control method of solid state disk and controller
CN113032246A (en) * 2021-03-04 2021-06-25 成都佰维存储科技有限公司 SSD (solid State disk) firmware operation method and device, readable storage medium and electronic equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10853179B2 (en) * 2018-12-21 2020-12-01 Dell Products L.P. Information handling system and method for restoring firmware in one or more regions of a flash memory device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101183337A (en) * 2007-12-12 2008-05-21 中兴通讯股份有限公司 Space management techniques based on NAND FLASH mobile terminal storage medium
CN108170368A (en) * 2016-12-07 2018-06-15 北京忆恒创源科技有限公司 The method and system of online upgrading firmware
CN107315616A (en) * 2017-06-30 2017-11-03 郑州云海信息技术有限公司 A kind of loading method of firmware, device and electronic equipment
CN110597457A (en) * 2019-08-06 2019-12-20 深圳市金泰克半导体有限公司 Solid state disk, control method of solid state disk and controller
CN113032246A (en) * 2021-03-04 2021-06-25 成都佰维存储科技有限公司 SSD (solid State disk) firmware operation method and device, readable storage medium and electronic equipment

Also Published As

Publication number Publication date
CN114464231A (en) 2022-05-10

Similar Documents

Publication Publication Date Title
CN109582217B (en) Data storage device and method for writing data into memory device
CN103853582B (en) Flash memory update method
CN102023908A (en) Method and device for backing up boot program
US10825529B2 (en) Low latency memory erase suspend operation
CN111142907B (en) Partition upgrading method for off-line keyword recognition system
CN102541690B (en) Intelligent card and method for recovering data
CN104516959A (en) Method and device for managing database logs
CN114464231B (en) Firmware storage method and system
WO2015199700A1 (en) Post package repair (ppr) data in non-volatile memory
CN101206579A (en) Computer system capable of avoiding update of basic input /output system program from failing and updating method thereof
CN103778964B (en) Process, using method and the device of a kind of NAND Flash programming data, system
US20220043724A1 (en) Memory Device Providing Fast Data Recovery
CN102024502A (en) Flash device testing method and device as well as board and network equipment
CN104503781A (en) Firmware upgrading method for hard disk and storage system
CN109491592B (en) Storage device, data writing method thereof and storage device
CN102395956B (en) Processing method and device for system commands during memory backup procedure
CN110875078B (en) Processing system and method for abnormal power failure of storage device
CN117472647A (en) Database transaction rollback method and device
CN114063901A (en) SSD-supported read-only mode after PLP backup failure
CN116795408A (en) ECU software upgrading method and system and vehicle
CN111522598A (en) Method and device for recording restart information of embedded equipment
CN116301973A (en) Firmware upgrading method, device, equipment and readable storage medium
CN110119285A (en) A kind of low side scm software upgrade method and relevant apparatus
CN115202579A (en) Memory data storage method and system
CN111785316B (en) Method, system, storage medium and terminal for overcoming erasure interference

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
GR01 Patent grant
GR01 Patent grant