TW202123016A - Storage controller, memory management method, and storage device - Google Patents

Storage controller, memory management method, and storage device Download PDF

Info

Publication number
TW202123016A
TW202123016A TW108145546A TW108145546A TW202123016A TW 202123016 A TW202123016 A TW 202123016A TW 108145546 A TW108145546 A TW 108145546A TW 108145546 A TW108145546 A TW 108145546A TW 202123016 A TW202123016 A TW 202123016A
Authority
TW
Taiwan
Prior art keywords
physical
block
target
valid
section
Prior art date
Application number
TW108145546A
Other languages
Chinese (zh)
Other versions
TWI762843B (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 TW108145546A priority Critical patent/TWI762843B/en
Publication of TW202123016A publication Critical patent/TW202123016A/en
Application granted granted Critical
Publication of TWI762843B publication Critical patent/TWI762843B/en

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

A memory management method includes: grouping a plurality of physical pages of each of a plurality of physical blocks; updating, according to a performed write command, a first target segment valid data count corresponding to a first target physical segment among a plurality of target segment valid data counts of a plurality of target physical segments corresponding to the write command; updating, according to the updated first target segment valid data count, a target block valid data count corresponding to a target physical block among a plurality of block valid data counts of the physical blocks; and updating, according to the target segment valid data counts of the target physical block, a target valid segment count corresponding to the target physical block among a plurality of valid segment counts of the physical blocks.

Description

儲存控制器、記憶體管理方法與儲存裝置Storage controller, memory management method and storage device

本發明是有關於一種記憶體管理方法,且特別是有關於一種配置有可複寫式非揮發性記憶體模組的儲存裝置、所述儲存裝置的儲存控制器以及所使用的記憶體管理方法。The present invention relates to a memory management method, and more particularly to a storage device equipped with a rewritable non-volatile memory module, a storage controller of the storage device, and a used memory management method.

一般來說,在儲存裝置的可複寫式非揮發性記憶體模組的閒置空間不足時,可儲存裝置的的控制器會對可複寫式非揮發性記憶體模組的多個實體區塊(亦稱,回收實體區塊)執行垃圾回收操作,以釋放出所述多個回收實體區塊的可用空間。Generally speaking, when the free space of the rewritable non-volatile memory module of the storage device is insufficient, the controller of the storage device will treat multiple physical blocks of the rewritable non-volatile memory module ( Also known as reclaiming physical blocks) perform a garbage collection operation to release the available space of the multiple reclaimed physical blocks.

垃圾回收操作需要耗費大量的時間來辨識儲存於所述多個回收實體區塊中的有效資料的實體位址,而使可複寫式非揮發性記憶體模組於執行垃圾回收操作時的效能降低。The garbage collection operation takes a lot of time to identify the physical addresses of the valid data stored in the multiple garbage collection blocks, which reduces the performance of the rewritable non-volatile memory module when performing garbage collection operations. .

基此,要如何有效率地增進垃圾回收操作的速度,以增進儲存裝置的效能,是本領域人員研究的課題之一。Based on this, how to efficiently increase the speed of the garbage collection operation so as to increase the performance of the storage device is one of the subjects studied by those in the field.

本發明的一實施例提供用於控制配置有可複寫式非揮發性記憶體模組的儲存裝置的一種儲存控制器。所述儲存控制器包括連接介面電路、記憶體介面控制電路、區塊管理電路單元以及處理器。所述連接介面電路用以耦接至主機系統。所述記憶體介面控制電路用以耦接至所述可複寫式非揮發性記憶體模組,其中所述可複寫式非揮發性記憶體模組具有多個實體區塊,並且所述多個實體區塊各自具有多個實體頁面。所述處理器耦接至所述連接介面電路、所述記憶體介面控制電路及所述區塊管理電路單元。所述區塊管理電路單元用以將所述多個實體區塊中的每一個實體區塊的所述多個實體頁面分組至多個實體區段。所述處理器用以執行一寫入指令,其中所述寫入指令用以指示儲存一資料至一或多個邏輯頁面中,其中所述一或多個邏輯頁面已被映射至一目標實體區塊的一或多個目標實體頁面,並且所述一或多個目標實體頁面屬於所述目標實體區塊的多個目標實體區段中的一第一目標實體區段。此外,所述區塊管理電路單元更用以根據所述寫入指令更新所述多個目標實體區段的多個目標區段有效資料計數中的對應所述第一目標實體區段的第一目標區段有效資料計數,其中所述區塊管理電路單元更用以根據已更新的所述第一目標區段有效資料計數來更新所述多個實體區塊的多個區塊有效資料計數中的對應所述目標實體區塊的目標區塊有效資料計數,其中所述區塊管理電路單元更用以根據所述目標實體區塊的所述多個目標區段有效資料計數來更新所述多個實體區塊的多個有效區段計數中對應所述目標實體區塊的目標有效區段計數,其中所述多個有效區段計數各自用以記錄所對應的實體區塊的一或多個有效實體區段的總數量,其中所述一或多個有效實體區段各自的所述區段有效資料計數大於零。An embodiment of the present invention provides a storage controller for controlling a storage device equipped with a rewritable non-volatile memory module. The storage controller includes a connection interface circuit, a memory interface control circuit, a block management circuit unit, and a processor. The connection interface circuit is used for coupling to the host system. The memory interface control circuit is used for coupling to the rewritable non-volatile memory module, wherein the rewritable non-volatile memory module has a plurality of physical blocks, and the plurality of Each physical block has multiple physical pages. The processor is coupled to the connection interface circuit, the memory interface control circuit, and the block management circuit unit. The block management circuit unit is used for grouping the plurality of physical pages of each of the plurality of physical blocks into a plurality of physical sections. The processor is used for executing a write command, wherein the write command is used for instructing to store a data in one or more logical pages, wherein the one or more logical pages have been mapped to a target physical block One or more target entity pages of the target entity page, and the one or more target entity pages belong to a first target entity section of the plurality of target entity sections of the target entity block. In addition, the block management circuit unit is further configured to update the first one corresponding to the first target physical section among the valid data counts of the plurality of target physical sections of the plurality of target physical sections according to the write instruction. The effective data count of the target section, wherein the block management circuit unit is further used to update the effective data counts of the plurality of physical blocks according to the updated effective data count of the first target section The target block effective data count corresponding to the target physical block, wherein the block management circuit unit is further used to update the multiple target block effective data counts of the target physical block A target effective section count corresponding to the target physical block among the plurality of effective section counts of a physical block, wherein each of the plurality of effective section counts is used to record one or more corresponding physical blocks The total number of valid physical segments, wherein the segment valid data count of each of the one or more valid physical segments is greater than zero.

本發明的一實施例提供適用於用以控制配置有一可複寫式非揮發性記憶體模組的一儲存裝置的儲存控制器的一種記憶體管理方法,其中所述可複寫式非揮發性記憶體模組具有多個實體區塊,並且所述多個實體區塊各自具有多個實體頁面。所述方法包括:將所述多個實體區塊中的每一個實體區塊的所述多個實體頁面分組至多個實體區段;執行一寫入指令,其中所述寫入指令用以指示儲存一資料至一或多個邏輯頁面中,其中所述一或多個邏輯頁面已被映射至一目標實體區塊的一或多個目標實體頁面,並且所述一或多個目標實體頁面屬於所述目標實體區塊的多個目標實體區段中的一第一目標實體區段;根據所述寫入指令更新所述多個目標實體區段的多個目標區段有效資料計數中的對應所述第一目標實體區段的第一目標區段有效資料計數;根據已更新的所述第一目標區段有效資料計數來更新所述多個實體區塊的多個區塊有效資料計數中的對應所述目標實體區塊的目標區塊有效資料計數;以及根據所述目標實體區塊的所述多個目標區段有效資料計數來更新所述多個實體區塊的多個有效區段計數中對應所述目標實體區塊的目標有效區段計數,其中所述多個有效區段計數各自用以記錄所對應的實體區塊的一或多個有效實體區段的總數量,其中所述一或多個有效實體區段各自的所述區段有效資料計數大於零。An embodiment of the present invention provides a memory management method suitable for a storage controller for controlling a storage device equipped with a rewritable non-volatile memory module, wherein the rewritable non-volatile memory The module has a plurality of physical blocks, and each of the plurality of physical blocks has a plurality of physical pages. The method includes: grouping the plurality of physical pages of each of the plurality of physical blocks into a plurality of physical sections; executing a write command, wherein the write command is used to instruct storage A data into one or more logical pages, wherein the one or more logical pages have been mapped to one or more target physical pages of a target physical block, and the one or more target physical pages belong to all A first target entity section of the plurality of target entity sections of the target entity block; the corresponding one of the multiple target section valid data counts of the plurality of target entity sections is updated according to the write instruction The effective data count of the first target section of the first target physical section; and the effective data counts of the plurality of physical blocks are updated according to the updated effective data count of the first target section Corresponding to the effective data count of the target block of the target physical block; and updating the multiple effective section counts of the plurality of physical blocks according to the effective data count of the multiple target sections of the target physical block The target effective section count corresponding to the target physical block in the target physical block, wherein each of the plurality of effective section counts is used to record the total number of one or more effective physical sections of the corresponding physical block, wherein the The segment valid data count of each of one or more valid physical segments is greater than zero.

本發明的一實施例提供一種儲存裝置。所述儲存裝置包括可複寫式非揮發性記憶體模組以及儲存控制器,其中所述可複寫式非揮發性記憶體模組具有多個實體區塊,並且所述多個實體區塊各自具有多個實體頁面。所述儲存控制器耦接至所述可複寫式非揮發性記憶體模組。所述儲存控制器用以將所述多個實體區塊中的每一個實體區塊的所述多個實體頁面分組至多個實體區段,其中所述儲存控制器更用以執行一寫入指令,其中所述寫入指令用以指示儲存一資料至一或多個邏輯頁面中,其中所述一或多個邏輯頁面已被映射至一目標實體區塊的一或多個目標實體頁面,並且所述一或多個目標實體頁面屬於所述目標實體區塊的多個目標實體區段中的一第一目標實體區段。所述儲存控制器更用以根據所述寫入指令更新所述多個目標實體區段的多個目標區段有效資料計數中的對應所述第一目標實體區段的第一目標區段有效資料計數,其中所述儲存控制器更用以根據已更新的所述第一目標區段有效資料計數來更新所述多個實體區塊的多個區塊有效資料計數中的對應所述目標實體區塊的目標區塊有效資料計數,其中所述儲存控制器更用以根據所述目標實體區塊的所述多個目標區段有效資料計數來更新所述多個實體區塊的多個有效區段計數中對應所述目標實體區塊的目標有效區段計數,其中所述多個有效區段計數各自用以記錄所對應的實體區塊的一或多個有效實體區段的總數量,其中所述一或多個有效實體區段各自的所述區段有效資料計數大於零。An embodiment of the present invention provides a storage device. The storage device includes a rewritable non-volatile memory module and a storage controller, wherein the rewritable non-volatile memory module has a plurality of physical blocks, and each of the plurality of physical blocks has Multiple physical pages. The storage controller is coupled to the rewritable non-volatile memory module. The storage controller is used for grouping the plurality of physical pages of each of the plurality of physical blocks into a plurality of physical sections, wherein the storage controller is further used for executing a write command, The write command is used to instruct to store a data in one or more logical pages, wherein the one or more logical pages have been mapped to one or more target physical pages of a target physical block, and The one or more target entity pages belong to a first target entity section of the plurality of target entity sections of the target entity block. The storage controller is further configured to update a first target segment corresponding to the first target physical segment in the valid data counts of a plurality of target segments of the plurality of target physical segments according to the write instruction. Data count, wherein the storage controller is further used to update the target entity in the plurality of block effective data counts of the plurality of physical blocks according to the updated first target section effective data count The effective data count of the target block of the block, wherein the storage controller is further used for updating the effective data of the plurality of physical blocks according to the effective data count of the plurality of target sections of the target physical block The section count corresponds to the target effective section count of the target physical block, wherein each of the plurality of effective section counts is used to record the total number of one or more effective physical sections of the corresponding physical block, The valid data count of each of the one or more valid physical segments is greater than zero.

基於上述,本發明的實施例所提供的儲存控制器、記憶體管理方法以及儲存裝置,可將可複寫式非揮發性記憶體模組的多個實體區塊中的每一個實體區塊的所述多個實體頁面分組至多個實體區段,根據所述寫入指令更新對應的區段有效資料計數、對應的有效資料計數以及對應的有效區段計數,以利用所述區塊有效資料計數與所述有效區段計數來選擇且排序多個回收實體區塊,以依據有效資料的集中度來依序對所述多個垃圾實體區塊執行垃圾回收操作,進而有效率地釋放出可複寫式非揮發性記憶體模組的空間而增進了儲存裝置的整體存取效能Based on the above, the storage controller, the memory management method, and the storage device provided by the embodiments of the present invention can combine all the physical blocks of each of the multiple physical blocks of the rewritable non-volatile memory module. The multiple physical pages are grouped into multiple physical sections, and the corresponding section valid data count, the corresponding valid data count, and the corresponding valid section count are updated according to the write command, so as to use the block valid data count and The effective section count selects and sorts a plurality of reclaimed physical blocks, so as to sequentially perform a garbage collection operation on the plurality of garbage physical blocks according to the concentration of effective data, thereby efficiently releasing the rewritable type The space of the non-volatile memory module improves the overall access performance of the storage device

在本實施例中,儲存裝置包括可複寫式非揮發性記憶體模組(rewritable non-volatile memory module)與儲存裝置控制器(亦稱,儲存控制器或儲存控制電路)。此外,儲存裝置是與主機系統一起使用,以使主機系統可將資料寫入至儲存裝置或從儲存裝置中讀取資料。In this embodiment, the storage device includes a rewritable non-volatile memory module and a storage device controller (also referred to as a storage controller or a storage control circuit). In addition, the storage device is used together with the host system so that the host system can write data to the storage device or read data from the storage device.

圖1是根據本發明的一實施例所繪示的主機系統及儲存裝置的方塊示意圖。FIG. 1 is a block diagram of a host system and a storage device according to an embodiment of the invention.

請參照圖1,主機系統(Host System)10包括處理器(Processor)110、主機記憶體(Host Memory)120及資料傳輸介面電路(Data Transfer Interface Circuit)130。在本實施例中,資料傳輸介面電路130耦接(亦稱,電性連接)至處理器110與主機記憶體120。在另一實施例中,處理器110、主機記憶體120與資料傳輸介面電路130之間利用系統匯流排(System Bus)彼此耦接。Please refer to FIG. 1, the host system 10 includes a processor 110, a host memory 120 and a data transfer interface circuit 130. In this embodiment, the data transmission interface circuit 130 is coupled (also referred to as electrically connected) to the processor 110 and the host memory 120. In another embodiment, the processor 110, the host memory 120, and the data transmission interface circuit 130 are coupled to each other by a system bus.

儲存裝置20包括儲存控制器(Storage Controller)210、可複寫式非揮發性記憶體模組(Rewritable Non-Volatile Memory Module)220及連接介面電路(Connection Interface Circuit)230。其中,儲存控制器210包括處理器211、資料管理電路(Data Management Circuit)212與記憶體介面控制電路(Memory Interface Control Circuit)213。The storage device 20 includes a storage controller (Storage Controller) 210, a rewritable non-volatile memory module (Rewritable Non-Volatile Memory Module) 220 and a connection interface circuit (Connection Interface Circuit) 230. The storage controller 210 includes a processor 211, a data management circuit (Data Management Circuit) 212, and a memory interface control circuit (Memory Interface Control Circuit) 213.

在本實施例中,主機系統10是透過資料傳輸介面電路130與儲存裝置20的連接介面電路230耦接至儲存裝置20來進行資料的存取操作。例如,主機系統10可經由資料傳輸介面電路130將資料儲存至儲存裝置20或從儲存裝置20中讀取資料。In this embodiment, the host system 10 is coupled to the storage device 20 through the data transmission interface circuit 130 and the connection interface circuit 230 of the storage device 20 to perform data access operations. For example, the host system 10 can store data to the storage device 20 or read data from the storage device 20 via the data transmission interface circuit 130.

在本實施例中,處理器110、主機記憶體120及資料傳輸介面電路130可設置在主機系統10的主機板上。資料傳輸介面電路130的數目可以是一或多個。透過資料傳輸介面電路130,主機板可以經由有線或無線方式耦接至儲存裝置20。儲存裝置20可例如是隨身碟、記憶卡、固態硬碟(Solid State Drive,SSD)或無線記憶體儲存裝置。無線記憶體儲存裝置可例如是近距離無線通訊(Near Field Communication,NFC)記憶體儲存裝置、無線傳真(WiFi)記憶體儲存裝置、藍牙(Bluetooth)記憶體儲存裝置或低功耗藍牙記憶體儲存裝置(例如,iBeacon)等以各式無線通訊技術為基礎的記憶體儲存裝置。此外,主機板也可以透過系統匯流排耦接至全球定位系統(Global Positioning System,GPS)模組、網路介面卡、無線傳輸裝置、鍵盤、螢幕、喇叭等各式I/O裝置。In this embodiment, the processor 110, the host memory 120, and the data transmission interface circuit 130 may be disposed on the main board of the host system 10. The number of the data transmission interface circuit 130 may be one or more. Through the data transmission interface circuit 130, the motherboard can be coupled to the storage device 20 in a wired or wireless manner. The storage device 20 may be, for example, a flash drive, a memory card, a solid state drive (SSD) or a wireless memory storage device. The wireless memory storage device may be, for example, a Near Field Communication (NFC) memory storage device, a wireless fax (WiFi) memory storage device, a Bluetooth (Bluetooth) memory storage device, or a Bluetooth low energy memory storage device Devices (for example, iBeacon) and other memory storage devices based on various wireless communication technologies. In addition, the motherboard can also be coupled to various I/O devices such as Global Positioning System (GPS) modules, network interface cards, wireless transmission devices, keyboards, screens, speakers, etc. through the system bus.

在本實施例中,資料傳輸介面電路130與連接介面電路230是相容於高速周邊零件連接介面(Peripheral Component Interconnect Express, PCI Express)標準的介面電路。並且,資料傳輸介面電路130與連接介面電路230之間是利用快速非揮發性記憶體介面標準(Non-Volatile Memory express,NVMe)通訊協定來進行資料的傳輸。In this embodiment, the data transmission interface circuit 130 and the connection interface circuit 230 are interface circuits compatible with the Peripheral Component Interconnect Express (PCI Express) standard. In addition, the data transmission interface circuit 130 and the connection interface circuit 230 use a non-volatile memory interface standard (Non-Volatile Memory express, NVMe) communication protocol for data transmission.

然而,必須瞭解的是,本發明不限於此,資料傳輸介面電路130與連接介面電路230亦可以是符合並列先進附件(Parallel Advanced Technology Attachment,PATA)標準、電氣和電子工程師協會(Institute of Electrical and Electronic Engineers,IEEE)1394標準、序列先進附件(Serial Advanced Technology Attachment,SATA)標準、通用序列匯流排(Universal Serial Bus,USB)標準、SD介面標準、超高速一代(Ultra High Speed-I,UHS-I)介面標準、超高速二代(Ultra High Speed-II,UHS-II)介面標準、記憶棒(Memory Stick, MS)介面標準、多晶片封裝(Multi-Chip Package)介面標準、多媒體儲存卡(Multi Media Card,MMC)介面標準、eMMC介面標準、通用快閃記憶體(Universal Flash Storage,UFS)介面標準、eMCP介面標準、CF介面標準、整合式驅動電子介面(Integrated Device Electronics,IDE)標準或其他適合的標準。此外,在另一實施例中,連接介面電路230可與儲存控制器210封裝在一個晶片中,或者連接介面電路230是佈設於一包含儲存控制器210之晶片外。However, it must be understood that the present invention is not limited to this. The data transmission interface circuit 130 and the connection interface circuit 230 may also conform to the Parallel Advanced Technology Attachment (PATA) standard, the Institute of Electrical and Electronics Engineers (Institute of Electrical and Electronic Engineers, IEEE) 1394 standard, Serial Advanced Technology Attachment (SATA) standard, Universal Serial Bus (USB) standard, SD interface standard, Ultra High Speed-I (UHS-I) I) Interface standard, Ultra High Speed-II (UHS-II) interface standard, Memory Stick (MS) interface standard, Multi-Chip Package interface standard, multimedia memory card ( Multi Media Card (MMC) interface standard, eMMC interface standard, Universal Flash Storage (UFS) interface standard, eMCP interface standard, CF interface standard, Integrated Device Electronics (IDE) standard or Other suitable standards. In addition, in another embodiment, the connection interface circuit 230 and the storage controller 210 may be packaged in a chip, or the connection interface circuit 230 may be arranged outside a chip including the storage controller 210.

在本實施例中,主機記憶體120用以暫存處理器110所執行的指令或資料。例如,在本範例實施例中,主機記憶體120可以是動態隨機存取記憶體(Dynamic Random Access Memory,DRAM)、靜態隨機存取記憶體(Static Random Access Memory,SRAM)等。然而,必須瞭解的是,本發明不限於此,主機記憶體120也可以是其他適合的記憶體。In this embodiment, the host memory 120 is used to temporarily store instructions or data executed by the processor 110. For example, in this exemplary embodiment, the host memory 120 may be a dynamic random access memory (Dynamic Random Access Memory, DRAM), a static random access memory (Static Random Access Memory, SRAM), etc. However, it must be understood that the present invention is not limited to this, and the host memory 120 may also be other suitable memory.

儲存控制器210用以執行以硬體型式或韌體型式實作的多個邏輯閘或控制指令並且根據主機系統10的指令在可複寫式非揮發性記憶體模組220中進行資料的寫入、讀取與抹除等運作。The storage controller 210 is used to execute a plurality of logic gates or control commands implemented in a hardware type or a firmware type, and to write data in the rewritable non-volatile memory module 220 according to the commands of the host system 10 , Read and erase operations.

更詳細來說,儲存控制器210中的處理器211為具備運算能力的硬體,其用以控制儲存控制器210的整體運作。具體來說,處理器211具有多個控制指令,並且在儲存裝置20運作時,此些控制指令會被執行以進行資料的寫入、讀取與抹除等運作。In more detail, the processor 211 in the storage controller 210 is a hardware capable of computing, which is used to control the overall operation of the storage controller 210. Specifically, the processor 211 has a plurality of control commands, and when the storage device 20 is operating, these control commands are executed to perform operations such as writing, reading, and erasing data.

值得一提的是,在本實施例中,處理器110與處理器211例如是中央處理單元(Central Processing Unit,CPU)、微處理器(micro-processor)、或是其他可程式化之處理單元(Microprocessor)、數位訊號處理器(Digital Signal Processor,DSP)、可程式化控制器、特殊應用積體電路(Application Specific Integrated Circuits,ASIC)、可程式化邏輯裝置(Programmable Logic Device,PLD)或其他類似電路元件,本發明並不限於此。It is worth mentioning that in this embodiment, the processor 110 and the processor 211 are, for example, a central processing unit (CPU), a microprocessor (micro-processor), or other programmable processing units. (Microprocessor), Digital Signal Processor (DSP), Programmable Controller, Application Specific Integrated Circuits (ASIC), Programmable Logic Device (PLD) or others Similar to circuit elements, the present invention is not limited to this.

在一實施例中,儲存控制器210還具有唯讀記憶體(未繪示)及隨機存取記憶體(未繪示)。特別是,此唯讀記憶體具有開機碼(boot code),並且當儲存控制器210被致能時,處理器211會先執行此開機碼來將儲存於可複寫式非揮發性記憶體模組220中之控制指令載入至儲存控制器210的隨機存取記憶體中。之後,處理器211會運轉此些控制指令以進行資料的寫入、讀取與抹除等運作。在另一實施例中,處理器211的控制指令亦可以程式碼型式儲存於可複寫式非揮發性記憶體模組220的特定區域,例如,可複寫式非揮發性記憶體模組220中專用於存放系統資料的實體儲存單元中。In one embodiment, the storage controller 210 also has a read-only memory (not shown) and a random access memory (not shown). In particular, the read-only memory has a boot code, and when the storage controller 210 is enabled, the processor 211 will first execute the boot code to store it in the rewritable non-volatile memory module The control command in 220 is loaded into the random access memory of the storage controller 210. After that, the processor 211 runs these control commands to perform data writing, reading, and erasing operations. In another embodiment, the control commands of the processor 211 may also be stored in a specific area of the rewritable non-volatile memory module 220 in the form of program codes, for example, dedicated to the rewritable non-volatile memory module 220 In the physical storage unit storing system data.

在本實施例中,如上所述,儲存控制器210還包括資料管理電路212與記憶體介面控制電路213。應注意的是,儲存控制器210各部件所執行的操作亦可視為儲存控制器210所執行的操作。In this embodiment, as described above, the storage controller 210 further includes a data management circuit 212 and a memory interface control circuit 213. It should be noted that the operations performed by the components of the storage controller 210 can also be regarded as operations performed by the storage controller 210.

其中,資料管理電路212耦接至處理器211、記憶體介面控制電路213與連接介面電路230。資料管理電路212用以接受處理器211的指示來進行資料的傳輸。例如,經由連接介面電路230從主機系統10(如,主機記憶體120)讀取資料,並且將所讀取的資料經由記憶體介面控制電路213寫入至可複寫式非揮發性記憶體模組220中(如,根據來自主機系統10的寫入指令來進行寫入操作)。又例如,經由記憶體介面控制電路213從可複寫式非揮發性記憶體模組220的一或多個實體單元中讀取資料(資料可讀取自一或多個實體單元中的一或多個記憶胞),並且將所讀取的資料經由連接介面電路230寫入至主機系統10(如,主機記憶體120)中(如,根據來自主機系統10的讀取指令來進行讀取操作)。在另一實施例中,資料管理電路212亦可整合至處理器211中。The data management circuit 212 is coupled to the processor 211, the memory interface control circuit 213, and the connection interface circuit 230. The data management circuit 212 is used for receiving instructions from the processor 211 to transmit data. For example, read data from the host system 10 (eg, the host memory 120) through the connection interface circuit 230, and write the read data to the rewritable non-volatile memory module through the memory interface control circuit 213 220 (for example, a write operation is performed according to a write command from the host system 10). For another example, data can be read from one or more physical units of the rewritable non-volatile memory module 220 through the memory interface control circuit 213 (data can be read from one or more of the one or more physical units). Memory cells), and write the read data to the host system 10 (for example, the host memory 120) via the connection interface circuit 230 (for example, perform a read operation according to a read command from the host system 10) . In another embodiment, the data management circuit 212 can also be integrated into the processor 211.

