TWI756854B - Method and apparatus and computer program product for managing data storage - Google Patents

Method and apparatus and computer program product for managing data storage Download PDF

Info

Publication number
TWI756854B
TWI756854B TW109133776A TW109133776A TWI756854B TW I756854 B TWI756854 B TW I756854B TW 109133776 A TW109133776 A TW 109133776A TW 109133776 A TW109133776 A TW 109133776A TW I756854 B TWI756854 B TW I756854B
Authority
TW
Taiwan
Prior art keywords
sub
host
area
flash memory
hpb
Prior art date
Application number
TW109133776A
Other languages
Chinese (zh)
Other versions
TW202141280A (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 慧榮科技股份有限公司
Publication of TW202141280A publication Critical patent/TW202141280A/en
Application granted granted Critical
Publication of TWI756854B publication Critical patent/TWI756854B/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation
    • G06F12/1009Address translation using page tables, e.g. page table structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • G06F12/0615Address space extension

Abstract

The invention relates to a method, an apparatus and a computer program product for managing data storage. The method is performed by a flash controller to include: obtaining information indicating a sub-region to be activated, which is associated with a logical block address (LBA) range; triggering a garbage collection (GC) process in background for migrating user data of the whole or a portion of the LBA range to continuous physical addresses of a flash device; and updating the content of a plurality of entries of the sub-region according to the migration results, where each entry includes information indicating a physical address of the flash device user data of an LBA is physically stored. By the triggering of the GC process, it allows an execution of a subsequent read command to read data from the flash device according to the content of the updated entries directly, without the need to spend extra time and computing resources to read a T1 table from the flash device and perform a logical-to-physical address translation.

Description

管理資料儲存的方法及裝置以及電腦程式產品 Method and apparatus for managing data storage and computer program product

本發明涉及儲存裝置,尤指一種管理資料儲存的方法及裝置以及電腦程式產品。 The present invention relates to a storage device, in particular to a method and device for managing data storage and a computer program product.

閃存通常分為NOR閃存與NAND閃存。NOR閃存為隨機存取裝置,中央處理器(Host)可於位址腳位上提供任何存取NOR閃存的位址,並及時地從NOR閃存的資料腳位上獲得儲存於該位址上的資料。相反地,NAND閃存並非隨機存取,而是序列存取。NAND閃存無法像NOR閃存一樣,可以存取任何隨機位址,中央處理器反而需要寫入序列的位元組(Bytes)的值到NAND閃存中,用於定義請求命令(Command)的類型(如,讀取、寫入、抹除等),以及用在此命令上的位址。位址可指向一個頁面(閃存中寫入作業的最小資料塊)或一個區塊(閃存中抹除作業的最小資料塊)。 Flash memory is usually divided into NOR flash memory and NAND flash memory. NOR flash memory is a random access device. The central processing unit (Host) can provide any address for accessing the NOR flash memory on the address pin, and obtain the data stored at the address from the data pin of the NOR flash memory in time. material. In contrast, NAND flash memory is not random access, but sequential access. NAND flash memory cannot access any random address like NOR flash memory. Instead, the central processor needs to write the value of the sequence of bytes (Bytes) into the NAND flash memory to define the type of request command (Command) (such as , read, write, erase, etc.), and the address used on this command. The address can point to a page (the smallest block of data in flash for write operations) or a block (the smallest block of data in flash for erase operations).

為了提昇閃存裝置的資料寫入及讀取效能,裝置端會以多個通道並行地執行資料寫入及讀取。為了達成並行處理的目的,一段連續性的資料會分散地儲存到多個通道所連接的閃存單元,並使用邏輯實體對照表(Logical-to-physical,L2P Mapping Table)紀錄使用者資料的邏輯位址(由主機端管理)與實體位址(由閃存控制器管理)間的對應關係。更進一步地,在新的規範中,閃存控制器能夠將邏輯位址與實體位址間的對應關係整理成主機性能增強項目(Host Performance Booster,HPB Entries)的格式並提供給主機端。之後,主機端可從HPB項目中取出需要的實體位址,並且將實體位址攜帶 在發送給裝置端的HPB讀取命令中,使得閃存控制器可直接從閃存裝置的實體位址讀取使用者資料並回覆給主機端,而不需要像以前一樣得花費時間和運算資源從閃存裝置讀取邏輯實體對照表並進行邏輯實體位址轉換。 In order to improve the data writing and reading performance of the flash memory device, the device side performs data writing and reading through multiple channels in parallel. In order to achieve the purpose of parallel processing, a continuous piece of data will be distributed to the flash memory cells connected to multiple channels, and a logical-to-physical (L2P Mapping Table) will be used to record the logical bits of user data. The correspondence between addresses (managed by the host side) and physical addresses (managed by the flash controller). Furthermore, in the new specification, the flash memory controller can organize the corresponding relationship between the logical address and the physical address into the format of the Host Performance Booster (HPB Entries) and provide it to the host side. After that, the host can take out the required physical address from the HPB project, and carry the physical address In the HPB read command sent to the device, the flash controller can directly read the user data from the physical address of the flash device and reply to the host, without the need to spend time and computing resources from the flash device as before. Read the logical entity comparison table and perform logical entity address conversion.

此外,在新的規範中,主機端可發送一個HPB讀取命令給閃存控制器,用於讀取兩個或以上連續邏輯位址的使用者資料,但其中只允許攜帶一個HPB項目,其關聯起始邏輯位址。然而,當這些連續邏輯位址的使用者資料實際上並不是儲存在連續的實體位址時,閃存控制器依然需要從閃存裝置讀取L2P對照表才能知道之後邏輯位址的使用者資料實際儲存的實體位址,造成HPB讀取命令的執行無法獲得預期的效率。因此,本發明提出一種管理資料儲存的方法及裝置以及電腦程式產品,用於解決如上所述的問題。 In addition, in the new specification, the host side can send an HPB read command to the flash controller to read the user data of two or more consecutive logical addresses, but only one HPB item is allowed, and its associated Starting logical address. However, when the user data of these consecutive logical addresses are not actually stored in consecutive physical addresses, the flash controller still needs to read the L2P comparison table from the flash device to know that the user data of the subsequent logical addresses is actually stored The physical address of the HPB will cause the execution of the HPB read command to fail to obtain the expected efficiency. Therefore, the present invention provides a method and device for managing data storage and a computer program product for solving the above-mentioned problems.

有鑑於此,如何減輕或消除上述相關領域的缺失,實為有待解決的問題。 In view of this, how to alleviate or eliminate the above-mentioned deficiencies in related fields is a problem to be solved.

本說明書涉及一種管理資料儲存的方法,由閃存控制器執行,包含:獲取即將啟動的子區的資訊,上述子區關聯於一段邏輯區塊位址區間;觸發垃圾收集程序的背景操作,用於將上述子區關聯的全部或一部分邏輯區塊位址區間的使用者資料遷移到閃存裝置中的連續實體位址;以及依據遷移結果更新相應於上述子區的多個項目的內容。 This specification relates to a method for managing data storage, executed by a flash memory controller, including: acquiring information about a sub-area to be activated, the sub-area being associated with a logical block address range; triggering a background operation of a garbage collection program for Migrating all or part of the user data in the logical block address range associated with the sub-area to consecutive physical addresses in the flash memory device; and updating the contents of the items corresponding to the sub-area according to the migration result.

本說明書另涉及一種電腦程式產品,包含程式碼,其中,當程式碼被閃存控制器的處理單元載入並執行時實現如上所述管理資料儲存的方法。 The present specification further relates to a computer program product comprising program code, wherein the method of managing data storage as described above is implemented when the program code is loaded and executed by a processing unit of a flash memory controller.

本說明書另涉及一種管理資料儲存的裝置,包含:閃存介面和處理單元。處理單元用於獲取即將啟動的子區的資訊,其中上述子區關聯於一段邏輯區塊位址區間;觸發垃圾收集程序的背景操作,用於驅動上述閃存介面將上述子區關聯的全部或一部分上述邏輯區塊位 址區間的使用者資料遷移到閃存裝置中的連續實體位址;以及依據遷移結果更新相應於上述子區的多個項目的內容。 The present specification also relates to a device for managing data storage, comprising: a flash memory interface and a processing unit. The processing unit is used to obtain the information of the sub-area to be activated, wherein the sub-area is associated with a logical block address range; the background operation of triggering the garbage collection program is used to drive the flash memory interface to associate all or a part of the sub-area The above logical block bit The user data in the address interval is migrated to consecutive physical addresses in the flash memory device; and the contents of the plurality of items corresponding to the sub-areas are updated according to the migration result.

每個上述項目包含邏輯區塊位址的使用者資料實際儲存於閃存裝置中的實體位址的資訊。 Each of the above-mentioned entries contains information about the physical address at which the user data of the logical block address is actually stored in the flash memory device.

上述實施例的優點之一,通過如上所述垃圾收集程序的觸發,讓後續讀取命令的執行可直接依據更新後項目的內容讀取資料,而不需要多花費時間和運算資源從閃存裝置中讀取T1表和執行邏輯實體位址轉換。 One of the advantages of the above embodiment is that, through the triggering of the garbage collection program as described above, the execution of subsequent read commands can directly read data according to the content of the updated item, without spending more time and computing resources from the flash memory device. Read T1 table and perform logical entity address translation.

本發明的其他優點將搭配以下的說明和圖式進行更詳細的解說。 Other advantages of the present invention will be explained in more detail in conjunction with the following description and drawings.

10:電子裝置 10: Electronics

110:主機裝置 110: Host device

130:閃存控制器 130: Flash Controller

131:主機介面 131:Host Interface

132:匯流排 132: Busbar

134:處理單元 134: Processing unit

135:唯讀記憶體 135: read-only memory

136:隨機存取記憶體 136: Random Access Memory

139:閃存介面 139: Flash interface

150:閃存裝置 150: Flash device

151:介面 151: Interface

153#0~153#15:NAND閃存單元 153#0~153#15: NAND flash memory unit

CH#0~CH#3:通道 CH#0~CH#3: Channel

CE#0~CE#3:致能訊號 CE#0~CE#3: Enable signal

310:T2表 310:T2 table

330#0~330#15:T1表 330#0~330#15: T1 table

400#1:實體塊 400#1: Solid Block

410:實體頁面 410: Entity page

430:實體位址資訊 430: Physical address information

430-0:實體塊編號 430-0: Entity block number

430-1:實體頁面編號 430-1: Entity page number

500:HPB快取 500:HPB cache

610~650,711~775,1011~1037:操作 610~650, 711~775, 1011~1037: Operation

S810~S830,S910~S970:方法步驟 S810~S830, S910~S970: method steps

圖1為依據本發明實施例的電子裝置的系統架構圖。 FIG. 1 is a system architecture diagram of an electronic device according to an embodiment of the present invention.

圖2為依據本發明實施例的閃存裝置的示意圖。 FIG. 2 is a schematic diagram of a flash memory device according to an embodiment of the present invention.

圖3為依據本發明實施例的T1表和T2表之間的關聯示意圖。 FIG. 3 is a schematic diagram of the association between the T1 table and the T2 table according to an embodiment of the present invention.

圖4為依據本發明實施例的T1表和實體頁面之間的關聯示意圖。 FIG. 4 is a schematic diagram of an association between a T1 table and an entity page according to an embodiment of the present invention.

圖5為依據本發明實施例的主機性能增強器(Host Performance Booster,HPB)快取的建立與運用示意圖。 FIG. 5 is a schematic diagram illustrating the establishment and application of a Host Performance Booster (HPB) cache according to an embodiment of the present invention.

圖6為依據本發明實施例的HPB資料讀取的操作順序圖。 FIG. 6 is an operation sequence diagram of reading HPB data according to an embodiment of the present invention.

圖7為依據本發明實施例的應用在主機控制模式的操作順序圖。 FIG. 7 is an operation sequence diagram of an application in a host control mode according to an embodiment of the present invention.

圖8為依據本發明實施例的產生和更新HPB項目的方法流程圖。 FIG. 8 is a flowchart of a method for generating and updating HPB items according to an embodiment of the present invention.

圖9為依據本發明實施例的讀取使用者資料的方法流程圖。 FIG. 9 is a flowchart of a method for reading user data according to an embodiment of the present invention.

圖10為依據本發明實施例的應用在裝置控制模式的操作順序圖。 FIG. 10 is an operation sequence diagram of an application in a device control mode according to an embodiment of the present invention.

以下說明為完成發明的較佳實現方式,其目的在於描述本發明的基本精神,但並不用以限定本發明。實際的發明內容必須參考之後的權利要求範圍。 The following description is a preferred implementation manner to complete the invention, and its purpose is to describe the basic spirit of the invention, but it is not intended to limit the invention. Reference must be made to the scope of the following claims for the actual inventive content.

必須了解的是,使用於本說明書中的“包含”、“包括”等詞,用以表示存在特定的技術特徵、數值、方法步驟、作業處理、元件以及/或 組件,但並不排除可加上更多的技術特徵、數值、方法步驟、作業處理、元件、組件,或以上的任意組合。 It must be understood that the words "comprising", "comprising" and the like used in this specification are used to indicate the existence of specific technical features, values, method steps, work processes, elements and/or components, but does not exclude the addition of further technical features, values, method steps, job processes, elements, components, or any combination of the above.

於權利要求中使用如“第一”、“第二”、“第三”等詞是用來修飾權利要求中的元件,並非用來表示之間具有優先順序,前置關係,或者是一個元件先於另一個元件,或者是執行方法步驟時的時間先後順序,僅用來區別具有相同名字的元件。 The use of words such as "first", "second", "third", etc. in the claims is used to modify the elements in the claims, and is not used to indicate that there is a priority order, a prepositional relationship between them, or an element Prior to another element, or the chronological order in which method steps are performed, is only used to distinguish elements with the same name.

必須了解的是,當元件描述為“連接”或“耦接”至另一元件時,可以是直接連結、或耦接至其他元件,可能出現中間元件。相反地,當元件描述為“直接連接”或“直接耦接”至另一元件時,其中不存在任何中間元件。使用來描述元件之間關係的其他語詞也可類似方式解讀,例如“介於”相對於“直接介於”,或者是“鄰接”相對於“直接鄰接”等等。 It must be understood that when an element is described as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element, and intervening elements may be present. In contrast, when an element is described as being "directly connected" or "directly coupled" to another element, there are no intervening elements present. Other words used to describe the relationship between elements can also be read in a similar fashion, such as "between" versus "directly interposed," or "adjacent" versus "directly adjoining," and the like.

參考圖1。電子裝置10包含主機裝置(又可稱主機端)110、閃存控制器130及閃存裝置150,並且閃存控制器130及閃存裝置150可合稱為裝置端(Device Side)。電子裝置10可實施於個人電腦、筆記型電腦(Laptop PC)、平板電腦、手機、數位相機、數位攝影機等電子產品之中。主機裝置110與閃存控制器130的主機介面(Host Interface)131可以通用快閃記憶儲存(Universal Flash Storage,UFS)等通訊協定彼此溝通。雖然以下實施例描述了UFS規範的主機性能增強器(Host Performance Booster,HPB)的功能,但所屬技術領域人員可將本發明應用到其他規範的類似功能中,本發明並不因此受限。閃存控制器130的閃存介面139與閃存裝置150可以雙倍資料率(Double Data Rate,DDR)通訊協定彼此溝通,例如,開放NAND快閃介面(Open NAND Flash Interface,ONFI)、雙倍資料率開關(DDR Toggle)或其他通訊協定。閃存控制器130包含處理單元134,可使用多種方式實施,如使用通用硬體(例如,微控制單元、中央處理器、具平行處理能力的多處理器、圖形處理器或 其他具運算能力的處理器),並且在執行軟體以及/或韌體指令時,提供之後描述的功能。處理單元134通過主機介面131接收HPB命令,例如HPB讀取命令(HPB READ Command)、HPB讀取緩衝器命令(HPB READ BUFFER Command)、HPB寫入緩衝器命令(HPB WRITE BUFFER Command)等,並執行這些命令。閃存控制器130包含隨機存取記憶體(Random Access Memory,RAM)136,可實施為動態隨機存取記憶體(Dynamic Random Access Memory,DRAM)、靜態隨機存取記憶體(Static Random Access Memory,SRAM)或上述兩者的結合,用於配置空間作為資料緩衝區。隨機存取記憶體136另可儲存執行過程中需要的資料,例如,變數、資料表等。閃存控制器130包含唯讀記憶體(Read Only Memory,ROM)135,用於儲存開機時需要執行的程式碼。閃存介面139包含NAND閃存控制器(NAND Flash Controller,NFC),提供存取閃存裝置150時需要的功能,例如命令序列器(Command Sequencer)、低密度奇偶校驗(Low Density Parity Check,LDPC)等。 Refer to Figure 1. The electronic device 10 includes a host device (also referred to as a host side) 110 , a flash memory controller 130 and a flash memory device 150 , and the flash memory controller 130 and the flash memory device 150 may be collectively referred to as a device side. The electronic device 10 can be implemented in electronic products such as personal computers, notebook computers (Laptop PCs), tablet computers, mobile phones, digital cameras, and digital video cameras. The host device 110 and the host interface (Host Interface) 131 of the flash controller 130 can communicate with each other through a communication protocol such as Universal Flash Storage (UFS). Although the following embodiments describe the function of the Host Performance Booster (HPB) of the UFS specification, those skilled in the art can apply the present invention to similar functions of other specifications, and the present invention is not limited thereby. The flash memory interface 139 of the flash memory controller 130 and the flash memory device 150 can communicate with each other through a Double Data Rate (DDR) protocol, such as Open NAND Flash Interface (ONFI), double data rate switch (DDR Toggle) or other protocols. The flash controller 130 includes a processing unit 134, which may be implemented in a variety of ways, such as using general-purpose hardware (eg, a microcontroller unit, a central processing unit, a multiprocessor with parallel processing capabilities, a graphics processor, or other computing-capable processors) and, when executing software and/or firmware instructions, provide the functions described later. The processing unit 134 receives HPB commands, such as HPB READ Command, HPB READ BUFFER Command, HPB Write Buffer Command (HPB WRITE BUFFER Command), etc. through the host interface 131, and Execute these commands. The flash memory controller 130 includes a random access memory (RAM) 136, which can be implemented as a dynamic random access memory (DRAM), a static random access memory (SRAM) ) or a combination of the above two to configure the space as a data buffer. The random access memory 136 can also store data required in the execution process, such as variables, data tables, and the like. The flash memory controller 130 includes a Read Only Memory (ROM) 135 for storing program codes that need to be executed when booting. The flash memory interface 139 includes a NAND flash controller (NAND Flash Controller, NFC), which provides functions required for accessing the flash memory device 150, such as a command sequencer (Command Sequencer), a low density parity check (Low Density Parity Check, LDPC), etc. .

