TW201717024A - Data storage device and data maintenance method thereof - Google Patents

Data storage device and data maintenance method thereof Download PDF

Info

Publication number
TW201717024A
TW201717024A TW105122007A TW105122007A TW201717024A TW 201717024 A TW201717024 A TW 201717024A TW 105122007 A TW105122007 A TW 105122007A TW 105122007 A TW105122007 A TW 105122007A TW 201717024 A TW201717024 A TW 201717024A
Authority
TW
Taiwan
Prior art keywords
block
page
data
pages
backup
Prior art date
Application number
TW105122007A
Other languages
Chinese (zh)
Other versions
TWI592801B (en
Inventor
柯冠宇
Original Assignee
慧榮科技股份有限公司
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 慧榮科技股份有限公司 filed Critical 慧榮科技股份有限公司
Priority to CN201610768284.8A priority Critical patent/CN106708754B/en
Priority to US15/345,785 priority patent/US9747173B2/en
Publication of TW201717024A publication Critical patent/TW201717024A/en
Application granted granted Critical
Publication of TWI592801B publication Critical patent/TWI592801B/en
Priority to US15/660,029 priority patent/US9852032B2/en

Links

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The present invention provides a data storage device. The data storage device includes a flash memory and a controller. The flash memory includes a plurality of blocks, and each of the blocks includes a plurality of pages. When the data storage device is resumed from a power off state, the controller selects a first block that is the last written before the power off state from the blocks, and writes data of a plurality of first pages of the first block into a plurality of second pages of the first block.

Description

資料儲存裝置及其資料維護方法 Data storage device and data maintenance method thereof

本發明係關於一種資料儲存裝置,特別係關於在斷電事件後對資料進行維護之資料儲存裝置。 The present invention relates to a data storage device, and more particularly to a data storage device for maintaining data after a power outage event.

快閃記憶體為一種普遍的非揮發性資料儲存裝置,係以電性方式抹除與程式化。以非及閘型的快閃記憶體(即NAND FLASH)為例,常用作記憶卡(memory card)、通用序列匯流排閃存裝置(USB flash device)、固態硬碟(SSD)、嵌入式快閃記憶體模組(eMMC)…等使用。 Flash memory is a popular non-volatile data storage device that is electrically erased and programmed. For example, NAND FLASH, which is not a gate type, is often used as a memory card, a universal flash memory device, a solid state drive (SSD), and an embedded flash. Memory module (eMMC)...etc.

快閃記憶體(如,NAND FLASH)的儲存陣列包括複數個區塊(blocks),其中浮置閘極電晶體可用以構成快閃記憶體。浮置閘極電晶體中之浮置閘極,可捕捉的電荷以儲存資料。然而,在寫入的過程中,非預期之斷電事件發生會損壞正在寫入之頁面的資料。因此,如何在斷電事件發生後對資料進行維護是一個重要的課題。 A flash memory (eg, NAND FLASH) storage array includes a plurality of blocks, wherein a floating gate transistor can be used to form a flash memory. A floating gate in a floating gate transistor that captures charge to store data. However, during the write process, an unexpected power down event can corrupt the data on the page being written. Therefore, how to maintain data after a power outage is an important issue.

本發明所提供之資料儲存裝置以及資料維護方法可在斷電事件後將可能受損壞的資料重寫至相同的區塊中。 The data storage device and the data maintenance method provided by the present invention can rewrite potentially damaged data into the same block after a power failure event.

本發明提供一種資料儲存裝置包括一快閃記憶體以及一控制器。快閃記憶體包括複數區塊,每一區塊包括複數 頁面。控制器在資料儲存裝置自一斷電事件中回復時,在區塊中選擇在斷電事件之前最後一個進行寫入之一第一區塊,並且將第一區塊中之複數第一頁面中之資料寫入第一區塊中第一頁面外之其他複數第二頁面。 The invention provides a data storage device comprising a flash memory and a controller. The flash memory includes a plurality of blocks, each block including a plurality of blocks page. When the data storage device replies from a power-off event, the controller selects one of the first blocks to be written in the block before the power-off event, and the first page in the first block is The data is written to other plural second pages outside the first page in the first block.

在一實施例中,第一區塊更包括複數字元線,並且第一區塊為一二階儲存單元區塊(MLC block),其中第一區塊之每一字元線用以控制第一區塊中之兩個頁面。在資料儲存裝置自斷電事件中回復時,控制器更用以在第一區塊之頁面中選擇在斷電事件之前最後一個被寫入之頁面以作為一基準頁面,並且根據字元線中用以控制基準頁面之一第一字元線決定第一頁面。第一頁面為被第一字元線以及排列於第一字元線前方之至少一第二字元線所控制之複數第三頁面中具有有效資料的頁面。又一實施例中,控制器更用以將冗餘資料(dummy data)寫入第三頁面中不具有有效資料之頁面。 In an embodiment, the first block further includes a complex digital element line, and the first block is a second-order storage unit block (MLC block), wherein each word line of the first block is used to control the first block. Two pages in a block. When the data storage device replies from the power-off event, the controller is further configured to select, in the page of the first block, the last page to be written before the power-off event as a reference page, and according to the word line The first word line used to control one of the reference pages determines the first page. The first page is a page having valid data in a plurality of third pages controlled by the first word line and the at least one second word line arranged in front of the first word line. In another embodiment, the controller is further configured to write dummy data to a page in the third page that does not have valid data.

另一實施例中,控制器更用以判斷一備份區塊中是否具有第一頁面之備份,並且將第一頁面中在備份區塊不具有備份者之資料寫入備份區塊。另外,控制器更用以根據儲存於備份區塊中相應於第一頁面之資料,對第二頁面進行寫入以將第一頁面之資料寫入第二頁面,其中備份區塊之資料保護能力高於第一區塊。另外,一實施例中,第一區塊為一二階儲存單元區塊(MLC block),並且備份區塊為一單階儲存單元區塊(SLC block)。 In another embodiment, the controller is further configured to determine whether a backup block has a backup of the first page, and write the data in the first page that does not have the backup in the backup block to the backup block. In addition, the controller is further configured to write the second page according to the data stored in the backup block corresponding to the first page to write the data of the first page to the second page, wherein the data protection capability of the backup block Higher than the first block. In addition, in an embodiment, the first block is a second-order storage unit block (MLC block), and the backup block is a single-stage storage unit block (SLC block).

本發明另提供一種資料維護方法適用於具有一快閃記憶體之一資料儲存裝置,其中快閃記憶體包括複數區塊, 並且每一區塊包括複數頁面。資料維護方法包括:在資料儲存裝置自一斷電事件中回復時,在區塊中選擇在斷電事件之前最後一個進行寫入之一第一區塊;以及將第一區塊中之複數第一頁面中之資料寫入第一區塊中第一頁面外之其他複數第二頁面。 The present invention further provides a data maintenance method suitable for a data storage device having a flash memory, wherein the flash memory includes a plurality of blocks. And each block includes a plurality of pages. The data maintenance method includes: when the data storage device replies from a power-off event, selecting, in the block, one of the first blocks to be written before the power-off event; and the plurality of blocks in the first block The data in one page is written into the other plural second page outside the first page in the first block.

在一實施例中,第一區塊更包括複數字元線,並且第一區塊為一二階儲存單元區塊(MLC block),其中第一區塊之每一字元線用以控制第一區塊中之兩個頁面。其中,資料維護方法更包括:在第一區塊之頁面中,選擇在斷電事件之前最後一個進行寫入之頁面以作為一基準頁面;以及根據字元線中用以控制基準頁面之一第一字元線決定第一頁面,其中第一頁面為被第一字元線以及排列於第一字元線前方之至少一第二字元線所控制之複數第三頁面中具有有效資料的頁面。另外,資料維護方法更包括將冗餘資料(dummy data)寫入第三頁面中不具有有效資料之頁面。 In an embodiment, the first block further includes a complex digital element line, and the first block is a second-order storage unit block (MLC block), wherein each word line of the first block is used to control the first block. Two pages in a block. The data maintenance method further includes: selecting, in the page of the first block, the last page to be written before the power-off event as a reference page; and selecting one of the reference pages according to the character line. A word line determines a first page, wherein the first page is a page having valid data in a plurality of third pages controlled by the first word line and at least one second word line arranged in front of the first word line . In addition, the data maintenance method further includes writing dummy data to a page on the third page that does not have valid data.

又另一實施例中,資料維護方法更包括:判斷一備份區塊中是否具有第一頁面之備份;以及將第一頁面中在備份區塊不具有備份者之資料寫入備份區塊。上述將第一區塊中之第一頁面中之資料寫入第一區塊中第一頁面外之其他第二頁面的步驟更包括:根據儲存於備份區塊中相應於第一頁面之資料,對第二頁面進行寫入以將第一頁面之資料寫入第二頁面,其中備份區塊之資料保護能力高於第一區塊。 In another embodiment, the data maintenance method further includes: determining whether a backup block has a backup of the first page; and writing the data in the first page that does not have a backup in the backup block to the backup block. The step of writing the information in the first page in the first block to the other second page outside the first page in the first block further includes: according to the data corresponding to the first page stored in the backup block, The second page is written to write the data of the first page to the second page, wherein the data protection capability of the backup block is higher than the first block.

100‧‧‧電子系統 100‧‧‧Electronic system

120‧‧‧主機 120‧‧‧Host

140‧‧‧資料儲存裝置 140‧‧‧Data storage device

160‧‧‧控制器 160‧‧‧ Controller

162‧‧‧運算單元 162‧‧‧ arithmetic unit

164‧‧‧永久記憶體 164‧‧‧Permanent memory

166‧‧‧隨機存取記憶體 166‧‧‧ random access memory

180‧‧‧快閃記憶體 180‧‧‧Flash memory

LSB‧‧‧強頁面 LSB‧‧ strong page

MSB‧‧‧弱頁面 MSB‧‧‧ weak page

WL0~WLM‧‧‧字元線 WL0~WLM‧‧‧ character line

Or_P0~Or_PM‧‧‧原始頁面 Or_P0~Or_PM‧‧‧Original page

P0~PN、P0~PX‧‧‧頁面 P0~PN, P0~PX‧‧‧ page

B1‧‧‧區塊 Block B1‧‧‧

BU_B‧‧‧備份區塊 BU_B‧‧‧Backup block

POR‧‧‧斷電事件 POR‧‧‧ power outage

S600~S604、S700~S716‧‧‧步驟 S600~S604, S700~S716‧‧‧ steps

第1圖為本發明所提供之一電子系統之一種實施例的方塊圖。 BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 is a block diagram of one embodiment of an electronic system provided by the present invention.

第2圖為本發明所提供之一區塊之一種實施例的方塊圖。 Figure 2 is a block diagram of one embodiment of a block provided by the present invention.

第3圖為本發明所提供之一資料搬移的示意圖。 Figure 3 is a schematic diagram of one of the data movements provided by the present invention.

第4圖為本發明所提供之另一資料搬移的示意圖。 Figure 4 is a schematic illustration of another data transfer provided by the present invention.

第5圖為本發明所提供另之一資料搬移的示意圖。 Figure 5 is a schematic view showing another data transfer provided by the present invention.

第6圖為本發明所提供之一資料維護方法之一種實施例的流程圖。 Figure 6 is a flow chart of an embodiment of a data maintenance method provided by the present invention.

第7圖為本發明所提供之另一資料維護方法之另一種實施例的流程圖。 Figure 7 is a flow chart showing another embodiment of another data maintenance method provided by the present invention.

以下將詳細討論本發明各種實施例之裝置及使用方法。然而值得注意的是,本發明所提供之許多可行的發明概念可實施在各種特定範圍中。這些特定實施例僅用於舉例說明本發明之裝置及使用方法,但非用於限定本發明之範圍。 The apparatus and method of use of various embodiments of the present invention are discussed in detail below. However, it is to be noted that many of the possible inventive concepts provided by the present invention can be implemented in various specific ranges. These specific examples are only intended to illustrate the apparatus and methods of use of the present invention, but are not intended to limit the scope of the invention.

第1圖為本發明所提供之一電子系統之一種實施例的方塊圖。電子系統100包括一主機120以及一資料儲存裝置140。資料儲存裝置140包括一快閃記憶體180以及一控制器160,且可根據主機120所下達的命令操作。控制器160包括一運算單元162、一永久記憶體(如,唯讀記憶體ROM)164以及隨機存取記憶體(RAM)166。永久記憶體164與所載之程式碼、資料組成韌體(firmware),由運算單元162執行,使控制器160基於該韌體控制該快閃記憶體180。隨機存取記憶體(RAM)166用以載入程式碼與參數以提供控制器160根據所載入的程式碼與 參數動作。 BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 is a block diagram of one embodiment of an electronic system provided by the present invention. The electronic system 100 includes a host 120 and a data storage device 140. The data storage device 140 includes a flash memory 180 and a controller 160, and is operable according to commands issued by the host 120. The controller 160 includes an arithmetic unit 162, a permanent memory (e.g., read only memory ROM) 164, and a random access memory (RAM) 166. The permanent memory 164 and the stored code and data constitute a firmware, which is executed by the operation unit 162, so that the controller 160 controls the flash memory 180 based on the firmware. Random access memory (RAM) 166 is used to load code and parameters to provide controller 160 based on the loaded code and Parameter action.

快閃記憶體180包括複數區塊,每一區塊包括複數頁面。值得注意的是,快閃記憶體180以區塊為最小單位進行抹除,並且頁面為最小單位進行寫入。另外,快閃記憶體180更包括彼此相鄰的複數字元線與複數位元線,其中每一字元線用以控制至少一頁面,以選擇所欲讀取之頁面。舉例而言,當快閃記憶體180中之區塊係為單階儲存單元(Single-Level Cell,SLC)時,一條字元線用以控制一個頁面。當快閃記憶體180中之區塊係為多階儲存單元(Multi-Level Cell,MLC)時,一條字元線用以控制一強頁面LSB(strong page)以及一弱頁面MSB(weak page)。當快閃記憶體180中之區塊係為三階儲存單元(Triple-Level Cell,TLC)時,一條字元線用以控制一強頁面LSB(strong page)、一中頁面CSB(middle page)以及一弱頁面MSB(weak page),但本發明不限於此。詳細而言,當快閃記憶體180中之區塊係為多階儲存單元時,區塊中由一條字元線所控制之一個頁面可被程式化(program)為一個強頁面LSB(strong page)以及一個弱頁面MSB(weak page)。當快閃記憶體180中之區塊係為三階儲存單元時,區塊中由一條字元線所控制之一個頁面可被程式化(program)為一個強頁面LSB(strong page)、一個中頁面CSB(middle page)以及一個弱頁面MSB(weak page)。 Flash memory 180 includes a plurality of blocks, each block including a plurality of pages. It is worth noting that the flash memory 180 is erased in the smallest unit of the block, and the page is written in the smallest unit. In addition, the flash memory 180 further includes complex digital lines and complex bit lines adjacent to each other, wherein each of the word lines is used to control at least one page to select a page to be read. For example, when the block in the flash memory 180 is a Single-Level Cell (SLC), one word line is used to control one page. When the block in the flash memory 180 is a Multi-Level Cell (MLC), one word line is used to control a strong page LSB (strong page) and a weak page MSB (weak page). . When the block in the flash memory 180 is a Triple-Level Cell (TLC), one word line is used to control a strong page LSB (strong page) and a medium page CSB (middle page). And a weak page MSB (weak page), but the invention is not limited thereto. In detail, when the block in the flash memory 180 is a multi-level storage unit, a page controlled by a word line in the block can be programmed into a strong page LSB (strong page ) and a weak page MSB (weak page). When the block in the flash memory 180 is a third-order storage unit, a page controlled by a word line in the block can be programmed into a strong page LSB (strong page), one medium The page CSB (middle page) and a weak page MSB (weak page).

當控制器160再對快閃記憶體180進行寫入並且資料儲存裝置140經歷了一斷電事件後,控制器160會檢查在斷電事件發生時正在進行寫入之一特定頁面的資料是否被破壞。在 某些狀況下,雖然控制器160可成功的自特定頁面讀取資料,但特定頁面中之資料已由於遭受斷電事件的攻擊而變得不穩定。換言之,在一段時間後,控制器160再對特定頁面進行讀取時,特定頁面中之資料則可能無法被成功讀取。值得注意的是,在本發明中,只要可經由錯誤校正或者重複讀取修復錯誤位元之資料,皆是可被成功讀取之資料。因此,在某時些實施例中,控制器160會在自斷電事件回覆後,將成功讀取之特定頁面的資料寫入另一個區塊中,已確保資料的穩定性。然而,上述方法會消耗較多的區塊,也會增加區塊之抹除次數。 After the controller 160 writes the flash memory 180 again and the data storage device 140 experiences a power-off event, the controller 160 checks whether the data of a particular page being written at the time of the power-off event is detected. damage. in In some cases, although the controller 160 can successfully read data from a particular page, the data in a particular page has become unstable due to attacks from power outage events. In other words, after the controller 160 reads a specific page after a certain period of time, the data in the specific page may not be successfully read. It should be noted that in the present invention, as long as the data of the repair error bit can be corrected via error correction or repeated reading, it is a material that can be successfully read. Therefore, in some embodiments, the controller 160 writes the data of the specific page successfully read into another block after the self-power-off event reply, and the stability of the data is ensured. However, the above method consumes more blocks and also increases the number of erasures of the blocks.

有鑑於此,本發明提出一實施例,以改善上述問題。在本實施例中,在資料儲存裝置140自一斷電事件中回復時,控制器160在區塊中選擇在斷電事件之前最後一個進行寫入之一第一區塊,並且將第一區塊中之複數第一頁面中之資料寫入第一區塊中第一頁面外之其他複數第二頁面。如上所述,控制器160將第一頁面之資料寫入同一個第一區塊中之第二頁面,以減少區塊的消耗。 In view of this, the present invention proposes an embodiment to improve the above problems. In this embodiment, when the data storage device 140 replies from a power-off event, the controller 160 selects one of the first blocks to be written in the block before the power-off event, and the first region is to be written. The data in the first plurality of pages in the block is written into the other plural second pages outside the first page in the first block. As described above, the controller 160 writes the data of the first page to the second page in the same first block to reduce the consumption of the block.

值得注意的是,在一實施例中,快閃記憶體180具有一備份區塊,其中備份區塊之資料保護能力高於第一區塊B1。在控制器160對快閃記憶體180進行寫入時,會將資料寫在備份區塊上,再寫入區塊中。因此,在本實施例中,在將第一頁面中之資料寫入第二頁面前,控制器160更用以判斷備份區塊中是否具有第一頁面之備份,將第一頁面中在備份區塊不具有備份者之資料寫入備份區塊,並且根據儲存於備份區塊中相應於第一頁面之資料,對第二頁面進行寫入以將第一頁面之資 料寫入第二頁面。如上所述,控制器160藉由先將資料寫在備份區塊來保護資料,並且預防接續的其他斷電事件發生。 It should be noted that, in an embodiment, the flash memory 180 has a backup block, wherein the backup block has higher data protection capability than the first block B1. When the controller 160 writes to the flash memory 180, the data is written on the backup block and then written into the block. Therefore, in this embodiment, before writing the data in the first page to the second page, the controller 160 is further configured to determine whether the backup page has a backup of the first page, and the first page is in the backup area. The block does not have the data of the backup person written into the backup block, and according to the data stored in the backup block corresponding to the first page, the second page is written to the first page. It is written to the second page. As described above, the controller 160 protects the data by first writing the data in the backup block and preventing other power down events from occurring.

在一實施例中,快閃記憶體中之區塊大部份(第一區塊)為一二階儲存單元區塊(MLC block),並且快閃記憶體180具有操作為單階儲存單元區塊(SLC block)之備份區塊,其中單階儲存單元區塊之資料保護能力高於二階儲存單元區塊,但本發明不限於此。在其他實施例中,第一區塊可為多階儲存單元區塊(TLC block),備份區塊為可為單階儲存單元區塊或者二階儲存單元區塊,並且備份區塊的數量可為一個以上。在本實施例中,為了找出不穩定的第一頁面,控制器160更用以在第一區塊B1之頁面中選擇在斷電事件之前最後一個被寫入之頁面以作為一基準頁面,並且根據字元線中用以控制基準頁面之一第一字元線決定第一頁面。詳細而言,第一頁面為被第一字元線以及排列於第一字元線前方之至少一第二字元線所控制之複數第三頁面中具有有效資料的頁面。又另一實施例中,控制器160更用以將冗餘資料(dummy data)寫入第三頁面中不具有有效資料之頁面,以穩定第一區塊,其中冗餘資料可為一既定之無效資料或者隨機之資料,不具有任何意義。 In one embodiment, the majority of the blocks in the flash memory (the first block) are a second-order memory cell block (MLC block), and the flash memory 180 has a single-stage memory cell region. A backup block of a block (SLC block), wherein the data protection capability of the single-stage storage unit block is higher than that of the second-order storage unit block, but the invention is not limited thereto. In other embodiments, the first block may be a multi-level storage unit block (TLC block), and the backup block may be a single-order storage unit block or a second-order storage unit block, and the number of backup blocks may be More than one. In this embodiment, in order to find the unstable first page, the controller 160 is further configured to select, in the page of the first block B1, the last page written before the power-off event as a reference page. And determining the first page according to the first character line in the word line for controlling one of the reference pages. In detail, the first page is a page having valid data in a plurality of third pages controlled by the first word line and the at least one second word line arranged in front of the first word line. In another embodiment, the controller 160 is further configured to write dummy data into a page of the third page that does not have valid data to stabilize the first block, wherein the redundant data may be a predetermined one. Invalid data or random data does not make any sense.

詳細而言,如第2圖所示,區塊B1具有原始頁面Or_P0~Or_PM,並且原始頁面Or_P0~Or_PM分別由字元線WL0~WLM所控制。在本實施例中,區塊B1為多階儲存單元。因此,控制器160可將每一原始頁面Or_P0~Or_PM程式化為一個強頁面LSB以及一個弱頁面MSB,其中程式化為兩個頁面(強頁面LSB以及一個弱頁面MSB)之原始頁面相較於原本被操作 為單階儲存單元之原始頁面的容量大兩倍。值得注意的是,在一實施例中,基於特定的快閃記憶體特性,控制器160會依照一既定順序對原始頁面Or_P0~Or_PM進行程式化(Program)以構成頁面P0~PN,其中既定順序為:先對原始頁面Or_P0中之強頁面LSB進行寫入(Program)以構成頁面P0,接著對原始頁面Or_P1中之強頁面LSB進行寫入以構成頁面P1,接著對原始頁面Or_P0中之弱頁面MSB進行寫入以構成頁面P2,接著對原始頁面Or_P2中之強頁面LSB進行寫入以構成頁面P3,接著對原始頁面Or_P1中之弱頁面MSB進行寫入以構成頁面P4,依此類推。因此,對於控制器160而言,區塊B1中之頁面P0~PN的排列順序則如第2圖所示。值得注意的是,頁面P0~PN之數量為原始頁面Or_P0~Or_PM的兩倍,但本發明不限於此。 In detail, as shown in FIG. 2, the block B1 has the original pages Or_P0 to Or_PM, and the original pages Or_P0 to Or_PM are controlled by the word lines WL0 to WLM, respectively. In this embodiment, the block B1 is a multi-level storage unit. Therefore, the controller 160 can program each original page Or_P0~Or_PM into a strong page LSB and a weak page MSB, wherein the original page is programmed into two pages (strong page LSB and one weak page MSB). Originally operated The original page size for a single-stage storage unit is twice as large. It should be noted that, in an embodiment, based on the specific flash memory characteristics, the controller 160 programs the original pages Or_P0~Or_PM in a predetermined order to form the pages P0~PN, where the order is established. To: first write the strong page LSB of the original page Or_P0 to form the page P0, then write the strong page LSB of the original page Or_P1 to form the page P1, and then the weak page of the original page Or_P0 The MSB writes to form page P2, then writes the strong page LSB in the original page Or_P2 to form page P3, then writes the weak page MSB in the original page Or_P1 to form page P4, and so on. Therefore, for the controller 160, the order of the pages P0 to PN in the block B1 is as shown in FIG. It is to be noted that the number of pages P0 to PN is twice that of the original page Or_P0 to Or_PM, but the present invention is not limited thereto.

第3圖為本發明所提供之一資料搬移的示意圖。在發生斷電事件前,控制器160依序將資料DATA0~DATA10分別寫入區塊B0中之頁面P0~P10中,其中區塊B0為如第2圖所示之二階儲存單元區塊(MLC block)。為了防止在對區塊B1中之弱頁面LSB進行寫入的過程中會損壞被同個字元線所控制之強頁面MSB,控制器160會將強頁面MSB之資料先寫入備份區塊BU_B,在寫入強頁面MSB。因此,備份區塊BU_B中之頁面P0~P5依序具有資料DATA0、資料DATA1、資料DATA3、資料DATA5、資料DATA7以及資料DATA9,如第3圖之部分(A)所示。在控制器160正在將資料DATA10寫入區塊B1之頁面P10時,發生一斷電事件POR。接著,在資料儲存裝置140自斷電事件中回復時,控制器160在快閃記憶體之區塊中選擇在斷電 事件之前最後一個進行寫入之區塊B1做為第一區塊。接著,控制器160在第一區塊B1之頁面P0~PN中,選擇在斷電事件之前最後一個進行寫入之頁面P10以作為一基準頁面,自字元線WL0~WLM中選擇用以控制基準頁面P10之字元線WL4做為第一字元線,並且選擇被第一字元線WL4以及排列於第一字元線前方之兩個字元線WL2~WL3(第二字元線)所控制之複數頁面P3、P5~P8以及P10中具有有效資料的頁面作為第一頁面。如上所述,第一頁面為頁面P3、P5~P8以及P10。接著,控制器160判斷備份區塊BU_B中是否具有第一頁面P3、P5~P8、P10之備份。在本實施例中,備份區塊BU_B僅具有第一頁面P3之資料DATA3、第一頁面P5之資料DATA5以及第一頁面P7之資料DATA7,備份區塊BU_B沒有第一頁面P6之資料DATA6、第一頁面P8之資料DATA8以及第一頁面P9之資料DATA9。因此,控制器160接著將第一頁面P6、P8以及P9之資料DATA6、DATA8以及DATA9分別寫入備份區塊BU_B之頁面P6~P8中,如第3圖之部分(B)所示。由於被第一字元線WL4以及第二字元線WL2~WL3所控制之頁面P3、P5~P8以及P10中都具有有效資料。因此,控制器160不用將冗餘資料(dummy data)寫入區塊B1中。接著,控制器160根據儲存於備份區塊BU_B中相應於第一頁面P3、P5~P8、P10之資料DATA3、DATA5~DATA8、DATA10,將第一頁面P3、P5~P8、P10之資料DATA3、DATA5~DATA8、DATA10寫入第一區塊B1之第二頁面P11~P16中,如第3圖之部分(C)所示。 Figure 3 is a schematic diagram of one of the data movements provided by the present invention. Before the power-off event occurs, the controller 160 sequentially writes the data DATA0~DATA10 into the pages P0~P10 in the block B0, wherein the block B0 is the second-order storage unit block (MLC) as shown in FIG. Block). In order to prevent the strong page MSB controlled by the same word line from being damaged during the writing to the weak page LSB in the block B1, the controller 160 writes the data of the strong page MSB to the backup block BU_B first. , write strong page MSB. Therefore, the pages P0 to P5 in the backup block BU_B sequentially have the data DATA0, the data DATA1, the data DATA3, the data DATA5, the data DATA7, and the data DATA9, as shown in part (A) of FIG. When the controller 160 is writing the material DATA10 to the page P10 of the block B1, a power-off event POR occurs. Then, when the data storage device 140 replies from the power-off event, the controller 160 selects the power-off in the block of the flash memory. The last block B1 to be written before the event is used as the first block. Next, the controller 160 selects the last page P10 to be written before the power-off event as a reference page in the pages P0~PN of the first block B1, and selects from the word line WL0~WLM for control. The word line WL4 of the reference page P10 is taken as the first word line, and the first word line WL4 and the two word lines WL2 WL WL3 (second word line) arranged in front of the first word line are selected. The page with valid data in the plural pages P3, P5~P8 and P10 controlled is used as the first page. As described above, the first page is pages P3, P5~P8, and P10. Next, the controller 160 determines whether there is a backup of the first page P3, P5~P8, and P10 in the backup block BU_B. In this embodiment, the backup block BU_B has only the data DATA3 of the first page P3, the data DATA5 of the first page P5, and the data DATA7 of the first page P7, and the backup block BU_B has no data DATA6 of the first page P6, One page P8 data DATA8 and the first page P9 data DATA9. Therefore, the controller 160 then writes the data DATA6, DATA8, and DATA9 of the first pages P6, P8, and P9 into the pages P6 to P8 of the backup block BU_B, respectively, as shown in part (B) of FIG. Since the pages P3, P5 to P8, and P10 controlled by the first word line WL4 and the second word line WL2 to WL3 have valid data. Therefore, the controller 160 does not have to write dummy data into the block B1. Then, the controller 160 records the data DATA3 of the first page P3, P5~P8, P10 according to the data DATA3, DATA5~DATA8, DATA10 stored in the backup block BU_B corresponding to the first page P3, P5~P8, P10, DATA5~DATA8 and DATA10 are written in the second page P11~P16 of the first block B1, as shown in part (C) of Fig. 3.