記憶體介面控制電路213用以接受處理器211的指示,配合資料管理電路212來進行對於可複寫式非揮發性記憶體模組220的寫入(亦稱,程式化,Programming)操作、讀取操作或抹除操作。The memory interface control circuit 213 is used to receive instructions from the processor 211 and cooperate with the data management circuit 212 to perform writing (also known as programming) operations and reading to the rewritable non-volatile memory module 220 Operate or erase operation.

舉例來說,處理器211可執行寫入指令序列,以指示記憶體介面控制電路213將資料寫入至可複寫式非揮發性記憶體模組220中;處理器211可執行讀取指令序列,以指示記憶體介面控制電路213從可複寫式非揮發性記憶體模組220的對應讀取指令的一或多個實體單元(亦稱,目標實體單元)中讀取資料;處理器211可執行抹除指令序列,以指示記憶體介面控制電路213對可複寫式非揮發性記憶體模組220進行抹除操作。寫入指令序列、讀取指令序列及抹除指令序列可各別包括一或多個程式碼或指令碼並且用以指示對可複寫式非揮發性記憶體模組220執行相對應的寫入、讀取及抹除等操作。在一實施例中,處理器211還可以下達其他類型的指令序列給記憶體介面控制電路213,以對可複寫式非揮發性記憶體模組220執行相對應的操作。For example, the processor 211 can execute a write command sequence to instruct the memory interface control circuit 213 to write data into the rewritable non-volatile memory module 220; the processor 211 can execute a read command sequence, To instruct the memory interface control circuit 213 to read data from one or more physical units (also known as target physical units) corresponding to the read instructions of the rewritable non-volatile memory module 220; the processor 211 can execute The erase command sequence instructs the memory interface control circuit 213 to perform an erase operation on the rewritable non-volatile memory module 220. The write command sequence, the read command sequence, and the erase command sequence may each include one or more program codes or command codes and are used to instruct to perform corresponding writing, writing, and writing to the rewritable non-volatile memory module 220. Operations such as reading and erasing. In one embodiment, the processor 211 may also issue other types of instruction sequences to the memory interface control circuit 213 to perform corresponding operations on the rewritable non-volatile memory module 220.