閃存控制器130中可配置匯流排架構(Bus Architecture)132,用於讓元件之間彼此耦接以傳遞資料、位址、控制訊號等,這些元件包含主機介面131、處理單元134、ROM 135、RAM 136、閃存介面139等。在一些實施例中,主機介面131、處理單元134、ROM 135、RAM 136與閃存介面139可通過單一匯流排彼此耦接。在另一些實施例中,閃存控制器130中可配置高速匯流排,用於讓處理單元134、ROM 135與RAM 136彼此耦接,並且配置低速匯流排,用於讓處理單元134、主機介面131與閃存介面139彼此耦接。匯流排包含並行的物理線,連接閃存控制器130中兩個以上的組件。 A bus architecture 132 can be configured in the flash memory controller 130 to couple elements to each other to transmit data, addresses, control signals, etc. These elements include a host interface 131, a processing unit 134, a ROM 135, RAM 136, flash memory interface 139, etc. In some embodiments, the host interface 131, the processing unit 134, the ROM 135, the RAM 136, and the flash memory interface 139 may be coupled to each other through a single bus. In other embodiments, the flash controller 130 may be configured with a high-speed bus for coupling the processing unit 134 , the ROM 135 and the RAM 136 to each other, and a low-speed bus for connecting the processing unit 134 and the host interface 131 to each other. and the flash memory interface 139 are coupled to each other. The bus bars contain parallel physical lines that connect more than two components in the flash controller 130 .