第4圖為本發明所提供之另一資料搬移的示意 圖。詳細而言,在發生斷電事件前,控制器160依序將資料DATA0~DATA10分別寫入區塊B0中之頁面P0~P10中,其中區塊B0為如第2圖所示之二階儲存單元區塊(MLC block)。為了防止在對區塊B1中之弱頁面LSB進行寫入的過程中會損壞被同個字元線所控制之強頁面MSB,控制器160會將強頁面MSB之資料先寫入備份區塊BU_B,在寫入強頁面MSB。然而,由於寫入的規則,某些強頁面沒有被備份於備份區塊BU_B中。因此,在本實施例中,備份區塊BU_B中之頁面P0~P4依序具有資料DATA0、資料DATA1、資料DATA3、資料DATA7以及資料DATA9,如第4圖之部分(A)所示。在控制器160正在將資料DATA10寫入區塊B1之頁面P10時,發生一斷電事件POR。接著,在資料儲存裝置140自斷電事件中回復時,控制器160根據上述規則,選擇頁面P3、P5~P8以及P10作為第一頁面。接著,控制器160判斷備份區塊BU_B中是否具有第一頁面P3、P5~P8、P10之備份。在本實施例中,備份區塊BU_B僅具有第一頁面P3之資料DATA3以及第一頁面P7之資料DATA7,備份區塊BU_B沒有第一頁面P5之資料DATA5、第一頁面P6之資料DATA6、第一頁面P8之資料DATA8以及第一頁面P9之資料DATA9。因此,控制器160接著將第一頁面P5、P6、P8以及P9之資料DATA5、DATA6、DATA8以及DATA9分別寫入備份區塊BU_B之頁面P5~P8中,如第4圖之部分(B)所示。由於被第一字元線WL4以及第二字元線WL2~WL3所控制之頁面P3、P5~P8以及P10中都具有有效資料。因此,控制器160不用將冗餘資料(dummy data)寫入區塊B1中。接著,控制器160根據儲存於備 份區塊BU_B中相應於第一頁面P3、P5~P8、P10之資料DATA3、DATA5~DATA8、DATA10,將第一頁面P3、P5~P8、P10之資料DATA3、DATA5~DATA8、DATA10寫入第一區塊B1之第二頁面P11~P16中,如第4圖之部分(C)所示。 Figure 4 is a schematic illustration of another material transfer provided by the present invention. Figure. In detail, before the power-off event occurs, the controller 160 sequentially writes the data DATA0~DATA10 into the pages P0~P10 in the block B0, wherein the block B0 is the second-order storage unit as shown in FIG. Block (MLC block). In order to prevent the strong page MSB controlled by the same word line from being damaged during the writing to the weak page LSB in the block B1, the controller 160 writes the data of the strong page MSB to the backup block BU_B first. , write strong page MSB. However, due to the rules of writing, some strong pages are not backed up in the backup block BU_B. Therefore, in this embodiment, the pages P0 to P4 in the backup block BU_B sequentially have the data DATA0, the data DATA1, the data DATA3, the data DATA7, and the data DATA9, as shown in part (A) of FIG. When the controller 160 is writing the material DATA10 to the page P10 of the block B1, a power-off event POR occurs. Next, when the data storage device 140 replies from the power-off event, the controller 160 selects the pages P3, P5-P8, and P10 as the first page according to the above rules. Next, the controller 160 determines whether there is a backup of the first page P3, P5~P8, and P10 in the backup block BU_B. In this embodiment, the backup block BU_B has only the data DATA3 of the first page P3 and the data DATA7 of the first page P7, and the backup block BU_B has no data DATA5 of the first page P5, and the data DATA6 of the first page P6, the first page One page P8 data DATA8 and the first page P9 data DATA9. Therefore, the controller 160 then writes the data DATA5, DATA6, DATA8, and DATA9 of the first page P5, P6, P8, and P9 into the pages P5 to P8 of the backup block BU_B, respectively, as shown in part (B) of FIG. Show. Since the pages P3, P5 to P8, and P10 controlled by the first word line WL4 and the second word line WL2 to WL3 have valid data. Therefore, the controller 160 does not have to write dummy data into the block B1. Then, the controller 160 is stored in the standby The data DATA3, DATA5~DATA8, and DATA10 corresponding to the first page P3, P5~P8, and P10 in the block BU_B are written into the first page P3, P5~P8, and P10 data DATA3, DATA5~DATA8, and DATA10. The second page P11~P16 of a block B1 is as shown in part (C) of Fig. 4.