此外,欲寫入至可複寫式非揮發性記憶體模組220的資料會經由記憶體介面控制電路213轉換為可複寫式非揮發性記憶體模組220所能接受的格式。具體來說,若處理器211要存取可複寫式非揮發性記憶體模組220,處理器211會傳送對應的指令序列給記憶體介面控制電路213以指示記憶體介面控制電路213執行對應的操作。例如,這些指令序列可包括指示寫入資料的寫入指令序列、指示讀取資料的讀取指令序列、指示抹除資料的抹除指令序列、以及用以指示各種記憶體操作(例如,改變預設讀取電壓組的多個預設讀取電壓值以進行讀取操作,或執行垃圾回收程序等等)的相對應的指令序列。這些指令序列可包括一或多個訊號,或是在匯流排上的資料。這些訊號或資料可包括指令碼或程式碼。例如,在讀取指令序列中,會包括讀取的辨識碼、記憶體位址等資訊。In addition, the data to be written into the rewritable non-volatile memory module 220 is converted into a format acceptable by the rewritable non-volatile memory module 220 through the memory interface control circuit 213. Specifically, if the processor 211 wants to access the rewritable non-volatile memory module 220, the processor 211 will send a corresponding command sequence to the memory interface control circuit 213 to instruct the memory interface control circuit 213 to execute the corresponding operating. For example, these command sequences may include a write command sequence instructing to write data, a read command sequence instructing to read data, an erase command sequence instructing to erase data, and various memory operations (e.g., changing presets). It is assumed that a plurality of preset read voltage values of the read voltage group are used to perform a read operation, or execute a garbage collection program, etc.) corresponding to the instruction sequence. These command sequences can include one or more signals, or data on the bus. These signals or data may include script codes or program codes. For example, in the read command sequence, the read identification code, memory address and other information will be included.

可複寫式非揮發性記憶體模組220是耦接至儲存控制器210(記憶體介面控制電路213)並且用以儲存主機系統10所寫入之資料。可複寫式非揮發性記憶體模組220可以是單階記憶胞(Single Level Cell,SLC)NAND型快閃記憶體模組(即,一個記憶胞中可儲存1個位元的快閃記憶體模組)、多階記憶胞(Multi Level Cell,MLC)NAND型快閃記憶體模組(即,一個記憶胞中可儲存2個位元的快閃記憶體模組)、三階記憶胞(Triple Level Cell,TLC)NAND型快閃記憶體模組(即,一個記憶胞中可儲存3個位元的快閃記憶體模組)、四階記憶胞(Quadruple Level Cell,QLC)NAND型快閃記憶體模組(即,一個記憶胞中可儲存4個位元的快閃記憶體模組)、三維NAND型快閃記憶體模組(3D NAND flash memory module)或垂直NAND型快閃記憶體模組(Vertical NAND flash memory module)等其他快閃記憶體模組或其他具有相同特性的記憶體模組。可複寫式非揮發性記憶體模組220中的記憶胞是以陣列的方式設置。The rewritable non-volatile memory module 220 is coupled to the storage controller 210 (the memory interface control circuit 213) and is used to store data written by the host system 10. The rewritable non-volatile memory module 220 may be a single level cell (SLC) NAND flash memory module (that is, a flash memory that can store 1 bit in a memory cell). Module), Multi Level Cell (MLC) NAND-type flash memory module (that is, a flash memory module that can store 2 bits in a memory cell), and a third-level memory cell ( Triple Level Cell (TLC) NAND flash memory modules (that is, a flash memory module that can store 3 bits in a memory cell), Quadruple Level Cell (QLC) NAND flash memory modules Flash memory module (ie, a flash memory module that can store 4 bits in a memory cell), 3D NAND flash memory module (3D NAND flash memory module), or vertical NAND flash memory Other flash memory modules such as Vertical NAND flash memory module or other memory modules with the same characteristics. The memory cells in the rewritable non-volatile memory module 220 are arranged in an array.

在本實施例中,可複寫式非揮發性記憶體模組220具有多個字元線,其中所述多個字元線的每一個字元線耦接至多個記憶胞。同一條字元線上的多個記憶胞會組成一或多個實體程式化單元。此外,多個實體程式化單元可組成一個實體單元(實體區塊或實體抹除單元)。In this embodiment, the rewritable non-volatile memory module 220 has a plurality of character lines, and each of the plurality of character lines is coupled to a plurality of memory cells. Multiple memory cells on the same character line form one or more physical programming units. In addition, multiple physical programming units can form a physical unit (physical block or physical erase unit).

在本實施例中,是以記憶胞作為寫入(程式化)資料的最小單位。實體單元為抹除之最小單位,即,每一實體單元含有最小數目之一併被抹除之記憶胞。In this embodiment, the memory cell is used as the smallest unit for writing (programming) data. The physical unit is the smallest unit of erasure, that is, each physical unit contains one of the smallest number of memory cells that are erased.

每一實體單元會具有多個實體子單元。實體子單元可為實體頁面(page)或是實體扇(sector)。在本實施例中,實體子單元包括資料位元區與冗餘(redundancy)位元區。資料位元區用以儲存使用者資料,而冗餘位元區用以儲存系統資料。系統資料例如為錯誤更正碼、錯誤檢查碼或元資料(Meta Data)。然而,本發明不限於此。例如,在另一實施例中,亦可變化本實施例所述的資料傳輸方法,應用至以實體單元作為寫入資料的最小儲存單位的可複寫式非揮發性記憶體模組220。Each physical unit will have multiple physical sub-units. The physical subunit can be a physical page (page) or a physical sector (sector). In this embodiment, the physical subunit includes a data bit area and a redundancy bit area. The data bit area is used to store user data, and the redundant bit area is used to store system data. The system data is, for example, error correction code, error check code, or metadata (Meta Data). However, the present invention is not limited to this. For example, in another embodiment, the data transmission method described in this embodiment can also be modified and applied to a rewritable non-volatile memory module 220 that uses a physical unit as the smallest storage unit for writing data.

應注意的是,在本實施例中,用以記錄一實體單元的資訊的系統資料可利用該實體單元中的一或多個實體子單元來記錄,或是利用一個系統區中用以記錄所有系統資料的特定實體單元的一或多個實體子單元來記錄。在本實施例中,所述對應一實體單元的系統資料包括該實體單元的抹除次數值(Program erase cycle,PEC)、區塊有效資料計數(Block Valid Data Count)、多個區段有效資料計數(Segment Valid Data Count)以及有效區段計數(Valid Segment Count)(亦稱,有效區段總數)等資訊。It should be noted that, in this embodiment, the system data used to record the information of a physical unit can be recorded by one or more physical subunits in the physical unit, or can be recorded in a system area for recording all One or more physical sub-units of a specific physical unit of the system data are recorded. In this embodiment, the system data corresponding to a physical unit includes the erase frequency value (Program erase cycle, PEC) of the physical unit, the block valid data count (Block Valid Data Count), and multiple section valid data. Count (Segment Valid Data Count) and valid segment count (Valid Segment Count) (also known as the total number of valid segments) and other information.

在以下實施例中,是以一個實體區塊作為一個實體單元的範例。然而,在另一實施例中,一個實體單元亦可以是指任意數目的記憶胞組成,視實務上的需求而定。此外,必須瞭解的是,當儲存控制器211對可複寫式非揮發性記憶體模組220中的記憶胞(或實體單元)進行分組以執行對應的管理操作時,此些記憶胞(或實體單元)是被邏輯地分組,而其實際位置並未更動。In the following embodiments, a physical block is used as an example of a physical unit. However, in another embodiment, a physical unit can also refer to any number of memory cells, depending on practical requirements. In addition, it must be understood that when the storage controller 211 groups the memory cells (or physical units) in the rewritable non-volatile memory module 220 to perform corresponding management operations, these memory cells (or physical units) Units) are logically grouped, and their actual locations have not changed.

儲存控制器210會配置多個邏輯單元給可複寫式非揮發性記憶體模組220。主機系統10是透過所配置的邏輯單元來存取儲存在多個實體單元中的使用者資料。在此,每一個邏輯單元可以是由一或多個邏輯位址組成。例如,邏輯單元可以是邏輯區塊(Logical Block)、邏輯頁面(Logical Page)或是邏輯扇區(Logical Sector)。一個邏輯單元可以是映射至一或多個實體單元,其中實體單元可以是一或多個實體位址、一或多個實體扇、一或多個實體程式化單元或者一或多個實體抹除單元。在本實施例中,邏輯單元為邏輯區塊,並且邏輯子單元為邏輯頁面。每一邏輯單元具有多個邏輯子單元。The storage controller 210 allocates a plurality of logic units to the rewritable non-volatile memory module 220. The host system 10 accesses user data stored in multiple physical units through configured logical units. Here, each logical unit can be composed of one or more logical addresses. For example, the logical unit may be a logical block (Logical Block), a logical page (Logical Page) or a logical sector (Logical Sector). A logical unit can be mapped to one or more physical units, where the physical unit can be one or more physical addresses, one or more physical sectors, one or more physical programming units, or one or more physical erasures unit. In this embodiment, the logical unit is a logical block, and the logical sub-unit is a logical page. Each logic unit has multiple logic sub-units.

