TWI704454B - Mapping table management method applied to solid state storage device - Google Patents
Mapping table management method applied to solid state storage device Download PDFInfo
- Publication number
- TWI704454B TWI704454B TW107108917A TW107108917A TWI704454B TW I704454 B TWI704454 B TW I704454B TW 107108917 A TW107108917 A TW 107108917A TW 107108917 A TW107108917 A TW 107108917A TW I704454 B TWI704454 B TW I704454B
- Authority
- TW
- Taiwan
- Prior art keywords
- control circuit
- volatile memory
- correspondence table
- storage device
- state storage
- Prior art date
Links
- 238000007726 management method Methods 0.000 title claims abstract description 18
- 238000013507 mapping Methods 0.000 title abstract description 12
- 239000007787 solid Substances 0.000 title abstract description 7
- 238000000034 method Methods 0.000 claims abstract description 8
- 230000007423 decrease Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000001568 sexual effect Effects 0.000 description 1
Images
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
Description
本發明是有關於一種固態儲存裝置的處理方法,且特別是有關於一種固態儲存裝置的對應表(mapping table)管理方法。The present invention relates to a processing method of a solid-state storage device, and particularly relates to a mapping table management method of a solid-state storage device.
眾所周知,固態儲存裝置 (Solid State Storage Device) 已經非常廣泛的應用於各種電子產品,例如SD卡、固態硬碟等等。固態儲存裝置中包括一非揮發性記憶體(non-volatile memory)。當資料寫入非揮發性記憶體後,一旦系統電源關閉,資料仍保存在非揮發性記憶體中。As we all know, solid state storage devices (Solid State Storage Devices) have been widely used in various electronic products, such as SD cards, solid state drives, and so on. The solid-state storage device includes a non-volatile memory. After the data is written into the non-volatile memory, once the system power is turned off, the data is still stored in the non-volatile memory.
請參照第1圖,其所繪示為習知固態儲存裝置示意圖。固態儲存裝置100的控制電路10經由一外部匯流排110連接至主機(host)150,其中外部匯流排110可為USB匯流排、SATA匯流排、PCIe匯流排、M.2匯流排或者U.2匯流排等等。Please refer to Figure 1, which is a schematic diagram of a conventional solid-state storage device. The control circuit 10 of the solid state storage device 100 is connected to a
再者,固態儲存裝置100包括:控制電路10、動態隨機存取記憶體(DRAM)30以及非揮發性記憶體20。其中,控制電路10連接至非揮發性記憶體20與DRAM 30。Furthermore, the solid-state storage device 100 includes a control circuit 10, a dynamic random access memory (DRAM) 30, and a
一般來說,主機150與控制電路10之間以邏輯區塊位址(Logical Block Address,以下簡稱LBA位址)來存取資料。而控制電路10與非揮發性記憶體20之間以實體配置位址(Physical Allocation Address,以下簡稱PAA位址)來存取資料。Generally, the
因此,固態儲存裝置100的DRAM 30中會儲存一對應表(mapping table)32用來作為LBA位址與PAA位置之間的對應關係。此對應表32又稱為邏輯至實體位址對應表(Logical-to-Physical address mapping table)。以下介紹對應表32的運作原理。Therefore, a mapping table 32 is stored in the
當主機150要將資料寫入固態儲存裝置100時,主機150會發出寫入指令至固態儲存裝置100。此時,寫入指令中包括LBA位址以及寫入資料。接著,控制電路10在DRAM 30的對應表32中記錄LBA位址與PAA位址之間的對應關係,並將寫入資料儲存於非揮發性記憶體中PAA位址的儲存空間。When the
當主機150欲由固態儲存裝置100中讀取資料時,則主機150發出讀取指令,且讀取指令中包括LBA位址。當控制電路10接收到讀取指令時,即根據LBA位址於對應表32中找到PAA位址。之後,控制電路10由非揮發性記憶體20中PAA位址的儲存空間中獲得讀取資料,並傳遞至主機150。When the
由以上的說明可知,當固態儲存裝置100在寫入資料時,控制電路10必須同步記錄對應表32,使得控制電路10能掌握儲存在非揮發性記憶體20中所有的寫入資料,並且有效地進行資料的管理。It can be seen from the above description that when the solid-state storage device 100 is writing data, the control circuit 10 must synchronously record the correspondence table 32 so that the control circuit 10 can grasp all the written data stored in the
由於對應表32儲存於DRAM 30中,且一旦系統電源關閉,儲存於DRAM 30中的資料便會消失,因此當固態儲存裝置100收到關機指令(power down command)時,控制電路10必須先將對應表32儲存至非揮發性記憶體20之後才可以關閉電源。Since the correspondence table 32 is stored in the
當固態儲存裝置100再次被供電時,控制電路10必須先將非揮發性記憶體20中的對應表載入(load)DRAM 30後,固態儲存裝置100才可正常運作。When the solid-state storage device 100 is powered again, the control circuit 10 must first load the corresponding table in the
由以上的說明可知,DRAM 30中的對應表32記錄了LBA位址與PAA位址之間的對應關係。It can be seen from the above description that the correspondence table 32 in the
然而,如果固態儲存裝置100正常運作並存取了許多資料後,供應至固態儲存裝置100的電力突然斷電,則DRAM 30中對應表32的資料皆會被刪除。However, if the solid-state storage device 100 operates normally and accesses a lot of data, the power supplied to the solid-state storage device 100 is suddenly cut off, the data in the corresponding table 32 in the
如此,當固態儲存裝置100再次被供電時,控制單元10僅能由非揮發性記憶體20中載入舊的對應表至DRAM 30。接著,控制電路10必須搜尋(search)非揮發性記憶體20內的所有儲存空間,並逐步修改並重建對應表32。In this way, when the solid-state storage device 100 is powered on again, the control unit 10 can only load the old correspondence table from the
當控制電路10搜尋完非揮發性記憶體20內的所有儲存空間後,對應表32即重建(rebuild)完成,而固態儲存裝置100才可正常運作。然而,上述的對應表32重建會耗費相當長的時間。After the control circuit 10 has searched all the storage spaces in the
本發明有關於一種固態儲存裝置的對應表管理方法,該固態儲存裝置包括一控制電路、一動態隨機存取記憶體與一非揮發性記憶體,該對應表管理方法包括下列步驟:當該控制電路接收到一寫入指令時,控制電路將寫入資料儲存至該非揮發性記憶體,並更新該動態隨機存取記憶體中的一對應表;當該控制電路收到一關機指令時,該控制電路將該動態隨機存取記憶體中完整的該對應表儲存至該非揮發性記憶體;以及當該控制電路判斷出符合一更新條件時,該控制電路將該動態隨機存取記憶體中一部分的該對應表儲存至該非揮發性記憶體。The present invention relates to a corresponding table management method for a solid-state storage device. The solid-state storage device includes a control circuit, a dynamic random access memory and a non-volatile memory. The corresponding table management method includes the following steps: When the circuit receives a write command, the control circuit stores the written data in the non-volatile memory and updates a corresponding table in the dynamic random access memory; when the control circuit receives a shutdown command, the control circuit The control circuit stores the complete correspondence table in the dynamic random access memory in the non-volatile memory; and when the control circuit determines that an update condition is met, the control circuit stores a part of the dynamic random access memory The corresponding table of is stored in the non-volatile memory.
為了對本發明之上述及其他方面有更佳的瞭解,下文特舉實施例,並配合所附圖式詳細說明如下:。In order to have a better understanding of the above-mentioned and other aspects of the present invention, the following embodiments are specifically described in conjunction with the accompanying drawings as follows:
請參照第2圖,其所繪示為本發明第一實施例之對應表管理方法。基本上,第一實施例所揭露之對應表管理方法係運用於第1圖之固態儲存裝置100,此處不再贅述固態儲存裝置的結構。Please refer to Figure 2, which illustrates the corresponding table management method according to the first embodiment of the present invention. Basically, the mapping table management method disclosed in the first embodiment is applied to the solid-state storage device 100 shown in FIG. 1, and the structure of the solid-state storage device is not repeated here.
於固態儲存裝置100正常運作時,當控制電路10接收到主機150的寫入指令時,控制電路10除了將寫入資料儲存至非揮發性記憶體20之外,也會同步地記錄DRAM 30中的對應表32。When the solid-state storage device 100 is operating normally, when the control circuit 10 receives a write command from the
根據本發明的第一實施例,當固態儲存裝置100正常運作且未收到關機指令(步驟S210)時,控制電路10會判斷是否符合更新條件(步驟S320)。當控制電路10判斷已經符合更新條件(步驟S230)時,控制電路10將DRAM 30中完整對應表32儲存至非揮發性記憶體20(步驟S240)。反之,當控制電路10判斷出尚未符合更新條件(步驟S230)時,則回到步驟S210。According to the first embodiment of the present invention, when the solid-state storage device 100 is operating normally and the shutdown command is not received (step S210), the control circuit 10 determines whether the update condition is met (step S320). When the control circuit 10 determines that the update condition has been met (step S230), the control circuit 10 stores the complete correspondence table 32 in the
舉例來說,控制電路10可預設10Mbyte的資料量作為更新條件的判斷基準。具體而言,控制電路10會持續計算儲存到非揮發性記憶體20中寫入資料的資料總量,當寫入資料的資料總量到達預設資料量的整數倍時,即代表符合更新條件。此時,控制電路10將DRAM 30中完整對應表32儲存至非揮發性記憶體20。For example, the control circuit 10 can preset a data amount of 10 Mbyte as a criterion for judging the update condition. Specifically, the control circuit 10 will continue to calculate the total amount of data written into the non-volatile
換句話說,當儲存的寫入資料到達10Mbytes的整數倍(亦即,10Mbyte、20Mbytes、30Mbytes…)時,控制電路10即將DRAM 30中完整對應表32儲存至非揮發性記憶體20。反之,當儲存的寫入資料未到達10Mbytes的整數倍時,控制電路10僅繼續計算寫入資料的資料總量,不會將DRAM 30中的對應表32儲存至非揮發性記憶體20。In other words, when the stored write data reaches an integral multiple of 10 Mbytes (ie, 10 Mbyte, 20 Mbytes, 30 Mbytes...), the control circuit 10 stores the complete correspondence table 32 in the
當然,如果固態儲存裝置100接收到關機指令(步驟S210)時,控制電路10則直接將DRAM 30中完整的對應表32儲存至非揮發性記憶體(步驟S220)。之後,固態儲存裝置100即可被關機。Of course, if the solid-state storage device 100 receives a shutdown command (step S210), the control circuit 10 directly stores the complete correspondence table 32 in the
固態儲存裝置100在正常運作的過程,DRAM 30中的對應表32會不斷地被更新。而由以上的說明可知,本發明的固態儲存裝置100在正常運作的過程,會將DRAM 30中更新的對應表32儲存至非揮發性記憶體20中。因此,當固態儲存裝置100發生不正常的斷電時,非揮發性記憶體20中可儲存有較新的對應表。During the normal operation of the solid-state storage device 100, the correspondence table 32 in the
如此,當固態儲存裝置100再次被供電時,控制單元10可載入斷電之前儲存於非揮發性記憶體20中最新的對應表至DRAM 30中。接著,控制電路10再根據此最新的對應表32來重建(rebuild)正確的對應表。由於最新的對應表32需修改的部分相對較少,因此可有效地縮短重建對應表32的時間。In this way, when the solid-state storage device 100 is powered on again, the control unit 10 can load the latest correspondence table stored in the
由以上的說明可知,運用本發明第一實施例之對應表管理方法,當固態儲存裝置100發生不正常的斷電後並再次供電至固態儲存裝置100時,控制電路10可以快速地重建對應表32,並使得固態儲存裝置100正常運作。It can be seen from the above description that using the correspondence table management method of the first embodiment of the present invention, when the solid-state storage device 100 is abnormally powered off and power is supplied to the solid-state storage device 100 again, the control circuit 10 can quickly rebuild the correspondence table 32, and make the solid-state storage device 100 operate normally.
然而,當主機150連續地將寫入資料儲存至固態儲存裝置100時,運用本發明的第一實施例可能會造成固態儲存裝置100的寫入效能(write performance)降低。說明如下:However, when the
基本上,對應表32的大小(size)相關於非揮發性記憶體20的總容量。當非揮發性記憶體20的總容量越大,對應表的大小也越大。Basically, the size of the correspondence table 32 is related to the total capacity of the
當主機150將大量的寫入資料連續地儲存至固態儲存裝置100時,控制電路10需要根據主機150的指令連續地將寫入資料儲存至非揮發性記憶體20。然而,在第一實施例所揭露的方法中,當控制電路10累計的資料總量到達預設資料量的整數倍時,控制電路10會暫停將寫入資料儲存至非揮發性記憶體20,並且將完整的對應表32儲存至非揮發性記憶體20。When the
當完整的對應表32儲存至非揮發性記憶體20後,控制電路10才會繼續將寫入資料儲存至非揮發性記憶體20。After the complete correspondence table 32 is stored in the
由以上的說明可知,於主機150將大量的寫入資料連續地儲存至固態儲存裝置100的過程,控制電路20在儲存一預設資料量的寫入資料後會中斷一段時間來將對應表32儲存至非揮發性記憶體20。之後,再次儲存該預設資料量的寫入資料後會再中斷一段時間來將對應表32儲存至非揮發性記憶體20,並持續重複進行。It can be seen from the above description that in the process of the
明顯地,在上述的運作過程中,儲存對應表32所花費的時間越長,則固態儲存裝置100的寫入效能降低越嚴重。換句話說,當非揮發性記憶體20的總容量越大,對應表32的大小也越大,則固態儲存裝置100的寫入效能降低越嚴重。Obviously, in the above-mentioned operation process, the longer the time it takes to store the corresponding table 32, the more serious the write performance of the solid-state storage device 100 decreases. In other words, when the total capacity of the
請參照第3圖,其所繪示為本發明第二實施例之對應表管理方法。相同地,第二實施例所揭露之對應表管理方法係運用於第1圖之固態儲存裝置100。另外,第二實施例與第一實施例的差異僅在於步驟S340。以下僅介紹此步驟,其他步驟不再贅述。Please refer to FIG. 3, which illustrates the corresponding table management method according to the second embodiment of the present invention. Similarly, the corresponding table management method disclosed in the second embodiment is applied to the solid-state storage device 100 in FIG. 1. In addition, the difference between the second embodiment and the first embodiment is only in step S340. The following only introduces this step, other steps will not be repeated.
當控制電路10判斷已經符合更新條件(步驟S230)時,控制電路10將DRAM 30中部分的對應表32儲存至非揮發性記憶體20(步驟S340)。When the control circuit 10 determines that the update condition has been met (step S230), the control circuit 10 stores part of the correspondence table 32 in the
根據本發明的第二實施例,控制電路10將對應表32區分為M個部分。當控制電路10判斷已經符合更新條件時,控制電路10僅將對應表32中M個部分其中之一的內容儲存至非揮發性記憶體20。如此,可以花費較少的時間來進行儲存。According to the second embodiment of the present invention, the control circuit 10 divides the correspondence table 32 into M parts. When the control circuit 10 determines that the update conditions are met, the control circuit 10 only stores the content of one of the M parts in the corresponding table 32 to the
舉例來說,控制電路10中預設10Mbyte的資料量,且控制電路10將對應表32區分為M個部分。再者,控制電路10會持續計算儲存到非揮發性記憶體20中寫入資料的資料總量,當控制電路10判斷已經符合更新條件時,控制電路10將對應表32第一部分的內容儲存至非揮發性記憶體20。For example, the data amount of 10 Mbyte is preset in the control circuit 10, and the control circuit 10 divides the correspondence table 32 into M parts. Furthermore, the control circuit 10 will continue to calculate the total amount of data written into the
同理,當控制電路10再次判斷已經符合更新條件時,控制電路10將對應表32第二部分的內容儲存至非揮發性記憶體20。再者,當控制電路10進行第M次儲存並將對應表32第M部分的內容儲存至非揮發性記憶體20之後,即可確定控制電路10已經將對應表32的全部內容儲存至非揮發性記憶體20。Similarly, when the control circuit 10 determines that the update condition is met again, the control circuit 10 stores the content of the second part of the correspondence table 32 to the
接著,當控制電路10進行第(M+1)次儲存時,控制電路10再次將對應表32第一部分的內容儲存至非揮發性記憶體20。如此類推。換句話說,每當控制電路10判斷出符合更新條件時,控制電路10以循環方式依序選擇對應表32中M個部分的其中之一部分,並將其內容儲存至非揮發性記憶體20。Then, when the control circuit 10 performs the (M+1)th storage, the control circuit 10 stores the content of the first part of the correspondence table 32 in the
固態儲存裝置100在正常運作的過程,DRAM 30中的對應表32會不斷地被更新。而由以上的說明可知,本發明的固態儲存裝置100在正常運作的過程,會將DRAM 30中更新的對應表32儲存至非揮發性記憶體20中。因此,當固態儲存裝置100發生不正常的斷電時,非揮發性記憶體20中可儲存有較新的對應表。因此,當固態儲存裝置100再次被供電時,可有效地縮短重建(rebuild)正確的對應表32所耗費的時間。During the normal operation of the solid-state storage device 100, the correspondence table 32 in the
再者,由於控制電路10將對應表32區分為M個部分,每次儲存一部分對應表32內容所耗費的時間較短。因此,第二實施例所揭露之對應表管理方法,可以使得固態儲存裝置100維持在較佳的寫入效能(write performance)。Furthermore, since the control circuit 10 divides the correspondence table 32 into M parts, it takes a short time to store a part of the contents of the correspondence table 32 each time. Therefore, the mapping table management method disclosed in the second embodiment can maintain the solid-state storage device 100 at a better write performance.
在本發明的第一實施例與第二實施例中,係以儲存的寫入資料的資料總量是否到達預設資料量的整數倍來作為更新條件的判斷基準。當然,本發明並不限定於此,在此領域的技術人員可以運用其他的條件來決定是否將更新的對應表32儲存至非揮發性記憶體20。舉例來說,控制電路10可以計算儲存寫入資料所耗費的總時間,當累計的總時間到一達預設時間的整數倍時,即進行將更新的對應表32儲存至非揮發性記憶體20的動作。In the first embodiment and the second embodiment of the present invention, whether the total data amount of the stored written data reaches an integer multiple of the preset data amount is used as the judgment criterion of the update condition. Of course, the present invention is not limited to this, and those skilled in the art can use other conditions to determine whether to store the updated correspondence table 32 in the
綜上所述,雖然本發明已以實施例揭露如上,然其並非用以限定本發明。本發明所屬技術領域中具有通常知識者,在不脫離本發明之精神和範圍內,當可作各種之更動與潤飾。因此,本發明之保護範圍當視後附之申請專利範圍所界定者為準。In summary, although the present invention has been disclosed in the above embodiments, it is not intended to limit the present invention. Those who have ordinary knowledge in the technical field to which the present invention belongs can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be subject to those defined by the attached patent application scope.
10‧‧‧控制電路20‧‧‧非揮發性記憶體30‧‧‧DRAM32‧‧‧對應表100‧‧‧固態儲存裝置110‧‧‧外部匯流排150‧‧‧主機10‧‧‧
第1圖為習知固態儲存裝置示意圖。 第2圖為本發明第一實施例之對應表管理方法。 第3圖為本發明第二實施例之對應表管理方法。Figure 1 is a schematic diagram of a conventional solid-state storage device. Figure 2 shows the correspondence table management method according to the first embodiment of the present invention. Figure 3 shows the correspondence table management method according to the second embodiment of the present invention.
S210~S340‧‧‧步驟流程 S210~S340‧‧‧Step Process
Claims (5)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW107108917A TWI704454B (en) | 2018-03-15 | 2018-03-15 | Mapping table management method applied to solid state storage device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW107108917A TWI704454B (en) | 2018-03-15 | 2018-03-15 | Mapping table management method applied to solid state storage device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TW201939284A TW201939284A (en) | 2019-10-01 |
| TWI704454B true TWI704454B (en) | 2020-09-11 |
Family
ID=69023139
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW107108917A TWI704454B (en) | 2018-03-15 | 2018-03-15 | Mapping table management method applied to solid state storage device |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TWI704454B (en) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20130124794A1 (en) * | 2010-07-27 | 2013-05-16 | International Business Machines Corporation | Logical to physical address mapping in storage systems comprising solid state memory devices |
| TW201435587A (en) * | 2013-03-12 | 2014-09-16 | Macronix Int Co Ltd | Difference L2P method |
| TW201712540A (en) * | 2015-09-25 | 2017-04-01 | 瑞昱半導體股份有限公司 | Data backup system |
| US20170269844A1 (en) * | 2016-03-21 | 2017-09-21 | Apple Inc. | Managing backup of logical-to-physical translation information to control boot-time and write amplification |
-
2018
- 2018-03-15 TW TW107108917A patent/TWI704454B/en active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20130124794A1 (en) * | 2010-07-27 | 2013-05-16 | International Business Machines Corporation | Logical to physical address mapping in storage systems comprising solid state memory devices |
| TW201435587A (en) * | 2013-03-12 | 2014-09-16 | Macronix Int Co Ltd | Difference L2P method |
| TW201712540A (en) * | 2015-09-25 | 2017-04-01 | 瑞昱半導體股份有限公司 | Data backup system |
| US20170269844A1 (en) * | 2016-03-21 | 2017-09-21 | Apple Inc. | Managing backup of logical-to-physical translation information to control boot-time and write amplification |
Also Published As
| Publication number | Publication date |
|---|---|
| TW201939284A (en) | 2019-10-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8316257B2 (en) | NAND power fail recovery | |
| CN101930404B (en) | Storage device and method of operation thereof | |
| CN103136116B (en) | Memory storage system and its central control device, management method, and power-off recovery method | |
| TWI636396B (en) | Solid state drive architectures | |
| TWI457756B (en) | Memory system and operation method thereof | |
| US20150331624A1 (en) | Host-controlled flash translation layer snapshot | |
| US8909870B2 (en) | Cache evictions from data cache based on content of address translation table cache and address translation table | |
| US9529537B2 (en) | Storage system and storage method | |
| US20090327837A1 (en) | NAND error management | |
| TWI596541B (en) | Data accessing system, data accessing appraratus and method for accessing data | |
| JP2010211734A (en) | Storage device using nonvolatile memory | |
| US20140052904A1 (en) | Systems and methods for recovering addressing data | |
| EP3783490B1 (en) | Operating method of memory controller and storage device | |
| CN113711189B (en) | Systems and methods for managing reduced power failure energy requirements on solid state drives | |
| KR20100133710A (en) | Memory system and its code data loading method | |
| JP2013222435A (en) | Semiconductor storage device and method of controlling the same | |
| JP2020191055A (en) | Recovery process and equipment from momentary interruptions, and computer-readable storage media | |
| CN106294217A (en) | A kind of SSD system and power-off protection method thereof | |
| US10379944B2 (en) | Bit error protection in cache memories | |
| CN110147332B (en) | Management method of directory data and memory device | |
| TWI704454B (en) | Mapping table management method applied to solid state storage device | |
| JP7470112B2 (en) | Persistent Memory Cleaning | |
| US20190286343A1 (en) | Mapping table management method for solid state storage device | |
| JP7572520B1 (en) | STORAGE APPARATUS, STORAGE CONTROL METHOD, AND PROGRAM | |
| TW201418984A (en) | Method for protecting data integrity of disk and computer program product for implementing the method |