閃存裝置150提供大量的儲存空間,通常是數百個千兆位元組(Gigabytes,GB),甚至是數個兆兆位元組(Terabytes,TB),用於儲存大量的使用者資料,例如高解析度圖片、影片等。閃存裝 置150中包含控制電路以及記憶體陣列,記憶體陣列中的記憶單元可組態為單層式單元(Single Level Cells,SLCs)、多層式單元(Multiple Level Cells,MLCs)三層式單元(Triple Level Cells,TLCs)、四層式單元(Quad-Level Cells,QLCs)或上述的任意組合。處理單元134通過閃存介面139寫入使用者資料到閃存裝置150中的指定位址(目的位址),以及從閃存裝置150中的指定位址(來源位址)讀取使用者資料和L2P對照表中的指定部分。閃存介面139使用數個電子訊號來協調閃存控制器130與閃存裝置150間的資料與命令傳遞,包含資料線(Data Line)、時脈訊號(Clock Signal)與控制訊號(Control Signal)。資料線可用於傳遞命令、位址、讀出及寫入的資料;控制訊號線可用於傳遞晶片致能(Chip Enable,CE)、位址提取致能(Address Latch Enable,ALE)、命令提取致能(Command Latch Enable,CLE)、寫入致能(Write Enable,WE)等控制訊號。 The flash memory device 150 provides a large amount of storage space, usually hundreds of gigabytes (Gigabytes, GB), or even several terabytes (Terabytes, TB), for storing a large amount of user data, such as High-resolution pictures, videos, etc. flash The device 150 includes a control circuit and a memory array, and the memory cells in the memory array can be configured as single-level cells (Single Level Cells, SLCs), multi-level cells (Multiple Level Cells, MLCs), triple-level cells (Triple Level Cells, MLCs) Level Cells, TLCs), Quad-Level Cells (Quad-Level Cells, QLCs), or any combination of the above. The processing unit 134 writes the user data to the specified address (destination address) in the flash memory device 150 through the flash memory interface 139, and reads the user data and L2P comparison from the specified address (source address) in the flash memory device 150 specified section in the table. The flash memory interface 139 uses several electronic signals to coordinate data and command transfer between the flash memory controller 130 and the flash memory device 150 , including a data line, a clock signal, and a control signal. Data lines can be used to transmit commands, addresses, read and written data; control signal lines can be used to transmit Chip Enable (CE), Address Latch Enable (ALE), Command Extraction Enable Control signals such as Command Latch Enable (CLE) and Write Enable (WE).

參考圖2,閃存裝置150中的介面151可包含四個輸出入通道(I/O channels,以下簡稱通道)CH#0至CH#3,每一個通道連接四個NAND閃存單元,例如,通道CH#0連接NAND閃存單元153#0、153#4、153#8及153#12。每個NAND閃存單元可封裝為獨立的芯片(die)。閃存介面139可通過介面151發出致能訊號CE#0至CE#3中的一個來致能NAND閃存單元153#0至153#3、153#4至153#7、153#8至153#11、或153#12至153#15,接著以並行的方式從致能的NAND閃存單元讀取使用者資料,或者寫入使用者資料至致能的NAND閃存單元。 Referring to FIG. 2 , the interface 151 in the flash memory device 150 may include four I/O channels (hereinafter referred to as channels) CH#0 to CH#3, each of which is connected to four NAND flash memory cells, for example, channel CH #0 connects NAND flash memory cells 153#0, 153#4, 153#8 and 153#12. Each NAND flash memory cell can be packaged as an independent die. The flash memory interface 139 can enable the NAND flash memory cells 153#0 to 153#3, 153#4 to 153#7, and 153#8 to 153#11 by issuing one of the enable signals CE#0 to CE#3 through the interface 151 , or 153#12 to 153#15, and then read user data from the enabled NAND flash memory cells in parallel, or write user data to the enabled NAND flash memory cells.

由於一段連續性的資料(也就是一段連續邏輯位址的資料)被分散地儲存到多個通道所連接的閃存單元,閃存控制器130使用邏輯實體對照表(Logical-to-physical,L2P Mapping Table)紀錄使用者資料的邏輯位址(由主機裝置110管理)與實體位址(由閃存控制器 130管理)間的對應關係。L2P對照表也可稱為主機閃存對照表(Host-to-flash,H2F Mapping Table)。L2P對照表包含多筆紀錄,依邏輯位址的順序儲存每個邏輯位址的使用者資料實際儲存在哪個實體位址的資訊。然而,由於RAM 136無法提供足夠空間儲存整個L2P對照表以供處理單元134將來於資料讀取操作時快速查找,L2P對照表可切成多個第一表(Table 1,又可稱為T1表),並儲存在非揮發性的閃存裝置150,使得將來於資料讀取操作時只要從閃存裝置150讀取相應的T1表至RAM 136。參考圖3,整個L2P對照表可切成T1表330#0~330#15。處理單元134更維護第二表(Table 2,又可稱為T2表)310,包含多個紀錄,依邏輯位址的順序儲存每段邏輯位址區段關聯的T1表的實體位址資訊。例如,第0個至第4095個邏輯區塊位址(Logical Block Addresses,LBAs)的關聯T1表330#0儲存在特定邏輯單元號(Logical Unit Number,LUN)的特定實體塊中(字母”Z”可代表LUN和實體塊的編號)的第0個實體頁面,第4096個至第8191個LBA的關聯T1表330#1儲存在特定LUN的特定實體塊中的第1個實體頁面,依此類推。雖然圖3中只包含16個T1表,但是所屬技術領域的技術人員可因應閃存裝置150的容量,設置更多的T1表,本發明並不因此侷限。 Since a continuous piece of data (that is, a piece of data with a continuous logical address) is dispersedly stored in the flash memory cells connected to multiple channels, the flash memory controller 130 uses a logical-to-physical (L2P Mapping Table) table. ) to record the logical address (managed by the host device 110) and physical address (managed by the flash controller) of user data 130 management) correspondence. The L2P mapping table may also be referred to as a host-to-flash mapping table (Host-to-flash, H2F Mapping Table). The L2P comparison table includes a plurality of records, and stores the information of which physical address the user data of each logical address is actually stored in according to the order of the logical addresses. However, since the RAM 136 cannot provide enough space to store the entire L2P lookup table for the processing unit 134 to quickly look up the data read operation in the future, the L2P lookup table can be divided into a plurality of first tables (Table 1, also known as T1 table) ) and stored in the non-volatile flash memory device 150 , so that the corresponding T1 table only needs to be read from the flash memory device 150 to the RAM 136 in the future data read operation. Referring to Figure 3, the entire L2P comparison table can be cut into T1 tables 330#0~330#15. The processing unit 134 further maintains a second table (Table 2, also referred to as a T2 table) 310, which includes a plurality of records and stores the physical address information of the T1 table associated with each logical address segment in the order of logical addresses. For example, the associated T1 table 330#0 of the 0th to 4095th Logical Block Addresses (LBAs) is stored in a specific physical block (the letter "Z") of a specific Logical Unit Number (LUN) ” can represent the number of the LUN and the physical block) of the 0th physical page, the associated T1 table 330#1 of the 4096th to 8191st LBAs is stored in the 1st physical page of a specific physical block of a specific LUN, and so on analogy. Although only 16 T1 tables are included in FIG. 3 , those skilled in the art can set more T1 tables according to the capacity of the flash memory device 150 , and the present invention is not limited thereto.

每個T1表所需的空間可以為4KB、8KB、16KB等。每個T1表依照LBA的順序儲存相應於每一個LBA的實體位址資訊,而每一個LBA對應到一個固定大小的實體儲存空間,例如4KB。參考圖4,舉例來說,T1表330#0依序儲存從LBA#0至LBA#4095的實體位址資訊。實體位址資訊430可以四個位元組表示:前二個位元組430-0紀錄實體塊編號(Physical Block Number);後二個位元組430-1紀錄實體頁面編號(Physical Page Number)。舉例來說,相應於LBA#2的實體位址資訊430可指向實體塊400#1中的實體頁面410。位元組430-0紀錄實體塊400#1的編號,位元組430-1紀錄實體頁面410的編號。 The space required for each T1 table can be 4KB, 8KB, 16KB, etc. Each T1 table stores the physical address information corresponding to each LBA according to the LBA order, and each LBA corresponds to a fixed-size physical storage space, such as 4KB. Referring to FIG. 4, for example, T1 table 330#0 stores physical address information from LBA#0 to LBA#4095 in sequence. The physical address information 430 can be represented by four bytes: the first two bytes 430-0 record the physical block number (Physical Block Number); the last two bytes 430-1 record the physical page number (Physical Page Number) . For example, physical address information 430 corresponding to LBA #2 may point to physical page 410 in physical block 400 #1. The byte group 430-0 records the number of the physical block 400#1, and the byte group 430-1 records the number of the physical page 410.

參考圖5,在HPB規範中,主機端110在其系統記憶體(System Memory)中配置空間作為HPB快取500,用於暫存由裝置端維護的L2P對照表的資訊。HPB快取500儲存多個從裝置端接收的HPB項目(HPB Entries),每個HPB項目紀錄相應於一個LBA的實體位址的資訊。接著,主機端110可發出攜帶HPB項目的HPB讀取命令給裝置端,用於取得指定LBA的使用者資料。裝置端可直接根據HPB項目中的資訊來驅動閃存介面139從閃存裝置150讀取指定LBA的使用者資料,而不需要像以前一樣得花費時間和運算資源從閃存裝置150讀取T1表並進行邏輯實體位址轉換後才能從閃存裝置150讀取指定LBA的使用者資料。針對HPB快取500的建立和運用,可分為三個階段: Referring to FIG. 5 , in the HPB specification, the host 110 configures a space in its system memory as the HPB cache 500 for temporarily storing the information of the L2P comparison table maintained by the device. The HPB cache 500 stores a plurality of HPB entries (HPB Entries) received from the device, and each HPB entry records information corresponding to a physical address of an LBA. Next, the host side 110 may issue an HPB read command carrying the HPB item to the device side for obtaining the user data of the designated LBA. The device side can directly drive the flash memory interface 139 to read the user data of the specified LBA from the flash memory device 150 according to the information in the HPB item, without the need to spend time and computing resources to read the T1 table from the flash memory device 150 and perform the same as before. The user data of the designated LBA can be read from the flash memory device 150 only after the logical physical address is translated. The establishment and application of HPB cache 500 can be divided into three stages:

階段I(HPB初始化):主機端110向裝置端(詳細來說是閃存控制器130)請求取得其裝置能力並且組態HPB功能,包含HPB模式(Mode)等。 Phase I (HPB initialization): The host side 110 requests the device side (specifically, the flash controller 130 ) to obtain its device capability and configure the HPB function, including the HPB mode (Mode).

階段II(L2P快取管理):主機端110在系統記憶體中配置空間作為HPB快取500,用於儲存HPB項目。主機端110可在組態好的模式下於需要的時間點發送HPB讀取緩衝器命令(HPB READ BUFFER Command)給閃存控制器130,用於請求從裝置端載入指定的HPB項目。接著,主機端110將這些HPB項目儲存在HPB快取500中的一個或多個子區(Sub-Regions)。在HPB規範中,每個邏輯單元(例如區段,Partition)的LBAs分為多個HPB區域,而每個HPB區域可更細分為多個子區。 Phase II (L2P cache management): The host 110 allocates space in the system memory as the HPB cache 500 for storing HPB items. The host 110 may send an HPB READ BUFFER Command to the flash controller 130 at a required time point in the configured mode, for requesting to load a specified HPB item from the device. Next, the host 110 stores the HPB items in one or more sub-regions (Sub-Regions) in the HPB cache 500 . In the HPB specification, the LBAs of each logical unit (eg, Partition) are divided into multiple HPB regions, and each HPB region can be further subdivided into multiple sub-regions.