第5圖為本發明所提供之另一資料搬移的示意圖。在發生斷電事件前,控制器160依序將資料DATA0~DATA7分別寫入區塊B0中之頁面P0~P7中,其中區塊B0為如第2圖所示之二階儲存單元區塊(MLC block)。為了防止在對區塊B1中之弱頁面LSB進行寫入的過程中會損壞被同個字元線所控制之強頁面MSB,控制器160會將強頁面MSB之資料先寫入備份區塊BU_B,在寫入強頁面MSB。然而,基於特定之寫入規則,某些強頁面MSB可能不會備份在備份區塊BU_B中,例如頁面P5之資料DATA5。在本實施例中,備份區塊BU_B中之頁面P0~P5依序具有資料DATA0、資料DATA1、資料DATA3以及資料DATA7,如第5圖之部分(A)所示。在控制器160正在將資料DATA7寫入區塊B1之頁面P7時,發生一斷電事件POR。接著,在資料儲存裝置140自斷電事件中回復時,控制器160在快閃記憶體之區塊中選擇在斷電事件之前最後一個進行寫入之區塊B1做為第一區塊。接著,控制器160在第一區塊B1之頁面P0~PN中,選擇在斷電事件之前最後一個進行寫入之頁面P7以作為一基準頁面,自字元線WL0~WLM中選擇用以控制基準頁面P7之字元線WL4做為第一字元線,並且選擇被第一字元線WL4以及排列於第一字元線前方之兩個字元線WL2~WL3(第二字元線)所控制之複數頁面P3、P5~P7以及P10中具有有效資料的頁面作 為第一頁面。在本實施例中,頁面P3、P5~P8以及P10中僅有頁面P3以及P5~P7具有有效資料,其中頁面P8以及P10不具有有效資料。如上所述,第一頁面為頁面P3以及P5~P7。接著,控制器160判斷備份區塊BU_B中是否具有第一頁面P3以及P5~P7之備份。在本實施例中,備份區塊BU_B僅具有第一頁面P3之資料DATA3以及第一頁面P7之資料DATA7,備份區塊BU_B沒有第一頁面P5之資料DATA5以及第一頁面P6之資料DATA6。因此,控制器160接著將第一頁面P5以及P6之資料DATA5以及DATA6分別寫入備份區塊BU_B之頁面P4~P5中,如第5圖之部分(B)所示。由於被第一字元線WL4以及第二字元線WL2~WL3所控制之頁面P3、P5~P7以及P10中頁面P8以及P10不具有有效資料。因此,控制器160將冗餘資料(dummy data)寫入區塊B1之頁面P8以及P10,以避免有效資料被寫入遭受斷電攻擊後不穩定之頁面P8以及P10,如第5圖部分(C)所示。接著,控制器160根據儲存於備份區塊BU_B中相應於第一頁面P3以及P5~P7之資料DATA3、DATA5~DATA7,將第一頁面P3、P5~P7之資料DATA3、DATA5~DATA7寫入第一區塊B1之第二頁面P9、P11~P13中,如第5圖之部分(D)所示。 Figure 5 is a schematic illustration of another data transfer provided by the present invention. Before the power-off event occurs, the controller 160 sequentially writes the data DATA0~DATA7 into the pages P0~P7 in the block B0, wherein the block B0 is the second-order storage unit block (MLC) as shown in FIG. Block). In order to prevent the strong page MSB controlled by the same word line from being damaged during the writing to the weak page LSB in the block B1, the controller 160 writes the data of the strong page MSB to the backup block BU_B first. , write strong page MSB. However, based on specific write rules, some strong page MSBs may not be backed up in the backup block BU_B, such as the data DATA5 of page P5. In this embodiment, the pages P0 to P5 in the backup block BU_B sequentially have the data DATA0, the data DATA1, the data DATA3, and the data DATA7, as shown in part (A) of FIG. When the controller 160 is writing the material DATA7 to the page P7 of the block B1, a power-off event POR occurs. Then, when the data storage device 140 replies from the power-off event, the controller 160 selects the last block B1 to be written as the first block in the block of the flash memory before the power-off event. Next, the controller 160 selects the last page P7 to be written before the power-off event as a reference page in the pages P0~PN of the first block B1, and selects from the word lines WL0~WLM for control. The word line WL4 of the reference page P7 is taken as the first word line, and the first word line WL4 and the two word lines WL2 WL WL3 (second word line) arranged in front of the first word line are selected. The pages with valid data in the controlled plural pages P3, P5~P7 and P10 are made For the first page. In this embodiment, only pages P3 and P5~P7 of the pages P3, P5~P8, and P10 have valid data, and the pages P8 and P10 do not have valid data. As described above, the first page is page P3 and P5~P7. Next, the controller 160 determines whether there is a backup of the first page P3 and P5~P7 in the backup block BU_B. In this embodiment, the backup block BU_B has only the data DATA3 of the first page P3 and the data DATA7 of the first page P7, and the backup block BU_B has no data DATA5 of the first page P5 and the data DATA6 of the first page P6. Therefore, the controller 160 then writes the data DATA5 and DATA6 of the first page P5 and P6 into the pages P4 to P5 of the backup block BU_B, respectively, as shown in part (B) of FIG. Since the pages P3, P5 to P7 and P10 of the pages P3, P5 to P7 and P10 controlled by the first word line WL4 and the second word line WL2 to WL3 do not have valid data. Therefore, the controller 160 writes dummy data to the pages P8 and P10 of the block B1 to prevent the valid data from being written to the pages P8 and P10 which are unstable after the power-off attack, as shown in the fifth figure ( C) is shown. Then, the controller 160 writes the data DATA3, DATA5~DATA7 of the first page P3, P5~P7 into the first page according to the data DATA3, DATA5~DATA7 stored in the backup block BU_B corresponding to the first page P3 and P5~P7. The second page P9, P11~P13 of a block B1 is as shown in part (D) of Fig. 5.

