CN109976938B - Data storage device and non-volatile memory operation method - Google Patents

Data storage device and non-volatile memory operation method Download PDF

Info

Publication number
CN109976938B
CN109976938B CN201810709213.XA CN201810709213A CN109976938B CN 109976938 B CN109976938 B CN 109976938B CN 201810709213 A CN201810709213 A CN 201810709213A CN 109976938 B CN109976938 B CN 109976938B
Authority
CN
China
Prior art keywords
data
last page
pages
shot
page
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
CN201810709213.XA
Other languages
Chinese (zh)
Other versions
CN109976938A (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.)
Silicon Motion Inc
Original Assignee
Silicon Motion Inc
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 Silicon Motion Inc filed Critical Silicon Motion Inc
Publication of CN109976938A publication Critical patent/CN109976938A/en
Application granted granted Critical
Publication of CN109976938B publication Critical patent/CN109976938B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1008Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices
    • G06F11/1068Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices in sector programmable memories, e.g. flash disk
    • 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
    • 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/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1008Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices
    • G06F11/1048Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices using arrangements adapted for a specific error detection or correction feature
    • 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/1456Hardware arrangements for backup
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory
    • G06F12/0261Garbage collection, i.e. reclamation of unreferenced memory using reference counting
    • 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/0604Improving or facilitating administration, e.g. storage management
    • 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/064Management of blocks
    • 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
    • G11C16/00Erasable programmable read-only memories
    • G11C16/02Erasable programmable read-only memories electrically programmable
    • G11C16/06Auxiliary circuits, e.g. for writing into memory
    • G11C16/10Programming or data input circuits
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1032Reliability improvement, data loss prevention, degraded operation etc
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7204Capacity control, e.g. partitioning, end-of-life degradation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7207Details relating to flash memory management management of metadata or control data

Landscapes

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

Abstract

The present invention relates to a power recovery technique for a data storage device, and more particularly, to a data storage device and a method for operating a non-volatile memory. The data storage device has a non-volatile memory and a control unit. The non-volatile memory receives data by a single completion write operation. Each single completion write operation writes N pages of data. N is a number greater than 1. When the data storage device is powered back, the control unit enables a last page index of an active block used before the non-volatile memory is powered off to point to a last page of N pages of data written by a write operation which is finished in a single shot.

Description