階段III(HPB讀取命令):主機端110在HPB快取500的HPB項目中搜索包含欲讀取LBA的資料的實體區塊位址(Physical Block Addresses,PBAs)的HPB項目。PBA可使用如圖4的實體位址資訊430表示。接著,主機端110發送HPB讀取命令(HPB READ Command)給閃存控制器130,其中除了LBA、傳輸長度 (TRANSFER LENGTH)等資訊外還包含HPB項目,用於從裝置端獲取指定的使用者資料。 Phase III (HPB read command): The host 110 searches the HPB entries in the HPB cache 500 for HPB entries containing physical block addresses (PBAs) of the data to be read from the LBA. The PBA can be represented using physical address information 430 as shown in FIG. 4 . Next, the host 110 sends an HPB READ Command to the flash controller 130, in which, except for LBA, transfer length In addition to information such as (TRANSFER LENGTH), it also includes HPB items, which are used to obtain specified user data from the device.

雖然HPB讀取命令中包含了HPB項目的資訊,然而,當HPB讀取命令的傳輸長度大於1時(也就是主機端110想要讀取超過4KB的使用者資料),HPB項目中的PBA只屬於起始LBA,使得閃存控制器130還是需要讀取關聯的T1表來知道起始LBA之後的LBA的PBA。參考如圖6所示的HPB資料讀取的操作順序圖,詳細說明如下: Although the HPB read command contains the information of the HPB item, when the transmission length of the HPB read command is greater than 1 (that is, the host 110 wants to read user data exceeding 4KB), the PBA in the HPB item only It belongs to the starting LBA, so that the flash controller 130 still needs to read the associated T1 table to know the PBA of the LBA after the starting LBA. Referring to the operation sequence diagram of HPB data reading as shown in Figure 6, the detailed description is as follows:

操作610:主機端110從HPB快取500獲取相應於欲讀取的起始LBA的HPB項目。 Operation 610 : the host 110 obtains the HPB entry corresponding to the starting LBA to be read from the HPB cache 500 .

操作620:主機端110發送HPB讀取命令給閃存控制器130,向閃存控制器130請求指定LBA的使用者資料,其中包含LBA、傳輸長度和HPB項目。需要注意的是,HPB讀取命令可代表命令UFS協議資訊單元HPB讀取(COMMAND UFS Protocol Information Unit,UPIU HPB Read)。傳輸長度可為1到8之間的任意整數。舉例來說,當傳輸長度為1時,此HPB讀取命令欲讀取一個LBA的使用者資料;當傳輸長度為2時,此HPB讀取命令欲讀取連續兩個LBA的使用者資料;依此類推。 Operation 620: The host 110 sends an HPB read command to the flash controller 130, and requests the flash controller 130 for the user data of the designated LBA, which includes the LBA, the transfer length and the HPB item. It should be noted that, the HPB read command may represent a command UFS Protocol Information Unit HPB Read (COMMAND UFS Protocol Information Unit, UPIU HPB Read). The transfer length can be any integer between 1 and 8. For example, when the transmission length is 1, the HPB read command is to read the user data of one LBA; when the transmission length is 2, the HPB read command is to read the user data of two consecutive LBAs; So on and so forth.

操作630:閃存控制器130依據HPB項目的PBA從閃存裝置150讀取請求的使用者資料。如果HPB讀取命令中的傳輸長度大於1時,閃存控制器130還需要從閃存裝置150讀取相應的T1表,並且從T1表中獲取之後LBA的PBA。接著,閃存控制器130依據HPB項目的PBA(當傳輸長度等於1)或者依據讀取T1表中的PBA(當傳輸長度大於1)從閃存裝置150讀取請求的使用者資料。 Operation 630: The flash controller 130 reads the requested user data from the flash device 150 according to the PBA of the HPB entry. If the transfer length in the HPB read command is greater than 1, the flash controller 130 also needs to read the corresponding T1 table from the flash memory device 150, and obtain the PBA of the subsequent LBA from the T1 table. Next, the flash controller 130 reads the requested user data from the flash memory device 150 according to the PBA of the HPB entry (when the transfer length is equal to 1) or according to the PBA in the read T1 table (when the transfer length is greater than 1).

操作640:閃存控制器130傳送一個或多個資料輸入UPIU給主機端110,其中包含請求的使用者資料。每個資料輸入UPIU可傳輸4KB的使用者資料。在所有請求的使用者資料都傳送給主機端110後,閃存控制器130傳送回覆UPIU給主機端110,指出HPB讀取命令已經 執行完的訊息。 Operation 640: The flash controller 130 transmits one or more data input UPIUs to the host 110, including the requested user data. Each data input UPIU can transmit 4KB of user data. After all requested user data are sent to the host 110, the flash controller 130 sends a reply UPIU to the host 110, indicating that the HPB read command has been completed message.

操作650:主機端110依據作業系統、驅動程式、應用程式等的需要處理這些使用者資料。 Operation 650: The host 110 processes the user data according to the needs of the operating system, drivers, applications and the like.

從上述描述可知,當HPB讀取命令中的傳輸長度大於1時,閃存控制器130無法節省從閃存裝置150讀取T1表及執行邏輯實體位址轉換的時間,因而失去原來HPB功能的優點。 As can be seen from the above description, when the transfer length in the HPB read command is greater than 1, the flash controller 130 cannot save the time for reading the T1 table from the flash device 150 and performing logical physical address translation, thus losing the advantages of the original HPB function.

所屬技術領域技術人員理解HPB規範的每個HPB項目的長度(例如8位元組)可能大於T1表中紀錄的關聯於每個LBA的實體位址資訊的長度(例如4位元組)。為了解決如上所述的問題,除了每個LBA的實體位址資訊(也就是T1表中紀錄的此LBA的PBA資訊)外,處理單元134可在HPB項目的剩餘空間添加相應PBA的連續性資訊,用於加速將來的HPB讀取操作。每個HPB項目的連續性資訊描述此LBA之後的特定LBA區間的使用者資料儲存在閃存裝置150中的連續實體位址。 Those skilled in the art understand that the length (eg, 8 bytes) of each HPB entry of the HPB specification may be greater than the length (eg, 4 bytes) of the physical address information associated with each LBA recorded in the T1 table. In order to solve the above problem, in addition to the physical address information of each LBA (that is, the PBA information of the LBA recorded in the T1 table), the processing unit 134 can add the continuity information of the corresponding PBA to the remaining space of the HPB entry , used to speed up future HPB read operations. The continuity information of each HPB entry describes the consecutive physical addresses in the flash memory device 150 where the user data of the specific LBA interval following this LBA is stored.

在階段II的一些實施例中,處理單元134可在每個8位元組的HPB項目填入4位元組的相應PBA資訊和4位元組的連續長度(Continuous Length)。連續長度指出在此LBA之後有多少個LBA的資料是連續性地儲存在閃存裝置150中的實體位址。所以,一個HPB項目能夠表達T1表中多個連續PBA的資訊。HPB項目的範例如表1所示:

Figure 109133776-A0305-02-0013-1
Figure 109133776-A0305-02-0014-2
In some embodiments of Phase II, the processing unit 134 may fill the HPB entry of each octet with 4-byte corresponding PBA information and the 4-byte Continuous Length. The contiguous length indicates how many LBAs are consecutively stored in the physical address of the flash memory device 150 after the LBA. Therefore, one HPB entry can express information for multiple consecutive PBAs in the T1 table. Examples of HPB projects are shown in Table 1:
Figure 109133776-A0305-02-0013-1
Figure 109133776-A0305-02-0014-2

舉例來說,表1中的第11個HPB項目關聯於LBA#11,LBA#11的使用者資料儲存在PBA”212344”並且LBA#11~17(共7個LBA)的使用者資料連續性地儲存在閃存裝置150中的實體位址。表1中的第12個HPB項目關聯於LBA#12,LBA#12的使用者資料儲存在PBA”212345”並且LBA#12~17(共6個LBA)的使用者資料連續性地儲存在閃存裝置150中的實體位址。處理單元134將來能夠根據第11個HPB項目中攜帶的資訊讀取LBA#11~17的使用者資料。也就是說,如果HPB讀取命令指出欲讀取的開始LBA為LBA#11並且傳輸 長度小於或等於”7”時,處理單元134不需要再從閃存裝置150中讀取對應的T1表,而直接從閃存裝置150的推測PBA讀取使用者資料並回覆給主機端110。 For example, the 11th HPB item in Table 1 is associated with LBA#11, the user data of LBA#11 is stored in PBA "212344" and the user data continuity of LBA#11~17 (7 LBAs in total) physical addresses stored in the flash memory device 150 . The 12th HPB item in Table 1 is associated with LBA#12, the user data of LBA#12 is stored in PBA "212345" and the user data of LBA#12~17 (6 LBAs in total) are continuously stored in flash memory Physical address in device 150. In the future, the processing unit 134 can read the user data of LBA #11-17 according to the information carried in the eleventh HPB item. That is, if the HPB read command indicates that the starting LBA to be read is LBA#11 and the transfer When the length is less than or equal to "7", the processing unit 134 does not need to read the corresponding T1 table from the flash memory device 150, but directly reads the user data from the speculative PBA of the flash memory device 150 and replies to the host 110.

在階段II的另一些實施例中,處理單元134可在每個8位元組的HPB項目填入4位元組的相應PBA資訊和4位元組的連續位元表(Continuous Bit Table)。連續位元表用來表示此LBA的多個後續LBA(例如,32個後續LBA)的PBA連續性。例如,32個位元分別相應於32個後續LBA。HPB項目的範例如表2所示:

Figure 109133776-A0305-02-0015-3
Figure 109133776-A0305-02-0016-5
In other embodiments of Phase II, the processing unit 134 may fill in the corresponding 4-byte PBA information and the 4-byte Continuous Bit Table in each 8-byte HPB entry. The contiguous bit table is used to represent the PBA contiguity of multiple subsequent LBAs (eg, 32 subsequent LBAs) of this LBA. For example, 32 bits respectively correspond to 32 subsequent LBAs. Examples of HPB projects are shown in Table 2:
Figure 109133776-A0305-02-0015-3
Figure 109133776-A0305-02-0016-5

舉例來說,表2中的第11個HPB項目關聯於LBA#11,LBA#11的使用者資料儲存在PBA”212344”並且連續位元表儲存”0x0000003F”(也就是”0b00000000000000000000000000111111”),指出LBA#11~17(共7個LBA)的使用者資料連續性地儲存在閃存裝置150中的實體位址。 For example, the 11th HPB entry in Table 2 is associated with LBA#11, the user data of LBA#11 is stored in PBA "212344" and the contiguous bit table is stored in "0x0000003F" (ie "0b00000000000000000000000000111111"), indicating that User data of LBAs #11 to 17 (7 LBAs in total) are continuously stored at physical addresses in the flash memory device 150 .