第6圖為本發明所提供之一資料維護方法之一種實施例的流程圖。資料維護方法適用於第1圖之資料儲存裝置。流程開始於步驟S600。 Figure 6 is a flow chart of an embodiment of a data maintenance method provided by the present invention. The data maintenance method is applicable to the data storage device of Figure 1. The flow begins in step S600.

在步驟S600中,資料儲存裝置140自一斷電事件中回復。詳細而言,斷電事件可為任何導致資料儲存裝置140失去操作電壓而無法進行操作之事件。 In step S600, the data storage device 140 replies from a power down event. In detail, the power down event can be any event that causes the data storage device 140 to lose operating voltage and is unable to operate.

接著,在步驟S602中,控制器160在快閃記憶體180所具有之區塊中選擇在斷電事件之前最後一個進行寫入之一第一區塊。換言之,控制器160在快閃記憶體180所具有之區塊中找出在斷電事件之前最後一個進行寫入之區塊。 Next, in step S602, the controller 160 selects one of the first blocks to be written before the power-off event in the block that the flash memory 180 has. In other words, the controller 160 finds the last block to be written before the power down event in the block that the flash memory 180 has.

接著,在步驟S604中,控制器160將第一區塊中之複數第一頁面中之資料寫入第一區塊中第一頁面外之其他複數第二頁面。換言之,在步驟S604中,由於第一區塊是在斷電事件發生時正在被進行寫入之區塊,故控制器160將第一區塊中原本所具有之有效資料(第一頁面之資料),寫入其他不具有有效資料的頁面(第二頁面),以避免資料被儲存於不穩定的頁面中。流程結束於步驟S604。值得注意的是,在其他實施例中,在步驟S604中可包括上述備份區塊之實施例,或者包括亢餘資料寫入之實施例,本發明不限於此。 Next, in step S604, the controller 160 writes the data in the plurality of first pages in the first block to the other plurality of second pages outside the first page in the first block. In other words, in step S604, since the first block is the block that is being written when the power-off event occurs, the controller 160 will have the valid data originally in the first block (the first page of the data) ), write other pages (second page) that do not have valid data to prevent the data from being stored in unstable pages. The flow ends in step S604. It should be noted that in other embodiments, the foregoing embodiment of the backup block may be included in step S604, or an embodiment including redundant data writing may be included, and the present invention is not limited thereto.