Data storage device and non-volatile memory operation method
Technical Field
The invention relates to a data storage device and an operation method of a non-volatile memory in the data storage device.
Background
Non-volatile memory is available in various forms, such as flash memory (flash memory), Magnetoresistive random access memory (Magnetoresistive RAM), Ferroelectric random access memory (Ferroelectric RAM), Resistive random access memory (Resistive RAM), Spin Transfer Torque RAM (STT-RAM) …, and the like, for long-term data retention.
However, write operations to non-volatile memory may be interrupted by an unexpected power down. To ensure data reliability, a power restoration procedure of a data storage device is an important issue in the art.
Disclosure of Invention
When the data storage device is powered back, the data reliability is judged based on the size of a single-shot write operation (one shot programming).
A data storage device implemented according to an embodiment of the invention includes a non-volatile memory and a control unit. The non-volatile memory receives data by a single-burst write operation. Each single completion write operation writes N pages of data. N is a number greater than 1. When the data storage device is powered back, the control unit enables a last page index of an active block used before the non-volatile memory is powered off to point to a last page of N pages of data written by a write operation in a single-shot mode.
Another embodiment of the present invention provides a method for operating a non-volatile memory, including: enabling a non-volatile memory to receive data through single-shot write-in operation, wherein each single-shot write-in operation writes N pages of data, and N is a number greater than 1; and when the data storage device is powered back, enabling a last page index of an active block used before the non-volatile memory is powered off to point to a last page in the N pages of data which are written by a write-in operation and are sent back singly.
In one embodiment, the last page pointer indicates that the single write operation of N pages of data must be error checked. When the error check fails, the last page index needs to be corrected to point to the last page in the N pages of data written by the write operation which is completed in a single-shot manner in the previous time.
In one embodiment, after the last page pointer is determined, whether the N pages of data for completing the write operation in a single shot corresponding to the space pointed by the last page pointer are affected by power failure and need to be determined again for moving the data.
In one embodiment, if the space pointed by the last page pointer is not consecutive to an empty page, the N pages of data that have been written in a single burst corresponding to the space pointed by the last page pointer are not shifted.
In one embodiment, if the mapping information of the single-shot write operation corresponding to the space pointed by the last page pointer is sealed, the N pages of data of the single-shot write operation corresponding to the space pointed by the last page pointer are not moved.
In one embodiment, after the last page pointer is determined, if the N pages of data of a single-shot write operation corresponding to the space pointed by the last page pointer are updated or moved, the data is not moved.
The following description specifically illustrates embodiments of the present invention, with reference to the accompanying drawings.
Drawings
FIG. 1 illustrates, in block diagram form, a data storage device 100 implemented in accordance with one embodiment of the present invention, including a flash memory 102 and a control unit 104;
FIG. 2 is a flowchart illustrating a power restoration procedure implemented according to an embodiment of the present invention, further including the determination and movement of unreliable data (steps S208 and S212);
FIG. 3 illustrates the flow of FIG. 2;
FIG. 4 illustrates an exception condition of the unreliable data moving step S212;
fig. 5 illustrates an example of an exceptional situation in the unreliable data moving step S212.
Description of the symbols
100-a data storage device;
102-flash memory;
104-a control unit;
106 to the host:
112-in-system program code block pool;
114-system information block pool;
116-idle block pool;
118-data chunk pool;
122 to a microprocessor;
124 read-only memory;
126 volatile memory;
130. pages 132 and 134;
140-mapping information;
a _ BLK-active block;
F2H, H2F-mapping table;
a _ BLK-index, pointing to the active block a _ BLK;
seal-index, indicating the sealing progress of the mapping table;
s202 … S212.
Detailed Description
The following description sets forth various embodiments of the invention. The following description is made for the purpose of illustrating the general principles of the invention and is not meant to limit the invention. The actual invention scope should be determined from the following claims.
The nonvolatile memory may be a flash memory (flash memory), a Magnetoresistive random access memory (Magnetoresistive RAM), a Ferroelectric RAM (Ferroelectric RAM), a Resistive RAM (RRAM), a Spin Transfer Torque RAM (STT-RAM) …, etc., and provides a storage medium for long-term data storage, and may be used to implement a data storage device or applied to a data center. The following discussion will be made particularly with reference to a flash memory (flash memory) as an example.
Nowadays, flash memory is often used as a storage medium in data storage devices to implement memory cards (memory cards), universal serial bus flash devices (USB flash devices), Solid State Drives (SSD) …, and other products. One application is the packaging of flash memory with its controller in a multi-chip package-known as an embedded flash memory module (e.g., eMMC).
The data storage device using the flash memory as the storage medium can be applied to various electronic devices. The electronic device comprises an intelligent mobile phone, a wearable device, a tablet computer, a virtual reality device … and the like. The operation module of the electronic device can be regarded as a host (host) to operate the used data storage device to access the flash memory therein.
Flash memory implemented storage media may also be used to construct data centers. For example, a server may operate an array of Solid State Drives (SSDs) forming a data center. The server can be regarded as a host (host) to operate the connected solid state disk to access the flash memory therein.
The host side distinguishes data by logical addresses (e.g., logical block address LBA or global host page number GHP …). The physical space of the flash memory is in blocks (blocks) and is configured to receive a plurality of pages (pages) of data that the host requires to write. In order to optimize the use of the flash memory, the storage space of the flash memory is dynamically allocated to the logical address identified by the host. The mapping information between logical addresses and storage spaces needs to be managed properly.
The flash memory needs reference to, or may be involved in, mapping information for various operations. For example, the mapping information is needed to read the flash memory, and the mapping information is needed to update the write operation of the flash memory. In particular, the storage space of the flash memory needs to be reused after erase (erase) is performed on a block basis. Since each block can be erased for an upper limit, the operation of the flash memory has a requirement for wear leveling (wear leveling). In addition, old data updates are not duplicative of the same space. After the new version of data is written into the free space, the old space contents will be marked as invalid. A block may sporadically retain valid data, so a garbage collection (garbage collection) requirement is generated accordingly. The sporadic valid data retained in a block can be moved to the free space by garbage collection technology, so that the block with invalid data left can be erased and reused. The above-described erasures and garbage collection techniques both involve referencing or updating mapping information. Maintenance of mapping information is necessary.
There are various ways to maintain the mapping information. The mapping information about the data receiving blocks (receiving host-requested write data, or as garbage collection blocks) that are being allocated for use can be dynamically updated by the mapping table F2H. The mapping table F2H is indexed by physical space, and is labeled with corresponding logical addresses, so that dynamic maintenance can be performed on volatile memory. Mapping table F2H needs to be reversely sorted into mapping table H2F, providing a mapping information query mechanism using logical address as index. Mapping table H2F needs to be backed up on the flash memory in a non-volatile manner; that is, the mapping information of small table F2H needs to be sealed (seal) to large table H2F. In addition, after small table F2H is sealed into large table H2F, small table F2H can also be stored in a flash memory for determining whether each page of the data receiving block stores valid data in a subsequent garbage collection operation. In particular, the logical address corresponding to each page of the data receiving block can be recorded in the metadata (meta data) of the page. In this way, if a unexpected power-off event occurs, the scan metadata can be reconstructed even if the volatilely stored small table F2H is lost without having to be sealed to large table H2F.
With respect to unexpected power-off events, a write operation that is interrupted by the unexpected power-off event will be unreliable, and even affect the reliability of the front and back spaces. For example, data that can be correctly read out immediately after power restoration is destroyed and cannot be read out after a burst. Such data stability issues need to be considered in the power recovery process.
The flash memory of the invention particularly adopts a high-density storage technology to improve the storage density of a unit physical space. For example, multi-level storage (MLC) allows a unit physical space to store double data, and three-level storage (TLC) allows a unit physical space to store triple data, as compared to single-level Storage (SLC). The high density storage technique employed in the present invention particularly provides a single shot programming operation, which allows multiple pages of data in a unit physical space to be written simultaneously. Even more, flash memory devices may have single-sided (1-plane), double-sided (2-plane), or even more read/write designs, which determine the number of sides involved in a single read/write operation (e.g., single-sided, or across two-sided, or across more sides). Thus, a single shot programming operation is performed for N pages of writing, where N is an integer greater than 1, and may be the product of Level # (the number of pages of data in the shared unit physical space) and Plane # (the number of planes in the common operation): n is Level #. Plane #. Taking a 3D MLC flash memory as an example, the number of pages of data in the shared unit physical space is 2. For double-sided (2-plane) writing, the value of N is 2x2, i.e. 4. Alternatively, considering the multi-chip enable function, if the physical space quantity that can be activated alternately by programming the chip activation signals (CE signals) is CE #, then the N value calculation is multiplied by CE #, which is Level #, Plane #, CE #. The present invention considers such a single shot programming feature to perform the power-up procedure.
Fig. 1 illustrates, in block diagram form, a data storage device 100 implemented in accordance with one embodiment of the present invention, which includes a flash memory 102 and a control unit 104. The control unit 104 operates the flash memory 102 in response to a request from the host 106. The storage space of the flash memory 102 can be configured for use in various categories. The in-system code (ISP) block pool 112 stores in-system code (ISP). The system information block pool 114 stores system information. The active block a _ BLK is selected from the pool of idle blocks 116 for use in data reception, either in response to a write request or as a collection block for garbage collection. In particular, the active block a _ BLK receives data from the single-shot write operation (one shot programming). When performing double-sided writing with SLC, the active block a _ BLK receives two pages of data at a time. When performing single-sided writing with MLC, the active block a _ BLK receives two pages of data at a time. When double-sided writing is performed by MLC, the active block a _ BLK receives four pages of data at a time. When performing single-sided writing by TLC, the active block a _ BLK receives three pages of data at a time. When performing double-sided writing by TLC, the active block a _ BLK receives six pages of data at a time. After completing the data reception, the active block a _ BLK will be pushed into the data block pool 118. The system information stored in the system information block pool 114 may include a mapping table H2F, and may also record a pointer a _ BLK indicating which physical space is currently used as the active block a _ BLK.
The control unit 104 includes a microprocessor 122, a read only memory 124, and a volatile memory 126. The ROM 124 and the volatile memory 126 may be integrated with the microprocessor 122 or external to the microprocessor 122. The ROM 124 carries read-only code. The microprocessor 122 can operate the flash memory 102 according to the ROM code loaded in the ROM 124 and the system code loaded in the ISP block pool 112, during which the microprocessor 122 can utilize the volatile memory 126 to dynamically arrange the mapping table F2H corresponding to the active block A _ BLK. Volatile memory 126 may be space-limited and mapping table F2H may be quantitatively sealed to mapping table H2F. In one embodiment, the mapping table F2H is partially sealed to the flash memory 102 when a Power Off Notification (PON) is received. In one embodiment, the mapping table F2H may be locally stored in the flash memory 102 after a power-up (SPOR) rebuild. The progress of mapping table F2H to mapping table H2F may also be recorded as system information (e.g., index _ seal) in the system information block pool 114. If an unexpected power-down event occurs, mapping information that has not been sealed in volatile memory 126 is lost. The control unit 104 performs a power restoration procedure for this situation, wherein a one-shot programming operation (one shot programming) of the active block a _ BLK is considered, so as to enhance the reliability of the data after power restoration.
As shown, after the power recovery procedure is initiated, the control unit 104 checks the system information block pool 114, and knows the active block a _ BLK that is interrupted by the power failure and where the sealing from the mapping table F2H to the mapping table H2F has been performed according to the index a _ BLK and the index seal. According to the index seal indication, the control unit 104 starts the metadata (meta data) scan of the active block a _ BLK, obtains the logical addresses corresponding to the pages in the order of use of the space in the active block a _ BLK, arranges the mapping information that the active block a _ BLK has not been stored in the volatile memory 126, and reconstructs the mapping table F2H. When no content metadata is scanned, an empty page (130 in the figure) is found. The control unit 104 may initialize a last page pointer of the active block a _ BLK to point to a page 132 preceding the empty page 130. The control unit 104 checks whether the page 132 pointed by the last page pointer is the last page of the N pages written by a one-shot programming operation (one-shot programming). If page 132 is not the last page of the N pages written by a one shot writing operation (one shot programming), as illustrated, control unit 104 pushes forward active block a _ BLK, finds the previous one shot writing operation (one shot programming), corrects the last page pointer to page 134, and discards mapping information 140 collected along with the power-back scan on volatile memory 126. Mapping information 140 is metadata taken from the next page of page 134 to page 132 during the scan.
The single-shot write operation (one shot programming) to which page 132 belongs is apparently interrupted by an unexpected power-down event. The above action of correcting the last page index of the active block a _ BLK to the page 134 makes the one shot program (one shot program) which is most likely to be damaged by the unexpected power-off event be regarded as invalid. Therefore, the data reliability is greatly improved.
After the last page pointer is corrected to page 134, the N pages of data written in the same single write operation (one shot programming) can be further error-checked. If any of the N pages fails to pass the error check (e.g., UECC occurs), it indicates that the receipt has completed the write operation (one shot programming) and is damaged by an unexpected power-off event. The control unit 104 pushes forward the active block a _ BLK to find a one-shot writing operation (one-shot programming) of the previous loop. The last page pointer is corrected to point to the last page of the N pages of data written by the previous one-shot programming. The mapping information in the mapping table F2H is discarded accordingly.
FIG. 2 is a flowchart illustrating a power restoration procedure implemented according to an embodiment of the present invention, further including the determination and movement of unreliable data (steps S208 and S212); the following description will be made with reference to fig. 1. In step S202, the control unit 104 performs a power restoration process. Based on the index A _ BLK loaded by the system information block pool 114, the control unit 104 finds the active block A _ BLK interrupted by the unexpected power outage event. Based on the index _ seal loaded by the system information block pool 114, the control unit 104 knows the mapping information sealing progress of the active block a _ BLK before power-off. In step S204, according to the saving progress, the control unit 104 sets the initial scanning page of the active block a _ BLK, initially collects the mapping information (corresponding to the logical address of each page) in the metadata page by page, and rebuilds the mapping table F2H of the active block a _ BLK in the volatile memory 126. After scanning the empty page 130 (the page metadata has no content), the control unit 104 proceeds to step S206. If the previous page 132 of the empty page 130 is not the last page of a group of N pages of single-shot write operation (one shot programming), the control unit 104 performs the last page correction of the active block a _ BLK in step S206, so that the last page index of the active block a _ BLK points to the last page of N pages of data written by a single-shot write operation (one shot programming). In step S208, the control unit 104 performs error checking on the N pages associated with the last page index of the active block a _ BLK (write operation is completed in the same way). If any page fails to pass the error check (e.g., UECC occurs), the control unit 104 proceeds to step S210 to discard the mapping information about the N pages loaded in the mapping table F2H, and proceeds to step S206 again to advance the last page index of the active block A _ BLK. If no error checking failure (e.g., UECC) occurs in step S208, the control unit 104 performs step S212 to move the unreliable data immediately.
Fig. 3 illustrates the flow of fig. 2 in a diagram. After the power is restored, the metadata scanning performed in step S204 may be a double-sided scanning in which metadata of two pages across both sides is scanned. The logical addresses carried by the metadata for pages 0x00 and 0x01 are updated to mapping table F2H. The double-sided scan of metadata may proceed all the way to empty page 0x 26. At this time, the mapping table F2H is updated to the mapping information of pages 0x24 and 0x 25. This embodiment uses MLC double-sided writing, and the active block A _ BLK receives four pages of data at a time for programming. A single-shot write operation corresponding to page 0x25 before empty page 0x26 involves pages 0x 24-0 x 27. Page 0x25 is not the last page 0x27 in an N-page write. Therefore, the last page index of the active block A _ BLK is calibrated to page 0x23 by step S206, and is aligned with the last page 0x23 of 4 pages 0x 20-0 x23 that have been written in the previous write-once. According to step S208, the control unit 104 reads 4 pages 0x20 ~ 0x23 completely page by page from page 0x 20. The 4 pages 0x 20-0 x23 of data are read and checked with a check code (e.g., ECC code) stored in the respective metadata. If UECC occurs, the contents of pages 0x 20-0 x23 are discarded together with the mapping information (step S210), and the last page index of the active block A _ BLK is corrected to page 0x19 by step S206 to align with the last page 0x19 of pages 0x 16-0 x19 that completed the write operation in the previous single shot. Even if step S208 determines that no UECC occurs, unreliable data can be moved by step S212. For example, if pages 0x 20-0 x23 are still readable but unreliable, step S212 can move them to other spaces.
In step S212, there are many exceptions to allow data movement to be skipped. In one embodiment, if the page next to the last page of the receipt that passed the error check completes the write operation, it represents that the unexpected power-off event does not occur in the receipt that completes the write operation, and no unreliable data needs to be moved by step S212. Referring to fig. 3, if the last page index (passing the error check) of the active block a _ BLK is page 0x23, pages 0x20 to 0x23 are reliable because the next page 0x24 of page 0x23 is not empty page 0x26, and it is not necessary to move in step S212.
Fig. 4 illustrates another example of the exception condition of the unreliable data moving step S212. If the mapping information of the receipt complete write operation passing the error check is already sealed (small table F2H to large table H2F), it indicates that the unexpected power-off event does not occur in the receipt complete write operation, and no unreliable data needs to be moved by step S212. Fig. 4 shows that the sealing progress (carried by index _ seal) of the mapping table F2H to the mapping table H2F reaches page 0x23 before the unexpected power outage event occurs. As such, the unexpected power down event does not occur in a single completion write operation for pages 0x 20-0 x 23. Pages 0x 20-0 x23 are reliable and do not need to be moved in step S212.
Fig. 5 illustrates an example of an exceptional situation in the unreliable data moving step S212. The mapping information of the receipt completing write operation passing the error check is not necessary to be moved in step S212 if it is actually invalid data (e.g., erased or updated early). FIG. 5 shows that the active block A _ BLK last page pointer points to page 0x 23. Even if the pages 0x 20-0 x23 pass the error check, the pages 0x 20-0 x23 are all invalid as the query result, so that the page is not required to be moved in step S212. Whether the data is valid or not can be determined by querying the system information stored in the system information block pool 214. In one embodiment, mapping tables F2H and H2F stored in the flash memory 102 in a non-volatile manner can be used as the system information to help determine the presence/absence of data. After mapping table F2H finds the LBA of the logical block address corresponding to the previous page of the block, the found LBA is checked by mapping table H2F. If mapping table H2F indicates that the LBA does correspond to the page of the block, it indicates valid data is stored, otherwise, it indicates invalid data. Alternatively, during the power restoration process, the control unit 104 may also sort the system information in the volatile memory 126 to help determine whether the data is valid or not.
In one embodiment, after determining the last page index, the control unit 104 further moves N pages of data of a single-shot write operation corresponding to the space indicated by the last page index when determining that the data stored in the space indicated by the last page index is still valid, the space indicated by the last page index is consecutive to an empty page, and the mapping data of the single-shot write operation corresponding to the space indicated by the last page index is not sealed.
In one embodiment, the sequential data and the scattered data have respective data receiving blocks, which are labeled as C0 and C1. The control unit 104 needs to repair both data receiving blocks C0 and C1. In one embodiment, after the blocks C0/C1 finish receiving data, the control unit 104 reconfigures the blocks C2/C3 for continuous/scattered data reception. The mapping tables F2H-H2F of the block C0/C1 seal the operation gaps that can be inserted into the block C2/C3. In the power-up procedure, if the control unit 104 knows that the block C2/C3 exists from the system information block pool 214, the step S204 of scanning needs to include the scanning of the blocks C2/C3. If the block C2/C3 does not exist, the control unit 104 scans the block C0/C1 for reconstruction.
For example, in the power-up procedure of the data storage device, the data reliability determination based on the size (N pages) of a single write operation is within the protection scope of the present invention. Based on the above technical content, the present invention further relates to a non-volatile memory operation method.
Although the present invention has been described with reference to the preferred embodiments, it should be understood that various changes and modifications can be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (18)