如果閃存裝置150中儲存的資料具有相當程度的不連續性(也可稱為隨機儲存於閃存裝置150),雖然事先提供了連續性資訊給閃存控制器130,當HPB讀取命令請求的傳輸長度大於HPB項目中攜帶的連續長度時,閃存控制器130也需要從閃存裝置150讀取相應的T1表並執行邏輯實體位址轉換。例如,搭配表1或表2的範例,當主機端110請求讀取LBA#3~10的使用者資料時,閃存控制器130依然要從閃存裝置150讀取T1表330#0。也就是說,當資料是隨機地儲存在閃存裝置150時,HPB讀取命令的執行效能相比於先前的UFS讀取命令幾乎相同。 If the data stored in the flash memory device 150 has a considerable degree of discontinuity (also referred to as random storage in the flash memory device 150 ), although the continuity information is provided to the flash memory controller 130 in advance, when the HPB read command requests the transfer length When the contiguous length is larger than that carried in the HPB entry, the flash controller 130 also needs to read the corresponding T1 table from the flash device 150 and perform logical physical address translation. For example, with the example of Table 1 or Table 2, when the host 110 requests to read the user data of LBAs #3-10, the flash controller 130 still needs to read the T1 table 330#0 from the flash memory device 150. That is, when the data is randomly stored in the flash memory device 150, the execution performance of the HPB read command is almost the same as that of the previous UFS read command.

在一些實施例中,當閃存控制器130(更明確地說,閃存控制器130中的處理單元134在執行特定韌體或軟體指令期間)在階段II中知道HPB快取500的子區中儲存的相應於多個連續LBA區間的HPB項目所對應的T1表時,閃存控制器130可分析對應T1表的內容來判斷HPB快取500的特定子區中的哪些LBA區間的使用者資料是隨機儲存在閃存裝置150中的實體位址。接著,閃存控制器130可在階段II 或階段III中,執行垃圾收集程序的背景操作,用於將指定LBA區間的使用者資料遷移(寫入)到閃存裝置150中的連續實體位址,並更新相應T1表和此子區的HPB項目。更新後的結果可先暫存於RAM 136。舉例來說,表1的範例HPB項目可更新如表3所示:

Figure 109133776-A0305-02-0017-7
Figure 109133776-A0305-02-0018-8
In some embodiments, when flash controller 130 (more specifically, processing unit 134 in flash controller 130 during execution of certain firmware or software instructions) is aware of storage in a subsection of HPB cache 500 in Phase II When there are T1 tables corresponding to HPB entries corresponding to multiple consecutive LBA intervals, the flash controller 130 can analyze the content of the corresponding T1 table to determine which LBA intervals in the specific sub-area of the HPB cache 500 have random user data The physical address stored in the flash memory device 150 . Then, the flash controller 130 may perform the background operation of the garbage collection procedure in phase II or phase III for migrating (writing) the user data of the specified LBA interval to the consecutive physical addresses in the flash memory device 150, and Update the corresponding T1 table and the HPB entry for this subregion. The updated result may be temporarily stored in RAM 136 first. For example, the example HPB project in Table 1 can be updated as shown in Table 3:
Figure 109133776-A0305-02-0017-7
Figure 109133776-A0305-02-0018-8

垃圾收集程序執行完成後,閃存控制器130通知主機端110更新此子區的HPB項目。當接收到更新訊息後,主機端110發出HPB讀取緩衝器命令來獲取更新的HPB項目,並據以更新HPB快取500中此子區的內容。所以,主機端110發送的HPB讀取命令中所請求讀取的一段連續LBA區間的使用者資料大多儲存在閃存裝置150中的連續實體位址,使得HPB讀取命令的執行效能可以進一步提升。 After the execution of the garbage collection procedure is completed, the flash controller 130 notifies the host 110 to update the HPB entry of the subarea. After receiving the update message, the host 110 issues an HPB read buffer command to obtain the updated HPB entry, and accordingly updates the content of the subarea in the HPB cache 500 . Therefore, most of the user data of a continuous LBA interval requested to be read in the HPB read command sent by the host 110 is stored in a continuous physical address in the flash memory device 150, so that the execution performance of the HPB read command can be further improved.

HPB規範定義了兩種取得HPB項目的模式:主機控制模式(Host Control Mode)和裝置控制模式(Device Control Mode)。主機控制模式由主機端110觸發,決定哪些HPB子區需要儲存在HPB快取500;而裝置控制模式則由快閃控制器130觸發,決定哪些HPB子區需要儲存在HPB快取500。所屬技術領域人員理解,本發明實施例涵蓋這兩種或其他類似的控制模式。 The HPB specification defines two modes for obtaining HPB items: Host Control Mode and Device Control Mode. The host control mode is triggered by the host 110 to determine which HPB subareas need to be stored in the HPB cache 500 ; and the device control mode is triggered by the flash controller 130 to determine which HPB subareas need to be stored in the HPB cache 500 . Those skilled in the art understand that the embodiments of the present invention cover these two or other similar control modes.

參考如圖7所示應用在主機控制模式的操作順序圖,詳細說明如下: Referring to the operation sequence diagram applied in the host control mode as shown in Figure 7, the detailed description is as follows:

操作711:主機端110決定哪些子區即將要啟動(Activated)。 Operation 711: The host 110 determines which sub-regions are about to be activated (Activated).

操作713:主機端110發送HPB讀取緩衝器命令給閃存控制器130,向閃存控制器130請求決定子區的HPB項目。HPB讀取緩衝器命令可包含10個位元組,其中第0個位元組紀錄操作碼(Operation Code)“F9h”、第2和第3個位元組紀錄即將啟動HPB區域的資訊以及第4和第5個位元組紀錄即將啟動子區的資訊。 Operation 713: The host 110 sends an HPB read buffer command to the flash controller 130, and requests the flash controller 130 to determine the HPB entry of the subarea. The HPB read buffer command can contain 10 bytes, of which the 0th byte records the operation code (Operation Code) "F9h", the 2nd and 3rd bytes record the information about the HPB area to be activated, and the first byte The 4th and 5th bytes record the information about the subarea to be activated.

操作715:閃存控制器130產生相應於啟動子區的HPB項目。關於產生操作715的技術細節可參考如圖8所示的HPB項目的產生和更新方法的流程圖,此方法由處理單元134於載入並執行相關軟體或韌體程式碼時實施,進一步說明如下: Operation 715: The flash controller 130 generates an HPB entry corresponding to the boot sub area. For the technical details of the generating operation 715, please refer to the flowchart of the method for generating and updating the HPB item shown in FIG. 8. This method is implemented by the processing unit 134 when the relevant software or firmware code is loaded and executed, which is further explained as follows :

步驟S810:驅動閃存介面139從閃存裝置150讀取特定T1表。 Step S810 : Drive the flash memory interface 139 to read the specific T1 table from the flash memory device 150 .

步驟S820:依據讀取T1表的內容編排成HPB項目。為了提升讀取的效率,除了PBA以外,處理單元134還在HPB項目中添加如上所述的PBA連續性資訊。 Step S820: Arrange HPB items according to the content of the read T1 table. In order to improve the efficiency of reading, in addition to the PBA, the processing unit 134 also adds the above-mentioned PBA continuity information to the HPB item.

步驟S830:觸發相應於啟動子區的垃圾收集程序的背景操作。在閃存控制器130接收到HPB讀取緩衝器命令之後,閃存控制器130除了把讀取的對照資訊編排HPB項目以回覆給主機端110外,還可觸發垃圾收集程序的背景操作,用於將啟動子區關聯的全部或指定部分LBA區間的使用者資料遷移(寫入)到閃存裝置150中的連續實體位址。處理單元134還可在RAM 136中維護一個變數,用於紀錄此啟動子區的垃圾收集程序的執行狀態。初始時,變數紀錄此啟動子區沒有關聯到任何垃圾收集程序的資訊。當垃圾收集程序觸發後,變數紀錄此啟動子區的垃圾收集程序正在執行的資訊。當每個批次的遷移(寫入)操作完成後,閃存控制器130更新暫存在RAM 136中的相應T1表和此子區的HPB項目,其中一個批次的遷移(寫入)操作相應於啟動子區中的一部分LBA區間的使用者資料。當垃圾收集程序執行完畢後,閃存控制器130更新變數,用於紀錄此啟動子區的垃圾收集程序已經執行完成的資訊。 Step S830: Trigger the background operation corresponding to the garbage collection program of the initiator sub-area. After the flash memory controller 130 receives the HPB read buffer command, the flash memory controller 130 not only arranges the read comparison information for the HPB entry to reply to the host 110, but also triggers the background operation of the garbage collection program to The user data of all or a specified part of the LBA interval associated with the initiator area is migrated (written) to the contiguous physical address in the flash memory device 150 . The processing unit 134 may also maintain a variable in the RAM 136 for recording the execution status of the garbage collector of the initiator area. Initially, the variable records information that this promoter region is not associated with any garbage collector. When the garbage collector is triggered, the variable records the information that the garbage collector in this initiator area is executing. Flash controller 130 updates the corresponding T1 table temporarily stored in RAM 136 and the HPB entry for this sub-area when each batch of migration (write) operations is completed, wherein a batch of migration (write) operations corresponds to User data for a portion of the LBA region in the promoter region. After the execution of the garbage collection procedure is completed, the flash controller 130 updates the variable for recording the information that the execution of the garbage collection procedure in the startup subarea has been completed.

請參考回圖7。操作717:閃存控制器130傳送資料輸入UFS協議資訊單元(DATA IN UFS Protocol Information Unit,UPIU)給主機端110。 Please refer back to Figure 7. Operation 717 : The flash controller 130 transmits a DATA IN UFS Protocol Information Unit (UPIU) to the host 110 .

如果相應垃圾收集程序尚未執行完成,則閃存控制器130先回覆包含原始HPB項目(如表1所示的範例)的資料輸入UPIU。之後,當從主機端110接收到相應於此啟動子區的HPB讀取命令時,閃存控制器130可不回覆請求讀取的使用者資料,而是先回覆訊息給主機端110,請主機端110更新此啟動子區的HPB項目。 If the corresponding garbage collection procedure has not been completed, the flash controller 130 first replies to the data input UPIU containing the original HPB entry (such as the example shown in Table 1). Afterwards, when receiving the HPB read command corresponding to the boot sub area from the host 110 , the flash controller 130 may not reply to the user data requested to be read, but first reply a message to the host 110 , requesting the host 110 Update the HPB project for this promoter region.