第7圖為本發明所提供之另一資料維護方法之一種實施例的流程圖。資料維護方法適用於第1圖所示之資料儲存裝置140。流程開始於步驟S700。 Figure 7 is a flow chart of an embodiment of another data maintenance method provided by the present invention. The data maintenance method is applied to the data storage device 140 shown in FIG. The flow begins in step S700.

在步驟S700中,資料儲存裝置140自一斷電事件中回復。詳細而言,斷電事件可為任何導致資料儲存裝置140失去操作電壓而無法進行操作之事件。 In step S700, the data storage device 140 replies from a power outage event. In detail, the power down event can be any event that causes the data storage device 140 to lose operating voltage and is unable to operate.

接著,在步驟S702中,控制器160在快閃記憶體180所具有之區塊中選擇在斷電事件之前最後一個進行寫入之一第一區塊。換言之,控制器160在快閃記憶體180所具有之區塊中找出在斷電事件之前最後一個進行寫入之區塊。 Next, in step S702, the controller 160 selects one of the first blocks to be written before the power-off event in the block that the flash memory 180 has. In other words, the controller 160 finds the last block to be written before the power down event in the block that the flash memory 180 has.

接著,在步驟S704中,控制器160在第一區塊之頁 面中選擇在斷電事件之前最後一個被寫入之頁面以作為一基準頁面。 Next, in step S704, the controller 160 is on the page of the first block. The last page to be written before the power down event is selected as a reference page.