1. A data storage device, comprising:
a non-volatile memory that receives data by a single write operation, each single write operation writing N pages of data, N being a number greater than 1; and
a control unit, when the data storage device is powered back, enabling a last page index of an active block used before the non-volatile memory is powered off to point to a last page in N pages of data written by a single-shot write operation;
the control unit performs error check on the N pages of data which are written by the single-shot completion write operation and correspond to the space pointed by the last page index, and corrects the last page index to point to the last page in the N pages of data written by the single-shot completion write operation in the previous time when the error check fails.
2. The data storage device of claim 1, wherein:
after determining the last page index, the control unit also determines whether the single-shot N pages of data completing the write operation corresponding to the space pointed by the last page index are affected by power failure so as to move the data.
3. The data storage device of claim 2, wherein:
when the space pointed by the last page index is not continuous with the empty page, the control unit judges that the single-shot N pages of data which finish the write operation and correspond to the space pointed by the last page index are not affected by power failure and are not moved.
4. The data storage device of claim 2, wherein:
when the mapping information of the single-shot write operation corresponding to the space pointed by the last page pointer is sealed, the control unit determines that the N pages of data of the single-shot write operation corresponding to the space pointed by the last page pointer are not affected by the power failure and are not moved.
5. The data storage device of claim 1, wherein:
after determining the last page index, the control unit further determines whether the N pages of data of the single-shot write operation corresponding to the space indicated by the last page index have been updated or moved, so as to omit the movement of invalid data.
6. The data storage device of claim 1, wherein:
after determining the last page index, the control unit moves the N pages of data of the single-shot write-completed operation corresponding to the space indicated by the last page index when determining that the data stored in the space indicated by the last page index is still valid, the space indicated by the last page index continues to be an empty page, and the mapping data of the single-shot write-completed operation corresponding to the space indicated by the last page index is not sealed.
7. The data storage device of claim 1, wherein:
when the data storage device is powered back, the control unit scans the active block along the filling sequence, checks the metadata page by page, makes the metadata without content a first empty page, and initializes the last page index to point to the previous page of the first empty page.
8. The data storage device of claim 7, wherein:
the control unit also reconstructs the mapping table F2H of the active block while checking metadata page by page; and is
After determining the last page index, the control unit invalidates the mapping information of the mapping table F2H corresponding to the space pointed by the last page index.
9. The data storage device of claim 1, wherein:
each single write completion operation causes the data in the common storage unit to be written in a single burst.
10. A method of non-volatile memory operation, comprising:
enabling a non-volatile memory to receive data through single-shot write-in operation, wherein each single-shot write-in operation writes N pages of data, and N is a number greater than 1;
when the non-volatile memory is powered back, enabling a last page index of an active block used before the non-volatile memory is powered off to point to a last page in N pages of data written by a write operation;
performing error check on the N pages of data with single write operation completed corresponding to the space pointed by the last page pointer; and
when the error check fails, the last page pointer is corrected to point to the last page in the N pages of data written by the write operation which is completed in a single shot in the previous time.
11. The method of non-volatile memory operation of claim 10, further comprising:
after the last page index is determined, whether the single-shot N pages of data completing the write operation corresponding to the space pointed by the last page index are affected by power failure is judged so as to move the data.
12. The method of non-volatile memory operation of claim 11, further comprising:
when the space pointed by the last page index is not continuous with the empty page, the N pages of data which are written in the single shot and correspond to the space pointed by the last page index are judged not to be affected by the power failure and not to be moved.
13. The method of claim 11, wherein:
when the mapping information of the single-shot write-in operation corresponding to the space pointed by the last page pointer is sealed, it is determined that the N pages of data of the single-shot write-in operation corresponding to the space pointed by the last page pointer are not affected by the power failure and are not moved.
14. The method of non-volatile memory operation of claim 10, further comprising:
after the last page index is determined, whether the N pages of data which are singly written and operated and correspond to the space pointed by the last page index are updated or moved is judged, so that the moving of invalid data is omitted.
15. The method of non-volatile memory operation of claim 10, further comprising:
after the last page index is determined, when the data stored in the space pointed by the last page index is still valid, the space pointed by the last page index is continued to be an empty page, and the mapping data of the single-shot write-in operation corresponding to the space pointed by the last page index is not sealed, the N pages of data of the single-shot write-in operation corresponding to the space pointed by the last page index are moved.
16. The method of non-volatile memory operation of claim 10, further comprising:
when the non-volatile memory is powered back, the active block is scanned along the filling sequence, the metadata is checked page by page, the page without the metadata is the first empty page, and the index of the last page is initialized to point to the page before the first empty page.
17. The method of non-volatile memory operation of claim 16, further comprising:
when checking the metadata page by page, further reconstructing the mapping table F2H of the active block; and
after determining the last page index, the mapping information of the mapping table F2H corresponding to the space pointed by the last page index is invalidated.
18. The method of claim 10, wherein:
each single-shot write-in operation enables single-shot writing of data in the shared storage unit.
CN201810709213.XA 2017-12-27 2018-07-02 Data storage device and non-volatile memory operation method Active CN109976938B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
TW106145988A TWI646535B (en) 2017-12-27 2017-12-27 Data storage device and non-volatile memory operation method
TW106145988 2017-12-27