如果垃圾收集程序已經執行完成,則資料輸入UPIU包含更新後的HPB項目(如表3所示的範例)。在閃存控制器130將此啟動子區的 更新後的HPB項目傳送給主機端110之後,將RAM 136中的變數更新為此啟動子區沒有關聯到任何垃圾收集程序的資訊。 If the garbage collector has been executed, the data input UPIU contains the updated HPB entry (example shown in Table 3). In the flash controller 130, the After the updated HPB entry is sent to the host 110, the variable in the RAM 136 is updated to the information that the startup subarea is not associated with any garbage collector.

操作719:主機端110儲存接收到的HPB項目到HPB快取500中的啟動子區。 Operation 719 : the host 110 stores the received HPB entry into the promoter region in the HPB cache 500 .

操作731:主機端110決定哪些區域即將要關閉(Deactivated)。在這裡需要注意的是,在HPB規範中,啟動是以子區為單位,而關閉是以區域為單位,主機端110可依據其演算法的需求決定要啟動的子區以及要關閉的區域。 Operation 731: The host 110 determines which regions are about to be deactivated. It should be noted here that in the HPB specification, startup is based on sub-areas, and shutdown is in units of regions. The host 110 can determine the sub-region to be activated and the region to be closed according to the requirements of its algorithm.

操作733:主機端110發送HPB寫入緩衝器命令(HPB WRITE BUFFER command)給閃存控制器130,向閃存控制器130通知關閉決定的區域。HPB讀取緩衝器命令可包含10個位元組,其中第0個位元組紀錄操作碼“FAh”並且在第2和第3個位元組紀錄即將關閉區域的資訊。 Operation 733: The host side 110 sends an HPB write buffer command (HPB WRITE BUFFER command) to the flash controller 130, and notifies the flash controller 130 of the area determined to be closed. The HPB read buffer command may contain 10 bytes, wherein the 0th byte records the opcode "FAh" and the 2nd and 3rd bytes record the information of the area to be closed.

操作735:閃存控制器130關閉區域。舉例而言,閃存控制器130在將HPB項目傳送給主機端110之後,閃存控制器130可針對已啟動的子區對主機端110後續之讀取命令的讀取流程執行優化運作,而在收到主機端110關閉區域的通知後,閃存控制器130即可終止相應於關閉區域的相關優化運作。 Operation 735: The flash controller 130 closes the region. For example, after the flash memory controller 130 transmits the HPB item to the host side 110, the flash memory controller 130 can perform an optimization operation on the read process of the subsequent read command from the host side 110 for the activated sub-area, and then After the host 110 is notified of the closed area, the flash controller 130 can terminate the relevant optimization operation corresponding to the closed area.

操作751:如果必要,閃存控制器130在執行完特定啟動子區的垃圾收集程序後,驅動閃存介面139更新閃存裝置150中的相應T1表的內容。此外,閃存控制器130更新RAM 136中的特定變數,指出此啟動子區的垃圾收集程序已經執行完成的資訊。於此需注意的是,如果特定啟動子區的垃圾收集程序已經在操作715中執行完畢,則閃存控制器130不需要特別再執行更新操作751,從而之後的操作753至775也可以不需要再執行。 Operation 751 : If necessary, the flash controller 130 drives the flash interface 139 to update the content of the corresponding T1 table in the flash device 150 after executing the garbage collection procedure of the specific startup sub-region. In addition, the flash controller 130 updates a specific variable in the RAM 136 to indicate that the garbage collection process of the startup sub-region has been executed. It should be noted here that, if the garbage collection program of the specific promoter area has been executed in operation 715, the flash controller 130 does not need to perform the update operation 751, so the subsequent operations 753 to 775 do not need to be performed again. implement.

操作753:閃存控制器130傳送回覆UFS協議資訊單元(RESPONSE UPIU)給主機端110,其中包含建議主機端110更新上述子區的HPB 項目的資訊。 Operation 753 : The flash controller 130 transmits a reply UFS protocol information unit (RESPONSE UPIU) to the host 110 , which includes recommending the host 110 to update the HPB of the sub-region. project information.

操作755和757:主機端110發送HPB讀取緩衝器命令給閃存控制器130,向閃存控制器130請求關聯於建議子區的HPB項目。 Operations 755 and 757 : The host side 110 sends an HPB read buffer command to the flash controller 130 to request the flash controller 130 for the HPB entry associated with the proposed subregion.

操作771:閃存控制器130從RAM 136讀取上述子區的更新後HPB項目。 Operation 771 : The flash controller 130 reads the updated HPB entry of the above sub-area from the RAM 136 .

操作773:閃存控制器130傳送資料輸入UPIU給主機端110,其中包含上述子區的更新後HPB項目。 Operation 773: The flash controller 130 transmits the data input UPIU to the host 110, which includes the updated HPB entry of the above-mentioned sub-area.

操作775:主機端110將接收到的更新後HPB項目覆寫掉HPB快取500的啟動子區中的內容。 Operation 775: The host 110 overwrites the content in the promoter region of the HPB cache 500 with the received updated HPB entry.

在主機控制模式下,為了因應如上所述的背景操作,圖6中的讀取操作630的技術內容需要修改。參考如圖9所示的使用者資料讀取方法的流程圖,此方法由處理單元134於載入並執行相關軟體或韌體程式碼時實施,進一步說明如下: In the host control mode, the technical content of the read operation 630 in FIG. 6 needs to be modified in order to cope with the background operation as described above. Referring to the flowchart of the method for reading user data as shown in FIG. 9 , the method is implemented by the processing unit 134 when the relevant software or firmware code is loaded and executed, which is further described as follows:

步驟S910:處理單元134通過主機介面131從主機端110接收到HPB讀取命令,其中包含LBA、傳輸長度和HPB項目。 Step S910: The processing unit 134 receives the HPB read command from the host terminal 110 through the host interface 131, which includes the LBA, the transmission length and the HPB item.

步驟S920:處理單元134依據HPB讀取命令中的LBA和傳輸長度決定HPB讀取命令中HPB項目的所屬子區。 Step S920: The processing unit 134 determines the subarea to which the HPB item in the HPB read command belongs according to the LBA and the transmission length in the HPB read command.

步驟S930:處理單元134判斷所屬子區的HPB項目是否需要更新。如果是,流程繼續進行步驟S970的處理。否則,流程繼續進行步驟S950的處理。處理單元134可依據RAM 136中儲存的相應於所屬子區的變數進行判斷。如果此變數紀錄所屬子區沒有關聯到任何垃圾收集程序的資訊,則代表所屬子區的HPB項目不需要更新。如果此變數紀錄所屬子區的垃圾收集程序正在執行或者已經執行完成的資訊,則代表所屬子區的HPB項目需要更新。 Step S930: The processing unit 134 determines whether the HPB item of the sub-region to which it belongs needs to be updated. If so, the flow continues with the processing of step S970. Otherwise, the flow continues to the process of step S950. The processing unit 134 can judge according to the variables stored in the RAM 136 and corresponding to the sub-areas. If the sub-area to which this variable record belongs is not associated with any garbage collector information, the HPB entry representing the sub-area does not need to be updated. If this variable records the information that the garbage collector of the sub-area is executing or has been executed, it means that the HPB item of the sub-area to which it belongs needs to be updated.

步驟S950:處理單元134依據HPB讀取命令攜帶的HPB項目的內容,驅動閃存介面130從閃存裝置150讀取請求LBA區間的使用者資料。需要注意的是,由於經過垃圾收集程序的背景操作後,相應於所屬 子區的連續LBA的使用者資料大部分儲存在閃存裝置150中的連續實體位址,所以在大部分情況下處理單元134可直接依據HPB讀取命令攜帶的HPB項目的內容從閃存裝置150讀取請求LBA區間的使用者資料。 Step S950 : The processing unit 134 drives the flash memory interface 130 to read the user data of the requested LBA section from the flash memory device 150 according to the content of the HPB item carried by the HPB read command. It should be noted that, due to the background operation of the garbage collector, the corresponding Most of the user data of the consecutive LBAs of the subarea are stored in consecutive physical addresses in the flash memory device 150, so in most cases, the processing unit 134 can directly read the content of the HPB item carried by the HPB read command from the flash memory device 150. Get the user data of the requested LBA interval.

步驟S960:處理單元134驅動主機介面131傳送一或多個資料輸入UPIU給主機端,其中包含讀出的使用者資料。 Step S960: The processing unit 134 drives the host interface 131 to transmit one or more data input UPIUs to the host, including the read user data.

步驟S970:處理單元134驅動主機介面131傳送回覆UPIU給主機端110,其中包含建議主機端110更新上述子區的HPB項目的資訊。當主機端110接收到回覆UPIU後,主機端110可執行如圖7所述的發送操作755以啟動上述子區的HPB項目的更新。 Step S970 : The processing unit 134 drives the host interface 131 to transmit a reply UPIU to the host 110 , which includes the information suggesting that the host 110 update the HPB item of the sub-area. After the host 110 receives the reply UPIU, the host 110 can perform the sending operation 755 as described in FIG. 7 to start the update of the HPB item of the above-mentioned sub-area.

參考如圖10所示應用在裝置控制模式的操作順序圖,詳細說明如下: Referring to the operation sequence diagram applied in the device control mode as shown in Figure 10, the detailed description is as follows:

操作1011:閃存控制器130主動決定哪些子區即將要啟動和/或哪些區域即將關閉。 Operation 1011: The flash controller 130 actively decides which sub-regions are about to be powered on and/or which regions are about to be powered off.

操作1012:閃存控制器130產生相應於啟動子區的HPB項目。關於產生操作1012的技術細節可參考如上所述圖8中步驟S830的內容,為求簡明不再贅述。 Operation 1012: The flash controller 130 generates an HPB entry corresponding to the boot sub area. For the technical details of the generating operation 1012, reference may be made to the content of step S830 in FIG. 8 as described above, which will not be repeated for brevity.

操作1013:閃存控制器130傳送回覆UPIU給主機端110,其中建議主機端110啟動上述子區和/或關閉上述區域。由於在這個模式中是由裝置端決定何時啟動子區,所以,閃存控制器130可在相應於啟動子區的垃圾收集程序的背景操作完成後再傳送回覆UPIU給主機端110。 Operation 1013: The flash controller 130 transmits a reply UPIU to the host side 110, wherein the host side 110 is advised to activate the above-mentioned sub-area and/or close the above-mentioned area. In this mode, the device side decides when to activate the subarea, so the flash controller 130 can send a reply UPIU to the host side 110 after the background operation of the garbage collector corresponding to the subarea is completed.