接著,在步驟S706中,控制器160根據字元線中用以控制基準頁面之一第一字元線決定第一頁面。詳細而言,第一頁面為被第一字元線以及排列於第一字元線前方之至少一第二字元線所控制之複數第三頁面中具有有效資料的頁面。換言之,控制器160選擇被第一字元線以及排列於第一字元線前方之至少一第二字元線所控制之複數第三頁面中具有有效資料的頁面作為第一頁面。 Next, in step S706, the controller 160 determines the first page according to the first word line in the word line for controlling one of the reference pages. In detail, the first page is a page having valid data in a plurality of third pages controlled by the first word line and the at least one second word line arranged in front of the first word line. In other words, the controller 160 selects, as the first page, a page having valid material in the plurality of third pages controlled by the first word line and the at least one second word line arranged in front of the first word line.

接著,在步驟S708中,控制器160判斷一備份區塊中是否具有第一頁面之備份。當備份區塊中具有所有第一頁面之備份時,流程進行至步驟S710;否則,流程進行至步驟S712。 Next, in step S708, the controller 160 determines whether there is a backup of the first page in a backup block. When there is a backup of all the first pages in the backup block, the flow proceeds to step S710; otherwise, the flow proceeds to step S712.

接著,在步驟S710中,控制器160將在備份區塊不具有備份之第一頁面中之資料寫入備份區塊。 Next, in step S710, the controller 160 writes the data in the first page in which the backup block does not have a backup to the backup block.