Publications (2)

Publication Number Publication Date
CN109976938A CN109976938A (en) 2019-07-05
CN109976938B true CN109976938B (en) 2022-09-23

Family

ID=65804045

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810709213.XA Active CN109976938B (en) 2017-12-27 2018-07-02 Data storage device and non-volatile memory operation method

Country Status (3)

Country Link
US (1) US10789163B2 (en)
CN (1) CN109976938B (en)
TW (1) TWI646535B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20190092054A (en) * 2018-01-30 2019-08-07 에스케이하이닉스 주식회사 Memory system and operating method of memory system
KR102583810B1 (en) * 2018-05-15 2023-10-05 에스케이하이닉스 주식회사 Memory system and operation method thereof
US10747612B2 (en) * 2018-12-31 2020-08-18 Micron Technology, Inc. Multi-page parity protection with power loss handling
TWI777087B (en) * 2019-09-06 2022-09-11 群聯電子股份有限公司 Data managing method, memory controlling circuit unit and memory storage device
CN112527184A (en) * 2019-09-17 2021-03-19 群联电子股份有限公司 Data management method, memory control circuit unit and memory storage device
CN113535459B (en) * 2020-04-14 2024-04-12 慧荣科技股份有限公司 Data access method and device for responding to power event
US10990526B1 (en) * 2020-04-30 2021-04-27 Micron Technology, Inc. Handling asynchronous power loss in a memory sub-system that programs sequentially
EP4283474A1 (en) * 2022-05-23 2023-11-29 Samsung Electronics Co., Ltd. Storage device, memory device, and computing system including the same

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6988175B2 (en) * 2003-06-30 2006-01-17 M-Systems Flash Disk Pioneers Ltd. Flash memory management method that is resistant to data corruption by power loss
WO2007058617A1 (en) * 2005-11-17 2007-05-24 Chee Keng Chang A controller for non-volatile memories, and methods of operating the memory controller
US8799555B2 (en) * 2011-04-14 2014-08-05 Apple Inc. Boot data storage schemes for electronic devices
US9176800B2 (en) * 2011-08-31 2015-11-03 Micron Technology, Inc. Memory refresh methods and apparatuses
KR102053953B1 (en) * 2013-02-04 2019-12-11 삼성전자주식회사 Memory system comprising nonvolatile memory device and program method thereof
KR20150053092A (en) * 2013-11-07 2015-05-15 에스케이하이닉스 주식회사 Data storing system and operating method thereof
KR102285994B1 (en) * 2014-05-13 2021-08-06 삼성전자주식회사 Nonvolatile memory system including nonvolatile memory device and memory controller and operating method of memory controller
TWI546666B (en) * 2014-11-03 2016-08-21 慧榮科技股份有限公司 Data storage device and flash memory control method
KR20170076878A (en) * 2015-12-24 2017-07-05 에스케이하이닉스 주식회사 Memory system and operating method of memory system
KR20170118284A (en) * 2016-04-14 2017-10-25 에스케이하이닉스 주식회사 Memory system and operating method of memory system
US20180157428A1 (en) * 2016-12-01 2018-06-07 Alibaba Group Holding Limited Data protection of flash storage devices during power loss
US10326473B2 (en) * 2017-04-13 2019-06-18 Sk Hynix Inc Symbol-based coding for NAND flash devices