操作1015:如果需要,主機端110從系統記憶體中捨棄那些不再有效的HPB區域的HPB項目。 Operation 1015: If necessary, the host side 110 discards the HPB entries of those HPB regions that are no longer valid from the system memory.

操作1031:如果需要,主機端110發送HPB讀取緩衝器命令給閃存控制器130,向閃存控制器130請求建議子區的HPB項目。 Operation 1031 : If necessary, the host side 110 sends an HPB read buffer command to the flash controller 130 to request the flash controller 130 for the HPB item of the proposed subarea.

操作1033:閃存控制器130從RAM 136讀取請求子區的HPB項目,其中每個HPB項目包含如上所述的PBA連續性資訊。 Operation 1033: The flash controller 130 reads the HPB entries of the requested subregion from the RAM 136, wherein each HPB entry contains the PBA continuity information as described above.

操作1035:閃存控制器130傳送資料輸入UPIU給主機端110,其中包含相應於上述子區的HPB項目。在傳送完相應於上述子區的HPB項目後,處理單元134可更新RAM 136中相應於上述子區的變數,用於記錄此子區沒有關聯到任何垃圾收集程序的資訊。 Operation 1035: The flash controller 130 transmits the data input UPIU to the host 110, which includes the HPB entry corresponding to the above-mentioned sub-area. After transferring the HPB entry corresponding to the above-mentioned sub-area, the processing unit 134 may update the variable corresponding to the above-mentioned sub-area in the RAM 136 to record the information that the sub-area is not associated with any garbage collection program.

操作1037:主機端110儲存接收到的HPB項目到HPB快取500中的啟動子區。 Operation 1037 : the host 110 stores the received HPB entry into the promoter region in the HPB cache 500 .

本發明所述的方法中的全部或部分步驟可以計算機指令實現,例如儲存裝置中的韌體轉換層(Firmware Translation Layer,FTL)、特定硬體的驅動程式等。此外,也可實現於其他類型程式。所屬技術領域具有通常知識者可將本發明實施例的方法撰寫成計算機指令,為求簡潔不再加以描述。依據本發明實施例方法實施的計算機指令可儲存於適當的電腦可讀取媒體,例如DVD、CD-ROM、USB碟、硬碟,亦可置於可通過網路(例如,網際網路,或其他適當載具)存取的網路伺服器。 All or part of the steps in the method of the present invention can be implemented by computer instructions, such as a firmware translation layer (Firmware Translation Layer, FTL) in a storage device, a driver of a specific hardware, and the like. In addition, it can also be implemented in other types of programs. Those skilled in the art can compose the methods of the embodiments of the present invention into computer instructions, which will not be described for brevity. Computer instructions for implementing methods according to embodiments of the present invention may be stored in a suitable computer-readable medium, such as DVD, CD-ROM, USB disk, hard disk, or may be other suitable vehicles) to access the web server.

雖然圖1至圖2中包含了以上描述的元件,但不排除在不違反發明的精神下,使用更多其他的附加元件,已達成更佳的技術效果。此外,雖然圖8、圖9的流程圖採用指定的順序來執行,但是在不違反發明精神的情況下,熟習此技藝人士可以在達到相同效果的前提下,修改這些步驟間的順序,所以,本發明並不侷限於僅使用如上所述的順序。此外,熟習此技藝人士亦可以將若干步驟整合為一個步驟,或者是除了這些步驟外,循序或平行地執行更多步驟,本發明亦不因此而侷限。 Although the above-described elements are included in FIGS. 1 to 2 , it is not excluded that more other additional elements may be used to achieve better technical effects without departing from the spirit of the invention. In addition, although the flowcharts of Fig. 8 and Fig. 9 are executed in the specified order, those skilled in the art can modify the order of these steps under the premise of achieving the same effect without violating the spirit of the invention. Therefore, The present invention is not limited to using only the sequence described above. In addition, those skilled in the art can also integrate several steps into one step, or in addition to these steps, perform more steps sequentially or in parallel, and the present invention is not limited thereby.

雖然本發明使用以上實施例進行說明,但需要注意的是,這些描述並非用以限縮本發明。相反地,此發明涵蓋了熟習此技藝人士顯而易見的修改與相似設置。所以,申請權利要求範圍須以最寬廣的方式解釋來包含所有顯而易見的修改與相似設置。 Although the present invention is described using the above embodiments, it should be noted that these descriptions are not intended to limit the present invention. On the contrary, this invention covers modifications and similar arrangements obvious to those skilled in the art. Therefore, the scope of the appended claims is to be construed in the broadest manner so as to encompass all obvious modifications and similar arrangements.

S810~S830:方法步驟 S810~S830: method steps

Claims (14)

一種管理資料儲存的方法,由一閃存控制器執行,包含:從一主機端發送的一第一讀取命令中獲取即將啟動的一子區的資訊,其中上述子區關聯於一段邏輯區塊位址區間,以及上述第一讀取命令請求上述閃存控制器提供關聯於上述子區的多個項目,用於儲存關聯於上述子區的上述多個項目至上述主機端中的一系統記憶體中;在接收到上述第一讀取命令後,觸發一垃圾收集程序的背景操作,用於將上述子區關聯的全部或一部分上述邏輯區塊位址區間的使用者資料遷移到一閃存裝置中的連續實體位址;以及依據遷移結果更新相應於上述子區的多個項目的內容,其中,每個上述項目包含一邏輯區塊位址的使用者資料實際儲存於上述閃存裝置中的一實體位址的資訊。 A method for managing data storage, executed by a flash memory controller, comprising: obtaining information of a sub-area to be activated from a first read command sent by a host, wherein the sub-area is associated with a segment of logical block bits address interval, and the first read command requests the flash memory controller to provide a plurality of items associated with the sub-area for storing the plurality of items associated with the sub-area to a system memory in the host side After receiving the above-mentioned first read command, trigger a background operation of a garbage collection program for migrating all or part of the user data in the above-mentioned sub-area associated with the above-mentioned logical block address interval to a flash memory device. Consecutive physical addresses; and updating the contents of a plurality of items corresponding to the sub-areas according to the migration result, wherein each of the items includes user data of a logical block address that is actually stored in a physical bit in the flash memory device address information. 如請求項1所述的管理資料儲存的方法,其中,每個上述項目包含連續性資訊,描述一相應邏輯區塊位址之後的特定邏輯區塊位址區間的使用者資料儲存在上述閃存裝置中的連續實體位址。 The method for managing data storage according to claim 1, wherein each of the above items includes continuity information, and the user data describing a specific logical block address interval following a corresponding logical block address is stored in the flash memory device Consecutive physical addresses in . 如請求項1所述的管理資料儲存的方法,包含:在上述垃圾收集程序執行完畢後,傳送一回覆給上述主機端,包含建議上述主機端更新上述子區的多個項目;從上述主機端接收一第二讀取命令,上述第二讀取命令請求上述閃存控制器提供關聯於上述子區的多個項目;讀取上述子區的上述更新後的項目;以及傳送上述子區的上述更新後的項目給上述主機端。 The method for managing data storage according to claim 1, comprising: after the execution of the garbage collection program is completed, sending a reply to the host side, including suggesting that the host side update a plurality of items in the sub-area; from the host side Receive a second read command, the second read command requests the flash controller to provide a plurality of items associated with the sub-area; read the updated items of the sub-area; and transmit the update of the sub-area After the project to the above host side. 如請求項1所述的管理資料儲存的方法,包含:觸發上述垃圾收集程序的背景操作時,更新一第一變數,用於記錄上述垃圾收集程序正在執行的資訊;以及在上述垃圾收集程序執行完畢後,更新上述第一變數,用於記錄上述垃圾收集程序已經執行完成的資訊。 The method for managing data storage according to claim 1, comprising: when a background operation of the garbage collection program is triggered, updating a first variable for recording information that the garbage collection program is executing; and when the garbage collection program is executed After the completion, the first variable is updated to record the information that the garbage collection program has been executed. 如請求項4所述的管理資料儲存的方法,包含:從上述主機端接收一第三讀取命令,其中上述第三讀取命令包含一邏輯區塊位址、一傳輸長度和一項目;依據上述邏輯區塊位址和上述傳輸長度決定上述項目的所屬子區;以及當相應於上述所屬子區的一第二變數紀錄相應於上述所屬子區的垃圾收集程序正在執行或者已經執行完成的資訊時,傳送一回覆給上述主機端,包含建議上述主機端更新上述所屬子區的多個項目。 The method for managing data storage according to claim 4, comprising: receiving a third read command from the host, wherein the third read command includes a logical block address, a transmission length and an item; according to The above-mentioned logical block address and the above-mentioned transmission length determine the sub-area to which the above-mentioned item belongs; and when a second variable corresponding to the above-mentioned sub-area records information that the garbage collection program corresponding to the above-mentioned sub-area is being executed or has been executed , sending a reply to the host, including suggesting that the host update a plurality of items in the sub-area to which it belongs. 如請求項1所述的管理資料儲存的方法,包含:主動決定即將啟動的上述子區。 The method for managing data storage according to claim 1, comprising: actively determining the above-mentioned sub-areas to be activated. 一種電腦程式產品,包含一程式碼,其中,當上述程式碼被一閃存控制器的一處理單元載入並執行時,實現如請求項1至6中任一項所述的管理資料儲存的方法。 A computer program product, comprising a program code, wherein, when the program code is loaded and executed by a processing unit of a flash memory controller, the method for managing data storage as described in any one of claims 1 to 6 is implemented . 一種管理資料儲存的裝置,包含:一閃存介面,耦接一閃存裝置;一處理單元,耦接上述閃存介面,用於從一主機端發送的一第一讀 取命令中獲取即將啟動的一子區的資訊,其中上述子區關聯於一段邏輯區塊位址區間,以及上述第一讀取命令請求上述閃存控制器提供關聯於上述子區的多個項目,用於儲存關聯於上述子區的上述多個項目至上述主機端中的一系統記憶體中;在接收到上述第一讀取命令後,觸發一垃圾收集程序的背景操作,用於驅動上述閃存介面將上述子區關聯的全部或一部分上述邏輯區塊位址區間的使用者資料遷移到一閃存裝置中的連續實體位址;以及依據遷移結果更新相應於上述子區的多個項目的內容,其中,每個上述項目包含一邏輯區塊位址的使用者資料實際儲存於上述閃存裝置中的一實體位址的資訊。 A device for managing data storage, comprising: a flash memory interface coupled to a flash memory device; a processing unit coupled to the flash memory interface for a first read sent from a host Obtaining information about a sub-area to be activated in the fetch command, wherein the sub-area is associated with a logical block address range, and the first read command requests the flash memory controller to provide a plurality of items associated with the sub-area, for storing the above-mentioned multiple items associated with the above-mentioned sub-areas in a system memory in the above-mentioned host side; after receiving the above-mentioned first read command, triggering a background operation of a garbage collection program for driving the above-mentioned flash memory The interface migrates all or a part of the user data in the logical block address range associated with the sub-area to consecutive physical addresses in a flash memory device; and updates the contents of a plurality of items corresponding to the sub-area according to the migration result, Wherein, each of the above-mentioned items includes information of a physical address where the user data of a logical block address is actually stored in the above-mentioned flash memory device. 如請求項8所述的管理資料儲存的裝置,其中,每個上述項目包含連續性資訊,描述一相應邏輯區塊位址之後的特定邏輯區塊位址區間的使用者資料儲存在上述閃存裝置中的連續實體位址。 The device for managing data storage as claimed in claim 8, wherein each of the above items includes continuity information, and user data describing a specific logical block address interval following a corresponding logical block address is stored in the flash memory device Consecutive physical addresses in . 如請求項8所述的管理資料儲存的裝置,包含:一主機介面,耦接上述主機端和上述處理單元,其中,上述處理單元通過上述主機介面從上述主機端接收上述第一讀取命令。 The device for managing data storage according to claim 8, comprising: a host interface coupled to the host and the processing unit, wherein the processing unit receives the first read command from the host through the host interface. 如請求項10所述的管理資料儲存的裝置,其中,上述處理單元在上述垃圾收集程序執行完畢後,通過上述主機介面傳送一回覆給上述主機端,包含建議上述主機端更新上述子區的多個項目;通過上述主機介面從上述主機端接收一第二讀取命令,上述第二讀取命令請求閃存控制器提供關聯於上述子區的多個項目;讀取上述子區的上述更新後的項目;以及通過上述主機介面傳送上述子區的上述更新後的項目給上述主機端。 The device for managing data storage according to claim 10, wherein the processing unit sends a reply to the host through the host interface after the garbage collection program is executed, including a number of suggestions for the host to update the sub-area. receive a second read command from the host side through the host interface, the second read command requests the flash memory controller to provide a plurality of items associated with the sub-area; read the updated sub-area item; and transmitting the updated item of the sub-area to the host through the host interface. 如請求項10所述的管理資料儲存的裝置,包含:一隨機存取記憶體,耦接上述處理單元,儲存一第一變數,其中,上述處理單元觸發上述垃圾收集程序的背景操作時,更新上述第一變數,用於記錄上述垃圾收集程序正在執行的資訊;以及上述處理單元在上述垃圾收集程序執行完畢後,更新上述第一變數,用於記錄上述垃圾收集程序已經執行完成的資訊。 The device for managing data storage according to claim 10, comprising: a random access memory, coupled to the processing unit, to store a first variable, wherein when the processing unit triggers the background operation of the garbage collection program, update The first variable is used to record the information that the garbage collection program is being executed; and the processing unit updates the first variable after the garbage collection program is executed, and is used to record the information that the garbage collection program has been executed. 如請求項12所述的管理資料儲存的裝置,其中,上述處理單元通過上述主機介面從上述主機端接收一第三讀取命令,其中上述第三讀取命令包含一邏輯區塊位址、一傳輸長度和一項目;依據上述邏輯區塊位址和上述傳輸長度決定上述項目的所屬子區;以及當相應於上述所屬子區的一第二變數紀錄相應於上述所屬子區的垃圾收集程序正在執行或者已經執行完成的資訊時,通過上述主機介面傳送一回覆給上述主機端,包含建議上述主機端更新上述所屬子區的多個項目。 The device for managing data storage according to claim 12, wherein the processing unit receives a third read command from the host through the host interface, wherein the third read command includes a logical block address, a transfer length and an item; determine the sub-area to which the item belongs according to the logical block address and the transfer length; and when a second variable record corresponding to the sub-area corresponds to the garbage collection process of the sub-area When the information is executed or has been executed, a reply is sent to the host through the host interface, including suggesting that the host update a plurality of items in the sub-area to which it belongs. 如請求項8所述的管理資料儲存的裝置,其中,上述處理單元主動決定即將啟動的上述子區。 The device for managing data storage according to claim 8, wherein the processing unit actively determines the sub-area to be activated.
TW109133776A 2020-04-27 2020-09-29 Method and apparatus and computer program product for managing data storage TWI756854B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US202063015905P 2020-04-27 2020-04-27
US63/015,905 2020-04-27

