TW202125206A - Memory management method and memory device - Google Patents
Memory management method and memory device Download PDFInfo
- Publication number
- TW202125206A TW202125206A TW108148086A TW108148086A TW202125206A TW 202125206 A TW202125206 A TW 202125206A TW 108148086 A TW108148086 A TW 108148086A TW 108148086 A TW108148086 A TW 108148086A TW 202125206 A TW202125206 A TW 202125206A
- Authority
- TW
- Taiwan
- Prior art keywords
- memory
- reserved area
- power
- memory device
- command
- Prior art date
Links
Images
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
Description
本發明是有關於一種記憶體管理技術,且特別是有關於一種記憶體管理方法與記憶體裝置。The present invention relates to a memory management technology, and particularly relates to a memory management method and a memory device.
一般來說,為了提升記憶體裝置的性能,在記憶體裝置出廠時都會預留一部分記憶體空間作為超額配置(Over-provisioning, OP)使用。當記憶體裝置中可供平時使用的記憶體空間不足時,此預留作為OP使用的記憶體空間就可以用來加速記憶體裝置的存取。但是,無論是一般使用的記憶體空間或作為OP使用的記憶體空間,實際上在目前的記憶體管理機制中都有可能被寫滿。一旦記憶體裝置中所有可使用的記憶體空間都被寫滿(或即將被寫滿),當接收到來自主機系統的斷電指令時,記憶體裝置將需要花費額外的時間反覆執行例如垃圾回收等程序以釋放出新的記憶體空間,以儲存記憶體裝置因應即將到來的斷電而從緩衝記憶體搬移的資料。Generally speaking, in order to improve the performance of the memory device, a part of the memory space is reserved for over-provisioning (OP) use when the memory device leaves the factory. When the memory space available for normal use in the memory device is insufficient, the memory space reserved for OP can be used to speed up the access of the memory device. However, whether it is generally used memory space or memory space used as OP, in fact, it may be full in the current memory management mechanism. Once all the available memory space in the memory device is full (or is about to be full), when receiving a power-off command from the host system, the memory device will take extra time to repeatedly perform such as garbage collection Wait for the process to free up new memory space to store the data moved from the buffer memory by the memory device in response to the upcoming power failure.
本發明提供一種記憶體管理方法與記憶體裝置,可有效提高記憶體裝置斷電前的資料處理速度。The invention provides a memory management method and a memory device, which can effectively improve the data processing speed before the memory device is powered off.
本發明的實施例提供一種記憶體管理方法,其用於包括緩衝記憶體與記憶體模組的記憶體裝置。所述記憶體模組包括多個實體區塊。所述記憶體管理方法包括:將所述多個實體區塊中的至少一第一實體區塊劃分至保留區;從主機系統接收斷電指令;以及當接收到所述斷電指令時,將所述緩衝記憶體中的資料儲存至所述保留區。An embodiment of the present invention provides a memory management method, which is used in a memory device including a buffer memory and a memory module. The memory module includes a plurality of physical blocks. The memory management method includes: dividing at least one first physical block of the plurality of physical blocks into a reserved area; receiving a power-off command from a host system; and when the power-off command is received, The data in the buffer memory is stored in the reserved area.
本發明的實施例另提供一種記憶體裝置,其包括連接介面、緩衝記憶體、記憶體模組及記憶體控制器。所述連接介面用以耦接至主機系統。所述記憶體模組包括多個實體區塊。所述記憶體控制器耦接至所述連接介面、所述緩衝記憶體及所述記憶體模組。所述記憶體控制器用以將所述多個實體區塊中的至少一第一實體區塊劃分至保留區。所述記憶體控制器更用以經由所述連接介面從所述主機系統接收斷電指令。當接收到所述斷電指令時,所述記憶體控制器更用以將所述緩衝記憶體中的資料儲存至所述保留區。An embodiment of the present invention further provides a memory device, which includes a connection interface, a buffer memory, a memory module, and a memory controller. The connection interface is used for coupling to the host system. The memory module includes a plurality of physical blocks. The memory controller is coupled to the connection interface, the buffer memory and the memory module. The memory controller is used for dividing at least one first physical block among the plurality of physical blocks into a reserved area. The memory controller is further configured to receive a power-off command from the host system via the connection interface. When receiving the power-off command, the memory controller is further used to store the data in the buffer memory to the reserved area.
基於上述,記憶體裝置的至少一第一實體區塊可被劃分至保留區。爾後,若從主機系統接收到斷電指令,則可藉由將所述緩衝記憶體中的資料快速儲存至所述保留區,以有效提高記憶體裝置斷電前的資料處理速度及斷電速度。Based on the above, at least one first physical block of the memory device can be divided into a reserved area. Afterwards, if a power-off command is received from the host system, the data in the buffer memory can be quickly stored to the reserved area to effectively improve the data processing speed and power-off speed of the memory device before power-off .
圖1是根據本發明的一實施例所繪示的資料儲存系統的示意圖。請參照圖1,記憶體裝置10包括連接介面11、記憶體控制器12、記憶體模組13及緩衝記憶體14。連接介面11用以連接主機系統15並且例如是相容於序列先進附件(Serial Advanced Technology Attachment, SATA)、並列先進附件(Parallel Advanced Technology Attachment, PATA)、高速周邊零件連接介面(Peripheral Component Interconnect Express, PCI Express)或通用序列匯流排(Universal Serial Bus, USB)等各式連接介面標準。FIG. 1 is a schematic diagram of a data storage system according to an embodiment of the present invention. 1, the
記憶體控制器12耦接至連接介面11、記憶體模組13及緩衝記憶體14。記憶體控制器12用以執行以硬體型式或韌體型式實作的多個邏輯閘或控制指令並且根據主機系統15的指令在記憶體模組13中進行資料的寫入、讀取與抹除等運作。此外,記憶體控制器12控制記憶體裝置10的整體運作。The
記憶體模組13用以儲存主機系統15所寫入之資料。例如,記憶體模組13可包括單階胞(single level cell, SLC)NAND型快閃記憶體模組(即,一個記憶胞可儲存1個位元的快閃記憶體模組)、多階胞(multi level cell, MLC)NAND型快閃記憶體模組(即,一個記憶胞可儲存2個位元的快閃記憶體模組)、三階胞(triple level cell, TLC)NAND型快閃記憶體模組(即,一個記憶胞可儲存3個位元的快閃記憶體模組)及/或四階胞(quad level cell, QLC)NAND型快閃記憶體模組(即,一個記憶胞可儲存4個位元的快閃記憶體模組)。緩衝記憶體14可用以暫存從主機系統15接收的資料或從記憶體模組13讀取的資料。The
主機系統15可將資料儲存至記憶體裝置10中,或從記憶體裝置10中讀取資料。例如,主機系統15為可實質地與記憶體裝置10配合以儲存資料的任意系統,例如,電腦系統、數位相機、攝影機、通訊裝置、音訊播放器、視訊播放器或平板電腦等,而記憶體裝置10則可為隨身碟、記憶卡、固態硬碟(Solid State Drive, SSD)、安全數位(Secure Digital, SD)卡、小型快閃(Compact Flash, CF)卡或嵌入式儲存裝置等各式非揮發性記憶體儲存裝置。The
圖2是根據本發明的一實施例所繪示的管理記憶體模組的示意圖。請參照圖1與圖2,記憶體模組13包含多個實體區塊201(0)~201(n)與202(1)~202(m),其中每一個實體區塊包含一預設數目的記憶胞。記憶體模組13中的記憶胞是以臨界電壓的改變來儲存資料。例如,多個記憶胞可以頁等單位來進行程式化以改變記憶胞的臨界電壓。此外,每一個實體區塊可為一個最小抹除單位。FIG. 2 is a schematic diagram of a management memory module according to an embodiment of the present invention. 1 and 2, the
記憶體控制器12可將實體區塊(亦稱為第二實體區塊)201(1)~201(n)邏輯地劃分至使用區210並將實體區塊(亦稱為第一實體區塊)202(1)~202(m)邏輯地劃分至保留區220。被劃分至使用區210的實體區塊201(1)~201(n)可正常被使用。例如,當主機系統15發送寫入指令至記憶體裝置10時,記憶體控制器12可根據此寫入指令所指示的邏輯位址(例如邏輯區塊位址)將此寫入指令所攜帶的資料寫入至使用區210中此邏輯位址所映射的實體區塊。或者,當主機系統15發送讀取指令至記憶體裝置10時,記憶體控制器12可根據此讀取指令所指示的邏輯位址(例如邏輯區塊位址)從此邏輯位址所映射的實體區塊中讀取資料,並將所讀取的資料傳送至主機系統15。The
在一實施例中,被劃分至使用區210的實體區塊201(1)~201(n)可包括已儲存有使用者資料的實體區塊、經抹除且待使用的閒置實體區塊、專用以儲存系統資料(例如邏輯至實體映射表)的實體區塊及/或用於替換已損壞的實體區塊的備用實體區塊。此外,被劃分至使用區210的實體區塊201(1)~201(n)的至少一部分的容量可被提供給主機系統15使用,以對記憶體裝置10的可用容量進行管理。In one embodiment, the physical blocks 201(1) to 201(n) divided into the
另一方面,記憶體控制器12可限制被劃分至保留區220的實體區塊202(1)~202(m)只有在接收到來自主機系統15的斷電指令時才能使用。例如,當主機系統15偵測到斷電訊號時,主機系統15可根據此斷電訊號將斷電指令傳送至記憶體裝置10。記憶體控制器12可經由連接介面11接收此斷電指令。根據此斷電指令,記憶體控制器12可將緩衝記憶體14中的資料儲存至保留區220。On the other hand, the
換言之,若未接收到來自主機系統15的斷電指令,則在記憶體裝置10的運作過程中,被劃分至保留區220的實體區塊202(1)~202(m)可持續被禁止使用。藉此,可確保被劃分至保留區220的實體區塊202(1)~202(m)中至少大部分的實體區塊平時都是處於閒置狀態(即已被抹除且尚未被程式化)。當接收到來自主機系統15的斷電指令時,緩衝記憶體14中的資料可立即被儲存至被劃分至保留區220的實體區塊202(1)~202(m)中,進而提升記憶體裝置10的斷電速度。In other words, if the power-off command from the
在一實施例中,被劃分至保留區220的實體區塊202(1)~202(m)的容量不被提供給主機系統15使用。也就是說,主機系統15不會將被劃分至保留區220的實體區塊202(1)~202(m)的容量視為記憶體裝置10的可用容量。藉此,可避免來自主機系統15的使用者資料佔用保留區220的容量。In an embodiment, the capacity of the physical blocks 202(1)-202(m) divided into the
在一實施例中,當主機系統15偵測到反映即將進入工作模式中的S3、S4或S5模式的斷電訊號時,主機系統15可將斷電指令傳送給記憶體裝置10。記憶體控制器12可根據此斷電指令將記憶體裝置10斷電。此外,上述將緩衝記憶體14中的資料儲存至保留區220之操作可以是記憶體控制器12響應於此斷電指令而執行且在記憶體裝置10實際被斷電之前完成。In one embodiment, when the
在一實施例中,當記憶體裝置10被斷電且重新上電後,記憶體控制器12可將儲存於保留區220中的資料複製到被劃分至使用區210的實體區塊201(1)~201(n)中。換言之,保留區220只是用來保存斷電前從緩衝記憶體14搬移的資料。待記憶體裝置10被重新上電後,保留區220中的資料可根據相應的邏輯至實體映射關係而被儲存至使用區210中原先設定的實體位址。例如,當記憶體裝置10被重新上電後,記憶體控制器12可根據保留區220中的資料的邏輯位址查詢邏輯至實體映射表以獲得此邏輯位址所映射的實體區塊。接著,記憶體控制器12可將此資料從保留區220複製或移動至此實體區塊並指示記憶體模組13抹除保留區220中原先用以暫存此資料的實體區塊。保留區220中經抹除的實體區塊可回復至閒置狀態,以等待下一次記憶體裝置10被斷電時使用。In one embodiment, when the
在一實施例中,記憶體模組13中被劃分至保留區220的實體區塊202(1)~202(m)的容量可佔記憶體模組13的所有實體區塊的總容量的1%至28%之間(例如7%),且本發明不限於此。In an embodiment, the capacity of the physical blocks 202(1)~202(m) in the
圖3是根據本發明的一實施例所繪示的記憶體管理方法的流程圖。請參照圖3,在步驟S301中,將記憶體模組中的至少一第一實體區塊劃分至保留區。在步驟S302中,判斷是否從主機系統接收到斷電指令。當接收到所述斷電指令時,在步驟S303中,將緩衝記憶體中的資料儲存至所述保留區。此外,若未接收到所述斷電指令,則在步驟S304中,可持續禁止使用所述保留區。FIG. 3 is a flowchart of a memory management method according to an embodiment of the invention. Referring to FIG. 3, in step S301, at least one first physical block in the memory module is divided into a reserved area. In step S302, it is determined whether a power-off instruction is received from the host system. When the power-off instruction is received, in step S303, the data in the buffer memory is stored in the reserved area. In addition, if the power-off instruction is not received, in step S304, the reserved area can be continuously prohibited from being used.
然而,圖3中各步驟已詳細說明如上,在此便不再贅述。值得注意的是,圖3中各步驟可以實作為多個程式碼或是電路,本發明不加以限制。此外,圖3的方法可以搭配以上範例實施例使用,也可以單獨使用,本發明不加以限制。However, each step in FIG. 3 has been described in detail as above, and will not be repeated here. It is worth noting that each step in FIG. 3 can be implemented as multiple program codes or circuits, and the present invention is not limited. In addition, the method in FIG. 3 can be used in conjunction with the above exemplary embodiments, or can be used alone, and the present invention is not limited.
綜上所述,記憶體裝置的至少一第一實體區塊可被劃分至保留區。爾後,若從主機系統接收到斷電指令,則可藉由將所述緩衝記憶體中的資料快速儲存至所述保留區,以有效提高記憶體裝置斷電前的資料處理速度及斷電速度。In summary, at least one first physical block of the memory device can be divided into a reserved area. Afterwards, if a power-off command is received from the host system, the data in the buffer memory can be quickly stored to the reserved area to effectively improve the data processing speed and power-off speed of the memory device before power-off .
10:記憶體裝置 11:連接介面 12:記憶體控制器 13:記憶體模組 14:緩衝記憶體 15:主機系統 210:使用區 220:保留區 201(1)~201(n)、202(1)~202(m):實體區塊 S301~S304:步驟10: Memory device 11: Connection interface 12: Memory controller 13: Memory module 14: Buffer memory 15: host system 210: Use area 220: reserved area 201(1)~201(n), 202(1)~202(m): physical block S301~S304: steps
圖1是根據本發明的一實施例所繪示的資料儲存系統的示意圖。 圖2是根據本發明的一實施例所繪示的管理記憶體模組的示意圖。 圖3是根據本發明的一實施例所繪示的記憶體管理方法的流程圖。FIG. 1 is a schematic diagram of a data storage system according to an embodiment of the present invention. FIG. 2 is a schematic diagram of a management memory module according to an embodiment of the present invention. FIG. 3 is a flowchart of a memory management method according to an embodiment of the invention.
S301~S304:步驟S301~S304: steps
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW108148086A TW202125206A (en) | 2019-12-27 | 2019-12-27 | Memory management method and memory device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW108148086A TW202125206A (en) | 2019-12-27 | 2019-12-27 | Memory management method and memory device |
Publications (1)
Publication Number | Publication Date |
---|---|
TW202125206A true TW202125206A (en) | 2021-07-01 |
Family
ID=77908555
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW108148086A TW202125206A (en) | 2019-12-27 | 2019-12-27 | Memory management method and memory device |
Country Status (1)
Country | Link |
---|---|
TW (1) | TW202125206A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI796935B (en) * | 2022-01-19 | 2023-03-21 | 宏碁股份有限公司 | Memory control method and memory storage devcie |
-
2019
- 2019-12-27 TW TW108148086A patent/TW202125206A/en unknown
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI796935B (en) * | 2022-01-19 | 2023-03-21 | 宏碁股份有限公司 | Memory control method and memory storage devcie |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20180260317A1 (en) | Method for managing the copying and storing of data in garbage collection, memory storage device and memory control circuit unit using the same | |
US9268687B2 (en) | Data writing method, memory control circuit unit and memory storage apparatus | |
US9280460B2 (en) | Data writing method, memory control circuit unit and memory storage apparatus | |
US9880742B2 (en) | Valid data merging method, memory controller and memory storage apparatus | |
US20170039141A1 (en) | Mapping table updating method, memory storage device and memory control circuit unit | |
US8812776B2 (en) | Data writing method, and memory controller and memory storage device using the same | |
US9665481B2 (en) | Wear leveling method based on timestamps and erase counts, memory storage device and memory control circuit unit | |
US10303367B2 (en) | Mapping table updating method without updating the first mapping information, memory control circuit unit and memory storage device | |
US8694748B2 (en) | Data merging method for non-volatile memory module, and memory controller and memory storage device using the same | |
US9141530B2 (en) | Data writing method, memory controller and memory storage device | |
US8423838B2 (en) | Block management method, memory controller, and memory storage apparatus | |
US10503433B2 (en) | Memory management method, memory control circuit unit and memory storage device | |
CN106445401B (en) | Table updating method, memory storage device and memory control circuit unit | |
US20170329539A1 (en) | Data writing method, memory control circuit unit and memory storage device | |
US9378130B2 (en) | Data writing method, and memory controller and memory storage apparatus using the same | |
TWI536166B (en) | Memory management method, memory control circuit unit and memry storage apparatus | |
US20130332653A1 (en) | Memory management method, and memory controller and memory storage device using the same | |
US9223688B2 (en) | Data storing method and memory controller and memory storage device using the same | |
US11755242B2 (en) | Data merging method, memory storage device for updating copied L2P mapping table according to the physical address of physical unit | |
US8572350B2 (en) | Memory management, memory control system and writing method for managing rewritable semiconductor non-volatile memory of a memory storage system | |
US9778862B2 (en) | Data storing method for preventing data losing during flush operation, memory control circuit unit and memory storage apparatus | |
US10346040B2 (en) | Data merging management method based on data type, memory storage device and memory control circuit unit | |
US10824340B2 (en) | Method for managing association relationship of physical units between storage area and temporary area, memory control circuit unit, and memory storage apparatus | |
US9760456B2 (en) | Memory management method, memory storage device and memory control circuit unit | |
TW202125206A (en) | Memory management method and memory device |