TW201526013A - Storage device and access method therefor - Google Patents

Storage device and access method therefor Download PDF

Info

Publication number
TW201526013A
TW201526013A TW102147314A TW102147314A TW201526013A TW 201526013 A TW201526013 A TW 201526013A TW 102147314 A TW102147314 A TW 102147314A TW 102147314 A TW102147314 A TW 102147314A TW 201526013 A TW201526013 A TW 201526013A
Authority
TW
Taiwan
Prior art keywords
data
error correction
memory device
unit
correction data
Prior art date
Application number
TW102147314A
Other languages
Chinese (zh)
Other versions
TWI537971B (en
Inventor
jun-qi Ye
Jia-Hong Jian
fu-sheng Zhuang
Original Assignee
Silicon Technologies Corp Q
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 Technologies Corp Q filed Critical Silicon Technologies Corp Q
Priority to TW102147314A priority Critical patent/TWI537971B/en
Publication of TW201526013A publication Critical patent/TW201526013A/en
Application granted granted Critical
Publication of TWI537971B publication Critical patent/TWI537971B/en

Links

Abstract

A storage device and an access method therefor are disclosed. The device includes a memory and a controller. The memory is used to store a plurality of unit data; the controller receives a plurality of data and encodes the data to generate a plurality of error correction data. The error correction data includes the unit data, and the controller writes the unit data either using an alternating approach or based on a mapping address into the memory. Accordingly, the errors in the error correction data can be equally distributed in the memory, thereby improving the error correction capability of the error correction codes.

Description

儲存裝置及其存取方法Storage device and access method thereof

本發明係一種電子裝置及其控制方法,尤指一種儲存裝置及其存取方法。The present invention relates to an electronic device and a control method thereof, and more particularly to a storage device and an access method thereof.

近年來由於快閃記憶體的技術不斷地發展,各種可攜式記憶體裝置或具備快閃記憶體之固態硬碟(Solid State Drive,SSD)被廣泛地實施於諸多應用中。因此,這些可攜式記憶裝置中之快閃記憶體的存取控制遂成為相當熱門的議題。以常用的NAND型快閃記憶體而言,其主要可區分為單階細胞(Single Level Cell,SLC)與多階細胞(Multiple Level Cell,MLC)兩大類之快閃記憶體。In recent years, due to the continuous development of flash memory technology, various portable memory devices or solid state drives (SSDs) with flash memory have been widely implemented in many applications. Therefore, access control of flash memory in these portable memory devices has become a hot topic. In the conventional NAND type flash memory, it can be mainly divided into two types of flash memory: single level cell (SLC) and multiple level cell (MLC).

另外,錯誤更正對於記憶體裝置內資料可靠度的維持非常重要。尤其當記憶單元的密度或每一記憶單元的儲存位元數增加時,錯誤更正變得更為重要。再者,記憶體裝置(例如快閃記憶體)於製造時或是經過相當多次的讀寫後,也會產生錯誤位元。In addition, error correction is very important for maintaining data reliability in a memory device. In particular, error correction becomes more important as the density of memory cells or the number of memory bits per memory cell increases. Furthermore, memory devices (such as flash memory) can also generate erroneous bits at the time of manufacture or after a considerable number of reads and writes.

錯誤更正碼(Error Correcting Code,ECC)被用以增進記憶體裝置的可靠度。然而,傳統記憶體裝置的錯誤更正碼並非很有效,一般而言,使用固定資料長度及固定錯誤更正碼率,且以錯誤更正單位為單位進行資料存取,若某一個錯誤更正單位資料的錯誤位元特別多且超過錯誤更正碼可更正範圍,則此資料即無法使用,甚至無法回復而永遠失去。鑑於傳統記憶體裝置無法有效地更正錯誤及防止資料遺失,因此亟需提出一種新穎的記憶體系統及方法,用以有效地增進記憶體裝置內資料的可靠度並防止資料的遺失。An Error Correcting Code (ECC) is used to improve the reliability of the memory device. However, the error correction code of the conventional memory device is not very effective. Generally, the fixed data length and the fixed error correction code rate are used, and the data access is performed in units of error correction units, and if one error corrects the error of the unit data. The bit is particularly large and the error correction code can be corrected to correct the range, so the data cannot be used, even unable to reply and will be lost forever. In view of the fact that traditional memory devices cannot effectively correct errors and prevent data loss, it is imperative to propose a novel memory system and method for effectively improving the reliability of data in the memory device and preventing data loss.

因此,本發明針對上述問題提供了一種用以提升錯誤更正能力之儲存裝置及其存取方法。Accordingly, the present invention provides a storage device for improving error correction capability and an access method thereof for the above problems.

本發明之一目的,係提供一種儲存裝置及其存取方法,將複數錯誤更正資料藉由交錯或映射之方式平均分散至記憶體裝置之複數資料區塊中,使該些錯誤更正資料中的錯誤平均分散至該些資料區塊,進而增加錯誤更正碼的錯誤更正能力。An object of the present invention is to provide a storage device and an access method thereof, wherein the complex error correction data is evenly distributed to the plurality of data blocks of the memory device by means of interleaving or mapping, so that the errors are corrected in the data. Errors are evenly spread across the data blocks, which in turn increases the error correction ability of the error correction code.

本發明之一目的,係提供一種儲存裝置及其存取方法,藉由改變每一分頁中資料區塊與備用區塊的儲存空間比例,以提升錯誤更正碼的錯誤更正能力。An object of the present invention is to provide a storage device and an access method thereof, which can improve the error correction capability of an error correction code by changing the storage space ratio of the data block and the spare block in each page.

為了達到上述所指稱之各目的與功效,本發明係揭示了一種儲存裝置,其包含:一記憶體裝置,用以儲存複數單位資料;以及一控制器,接收複數資料,並將該些資料編碼產生複數錯誤更正資料,該些錯誤更正資料包含該些單位資料,控制器將該些錯誤更正資料之該些單位資料以一交錯方式或依照一映射位址寫入至記憶體裝置。In order to achieve the above-mentioned various purposes and effects, the present invention discloses a storage device comprising: a memory device for storing a plurality of unit data; and a controller for receiving the plurality of data and encoding the data A plurality of error correction data is generated. The error correction data includes the unit data, and the controller writes the unit data of the error correction data to the memory device in an interleaved manner or according to a mapping address.

本發明更揭示了一種儲存裝置之存取方法,其步驟包含:將複數資料編碼產生複數錯誤更正資料,該些錯誤更正資料包含複數單位資料;以及將該些錯誤更正資料之該些單位資料以一交錯方式或依照一映射位址寫入至一記憶體裝置。The present invention further discloses a method for accessing a storage device, the method comprising: encoding a plurality of data to generate a plurality of error correction data, wherein the error correction data comprises a plurality of unit data; and the unit data of the error correction data is Write to a memory device in an interleaved manner or in accordance with a mapped address.

10‧‧‧記憶體裝置
30‧‧‧控制器
301‧‧‧微處理單元
303‧‧‧錯誤更正碼電路
305‧‧‧映射電路
307‧‧‧轉換電路
309‧‧‧緩衝記憶體
50‧‧‧主機
A、B、C‧‧‧錯誤更正資料
A1、A2、An、B1、B2、Bn、C1、C2、Cn‧‧‧單位資料
D、D1、D2、Dn‧‧‧資料區塊
S‧‧‧備用區塊
S10、S20、S30、S40、S50、S70‧‧‧步驟
10‧‧‧ memory device
30‧‧‧ Controller
301‧‧‧Microprocessing unit
303‧‧‧Error correction code circuit
305‧‧‧ mapping circuit
307‧‧‧Transition circuit
309‧‧‧ Buffer memory
50‧‧‧Host
A, B, C‧‧‧ error correction information
A 1 , A 2 , A n , B 1 , B 2 , B n , C 1 , C 2 , C n ‧‧‧ unit data
D, D 1 , D 2 , D n ‧‧‧ data blocks
S‧‧‧ spare block
S10, S20, S30, S40, S50, S70‧‧ steps


第1圖:其係為本發明之一較佳實施例之儲存裝置之方塊圖;
第2圖:其係為本發明之一較佳實施例之寫入程序之流程圖;
第3圖:其係為本發明之一較佳實施例之寫入程序之交錯示意圖;
第4圖:其係為本發明之另一較佳實施例之寫入程序之流程圖;
第5A圖:其係為本發明之一較佳實施例之資料區塊-備用區塊之比例示意圖;
第5B圖:其係為本發明之另一較佳實施例之資料區塊-備用區塊之比例示意圖;
第6圖:其係為本發明之一較佳實施例之讀取程序之流程圖;以及
第7圖:其係為本發明之一較佳實施例之讀取程序之映射示意圖。

Figure 1 is a block diagram of a storage device in accordance with a preferred embodiment of the present invention;
Figure 2 is a flow chart of a writing procedure of a preferred embodiment of the present invention;
Figure 3 is a cross-sectional view showing a writing procedure of a preferred embodiment of the present invention;
Figure 4 is a flow chart showing a writing procedure of another preferred embodiment of the present invention;
FIG. 5A is a schematic diagram showing the ratio of a data block to a spare block according to a preferred embodiment of the present invention;
FIG. 5B is a schematic diagram showing the ratio of a data block to a spare block according to another preferred embodiment of the present invention;
Figure 6 is a flow chart showing a reading procedure of a preferred embodiment of the present invention; and Figure 7 is a schematic diagram showing the mapping of a reading program according to a preferred embodiment of the present invention.

在說明書及後續的申請專利範圍當中使用了某些詞彙來指稱特定的元件。所屬領域中具有通常知識者應可理解,硬體製造商可能會用不同的名詞來稱呼同一個元件。本說明書及後續的申請專利範圍並不以名稱的差異來作為區分元件的方式,而是以元件在功能上的差異來作為區分的準則。在通篇說明書及後續的請求項當中所提及的「包含」係為一開放式的用語,故應解釋成「包含但不限定於」。以外,「耦接」一詞在此係包含任何直接及間接的電氣連接手段。因此,若文中描述一第一裝置耦接於一第二裝置,則代表該第一裝置可直接電氣連接於該第二裝置,或透過其他裝置或連接手段間接地電氣連接至該第二裝置。Certain terms are used throughout the description and following claims to refer to particular elements. Those of ordinary skill in the art should understand that a hardware manufacturer may refer to the same component by a different noun. The scope of this specification and the subsequent patent application do not use the difference of the names as the means for distinguishing the elements, but the difference in function of the elements as the criterion for distinguishing. The term "including" as used throughout the specification and subsequent claims is an open term and should be interpreted as "including but not limited to". In addition, the term "coupled" is used herein to include any direct and indirect electrical connection. Therefore, if a first device is coupled to a second device, it means that the first device can be directly electrically connected to the second device or indirectly electrically connected to the second device through other devices or connection means.

為使 貴審查委員對本發明之特徵及所達成之功效有更進一步之瞭解與認識,謹佐以較佳之實施例及配合詳細之說明,說明如後:In order to provide a better understanding and understanding of the features and the efficacies of the present invention, the preferred embodiment and the detailed description are as follows:

請參閱第1圖,其為本發明之一較佳實施例之儲存裝置之方塊圖。如圖所示,儲存裝置包含一記憶體裝置10以及一控制器30。控制器30用以對一主機50所提供之複數資料進行編碼以產生複數錯誤更正資料,並以一交錯方式或依照一映射位址將該些錯誤更正資料所包含之複數單位資料寫入至記憶體裝置10,或以交錯方式或依照映射位址將記憶體裝置10所儲存之該些單位資料讀出,而還原為該些錯誤更正資料,並對該些錯誤更正資料解碼以供主機50讀取。且 控制器30於寫入該些單位資料至記憶體裝置10之後,更依據該些單位資料之錯誤數量,而將記憶體裝置10之複數資料區塊的部分空間轉換至該些資料區塊所對應之複數備用區塊。Please refer to FIG. 1 , which is a block diagram of a storage device in accordance with a preferred embodiment of the present invention. As shown, the storage device includes a memory device 10 and a controller 30. The controller 30 is configured to encode the complex data provided by the host 50 to generate complex error correction data, and write the complex unit data included in the error correction data to the memory in an interleaved manner or according to a mapping address. The device 10 reads out the unit data stored in the memory device 10 in an interleaved manner or in accordance with the mapped address, and restores the error correction data, and decodes the error correction data for the host 50 to read. take. After the controller 30 writes the unit data to the memory device 10, the partial space of the plurality of data blocks of the memory device 10 is converted to the data blocks according to the number of errors of the unit data. Corresponding multiple spare blocks.

控制器30包含一微處理單元301、一錯誤更正碼電路303、一映射電路305以及一轉換電路307。錯誤更正碼電路303耦接微處理單元301,並受控於微處理單元301。當需將該些資料寫入記憶體裝置10時,錯誤更正碼電路303對主機50所傳送之該些資料進行編碼以加入錯誤更正碼,而產生該些錯誤更正資料,並傳送至映射電路。當主機50需讀取該些資料時,錯誤更正碼電路305對映射電路305傳送來之該些錯誤更正資料進行解碼,而還原為該些資料,以供主機50讀取。The controller 30 includes a micro processing unit 301, an error correction code circuit 303, a mapping circuit 305, and a conversion circuit 307. The error correction code circuit 303 is coupled to the micro processing unit 301 and is controlled by the micro processing unit 301. When the data needs to be written to the memory device 10, the error correction code circuit 303 encodes the data transmitted by the host 50 to add an error correction code, and generates the error correction data and transmits the error correction data to the mapping circuit. When the host 50 needs to read the data, the error correction code circuit 305 decodes the error correction data transmitted by the mapping circuit 305, and restores the data to the host 50 for reading.

映射電路305耦接微處理單元301,並受控於微處理單元301。於寫入資料時,映射電路305將錯誤更正碼電路303輸出之該些錯誤更正資料所包含之該些單位資料以交錯方式或依照映射位址寫入至記憶體裝置10。於讀取資料時,映射電路305以交錯方式或依照映射位址將記憶體裝置10所儲存之該些單位資料讀出還原為該些錯誤更正資料,並傳送至錯誤更正碼電路303。The mapping circuit 305 is coupled to the micro processing unit 301 and is controlled by the micro processing unit 301. When the data is written, the mapping circuit 305 writes the unit data included in the error correction data output by the error correction code circuit 303 to the memory device 10 in an interleaved manner or according to the mapping address. When the data is read, the mapping circuit 305 reads and restores the unit data stored in the memory device 10 to the error correction data in an interleaved manner or according to the mapping address, and transmits the error correction data to the error correction code circuit 303.

轉換電路307耦接於微處理單元301,並受控於微處理單元301而動作,於寫入資料前,微處理單元301會先控制使錯誤更正碼電路303輸出之該些錯誤更正資料寫入至記憶體裝置10(此部分較佳之寫入方式為透過微處理單元301控制映射電路305將該些錯誤更正資料,可以採用不交錯之方式寫入記憶體裝置10,但本發明不以此為限),接著透過主機50或微處理單元301偵測記憶體裝置10,以得知所寫入至記憶體裝置10之該些錯誤更正資料於記憶體裝置10之該些資料區塊中所產生的錯誤數量,亦即該些錯誤更正資料之錯誤數量。接著微處理單元301則使轉換電路307依據該些錯誤更正資料之錯誤數量,而控制記憶體裝置10 之該些資料區塊的部分空間轉換至該些資料區塊所對應之該些備用區塊。轉換完成後,再將 錯誤更正碼電路303輸出之該些錯誤更正資料寫入並儲存至記憶體裝置10的該些資料區塊(透過映射電路305以交錯方式、依照映射位址分為該些單位資料寫入,或以採用不交錯之方式寫入) 。The conversion circuit 307 is coupled to the micro processing unit 301 and controlled by the micro processing unit 301. Before the data is written, the micro processing unit 301 first controls the error correction data output by the error correction code circuit 303. To the memory device 10 (this portion is preferably written in such a manner that the mapping circuit 305 is controlled by the micro processing unit 301 to correct the error data, and can be written into the memory device 10 without interleaving, but the present invention does not The memory device 10 is detected by the host device 50 or the micro processing unit 301 to learn that the error correction data written to the memory device 10 is generated in the data blocks of the memory device 10. The number of errors, that is, the number of errors in which the errors correct the data. The micro-processing unit 301 then causes the conversion circuit 307 to control the partial space of the data blocks of the memory device 10 to be converted to the spare blocks corresponding to the data blocks according to the error correction of the errors. . After the conversion is completed, the error correction data outputted by the error correction code circuit 303 is written and stored in the data blocks of the memory device 10 (divided into the data by the mapping circuit 305 in an interleaved manner according to the mapping address). The unit data is written or written in a non-interlaced manner.

另外,控制器30更可包含一緩衝記憶體309,耦接於主機50與錯誤更正碼電路303之間,用以暫存主機50所傳送或需讀取之該些資料,但此緩衝記憶體309並不用以限定本發明。In addition, the controller 30 further includes a buffer memory 309 coupled between the host 50 and the error correction code circuit 303 for temporarily storing the data transmitted or read by the host 50, but the buffer memory 309 is not intended to limit the invention.

此外,本發明之控制器30亦可僅包含映射電路305或轉換電路307之一,而僅做其中之一功能,並不限定同時包含映射電路305與轉換電路307。In addition, the controller 30 of the present invention may also include only one of the mapping circuit 305 or the conversion circuit 307, and only one of the functions is not limited, and the mapping circuit 305 and the conversion circuit 307 are not limited.

請參閱第2圖,其為本發明之一較佳實施例之寫入程序之流程圖。如圖所示,於寫入程序時,主機50會傳送複數資料至控制器30,並首先執行步驟S10,錯誤更正碼電路303對該些資料進行編碼以加入錯誤更正碼,而產生複數錯誤更正資料,並傳送至映射電路305。接著執行步驟S70,映射電路305以交錯方式或依照映射位址將該些錯誤更正資料所包含之該些單位資料寫入至記憶體裝置10之該些資料區塊。Please refer to FIG. 2, which is a flow chart of a writing procedure according to a preferred embodiment of the present invention. As shown, when writing a program, the host 50 transmits a plurality of data to the controller 30, and first performs step S10, and the error correction code circuit 303 encodes the data to add an error correction code to generate a complex error correction. The data is transmitted to the mapping circuit 305. Then, in step S70, the mapping circuit 305 writes the unit data included in the error correction data to the data blocks of the memory device 10 in an interleaved manner or according to the mapping address.

請一併參閱第3圖,其為本發明之一較佳實施例之寫入程序之交錯示意圖。如圖所示,當有三筆資料需寫入儲存裝置時,映射電路305依照微處理單元301所傳送而來之交錯方式,將該些錯誤更正資料A、B、C所包含之該些單位資料A1 、A2 -An 、B1 、B2 -Bn 、C1 、C2 -Cn 寫入記憶體裝置10之一分頁中的複數資料區塊D1 、D2 -Dn ,且同時該些單位資料A1 、A2 -An 、B1 、B2 -Bn 、C1 、C2 -Cn 已包含該些錯誤更正資料A、B、C中之資料以及錯誤更正碼,而不多加說明。Please refer to FIG. 3, which is a cross-sectional view of a write program according to a preferred embodiment of the present invention. As shown in the figure, when there are three pieces of data to be written into the storage device, the mapping circuit 305 corrects the unit data included in the data A, B, and C according to the interleaving manner transmitted by the micro processing unit 301. A 1 , A 2 -A n , B 1 , B 2 -B n , C 1 , C 2 -C n are written into the complex data blocks D 1 , D 2 -D n in one of the pages of the memory device 10, At the same time, the unit data A 1 , A 2 -A n , B 1 , B 2 -B n , C 1 , C 2 -C n already contain the data in the error correction data A, B, C and the error correction. Code, without more explanation.

另外,上述是以交錯之方式寫入該些資料區塊D1 、D2 -Dn ,但本發明亦可依照映射位址,而不需依照上述的寫入順序或交錯位置將該些單位資料A1 、A2 -An 、B1 、B2 -Bn 、C1 、C2 -Cn 寫入該些資料區塊D1 、D2 -Dn ,而映射之方式有許多種,且映射之方式並非用以限定本發明,因此不加贅述,只要是將錯誤更正資料A、B、C所包含之該些單位資料A1 、A2 -An 、B1 、B2 -Bn 、C1 、C2 -Cn 依照交錯方式或映射位址平均分散至該些資料區塊D1 、D2 -Dn ,即符合本發明之精神。In addition, the foregoing is to write the data blocks D 1 , D 2 -D n in an interleaved manner, but the present invention may also follow the mapping address without the need to follow the above-mentioned writing order or staggered position. The data A 1 , A 2 -A n , B 1 , B 2 -B n , C 1 , C 2 -C n are written into the data blocks D 1 , D 2 -D n , and there are many ways to map The manner of mapping is not intended to limit the present invention, and therefore, the description will not be repeated, as long as the errors are corrected for the unit data A 1 , A 2 -A n , B 1 , B 2 included in the data A, B, and C. B n , C 1 , C 2 -C n are evenly distributed to the data blocks D 1 , D 2 -D n in an interleaved manner or a mapped address, which is in accordance with the spirit of the present invention.

請參閱第4圖,其為本發明之另一較佳實施例之寫入程序之流程圖。如圖所示,本實施例於步驟S10與S70之間更包含步驟S30、S50,於交錯該些錯誤更正資料儲存至記憶體裝置10之前,先進行步驟S30,微處理單元301先使錯誤更正碼電路303輸出之該些錯誤更正資料寫入至記憶體裝置10,並透過主機50或微處理單元301偵測該些錯誤更正資料之錯誤數量(如第1圖之說明)。接著進行步驟S50,轉換電路307依據主機50或微處理單元301所偵測到該些錯誤更正資料之錯誤數量,而將記憶體裝置10 之該些資料區塊的部分空間轉換至該些資料區塊所對應之該些備用區塊。Please refer to FIG. 4, which is a flow chart of a writing process according to another preferred embodiment of the present invention. As shown in the figure, in this embodiment, steps S30 and S50 are further included between steps S10 and S70. Before the error correction data is stored in the memory device 10, step S30 is performed first, and the micro processing unit 301 first corrects the error. The error correction data outputted by the code circuit 303 is written to the memory device 10, and the number of errors of the error correction data is detected by the host 50 or the micro processing unit 301 (as illustrated in FIG. 1). Next, in step S50, the conversion circuit 307 converts the partial space of the data blocks of the memory device 10 to the data areas according to the number of errors of the error correction data detected by the host 50 or the micro processing unit 301. The spare blocks corresponding to the block.

接著,再執行步驟S70,映射電路305以交錯方式或依照映射位址將該些錯誤更正資料所包含之該些單位資料寫入至記憶體裝置10之該些資料區塊。並且,於此實施例中之映射電路305亦可受控於微處理單元301,以依據該些錯誤更正資料之錯誤數量而決定交錯方式或映射位址,以將該些單位資料以較佳之交錯方式或映射位址寫入至該些資料區塊。Then, in step S70, the mapping circuit 305 writes the unit data included in the error correction data to the data blocks of the memory device 10 in an interleaved manner or according to the mapping address. Moreover, the mapping circuit 305 in this embodiment may also be controlled by the micro processing unit 301 to determine an interleaving manner or a mapping address according to the number of errors in the error correction data to better interleave the unit data. The mode or mapping address is written to the data blocks.

請一併參閱第5A、5B圖,第5A圖為本發明之一較佳實施例之資料區塊-備用區塊之比例示意圖,第5B圖為本發明之另一較佳實施例之資料區塊-備用區塊之比例示意圖。Please refer to FIG. 5A and FIG. 5B together, FIG. 5A is a schematic diagram of a ratio of a data block to a spare block according to a preferred embodiment of the present invention, and FIG. 5B is a data area of another preferred embodiment of the present invention. Schematic diagram of the block-to-spare block.

如第5A圖所示,若原本資料區塊D與備用區塊S所佔的儲存空間分別為8K位元組與1K位元組,當轉換電路307判斷該些錯誤更正資料中的錯誤數量低於一門檻值時,轉換電路307控制記憶體裝置10將資料區塊D中0.5K位元組的儲存空間轉換至備用區塊S,使資料區塊D與備用區塊S所佔的儲存空間變為7.5K位元組與1.5K位元組。如此,可降低資料區塊D所儲存之資料量,並提升錯誤更正碼可運用之空間,進而有效提升錯誤更正碼的錯誤更正能力。As shown in FIG. 5A, if the storage space occupied by the original data block D and the spare block S is 8K bytes and 1K bytes, respectively, the conversion circuit 307 determines that the number of errors in the error correction data is low. At a threshold, the conversion circuit 307 controls the memory device 10 to convert the storage space of the 0.5K byte in the data block D to the spare block S, so that the storage space occupied by the data block D and the spare block S It becomes 7.5K bytes and 1.5K bytes. In this way, the amount of data stored in the data block D can be reduced, and the space in which the error correction code can be used can be improved, thereby effectively improving the error correction capability of the error correction code.

另外,如第5B圖所示,當轉換電路307判斷該些錯誤更正資料中的錯誤數量高於門檻值時,轉換電路307控制記憶體裝置10將資料區塊D中1K位元組的儲存空間轉換至備用區塊S,使資料區塊D與備用區塊S所佔的儲存空間變為7K位元組與2K位元組。如此,更進一步提升錯誤更正碼的更正能力。In addition, as shown in FIG. 5B, when the conversion circuit 307 determines that the number of errors in the error correction data is higher than the threshold value, the conversion circuit 307 controls the memory device 10 to store the storage space of the 1K byte in the data block D. The conversion to the spare block S causes the storage space occupied by the data block D and the spare block S to become 7K bytes and 2K bytes. In this way, the correction ability of the error correction code is further improved.

其中,本實施例僅以一個資料區塊D以及一個備用區塊S做說明,但實際上若該些單位資料需交錯儲存於複數資料區塊時,本發明之轉換電路307會同時控制該些資料區塊與其對應之備用區塊的儲存空間比例。In this embodiment, only one data block D and one spare block S are used for description. However, if the unit data is to be interleaved and stored in the plurality of data blocks, the conversion circuit 307 of the present invention controls the same. The storage space ratio of the data block and its corresponding spare block.

請參閱第6圖,其為本發明之一較佳實施例之讀取程序之流程圖。如圖所示,於讀取程序時,首先執行步驟S20,映射電路305依照交錯方式或映射位址將記憶體裝置10之該些資料區塊所儲存之該些單位資料讀出還原為該些錯誤更正資料,並輸出至錯誤更正碼電路305。接著執行步驟S40,錯誤更正碼電路305對映射電路305傳送來之該些錯誤更正資料進行解碼,而還原為該些資料,以供主機50讀取。Please refer to FIG. 6, which is a flow chart of a reading procedure according to a preferred embodiment of the present invention. As shown in the figure, when the program is read, step S20 is first executed, and the mapping circuit 305 reads and restores the unit data stored in the data blocks of the memory device 10 to the plurality of data blocks according to the interleaving manner or the mapping address. The error correction data is output to the error correction code circuit 305. Next, in step S40, the error correction code circuit 305 decodes the error correction data transmitted by the mapping circuit 305, and restores the data to the host 50 for reading.

請一併參閱第7圖,其為本發明之一較佳實施例之讀取程序之映射示意圖。如圖所示,當需讀取資料時,映射電路305依照微處理單元301所傳送而來之交錯方式或映射位址,將記憶體裝置10之該些資料區塊D1 、D2 -Dn 中所儲存的該些單位資料A1 、A2 -An 、B1 、B2 -Bn 、C1 、C2 -Cn 讀出還原為該些錯誤更正資料A、B、C,並傳送至錯誤更正碼電路303,錯誤更正碼電路303對該些錯誤更正資料A、B、C解碼,而產生主機50所能讀取之該些資料,並傳送至主機50(或先傳送至緩衝記憶體309暫存)。Please refer to FIG. 7, which is a schematic diagram of mapping of a reading program according to a preferred embodiment of the present invention. As shown in the figure, when the data needs to be read, the mapping circuit 305 compares the data blocks D 1 and D 2 -D of the memory device 10 according to the interleaving manner or mapping address transmitted by the micro processing unit 301. n stored in the plurality of data units a 1, a 2 -A n, B 1, B 2 -B n, C 1, C 2 -C n readout restore some error correction information a, B, C that, And transmitted to the error correction code circuit 303, the error correction code circuit 303 decodes the error correction data A, B, C, and generates the data that the host 50 can read, and transmits the data to the host 50 (or to the host 50 first) Buffer memory 309 is temporarily stored).

其中,雖本發明之每一資料區塊(例如D1 )中所儲存的單位資料僅有A1 、B1 、C1 三個,但這僅為示意圖,實際上,每一資料區塊中可包含錯誤更正資料A中的複數單位資料、錯誤更正資料B中的複數單位資料以及錯誤更正資料C中的複數單位資料,也就是資料區塊D1 、D2 -Dn 中所儲存的單位資料A1 、A2 -An 、B1 、B2 -Bn 、C1 、C2 -Cn 的數量以及寫入順序、映射位址或交錯方式並無限定,可依所需而做適當調整,且每一個單位資料的大小亦無限定,可為一位元、複數位元、一位元組或複數位元組 。Wherein, although the unit data stored in each data block (for example, D 1 ) of the present invention has only three A 1 , B 1 , and C 1 , this is only a schematic diagram. In fact, in each data block It may include the complex unit data in the error correction data A, the complex unit data in the error correction data B, and the complex unit data in the error correction data C, that is, the units stored in the data blocks D 1 , D 2 - D n The number of data A 1 , A 2 -A n , B 1 , B 2 -B n , C 1 , C 2 -C n and the order of writing, mapping address or interleaving are not limited, and can be done as needed Appropriate adjustment, and the size of each unit of data is not limited, it can be one-bit, complex, one-tuple or complex.

綜上所述,本發明之儲存裝置及其存取方法,藉由將該些錯誤更正資料分散寫入至記憶體裝置之該些資料區塊中,使該些錯誤更正資料中的錯誤平均分散至該些資料區塊,或者於讀取時,將該些資料區塊與該些備用區塊所儲存的該些單位資料以及該些錯誤更正碼依照上述方式還原為錯誤更正資料,使該些資料區塊中的錯誤平均分散至錯誤更正資料。另外,更藉由改變每一分頁中資料區塊與備用區塊的儲存空間比例,以提升錯誤更正碼的錯誤更正能力。如此,可避免錯誤更正資料或該些資料區塊包含超過其錯誤更正能力的錯誤,而導致無法更正進而遺失資料之問題。In summary, the storage device of the present invention and the access method thereof are distributed to the data blocks of the memory device by the error correction data, so that the errors in the error correction data are evenly dispersed. Up to the data blocks, or when reading, the data blocks and the unit data stored in the spare blocks and the error correction codes are restored to the error correction data according to the above manner, so that the data blocks are Errors in the data block are evenly spread to the error correction data. In addition, by changing the storage space ratio of the data block and the spare block in each page, the error correction ability of the error correction code is improved. In this way, it is possible to avoid errors in correcting the data or the fact that the data blocks contain errors that exceed their error correction capabilities, resulting in an inability to correct and thus loss of data.

惟以上所述者,僅為本發明之較佳實施例而已,並非用來限定本發明實施之範圍,舉凡依本發明申請專利範圍所述之形狀、構造、特徵及精神所為之均等變化與修飾,均應包括於本發明之申請專利範圍內。The above is only the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention, and the variations, modifications, and modifications of the shapes, structures, features, and spirits described in the claims of the present invention. All should be included in the scope of the patent application of the present invention.

本發明係實為一具有新穎性、進步性及可供產業利用者,應符合我國專利法所規定之專利申請要件無疑,爰依法提出發明專利申請,祈 鈞局早日賜准專利,至感為禱。The invention is a novelty, progressive and available for industrial use, and should meet the requirements of the patent application stipulated in the Patent Law of China, and the invention patent application is filed according to law, and the prayer bureau will grant the patent as soon as possible. prayer.

10‧‧‧記憶體裝置 10‧‧‧ memory device

30‧‧‧控制器 30‧‧‧ Controller

301‧‧‧微處理單元 301‧‧‧Microprocessing unit

303‧‧‧錯誤更正碼電路 303‧‧‧Error correction code circuit

305‧‧‧映射電路 305‧‧‧ mapping circuit

307‧‧‧轉換電路 307‧‧‧Transition circuit

309‧‧‧緩衝記憶體 309‧‧‧ Buffer memory

50‧‧‧主機 50‧‧‧Host

Claims (15)

一種儲存裝置,其包含:
一記憶體裝置,用以儲存複數單位資料;以及
一控制器,接收複數資料,並將該些資料編碼產生複數錯誤更正資料,該些錯誤更正資料包含該些單位資料,該控制器將該些錯誤更正資料之該些單位資料以一交錯方式或依照一映射位址寫入至該記憶體裝置。
A storage device comprising:
a memory device for storing a plurality of unit data; and a controller for receiving the plurality of data and encoding the data to generate a plurality of error correction data, the error correction data including the unit data, the controller The unit data of the error correction data is written to the memory device in an interleaved manner or according to a mapped address.
如申請專利範圍第1項所述之儲存裝置,其中該控制器以該交錯方式或依照該映射位址將該記憶體裝置所儲存之該些單位資料讀出為該些錯誤更正資料。The storage device of claim 1, wherein the controller reads the unit data stored in the memory device in the interleaving manner or according to the mapping address as the error correction data. 如申請專利範圍第2項所述之儲存裝置,其中該控制器包含:
一映射電路,受控於一微處理單元,而將該些單位資料以該交錯方式或依照該映射位址而寫入至該記憶體裝置,或將該記憶體裝置所儲存之該些單位資料以該交錯方式或依照該映射位址讀出為該些錯誤更正資料。
The storage device of claim 2, wherein the controller comprises:
a mapping circuit controlled by a micro processing unit, and the unit data is written to the memory device in the interleaving manner or according to the mapping address, or the unit data stored in the memory device The error correction data is read out in the interleaving manner or in accordance with the mapping address.
如申請專利範圍第3項所述之儲存裝置,其中該控制器更包含:
一錯誤更正碼電路,耦接該微處理單元與該映射電路,並受控於該微處理單元而對該些資料進行編碼,以加入複數錯誤更正碼,而產生該些錯誤更正資料,或對該些錯誤更正資料進行解碼,而產生該些資料。
The storage device of claim 3, wherein the controller further comprises:
An error correction code circuit coupled to the micro processing unit and the mapping circuit, and controlled by the micro processing unit to encode the data to add a complex error correction code to generate the error correction data, or The error correction data is decoded to generate the data.
如申請專利範圍第1項所述之儲存裝置,其中該控制器先將該些錯誤更正資料寫入至該記憶體裝置之複數資料區塊,以偵測該些錯誤更正資料之錯誤數量,並依據該些錯誤更正資料之錯誤數量,而控制該記憶體裝置之複數資料區塊的部分空間轉換至該些資料區塊所對應之複數備用區塊。The storage device of claim 1, wherein the controller first writes the error correction data to the plurality of data blocks of the memory device to detect the number of errors of the error correction data, and The partial space of the plurality of data blocks controlling the memory device is converted to the plurality of spare blocks corresponding to the data blocks according to the error correction errors of the data. 如申請專利範圍第5項所述之儲存裝置,其中該控制器包含:
一轉換電路,受控於一微處理單元,而依據該些錯誤更正資料之錯誤數量,控制該記憶體裝置之該些資料區塊的部分空間轉換至該些資料區塊所對應之該些備用區塊。
The storage device of claim 5, wherein the controller comprises:
a conversion circuit controlled by a micro processing unit, and according to the error correction number of errors of the data, controlling a partial space of the data blocks of the memory device to be converted to the spares corresponding to the data blocks Block.
如申請專利範圍第1項所述之儲存裝置,其中該控制器以該交錯方式將每一該錯誤更正資料中之該些單位資料平均分散並寫入該記憶體裝置之複數資料區塊中。The storage device of claim 1, wherein the controller divides the unit data in each of the error correction data evenly into the plurality of data blocks of the memory device in the interleaving manner. 如申請專利範圍第1項所述之儲存裝置,其中該些單位資料分別為一位元、複數位元、一位元組或複數位元組。The storage device of claim 1, wherein the unit data is a single element, a complex number of bits, a one-dimensional group or a complex number of bytes. 一種儲存裝置之存取方法,其步驟包含:
將複數資料編碼產生複數錯誤更正資料,該些錯誤更正資料包含複數單位資料;以及
將該些錯誤更正資料之該些單位資料以一交錯方式或依照一映射位址寫入至一記憶體裝置。
A storage device access method, the steps comprising:
The complex data is encoded to generate complex error correction data, the error correction data includes a plurality of unit data; and the unit data of the error correction data is written to a memory device in an interleaved manner or according to a mapping address.
如申請專利範圍第9項所述之存取方法,其更包含:以該交錯方式或依照該映射位址將該記憶體裝置所儲存之該些單位資料讀出為該些錯誤更正資料。The access method of claim 9, further comprising: reading the unit data stored by the memory device in the interleaving manner or according to the mapping address as the error correction data. 如申請專利範圍第9項所述之存取方法,其中於將複數資料編碼產生複數錯誤更正資料之步驟中包含:對該些資料進行編碼,以加入複數錯誤更正碼,而產生該些錯誤更正資料。The access method of claim 9, wherein the step of encoding the complex data to generate the complex error correction data comprises: encoding the data to add a complex error correction code, and generating the error correction data. 如申請專利範圍第9項所述之存取方法,其更包含:對該些錯誤更正資料進行解碼,而產生該些資料。The access method of claim 9, further comprising: decoding the error correction data to generate the data. 如申請專利範圍第9項所述之存取方法,其更包含:
將該些錯誤更正資料寫入至該記憶體裝置之複數資料區塊,以偵測該些錯誤更正資料之錯誤數量;以及
依據該些錯誤更正資料之錯誤數量,而將該記憶體裝置之複數資料區塊的部分空間轉換至該些資料區塊所對應之複數備用區塊。
For example, the access method described in claim 9 further includes:
Writing the error correction data to the plurality of data blocks of the memory device to detect the number of errors of the error correction data; and correcting the number of errors of the data according to the errors, and multiplexing the memory device A portion of the data block is converted to a plurality of spare blocks corresponding to the data blocks.
如申請專利範圍第9項所述之存取方法,其中於將該些單位資料以一交錯方式或依照一映射位址寫入至一記憶體裝置之步驟中包含:以該交錯方式將每一該錯誤更正資料中之該些單位資料平均分散並寫入該記憶體裝置之複數資料區塊中。The access method of claim 9, wherein the step of writing the unit data in an interleaved manner or according to a mapping address to a memory device comprises: each of the interleaving manners The unit data in the error correction data are evenly dispersed and written into the plurality of data blocks of the memory device. 如申請專利範圍第9項所述之存取方法,其中該些單位資料分別為一位元、複數位元、一位元組或複數位元組。
The access method of claim 9, wherein the unit data is a single element, a complex number of bits, a one-dimensional group or a complex byte.
TW102147314A 2013-12-19 2013-12-19 Storage device and access method thereof TWI537971B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW102147314A TWI537971B (en) 2013-12-19 2013-12-19 Storage device and access method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW102147314A TWI537971B (en) 2013-12-19 2013-12-19 Storage device and access method thereof

Publications (2)

Publication Number Publication Date
TW201526013A true TW201526013A (en) 2015-07-01
TWI537971B TWI537971B (en) 2016-06-11

Family

ID=54197752

Family Applications (1)

Application Number Title Priority Date Filing Date
TW102147314A TWI537971B (en) 2013-12-19 2013-12-19 Storage device and access method thereof

Country Status (1)

Country Link
TW (1) TWI537971B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI657336B (en) * 2017-08-28 2019-04-21 慧榮科技股份有限公司 Data storage method for detecting data storage device and its data storage device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2023037877A (en) * 2021-09-06 2023-03-16 キオクシア株式会社 memory system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI657336B (en) * 2017-08-28 2019-04-21 慧榮科技股份有限公司 Data storage method for detecting data storage device and its data storage device
US10474530B2 (en) 2017-08-28 2019-11-12 Silicon Motion, Inc. Data storage method for detecting data storage device and its data storage device

Also Published As

Publication number Publication date
TWI537971B (en) 2016-06-11

Similar Documents

Publication Publication Date Title
TWI474330B (en) Method for performing memory access management, and associated memory device and controller thereof
US8707135B2 (en) Method and system of dynamic data storage for error correction in a memory device
US10417086B2 (en) Data write method and memory storage device using the same
JP6110953B2 (en) Stop criteria for layered iterative error correction
CN111326199B (en) Multi-state programming for memory devices
CN107408069B (en) Apparatus and method for detecting and relieving bit line open in flash memory
US9136872B2 (en) Memory, memory system, and error checking and correcting method for memory
JP2011134433A (en) Semiconductor storage system including ecc circuit, and method of controlling the same
US8656263B2 (en) Trellis-coded modulation in a multi-level cell flash memory device
JP2010237822A (en) Memory controller and semiconductor storage device
CN102394114B (en) BCH code error correction method capable of adaptive error correction
US11243838B2 (en) Methods and apparatuses for error correction
US10691534B2 (en) Data encoding method, data decoding method and storage controller
TW201637019A (en) Read voltage level estimating method, memory storage device and memory controlling circuit unit
US10423484B2 (en) Memory controller, memory system, and control method
US9754682B2 (en) Implementing enhanced performance with read before write to phase change memory
CN109872764B (en) ECC multi-code rate coding and decoding system and method for multi-level storage unit flash memory
JP6975047B2 (en) Write-once memory code error correction code management
TWI537971B (en) Storage device and access method thereof
US11528038B2 (en) Content aware decoding using shared data statistics
WO2018119741A1 (en) Data access method, and flash memory apparatus
JP2021033530A (en) Memory system
US9160371B2 (en) Memory controller, storage device and memory control method
US20230214136A1 (en) Memory system
Li et al. A 1/10000 lower error rate achievable SSD controller with Message-Passing Error Correcting Code architecture and Parity Area Combined scheme