Publications (2)

Publication Number Publication Date
TW202141280A TW202141280A (en) 2021-11-01
TWI756854B true TWI756854B (en) 2022-03-01

Family

ID=78415607

Family Applications (1)

Application Number Title Priority Date Filing Date
TW109133776A TWI756854B (en) 2020-04-27 2020-09-29 Method and apparatus and computer program product for managing data storage

Country Status (2)

Country Link
CN (1) CN113641597A (en)
TW (1) TWI756854B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI829363B (en) * 2022-09-26 2024-01-11 慧榮科技股份有限公司 Data processing method and the associated data storage device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI808011B (en) * 2022-09-26 2023-07-01 慧榮科技股份有限公司 Data processing method and the associated data storage device

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201118570A (en) * 2009-11-16 2011-06-01 Mediatek Inc Methods of utilizing address mapping table to manage data access of storage medium without physically accessing storage medium and related storage controllers thereof
US8316176B1 (en) * 2010-02-17 2012-11-20 Western Digital Technologies, Inc. Non-volatile semiconductor memory segregating sequential data during garbage collection to reduce write amplification
US20170060479A1 (en) * 2015-08-31 2017-03-02 Samsung Electronics Co., Ltd. Storage device configured to manage plural data streams based on data amount
US20180232151A1 (en) * 2015-09-14 2018-08-16 Microsoft Technology Licensing, Llc. Data storage system with data storage devices operative to manage storage device functions specific to a particular data storage device
TW201839611A (en) * 2017-04-25 2018-11-01 慧榮科技股份有限公司 Data storage devices and methods for rebuilding a mapping table thereof
US20190163621A1 (en) * 2017-11-24 2019-05-30 Samsung Electronics Co., Ltd. Data management method and storage device performing the same
TW201939288A (en) * 2018-03-09 2019-10-01 深圳大心電子科技有限公司 Data moving method and storage controller
TW202006553A (en) * 2017-09-22 2020-02-01 慧榮科技股份有限公司 Methods for internal data movement of a flash memory and apparatuses using the same
TW202008168A (en) * 2018-08-01 2020-02-16 大陸商深圳大心電子科技有限公司 Memory management method and storage controller
TW202013183A (en) * 2018-09-17 2020-04-01 慧榮科技股份有限公司 High efficiency garbage collection method, and associated data storage device and controller thereof

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9323667B2 (en) * 2012-04-12 2016-04-26 Violin Memory Inc. System and method for managing trim operations in a flash memory system using mapping tables and block status tables
TWI629591B (en) * 2017-08-30 2018-07-11 慧榮科技股份有限公司 Method for accessing flash memory module and associated flash memory controller and electronic device
TWI727185B (en) * 2018-07-09 2021-05-11 慧榮科技股份有限公司 Apparatus and method for searching linked lists
CN110908925B (en) * 2018-09-17 2022-01-25 慧荣科技股份有限公司 High-efficiency garbage collection method, data storage device and controller thereof

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201118570A (en) * 2009-11-16 2011-06-01 Mediatek Inc Methods of utilizing address mapping table to manage data access of storage medium without physically accessing storage medium and related storage controllers thereof
US8316176B1 (en) * 2010-02-17 2012-11-20 Western Digital Technologies, Inc. Non-volatile semiconductor memory segregating sequential data during garbage collection to reduce write amplification
US20170060479A1 (en) * 2015-08-31 2017-03-02 Samsung Electronics Co., Ltd. Storage device configured to manage plural data streams based on data amount
US20180232151A1 (en) * 2015-09-14 2018-08-16 Microsoft Technology Licensing, Llc. Data storage system with data storage devices operative to manage storage device functions specific to a particular data storage device
TW201839611A (en) * 2017-04-25 2018-11-01 慧榮科技股份有限公司 Data storage devices and methods for rebuilding a mapping table thereof
TW202006553A (en) * 2017-09-22 2020-02-01 慧榮科技股份有限公司 Methods for internal data movement of a flash memory and apparatuses using the same
US20190163621A1 (en) * 2017-11-24 2019-05-30 Samsung Electronics Co., Ltd. Data management method and storage device performing the same
TW201939288A (en) * 2018-03-09 2019-10-01 深圳大心電子科技有限公司 Data moving method and storage controller
TW202008168A (en) * 2018-08-01 2020-02-16 大陸商深圳大心電子科技有限公司 Memory management method and storage controller
TW202013183A (en) * 2018-09-17 2020-04-01 慧榮科技股份有限公司 High efficiency garbage collection method, and associated data storage device and controller thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI829363B (en) * 2022-09-26 2024-01-11 慧榮科技股份有限公司 Data processing method and the associated data storage device

Also Published As

Publication number Publication date
CN113641597A (en) 2021-11-12
TW202141280A (en) 2021-11-01

Similar Documents

Publication Publication Date Title
TWI678618B (en) Method and apparatus for performing operations to namespaces of a flash memory device
TWI719654B (en) Apparatus and method and computer program product for handling flash physical-resource sets
US11580017B2 (en) Method and apparatus and computer program product for preparing logical-to-physical mapping information for host side
TWI756854B (en) Method and apparatus and computer program product for managing data storage
CN112214158B (en) Device and method for executing host output and input command and computer readable storage medium
KR20130081526A (en) Storage device, electronic device having the same, and data management methods thereof
US11573732B2 (en) Storage device, memory system comprising the same, and operation method thereof
US11544185B2 (en) Method and apparatus for data reads in host performance acceleration mode
TWI754396B (en) Method and apparatus and computer program product for storing data in flash memory
TWI760884B (en) Method and apparatus for data reads in host performance acceleration mode
TWI835027B (en) Method and computer program product and apparatus for updating host-to-flash address mapping table
TWI810876B (en) Method and computer program product and apparatus for data access in response to host discard commands
TWI814647B (en) Method and computer program product and apparatus for executing host commands
TWI749490B (en) Computer program product and method and apparatus for programming flash administration tables
TWI760262B (en) Data storage device and data processing method
TWI758745B (en) Computer program product and method and apparatus for scheduling executions of host commands
TW202321921A (en) Method and computer program product and apparatus for updating host-to-flash address mapping table
TW202145042A (en) Method and apparatus for encrypting and decrypting physical address information
CN113448487A (en) Computer readable storage medium, method and device for writing flash memory management table
CN116149540A (en) Method for updating host and flash memory address comparison table, computer readable storage medium and device