此外,儲存控制器210會建立邏輯轉實體位址映射表(Logical To Physical address mapping table)與實體轉邏輯位址映射表(Physical To Logical address mapping table),以記錄配置給可複寫式非揮發性記憶體模組220的邏輯單元(如,邏輯區塊、邏輯頁面或邏輯扇區)與實體單元(如,實體抹除單元、實體程式化單元、實體扇區)之間的位址映射關係。換言之,儲存控制器210可藉由邏輯轉實體位址映射表來查找一邏輯單元所映射的實體單元,並且儲存控制器210可藉由實體轉邏輯位址映射表來查找一實體單元所映射的邏輯單元。然而,上述有關邏輯單元與實體單元映射的技術概念為本領域技術人員之慣用技術手段且非本發明所欲闡述的技術方案,不再贅述於此。例如,主機系統10可配置多個邏輯頁面,並且所述多個邏輯頁面可被映射至多個實體頁面。In addition, the storage controller 210 creates a logical to physical address mapping table (Logical To Physical address mapping table) and a physical to logical address mapping table (Physical To Logical address mapping table) to record the configuration to the rewritable non-volatile The address mapping relationship between logical units (eg, logical blocks, logical pages, or logical sectors) of the memory module 220 and physical units (eg, physical erase units, physical programming units, physical sectors). In other words, the storage controller 210 can use the logical-to-physical address mapping table to find the physical unit to which a logical unit is mapped, and the storage controller 210 can use the physical-to-logical address mapping table to find the physical unit to which a physical unit is mapped. Logical unit. However, the above-mentioned technical concepts related to the mapping between logical units and physical units are conventional technical means by those skilled in the art and are not technical solutions intended to be described in the present invention, and will not be repeated here. For example, the host system 10 may be configured with multiple logical pages, and the multiple logical pages may be mapped to multiple physical pages.

在本實施例中,錯誤檢查與校正電路214是耦接至處理器211並且用以執行錯誤檢查與校正程序以確保資料的正確性。具體來說,當處理器211從主機系統10中接收到寫入指令時,錯誤檢查與校正電路214會為對應此寫入指令的資料產生對應的錯誤更正碼(error correcting code,ECC)及/或錯誤檢查碼(error detecting code,EDC),並且處理器211會將對應此寫入指令的資料與對應的錯誤更正碼及/或錯誤檢查碼寫入至可複寫式非揮發性記憶體模組220中。之後,當處理器211從可複寫式非揮發性記憶體模組220中讀取資料時會同時讀取此資料對應的錯誤更正碼及/或錯誤檢查碼,並且錯誤檢查與校正電路214會依據此錯誤更正碼及/或錯誤檢查碼對所讀取的資料執行錯誤檢查與校正程序。In this embodiment, the error checking and correcting circuit 214 is coupled to the processor 211 and used to perform error checking and correcting procedures to ensure the correctness of the data. Specifically, when the processor 211 receives a write command from the host system 10, the error checking and correction circuit 214 will generate a corresponding error correcting code (ECC) and/or for the data corresponding to the write command. Or error detecting code (EDC), and the processor 211 will write the data corresponding to this write command and the corresponding error correction code and/or error check code to the rewritable non-volatile memory module 220 in. After that, when the processor 211 reads data from the rewritable non-volatile memory module 220, it will read the error correction code and/or error check code corresponding to the data at the same time, and the error check and correction circuit 214 will follow This error correction code and/or error check code performs error checking and correction procedures on the read data.

在一實施例中,儲存控制器210還包括緩衝記憶體216與電源管理電路217。緩衝記憶體是耦接至處理器211並且用以暫存來自於主機系統10的資料與指令、來自於可複寫式非揮發性記憶體模組220的資料或其他用以管理儲存裝置20的系統資料,以讓處理器211可快速地從緩衝記憶體216中存取所述資料、指令或系統資料。電源管理電路217是耦接至處理器211並且用以控制儲存裝置20的電源。In one embodiment, the storage controller 210 further includes a buffer memory 216 and a power management circuit 217. The buffer memory is coupled to the processor 211 and used to temporarily store data and instructions from the host system 10, data from the rewritable non-volatile memory module 220, or other systems for managing the storage device 20 Data, so that the processor 211 can quickly access the data, instructions, or system data from the buffer memory 216. The power management circuit 217 is coupled to the processor 211 and used to control the power of the storage device 20.

在本實施例中,區塊管理電路單元215包括有效資料計數電路2151與有效區段管理電路2152。所述區塊管理電路單元215用以管理可複寫式非揮發性記憶體模組220中的多個實體區塊的資訊。區塊管理電路單元215各部件的運作也可代表區塊管理電路單元215的運作。以下利用圖2來說明區塊管理電路單元215的功用以及對應的本實施例所提供的記憶體管理方法。In this embodiment, the block management circuit unit 215 includes a valid data counting circuit 2151 and a valid section management circuit 2152. The block management circuit unit 215 is used to manage the information of multiple physical blocks in the rewritable non-volatile memory module 220. The operations of the components of the block management circuit unit 215 may also represent the operations of the block management circuit unit 215. The function of the block management circuit unit 215 and the corresponding memory management method provided in this embodiment are described below using FIG. 2.

圖2是根據本發明的一實施例所繪示的記憶體管理方法的流程圖。請參照圖2,在步驟S210中,區塊管理電路單元215將可複寫式非揮發性記憶體模組220的多個實體區塊中的每一個實體區塊的多個實體頁面分組至多個實體區段。以下先利用圖4A、4B來進行說明。FIG. 2 is a flowchart of a memory management method according to an embodiment of the invention. 2, in step S210, the block management circuit unit 215 groups the multiple physical pages of each of the multiple physical blocks of the rewritable non-volatile memory module 220 into multiple entities Section. Hereinafter, the description will be made using FIGS. 4A and 4B first.

圖4A是根據本發明的一實施例所繪示的碼字、實體頁面、實體區塊與可複寫式非揮發性記憶體模組的示意圖。圖4B是根據本發明的一實施例所繪示的分組實體區塊的多個實體頁面為多個實體區段的示意圖。4A is a schematic diagram of a codeword, a physical page, a physical block, and a rewritable non-volatile memory module according to an embodiment of the present invention. FIG. 4B is a schematic diagram illustrating that multiple physical pages of a grouped physical block are multiple physical sections according to an embodiment of the present invention.

請先參照圖4A,在本實施例中,從主機系統10所接收到的資料是以碼字(Codeword)為單位被儲存在一個實體頁面中,如,碼字CW(1)~CW(M),M為正整數。依據每個可複寫式非揮發性記憶體模組220的規格不同,每一個實體頁面所儲存的碼字的數量不同。多個實體頁面P(1)~P(NP)會被劃分為一個實體區塊,N、P為正整數(NP代表N乘以P的積)。多個實體區塊B(1)~B(Q)屬於可複寫式非揮發性記憶體模組220,Q為正整數。Please refer to FIG. 4A. In this embodiment, the data received from the host system 10 is stored in a physical page in units of codewords, for example, codewords CW(1)~CW(M ), M is a positive integer. According to the specifications of each rewritable non-volatile memory module 220, the number of codewords stored in each physical page is different. Multiple physical pages P(1)~P(NP) will be divided into one physical block, N and P are positive integers (NP represents the product of N times P). A plurality of physical blocks B(1)~B(Q) belong to the rewritable non-volatile memory module 220, and Q is a positive integer.

應注意的是,本發明並不限於M、N、P、Q的具體數值,M、N、P、Q的具體數值是依據可複寫式非揮發性記憶體模組220的規格或廠商的需求被預先設定的。It should be noted that the present invention is not limited to the specific values of M, N, P, and Q. The specific values of M, N, P, and Q are based on the specifications of the rewritable non-volatile memory module 220 or the requirements of the manufacturer. Is preset.

請參照圖4B,在本實施例中,區塊管理電路單元215會對每一個實體區塊所具有的多個實體頁面進行分組。例如,區塊管理電路單元215將實體區塊B(1)的多個實體頁面P(1)~P(NP)分組為多個實體區段S(1)~S(N)。每P個實體頁面會被分組至一個實體區段,如,實體區段S(1)包括實體頁面P(1)~P(P),實體區段S(2)包括實體頁面P(P+1)~P(2P),實體區段S(N)包括實體頁面P(NP-P+1)~P(NP)等等…。在獲得已分組的所述多個實體區段S(1)~S(N)後,區塊管理電路單元215可對應地記錄/維護/更新相關於所述多個實體區段S(1)~S(N)的多種資訊(如,有效資料計數、區段有效資料計數、區塊有效資料計數、有效區段計數等等…)。Referring to FIG. 4B, in this embodiment, the block management circuit unit 215 groups the multiple physical pages of each physical block. For example, the block management circuit unit 215 groups the multiple physical pages P(1)~P(NP) of the physical block B(1) into multiple physical sections S(1)~S(N). Each P physical pages will be grouped into a physical section. For example, physical section S(1) includes physical pages P(1)~P(P), and physical section S(2) includes physical pages P(P+ 1)~P(2P), the physical section S(N) includes physical pages P(NP-P+1)~P(NP), etc... After obtaining the grouped physical sections S(1) to S(N), the block management circuit unit 215 can correspondingly record/maintain/update related to the plurality of physical sections S(1) ~S(N) a variety of information (such as valid data count, segment valid data count, block valid data count, valid segment count, etc...).

請在回到圖2,在步驟S220中,處理器211執行一寫入指令,其中所述寫入指令用以指示儲存一資料至邏輯區塊的一或多個邏輯頁面中,其中所述邏輯區塊已被映射至所述多個實體區塊中的一目標實體區塊,其中所述一或多個邏輯頁面已被映射至所述目標實體區塊的一或多個目標實體頁面,並且所述一或多個目標實體頁面屬於所述目標實體區塊的多個目標實體區段中的一第一目標實體區段。具體來說,所述寫入指令可以是從主機系統10所接收的寫入指令,或是用以更新/搬移/複製已經儲存在可複寫式非揮發性記憶體模組220的資料的指令。Please return to FIG. 2. In step S220, the processor 211 executes a write instruction, where the write instruction is used to instruct to store a data in one or more logical pages of the logical block, where the logical The block has been mapped to a target physical block of the plurality of physical blocks, wherein the one or more logical pages have been mapped to one or more target physical pages of the target physical block, and The one or more target entity pages belong to a first target entity section of the plurality of target entity sections of the target entity block. Specifically, the write command may be a write command received from the host system 10, or a command used to update/move/copy data stored in the rewritable non-volatile memory module 220.

在本實施例中,若所述寫入指令所對應的一或多個邏輯頁面所映射的一或多個實體頁面(亦稱,目標實體頁面)已經儲存有資料,處理器211會選擇其他實體頁面來儲存對應所述寫入指令的寫入資料,所述一或多個實體頁面所儲存的有效資料會成為無效資料,進而經由區塊管理電路單元215(或有效資料計數電路2151)更新/減少所述一或多個實體頁面的有效資料計數(基於所述一或多個實體頁面中成為無效資料的所有碼字的總數量)。In this embodiment, if one or more physical pages (also known as target physical pages) mapped by one or more logical pages corresponding to the write instruction already have data stored in them, the processor 211 will select another entity The page is used to store the write data corresponding to the write command. The valid data stored in the one or more physical pages will become invalid data, which is then updated by the block management circuit unit 215 (or the valid data counting circuit 2151). Reduce the valid data count of the one or more physical pages (based on the total number of all codewords that become invalid data in the one or more physical pages).

另一方面,若所述寫入指令所對應的一或多個邏輯頁面所映射的一或多個實體頁面(亦稱,目標實體頁面)是空白的(尚未儲存有資料),處理器211會直接使用所述一或多個目標實體頁面來儲存對應所述寫入指令的寫入資料,所述一或多個實體頁面所儲存的寫入資料會成為有效資料,並且經由區塊管理電路單元215(或有效資料計數電路2151)更新/增加所述一或多個實體頁面的有效資料計數(基於所述一或多個實體頁面中為有效資料的所有碼字的總數量)。另一方面,若所述寫入指令所對應的一或多個邏輯頁面尚未被映射至一或多個實體頁面,處理器211會選擇空白的一或多個目標實體面來儲存對應所述寫入指令的寫入資料,所述一或多個目標實體頁面所儲存的寫入資料會成為有效資料,並且經由區塊管理電路單元215(或有效資料計數電路2151)更新/增加所述一或多個目標實體頁面的有效資料計數(基於所述一或多個實體頁面中為有效資料的所有碼字的總數量)。例如,假設一個空白的目標實體頁面最多可儲存4個碼字。反應於被儲存在所述目標實體頁面的對應寫入指令的寫入資料剛好填滿所述目標實體頁面,所述目標實體頁面的有效資料計數會從0成為4。On the other hand, if one or more physical pages (also known as target physical pages) mapped to one or more logical pages corresponding to the write instruction are blank (no data is yet stored), the processor 211 will Directly use the one or more target physical pages to store the write data corresponding to the write command, the write data stored in the one or more physical pages will become valid data, and the block management circuit unit 215 (or effective data counting circuit 2151) updates/increases the effective data count of the one or more physical pages (based on the total number of all codewords that are valid data in the one or more physical pages). On the other hand, if the one or more logical pages corresponding to the write instruction has not been mapped to one or more physical pages, the processor 211 will select one or more blank target physical surfaces to store the corresponding one or more physical pages. The write data of the input command, the write data stored in the one or more target physical pages will become valid data, and the one or more will be updated/incremented through the block management circuit unit 215 (or the valid data counting circuit 2151) A count of valid data of multiple target physical pages (based on the total number of all codewords that are valid data in the one or more physical pages). For example, suppose a blank target entity page can store up to 4 codewords. In response to the write data of the corresponding write command stored in the target physical page just filling the target physical page, the effective data count of the target physical page will change from 0 to 4.

