TWI639113B - Memory device and control unit thereof, and data storage method for memory device - Google Patents

Memory device and control unit thereof, and data storage method for memory device Download PDF

Info

Publication number
TWI639113B
TWI639113B TW106108253A TW106108253A TWI639113B TW I639113 B TWI639113 B TW I639113B TW 106108253 A TW106108253 A TW 106108253A TW 106108253 A TW106108253 A TW 106108253A TW I639113 B TWI639113 B TW I639113B
Authority
TW
Taiwan
Prior art keywords
data
spare
control unit
storage device
blocks
Prior art date
Application number
TW106108253A
Other languages
Chinese (zh)
Other versions
TW201812566A (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 TW106108253A priority Critical patent/TWI639113B/en
Publication of TW201812566A publication Critical patent/TW201812566A/en
Application granted granted Critical
Publication of TWI639113B publication Critical patent/TWI639113B/en

Links

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

一種儲存裝置及其控制單元,以及一種可用於儲存裝置的資料儲存方法。所述儲存裝置包括有資料儲存媒體與控制單元。資料儲存媒體具有備用區塊池,備用區塊池具有多個備用區塊,且每一備用區塊皆具有多個資料頁。控制單元接收來自主機之資料,並判斷此資料是否為連續資料。當判斷為是時,控制單元分別寫入上述資料至至少二個備用區塊。當判斷為否時,控制單元分別寫入上述資料至其中一備用區塊的至少二個資料頁。A storage device and a control unit thereof, and a data storage method usable for the storage device. The storage device includes a data storage medium and a control unit. The data storage medium has a spare block pool, the spare block pool has a plurality of spare blocks, and each spare block has multiple data pages. The control unit receives the data from the host and determines whether the data is continuous data. When the determination is YES, the control unit respectively writes the above data to at least two spare blocks. When the determination is no, the control unit respectively writes the above data to at least two data pages of one of the spare blocks.

Description

儲存裝置及其控制單元、可用於儲存裝置的資料儲存方法Storage device and control unit thereof, data storage method applicable to storage device

本發明是有關於資料儲存的相關技術,尤其是一種儲存裝置及其控制單元,以及一種可用於儲存裝置的資料儲存方法。The present invention relates to related technologies for data storage, and more particularly to a storage device and a control unit thereof, and a data storage method that can be used for a storage device.

一般而言,儲存裝置主要由控制單元與資料儲存媒體(例如是快閃記憶體)所構成,其中資料儲存媒體具有多個資料區塊(data block),每一資料區塊具有多個資料頁(page),而控制單元電性耦接資料儲存媒體,以對上述資料區塊的資料頁進行資料之寫入、讀取或抹除動作。Generally, the storage device is mainly composed of a control unit and a data storage medium (for example, a flash memory), wherein the data storage medium has a plurality of data blocks, and each data block has a plurality of data pages. (page), and the control unit is electrically coupled to the data storage medium to perform data writing, reading or erasing operations on the data page of the data block.

然而,由於儲存裝置會因為頻繁的抺除動作、製程上的缺陷、隨著時間增長而導致的老化等因素而產生資料保存的問題。因此,在執行資料寫入操作後,儲存裝置的控制單元會利用錯誤校正碼(error correcting code,ECC)來對儲存裝置所儲存的資料進行資料的糾錯與修正操作。然而,錯誤校正碼的修正能力有一定的限制(例如,60位元),當資料頁所儲存的資料的錯誤位元數超過60位元時,超出了錯誤校正碼的修正能力而發生錯誤校正碼失效的問題,這將導致儲存裝置所儲存的資料喪失有效性。However, the storage device may cause data retention problems due to frequent removal actions, defects in the process, aging due to time, and the like. Therefore, after performing the data writing operation, the control unit of the storage device uses an error correcting code (ECC) to perform error correction and correction operations on the data stored in the storage device. However, the correction capability of the error correction code has a certain limit (for example, 60 bits). When the number of error bits of the data stored in the data page exceeds 60 bits, the error correction code is exceeded and the error correction occurs. The problem of code failure, which will result in loss of validity of the data stored in the storage device.

本發明提供一種儲存裝置,其在執行資料寫入操作時會複製一份相同的資料,以在有其中一份資料發生錯誤校正碼失效時能選擇儲存未發生錯誤校正碼失效的另一份資料,或是針對二份皆有發生錯誤校正碼失效的資料進行資料頁的整併而合成一份未發生錯誤校正碼失效的資料,進而避免資料遺失的問題。The present invention provides a storage device that copies a copy of the same data when performing a data write operation to select to store another data that has failed the error correction code when one of the data has an error correction code failure. Or, for the data of two copies of the error correction code failure, the data page is consolidated and a data that does not have the error correction code failure is synthesized, thereby avoiding the problem of data loss.

本發明另提供一種儲存裝置的控制單元,其在執行資料寫入操作時會複製一份相同的資料,以在有其中一份資料發生錯誤校正碼失效時能選擇儲存未發生錯誤校正碼失效的另一份資料,或是針對二份皆有發生錯誤校正碼失效的資料進行資料頁的整併而合成一份未發生錯誤校正碼失效的資料,進而避免資料遺失的問題。The invention further provides a control unit of the storage device, which copies a copy of the same data when performing the data writing operation, so as to select to store the failure of the error correction code when the error correction code of one of the data fails. Another piece of information, or the data sheet for the failure of the error correction code for two copies, is combined to form a data that has not failed the error correction code, thereby avoiding the loss of data.

本發明再提供一種可用於儲存裝置的資料儲存方法,其使得儲存裝置的控制單元在執行資料寫入操作時會複製一份相同的資料,以在有其中一份資料發生錯誤校正碼失效時能選擇儲存未發生錯誤校正碼失效的另一份資料,或是針對二份皆有發生錯誤校正碼失效的資料進行資料頁的整併而合成一份未發生錯誤校正碼失效的資料,進而避免資料遺失的問題。The present invention further provides a data storage method applicable to a storage device, which causes a control unit of the storage device to copy a copy of the same data when performing a data write operation, so that when one of the data fails the error correction code Select to store another piece of data that has not failed the error correction code, or to merge the data page for the data in which the error correction code has failed, and synthesize a piece of data that has not failed the error correction code, thereby avoiding the data. Lost question.

本發明提出一種儲存裝置,其包括有資料儲存媒體與控制單元。資料儲存媒體具有備用區塊池,而此備用區塊池用以存放多個備用區塊,且每一備用區塊皆具有多個資料頁。控制單元電性耦接資料儲存媒體,且控制單元接收並判斷來自於主機之資料是否為連續資料。當判斷為是時,控制單元分別寫入上述資料至至少二個備用區塊。而當判斷為否時,控制單元分別寫入上述資料至其中一備用區塊的至少二個資料頁。The invention provides a storage device comprising a data storage medium and a control unit. The data storage medium has a spare block pool, and the spare block pool is used to store a plurality of spare blocks, and each spare block has multiple data pages. The control unit is electrically coupled to the data storage medium, and the control unit receives and determines whether the data from the host is continuous data. When the determination is YES, the control unit respectively writes the above data to at least two spare blocks. When the determination is no, the control unit respectively writes the above data to at least two data pages of one of the spare blocks.

本發明另提出一種控制單元,其包括有控制邏輯與微處理器。控制邏輯電性耦接資料儲存媒體,所述資料儲存媒體具有備用區塊池,而此備用區塊池用以存放多個備用區塊,且每一備用區塊皆具有多個資料頁。微處理器電性耦接控制邏輯,且微處理器用以接收並判斷來自於主機之資料是否為連續資料。當判斷為是時,微處理器透過控制邏輯分別寫入上述資料至至少二個備用區塊。而當判斷為否時,微處理器透過控制邏輯分別寫入上述資料至其中一備用區塊的至少二個資料頁。The invention further provides a control unit comprising control logic and a microprocessor. The control logic is electrically coupled to the data storage medium. The data storage medium has a spare block pool, and the spare block pool is used to store a plurality of spare blocks, and each spare block has multiple data pages. The microprocessor is electrically coupled to the control logic, and the microprocessor is configured to receive and determine whether the data from the host is continuous data. When the determination is yes, the microprocessor writes the above data to the at least two spare blocks through the control logic. When the determination is no, the microprocessor writes the above data to at least two data pages of one of the spare blocks through the control logic.

本發明再提出一種可用於儲存裝置的資料儲存方法,其包括下列步驟:接收來自主機之資料;判斷此資料是否為連續資料;當判斷為是時,分別寫入上述資料至至少二個備用區塊,其中上述至少二個備用區塊係選自於備用區塊池之複數備用區塊且每一備用區塊皆具有多個資料頁;以及當判斷為否時,分別寫入上述資料至備用區塊池之其中一備用區塊的至少二個資料頁。The invention further provides a data storage method applicable to a storage device, comprising the steps of: receiving data from a host; determining whether the data is continuous data; and when determining that it is, writing the data to at least two spare areas respectively a block, wherein the at least two spare blocks are selected from a plurality of spare blocks in the spare block pool and each spare block has a plurality of data pages; and when the determination is no, the data is separately written to the spare area At least two data pages of one of the spare blocks of the block pool.

本發明係使儲存裝置在執行資料寫入操作時,採用上述方式來複製一份相同的資料,因此可以在有其中一份資料發生錯誤校正碼失效時能選擇儲存未發生錯誤校正碼失效的另一份資料,或是針對二份皆有發生錯誤校正碼失效的資料進行資料頁的整併而合成一份未發生錯誤校正碼失效的資料,進而避免資料遺失的問題。The invention enables the storage device to copy a copy of the same data in the above manner when performing the data writing operation, so that when one of the data fails the error correction code, the storage device can select to store the failure of the error correction code. A piece of information, or the data sheet for the failure of the error correction code for two copies, to synthesize a data without failure of the error correction code, thereby avoiding the problem of data loss.

圖1為依照本發明一實施例之儲存裝置的電路方塊圖。如圖1所示,儲存裝置100主要包括有控制單元110與資料儲存媒體120。資料儲存媒體120具有資料區塊池(data block pool)130與備用區塊池(spare block pool)140。備用區塊池140用以存放未寫入任何資料之備用區塊(如標示141~K所示,其中K為自然數)。備用區塊寫滿資料後將形成資料區塊(如標示131~M所示,其中M為自然數),並被移至資料區塊池130。在執行垃圾回收(garbage collection)之程序時,數個資料區塊的資料將被寫入至一個備用區塊,並於抺除動作後,又變回了備用區塊並被移至備用區塊池140;而寫入資料的備用區塊將形成資料區塊並被移至資料區塊池130。可想而知地,備用區塊141~K及資料區塊131~M皆為資料區塊在邏輯上之定義,使用者可依實際之需求而增加或減少資料區塊在邏輯上之定義。而如圖1所示,每一資料區塊皆具有多個資料頁(如標示P1~PN所示,其中N亦為自然數)。在此例中,資料儲存媒體120包括以非揮發性記憶體來實現,例如是以快閃記憶體(Flash memory)、磁阻式隨機存取記憶體(Magnetoresistive RAM)、鐵電隨機存取記憶體(Ferroelectric RAM)等具有長時間資料保存之記憶體裝置來實現。1 is a circuit block diagram of a storage device in accordance with an embodiment of the present invention. As shown in FIG. 1 , the storage device 100 mainly includes a control unit 110 and a data storage medium 120 . The data storage medium 120 has a data block pool 130 and a spare block pool 140. The spare block pool 140 is used to store spare blocks that are not written with any data (as indicated by the flags 141 to K, where K is a natural number). After the spare block is full, the data block will be formed (as indicated by the marks 131~M, where M is a natural number), and moved to the data block pool 130. When performing the garbage collection process, the data of several data blocks will be written to a spare block, and after the deletion operation, it will be changed back to the spare block and moved to the spare block. The pool 140; and the spare block that writes the data will form a data block and be moved to the data block pool 130. It is conceivable that the spare blocks 141~K and the data blocks 131~M are logically defined by the data blocks, and the user can increase or decrease the logical definition of the data blocks according to actual needs. As shown in FIG. 1, each data block has multiple data pages (as indicated by the labels P1 to PN, where N is also a natural number). In this example, the data storage medium 120 is implemented by non-volatile memory, such as a flash memory, a magnetoresistive random access memory (Magnetoresistive RAM), and a ferroelectric random access memory. This is realized by a memory device such as a Ferroelectric RAM that has a long-term data storage.

請繼續參照圖1。控制單元110係電性耦接資料儲存媒體120,並用以控制資料儲存媒體120的操作(例如進行資料的存取或抹除)。在此例中,控制單元110包括有介面邏輯112、微處理器114與控制邏輯116。微處理器114係電性耦接介面邏輯112,用以透過介面邏輯112接收來自主機(例如是電腦、手機、數位相機等具運算功能的電子裝置,未繪示)之命令或資料,例如:寫入命令、讀取命令、抺除命令等。此外,微處理器114還透過控制邏輯116電性耦接資料儲存媒體120,並用以透過控制邏輯116對資料儲存媒體120進行資料之存取,或進行資料之抹除。Please continue to refer to Figure 1. The control unit 110 is electrically coupled to the data storage medium 120 and is used to control the operation of the data storage medium 120 (for example, accessing or erasing data). In this example, control unit 110 includes interface logic 112, microprocessor 114, and control logic 116. The microprocessor 114 is electrically coupled to the interface logic 112 for receiving commands or data from the host computer (for example, an electronic device having a computing function such as a computer, a mobile phone, a digital camera, etc., not shown) through the interface logic 112, for example: Write commands, read commands, delete commands, and so on. In addition, the microprocessor 114 is electrically coupled to the data storage medium 120 through the control logic 116, and is used to access the data storage medium 120 through the control logic 116 or to erase the data.

在此例中,當接收到來自於主機的寫入命令以及欲寫入的資料時,微處理器114就會去判斷此資料是否為連續資料。所謂的連續資料即表示其所對應的多個邏輯區塊位址(logic block address,LBA)為依序接續。另外,連續資料的判斷不需以依序接續的二個邏輯區塊位址為準,可以依使用者所需而予以設定。例如,當其設定值為四時,唯有欲寫入的資料的依序接續邏輯區塊位址超過四時,微處理器114才判斷其為連續資料,否則,仍不視為連續資料。接著,微處理器114會依據判斷結果來選擇不同的資料儲存方式。In this example, upon receiving a write command from the host and the data to be written, the microprocessor 114 will determine if the data is continuous. The so-called continuous data means that the corresponding multiple logical block addresses (LBAs) are sequentially connected. In addition, the determination of continuous data does not need to be based on the two logical block addresses that are sequentially connected, and can be set according to the needs of the user. For example, when the set value is four, the microprocessor 114 judges that it is continuous data only if the sequential logical block address of the data to be written exceeds four, otherwise, it is not regarded as continuous data. Then, the microprocessor 114 selects different data storage methods according to the judgment result.

當判斷為否時,微處理器114就會透過控制邏輯116自備用區塊池140中挑選出一個備用區塊,並透過控制邏輯116而在挑選出的這個備用區塊的二個資料頁中皆寫入上述資料。舉例來說,微處理器114可以是透過控制邏輯116自備用區塊池140中挑選出備用區塊141,並在備用區塊141的資料頁P1中寫入上述資料,以及在備用區塊141的資料頁P2中寫入同樣的資料。換句話說,一份資料還有其備份皆儲存至同一個備用區塊141中。圖示中資料頁P1與資料頁P2為相鄰的二個資料頁,此為較佳的實施方式。然而,資料頁P1與資料頁P2也可為不相鄰的二個資料頁,微處理器114可依據一方程式或亂數產生器來決定資料頁的位置,但不以此為限。另外,備份的數量可以大於一。例如,微處理器114於備用區塊141的其他資料頁,例如,資料頁P3,寫入同樣的資料。如此一來,一份資料以及二份備份皆儲存至同一個備用區塊141中。When the determination is no, the microprocessor 114 selects a spare block from the spare block pool 140 through the control logic 116, and selects two data pages of the spare block through the control logic 116. The above information is written in both. For example, the microprocessor 114 may select the spare block 141 from the spare block pool 140 through the control logic 116, and write the above data in the data page P1 of the spare block 141, and in the spare block. The same information is written in the data page P2 of 141. In other words, a piece of data and its backups are stored in the same spare block 141. The data page P1 and the data page P2 in the figure are two adjacent data pages, which is a preferred embodiment. However, the data page P1 and the data page P2 may also be two data pages that are not adjacent. The microprocessor 114 may determine the location of the data page according to a program or a random number generator, but is not limited thereto. In addition, the number of backups can be greater than one. For example, the microprocessor 114 writes the same data on other material pages of the spare block 141, for example, the material page P3. In this way, one piece of data and two copies are stored in the same spare block 141.

另外,備用區塊141可為備用區塊池140中抺除次數最少或者最久未執行抺除動作者,以符合耗損平均(wear leveling)之管理。In addition, the spare block 141 may be the least number of erasures in the spare block pool 140 or the last time the actor is not executed to comply with the management of wear leveling.

反之,當判斷為是時,微處理器114便透過控制邏輯116自備用區塊池140中挑選出二個備用區塊,並透過控制邏輯116而在挑選出的每一備用區塊中皆寫入上述資料。舉例來說,微處理器114可以是透過控制邏輯116自備用區塊池140中挑選出備用區塊142與143,並自備用區塊142的資料頁P1寫入上述資料,以及自備用區塊143的資料頁P1寫入同樣的資料。On the other hand, when the determination is yes, the microprocessor 114 selects two spare blocks from the spare block pool 140 through the control logic 116, and passes through the control logic 116 in each of the selected spare blocks. Write the above information. For example, the microprocessor 114 may select the spare blocks 142 and 143 from the spare block pool 140 through the control logic 116, and write the above data from the data page P1 of the spare block 142, and provide the self-prepared data. The same data is written by the data page P1 of the block 143.

當上述的二個備用區塊寫滿資料時(即所有的資料頁皆寫入資料),微處理器114就會啟動資料確認(verification)之程序,即利用錯誤校正碼來對這二個備用區塊中的每一個資料頁進行資料的糾錯與修正操作,當任何一個備用區塊的任一資料頁有錯誤校正碼失效的問題,則此備用區塊即存在錯誤校正碼失效的問題。並依是否有錯誤校正碼失效的問題來決定是否對這二個備用區塊進行資料整併。另外,為了特定的目的,微處理器114可主動地對備用區塊的未寫入資料的資料頁填入虛置資料(dummy data),使備用區塊寫滿資料而進入啟動資料確認程序。When the two spare blocks described above are full of data (ie, all data pages are written to the data), the microprocessor 114 initiates a data verification procedure, that is, using the error correction code to perform the two backups. Each data page in the block performs error correction and correction operations on the data. When any data page of any spare block has a problem that the error correction code fails, the spare block has the problem that the error correction code fails. And depending on whether there is an error correction code failure, it is decided whether to perform data consolidation on the two spare blocks. In addition, for a specific purpose, the microprocessor 114 can actively fill in the dummy data of the unwritten data of the spare block, and make the spare block full of data to enter the startup data confirming program.

當執行資料確認程序而微處理器114判斷上述這二個備用區塊皆沒有發生錯誤校正碼失效的問題,或是判斷只有一個備用區塊有發生錯誤校正碼失效的問題時,那麼微處理器114就會透過控制邏輯116將沒有發生錯誤校正碼失效的問題的其中一個備用區塊變更為資料區塊,並存放至資料區塊池130中,而剩下的另一個備用區塊則被回收,即抹除資料並存放回備用區塊池140中。When the data confirmation program is executed and the microprocessor 114 determines that none of the two spare blocks has failed the error correction code, or judges that only one spare block has a problem that the error correction code has failed, then the microprocessor 114, through the control logic 116, one of the spare blocks of the problem that the error correction code has not been invalidated is changed into a data block and stored in the data block pool 130, and the remaining spare block is recycled. That is, the data is erased and stored back into the spare block pool 140.

以前述微處理器114所挑選出的備用區塊142與143為例,假設備用區塊142與143皆已寫滿資料,且其中只有備用區塊142有發生錯誤校正碼失效的問題,而備用區塊143沒有發生錯誤校正碼失效的問題時,那麼微處理器114就會透過控制邏輯116將備用區塊143變更為資料區塊並存放至資料區塊池130中。此外,微處理器114還會透過控制邏輯116抹除備用區塊142中的所有資料並存回備用區塊池140中。Taking the spare blocks 142 and 143 selected by the microprocessor 114 as an example, it is assumed that the spare blocks 142 and 143 are full of data, and only the spare block 142 has a problem that the error correction code fails. When the spare block 143 does not have the problem of the error correction code failing, the microprocessor 114 changes the spare block 143 to the data block through the control logic 116 and stores it in the data block pool 130. In addition, the microprocessor 114 also erases all of the data in the spare block 142 through the control logic 116 and stores it back into the spare block pool 140.

另外,當執行資料確認程序而微處理器114判斷上述的二個備用區塊皆有發生錯誤校正碼失效的問題時,就會透過控制邏輯116自備用區塊池140中再挑選出一個備用區塊(命名為第三備用區塊),並將上述這二個已寫滿資料的備用區塊中之沒有發生錯誤校正碼失效的資料頁的資料儲存至第三備用區塊的資料頁中,並在第三備用區塊寫滿資料並通過資料確認後將其變更為資料區塊,並存放至資料區塊池130中,最後,將上述這二個備用區塊在抹除其資料後存放回備用區塊池140中。In addition, when the data confirmation program is executed and the microprocessor 114 determines that the two spare blocks have the problem that the error correction code has failed, the control logic 116 selects another spare from the spare block pool 140. a block (named as a third spare block), and storing the data of the data pages in the spare blocks that have been filled with data without the error correction code being invalidated into the data page of the third spare block And after the third spare block is full of data and confirmed by the data, it is changed into a data block and stored in the data block pool 130. Finally, the two spare blocks are erased after the data is erased. Stored back into the spare block pool 140.

再以前述微處理器114所挑選出的備用區塊142與143為例,假設備用區塊142與143皆已寫滿資料,且備用區塊142資料頁P1及PN有發生錯誤校正碼失效的問題,備用區塊143的資料頁P1及PN並無錯誤校正碼失效的問題;備用區塊143的資料頁P2及PN-1有發生錯誤校正碼失效的問題,備用區塊142的資料頁P2及PN-1並無錯誤校正碼失效的問題。那麼微處理器114就會透過控制邏輯116自備用區塊池140中挑選出一個備用區塊以作為第三備用區塊,例如是挑選出備用區塊144,以將備用區塊142的資料頁P2~PN-1以及備用區塊143的資料頁P1及PN的資料儲存至備用區塊144中。於資料確認的程序中,微處理器114更可以於資料儲存至備用區塊144後,重新確認資料頁之資料,以確保資料已正確地儲存至備用區塊144中。如果有資料頁亦存在錯誤校正碼失效的問題,則微處理器114透過控制邏輯116自備用區塊池140中再挑選出另一個備用區塊作為第三備用區塊,並重新上述步驟。當資料的準確性完成確認後,微處理器114就會透過控制邏輯116將備用區塊144變更為資料區塊並存放至資料區塊池130中。此外,微處理器114還會透過控制邏輯116抹除備用區塊142與143並存回備用區塊池140中,完成資料確認之程序。Taking the spare blocks 142 and 143 selected by the microprocessor 114 as an example, it is assumed that the spare blocks 142 and 143 are full of data, and the error blocks of the data blocks P1 and PN of the spare block 142 are invalid. The problem that the data pages P1 and PN of the spare block 143 have no error correction code failure; the data pages P2 and PN-1 of the spare block 143 have the problem that the error correction code is invalid, and the data page of the spare block 142 P2 and PN-1 have no problem with the error correction code being invalid. Then, the microprocessor 114 selects a spare block from the spare block pool 140 through the control logic 116 as a third spare block, for example, picking up the spare block 144 to use the data of the spare block 142. The pages P2 to PN-1 and the data pages P1 and PN of the spare block 143 are stored in the spare block 144. In the data confirmation process, the microprocessor 114 can re-confirm the data page data after the data is stored in the spare block 144 to ensure that the data has been correctly stored in the spare block 144. If there is a problem that the data page also has an error correction code failure, the microprocessor 114 selects another spare block from the spare block pool 140 as the third spare block through the control logic 116, and repeats the above steps. When the accuracy of the data is confirmed, the microprocessor 114 changes the spare block 144 to the data block through the control logic 116 and stores it in the data block pool 130. In addition, the microprocessor 114 also erases the spare blocks 142 and 143 through the control logic 116 and stores them in the spare block pool 140 to complete the data confirmation process.

藉由上述教示,本領域具有通常知識者當可歸納出一種可用於儲存裝置之資料儲存方法的一些基本操作步驟,如圖2所示。圖2即為依照本發明一實施例之一種可用於儲存裝置之資料儲存方法的流程圖。請參照圖2,此方法包括有下列步驟:首先,接收來自主機之資料(如步驟S201所示);接著,判斷此資料是否為連續資料(如步驟S202所示);接下來,當判斷為是時,分別寫入上述資料至至少二個備用區塊,其中上述至少二個備用區塊係選自於備用區塊池且每一備用區塊皆具有多個資料頁(如步驟S203所示);反之,當判斷為否時,分別寫入上述資料至備用區塊池之其中一備用區塊的至少二個資料頁(如步驟S204所示)。With the above teachings, those skilled in the art can summarize some basic operational steps of a data storage method that can be used for a storage device, as shown in FIG. 2 is a flow chart of a data storage method applicable to a storage device according to an embodiment of the invention. Referring to FIG. 2, the method includes the following steps: first, receiving data from the host (as shown in step S201); then, determining whether the data is continuous data (as shown in step S202); If yes, the foregoing data is respectively written to the at least two spare blocks, wherein the at least two spare blocks are selected from the spare block pool and each spare block has multiple data pages (as shown in step S203). Otherwise, when the determination is no, the above data is respectively written to at least two data pages of one of the spare blocks of the spare block pool (as shown in step S204).

綜上所述,本發明係使儲存裝置在執行資料寫入操作時,採用上述方式來複製一份相同的資料,因此可以在有其中一份資料發生錯誤校正碼失效時能選擇儲存未發生錯誤校正碼失效的另一份資料,或是針對二份皆有發生錯誤校正碼失效的資料進行資料頁的整併而合成一份未發生錯誤校正碼失效的資料,進而避免資料遺失的問題。In summary, the present invention enables the storage device to copy a copy of the same data in the above manner when performing a data write operation, so that it can be selected to store no error when one of the data fails the error correction code. Another piece of information that invalidates the calibration code, or the data sheet for the failure of the error correction code to be duplicated, and a data that has not been invalidated by the error correction code is synthesized, thereby avoiding the problem of data loss.

雖然本發明已以較佳實施例揭露如上,然其並非用以限定本發明,任何熟習此技藝者,在不脫離本發明之精神和範圍內,當可作些許之更動與潤飾,因此本發明之保護範圍當視後附之申請專利範圍所界定者為準。While the present invention has been described in its preferred embodiments, the present invention is not intended to limit the invention, and the present invention may be modified and modified without departing from the spirit and scope of the invention. The scope of protection is subject to the definition of the scope of the patent application.

100‧‧‧儲存裝置100‧‧‧ storage device

110‧‧‧控制單元110‧‧‧Control unit

112‧‧‧介面邏輯112‧‧‧Interface logic

114‧‧‧微處理器114‧‧‧Microprocessor

116‧‧‧控制邏輯116‧‧‧Control logic

120‧‧‧資料儲存媒體120‧‧‧Data storage media

130‧‧‧資料區塊池130‧‧‧Data block pool

131~M‧‧‧資料區塊131~M‧‧‧data block

140‧‧‧備用區塊池140‧‧‧Reserved block pool

141~K‧‧‧備用區塊141~K‧‧‧ spare block

P1 ~PN‧‧‧資料頁P1 ~ PN‧‧‧Information Page

S201~S204‧‧‧步驟S201~S204‧‧‧Steps

圖1為依照本發明一實施例之儲存裝置的電路方塊圖;   圖2為依照本發明一實施例之一種可用於儲存裝置之資料儲存方法的流程圖。1 is a circuit block diagram of a storage device in accordance with an embodiment of the present invention; and FIG. 2 is a flow chart of a data storage method applicable to a storage device in accordance with an embodiment of the present invention.

Claims (9)

一種儲存裝置,其包括:一非揮發性記憶體,具有複數備用區塊:以及一控制單元,用以控制該非揮發性記憶體的運作,該控制單元判斷欲寫入該非揮發性記憶體之一資料是否為一連續資料,當判斷為是時,該控制單元選取並寫入該資料至至少二該等備用區塊。 A storage device comprising: a non-volatile memory having a plurality of spare blocks: and a control unit for controlling operation of the non-volatile memory, the control unit determining to write to one of the non-volatile memories Whether the data is a continuous data, when the determination is yes, the control unit selects and writes the data to at least two of the spare blocks. 如申請專利範圍第1項所述之儲存裝置,其中該連續資料所對應的多個邏輯區塊位址為依序接續。 The storage device of claim 1, wherein the plurality of logical block addresses corresponding to the continuous data are sequentially connected. 如申請專利範圍第1項所述之儲存裝置,其中至少二該等備用區塊為該等備用區塊中具有一抺除次數的最小值或一時間記錄的最大值。 The storage device of claim 1, wherein at least two of the spare blocks are a minimum value of the number of erasures or a maximum value of a time record in the spare blocks. 如申請專利範圍第1項所述之儲存裝置,其中每一該等區塊具有複數資料頁。 The storage device of claim 1, wherein each of the blocks has a plurality of data pages. 如申請專利範圍第1項所述之儲存裝置,其中該控制單元判斷為否時,該控制單元選取並寫入該資料至其中之一該等備用區塊的至少二該等資料頁。 The storage device of claim 1, wherein the control unit selects and writes the data to at least two of the data pages of one of the spare blocks. 一種儲存裝置,其包括:一非揮發性記憶體,具有複數區塊;以及一控制單元,用以控制該非揮發性記憶體的運作,該控制單元判斷欲寫入該非揮發性記憶體之一資料是否為一連續資料,當判斷為是時,該控制單元選取並寫入該資料至至少二該等區塊。 A storage device comprising: a non-volatile memory having a plurality of blocks; and a control unit for controlling operation of the non-volatile memory, the control unit determining data to be written to the non-volatile memory Whether it is a continuous data, when the judgment is yes, the control unit selects and writes the data to at least two of the blocks. 如申請專利範圍第6項所述之儲存裝置,其中該連續資料所對應的多個邏輯區塊位址為依序接續。 The storage device of claim 6, wherein the plurality of logical block addresses corresponding to the continuous data are sequentially connected. 如申請專利範圍第6項所述之儲存裝置,其中每一該等區塊具有複數資料頁。 The storage device of claim 6, wherein each of the blocks has a plurality of data pages. 如申請專利範圍第6項所述之儲存裝置,其中該控制單元判斷為否時,該控制單元選取並寫入該資料至其中之一該等備用區塊的至少二該等資料頁。 The storage device of claim 6, wherein the control unit selects and writes the data to at least two of the data pages of one of the spare blocks.
TW106108253A 2016-03-14 2016-03-14 Memory device and control unit thereof, and data storage method for memory device TWI639113B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW106108253A TWI639113B (en) 2016-03-14 2016-03-14 Memory device and control unit thereof, and data storage method for memory device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW106108253A TWI639113B (en) 2016-03-14 2016-03-14 Memory device and control unit thereof, and data storage method for memory device

Publications (2)

Publication Number Publication Date
TW201812566A TW201812566A (en) 2018-04-01
TWI639113B true TWI639113B (en) 2018-10-21

Family

ID=62639401

Family Applications (1)

Application Number Title Priority Date Filing Date
TW106108253A TWI639113B (en) 2016-03-14 2016-03-14 Memory device and control unit thereof, and data storage method for memory device

Country Status (1)

Country Link
TW (1) TWI639113B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201314698A (en) 2011-07-28 2013-04-01 Sandisk Technologies Inc Non-volatile memory and method with accelerated post-write read using combined verification of multiple pages
TW201413453A (en) 2012-09-20 2014-04-01 Silicon Motion Inc Data storage device and flash memory control method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201314698A (en) 2011-07-28 2013-04-01 Sandisk Technologies Inc Non-volatile memory and method with accelerated post-write read using combined verification of multiple pages
TW201413453A (en) 2012-09-20 2014-04-01 Silicon Motion Inc Data storage device and flash memory control method

Also Published As

Publication number Publication date
TW201812566A (en) 2018-04-01

Similar Documents

Publication Publication Date Title
US10255192B2 (en) Data storage device and data maintenance method thereof
CN105701021B (en) Data storage device and data writing method thereof
JP4729062B2 (en) Memory system
US8086787B2 (en) Wear leveling method, and storage system and controller using the same
US20170228154A1 (en) Device and method for power loss protection in solid state drive
JP5675954B2 (en) Detection of irregular parity distribution via metadata tag
JP5853899B2 (en) Storage control device, storage device, information processing system, and processing method therefor
JP5612514B2 (en) Nonvolatile memory controller and nonvolatile storage device
US8055873B2 (en) Data writing method for flash memory, and controller and system using the same
TWI645404B (en) Data storage device and control method for non-volatile memory
CN110895514A (en) Mapping table updating method
US20090307413A1 (en) Data writing method for flash memory and storage system and controller using the same
US20090089484A1 (en) Data protection method for power failure and controller using the same
TWI633428B (en) Data storage device and methods for processing data in the data storage device
US10446252B2 (en) Data storage device and method for data error management
KR20110121897A (en) User device and program fail procerssing method thereof
TWI498899B (en) Data writing method, memory controller and memory storage apparatus
KR20100094241A (en) Nonvolatile memory device not including reserved blocks
TWI459198B (en) Memory storage device, memory controller thereof, and method for identifying valid data
US20100318726A1 (en) Memory system and memory system managing method
CN112099985A (en) Data storage device and non-volatile memory control method
TWI639112B (en) Memory device and control unit thereof, and data storage method for memory device
JP2010086009A (en) Storage device and memory control method
US9778862B2 (en) Data storing method for preventing data losing during flush operation, memory control circuit unit and memory storage apparatus
JP4513786B2 (en) Memory controller, memory system, and memory control method