Also Published As

Publication number Publication date
CN109976938A (en) 2019-07-05
TWI646535B (en) 2019-01-01
US20190196960A1 (en) 2019-06-27
US10789163B2 (en) 2020-09-29
TW201928968A (en) 2019-07-16

Similar Documents

Publication Publication Date Title
CN109976938B (en) Data storage device and non-volatile memory operation method
CN109977034B (en) Data storage device and non-volatile memory operation method
CN108733510B (en) Data storage device and mapping table reconstruction method
US10180805B2 (en) Memory system and operating method thereof
US10698809B2 (en) Method, associated flash controller and electronic device for accessing flash module with data validity verification
US9817725B2 (en) Flash memory controller, data storage device, and flash memory control method with volatile storage restoration
KR101491943B1 (en) Transaction log recovery
CN106095699B (en) Scalable SPOR algorithm for flash memory
CN107957959B (en) Memory system with file level secure erase and method of operating the same
US10866751B2 (en) Method for managing flash memory module and associated flash memory controller
CN105103137A (en) Compression and formatting of data for data storage systems
MX2012010944A (en) Non-regular parity distribution detection via metadata tag.
WO2019174205A1 (en) Trash recovery method and device and storage equipment
TW201706848A (en) Valid data merging method, memory controller and memory storage apparatus
US10606744B2 (en) Method for accessing flash memory module and associated flash memory controller and electronic device
US20150046772A1 (en) Method and device for error correcting code (ecc) error handling
TWI523030B (en) Method for managing buffer memory, memory controllor, and memory storage device
US9946644B2 (en) Memory system and operating method thereof
KR20220103378A (en) Apparatus and method for handling data stored in a memory system
US20200241955A1 (en) Data storage device and operating method thereof
CN113849121A (en) Memory system for accessing stripe form data and operating method thereof
CN114579040A (en) Apparatus and method for maintaining data stored in a memory system
US11934264B2 (en) ECC parity biasing for Key-Value data storage devices
US11662940B2 (en) Data storage device and data processing method for restoring MLC/TLC memory to avoid degradation of access performance of a memory device caused by word line short
KR20230098094A (en) Systems and methods for defragmenting memory devices

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