在步驟S230中,區塊管理電路單元215(或有效資料計數電路2151)根據所述寫入指令更新所述多個目標實體區段的多個目標區段有效資料計數中的對應所述第一目標實體區段的第一目標區段有效資料計數。In step S230, the block management circuit unit 215 (or the valid data counting circuit 2151) updates the valid data counts of the plurality of target physical segments corresponding to the first one of the valid data counts of the plurality of target physical segments according to the write instruction. The effective data count of the first target section of the target entity section.

接著,在步驟S240中,區塊管理電路單元215(或有效資料計數電路2151)根據已更新的所述第一目標區段有效資料計數來更新所述多個實體區塊的多個區塊有效資料計數中的對應所述目標實體區塊的目標區塊有效資料計數。Then, in step S240, the block management circuit unit 215 (or the effective data counting circuit 2151) updates the effective data of the plurality of physical blocks according to the updated effective data count of the first target section. The valid data count of the target block corresponding to the target physical block in the data count.

接著,在步驟S250中,區塊管理電路單元215(或有效區段管理電路2152)根據所述目標實體區塊的所述多個目標區段有效資料計數來更新所述多個實體區塊的多個有效區段計數中對應所述目標實體區塊的目標有效區段計數,其中所述多個有效區段計數各自用以記錄所對應的實體區塊的一或多個有效實體區段的總數量,其中所述一或多個有效實體區段各自的所述區段有效資料計數大於零。以下利用圖5A至5B來說明步驟S220~S250的細節。Then, in step S250, the block management circuit unit 215 (or the effective section management circuit 2152) updates the counts of the plurality of physical blocks according to the effective data counts of the plurality of target sections of the target physical block. A plurality of effective section counts corresponds to the target effective section count of the target physical block, wherein each of the plurality of effective section counts is used to record the number of one or more effective physical sections of the corresponding physical block The total number, wherein the segment valid data count of each of the one or more valid physical segments is greater than zero. The details of steps S220 to S250 are described below using FIGS. 5A to 5B.

圖5A至5B為根據本發明的一實施例所繪示的根據寫入指令來更新有效資料計數的示意圖。請參照圖5A,假設實體區塊50的多個實體頁面51(1)、51(2)、52(1)、52(2)、53(1)、53(2)、54(1)、54(2)已映射至邏輯頁面L51(1)、L51(2)、L52(1)、L52(2)、L53(1)、L53(2)、L54(1)、L54(2),並且實體頁面51(1)、51(2)中的多個碼字(亦稱,無效碼字)皆儲存無效資料;實體頁面52(1)、52(2)、53(1)、53(2)、54(1)、54(2)中的碼字(亦稱,有效碼字)皆儲存有效資料。此外,在此例子中,每2個實體頁面會被分組為1實體區段,如,實體頁面51(1)、51(2)被分組為實體區段51;實體頁面52(1)、52(2)被分組為實體區段52;實體頁面53(1)、53(2)被分組為實體區段53;實體頁面54(1)、54(2)被分組為實體區段54。5A to 5B are schematic diagrams of updating the valid data count according to a write command according to an embodiment of the present invention. Referring to FIG. 5A, suppose multiple physical pages 51(1), 51(2), 52(1), 52(2), 53(1), 53(2), 54(1), 54(2) has been mapped to logical pages L51(1), L51(2), L52(1), L52(2), L53(1), L53(2), L54(1), L54(2), and Multiple codewords (also known as invalid codewords) in physical pages 51(1) and 51(2) store invalid data; physical pages 52(1), 52(2), 53(1), 53(2) ), 54(1), 54(2) codewords (also known as valid codewords) store valid data. In addition, in this example, every two physical pages will be grouped into 1 physical section, for example, physical pages 51(1), 51(2) are grouped into physical section 51; physical pages 52(1), 52 (2) is grouped into a physical section 52; physical pages 53(1), 53(2) are grouped into a physical section 53; physical pages 54(1), 54(2) are grouped into a physical section 54.

基於每個實體頁面所具有的有效碼字的總數量,區塊管理電路單元215可以辨識出,實體頁面51(1)的有效資料計數為“0”;實體頁面51(2)的有效資料計數為“0”;實體頁面52(1)~54(2)的有效資料計數皆為“4”。此外,區塊管理電路單元215可計算出實體區段51中的所有的實體頁面51(1)~51(2)的有效資料計數的總和為“0”(如,0+0=0);實體區段52中的所有的實體頁面52(1)~52(2)的有效資料計數的總和為“8”(如,4+4=8);實體區段53中的所有的實體頁面53(1)~53(2)的有效資料計數的總和為“8”(如,4+4=8);實體區段54中的所有的實體頁面54(1)~54(2)的有效資料計數的總和為“8”(如,4+4=8)。Based on the total number of valid codewords in each physical page, the block management circuit unit 215 can recognize that the valid data count of the physical page 51(1) is "0"; the valid data count of the physical page 51(2) Is "0"; the valid data counts of physical pages 52(1) to 54(2) are all "4". In addition, the block management circuit unit 215 can calculate that the sum of the valid data counts of all the physical pages 51(1) to 51(2) in the physical section 51 is "0" (for example, 0+0=0); The sum of the valid data counts of all the physical pages 52(1)~52(2) in the physical section 52 is "8" (for example, 4+4=8); all the physical pages 53 in the physical section 53 (1)~53(2) The total of valid data counts is "8" (for example, 4+4=8); the valid data of all physical pages 54(1)~54(2) in the physical section 54 The sum of the counts is "8" (for example, 4+4=8).

接著,區塊管理電路單元215(或有效區段管理電路2152)更可辨識出對應於為“0”的區段有效資料計數的實體區段51為無效實體區段以及對應於為非“0”的區段有效資料計數的實體區段52~54為有效實體區段,並且區塊管理電路單元215會計算實體區塊50所具有的有效實體區段的總數量為有效區塊計數(如,對應於3個有效實體區段52~54的有效區塊計數為“3”)。此外,區塊管理電路單元215更可計算實體區塊50的所有實體區段51~54的所有區段有效資料計數的總和,以作為實體區塊50的區塊有效資料計數(如,0+8+8+8=24)。Then, the block management circuit unit 215 (or the effective section management circuit 2152) can further recognize that the physical section 51 corresponding to the section with a valid data count of "0" is an invalid physical section and corresponding to a non-"0". The physical sections 52 to 54 of the section valid data count are valid physical sections, and the block management circuit unit 215 will calculate the total number of valid physical sections of the physical block 50 as the effective block count (e.g. , The effective block count corresponding to the three effective physical segments 52-54 is "3"). In addition, the block management circuit unit 215 can further calculate the sum of the valid data counts of all the segments 51-54 of the physical block 50 as the block valid data counts of the physical block 50 (eg, 0+ 8+8+8=24).

在此例子中,處理器211執行寫入指令WC,並且如箭頭A51所示,所述對應於寫入指令WC的4個碼字(寫入資料)被寫入至邏輯頁面L52(1)。區塊管理電路單元215(或處理器211)可辨識映射至邏輯頁面L52(1)的實體頁面52(1)為目標實體頁面。In this example, the processor 211 executes the write command WC, and as indicated by the arrow A51, the 4 code words (write data) corresponding to the write command WC are written to the logical page L52(1). The block management circuit unit 215 (or the processor 211) can identify the physical page 52(1) mapped to the logical page L52(1) as the target physical page.

請參照圖5B,如箭頭A52所示,反應於邏輯頁面L52(1)已經儲存了對應寫入指令WC的4個碼字,區塊管理電路單元215(或處理器211)會辨識原本儲存在所述目標實體頁面52(1)中的4個碼字的資料成為無效資料,將目標實體頁面52(1)的有效資料計數減去4(目標實體頁面52(1)的有效資料計數會減為 “0”(即,4-4=0)),並且將實體區段52的區段有效資料計數從“8”更新為“4”(0+4=4)。此時,區塊管理電路單元215 (或有效區段管理電路2152)會基於所辨識的最新的實體區段51~54各自的區段有效資料計數來辨識出實體區塊50所具有的有效實體區段的總數量仍然為3個(具有大於“0”的區段有效資料計數的有效實體區段的總數量為“3“),即,有效區段計數為“3”。Please refer to FIG. 5B, as indicated by arrow A52, reflecting that the logical page L52(1) has stored 4 codewords corresponding to the write command WC, the block management circuit unit 215 (or the processor 211) will recognize that the original The data of the 4 code words in the target physical page 52(1) becomes invalid data, the valid data count of the target physical page 52(1) is subtracted by 4 (the valid data count of the target physical page 52(1) will be reduced Is “0” (ie, 4-4=0)), and the section effective data count of the physical section 52 is updated from “8” to “4” (0+4=4). At this time, the block management circuit unit 215 (or the effective section management circuit 2152) will identify the effective entity of the physical block 50 based on the section effective data count of the latest identified physical section 51-54. The total number of segments is still 3 (the total number of valid physical segments with a segment valid data count greater than "0" is "3"), that is, the valid segment count is "3".

在一實施例中,區塊管理電路單元215(或處理器211)可記錄對應所述多個實體區塊各自的多個區段有效資料計數與所述有效區段計數。例如,區塊管理電路單元215(或處理器211)將對應所述多個實體區塊各自的多個區段有效資料計數與所述有效區段計數記錄至一有效資料計數表中。In an embodiment, the block management circuit unit 215 (or the processor 211) can record the valid data counts and the valid sector counts of the respective multiple sections corresponding to the multiple physical blocks. For example, the block management circuit unit 215 (or the processor 211) records the effective data counts of the plurality of sections corresponding to the respective physical blocks and the effective section counts in a valid data count table.

圖6A為根據本發明的一實施例所繪示的記錄區段有效資料計數及有效區段計數的示意圖。請參照圖6A,如表T60所示,為了方便說明,假設可複寫式非揮發性記憶體模組220具有4個實體區塊50、60、70、80,每個實體區塊具有4個實體區段,每個實體區段具有2個實體頁面,並且每個實體頁面可儲存4個碼字(每個實體頁面的最大的有效資料計數為“4”,每個實體區段的最大的區段有效資料計數為“8”),並且表T60的每個條目對應至一個實體區段。FIG. 6A is a schematic diagram illustrating the effective data count and the effective section count of the recording section according to an embodiment of the present invention. Please refer to Figure 6A, as shown in Table T60, for the convenience of description, suppose that the rewritable non-volatile memory module 220 has 4 physical blocks 50, 60, 70, 80, and each physical block has 4 physical blocks. Section, each physical section has 2 physical pages, and each physical page can store 4 codewords (the maximum valid data count of each physical page is "4", the largest section of each physical section The section valid data count is "8"), and each entry in the table T60 corresponds to a physical section.

區塊管理電路單元215(或處理器211)可將所辨識/更新的實體區段51~84各自的區段有效資料計數記錄在表T60(亦稱,有效資料計數表)的一個欄位(亦稱,第一欄位),如表T60所記錄的對應實體區段51、52~83、84的區段有效資料計數“0”、“4”~“2”、“8”。此外,區塊管理電路單元215(或處理器211)更可將所辨識/更新的實體區塊50~80各自的有效區段計數記錄在表T60的另一個欄位(亦稱,第二欄位),如表T60所記錄的對應實體區塊50、60、70、80的有效區段計數“3”、“3”、“1”、“3”。The block management circuit unit 215 (or the processor 211) can record the effective data count of each of the identified/updated physical sections 51 to 84 in a field (also known as the effective data count table) of table T60 ( Also known as the first column), as recorded in Table T60, the valid data counts of the corresponding physical segments 51, 52 to 83, 84 are "0", "4" to "2", and "8". In addition, the block management circuit unit 215 (or the processor 211) may further record the effective section count of each of the identified/updated physical blocks 50-80 in another column of the table T60 (also known as the second column Bit), as recorded in table T60, the effective sector counts "3", "3", "1", and "3" of the corresponding physical blocks 50, 60, 70, and 80.