接著,在步驟S712中,控制器160判斷被第一字元線以及排列於第一字元線前方之至少一第二字元線所控制之複數第三頁面是否不具有有效資料。當第三頁面中之任一者不具有有效資料時,流程進行至步驟S714;否則,流程進行至步驟S716。 Next, in step S712, the controller 160 determines whether the plurality of third pages controlled by the first word line and the at least one second word line arranged in front of the first word line do not have valid data. When any of the third pages does not have valid materials, the flow proceeds to step S714; otherwise, the flow proceeds to step S716.

在步驟S714中,控制器160將冗餘資料(dummy data)寫入第三頁面中不具有有效資料之頁面,以穩定第一區塊。 In step S714, the controller 160 writes dummy data to the page in the third page that does not have valid data to stabilize the first block.

接著,在步驟S716中,控制器160根據儲存於備份區塊中相應於第一頁面之資料,對第一區塊中之其他複數第二頁面進行寫入以將第一頁面之資料寫入第二頁面。換言之,控 制器160讀取備用區塊中第一頁面之資料,並將所讀取之第一頁面之資料寫入第一區塊中其他不具有有效資料之頁面(第二頁面)。流程結束於步驟S716。 Next, in step S716, the controller 160 writes the other plural second pages in the first block according to the data stored in the backup block corresponding to the first page to write the data of the first page into the first page. Two pages. In other words, control The controller 160 reads the data of the first page in the spare block, and writes the read data of the first page into other pages in the first block that do not have valid data (second page). The flow ends in step S716.

本發明所提供之資料儲存裝置以及資料維護方法可在斷電事件後將可能受損壞的資料重寫至相同的區塊中。在某些實施例中,資料儲存裝置以及資料維護方法亦可藉由備用區塊以及亢餘資料使得有效資料更穩定。 The data storage device and the data maintenance method provided by the present invention can rewrite potentially damaged data into the same block after a power failure event. In some embodiments, the data storage device and the data maintenance method may also make the effective data more stable by using the spare block and the surplus data.

本發明之方法,或特定型態或其部份,可以以程式碼的型態存在。程式碼可儲存於實體媒體,如軟碟、光碟片、硬碟、或是任何其他機器可讀取(如電腦可讀取)儲存媒體,亦或不限於外在形式之電腦程式產品,其中,當程式碼被機器,如電腦載入且執行時,此機器變成用以參與本發明之裝置。程式碼也可透過一些傳送媒體,如電線或電纜、光纖、或是任何傳輸型態進行傳送,其中,當程式碼被機器,如電腦接收、載入且執行時,此機器變成用以參與本發明之裝置。當在一般用途處理單元實作時,程式碼結合處理單元提供一操作類似於應用特定邏輯電路之獨特裝置。 The method of the invention, or a particular type or portion thereof, may exist in the form of a code. The code can be stored in a physical medium such as a floppy disk, a CD, a hard disk, or any other machine readable (such as computer readable) storage medium, or is not limited to an external form of computer program product, wherein When the code is loaded and executed by a machine, such as a computer, the machine becomes a device for participating in the present invention. The code can also be transmitted via some transmission medium, such as a wire or cable, fiber optics, or any transmission type, where the machine becomes part of the program when it is received, loaded, and executed by a machine, such as a computer. Invented device. When implemented in a general purpose processing unit, the code combination processing unit provides a unique means of operation similar to application specific logic.

惟以上所述者,僅為本發明之較佳實施例而已,當不能以此限定本發明實施之範圍,即大凡依本發明申請專利範圍及發明說明內容所作之簡單的等效變化與修飾,皆仍屬本發明專利涵蓋之範圍內。另外本發明的任一實施例或申請專利範圍不須達成本發明所揭露之全部目的或優點或特點。此外,摘要部分和標題僅是用來輔助專利文件搜尋之用,並非用來限制本發明之權利範圍。 The above is only the preferred embodiment of the present invention, and the scope of the invention is not limited thereto, that is, the simple equivalent changes and modifications made by the scope of the invention and the description of the invention are All remain within the scope of the invention patent. In addition, any of the objects or advantages or features of the present invention are not required to be achieved by any embodiment or application of the invention. In addition, the abstract sections and headings are only used to assist in the search of patent documents and are not intended to limit the scope of the invention.

100‧‧‧電子系統 100‧‧‧Electronic system

120‧‧‧主機 120‧‧‧Host

140‧‧‧資料儲存裝置 140‧‧‧Data storage device

160‧‧‧控制器 160‧‧‧ Controller

162‧‧‧運算單元 162‧‧‧ arithmetic unit

164‧‧‧永久記憶體 164‧‧‧Permanent memory

166‧‧‧隨機存取記憶體 166‧‧‧ random access memory

180‧‧‧快閃記憶體 180‧‧‧Flash memory

Claims (18)

