CN111142792B - Power-down protection method of storage device - Google Patents

Power-down protection method of storage device Download PDF

Info

Publication number
CN111142792B
CN111142792B CN201911299445.3A CN201911299445A CN111142792B CN 111142792 B CN111142792 B CN 111142792B CN 201911299445 A CN201911299445 A CN 201911299445A CN 111142792 B CN111142792 B CN 111142792B
Authority
CN
China
Prior art keywords
data
log
flush tag
system data
stored
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
CN201911299445.3A
Other languages
Chinese (zh)
Other versions
CN111142792A (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.)
Yaoyun Technology Xi'an Co ltd
Original Assignee
Yaoyun Technology Xi'an 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 Yaoyun Technology Xi'an Co ltd filed Critical Yaoyun Technology Xi'an Co ltd
Priority to CN201911299445.3A priority Critical patent/CN111142792B/en
Publication of CN111142792A publication Critical patent/CN111142792A/en
Application granted granted Critical
Publication of CN111142792B publication Critical patent/CN111142792B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0619Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C5/00Details of stores covered by group G11C11/00
    • G11C5/14Power supply arrangements, e.g. power down, chip selection or deselection, layout of wirings or power grids, or multiple supply levels
    • G11C5/148Details of power up or power down circuits, standby circuits or recovery circuits
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Power Engineering (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The invention is applicable to the technical field of data storage safety, and provides a power failure protection method of a storage device. A power down protection method of a storage device, the method comprising: the data storage process is divided into Flush Tag stages; completely storing data before the Flush Tag is finished; generating and storing a log when the Flush Tag is finished; block pre-allocation and limited use of the Flush Tag; scanning the latest log based on the log and acquiring a Flush Tag; scanning and loading system data based on the latest log; block resources are acquired based on the latest log, and valid host data and system data are scanned and recovered. The invention can improve the safety of data storage and ensure the integrity and consistency of the protected data under the condition of no capacitance extremely.

Description

Power-down protection method of storage device
Technical Field
The invention is applicable to the technical field of data storage safety, and provides a power failure protection method of a storage device.
Background
Since Host uses Sector as the minimum unit and NAND uses Page (usually 16 KB) as the unit, and there is no duplication problem, FTL becomes the mainstream technology to implement mapping of Host command logical address to physical address. The storage device of various NVM media, such as NAND, needs to store various system data including FTL in addition to completely storing data read and written by the host.
When abnormal power failure events such as host power failure, hot plugging and the like occur, effective data protection needs to store complete host data and user data in the Cache, and the two events are not available.
According to the traditional technical scheme, when abnormal power failure occurs, the host data and the user data in the Cache are synchronously stored by means of endurance of a capacitor or a battery and the like; and when the power is powered on again, alignment operation is carried out on the actual storage condition of the host data and the user data so as to avoid the problems of data partial loss or data error and the like. The data amount required to be stored is large when the abnormal power failure occurs, and the power-on reconstruction operation is complex and consumes long time.
Disclosure of Invention
The present invention is directed to solve the above problems, and provides a method for protecting host data and corresponding system data written in NVM without depending on capacitor or battery endurance, and a method for fast booting.
The technical scheme of the invention is as follows:
a power failure protection method of a storage device is disclosed, wherein stored data comprises host data and system data; the method comprises the following steps:
and a data storage stage:
(1) The data storage process is divided into stages with different Flush Tag numbers, and the end point of each stage ensures that data is completely stored in the NVM;
(2) After the data storage of each Flush Tag is finished, a log is correspondingly generated and stored in the NVM; the data and the log have corresponding storage areas in the NVM, the host data are stored in the host data storage area, the system data are stored in the system data storage area, and the log is stored in the log storage area;
(3) In the Flush Tag stage, host data can only be stored in the available block resources corresponding to the host data; when the available block resources are used up, the Flush Tag stage is triggered to end; the Flush Tag allocated for the next Flush Tag stage must be larger than the Flush Tag of the previous Flush Tag stage;
and (3) a data recovery stage:
(4) When the storage device is powered on, scanning logs in a log storage area, and determining the latest log and the corresponding Flush Tag; after determining the latest log, scanning system data corresponding to the latest log in a system data storage area based on the latest log and the Flush Tag corresponding to the latest log to obtain an effective storage position of the system data;
(5) Scanning the effective storage position of the obtained system data, reading and loading each system table entry, and completing the recovery of the complete system data at the end point of the latest log and the corresponding Flush Tag stage;
(6) Reading the block resource information of the next Flush Tag, and scanning whether effective host data exists in the block resource range; if the host data does not exist, the system data does not need to be updated; if the valid host data exists, recovering the system data corresponding to the host data;
(7) And completing system data recovery and power-on processing.
Preferably, the system data includes useful data other than all host data such as FTL, BBT, etc., including but not limited to: NVM resource management data, bad block data in NVM, valid/invalid page identification in NVM, NVM service life data, mapping table data and system operation data.
Preferably, the NVM is a non-volatile memory including, but not limited to NOR, NAND, MRAM, and PCM.
Preferably, the stored host data and the system data each include its corresponding Flush Tag. To confirm which Flush Tag it belongs to.
Preferably, the block resources available in each Flush Tag stage are pre-allocated at the time of log generation of the previous Flush Tag and stored in the NVM.
Preferably, the host data includes a summary of the system data corresponding to the host data when stored. The system data digest is used to describe corresponding system data information of the host data, including but not limited to corresponding logical addresses of the host data.
The invention has the technical effects that:
the method provided by the invention divides the data storage process into Flush Tag stages; completely storing data before the Flush Tag is finished; generating and storing a log when the Flush Tag is finished; block pre-allocation and limited use of Flush Tag; scanning the latest log based on the log and acquiring a Flush Tag; scanning and loading system data based on the latest log; block resources are acquired based on the latest log, and valid host data and system data are scanned and recovered. The invention can improve the safety of data storage and ensure the integrity and consistency of the protected data under the condition of no capacitance extremely.
Drawings
FIG. 1 is a schematic diagram of the storage of logs for each Flush Tag.
Fig. 2 is a schematic storage diagram of each system data.
Fig. 3 is a schematic diagram of available block resources allocated in each Flush Tag phase and the usage process thereof in each Flush Tag phase.
FIG. 4 is a flow chart of a process for powering up the memory device.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. 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 invention.
A power-down protection method of a storage device comprises the following steps:
and a data storage stage:
(1) The data storage process is divided into stages with different Flush Tag numbers, and the end point of each stage ensures that data is completely stored in the NVM; the stored host data and the system data both comprise corresponding Flush tags. To confirm which Flush Tag it belongs to. The host data will contain the digest of its corresponding system data when stored. The system data abstract is used for describing corresponding system data information of the host data, and comprises a corresponding logical address which is not limited to the host data;
(2) After the data storage of each Flush Tag is finished, a log is correspondingly generated and stored in the NVM; the data and the log have corresponding storage areas in the NVM, the host data are stored in the host data storage area, the system data are stored in the system data storage area, and the log is stored in the log storage area;
(3) In the Flush Tag stage, host data can only be stored in the available block resources corresponding to the host data; the block resources available in each Flush Tag stage are pre-allocated when the log of the previous Flush Tag is generated, and are stored in the NVM. When the available block resources are used up, the Flush Tag stage is triggered to end; the Flush Tag allocated for the next Flush Tag stage must be larger than the Flush Tag of the previous Flush Tag stage;
and (3) a data recovery phase:
(4) When the storage device is powered on, scanning logs in a log storage area, and determining the latest log and the Flush Tag corresponding to the latest log; after determining the latest log, scanning system data corresponding to the latest log in a system data storage area based on the latest log and the Flush Tag corresponding to the latest log to obtain an effective storage position of the system data;
(5) Scanning the effective storage position of the obtained system data, reading and loading each system data, and completing the recovery of the complete system data at the end point of the latest log and the corresponding Flush Tag stage;
(6) Reading the block resource information of the next Flush Tag, and scanning whether effective host data exists in the block resource range; if the host computer data does not exist, the system data does not need to be updated; if the valid host data exists, the system data corresponding to the host data is recovered by reading the system data summary information of each data;
(7) And completing system data recovery and power-on processing.
The system data includes useful data other than all host data such as FTL and BBT, including but not limited to: NVM resource management data, bad block data in NVM, identification of valid/invalid page in NVM, NVM service life data, mapping table data and system operation data. The NVM is a non-volatile memory including, but not limited to NOR, NAND, MRAM, and PCM.

Claims (6)

1. A power failure protection method of a storage device is disclosed, wherein the stored data comprises host data and system data; the method is characterized in that: the method comprises the following steps:
and a data storage stage:
(1) The data storage process is divided into stages with different Flush Tag numbers, and the end point of each stage ensures that data is completely stored in the NVM;
(2) After the data storage of each Flush Tag is finished, a log is correspondingly generated and stored in the NVM; the data and the log have corresponding storage areas in the NVM, the host data is stored in the host data storage area, the system data is stored in the system data storage area, and the log is stored in the log storage area;
(3) In the present Flush Tag phase, the host data can only be stored in its corresponding available block resource; the available block resources in each Flush Tag stage are pre-allocated when the log of the previous Flush Tag is generated and stored in the NVM; when the available block resources are used up, the Flush Tag stage is triggered to end; the Flush Tag allocated for the next Flush Tag stage must be larger than the Flush Tag of the previous Flush Tag stage;
and (3) a data recovery stage:
(4) When the storage device is powered on, scanning logs in a log storage area, and determining the latest log and the Flush Tag corresponding to the latest log; after the latest log is determined, scanning system data corresponding to the latest log in a system data storage area based on the latest log and the Flush Tag corresponding to the latest log to obtain an effective storage position of the system data;
(5) Scanning the effective storage position of the obtained system data, reading and loading each system table entry, and completing the recovery of the latest log and the complete system data at the end point of the Flush Tag stage corresponding to the latest log;
(6) Reading the block resource information of the next Flush Tag, and scanning whether effective host data exists in the block resource range; if the host data does not exist, the system data does not need to be updated; if the valid host data exists, recovering the system data corresponding to the host data;
(7) And completing system data recovery and power-on processing.
2. The power-fail protection method of the storage device according to claim 1, characterized in that: the system data comprises useful data except all host data, including NVM resource management data, bad block data in the NVM, valid/invalid page identification in the NVM, NVM service life data, mapping table data and system operation data.
3. The power-fail protection method of the storage device according to claim 1, characterized in that: the NVM is non-volatile memory including NOR, NAND, MRAM, and PCM.
4. The power-fail protection method of the storage device according to claim 1, characterized in that: the stored host data and the system data both comprise corresponding Flush tags.
5. The power-fail protection method of the storage device according to claim 1, characterized in that: the host data will contain summary information of the corresponding system data when stored.
6. The power-fail protection method of the storage device according to claim 1, characterized in that: in the step (6), if there is valid host data, the summary information of the system data of the data is read to recover the system data.
CN201911299445.3A 2019-12-17 2019-12-17 Power-down protection method of storage device Active CN111142792B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911299445.3A CN111142792B (en) 2019-12-17 2019-12-17 Power-down protection method of storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911299445.3A CN111142792B (en) 2019-12-17 2019-12-17 Power-down protection method of storage device

Publications (2)

Publication Number Publication Date
CN111142792A CN111142792A (en) 2020-05-12
CN111142792B true CN111142792B (en) 2022-11-22

Family

ID=70518550

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911299445.3A Active CN111142792B (en) 2019-12-17 2019-12-17 Power-down protection method of storage device

Country Status (1)

Country Link
CN (1) CN111142792B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111753337B (en) * 2020-07-02 2023-02-21 上海电器科学研究所(集团)有限公司 SOC (State of Charge) processing method for energy storage battery management system during unexpected power failure

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102789431A (en) * 2012-06-29 2012-11-21 记忆科技(深圳)有限公司 Data protection method and system
CN104035893A (en) * 2014-06-30 2014-09-10 浪潮(北京)电子信息产业有限公司 Method for data storage during abnormal power down of computer
CN106294217A (en) * 2016-08-16 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of SSD system and power-off protection method thereof
CN106502928A (en) * 2016-09-29 2017-03-15 华为技术有限公司 A kind of storage system power-off protection method, storage control and electronic equipment
CN106776130A (en) * 2016-11-30 2017-05-31 华为技术有限公司 A kind of journal recovery method, storage device and memory node

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7272745B2 (en) * 2004-06-30 2007-09-18 Intel Corporation Data protection system
US8615681B2 (en) * 2010-12-14 2013-12-24 Western Digital Technologies, Inc. System and method for maintaining a data redundancy scheme in a solid state memory in the event of a power loss
CN107038131A (en) * 2016-02-04 2017-08-11 广明光电股份有限公司 Solid state hard disc power-off protection apparatus and method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102789431A (en) * 2012-06-29 2012-11-21 记忆科技(深圳)有限公司 Data protection method and system
CN104035893A (en) * 2014-06-30 2014-09-10 浪潮(北京)电子信息产业有限公司 Method for data storage during abnormal power down of computer
CN106294217A (en) * 2016-08-16 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of SSD system and power-off protection method thereof
CN106502928A (en) * 2016-09-29 2017-03-15 华为技术有限公司 A kind of storage system power-off protection method, storage control and electronic equipment
WO2018059361A1 (en) * 2016-09-29 2018-04-05 华为技术有限公司 Power down protection method for storage system, storage controller, and electronic device
CN106776130A (en) * 2016-11-30 2017-05-31 华为技术有限公司 A kind of journal recovery method, storage device and memory node

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
A high security and efficiency protection of confidentiality and integrity for off-chip memory;Su, Yang等;《Journal of Ambient Intelligence and Humanized Computing》;20190731;第2633-2643页 *
一种基于Nandflash的实时数据存储方案设计;李秋华等;《工业控制计算机》;20160731(第07期);第70-71页 *

Also Published As

Publication number Publication date
CN111142792A (en) 2020-05-12

Similar Documents

Publication Publication Date Title
TWI444825B (en) Memory storage device, memory controller thereof, and method for programming data thereof
US9104329B2 (en) Mount-time reconciliation of data availability
US10909030B2 (en) Enhanced trim command support for solid state drives
CN103577121B (en) A kind of highly reliable linear file access method based on Nand Flash
US7711923B2 (en) Persistent flash memory mapping table
US20180275887A1 (en) Data Storage Device and Operating Method of Data Storage Device
CN103577574B (en) High-reliability linear file system based on nand flash
EP2570927B1 (en) Handling unclean shutdowns for a system having non-volatile memory
TWI645404B (en) Data storage device and control method for non-volatile memory
US10997039B2 (en) Data storage device and operating method thereof
US20100070729A1 (en) System and method of managing metadata
US10838629B2 (en) Solid state device with fast boot after ungraceful shutdown
TW200929224A (en) Data writing method for flash memory and controller thereof
TWI479505B (en) Data management method, memory controller and memory storage apparatus
US10459803B2 (en) Method for management tables recovery
TWI498738B (en) File protecting method and system, and memory controller and memory storage apparatus thereof
US20150074336A1 (en) Memory system, controller and method of controlling memory system
TW201508748A (en) Data writing method, memory controller and memory storage apparatus
JP2007011872A (en) Memory card and control method therefor
TWI493341B (en) Memory storage device and repairing method thereof
CN103578566B (en) Memory storage apparatus and restorative procedure thereof
CN111142792B (en) Power-down protection method of storage device
KR20190006687A (en) Data storage device and operating method thereof
CN109002265B (en) Data processing method and related device
TWI354892B (en) Method of immediate data update with flash memory

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
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A power-off protection method for storage devices

Granted publication date: 20221122

Pledgee: Bank of China Limited Xi'an Chang'an District Branch

Pledgor: Yaoyun Technology (Xi'an) Co.,Ltd.

Registration number: Y2024610000090