此外,在一實施例中,所述區塊管理電路單元215(或處理器211)也可基於所記錄的區段有效資料計數,來即時地計算實體區塊50~80各自的區塊有效資料計數。在另一實施例中,,所述區塊管理電路單元215(或處理器211)也可將所計算的實體區塊50~80各自的區塊有效資料計數記錄至另一欄位(亦稱,第三欄位)中。In addition, in one embodiment, the block management circuit unit 215 (or the processor 211) can also calculate the effective data of the respective physical blocks 50 to 80 in real time based on the recorded effective data count of the section. count. In another embodiment, the block management circuit unit 215 (or the processor 211) may also record the calculated effective data count of each of the physical blocks 50-80 in another field (also known as , The third column).

在本實施例中,經由圖2所提供的記憶體管理方法,可經由區塊管理電路單元215即時地獲得/更新每個實體區段的區段有效資料計數以及每個實體區塊的區塊有效資料計數與有效區段計數。處理器211更可用以根據所述多個區塊有效資料計數與所述多個有效區段計數來執行垃圾回收操作。也就是說,本發明的實施利索提供的垃圾回收操作,可藉由所述多個區塊有效資料計數與所述多個有效區段計數增進執行的效率(有效率地辨識回收實體區塊中的有效資料)。In this embodiment, through the memory management method provided in FIG. 2, the block management circuit unit 215 can instantly obtain/update the section effective data count of each physical block and the block of each physical block. Valid data count and valid section count. The processor 211 can further be used to perform a garbage collection operation according to the valid data counts of the plurality of blocks and the valid section counts. That is to say, the garbage collection operation provided by the implementation of the present invention can improve the efficiency of execution through the effective data counts of the multiple blocks and the multiple effective segment counts (effectively identify the physical blocks in the recycling Valid information).

圖3是根據本發明的一實施例所繪示的垃圾回收操作的流程圖。請參照圖3,在步驟S310中,區塊管理電路單元215(或處理器211)可根據回收區塊有效資料計數門檻值與所述多個區塊有效資料計數來選擇所述多個實體區塊中的多個回收實體區塊。所述多個區塊有效資料計數各自用以記錄所屬的實體區塊的所有的有效實體區段各自的所述區段有效資料計數的總和,並且所述區段有效資料計數用以記錄儲存在所屬的實體區段的所有的實體頁面中的所有的有效碼字的總數量。其中,所述多個回收實體區塊各自的所述區塊有效資料計數皆小於所述回收區塊有效資料計數門檻值。Fig. 3 is a flowchart of a garbage collection operation according to an embodiment of the present invention. 3, in step S310, the block management circuit unit 215 (or the processor 211) may select the multiple physical areas according to the reclaimed block effective data count threshold and the multiple block effective data counts Multiple recycled physical blocks in the block. Each of the plurality of block effective data counts is used to record the sum of the respective section effective data counts of all the effective physical sections of the physical block to which they belong, and the section effective data count is used to record and store in The total number of all valid codewords in all the physical pages of the physical section to which it belongs. Wherein, the effective data count of each of the plurality of recycled physical blocks is less than the effective data count threshold value of the recycled block.

接著,在步驟S320中,區塊管理電路單元215(或處理器211)可根據所述多個回收實體區塊各自的所述有效區段計數,由小至大,來排序所述多個回收實體區塊。Then, in step S320, the block management circuit unit 215 (or the processor 211) may sort the multiple reclaimed blocks according to the effective section count of each of the multiple reclaimed physical blocks, from small to large. Physical block.

接著,在步驟S330中,處理器211可根據已排序的所述多個回收實體區塊執行所述垃圾回收操作,其中在已排序的所述多個回收實體區塊中的被排序在最前方的第一回收實體區塊會最先被所述處理器211執行所述垃圾回收操作。Then, in step S330, the processor 211 may perform the garbage collection operation according to the sorted plurality of reclaimed physical blocks, wherein the sorted plurality of reclaimed physical blocks are sorted at the forefront The first reclaimed physical block of is the first to be executed by the processor 211 for the garbage collection operation.

具體來說,所述處理器211僅檢查在所述第一回收實體區塊的一或多個第一有效實體區段中是否儲存有效資料,並且辨識所述有效資料的實體位址,以搬移所述有效資料。在一實施例中,所述處理器211不檢查在所述第一回收實體區塊中非所述一或多個第一有效實體區段的一或多個第二有效實體區段中是否儲存所述有效資料。如此一來,因為僅經由邏輯轉實體位址映射表與實體轉邏輯位址映射表來檢查一或多個第一有效實體區段的實體頁面與邏輯頁面的映射關係以確認一或多個第一有效實體區段中的有效資料的實體位址,可大量地節省所耗費的時間(因為不需要檢查第一回收實體區塊中的無效實體區段,而避免耗費檢查第一回收實體區塊中的全部的實體區段的大量時間)。Specifically, the processor 211 only checks whether valid data is stored in one or more first valid physical sections of the first recovered physical block, and identifies the physical address of the valid data to move The valid information. In an embodiment, the processor 211 does not check whether the storage is stored in one or more second valid physical sections other than the one or more first valid physical sections in the first reclaimed physical block. The valid information. As a result, it is only through the logical to physical address mapping table and the physical to logical address mapping table to check the mapping relationship between the physical page and the logical page of the one or more first effective physical sections to confirm the one or more second The physical address of the valid data in a valid physical section can save a lot of time (because there is no need to check the invalid physical section in the first reclaimed physical block, and avoid the cost of checking the first reclaimed physical block. A lot of time for all the physical sections in).

以下利用圖6B來說明步驟S310~S330的細節。The details of steps S310 to S330 are described below using FIG. 6B.

圖6B為根據本發明的一實施例所繪示的根據區塊有效資料計數與有效區段計數來選擇且排序多個回收實體區塊的示意圖。請參照圖6B,假設回收區塊有效資料計數門檻值為“14”。延續圖6A的例子,如箭頭A61所示,區塊管理電路單元215(或處理器211)可根據回收區塊有效資料計數門檻值“14”與對應實體區塊50、60、70、80的多個區塊有效資料計數“21”、“7”、“7”、“13”來選擇小於回收區塊有效資料計數門檻值“14”的區塊有效資料計數“7”、“7”、“13”所對應的實體區塊60、70、80作為多個回收實體區塊(步驟S310)。接著,如箭頭A62所示,區塊管理電路單元215(或處理器211)可根據對應實體區塊60、70、80的多個有效區塊計數“3”、“1”、“3”來由小至大排序回收實體區塊60、70、80(步驟S320)為已排序的多個回收實體區塊70、60、80。已排序的多個回收實體區塊70、60、80可被識別/加入為垃圾回收佇列,依據回收順序/排列順序,垃圾回收佇列中的回收實體區塊為實體區塊70、實體區塊60、實體區塊80。FIG. 6B is a schematic diagram of selecting and sorting a plurality of reclaimed physical blocks according to the effective data count of the block and the effective section count according to an embodiment of the present invention. Please refer to Figure 6B, assuming that the valid data count threshold of the recovered block is "14". Continuing the example of FIG. 6A, as shown by arrow A61, the block management circuit unit 215 (or the processor 211) can count the threshold value "14" according to the effective data of the recovered block and the corresponding physical block 50, 60, 70, 80. Multiple block valid data counts "21", "7", "7", "13" to select block valid data counts "7", "7", "7", "7", "7", The physical blocks 60, 70, and 80 corresponding to "13" are used as multiple reclaimed physical blocks (step S310). Then, as shown by arrow A62, the block management circuit unit 215 (or the processor 211) can count "3", "1", and "3" according to the multiple valid block counts corresponding to the physical blocks 60, 70, and 80. The reclaimed physical blocks 60, 70, and 80 are sorted from small to large (step S320) into a plurality of reclaimed physical blocks 70, 60, 80 that have been sorted. Sorted multiple recycling physical blocks 70, 60, 80 can be identified/added as garbage collection queue. According to the recycling order/arrangement order, the recycled physical blocks in the garbage collection queue are physical block 70 and physical area Block 60, physical block 80.

處理器211可根據已排序的多個回收實體區塊70、60、80,依序執行垃圾回收操作(步驟S330)。例如,如箭頭A63所示,在已排序的多個回收實體區塊70、60、80中,回收實體區塊70會先被執行垃圾回收操作。此外,參見表T60,處理器211可經由識別回收實體區塊70中的有效實體區段與無效實體區段,僅檢查回收實體區塊70中的實體區段74(有效實體區段)是否儲存有效資料(不檢查無效實體區段71~73)。The processor 211 may sequentially perform garbage collection operations according to the sorted multiple recycling physical blocks 70, 60, and 80 (step S330). For example, as indicated by the arrow A63, among the sorted multiple reclaimed physical blocks 70, 60, 80, the reclaimed physical block 70 will first be subjected to a garbage collection operation. In addition, referring to Table T60, the processor 211 may only check whether the physical section 74 (valid physical section) in the reclaimed physical block 70 is stored by identifying the valid physical section and the invalid physical section in the reclaimed physical block 70 Valid data (do not check invalid entity section 71-73).

值得一提的是,在本實施例中,每個實體區塊的有效區段計數也可以用來表示所對應的實體區塊所具有的有效資料的集中度。簡單來說,具有越小的有效區段計數的實體區塊所具有的有效資料的集中度越高;具有越大的有效區段計數的實體區塊所具有的有效資料的集中度越低。利用此概念,本實施例所提供的記憶體管理方法可根據有效區段計數來對所有的回收實體區塊進行排序,以有效地依據所有的回收實體區塊的集中度來決定對所有的回收實體區塊所執行的垃圾回收操作的順序。如此一來,即使兩個回收實體區塊(如,回收實體區塊60、70)的區塊有效資料計數相等,處理器211也可依據兩個回收實體區塊的有效資料的集中度(有效區段計數)來先選擇集中度較高(有效區段計數較小)的回收實體區塊(如,回收實體區塊70)以執行垃圾回收操作,進而可因僅檢查較少的有效實體區段,而較快地辨識於其內的有效資料的實體位址,達到快速地回收此回收實體區塊的功效。It is worth mentioning that in this embodiment, the effective section count of each physical block can also be used to indicate the concentration of the effective data of the corresponding physical block. To put it simply, a physical block with a smaller effective section count has a higher concentration of effective data; a physical block with a larger effective section count has a lower concentration of effective data. Using this concept, the memory management method provided by this embodiment can sort all reclaimed physical blocks according to the effective sector count, so as to effectively determine the recovery of all reclaimed physical blocks based on the concentration of all reclaimed physical blocks. The sequence of garbage collection operations performed by the physical block. In this way, even if the effective data counts of the two reclaimed physical blocks (for example, reclaimed physical blocks 60 and 70) are equal, the processor 211 can also rely on the concentration of the effective data of the two reclaimed physical blocks (effective Section count) to first select the reclaimed physical block with higher concentration (smaller effective section count) (for example, recycle physical block 70) to perform the garbage collection operation, so that only fewer effective physical areas are checked Segment, and quickly identify the physical address of the valid data in it, so as to achieve the effect of quickly recovering the reclaimed physical block.

綜上所述,本發明的實施例所提供的儲存控制器、記憶體管理方法以及儲存裝置,可將可複寫式非揮發性記憶體模組的多個實體區塊中的每一個實體區塊的所述多個實體頁面分組至多個實體區段,根據所述寫入指令更新對應的區段有效資料計數、對應的有效資料計數以及對應的有效區段計數,以利用所述區塊有效資料計數與所述有效區段計數來選擇且排序多個回收實體區塊,以依據有效資料的集中度來依序對所述多個垃圾實體區塊執行垃圾回收操作,進而有效率地釋放出可複寫式非揮發性記憶體模組的空間而增進了儲存裝置的整體存取效能。In summary, the storage controller, memory management method, and storage device provided by the embodiments of the present invention can store each of the multiple physical blocks of the rewritable non-volatile memory module The multiple physical pages are grouped into multiple physical sections, and the corresponding section valid data count, the corresponding valid data count, and the corresponding valid section count are updated according to the write command, so as to utilize the block valid data Count and the effective section count to select and sort a plurality of reclaimed physical blocks, so as to sequentially perform garbage collection operations on the plurality of garbage physical blocks according to the concentration of valid data, and then release the recyclable blocks efficiently. The space of the copy-type non-volatile memory module improves the overall access performance of the storage device.