一種資料儲存裝置,包括:一快閃記憶體,包括複數區塊,每一該等區塊包括複數頁面;以及一控制器,在該資料儲存裝置自一斷電事件中回復時,在該等區塊中選擇在該斷電事件之前最後一個進行寫入之一第一區塊,並且將該第一區塊中之複數第一頁面中之資料寫入該第一區塊中該等第一頁面外之其他複數第二頁面。 A data storage device comprising: a flash memory, comprising a plurality of blocks, each of the blocks comprising a plurality of pages; and a controller, when the data storage device replies from a power outage event, Selecting, in the block, one of the first blocks to be written before the power-off event, and writing the data in the plurality of first pages in the first block to the first block The other plural second page outside the page. 根據申請專利範圍第1項之資料儲存裝置,其中該第一區塊更包括複數字元線,並且該第一區塊為一二階儲存單元區塊(MLC block),其中該第一區塊之每一該等字元線用以控制該第一區塊中之兩個該等頁面。 The data storage device of claim 1, wherein the first block further comprises a complex digital element line, and the first block is a second-order storage unit block (MLC block), wherein the first block Each of the word lines is used to control two of the pages in the first block. 根據申請專利範圍第2項之資料儲存裝置,其中在該資料儲存裝置自該斷電事件中回復時,該控制器更用以在該第一區塊之該等頁面中選擇在該斷電事件之前最後一個被寫入之該頁面以作為一基準頁面,並且根據該等字元線中用以控制該基準頁面之一第一字元線決定該等第一頁面。 According to the data storage device of claim 2, wherein the controller is further configured to select the power-off event in the pages of the first block when the data storage device returns from the power-off event The last page that was previously written is used as a reference page, and the first page is determined based on the first word line in the word line for controlling one of the reference pages. 根據申請專利範圍第3項之資料儲存裝置,其中該等第一頁面為被該第一字元線以及排列於該第一字元線前方之至少一第二字元線所控制之複數第三頁面中具有有效資料的頁面。 The data storage device of claim 3, wherein the first page is a plurality of third words controlled by the first word line and at least one second word line arranged in front of the first word line A page with valid material on the page. 根據申請專利範圍第4項之資料儲存裝置,其中該控制器更用以將冗餘資料(dummy data)寫入該等第三頁面中不具有有效資料之頁面。 The data storage device of claim 4, wherein the controller is further configured to write dummy data into pages of the third page that do not have valid data. 根據申請專利範圍第1項之資料儲存裝置,其中該控制器更用以判斷一備份區塊中是否具有該等第一頁面之備份,並且將該等第一頁面中在該備份區塊不具有備份者之資料寫入該備份區塊。 According to the data storage device of claim 1, wherein the controller is further configured to determine whether a backup block has a backup of the first page, and the first page does not have the backup block in the first page. The backuper's data is written to the backup block. 根據申請專利範圍第6項之資料儲存裝置,其中該控制器更用以根據儲存於該備份區塊中相應於該等第一頁面之資料,對該等第二頁面進行寫入以將該等第一頁面之資料寫入該等第二頁面。 The data storage device of claim 6, wherein the controller is further configured to write the second pages according to the data stored in the backup block corresponding to the first pages to The first page of information is written to the second page. 根據申請專利範圍第6項之資料儲存裝置,其中該備份區塊之資料保護能力高於該第一區塊。 According to the data storage device of claim 6, wherein the backup block has higher data protection capability than the first block. 根據申請專利範圍第8項之資料儲存裝置,其中該第一區塊為一二階儲存單元區塊(MLC block),並且該備份區塊為一單階儲存單元區塊(SLC block)。 The data storage device of claim 8, wherein the first block is a second-order storage unit block (MLC block), and the backup block is a single-stage storage unit block (SLC block). 一種資料維護方法,適用於具有一快閃記憶體之一資料儲存裝置,其中該等快閃記憶體包括複數區塊,每一該等區塊包括複數頁面,該資料維護方法包括:在該資料儲存裝置自一斷電事件中回復時,在該等區塊中選擇在該斷電事件之前最後一個進行寫入之一第一區塊;以及將該第一區塊中之複數第一頁面中之資料寫入該第一區塊中該等第一頁面外之其他複數第二頁面。 A data maintenance method is applicable to a data storage device having a flash memory, wherein the flash memory includes a plurality of blocks, each of the blocks includes a plurality of pages, and the data maintenance method includes: When the storage device replies from a power outage event, select one of the first blocks to be written in the block before the power down event; and the first page in the first block The data is written to other plural second pages outside the first page in the first block. 根據申請專利範圍第10項之資料維護方法,其中該第一區塊更包括複數字元線,並且該第一區塊為一二階儲存單元區塊(MLC block),其中該第一區塊之每一該等字元線用以 控制該第一區塊中之兩個該等頁面。 According to the data maintenance method of claim 10, the first block further includes a complex digital element line, and the first block is a second-order storage unit block (MLC block), wherein the first block Each of the word lines is used Control two of the pages in the first block. 根據申請專利範圍第11項之資料維護方法,更包括:在該第一區塊之該等頁面中,選擇在該斷電事件之前最後一個進行寫入之該頁面以作為一基準頁面;以及根據該等字元線中用以控制該基準頁面之一第一字元線決定該等第一頁面。 According to the data maintenance method of claim 11, the method further includes: selecting, in the pages of the first block, the last page to be written before the power-off event as a reference page; The first word line in the word line for controlling one of the reference pages determines the first page. 根據申請專利範圍第12項之資料維護方法,其中該等第一頁面為被該第一字元線以及排列於該第一字元線前方之至少一第二字元線所控制之複數第三頁面中具有有效資料的頁面。 According to the data maintenance method of claim 12, wherein the first page is a plurality of third words controlled by the first word line and at least one second word line arranged in front of the first word line. A page with valid material on the page. 根據申請專利範圍第13項之資料維護方法,更包括將冗餘資料(dummy data)寫入該等第三頁面中不具有有效資料之頁面。 According to the data maintenance method of claim 13 of the patent application scope, it further includes writing dummy data to pages of the third page that do not have valid data. 根據申請專利範圍第10項之資料維護方法,更包括:判斷一備份區塊中是否具有該等第一頁面之備份;以及將該等第一頁面中在該備份區塊不具有備份者之資料寫入該備份區塊。 According to the data maintenance method of claim 10, the method further includes: determining whether a backup block has a backup of the first page; and the first page has no backup data in the backup block. Write to this backup block. 根據申請專利範圍第15項之資料維護方法,其中上述將該第一區塊中之該等第一頁面中之資料寫入該第一區塊中該等第一頁面外之其他該等第二頁面的步驟更包括:根據儲存於該備份區塊中相應於該等第一頁面之資料,對該等第二頁面進行寫入以將該等第一頁面之資料寫入該等第二頁面。 According to the data maintenance method of claim 15, wherein the information in the first page in the first block is written into the other second of the first block outside the first page. The step of the page further includes: writing the second pages according to the data stored in the backup block corresponding to the first pages to write the data of the first pages to the second pages. 根據申請專利範圍第15項之資料維護方法,其中該備份區 塊之資料保護能力高於該第一區塊。 According to the data maintenance method of claim 15 of the patent application scope, wherein the backup area The data protection capability of the block is higher than that of the first block. 根據申請專利範圍第17項之資料維護方法,其中該第一區塊為一二階儲存單元區塊(MLC block),並且該備份區塊為一單階儲存單元區塊(SLC block)。 According to the data maintenance method of claim 17, wherein the first block is a second-order storage unit block (MLC block), and the backup block is a single-stage storage unit block (SLC block).
TW105122007A 2015-11-13 2016-07-13 Data storage device and data maintenance method thereof TWI592801B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN201610768284.8A CN106708754B (en) 2015-11-13 2016-08-30 Data storage device and data maintenance method thereof
US15/345,785 US9747173B2 (en) 2015-11-13 2016-11-08 Data storage devices and data maintenance methods
US15/660,029 US9852032B2 (en) 2015-11-13 2017-07-26 Data storage devices and data maintenance methods

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
US201562254806P 2015-11-13 2015-11-13

Publications (2)

Publication Number Publication Date
TW201717024A true TW201717024A (en) 2017-05-16
TWI592801B TWI592801B (en) 2017-07-21

Family

ID=59366966

Family Applications (1)

Application Number Title Priority Date Filing Date
TW105122007A TWI592801B (en) 2015-11-13 2016-07-13 Data storage device and data maintenance method thereof

Country Status (1)

Country Link
TW (1) TWI592801B (en)

Also Published As

Publication number Publication date
TWI592801B (en) 2017-07-21

Similar Documents

Publication Publication Date Title
US10061512B2 (en) Data storage device and data writing method thereof
CN106708754B (en) Data storage device and data maintenance method thereof
US9483212B2 (en) Non-volatile memory devices and control methods therefor
TWI569273B (en) Method for read disturbance management in non-volatile memory devices
TWI621129B (en) Data storage device and data writing method thereof
US7751238B2 (en) Memory system protected from errors due to read disturbance and reading method thereof
TWI555023B (en) Refresh method for flash memory and memory controller
US9817725B2 (en) Flash memory controller, data storage device, and flash memory control method with volatile storage restoration
TWI660356B (en) Data storage device and operating method thereof
TWI569144B (en) Data storage device and power-interruption detection method thereof
TWI566252B (en) Method of performing wear management in non-volatile memory devices
CN111916136A (en) Memory controller and memory device
US10268546B2 (en) Non-volatile memory devices and controllers
TWI727458B (en) Memory apparatuses and methods for controlling memory apparatuses
US9430159B2 (en) Non-volatile memory devices and controllers
TWI682275B (en) Data storage device and operating method thereof
CN110069362B (en) Data storage device and data processing method
CN108255637B (en) Data storage device and operation method thereof
TWI592801B (en) Data storage device and data maintenance method thereof
CN115344418A (en) Memory system and operating method thereof
KR20190069803A (en) Memory system and operating method of memory system
US10019186B2 (en) Data maintenance method for error control and data storage device using the same
TWI640868B (en) Data storage device and data writing method thereof
JP7291640B2 (en) Semiconductor memory device and refresh method for semiconductor memory device
KR20220107733A (en) Nonvolatile memory device supporting protection mode and memory system for the same