10:主機系統 20:儲存裝置 110、211:處理器 120:主機記憶體 130:資料傳輸介面電路 210:儲存控制器 212:資料管理電路 213:記憶體介面控制電路 214:錯誤檢查與校正電路 215:區塊管理電路單元 2151:有效資料計數電路 2152:有效區段管理電路 216:緩衝記憶體 217:電源管理電路 220:可複寫式非揮發性記憶體模組 230:連接介面電路 S210、S220、S230、S240、S250:記憶體管理方法的流程步驟 S310、S320、S330:垃圾回收操作的流程步驟 CW(1)~CW(M):碼字 WC:寫入指令 P(1)~P(NP)、51(1)~54(2):實體頁面 B(1)~B(Q)、50、60、70、80:實體區塊 S(1)、S(2)~S(N)、51、52、53、54:實體區段 L51(1)~L54(2):邏輯頁面 A51、A52、A61、A62、A63:箭頭 T60:表10: Host system 20: storage device 110, 211: processor 120: host memory 130: data transmission interface circuit 210: storage controller 212: Data Management Circuit 213: Memory Interface Control Circuit 214: Error checking and correction circuit 215: block management circuit unit 2151: Effective data counting circuit 2152: Effective section management circuit 216: buffer memory 217: Power Management Circuit 220: rewritable non-volatile memory module 230: connection interface circuit S210, S220, S230, S240, S250: Process steps of the memory management method S310, S320, S330: process steps of garbage collection operations CW(1)~CW(M): codeword WC: write command P(1)~P(NP), 51(1)~54(2): physical page B(1)~B(Q), 50, 60, 70, 80: physical block S(1), S(2)~S(N), 51, 52, 53, 54: physical section L51(1)~L54(2): Logic page A51, A52, A61, A62, A63: Arrow T60: table

圖1是根據本發明的一實施例所繪示的主機系統及儲存裝置的方塊示意圖。 圖2是根據本發明的一實施例所繪示的記憶體管理方法的流程圖。 圖3是根據本發明的一實施例所繪示的垃圾回收操作的流程圖。 圖4A是根據本發明的一實施例所繪示的碼字、實體頁面、實體區塊與可複寫式非揮發性記憶體模組的示意圖。 圖4B是根據本發明的一實施例所繪示的分組實體區塊的多個實體頁面為多個實體區段的示意圖。 圖5A至5B為根據本發明的一實施例所繪示的根據寫入指令來更新有效資料計數的示意圖。 圖6A為根據本發明的一實施例所繪示的記錄區段有效資料計數及有效區段計數的示意圖。 圖6B為根據本發明的一實施例所繪示的根據區塊有效資料計數與有效區段計數來選擇且排序多個回收實體區塊的示意圖。FIG. 1 is a block diagram of a host system and a storage device according to an embodiment of the invention. FIG. 2 is a flowchart of a memory management method according to an embodiment of the invention. Fig. 3 is a flowchart of a garbage collection operation according to an embodiment of the present invention. 4A is a schematic diagram of a codeword, a physical page, a physical block, and a rewritable non-volatile memory module according to an embodiment of the present invention. FIG. 4B is a schematic diagram illustrating that multiple physical pages of a grouped physical block are multiple physical sections according to an embodiment of the present invention. 5A to 5B are schematic diagrams of updating the valid data count according to a write command according to an embodiment of the present invention. FIG. 6A is a schematic diagram illustrating the effective data count and the effective section count of the recording section according to an embodiment of the present invention. FIG. 6B is a schematic diagram of selecting and sorting a plurality of reclaimed physical blocks according to the effective data count of the block and the effective section count according to an embodiment of the present invention.

S210、S220、S230、S240、S250:記憶體管理方法的流程步驟S210, S220, S230, S240, S250: Process steps of the memory management method

Claims (15)

一種儲存控制器,用於控制配置有一可複寫式非揮發性記憶體模組的一儲存裝置,所述儲存控制器包括: 一連接介面電路,用以耦接至一主機系統; 一記憶體介面控制電路,用以耦接至所述可複寫式非揮發性記憶體模組,其中所述可複寫式非揮發性記憶體模組具有多個實體區塊,並且所述多個實體區塊各自具有多個實體頁面; 一區塊管理電路單元,以及 一處理器,耦接至所述連接介面電路、所述記憶體介面控制電路及所述區塊管理電路單元, 其中所述區塊管理電路單元用以將所述多個實體區塊中的每一個實體區塊的所述多個實體頁面分組至多個實體區段, 其中所述處理器用以執行一寫入指令,其中所述寫入指令用以指示儲存一資料至一或多個邏輯頁面中,其中所述一或多個邏輯頁面已被映射至一目標實體區塊的一或多個目標實體頁面,並且所述一或多個目標實體頁面屬於所述目標實體區塊的多個目標實體區段中的一第一目標實體區段, 其中所述區塊管理電路單元更用以根據所述寫入指令更新所述多個目標實體區段的多個目標區段有效資料計數中的對應所述第一目標實體區段的第一目標區段有效資料計數, 其中所述區塊管理電路單元更用以根據已更新的所述第一目標區段有效資料計數來更新所述多個實體區塊的多個區塊有效資料計數中的對應所述目標實體區塊的目標區塊有效資料計數, 其中所述區塊管理電路單元更用以根據所述目標實體區塊的所述多個目標區段有效資料計數來更新所述多個實體區塊的多個有效區段計數中對應所述目標實體區塊的目標有效區段計數,其中所述多個有效區段計數各自用以記錄所對應的實體區塊的一或多個有效實體區段的總數量,其中所述一或多個有效實體區段各自的所述區段有效資料計數大於零。A storage controller for controlling a storage device equipped with a rewritable non-volatile memory module, the storage controller comprising: A connection interface circuit for coupling to a host system; A memory interface control circuit for coupling to the rewritable non-volatile memory module, wherein the rewritable non-volatile memory module has a plurality of physical blocks, and the plurality of Each physical block has multiple physical pages; A block management circuit unit, and A processor coupled to the connection interface circuit, the memory interface control circuit and the block management circuit unit, The block management circuit unit is used for grouping the plurality of physical pages of each of the plurality of physical blocks into a plurality of physical sections, The processor is used to execute a write instruction, wherein the write instruction is used to instruct to store a data in one or more logical pages, wherein the one or more logical pages have been mapped to a target physical area One or more target physical pages of a block, and the one or more target physical pages belong to a first target physical section of a plurality of target physical sections of the target physical block, The block management circuit unit is further configured to update the first target corresponding to the first target physical section among the valid data counts of the plurality of target physical sections of the plurality of target physical sections according to the write instruction Count of valid data in the segment, The block management circuit unit is further configured to update the corresponding target physical area in the plurality of block effective data counts of the plurality of physical blocks according to the updated effective data count of the first target section The effective data count of the target block of the block, The block management circuit unit is further configured to update the valid data counts of the plurality of physical blocks corresponding to the target according to the valid data counts of the plurality of target segments of the target physical block The target effective section count of the physical block, wherein each of the plurality of effective section counts is used to record the total number of one or more effective physical sections of the corresponding physical block, wherein the one or more effective sections are The valid data count of the respective physical segments is greater than zero. 如申請專利範圍第1項所述的儲存控制器,其中所述處理器更用以根據所述多個區塊有效資料計數與所述多個有效區段計數來執行垃圾回收操作。According to the storage controller described in claim 1, wherein the processor is further configured to perform a garbage collection operation according to the valid data counts of the plurality of blocks and the valid section counts. 如申請專利範圍第2項所述的儲存控制器,其中在所述根據所述多個區塊有效資料計數與所述多個有效區段計數來執行垃圾回收操作的運作中, 所述區塊管理電路單元根據回收區塊有效資料計數門檻值與所述多個區塊有效資料計數來選擇所述多個實體區塊中的多個回收實體區塊,其中所述多個區塊有效資料計數各自用以記錄所屬的實體區塊的所有的有效實體區段各自的所述區段有效資料計數的總和,並且所述區段有效資料計數用以記錄儲存在所屬的實體區段的所有的實體頁面中的所有的有效碼字的總數量, 其中所述多個回收實體區塊各自的所述區塊有效資料計數皆小於所述回收區塊有效資料計數門檻值。The storage controller according to claim 2, wherein in the operation of executing the garbage collection operation according to the valid data counts of the plurality of blocks and the valid section counts, The block management circuit unit selects a plurality of recycled physical blocks of the plurality of physical blocks according to the effective data count threshold value of the recycled blocks and the plurality of effective data counts of the plurality of blocks, wherein the plurality of regions The block valid data counts are used to record the sum of the respective section valid data counts of all the valid physical sections of the physical block to which they belong, and the section valid data counts are used to record and store in the physical section to which they belong The total number of all valid codewords in all physical pages of The effective data count of each of the plurality of recycled physical blocks is less than the effective data count threshold value of the recycled block. 如申請專利範圍第3項所述的儲存控制器,其中在所述根據所述多個區塊有效資料計數與所述多個有效區段計數來執行垃圾回收操作的運作中, 所述區塊管理電路單元根據所述多個回收實體區塊各自的所述有效區段計數,由小至大,來排序所述多個回收實體區塊, 其中所述處理器根據已排序的所述多個回收實體區塊執行所述垃圾回收操作,其中在已排序的所述多個回收實體區塊中的被排序在最前方的第一回收實體區塊會最先被所述處理器執行所述垃圾回收操作。The storage controller according to item 3 of the scope of patent application, wherein in the operation of executing the garbage collection operation based on the valid data counts of the plurality of blocks and the valid section counts, The block management circuit unit sorts the multiple reclaimed physical blocks from small to large according to the effective section count of each of the multiple reclaimed physical blocks, The processor executes the garbage collection operation according to the sorted multiple reclaimed physical blocks, and among the sorted multiple reclaimed physical blocks, the first reclaimed physical area that is sorted at the forefront The block will be the first to be executed by the processor for the garbage collection operation. 如申請專利範圍第4項所述的儲存控制器,其中在對已排序的所述多個回收實體區塊中的所述第一回收實體區塊所執行的所述垃圾回收操作中, 所述處理器僅檢查在所述第一回收實體區塊的一或多個第一有效實體區段中是否儲存有效資料,並且辨識所述有效資料的實體位址,以搬移所述有效資料。The storage controller according to item 4 of the scope of patent application, wherein in the garbage collection operation performed on the first reclaimed physical block among the sorted reclaimed physical blocks, The processor only checks whether valid data is stored in one or more first valid physical sections of the first recovered physical block, and recognizes the physical address of the valid data to move the valid data. 如申請專利範圍第5項所述的儲存控制器,其中在對已排序的所述多個回收實體區塊中的所述第一回收實體區塊所執行的所述垃圾回收操作中, 所述處理器不檢查在所述第一回收實體區塊中非所述一或多個第一有效實體區段的一或多個第一無效實體區段中是否儲存所述有效資料,其中所述一或多個第一無效實體區段各自的區段有效資料計數為零。The storage controller according to item 5 of the scope of patent application, wherein in the garbage collection operation performed on the first reclaimed physical block of the sorted reclaimed physical blocks, The processor does not check whether the valid data is stored in one or more first invalid physical sections other than the one or more first valid physical sections in the first recovered physical block, wherein The section valid data count of each of the one or more first invalid physical sections is zero. 如申請專利範圍第1項所述的儲存控制器,其中 所述區塊管理電路單元記錄對應所述多個實體區塊各自的多個區段有效資料計數與所述有效區段計數至一有效資料計數表中, 其中所述有效資料計數表包括分別對應所述多個實體單元各自的所述多個實體區段的多個條目,其中所述多個條目各自包括第一欄位與第二欄位, 其中所述第一欄位用以記錄所對應的所述實體區段的所述區段有效資料計數,並且所述第二欄位用以記錄所對應的所述實體區段的所述有效區段計數。The storage controller as described in item 1 of the scope of patent application, wherein The block management circuit unit records the effective data counts of the plurality of sections corresponding to each of the plurality of physical blocks and the effective section counts into a valid data count table, The valid data count table includes a plurality of entries corresponding to the plurality of physical sections of the plurality of physical units, wherein each of the plurality of entries includes a first field and a second field, The first field is used to record the effective data count of the corresponding physical section, and the second field is used to record the effective area of the corresponding physical section Segment count. 一種記憶體管理方法,適用於用以控制配置有一可複寫式非揮發性記憶體模組的一儲存裝置的儲存控制器,其中所述可複寫式非揮發性記憶體模組具有多個實體區塊,並且所述多個實體區塊各自具有多個實體頁面,所述方法包括: 將所述多個實體區塊中的每一個實體區塊的所述多個實體頁面分組至多個實體區段; 執行一寫入指令,其中所述寫入指令用以指示儲存一資料至一或多個邏輯頁面中,其中所述一或多個邏輯頁面已被映射至一目標實體區塊的一或多個目標實體頁面,並且所述一或多個目標實體頁面屬於所述目標實體區塊的多個目標實體區段中的一第一目標實體區段; 根據所述寫入指令更新所述多個目標實體區段的多個目標區段有效資料計數中的對應所述第一目標實體區段的第一目標區段有效資料計數; 根據已更新的所述第一目標區段有效資料計數來更新所述多個實體區塊的多個區塊有效資料計數中的對應所述目標實體區塊的目標區塊有效資料計數;以及 根據所述目標實體區塊的所述多個目標區段有效資料計數來更新所述多個實體區塊的多個有效區段計數中對應所述目標實體區塊的目標有效區段計數,其中所述多個有效區段計數各自用以記錄所對應的實體區塊的一或多個有效實體區段的總數量,其中所述一或多個有效實體區段各自的所述區段有效資料計數大於零。A memory management method is suitable for a storage controller used to control a storage device equipped with a rewritable non-volatile memory module, wherein the rewritable non-volatile memory module has multiple physical areas Block, and each of the plurality of physical blocks has a plurality of physical pages, the method includes: Grouping the plurality of physical pages of each of the plurality of physical blocks into a plurality of physical sections; Execute a write command, wherein the write command is used to instruct to store a data in one or more logical pages, wherein the one or more logical pages have been mapped to one or more of a target physical block A target entity page, and the one or more target entity pages belong to a first target entity section of a plurality of target entity sections of the target entity block; Updating the valid data count of the first target segment corresponding to the first target physical segment among the valid data counts of the plural target segment of the plural target physical segments according to the write instruction; Updating the effective data count of the target block corresponding to the target physical block among the plurality of block effective data counts of the plurality of physical blocks according to the updated effective data count of the first target section; and According to the valid data counts of the multiple target segments of the target physical block, the target valid segment counts of the multiple valid segment counts of the multiple physical blocks corresponding to the target physical block are updated, wherein Each of the plurality of valid segment counts is used to record the total number of one or more valid physical segments of the corresponding physical block, wherein the segment valid data of each of the one or more valid physical segments The count is greater than zero. 如申請專利範圍第8項所述的記憶體管理方法,更包括: 根據所述多個區塊有效資料計數與所述多個有效區段計數來執行垃圾回收操作。The memory management method described in item 8 of the scope of patent application includes: The garbage collection operation is performed according to the valid data counts of the plurality of blocks and the valid section counts. 如申請專利範圍第9項所述的記憶體管理方法,其中所述根據所述多個區塊有效資料計數與所述多個有效區段計數來執行垃圾回收操作的步驟包括: 根據回收區塊有效資料計數門檻值與所述多個區塊有效資料計數來選擇所述多個實體區塊中的多個回收實體區塊,其中所述多個區塊有效資料計數各自用以記錄所屬的實體區塊的所有的有效實體區段各自的所述區段有效資料計數的總和,並且所述區段有效資料計數用以記錄儲存在所屬的實體區段的所有的實體頁面中的所有的有效碼字的總數量, 其中所述多個回收實體區塊各自的所述區塊有效資料計數皆小於所述回收區塊有效資料計數門檻值。The memory management method according to claim 9 of the scope of patent application, wherein the step of performing a garbage collection operation according to the valid data counts of the plurality of blocks and the valid section counts includes: According to the reclamation block effective data count threshold value and the plurality of block effective data counts, a plurality of reclamation physical blocks of the plurality of physical blocks are selected, wherein each of the plurality of block effective data counts is used The record is the sum of the effective data counts of the respective sections of all the effective physical sections of the physical block to which it belongs, and the effective data counts of the sections are used to record the data stored in all the physical pages of the physical section to which they belong The total number of all valid codewords, The effective data count of each of the plurality of recycled physical blocks is less than the effective data count threshold value of the recycled block. 如申請專利範圍第10項所述的記憶體管理方法,其中所述根據所述多個區塊有效資料計數與所述多個有效區段計數來執行垃圾回收操作的步驟更包括: 根據所述多個回收實體區塊各自的所述有效區段計數,由小至大,來排序所述多個回收實體區塊; 根據已排序的所述多個回收實體區塊執行所述垃圾回收操作, 其中在已排序的所述多個回收實體區塊中的被排序在最前方的第一回收實體區塊會最先被所述處理器執行所述垃圾回收操作。The memory management method according to claim 10, wherein the step of performing a garbage collection operation according to the valid data counts of the plurality of blocks and the valid section counts further includes: Sort the multiple reclaimed physical blocks according to the effective section count of each of the multiple reclaimed physical blocks, from small to large; Execute the garbage collection operation according to the sorted multiple reclaimed physical blocks, The first reclaimed physical block sorted at the forefront among the sorted reclaimed physical blocks is the first to be executed by the processor for the garbage collection operation. 如申請專利範圍第11項所述的記憶體管理方法,其中對所述第一回收實體區塊所執行的所述垃圾回收操作包括: 僅檢查在所述第一回收實體區塊的一或多個第一有效實體區段中是否儲存有效資料,並且辨識所述有效資料的實體位址,以搬移所述有效資料。The memory management method as described in item 11 of the scope of patent application, wherein the garbage collection operation performed on the first reclaimed physical block includes: Only check whether valid data is stored in one or more first valid physical sections of the first recovered physical block, and identify the physical address of the valid data to move the valid data. 如申請專利範圍第12項所述的記憶體管理方法,其中對所述第一回收實體區塊所執行的所述垃圾回收操作更包括: 不檢查在所述第一回收實體區塊中非所述一或多個第一有效實體區段的一或多個第一無效實體區段中是否儲存所述有效資料,其中所述一或多個第一無效實體區段各自的區段有效資料計數為零。The memory management method as described in item 12 of the scope of patent application, wherein the garbage collection operation performed on the first reclaimed physical block further includes: It is not checked whether the valid data is stored in one or more first invalid physical sections other than the one or more first valid physical sections in the first recycled physical block, wherein the one or more The valid data count of each of the first invalid physical segments is zero. 如申請專利範圍第8項所述的記憶體管理方法,更包括: 記錄對應所述多個實體區塊各自的多個區段有效資料計數與所述有效區段計數至一有效資料計數表中, 其中所述有效資料計數表包括分別對應所述多個實體單元各自的所述多個實體區段的多個條目,其中所述多個條目各自包括第一欄位與第二欄位, 其中所述第一欄位用以記錄所對應的所述實體區段的所述區段有效資料計數,並且所述第二欄位用以記錄所對應的所述實體區段的所述有效區段計數。The memory management method described in item 8 of the scope of patent application further includes: Recording the valid data counts of the plurality of sections corresponding to the respective physical blocks and the valid section counts into a valid data count table, The valid data count table includes a plurality of entries corresponding to the plurality of physical sections of the plurality of physical units, wherein each of the plurality of entries includes a first field and a second field, The first field is used to record the effective data count of the corresponding physical section, and the second field is used to record the effective area of the corresponding physical section Segment count. 一種儲存裝置,所述儲存裝置包括: 一可複寫式非揮發性記憶體模組,其中所述可複寫式非揮發性記憶體模組具有多個實體區塊,並且所述多個實體區塊各自具有多個實體頁面;以及 一儲存控制器,耦接至所述可複寫式非揮發性記憶體模組, 其中所述儲存控制器用以將所述多個實體區塊中的每一個實體區塊的所述多個實體頁面分組至多個實體區段, 其中所述儲存控制器更用以執行一寫入指令,其中所述寫入指令用以指示儲存一資料至一或多個邏輯頁面中,其中所述一或多個邏輯頁面已被映射至一目標實體區塊的一或多個目標實體頁面,並且所述一或多個目標實體頁面屬於所述目標實體區塊的多個目標實體區段中的一第一目標實體區段, 其中所述儲存控制器更用以根據所述寫入指令更新所述多個目標實體區段的多個目標區段有效資料計數中的對應所述第一目標實體區段的第一目標區段有效資料計數, 其中所述儲存控制器更用以根據已更新的所述第一目標區段有效資料計數來更新所述多個實體區塊的多個區塊有效資料計數中的對應所述目標實體區塊的目標區塊有效資料計數, 其中所述儲存控制器更用以根據所述目標實體區塊的所述多個目標區段有效資料計數來更新所述多個實體區塊的多個有效區段計數中對應所述目標實體區塊的目標有效區段計數,其中所述多個有效區段計數各自用以記錄所對應的實體區塊的一或多個有效實體區段的總數量,其中所述一或多個有效實體區段各自的所述區段有效資料計數大於零。A storage device, the storage device comprising: A rewritable non-volatile memory module, wherein the rewritable non-volatile memory module has a plurality of physical blocks, and each of the plurality of physical blocks has a plurality of physical pages; and A storage controller coupled to the rewritable non-volatile memory module, Wherein the storage controller is used for grouping the plurality of physical pages of each of the plurality of physical blocks into a plurality of physical sections, The storage controller is further used to execute a write command, wherein the write command is used to instruct to store a data in one or more logical pages, wherein the one or more logical pages have been mapped to a One or more target physical pages of the target physical block, and the one or more target physical pages belong to a first target physical section of the plurality of target physical sections of the target physical block, The storage controller is further configured to update the first target section corresponding to the first target physical section in the valid data counts of the plurality of target section of the plurality of target physical sections according to the write instruction Valid data count, The storage controller is further configured to update the effective data count of the plurality of physical blocks corresponding to the target physical block according to the updated effective data count of the first target section The effective data count of the target block, The storage controller is further configured to update the valid data counts of the plurality of physical blocks corresponding to the target physical area according to the valid data counts of the plurality of target segments of the target physical block The target effective section count of the block, wherein each of the plurality of effective section counts is used to record the total number of one or more effective physical sections of the corresponding physical block, wherein the one or more effective physical sections The segment valid data count of each segment is greater than zero.
TW108145546A 2019-12-12 2019-12-12 Storage controller, memory management method, and storage device TWI762843B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW108145546A TWI762843B (en) 2019-12-12 2019-12-12 Storage controller, memory management method, and storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW108145546A TWI762843B (en) 2019-12-12 2019-12-12 Storage controller, memory management method, and storage device

Publications (2)

Publication Number Publication Date
TW202123016A true TW202123016A (en) 2021-06-16
TWI762843B TWI762843B (en) 2022-05-01

Family

ID=77516844

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108145546A TWI762843B (en) 2019-12-12 2019-12-12 Storage controller, memory management method, and storage device

Country Status (1)

Country Link
TW (1) TWI762843B (en)

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI642059B (en) * 2017-06-02 2018-11-21 群聯電子股份有限公司 Memory management method, memory control circuit unit and memory storage apparatus

Also Published As

Publication number Publication date
TWI762843B (en) 2022-05-01

Similar Documents

Publication Publication Date Title
US10713178B2 (en) Mapping table updating method, memory controlling circuit unit and memory storage device
US9940189B2 (en) Method and system for data rebuilding and memory control circuit unit thereof
US10303367B2 (en) Mapping table updating method without updating the first mapping information, memory control circuit unit and memory storage device
US10642731B2 (en) Memory management method and storage controller
CN109491588B (en) Memory management method, memory control circuit unit and memory storage device
CN107590080B (en) Mapping table updating method, memory control circuit unit and memory storage device
TW202040370A (en) Data writing method, memory controlling circuit unit and memory storage device
US8966344B2 (en) Data protecting method, memory controller and memory storage device
US9983805B1 (en) Memory management method, memory control circuit unit and memory storage apparatus
US9778862B2 (en) Data storing method for preventing data losing during flush operation, memory control circuit unit and memory storage apparatus
TWI548991B (en) Memory management method, memory control circuit unit and memory storage apparatus
CN112860193B (en) Sorting instruction processing method, memory control circuit unit and memory device
CN112051971B (en) Data merging method, memory storage device and memory control circuit unit
CN109273033B (en) Memory management method, memory control circuit unit and memory storage device
CN111737165B (en) Memory control method, memory storage device and memory control circuit unit
CN107204205B (en) Memory management method, memory control circuit unit and memory storage device
TWI571881B (en) Valid data merging method, memory controller and memory storage apparatus
US10635583B2 (en) Memory management method and storage controller
CN110825653B (en) Memory management method and memory controller
CN109032957B (en) Memory management method, memory control circuit unit and memory storage device
CN110825310A (en) Memory management method and memory controller
US9665480B2 (en) Memory management method, memory storage device and memory control circuit unit
TWI688958B (en) Cold area determining method, memory controlling circuit unit and memory storage device
TWI762843B (en) Storage controller, memory management method, and storage device
CN106991055B (en) Data search method, memory storage device and memory control circuit unit