TWI679535B - Methods for internal data movement of a flash memory and apparatuses using the same - Google Patents

Methods for internal data movement of a flash memory and apparatuses using the same Download PDF

Info

Publication number
TWI679535B
TWI679535B TW107101541A TW107101541A TWI679535B TW I679535 B TWI679535 B TW I679535B TW 107101541 A TW107101541 A TW 107101541A TW 107101541 A TW107101541 A TW 107101541A TW I679535 B TWI679535 B TW I679535B
Authority
TW
Taiwan
Prior art keywords
data
internal
command
hard disk
state hard
Prior art date
Application number
TW107101541A
Other languages
Chinese (zh)
Other versions
TW201915743A (en
Inventor
林聖嵂
Sheng Liu Lin
Original Assignee
慧榮科技股份有限公司
Silicon Motion, Inc.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 慧榮科技股份有限公司, Silicon Motion, Inc. filed Critical 慧榮科技股份有限公司
Priority to CN202210242579.7A priority Critical patent/CN114546293A/en
Priority to CN201810209548.5A priority patent/CN109542335B/en
Priority to US16/015,703 priority patent/US10782910B2/en
Publication of TW201915743A publication Critical patent/TW201915743A/en
Application granted granted Critical
Publication of TWI679535B publication Critical patent/TWI679535B/en

Links

Abstract

本發明的實施例提出一種快閃記憶體的資料內部搬移方法,由主裝置執行,包含下列步驟:偵測到固態硬碟中的輸出入通道的使用狀態滿足條件時,產生內部搬移命令;以及提供內部搬移命令以指示固態硬碟於輸出入通道中執行內部資料搬移作業。 An embodiment of the present invention provides a method for internal data transfer of flash memory, which is executed by a host device and includes the following steps: when a use state of an input / output channel in a solid-state hard drive is detected to satisfy a condition, an internal transfer command is generated; and Provide an internal transfer command to instruct the solid-state hard disk to perform internal data transfer operations in the input and output channels.

Description

快閃記憶體的資料內部搬移方法以及使用該方法的裝置 Method for internally transferring data of flash memory and device using same

本發明關連於一種快閃記憶體,特別是一種快閃記憶體的資料內部搬移方法以及使用該方法的裝置。 The invention relates to a flash memory, in particular to a method for internally transferring data in the flash memory and a device using the method.

快閃記憶體裝置通常分為NOR快閃裝置與NAND快閃裝置。NOR快閃裝置為隨機存取裝置,主裝置(Host)可於位址腳位上提供存取NOR快閃裝置的任意位址,並即時地由NOR快閃裝置的資料腳位上獲得儲存於該位址上的使用者資料。相反地,NAND快閃裝置並非隨機存取,而是序列存取。NAND快閃裝置無法像NOR快閃裝置一樣,可以存取任何隨機位址,主裝置反而需要寫入序列的位元組(Bytes)到NAND快閃裝置中,用以定義請求命令(Command)的類型(如,讀取、寫入、抹除等),以及此命令上的位址。位址可指向一個頁面(在快閃記憶體中的一個寫入作業的最小資料塊)或一個區塊(在快閃記憶體中的一個抹除作業的最小資料塊)。實際上,NAND快閃裝置通常從記憶體單元(Memory Cells)上讀取或寫入完整的數頁資料。當一整頁的資料從陣列讀取到裝置中的緩存器(Buffer)後,藉由使用提取訊號(Strobe Signal)順序地敲出(Clock Out)內容,讓主單元可逐位元組或字元組(Words)存取資料。 Flash memory devices are generally divided into NOR flash devices and NAND flash devices. The NOR flash device is a random access device. The host device can provide an arbitrary address for accessing the NOR flash device on the address pin, and it can be obtained from the data pin of the NOR flash device and stored in real time. User data at that address. In contrast, NAND flash devices are not random access, but serial access. A NAND flash device cannot access any random address like a NOR flash device. Instead, the master device needs to write serial bytes to the NAND flash device to define the request command. The type (for example, read, write, erase, etc.), and the address on this command. The address can point to a page (the smallest data block of a write operation in flash memory) or a block (the smallest data block of an erase operation in flash memory). In fact, NAND flash devices usually read or write complete pages of data from memory cells. When a whole page of data is read from the array to the buffer in the device, the content of Clock Out is sequentially knocked out by using the Strobe Signal, so that the main unit can be byte-by-byte or word-by-byte. Words to access data.

開放通道固態硬碟(Open-Channel Solid State Disk)系統包括開放通道固態硬碟(裝置端)以及主裝置,並不在裝置端實施快閃記憶體翻譯層(FTL,Flash Translation Layer),反而在主裝置實施快閃記憶體翻譯層。不同於傳統的固態硬碟,開放通道固態硬碟讓主裝置知道固態硬碟內部的操作參數,並允許主裝置依據操作參數對開放通道固態硬碟進行操作,即進行資料的管理。然而,目前的開放通道固態硬碟只包含三種基本的存取命令:抹除;讀取;及寫入。當主裝置執行一連串讀取及寫入才能完成的存取程序時,例如垃圾收集(GC,Garbage Collection)、耗損平均(Wear Leveling)等時,需要透過開放通道固態硬碟的存取介面傳輸資料,耗費大量存取介面的頻寬。 The Open-Channel Solid State Disk (Open-Channel Solid State Disk) system includes an open-channel solid state disk (device side) and the main device. A Flash Translation Layer (FTL) is not implemented on the device side. The device implements a flash memory translation layer. Unlike traditional solid state drives, open channel SSDs let the host device know the operating parameters inside the solid state drive and allow the host device to operate the open channel SSDs based on the operating parameters, that is, to manage data. However, current open channel solid state drives only contain three basic access commands: erase; read; and write. When the host device executes a series of read and write access procedures, such as garbage collection (GC, Garbage Collection), wear leveling (Wear Leveling), etc., data needs to be transmitted through the open channel solid-state hard disk access interface , Which consumes a lot of bandwidth of the access interface.

因此,需要一種快閃記憶體的資料內部搬移方法以及使用該方法的裝置,用以解決如上所述的問題。 Therefore, a method for internally transferring data in a flash memory and a device using the method are needed to solve the problems described above.

本發明的實施例提出一種快閃記憶體的資料內部搬移方法,由主裝置執行,包含下列步驟:偵測到固態硬碟中的輸出入通道的使用狀態滿足條件時,產生內部搬移命令;以及提供內部搬移命令以指示固態硬碟於輸出入通道中執行內部資料搬移作業。 An embodiment of the present invention provides a method for internal data transfer of flash memory, which is executed by a host device and includes the following steps: when a use state of an input / output channel in a solid-state hard drive is detected to satisfy a condition, an internal transfer command is generated; and Provide an internal transfer command to instruct the solid-state hard disk to perform internal data transfer operations in the input and output channels.

本發明的實施例提出一種快閃記憶體的資料內部搬移裝置,包含主裝置。主裝置偵測到固態硬碟中的輸出入通道的使用狀態滿足條件時,產生內部搬移命令;以及提供內部搬移命令以指示固態硬碟於輸出入通道中執行內部資料搬移作業。 An embodiment of the present invention provides a data internal moving device of a flash memory, including a main device. When the host device detects that the use status of the input / output channel in the solid-state hard disk meets the conditions, it generates an internal move command; and provides an internal move command to instruct the solid-state hard disk to perform an internal data move operation in the input / output channel.

本發明的實施例另提出一種快閃記憶體的資料內部搬移方法,由固態硬碟中的處理單元執行,包含下列步驟:取得由主裝置產生的內部搬移命令,其中內部搬移命令指示固態硬碟於輸出入通道中執行內部資料搬移作業,包含指向資料緩衝區中的第一筆資料搬移紀錄的記憶體位址;從資料緩衝區中的記憶體位址開始取得多筆資料搬移紀錄,其中,資料搬移紀錄中之每一者包含來源位置;為每一來源位置決定輸出入通道中的目的地位置;指示快閃控制器要求輸出入通道執行複製回寫程序將輸出入通道中的每一來源位置的使用者資料搬移至決定的目的地位置;以及回覆每一來源位置的決定的目的地位置給主裝置。 An embodiment of the present invention further provides a flash memory data internal moving method, which is executed by a processing unit in a solid state hard disk and includes the following steps: obtaining an internal moving command generated by the main device, wherein the internal moving command indicates the solid state hard disk; Perform internal data transfer operations in the input and output channels, including the memory address that points to the first data transfer record in the data buffer; obtain multiple data transfer records from the memory address in the data buffer, where data transfer Each record contains the source location; determines the destination location in the input / output channel for each source location; instructs the flash controller to request the input / output channel to perform a copy-write procedure to copy each source location in the input / output channel. The user data is moved to the determined destination location; and the determined destination location is returned to the host device for each source location.

本發明的實施例另提出一種快閃記憶體的資料內部搬移裝置,包含快閃控制器及處理單元。處理單元耦接於快閃控制器,取得由主裝置產生的內部搬移命令,其中內部搬移命令指示固態硬碟於輸出入通道中執行內部資料搬移作業,包含指向資料緩衝區中的第一筆資料搬移紀錄的記憶體位址;從資料緩衝區中的記憶體位址開始取得多筆資料搬移紀錄,其中,資料搬移紀錄中之每一者包含來源位置;為每一來源位置決定輸出入通道中的目的地位置;指示快閃控制器要求輸出入通道執行複製回寫程序將輸出入通道中的每一來源位置的使用者資料搬移至決定的目的地位置;以及回覆每一來源位置的目的地位置給主裝置。 An embodiment of the present invention further provides a flash internal memory data moving device, which includes a flash controller and a processing unit. The processing unit is coupled to the flash controller and obtains an internal transfer command generated by the main device. The internal transfer command instructs the solid-state hard disk to perform an internal data transfer operation in the input / output channel, including the first data pointed to the data buffer. Memory address of the transfer record; multiple data transfer records are obtained starting from the memory address in the data buffer, where each of the data transfer records includes the source location; for each source location, the purpose of the input and output channels is determined Local location; instruct the flash controller to request the input and output channels to perform a copy-write procedure to move the user data of each source location in the input and output channels to the determined destination location; and reply to the destination location of each source location to The main unit.

110‧‧‧主裝置 110‧‧‧Master

120‧‧‧資料緩衝器 120‧‧‧Data Buffer

130‧‧‧固態硬碟 130‧‧‧Solid State Drive

133‧‧‧處理單元 133‧‧‧Processing unit

135‧‧‧快閃控制器 135‧‧‧Flash Controller

137‧‧‧存取介面 137‧‧‧Access interface

137_0~137_j‧‧‧存取子介面 137_0 ~ 137_ j ‧‧‧ accessor interface

139‧‧‧儲存單元 139‧‧‧Storage unit

139_0_0~139_j_i‧‧‧儲存子單元 139_0_0 ~ 139_ j _ i ‧‧‧Storage subunit

310_0‧‧‧資料線 310_0‧‧‧Data Line

320_0_0~320_0_i‧‧‧晶片致能控制訊號 320_0_0 ~ 320_0_ i ‧‧‧ Chip enable control signal

410、430、450、470‧‧‧輸出入通道 410, 430, 450, 470‧‧‧ I / O channels

410_0~410_m、430_0~430_m、450_0~450_m、470_0~470_m‧‧‧資料平面 410_0 ~ 410_ m , 430_0 ~ 430_ m , 450_0 ~ 450_ m , 470_0 ~ 470_ m ‧‧‧ data plane

490_0~490_n‧‧‧超頁面 490_0 ~ 490_ n ‧‧‧ Hyper Page

P#0~p#(n)‧‧‧實體頁面 P # 0 ~ p # ( n ) ‧‧‧physical page

510‧‧‧遞交佇列 510‧‧‧Submission queue

530‧‧‧完成佇列 530‧‧‧Complete queue

S1110~S1360‧‧‧方法步驟 S1110 ~ S1360‧‧‧Method steps

710、730、750、770‧‧‧實體區塊 710, 730, 750, 770‧‧‧ physical blocks

P1~P4‧‧‧實體頁面 P1 ~ P4‧‧‧physical page

711、733、755、757‧‧‧區段 Sections 711, 733, 755, 757‧‧‧

810、830‧‧‧實體區塊 810, 830‧‧‧ physical block

P5~P8‧‧‧實體頁面 P5 ~ P8‧‧‧physical page

S9110~S9120、S9310~S9330‧‧‧方法步驟 S9110 ~ S9120, S9310 ~ S9330‧‧‧Method steps

1000‧‧‧內部搬移命令 1000‧‧‧ Internal Move Order

1010‧‧‧操作碼 1010‧‧‧opcode

1020‧‧‧寫入模式 1020‧‧‧write mode

1030‧‧‧命令識別碼 1030‧‧‧Command ID

1040‧‧‧命名空間識別碼 1040‧‧‧namespace identifier

1050‧‧‧主要記憶體位址 1050‧‧‧Main memory address

1060‧‧‧延伸記憶體位址 1060‧‧‧ extended memory address

1070‧‧‧實體區段資訊 1070‧‧‧ Entity Section Information

1080‧‧‧搬移區段數量 1080‧‧‧ Number of moving sections

1100‧‧‧完成元件 1100‧‧‧Complete components

1110‧‧‧實體區域頁面紀錄 1110‧‧‧ physical area page record

1120‧‧‧狀態旗標 1120‧‧‧Status Flag

1130‧‧‧命令識別碼 1130‧‧‧Command ID

1210‧‧‧存取子介面 1210‧‧‧Accessor Interface

1230‧‧‧直接資料存取電路 1230‧‧‧Direct Data Access Circuit

1250‧‧‧寄存器 1250‧‧‧Register

1310‧‧‧存取子介面 1310‧‧‧Accessor Interface

1330‧‧‧直接資料存取電路 1330‧‧‧Direct Data Access Circuit

1350‧‧‧寄存器 1350‧‧‧Register

第1圖係依據本發明實施例之快閃記憶體的系統架構示意圖。 FIG. 1 is a schematic diagram of a system architecture of a flash memory according to an embodiment of the present invention.

第2圖係依據本發明實施例之存取介面與儲存單元的方塊圖。 FIG. 2 is a block diagram of an access interface and a storage unit according to an embodiment of the present invention.

第3圖係依據本發明實施例之一個存取子介面與多個儲存子單元的連接示意圖。 FIG. 3 is a schematic diagram of connection between an accessor interface and a plurality of storage subunits according to an embodiment of the present invention.

第4圖係儲存單元的示意圖。 Figure 4 is a schematic diagram of a storage unit.

第5圖係命令佇列示意圖。 Figure 5 is a schematic diagram of the command queue.

第6圖係資料存取命令的執行步驟的流程圖。 FIG. 6 is a flowchart of the execution steps of the data access command.

第7圖係依據一些實施方式之垃圾回收示意圖。 FIG. 7 is a schematic diagram of garbage recycling according to some embodiments.

第8圖係依據一些實施方式之耗損平均示意圖。 FIG. 8 is a schematic diagram of wear loss averaging according to some embodiments.

第9圖係依據本發明實施例之快閃記憶體的資料內部搬移方法流程圖。 FIG. 9 is a flowchart of a method for internally transferring data in a flash memory according to an embodiment of the present invention.

第10圖係依據本發明實施例的內部搬移命令的資料格式圖。 FIG. 10 is a data format diagram of an internal move command according to an embodiment of the present invention.

第11圖係完成元件的資料格式圖。 Figure 11 is a data format diagram of the completed component.

第12圖係依據本發明實施例的廢料蒐集程序的內部搬移作業示意圖。 FIG. 12 is a schematic diagram of an internal moving operation of a waste collection program according to an embodiment of the present invention.

第13圖係依據本發明實施例的耗損平均程序的內部搬移作業示意圖。 FIG. 13 is a schematic diagram of an internal moving operation according to a wear averaging program according to an embodiment of the present invention.

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

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

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

第1圖係依據本發明實施例之開放通道固態硬碟系統100架構示意圖。開放通道固態硬碟系統100架構包含主裝置110、資料緩衝器(Data Buffer)120及開放通道固態硬碟(SSD,Solid State Disk)130。主裝置111運作時可依據其需求而建立佇列(Queue)、實體儲存對照表(Storage Mapping Table,又稱為L2P Logical-to-Physical表)及使用紀錄。此系統架構可實施於個人電腦、筆記型電腦(Laptop PC)、平板電腦、手機、數位相機、數位攝影機等電子產品。資料緩衝器120、佇列、實體儲存對照表及使用紀錄可實施於隨機存取記憶體(RAM,Random Access Memory)中的特定區域。主裝置110透過開放通道固態硬碟快速非揮發記憶體(NVMe,Non-Volatile Memory express)介面與開放通道固態硬碟130溝通。主裝置110可使用多種方式實施,例如使用通用硬體(例如,單一處理器、具平行處理能力的多處理器、圖形處理器或其他具運算能力的處理 器),並且在執行指令(Instructions)、宏碼(Macrocode)或微碼(Microcode)時,提供之後描述的功能。主裝置110可包含運算邏輯單元(ALU,Arithmetic and Logic Unit)以及位移器(Bit Shifter)。運算邏輯單元負責執行布林運算(如AND、OR、NOT、NAND、NOR、XOR、XNOR等)或數學運算(如加、減、乘、除等),而位移器負責位移運算及位元旋轉。開放通道SSD NVMe規格,例如:版本1.2,公開於2016年四月,支援數個輸出入通道(I/O Channels),每一輸出入通道連接至一個邏輯單元編號LUNs,Logical Unit Numbers),用以分別對應到儲存單元139中的多個儲存子單元。於開放通道SSD NVMe規格中,主裝置110整合原來實施於裝置端中的快閃記憶體翻譯層(FTL,Flash Translation Layer),用以最佳化負載。傳統的快閃記憶體翻譯層將主裝置端或檔案系統認得的邏輯區塊位址(LBAs,Logical Block Addresses)映射至儲存單元139的實體位址(也稱為邏輯至實體映射)。於開放通道SSD NVMe規格中,主裝置110可指示開放通道固態硬碟130將使用者資料儲存至儲存單元139中的一個實體位址,因此,實體儲存對照表的維護由主裝置110所負責及記錄每個邏輯區塊位址的使用者資料實際儲存於儲存單元139中的哪個實體位址。 FIG. 1 is a schematic structural diagram of an open channel solid state hard disk system 100 according to an embodiment of the present invention. The architecture of the open channel solid state disk system 100 includes a main device 110, a data buffer (Data Buffer) 120, and an open channel solid state disk (SSD) 130. When the main device 111 operates, it can establish a queue (Queue), a physical storage mapping table (also known as an L2P Logical-to-Physical table), and a usage record according to its needs. This system architecture can be implemented in electronic products such as personal computers, laptop PCs, tablets, mobile phones, digital cameras, and digital cameras. The data buffer 120, the queue, the physical storage comparison table, and the usage record can be implemented in a specific area in a random access memory (RAM, Random Access Memory). The host device 110 communicates with the open channel solid state hard disk 130 through an open channel solid state hard disk fast non-volatile memory (NVMe, Non-Volatile Memory express) interface. The host device 110 may be implemented in a variety of ways, such as using general-purpose hardware (e.g., a single processor, multiple processors with parallel processing capabilities, a graphics processor, or other computing capabilities Device), and when the instructions (Instructions), macro code (Macrocode) or microcode (Microcode) is executed, it provides the functions described later. The host device 110 may include an arithmetic logic unit (ALU) and a shifter (Bit Shifter). The operation logic unit is responsible for performing Bolling operations (such as AND, OR, NOT, NAND, NOR, XOR, XNOR, etc.) or mathematical operations (such as addition, subtraction, multiplication, division, etc.), while the shifter is responsible for displacement operations and bit rotation . Open channel SSD NVMe specifications, such as version 1.2, which was released in April 2016. It supports several I / O channels. Each I / O channel is connected to a logical unit number LUNs, Logical Unit Numbers. Corresponding to a plurality of storage sub-units in the storage unit 139 respectively. In the open channel SSD NVMe specification, the main device 110 integrates a flash memory translation layer (FTL, Flash Translation Layer) originally implemented in the device to optimize the load. The traditional flash memory translation layer maps logical block addresses (LBAs, Logical Block Addresses) recognized by the host device or the file system to the physical addresses (also called logical-to-physical mapping) of the storage unit 139. In the open channel SSD NVMe specification, the main device 110 may instruct the open channel solid state hard disk 130 to store user data to a physical address in the storage unit 139. Therefore, the maintenance of the physical storage comparison table is the responsibility of the main device 110 and Record which physical address of the user data of each logical block address is actually stored in the storage unit 139.

開放通道固態硬碟130包含處理單元133。處理單元133可採用開放通道SSD NVMe通訊協定與主裝置110溝通,用以接收包含實體位址的資料存取命令,並且依據資料存取命令指示快閃控制器135執行抹除、讀取或寫入。於此須注意的是,處理單元133可使用輕簡型通用目的處理器(Lightweight General-Purpose Processor)實施。 The open channel solid state hard disk 130 includes a processing unit 133. The processing unit 133 may communicate with the host device 110 by using an open channel SSD NVMe communication protocol to receive a data access command including a physical address, and instruct the flash controller 135 to perform erasing, reading or writing according to the data access command. Into. It should be noted here that the processing unit 133 may use a lightweight general purpose processor (Lightweight General-Purpose Processor).

開放通道固態硬碟130另包含快閃控制器135、存取介面137及儲存單元139,並且快閃控制器135透過存取介面137與儲存單元139溝通,詳細來說,可採用雙倍資料率(Double Data Rate,DDR)通訊協定,例如,開放NAND快閃(Open NAND Flash Interface,ONFI)、雙倍資料率開關(DDR Toggle)或其他介面。開放通道固態硬碟130的快閃控制器135透過存取介面137寫入使用者資料到儲存單元139中的指定位址(目的位址),以及從儲存單元139中的指定位址(來源位址)讀取使用者資料。存取介面137使用數個電子訊號來協調快閃控制器135與儲存單元139間的資料與命令傳遞,包含資料線(Data Line)、時脈訊號(Clock Signal)與控制訊號(Control Signal)。資料線可用以傳遞命令、位址、讀出及寫入的資料;控制訊號線可用以傳遞晶片致能(Chip Enable,CE)、位址提取致能(Address Latch Enable,ALE)、命令提取致能(Command Latch Enable,CLE)、寫入致能(Write Enable,WE)等控制訊號。處理單元133與快閃控制器135可分開存在或整合於同一晶片中。 The open channel solid state hard disk 130 further includes a flash controller 135, an access interface 137, and a storage unit 139, and the flash controller 135 communicates with the storage unit 139 through the access interface 137. In detail, a double data rate can be used (Double Data Rate, DDR) communication protocol, for example, Open NAND Flash Interface (ONFI), Double Data Rate Switch (DDR Toggle) or other interfaces. The flash controller 135 of the open channel solid state hard disk 130 writes user data to the specified address (destination address) in the storage unit 139 through the access interface 137, and from the specified address (source bit) in the storage unit 139 Address) to read user data. The access interface 137 uses several electronic signals to coordinate data and command transfer between the flash controller 135 and the storage unit 139, including data lines, clock signals, and control signals. The data line can be used to transmit command, address, read and write data; the control signal line can be used to pass Chip Enable (CE), Address Latch Enable (ALE), command extraction Control signals such as Command Latch Enable (CLE) and Write Enable (WE). The processing unit 133 and the flash controller 135 may exist separately or integrated in the same chip.

於系統開機(System Boot)時,主裝置110從開放通道固態硬碟130獲得控制開放通道固態硬碟130運作時所需的操作參數,例如,區塊數目、壞塊(Bad Block)數目、滯後時間(latency)、輸出入通道總數等。 When the system is booted (System Boot), the main device 110 obtains the operating parameters required for controlling the operation of the open channel solid state hard disk 130 from the open channel solid state hard disk 130, such as the number of blocks, the number of bad blocks, and the hysteresis. Time (latency), total number of input and output channels, etc.

儲存單元139可包含多個儲存子單元,每個儲存子單元,各自使用關聯的存取子介面與快閃控制器135進行溝通。一或多個儲存子單元可封裝在一個晶粒(Die)之中。第2圖 係依據本發明實施例之存取介面與儲存單元的方塊圖。開放通道固態硬碟130可包含j+1個存取子介面137_0至137_j,每一個存取子介面連接i+1個儲存子單元。存取子介面及其後連接的儲存子單元又可統稱為輸出入通道,並可以邏輯單元編號識別。換句話說,i+1個儲存子單元共享一個存取子介面。例如,當開放通道固態硬碟130包含4個輸出入(j=3)且每一個輸出入連接4個儲存單元(i=3)時,開放通道固態硬碟130一共擁有16個儲存子單元139_0_0至139_j_i。快閃控制器135可驅動存取子介面137_0至137_j中之一者,從指定的儲存子單元讀取資料。每個儲存子單元擁有獨立的晶片致能(CE)控制訊號。換句話說,當欲對指定的儲存子單元進行資料讀取時,需要驅動關聯的存取子介面來致能此儲存子單元的晶片致能控制訊號。第3圖係依據本發明實施例之一個存取子介面與多個儲存子單元的連接示意圖。快閃控制器135可透過存取子介面137_0使用獨立的晶片致能控制訊號320_0_0至320_0_i從連接的儲存子單元139_0_0至139_0_i中選擇出其中一者,接著,透過共享的資料線310_0從選擇出的儲存子單元的指定位址讀取資料。 The storage unit 139 may include multiple storage sub-units, and each storage sub-unit communicates with the flash controller 135 using an associated access sub-interface. One or more storage sub-units may be packaged in a die. FIG. 2 is a block diagram of an access interface and a storage unit according to an embodiment of the present invention. Solid State Drive open channel 130 may include j +1 th sub-access interface 137_0 to 137_ j, each of the sub-access interface connector i +1 th storage subunit. The access sub-interface and the storage sub-units connected thereafter can be collectively referred to as input-output channels, and can be identified by the logical unit number. In other words, i + 1 storage subunits share an accessor interface. For example, when the open channel solid state hard disk 130 includes four inputs and outputs ( j = 3 ) and each input and output is connected to four storage units ( i = 3), the open channel solid state hard disk 130 has a total of 16 storage subunits 139_0_0 To 139_ j _ i . The flash controller 135 can drive one of the sub-interfaces 137_0 to 137_ j to read data from a designated storage sub-unit. Each storage sub-unit has an independent chip enable (CE) control signal. In other words, when data is read from a specified storage sub-unit, the associated access sub-interface needs to be driven to enable the chip enable control signal of the storage sub-unit. FIG. 3 is a schematic diagram illustrating a connection between an accessor interface and a plurality of storage subunits according to an embodiment of the present invention. Flash controller 135 may access through the use of separate sub-interface 137_0 wafer to enable control signal 320_0_0 wherein 320_0_ i selected from one of the storage sub-unit connected to 139_0_ i 139_0_0, followed, through the shared data line 310_0 Read data at the specified address of the selected storage subunit.

第4圖係儲存單元139的示意圖。儲存單元139包含多個資料平面(Data Planes)410_0至410_m、430_0至430_m、450_0至450_m及470_0至470_m,每一資料平面或多個資料平面置於一個邏輯單元編號中。資料平面410_0至410_m及共享的存取子介面稱為輸出入通道410,資料平面430_0至430_m及共享的存取子介面稱為輸出入通道430,資料平面450_0至450_m及共享的存取子介面稱為輸出入通道450,及資料平面470_0至 470_m及共享的存取子介面稱為輸出入通道470,其中,m可為2的次方的整數(例如2、4、8、16、32等),輸出入通道410、430、450及470可使用邏輯單元編號識別。資料平面410_0至470_m中之每一者包含多個實體區塊(Physical Blocks),每個實體區塊包含多個頁面(Pages)P#0至P#(n),每個頁面包含多個區段(Sectors)(例如,4個、8個等),其中,n可為767或1535等。每個頁面包含多個NAND記憶體單元(Memory Cells),並且NAND記憶體單元可為單層式單元(Single-Level Cells,SLCs)、多層式單元(Multi-Level Cells,MLCs)、三層式單元(Triple-Level Cells,TLCs)或四層式單元(Quad-Level Cells,QLCs)。於一些實施例中,當每一個NAND記憶體單元為單層式單元而可記錄2個狀態時,資料平面410_0至470_0中的頁面P#0可虛擬形成超頁面(Super Page)490_0,資料平面410_0至470_0中的頁面P#1可虛擬形成超頁面490_1,依此類推。於另一些實施例中,當每一個NAND記憶體單元為多層式單元而可記錄4個狀態時,一個實體字元線可包含頁面P#0(可稱為最低位元頁面,MSB,Most Significant Bit page)、頁面P#1(可稱為最高位元頁面,LSB,Least Significant Bit page),依此類推。於更另一些實施例中,當每一個NAND記憶體單元為三層式單元而可記錄8個狀態時,一個實體字元線可包含頁面P#0(可稱為最低位元頁面,MSB page)、頁面P#1(可稱為中間位元頁面,CSB,Center Significant Bit page)及頁面P#2(可稱為最高位元頁面,LSB page)。當每一個NAND記憶體單元為四層式單元而可記錄16個狀態時,除了MSB、CSB以及LSB頁面之外,更包括TSB(可稱 為頂部位元,TSB,Top Significant Bit)頁面。 FIG. 4 is a schematic diagram of the storage unit 139. The storage unit 139 includes a plurality of data plane (Data Planes) 410_0 through 410_ m, 430_0 to 430_ m, 450_0 and 470_0 through 450_ m to 470_ m, each of the plurality of information data plane or a plane disposed in the logical unit number. The data planes 410_0 to 410_ m and the shared accessor interface are called input / output channels 410, and the data planes 430_0 to 430_ m and the shared accessor interface are called input / output channels 430, and the data planes 450_0 to 450_ m and shared access taking into sub-channels are called output interface 450, and data plane 470_0 to 470_ m and shared access sub-channels into output interface 470 referred to, wherein, m may be an integer power of 2 (e.g. 4, 8, 16, 32, etc.), I / O channels 410, 430, 450, and 470 can be identified by logical unit numbers. Each of the data planes 410_0 to 470_ m contains multiple physical blocks, each of which contains multiple pages (Pages) P # 0 to P # ( n ), each page contains multiple Sectors (for example, 4, 8, etc.), where n can be 767 or 1535, etc. Each page contains multiple NAND memory cells (Memory Cells), and NAND memory cells can be single-level cells (SLCs), multi-level cells (MLCs), three-level cells Cells (Triple-Level Cells, TLCs) or Quad-Level Cells (QLCs). In some embodiments, when each NAND memory cell is a single-layer cell and can record 2 states, the page P # 0 in the data plane 410_0 to 470_0 can virtually form a Super Page 490_0, a data plane Pages P # 1 from 410_0 to 470_0 can virtually form a superpage 490_1, and so on. In other embodiments, when each NAND memory cell is a multi-layer cell and can record 4 states, a physical character line may include page P # 0 (may be referred to as the least significant page, MSB, Most Significant Bit page), page P # 1 (may be called Least Significant Bit page, LSB), and so on. In still other embodiments, when each NAND memory cell is a three-layer cell and can record 8 states, a physical character line may include a page P # 0 (which may be referred to as the least significant page, MSB page ), Page P # 1 (could be called the Center Significant Bit page, CSB) and page P # 2 (could be called the most significant page, LSB page). When each NAND memory cell is a four-layer cell and can record 16 states, in addition to the MSB, CSB, and LSB pages, it also includes a TSB (can be referred to as a TSB, Top Significant Bit) page.

儲存單元139運作時,頁面可為資料管理或編程的最小單位,大小例如為16KB,此時實體位址可表示為頁面編號;或者,頁面可包含多個區段,大小例如為4KB,則區段可為資料管理的最小單位,此時實體位址可表示為頁面的區段編號(Sector numbers)或此區段在頁面的偏移量(Offset)。區塊為資料抹除的最小單位。 When the storage unit 139 operates, the page can be the smallest unit for data management or programming, for example, the size is 16KB. At this time, the physical address can be expressed as a page number. Or, the page can contain multiple sections, such as 4KB, and the area Segments can be the smallest unit of data management. At this time, the physical address can be expressed as the sector number of the page or the offset of the sector on the page. A block is the smallest unit of data erasure.

實體區塊可依據其使用狀態而區分成主動區塊、資料區塊以及閒置區塊。主動區塊表示正在進行資料寫入的實體區塊,即尚未寫入區塊結束(End of Block)資訊的實體區塊。資料區塊為已寫入區塊結束資訊的實體區塊,即不再寫入任何使用者資料。閒置區塊可被選取而成為主動區塊,閒置區塊不儲存任何有效的使用者資料。通常閒置區塊被選取後,需執行抹除動作方可成為主動區塊。 The physical blocks can be divided into active blocks, data blocks, and idle blocks according to their use status. The active block indicates a physical block that is writing data, that is, a physical block that has not been written with End of Block information. A data block is a physical block that has been written with end-of-block information, that is, no more user data is written. The idle block can be selected to become the active block. The idle block does not store any valid user data. Usually, after an idle block is selected, an erasing action is required to become an active block.

於一些實施例中,主裝置110傳送給開放通道固態硬碟130的實體位址可包含邏輯單元編號、資料平面編號、實體區塊編號、實體頁面編號及區段編號等資訊,用以指出欲讀取或寫入的使用者資料位於特定輸出入通道中的特定資料平面中的特定實體區塊中的特定實體頁面中的特定區段。於一些實施例中,有時會以行(Column)編號取代區段編號。於另一些實施例中,主裝置110傳送給開放通道固態硬碟130的實體位址可包含邏輯單元編號、資料平面編號及實體區塊編號等資訊,用以指出欲抹除特定輸出入通道中的特定資料平面中的特定資料區塊。 In some embodiments, the physical address transmitted by the host device 110 to the open channel solid state hard disk 130 may include information such as a logical unit number, a data plane number, a physical block number, a physical page number, and a section number, and is used to indicate that The user data read or written is located in a specific section of a specific entity page in a specific entity block in a specific data plane in a specific input / output channel. In some embodiments, column numbers are sometimes replaced with column numbers. In other embodiments, the physical address transmitted by the host device 110 to the open channel solid state hard disk 130 may include information such as a logical unit number, a data plane number, and a physical block number, and is used to indicate that a specific input / output channel is to be erased. A specific data block in a specific data plane of.

第5圖係命令佇列示意圖。佇列115可包含遞交佇列(Submission Queue)510及完成佇列(Completion Queue)530,分別用以暫存主裝置指令以及完成元件(Completion Element)。遞交佇列510及完成佇列530中之每一者包含多筆條目的集合。遞交佇列510中的每一筆條目儲存一個主裝置指令,例如:輸出入命令(以下稱為資料存取命令)或管理命令,而完成佇列530中的每一筆條目儲存關聯至一個資料存取命令或管理命令的完成元件,此完成元件的功能類似確認訊息。集合中的條目依序存放。集合的操作基本原則是由結束位置新增條目(可稱為入列),並且由開始位置移除條目(可稱為出列)。也就是說,第一個新增至遞交佇列510或完成佇列530的命令或訊息,也將會是第一個被移出的。主裝置110可寫入資料存取命令(Data Access Command,例如,抹除、讀取、寫入命令等)至遞交佇列510,並且處理單元133從遞交佇列510讀取(或稱為提取Fetch)最早到達的資料存取命令並執行。於資料存取命令執行完成後,處理單元133寫入完成元件至完成佇列530,主裝置110可讀取或提取完成元件而判斷資料存取命令的執行結果。 Figure 5 is a schematic diagram of the command queue. The queue 115 may include a Submission Queue 510 and a Completion Queue 530, which are respectively used to temporarily store a main device instruction and a Completion Element. Each of the submission queue 510 and the completion queue 530 contains a set of multiple entries. Each entry in the submitted queue 510 stores a master device command, such as an input / output command (hereinafter referred to as a data access command) or a management command, and each entry in the completed queue 530 is associated with a data access The completion element of the command or management command. This completion element functions like a confirmation message. The entries in the collection are stored in order. The basic principle of the operation of the set is to add an entry from the end position (which can be referred to as dequeuing), and to remove the entry from the start position (which can be referred to as dequeuing). That is, the first command or message added to the submission queue 510 or the completion queue 530 will also be the first to be removed. The host device 110 may write a data access command (eg, an erase, read, write command, etc.) to the submission queue 510, and the processing unit 133 reads (or is referred to as extraction) from the submission queue 510 Fetch) The earliest data access command arrives and executes. After the execution of the data access command is completed, the processing unit 133 writes the completion element to the completion queue 530, and the host device 110 can read or extract the completion element to determine the execution result of the data access command.

第6圖係資料存取命令的執行步驟的流程圖。主裝置110產生並寫入資料存取命令(例如,抹除、讀取、寫入命令等)至遞交佇列510(步驟S1110),其中,資料存取命令包含實體位址的資訊,並且,實體位址指向特定的區塊、頁面或區段位址。接著,主裝置110發出遞交門鈴(Submission Doorbell)給處理單元133(步驟S1120),用以通知處理單元133關於遞交佇列 510中已寫入一個資料存取命令的資訊,並更新遞交佇列510的佇列尾(Tail)的值。處理單元133接收到遞交門鈴後(步驟S1310),從遞交佇列510讀取(最早到達的)資料存取命令(步驟S1320),並且依據資料存取命令指示快閃控制器135,用以完成指定的作業(例如,抹除、資料讀取、寫入等)(步驟S1330)。指定作業完成後,處理單元133產生並寫入完成元件至完成佇列530(步驟S1340)用以通知主裝置110相應於特定資料存取命令的作業的執行狀態資訊,並且發出中斷給主裝置(步驟S1350)。接收中斷後(步驟S1130),主裝置110從完成佇列530讀取(最早到達的)完成元件(步驟S1130),接著,發出完成門鈴給處理單元133(步驟S1140)。接收完成門鈴後(S1360),處理單元133更新完成佇列530的佇列頭(Head)的值。 FIG. 6 is a flowchart of the execution steps of the data access command. The host device 110 generates and writes a data access command (for example, an erase, read, write command, etc.) to the submission queue 510 (step S1110), where the data access command includes information of a physical address, and, The physical address points to a specific block, page, or section address. Next, the main device 110 sends a Submission Doorbell to the processing unit 133 (step S1120) to notify the processing unit 133 of the submission queue The information of a data access command has been written in 510, and the value of the tail of the queue 510 is updated. After receiving the doorbell (step S1310), the processing unit 133 reads the (earliest) data access command from the submission queue 510 (step S1320), and instructs the flash controller 135 according to the data access command to complete The designated job (for example, erasing, data reading, writing, etc.) (step S1330). After the designated operation is completed, the processing unit 133 generates and writes a completion element to the completion queue 530 (step S1340) to notify the host device 110 of the execution status information of the operation corresponding to the specific data access command, and issues an interrupt to the host device ( Step S1350). After receiving the interruption (step S1130), the main device 110 reads the (earliest) completion element from the completion queue 530 (step S1130), and then issues a completion doorbell to the processing unit 133 (step S1140). After receiving the completion doorbell (S1360), the processing unit 133 updates the value of the queue head of the completed queue 530.

於步驟S1120及S1140,主裝置110可設定相應寄存器(registers)來向處理單元133發出遞交門鈴及結束門鈴。 In steps S1120 and S1140, the main device 110 may set corresponding registers to send the doorbell to the processing unit 133 and end the doorbell.

一筆資料存取命令可處理多筆使用者資料,例如:64筆,則完成元件中可包括64個位元的執行回覆表,每個位元分別表示每一筆使用者資料的執行結果,例如:”0”表示成功,”1”表示失敗。資料存取命令包含操作碼欄位,用以儲存資料存取命令的類型(例如,抹除、讀取、寫入等)。完成元件包含狀態欄位,用以儲存對應的資料存取命令的執行狀態(例如,成功、失敗等)。另外,處理單元133可亂序或依優先權的順序來執行資料存取命令,因此,資料存取命令及完成元件都包含命令識別碼(Command Identifier),用以讓主裝置110可將每一個完成元件關聯至特定資料存取命令。 One data access command can process multiple user data, for example: 64, the completion component can include 64-bit execution response table, each bit represents the execution result of each user data, for example: "0" indicates success, and "1" indicates failure. The data access command contains an opcode field to store the type of data access command (eg, erase, read, write, etc.). The completion component includes a status field to store the execution status (eg, success, failure, etc.) of the corresponding data access command. In addition, the processing unit 133 can execute the data access commands out of order or in the order of priority. Therefore, the data access command and the completion component both include a command identifier (Command Identifier), so that the main device 110 can Complete the component associated with a specific data access command.

舉例來說,一個閒置區塊在寫入前需要被抹除以成為主動區塊,主裝置110可寫入抹除命令至遞交佇列510(步驟S1110)用以指示開放通道固態硬碟130(詳細來說為處理單元133)針對特定輸出入通道中的特定閒置區塊執行抹除作業。處理單元133因應抹除命令而指示快閃控制器135通過驅動存取介面137以完成於儲存單元139中指定的抹除作業(步驟S1330)。當抹除作業完成,處理單元133寫入完成元件至完成佇列530(步驟S1340)用以通知主裝置110關於相應抹除作業已經完成的資訊。 For example, an idle block needs to be erased to become an active block before writing. The master device 110 can write an erase command to the submission queue 510 (step S1110) to instruct the open channel solid state hard disk 130 ( In detail, the processing unit 133) performs an erase operation for a specific idle block in a specific input / output channel. In response to the erase command, the processing unit 133 instructs the flash controller 135 to complete the erase operation specified in the storage unit 139 by driving the access interface 137 (step S1330). When the erasing operation is completed, the processing unit 133 writes a completion element to the completion queue 530 (step S1340) to notify the host device 110 that the corresponding erasing operation has been completed.

舉例來說,主裝置110可寫入讀取命令至遞交佇列510(步驟S1110)用以指示開放通道固態硬碟130從特定輸出入通道中的特定資料平面中的特定實體區塊中的特定實體頁面(的特定區段)讀取使用者資料。處理單元133因應讀取命令而指示快閃控制器135通過驅動存取介面137從儲存單元139中指定的實體位址讀取使用者資料,並且將使用者資料儲存至讀取命令所指定的資料緩衝區120(步驟S1330)。當讀取作業完成,處理單元133寫入完成元件至完成佇列530(步驟S1340)用以通知主裝置110關於相應讀取作業已經完成的資訊。 For example, the host device 110 may write a read command to the submission queue 510 (step S1110) to instruct the open channel solid state hard disk 130 to select a specific physical block in a specific physical block in a specific data plane in a specific input / output channel. The user page is read by (a specific section) of the physical page. The processing unit 133 instructs the flash controller 135 to read the user data from the physical address specified in the storage unit 139 through the drive access interface 137 in response to the read command, and stores the user data to the data specified by the read command Buffer 120 (step S1330). When the reading operation is completed, the processing unit 133 writes a completion element to the completion queue 530 (step S1340) to notify the host device 110 about the completion of the corresponding reading operation.

舉例來說,主裝置110可儲存欲寫入的使用者資料於資料緩衝區120,並儲存寫入命令至遞交佇列510(步驟S1110)用以指示開放通道固態硬碟130寫入使用者資料至特定輸出入通道中的特定資料平面中的特定主動區塊中的特定實體頁面(的特定區段),其中,寫入命令包含資料緩衝區120中儲存欲寫入的使用者資料的位址資訊。處理單元133因應寫入命令而從 資料緩衝區120中的指定位址讀取欲寫入的使用者資料,並指示快閃控制器135通過驅動存取介面137將使用者資料編程至儲存單元139中寫入命令所指定的實體位址(步驟S1330)。當寫入作業完成,處理單元133寫入完成元件至完成佇列530(步驟S1340)用以通知主裝置110關於相應寫入作業已經完成的資訊。 For example, the host device 110 may store the user data to be written in the data buffer 120, and store the write command in the submission queue 510 (step S1110) to instruct the open channel solid state hard disk 130 to write the user data. To a specific physical page (a specific section) in a specific active block in a specific data plane in a specific input / output channel, wherein the write command includes an address in the data buffer 120 that stores user data to be written Information. The processing unit 133 responds to a write command from Read the user data to be written at the specified address in the data buffer 120, and instruct the flash controller 135 to program the user data to the physical bit specified by the write command in the storage unit 139 through the drive access interface 137 Address (step S1330). When the writing operation is completed, the processing unit 133 writes a completion element to the completion queue 530 (step S1340) to notify the host device 110 about the completion of the corresponding writing operation.

經過多次的存取後,一個實體頁面可能包含有效及無效區段(又稱為過期區段),其中,有效區段儲存有效的使用者資料,無效區段儲存無效的(舊的)使用者資料。於一些實施方式中,當主裝置110偵測到儲存單元139的可用空間不足時,可使用如上所述的讀取命令指示處理單元133讀取並蒐集有效區段中的使用者資料,接著,主裝置110使用如上所述的寫入命令指示處理單元133重新寫入蒐集起來的有效的使用者資料至閒置區塊或主動區塊的空實體頁面,使得這些包含無效的使用者資料的資料區塊可變更成為閒置區塊,於抹除後,即可提供資料儲存空間。如上所述的程序稱為垃圾收集(GC,Garbage Collection)。 After multiple accesses, a physical page may contain valid and invalid sections (also known as expired sections), where the valid section stores valid user data and the invalid section stores invalid (old) use Information. In some embodiments, when the main device 110 detects that the available space of the storage unit 139 is insufficient, the read command as described above may be used to instruct the processing unit 133 to read and collect user data in a valid section. Then, The host device 110 uses the write command as described above to instruct the processing unit 133 to rewrite the collected valid user data to the empty physical page of the idle block or active block, so that these data areas contain invalid user data The block can be changed into a free block, and after erasing, it can provide data storage space. The program described above is called Garbage Collection (GC).

第7圖係依據一些實施方式之垃圾回收示意圖。假設資料區塊的一個實體頁面包括四個區段,每一區段可儲存一筆使用者資料:經過多次存取後,資料區塊710中的實體頁面P1的第0個區段711儲存有效的使用者資料,其餘儲存無效的使用者資料。資料區塊730中的實體頁面P2的第1個區段733儲存有效的使用者資料,其餘儲存無效的使用者資料。資料區塊750中的實體頁面P3的第2個及第3個區段755及757儲存有效的使 用者資料,其餘儲存無效的使用者資料。為了將實體頁面P1至P3中的有效的使用者資料蒐集起來並儲存至實體區塊770中的新實體頁面P4,可執行垃圾回收程序,包含一連串的讀取及寫入命令。 FIG. 7 is a schematic diagram of garbage recycling according to some embodiments. Assume that a physical page of the data block includes four sections, and each section can store a piece of user data: After multiple accesses, the 0th section 711 of the physical page P1 in the data block 710 is stored valid User data for, the rest stores invalid user data. The first section 733 of the physical page P2 in the data block 730 stores valid user data, and the rest stores invalid user data. The second and third sections 755 and 757 of the physical page P3 in the data block 750 store effective User data, the rest stores invalid user data. In order to collect valid user data in the physical pages P1 to P3 and store them in the new physical page P4 in the physical block 770, a garbage collection process may be performed, including a series of read and write commands.

此外,由於經過一定次數的抹除(例如,500次、1000次、5000次等),儲存單元139中的實體區塊便會因為不良的資料保存(Data Retention)能力而被列為壞塊而不再使用。為了延長實體區塊的服務壽命,主裝置110持續監督每個實體區塊的抹除次數。當一個資料區塊的抹除次數超過抹除閥值時,主裝置110可使用如上所述的讀取命令指示處理單元133讀取這個資料區塊(來源區塊)中的使用者資料。接著,主裝置110選擇一個抹除次數最少的閒置區塊作為目的區塊,並且使用如上所述的寫入命令指示處理單元133寫入之前的讀取的使用者資料寫至選擇的目的區塊中的可用實體頁面。如上所述的程序稱為耗損平均(Wear Leveling)。第8圖係依據一些實施方式之耗損平均示意圖。假設資料區塊810的抹除次數已經超過抹除閥值,而閒置區塊830的抹除次數是此輸出入通道中所有實體區塊中最少的:主裝置110啟動耗損平均,將資料區塊810中的實體頁面P5至P6的使用者資料搬移至閒置區塊830中的實體頁面P7至P8,其中,耗損平均程序包含一連串的讀取及寫入命令。 In addition, after a certain number of erasures (for example, 500 times, 1000 times, 5000 times, etc.), the physical blocks in the storage unit 139 will be listed as bad blocks due to poor data retention capabilities. No longer use. In order to extend the service life of the physical blocks, the main device 110 continuously monitors the erasure times of each physical block. When the number of erasures of a data block exceeds the erasure threshold, the main device 110 may instruct the processing unit 133 to read user data in this data block (source block) using the read command as described above. Next, the main device 110 selects an idle block with the least number of erasures as the destination block, and uses the write command as described above to instruct the processing unit 133 to write the previously read user data to the selected destination block. Page of available entities in. The procedure described above is called Wear Leveling. FIG. 8 is a schematic diagram of wear loss averaging according to some embodiments. Assume that the number of erasures of the data block 810 has exceeded the erasure threshold, and the number of erasures of the idle block 830 is the least of all physical blocks in this input / output channel: the main device 110 starts the wear average and divides the data blocks. The user data of the physical pages P5 to P6 in 810 are moved to the physical pages P7 to P8 in the idle block 830, wherein the wear average process includes a series of read and write commands.

此外,主裝置110可記錄每一資料區塊的讀取次數並以讀取次數作為耗損平均程序啟動的條件。例如:在一個月中,資料區塊810的讀取次數最低且抹除次數未超過抹除閥值,主裝置110可選取所有閒置區塊中或同一輸出入通道的所 有閒置區塊中具有最高抹除次數的閒置區塊,例如:閒置區塊830,作為目的區塊,並將資料區塊810作為來源區塊,啟動耗損平均程序以將資料區塊810的使用者資料(或稱冷資料)搬移至閒置區塊830,其中,耗損平均程序包含一連串的讀取及寫入命令。 In addition, the host device 110 can record the number of readings of each data block and use the number of readings as a condition for starting the wear average program. For example, in one month, the data block 810 has the lowest number of reads and the number of erases does not exceed the erase threshold. The main device 110 may select all the blocks in the idle block or the same input / output channel. There are idle blocks with the highest number of erasures in idle blocks, such as: idle block 830 as the destination block, and data block 810 as the source block. The wear-out averaging process is started to use data block 810. The user data (or cold data) is moved to the idle block 830, where the wear average process includes a series of read and write commands.

然而,使用如上所述的讀取及寫入命令來完成垃圾收集或耗損平均程序,會讓佇列115耗費大量空間儲存一連串的讀取及寫入命令以及完成元件,並且資料緩衝器120也需要耗費大量頻寬傳輸從儲存單元139讀取的資料以及傳輸欲寫入儲存單元139的資料,以及耗費大量空間儲存從儲存單元139讀取的資料。此外,主裝置110及處理單元133亦需要耗費大量運算資源處理這一連串的讀取及寫入命令,而這將使開放通道固態硬碟130無法維持適當的運算資源以及時回應主裝置110的資料存取命令,造成開放通道固態硬碟130的系統效能低落。 However, using the read and write commands as described above to complete the garbage collection or wear averaging process will make queue 115 consume a lot of space to store a series of read and write commands and completion components, and the data buffer 120 also needs It takes a large amount of bandwidth to transmit the data read from the storage unit 139 and the data to be written to the storage unit 139, and it takes a lot of space to store the data read from the storage unit 139. In addition, the host device 110 and the processing unit 133 also need to consume a large amount of computing resources to process this series of read and write commands, which will make the open channel solid state hard disk 130 unable to maintain appropriate computing resources and respond to the data of the host device 110 in a timely manner. The access command causes the system performance of the open channel solid state hard disk 130 to decrease.

為了解決如上所述實施方式的缺陷,本發明實施例提出一種快閃記憶體的資料內部搬移方法,此資料內部搬移方法適用於實體儲存對照表117由主裝置110負責維護的系統,例如:開放通道固態硬碟系統100。第9圖係依據本發明實施例之快閃記憶體的資料內部搬移方法流程圖。主裝置110可週期性地監督每一個輸出入通道的使用狀態,例如,可用閒置區塊的數量、每一實體區塊的抹除次數或讀取次數等等。當主裝置110偵測到開放通道固態硬碟130中的一個輸出入通道的使用狀態滿足資料搬移的條件後,產生內部搬移(Internal Movement)命令並寫入至遞交佇列510(步驟S9110),用以指示 開放通道固態硬碟130將特定輸出入通道中的來源區塊的使用者資料搬移至相同輸出入通道中的目的區塊,其中,資料搬移的條件可以是閒置區塊的數量低於閒置閥值或是資料區塊(來源區塊)的抹除次數或讀取次數分別高於抹除閥值或讀取閥值。另外,較佳僅搬移有效的使用者資料至目的區塊,但為了較高的執行效率或大部份使用者資料皆為有效時,可搬移全部的使用者資料至目的區塊。 In order to solve the shortcomings of the above-mentioned embodiments, an embodiment of the present invention proposes a method for internally moving data in flash memory. This method for internally moving data is applicable to a system where the physical storage comparison table 117 is maintained by the main device 110, such as: Channel solid state drive system 100. FIG. 9 is a flowchart of a method for internally transferring data in a flash memory according to an embodiment of the present invention. The host device 110 may periodically monitor the usage status of each input / output channel, for example, the number of available idle blocks, the number of erasing or reading times of each physical block, and the like. When the main device 110 detects that the use status of an input / output channel in the open channel solid state hard disk 130 satisfies the condition of data movement, it generates an Internal Movement command and writes it to the submission queue 510 (step S9110), To indicate The open channel solid state hard disk 130 moves user data of a source block in a specific input / output channel to a destination block in the same input / output channel. The condition for data transfer may be that the number of idle blocks is lower than the idle threshold. Or the number of erasures or reads of the data block (source block) is higher than the erase threshold or read threshold, respectively. In addition, it is better to move only valid user data to the destination block, but for higher execution efficiency or when most of the user data is valid, all user data can be moved to the destination block.

寫入內部搬移命令至遞交佇列510後,主裝置110發出遞交門鈴給處理單元133(步驟S1120),用以通知處理單元133關於遞交佇列510中已寫入一個資料存取命令的資訊。處理單元133接收遞交門鈴後(步驟S1310),從遞交佇列510讀取內部搬移命令(步驟S9310),並且因應內部搬移命令而指示快閃控制器135通過驅動存取介面137在特定輸出入通道的來源區塊和目的區塊之間啟動複製回寫程序(CopyBack Procedure)(步驟S9320)。雖然在最理想的情況下,處理單元133於步驟S9310讀取的最早到達的資料存取命令為內部搬移命令,但是,當遞交佇列510中存在其他較早到達的資料存取命令時,處理單元133會花一段時間讀取並執行完這些較早到達的資料存取命令後,才接著於步驟S9310讀取並執行內部搬移命令。雖然本發明實施例於第6圖中無法沒有顯示這些較早到達的資料存取命令的讀取與執行,但是本發明並不因此受限。當處理單元133完成內部搬移作業後,處理單元133寫入完成元件至完成佇列530(步驟S9330)用以通知主裝置110關於相應內部搬移命令已經完成的資訊。於步驟S1130,主裝置110可執行中斷服務處理 程序(ISR,Interrupt Service Routine),用以讀取完成佇列530中完成元件,並且因應已執行的內部搬移作業更新實體儲存對照表117。例如,將實體儲存對照表117中的一個邏輯區塊位址原先關聯的實體位址(也就是來源區塊)更新為新的實體位址(也就是目的區塊)。雖然在最理想的情況下,處理單元133於步驟S1130讀取的最早到達的確認訊息相應於內部搬移命令,但是,當完成佇列530中存在其他較早到達的確認訊息時,處理單元133會花一段時間讀取這些較早到達的確認訊息並執行相應處理後,才接著於步驟S1130讀取相應於內部搬移命令的確認訊息,並據以更新實體儲存對照表117。雖然本發明實施例於第6圖中無法沒有顯示這些較早到達的確認訊息的讀取與相應處理,但是本發明並不因此受限。在另一實施例中,主裝置110於步驟S9110或步驟S9110之前即更新實體儲存對照表117,而非等到步驟S1130或步驟S1130之後再更新實體儲存對照表117。在另一實施例中,主裝置110於步驟S1130時更會判斷目的區塊是否已寫滿使用者資料並寫入區塊結束資訊,如果是,則更新實體儲存對照表117,如果不是,則不更新實體儲存對照表117。 After the internal transfer command is written to the submission queue 510, the main device 110 sends a delivery doorbell to the processing unit 133 (step S1120) to notify the processing unit 133 that the data access command has been written into the submission queue 510. After receiving the doorbell (step S1310), the processing unit 133 reads the internal movement command from the submission queue 510 (step S9310), and instructs the flash controller 135 to drive the access interface 137 on the specific input / output channel in response to the internal movement command. A CopyBack Procedure is started between the source block and the destination block (step S9320). Although in the most ideal case, the earliest arriving data access command read by the processing unit 133 in step S9310 is an internal transfer command, but when there is another earlier arriving data access command in the submission queue 510, the processing is performed. The unit 133 will take some time to read and execute the data access commands that arrive earlier, and then read and execute the internal move command in step S9310. Although the embodiment of the present invention cannot show the reading and execution of these earlier arriving data access commands in FIG. 6, the present invention is not limited thereby. After the processing unit 133 completes the internal transfer operation, the processing unit 133 writes a completion component to the completion queue 530 (step S9330) to notify the host device 110 that the corresponding internal transfer command has been completed. In step S1130, the main device 110 may perform an interrupt service process. A program (ISR, Interrupt Service Routine) is used to read the completed components in the completion queue 530 and update the entity storage comparison table 117 according to the internal moving operation that has been performed. For example, the physical address (that is, the source block) of a logical block address in the physical storage comparison table 117 is updated to a new physical address (that is, the destination block). Although in the most ideal case, the earliest arrival confirmation message read by the processing unit 133 at step S1130 corresponds to the internal move command, but when there are other earlier arrival confirmation messages in the completion queue 530, the processing unit 133 will After taking some time to read the confirmation messages that arrived earlier and performing the corresponding processing, then in step S1130, the confirmation messages corresponding to the internal move command are read, and the entity storage comparison table 117 is updated accordingly. Although the embodiment of the present invention cannot show the reading and corresponding processing of these earlier confirmation messages in FIG. 6, the present invention is not limited thereby. In another embodiment, the host device 110 updates the entity storage comparison table 117 before step S9110 or step S9110, instead of waiting until step S1130 or step S1130 to update the entity storage comparison table 117. In another embodiment, in step S1130, the main device 110 further determines whether the destination block is filled with user data and writes end-of-block information. If it is, the entity storage comparison table 117 is updated, and if not, then Do not update the entity storage lookup table 117.

內部搬移命令可使用結構化格式定義。第10圖係依據本發明實施例的內部搬移命令的資料格式圖。內部搬移命令可為64位元組命令。內部搬移命令1000的第0雙字組的第0位元組紀錄操作碼(opcode)1010,用以通知開放通道固態硬碟130此為內部搬移命令。內部搬移命令1000的第0雙字組的第2至3位元組紀錄命令識別碼1030,此命令識別碼1030較佳為依序產 生,作為內部搬移命令1000識別的依據,也用以讓完成佇列530中的一個對應的完成元件關聯至內部搬移命令1000。內部搬移命令1000以區段為基本單元指示開放通道固態硬碟130執行特定輸出入通道的資料搬移作業,但不以此為限。 Internal move commands can be defined using a structured format. FIG. 10 is a data format diagram of an internal move command according to an embodiment of the present invention. The internal move command can be a 64-bit command. The 0th byte of the 0th double block of the internal transfer command 1000 records an opcode 1010, which is used to notify the open channel solid state hard disk 130 that this is an internal transfer command. The 2nd to 3rd byte of the 0th double block of the internal transfer command 1000 records the command identification code 1030, and the command identification code 1030 is preferably a sequential production Health, as the basis for identifying the internal move command 1000, is also used to associate a corresponding completion element in the completion queue 530 with the internal move command 1000. The internal transfer command 1000 instructs the open channel solid state hard disk 130 to perform a data transfer operation of a specific input / output channel by using a section as a basic unit, but is not limited thereto.

內部搬移命令1000的第12雙字組的第0至5位元紀錄搬移區段數量1080,最大值為64,因此,一個內部搬移命令1000可指示開放通道固態硬碟130於資料搬移作業中搬移特定輸出入通道中至多64個區段的使用者資料。 The internal move command 1000 of the 12th double block of bits 0 to 5 records the number of moving segments of 1080, with a maximum value of 64. Therefore, an internal move command 1000 can instruct the open channel solid state hard disk 130 to be moved during the data transfer operation. User data for up to 64 segments in a particular input / output channel.

內部搬移命令1000的第10至11雙字組紀錄實體區段(Physical Sector)資訊1070。如果實體區塊的實體位址以32位元表示,且搬移區段數量1080的值為1,則內部搬移命令1000的第10雙字組紀錄使用者資料儲存於來源區塊的區段位址(來源位址),第11雙字組紀錄使用者資料儲存於目的區塊的區段位址(目的位址)。藉由複製回寫程序,處理單元133可將來源位址的使用者資料編程至目的位址。 The 10th to 11th double blocks of the internal transfer command 1000 record the physical sector information 1070. If the physical address of the physical block is represented by 32 bits, and the value of the number of moving sections 1080 is 1, the 10th double-byte record of the internal move command 1000 stores the user data in the section address of the source block ( Source address), the eleventh double-byte record segment address (destination address) where user data is stored in the destination block. By copying and writing back the program, the processing unit 133 can program the user data of the source address to the destination address.

若搬移區段數量1080的值大於1,或實體區塊的實體位址以64位元表示,則實體區段資訊1070紀錄資料緩衝器120的記憶體位址,此時,來源位址以及目的位址以成對地(Paired)存在資料緩衝器120中。於步驟S9310中,處理單元133從遞交佇列510讀取內部搬移命令1000並依據實體區段資訊1070的記錄以及搬移區段數量1080的值,自資料緩衝器120取得成對的來源位址以及目的位址,藉由複製回寫程序,處理單元133可將多個來源位址的多個使用者資料編程至多個指定的目的位址。 If the value of the moving segment number 1080 is greater than 1, or the physical address of the physical block is represented by 64 bits, the physical segment information 1070 records the memory address of the data buffer 120. At this time, the source address and the destination bit The addresses are stored in the data buffer 120 in pairs. In step S9310, the processing unit 133 reads the internal move command 1000 from the submission queue 510 and obtains the paired source address from the data buffer 120 according to the record of the physical section information 1070 and the value of the number of moved sections 1080. The destination address. By copying and writing back the program, the processing unit 133 can program a plurality of user data from a plurality of source addresses to a plurality of designated destination addresses.

在另一實施例中,內部搬移命令1000的第6至7雙字組以實體區域頁面紀錄(PRP,Physical Region Page Entry)或碎片收集清單(SGL,Scatter Gather List)記錄主要記憶體位址1050,且內部搬移命令1000的第8至9雙字組以實體區域頁面紀錄或碎片收集清單記錄延伸記憶體位址1060。當搬移區段數量1080的值大於1時,實體區段資訊1070可紀錄第一筆來源位址,主要記憶體位址1050可紀錄第一筆目的位址。在另一實施例中,主要記憶體位址1050可紀錄第一筆來源位址,延申記憶體位址1060可紀錄第一筆目的位址。在另一實施例中,主要記憶體位址1050可紀錄第一筆成對的來源位址以及目的位址,當主要記憶體位址1050所涵蓋的記憶體空間無法紀錄所有成對的來源位址以及目的位址時,延申記憶體位址1060可紀錄剩餘的成對的來源位址以及目的位址。 In another embodiment, the 6th to 7th double words of the internal transfer command 1000 record the main memory address 1050 with a Physical Region Page Entry (PRP) or a Scatter Gather List (SGL), In addition, the 8th to 9th double words of the internal move command 1000 extend the memory address 1060 with a physical area page record or a fragment collection list record. When the value of the moving segment number 1080 is greater than 1, the physical segment information 1070 can record the first source address, and the main memory address 1050 can record the first destination address. In another embodiment, the main memory address 1050 can record the first source address, and the deferred memory address 1060 can record the first destination address. In another embodiment, the main memory address 1050 can record the first pair of source address and destination address. When the memory space covered by the main memory address 1050 cannot record all the pair of source addresses and For the destination address, the deferred memory address 1060 can record the remaining paired source address and destination address.

內部搬移命令1000的第12雙字組的第24-25位元紀錄寫入模式(M1)1020,第12雙字組的第26-27位元紀錄讀取模式(M2)1040。寫入模式及讀取模式各可包含二個狀態,例如:預設模式及SLC模式。當其指出為SLC模式時,處理單元133指示快閃控制器135通過驅動存取介面137以SLC模式讀取或寫入一個頁面的資料。當其指出為預設模式時,處理單元133指示快閃控制器135通過驅動存取介面137以預設模式讀取或寫入一個頁面的資料。預設模式以TLC為例,此頁面可以是MSB頁面、CSB頁面或LSB頁面。於另一些實施例中,寫入模式可包含四個狀態,例如:SLC模式;MLC模式;TLC模式;及QLC模式。另外,寫入模式的數目較佳與儲存單元139的編程方式 有關,例如:儲存單元139為QLC並採用三段編程(3-Pass Programming)方式,第一段編程僅寫入MSB頁面,第二段編程再寫入CSB頁面以及LSB頁面,第三段編程再寫入TSB頁面,則寫入模式可包含三個模式,包括:SLC模式、TLC模式及QLC模式(預設模式)。當其指出QLC模式時,處理單元133指示快閃控制器135通過驅動存取介面137要求特定輸出入通道於每個記憶體單元寫入MSB頁面、CSB頁面、LSB頁面或TSB頁面的使用者資料。上述設定可也套用至讀取模式中。需注意的是,讀取模式與寫入模式的設定值可不同,例如:讀取模式是SLC模式但寫入模式是預設模式。假設儲存單元139為QLC,主裝置110可以多個輸出內部搬移命令1000而將4筆使用者資料以SLC模式自來源區塊的來源位址中讀出,並依序以QLC模式編程至目的區塊的目的位址。 The internal shift command 1000 of the 12th double block has a 24-25 bit record write mode (M1) 1020, and the 12th double block has a 26-27 bit record read mode (M2) 1040. The write mode and read mode can each include two states, such as: preset mode and SLC mode. When it indicates the SLC mode, the processing unit 133 instructs the flash controller 135 to read or write data of one page in the SLC mode through the driving access interface 137. When it indicates the preset mode, the processing unit 133 instructs the flash controller 135 to read or write data of a page in the preset mode by driving the access interface 137. The preset mode uses TLC as an example. This page can be an MSB page, a CSB page, or an LSB page. In other embodiments, the write mode may include four states, such as: SLC mode; MLC mode; TLC mode; and QLC mode. In addition, the number of write modes is preferably the same as the programming mode of the storage unit 139. For example, the storage unit 139 is QLC and adopts 3-pass programming. The first section of programming is only written into the MSB page, the second section of programming is written into the CSB page and the LSB page, and the third section is programmed again. When writing to a TSB page, the writing mode can include three modes, including: SLC mode, TLC mode, and QLC mode (preset mode). When it indicates the QLC mode, the processing unit 133 instructs the flash controller 135 to request a specific I / O channel to write the user data of the MSB page, CSB page, LSB page, or TSB page in each memory unit by driving the access interface 137. . The above settings can also be applied to the read mode. It should be noted that the setting values of the reading mode and the writing mode may be different. For example, the reading mode is an SLC mode but the writing mode is a preset mode. Assuming that the storage unit 139 is QLC, the main device 110 may output multiple internal transfer commands 1000 and read 4 user data from the source address of the source block in SLC mode, and sequentially program to the destination area in QLC mode. Destination address of the block.

第11圖係完成元件的資料格式圖。完成元件1100可為16位元組訊息。完成元件1100的第3雙字組的第0至1位元組紀錄命令識別碼1130,其內容應與內部搬移命令1000的命令識別碼1030一致,用以讓此完成元件1100關聯至特定內部搬移命令1000。完成元件1100的第0至1雙字組儲存執行回覆表1110,用以記錄每一使用者資料的存取結果。完成元件1100的第3雙字組的第17至31位元紀錄狀態欄位1120,用以記錄內部搬移命令1000的執行結果。 Figure 11 is a data format diagram of the completed component. The completion element 1100 may be a 16-byte message. The 0 to 1 byte record command identification code 1130 of the third double block of the completion element 1100 should be consistent with the command identification code 1030 of the internal transfer command 1000, so that the completion element 1100 is associated with a specific internal removal Order 1000. The 0 to 1 double-word storage execution completion table 1110 of the completion component 1100 is used to record the access result of each user data. The 17th to 31st bit record status field 1120 of the third double block of the completion element 1100 is used to record the execution result of the internal move command 1000.

在步驟S9110之前,主裝置110系統可儲存多筆使用紀錄119,每筆紀錄儲存一個輸出入通道的實體區塊的使用狀態的資訊。於每次開放通道固態硬碟130執行完資料存取作 業(例如,抹除、讀取、寫入、內部搬移等),主裝置110可更新相應使用紀錄中的使用狀態的資訊,並判定是否滿足相應輸出入通道的資料搬移條件。例如,將相應輸出入通道的閒置區塊的數量減1,將相應輸出入通道的一個實體區塊的抹除次數加1,或將相應輸出入通道的一個資料區塊的讀取次數加1等。於一些實施例中,當使用紀錄119指出相應輸出入通道的閒置區塊的數量低於閒置閥值時,代表閒置區塊的數量太少,需要啟動垃圾收集程序,以增加閒置區塊的數量。於一些實施例中,當使用紀錄119指出相應輸出入通道的一個實體區塊的抹除次數高於抹除閥值時,主裝置啟動耗損平均程序以避免使用者資料遇到資料保存的問題。 Before step S9110, the main device 110 system can store a plurality of usage records 119, and each record stores the usage status information of the physical block of an input / output channel. Perform data access operations on each open channel SSD 130 Industry (for example, erasing, reading, writing, internal relocation, etc.), the main device 110 may update the usage status information in the corresponding usage record and determine whether the data transfer conditions of the corresponding input / output channels are met. For example, the number of idle blocks of the corresponding input / output channel is reduced by 1, the number of erasures of a physical block of the corresponding input / output channel is increased by 1, or the number of reads of a data block of the corresponding input / output channel is increased by 1. Wait. In some embodiments, when the use record 119 indicates that the number of idle blocks of the corresponding input / output channel is lower than the idle threshold, it means that the number of idle blocks is too small, and a garbage collection process needs to be started to increase the number of idle blocks. . In some embodiments, when the use record 119 indicates that the number of erasures of a physical block of the corresponding input / output channel is higher than the erasure threshold, the host device initiates a wear averaging process to avoid user data encountering the problem of data storage.

在執行資料讀取或寫入的過程中,可能遇到讀取失敗或寫入失敗的情況。當遇到上述清況時,完成元件1100的狀態欄位1120會被設為”1”,讀取失敗或寫入失敗的使用者資料所對應在執行回覆表的位元也會設為”1”。此時,主裝置110必須先判斷此失敗為讀取失敗或寫入失敗,如果是讀取失敗,則啟動錯誤管理程序,例如:RAID,以修復來源位址的使用者資料;如果是寫入失敗,則重新為使用者資料決定一個新的目的位址。 In the process of reading or writing data, you may encounter read failure or write failure. When the above situation is encountered, the status field 1120 of the completion component 1100 will be set to "1", and the bit corresponding to the user data that failed to read or write will be set to "1" ". At this time, the host device 110 must first determine whether the failure is a read failure or a write failure. If it is a read failure, start an error management program, such as RAID, to repair the user data of the source address; if it is a write If it fails, a new destination address is determined for the user data.

由上述的描述中可知,內部搬移過程中如果發生會失敗的情況,則主裝置110需耗費大量時間及運算資源以判斷原因並修正此錯誤。為解決如上所述的缺陷,於另一些實施例,主裝置110不為每一個來源位址的使用者資料決定一個目的位址,而是讓開放通道固態硬碟130決定,之後,開放通道 固態硬碟130再將決定的目的位址依據內部搬移命令1000的指示上傳至主裝置111所指定的資料緩衝器120的記憶體位址,例如:主要記憶體位址1050、延伸記憶體位址1060或實體區段資訊1070所指定的記憶體位址。最後,透過完成元件1100通知主裝置110目的位址已完成上傳,之後,主裝置110可依據目的位址更新實體儲存對照表117。 It can be known from the above description that if a failure occurs during the internal removal process, the main device 110 needs to spend a lot of time and computing resources to determine the cause and correct the error. In order to solve the above-mentioned shortcomings, in other embodiments, the host device 110 does not determine a destination address for the user data of each source address, but allows the open channel solid state hard disk 130 to determine it. The solid state hard disk 130 then uploads the determined destination address to the memory address of the data buffer 120 designated by the main device 111 according to the instruction of the internal transfer command 1000, such as the main memory address 1050, the extended memory address 1060, or the entity. Memory address specified by section information 1070. Finally, the completion device 1100 is used to notify the host device 110 that the destination address has been uploaded. After that, the host device 110 may update the entity storage lookup table 117 according to the destination address.

當需要進行多個區段的使用者資料搬移時,詳細來說,於步驟S9110前,主裝置110可儲存多筆使用者資料的來源位址至資料緩衝區120,並將來源位址在資料緩衝區120的記憶體位址儲存至內部搬移命令1000中的主要記憶體位址1050、延伸記憶體位址1060或實體區段資訊1070其中一個,主要記憶體位址1050、延伸記憶體位址1060或實體區段資訊1070中的另一個則供開放通道固態硬碟130上傳使用者資料的目的位址。在步驟S9110,將內部搬移命令1000寫入至遞交佇列510。來源位址可使用邏輯單元編號、資料平面編號、實體區塊編號、實體頁面編號及區段編號表示。於步驟S9310,處理單元133讀取並判斷內部搬移命令1000的操作碼1010,接著再讀取內部搬移命令1000的搬移區段數量1080、主要記憶體位址1050、延申記憶體位址1060或實體區段資訊1070的值,再至資料緩衝器120的記憶體位址取得多筆使用者資料的來源位址。接著,於步驟S9320,處理單元133為每一個使用者資料決定一個目的位址,例如:選取具有抹除次數的閒置區塊作為目的區塊,並指示快閃控制器135通過驅動存取介面137對特定輸出入通道的來源區塊和目的區塊執行複製回寫程序。當寫入任何一 個目的位址失敗時,處理單元133將使用者資料編程至下一個頁面(的第一個區段);或直接將此實體字元線的所有剩餘頁面寫入虛假資料(Dummy Data),再將使用者資料編程至下一個實體字元線的MSB頁面(的第一個區段),或是,重新指示快閃控制器135通過驅動存取介面137要求對特定輸出入通道的來源區塊和目的區塊執行複製回寫程序,將使用者資料搬移至下一個實體字元線的MSB頁面,或是,將使用者資料編程至另一個目的區塊。於步驟S9330,當複製回寫程序成功執行完畢後,處理單元133可儲存所有使用者資料的目的位址至資料緩衝區120,寫入完成元件1100至完成佇列530。於步驟S1130,主裝置110收到完成元件1100之後,依據搬移區段數量1080、主要記憶體位址1050、延伸記憶體位址1060或實體區段資訊1070的值從資料緩衝區120讀取所有的目的位址,並據以更新實體儲存對照表117。 When user data needs to be moved in multiple sections, in detail, before step S9110, the main device 110 can store the source addresses of multiple user data in the data buffer 120, and store the source addresses in the data. The memory address of the buffer 120 is stored in one of the main memory address 1050, the extended memory address 1060, or the physical section information 1070 in the internal transfer command 1000, the main memory address 1050, the extended memory address 1060, or the physical section The other of the information 1070 is a destination address for the open channel solid state hard disk 130 to upload user data. In step S9110, the internal transfer command 1000 is written into the delivery queue 510. The source address can be represented by a logical unit number, a data plane number, a physical block number, a physical page number, and a section number. In step S9310, the processing unit 133 reads and judges the operation code 1010 of the internal move command 1000, and then reads the number of moved sections 1080 of the internal move command 1000, the main memory address 1050, the deferred memory address 1060, or the physical area. The value of the segment information 1070, and then the memory address of the data buffer 120 to obtain the source address of the plurality of user data. Next, in step S9320, the processing unit 133 determines a destination address for each user data. For example, an idle block with erasure times is selected as the destination block, and the flash controller 135 is instructed to drive the access interface 137. Perform a copy-write procedure on the source and destination blocks of a particular input-output channel. When writing any When each destination address fails, the processing unit 133 programs the user data to the next page (the first section); or directly writes all the remaining pages of this physical character line into dummy data, and then Program user data to the MSB page (first section) of the next physical character line, or re-instruct the flash controller 135 to request the source block of a specific input / output channel through the drive access interface 137 Perform a copy-write procedure with the destination block to move the user data to the MSB page of the next physical character line, or program the user data to another destination block. In step S9330, after the copy and write procedure is successfully executed, the processing unit 133 can store the destination addresses of all user data in the data buffer 120, and write the completion element 1100 to the completion queue 530. In step S1130, after receiving the completion component 1100, the main device 110 reads all the purposes from the data buffer 120 according to the value of the number of moved sections 1080, the main memory address 1050, the extended memory address 1060, or the physical section information 1070. Address, and update the physical storage lookup table 117 accordingly.

當只需要一個區段的使用者資料搬移時,詳細來說,於步驟S9110,主裝置110可儲存一個來源位址至內部搬移命令1000中的實體區段資訊1070,並設定主要記憶體位址1050的值以供開放通道固態硬碟130上傳使用者資料的目的位址,並且寫入內部搬移命令1000至遞交佇列510。於步驟S9310,處理單元133讀取內部搬移命令1000中的實體區段資訊1070的來源位址時,為此來源位址決定一個目的位址,並指示快閃控制器135通過驅動存取介面137要求特定輸出入通道執行複製回寫程序。於步驟S9330,當此複製回寫程序成功執行完畢後,處理單元133上傳使用者資料的目的位址至主要記憶體位址 1050所對應的記憶體位址寫入完成元件1100至完成佇列530。於步驟S1130,主裝置110讀取完成元件1100並依據主要記憶體位址1050的值從資料緩衝區120讀取目的位址,並據以更新實體儲存對照表117。 When only one section of user data needs to be moved, in detail, in step S9110, the main device 110 can store a source address to the physical section information 1070 in the internal move command 1000, and set the main memory address 1050 The value is used for the destination address of the open channel solid state hard disk 130 for uploading user data, and the internal transfer command 1000 is written to the submission queue 510. In step S9310, when the processing unit 133 reads the source address of the physical section information 1070 in the internal move command 1000, determines a destination address for the source address, and instructs the flash controller 135 to drive the access interface 137 through the driver. Requires specific I / O channels to perform a copy-write procedure. In step S9330, after the copy and write procedure is successfully executed, the processing unit 133 uploads the destination address of the user data to the main memory address. The memory address corresponding to 1050 is written into the completion element 1100 to the completion queue 530. In step S1130, the main device 110 reads the completed component 1100 and reads the destination address from the data buffer 120 according to the value of the main memory address 1050, and updates the physical storage comparison table 117 accordingly.

第12圖係依據本發明實施例的廢料蒐集程序的內部搬移作業示意圖。主裝置111可寫入內部搬移命令至遞交佇列510,內部搬移命令包含多組來源區段及目的地區段的實體位置。第一組包含來源區段711及目的地區段771的實體位置,第二組包含來源區段733及目的地區段773的實體位置,第三組包含來源區段755及目的地區段775的實體位置,以及第四組包含來源區段757及目的地區段777的實體位置。接著,快閃控制器135驅動存取子介面1210執行複製回寫程序。存取子介面1210指示直接資料存取電路(DMA-Direct Memory Access Circuit)1230讀取來源區段711、733、755及757的資料,並蒐集儲存至寄存器1250,接著,指示直接資料存取電路1230將寄存器1250中一整個實體頁面的資料寫入實體塊770中的實體頁面P4(包含區段771、773、775及777)。 FIG. 12 is a schematic diagram of an internal moving operation of a waste collection program according to an embodiment of the present invention. The main device 111 can write an internal move command to the submission queue 510. The internal move command includes multiple sets of physical locations of the source section and the destination section. The first group contains the physical locations of the source section 711 and the destination section 771, the second group contains the physical locations of the source section 733 and the destination section 773, and the third group contains the physical locations of the source section 755 and the destination section 775. , And the fourth group contains the physical locations of the source section 757 and the destination section 777. Then, the flash controller 135 drives the access sub-interface 1210 to execute the copy-back and write-back procedure. The access sub-interface 1210 instructs the DMA-Direct Memory Access Circuit 1230 to read the data of the source sections 711, 733, 755, and 757, and collects and stores the data in the register 1250, and then instructs the direct data access circuit 1230 writes the data of an entire physical page in the register 1250 into the physical page P4 (including the sections 771, 773, 775, and 777) in the physical block 770.

第13圖係依據本發明實施例的耗損平均程序的內部搬移作業示意圖。主裝置111可寫入內部搬移命令至遞交佇列510,內部搬移命令包含多組來源區段及目的地區段的實體位置。例如,第一組包含實體塊810的實體頁面P5中之第一來源區段以及實體塊830的實體頁面P7中之第一目的地區段的實體位置,第二組包含實體塊810的實體頁面P5中之第二來源區段以及實體塊830的實體頁面P7中之第二目的地區段的實體位 置,依此類推。接著,快閃控制器135驅動存取子介面1310執行複製回寫程序。存取子介面1310指示直接資料存取電路1330讀取實體頁面P5及P6中八個來源區段的資料,並儲存至寄存器1350,接著,指示直接資料存取電路1330將寄存器1350中二個實體頁面的資料寫入實體塊830中的實體頁面P7及P8。 FIG. 13 is a schematic diagram of an internal moving operation according to a wear averaging program according to an embodiment of the present invention. The main device 111 can write an internal move command to the submission queue 510. The internal move command includes multiple sets of physical locations of the source section and the destination section. For example, the first group contains the first source section in the physical page P5 of the physical block 810 and the physical location of the first destination section in the physical page P7 of the physical block 830, and the second group contains the physical page P5 of the physical block 810. The second source section in the second block and the physical bit in the second destination section in the physical page P7 of the physical block 830 Settings, and so on. Then, the flash controller 135 drives the access sub-interface 1310 to execute the copy-back and write-back procedure. The access sub-interface 1310 instructs the direct data access circuit 1330 to read the data of the eight source sections in the physical pages P5 and P6 and stores them in the register 1350. Then, the direct data access circuit 1330 instructs the direct data access circuit 1330 to register the two entities in the register 1350 The data of the page is written into the physical pages P7 and P8 in the physical block 830.

另外,複製回寫程序的執行過程中,使用者資料不需要上傳至資料緩衝器120。快閃控制器135輸出複製回寫的讀取命令至儲存單元139的來源區塊,使得自來源位址讀取出的使用者資料暫存於儲存單元139的寄存器(快取寄存器或頁面寄存器)中。接著,快閃控制器135輸出複製回寫的編程命令至儲存單元139的目的區塊,使得暫存在寄存器1250的使用者資料被編程至目的位址。由於使用者資料不需要上傳至資料緩衝器120,因此,使用者資料自來源區塊傳送至資料緩衝器120以及自資料緩衝器120傳送至目的區塊的時間即可被節省,故能增加開放通道固態硬碟130的系統效能,達到本發明的目的。 In addition, the user data does not need to be uploaded to the data buffer 120 during the execution of the copy-back program. The flash controller 135 outputs a read-back read command to the source block of the storage unit 139, so that the user data read from the source address is temporarily stored in a register (cache register or page register) of the storage unit 139. in. Then, the flash controller 135 outputs the program command copied back to the destination block of the storage unit 139, so that the user data temporarily stored in the register 1250 is programmed to the destination address. Since user data does not need to be uploaded to the data buffer 120, the time for transmitting user data from the source block to the data buffer 120 and from the data buffer 120 to the destination block can be saved, which can increase openness The system performance of the channel solid state hard disk 130 achieves the purpose of the present invention.

雖然第1至3圖中包含了以上描述的元件,但不排除在不違反發明的精神下,使用更多其他的附加元件,已達成更佳的技術效果。此外,雖然第6圖及第9圖的流程圖採用指定的順序來執行,但是在不違反發明精神的情況下,熟習此技藝人士可以在達到相同效果的前提下,修改這些步驟間的順序,所以,本發明並不侷限於僅使用如上所述的順序。此外,熟習此技藝人士亦可以將若干步驟整合為一個步驟,或者是除了這些步驟外,循序或平行地執行更多步驟,本發明亦不因此而侷限。 Although the above-mentioned elements are included in the drawings 1 to 3, it is not excluded that more technical advantages can be achieved by using more additional elements without violating the spirit of the invention. In addition, although the flowcharts in Figures 6 and 9 are executed in a specified order, those skilled in the art can modify the order between these steps 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 perform more steps sequentially or in parallel in addition to these steps, and the present invention is not limited by this.

雖然本發明使用以上實施例進行說明,但需要注意的是,這些描述並非用以限縮本發明。相反地,此發明涵蓋了熟習此技藝人士顯而易見的修改與相似設置。所以,申請權利要求範圍須以最寬廣的方式解釋來包含所有顯而易見的修改與相似設置。 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. Rather, the invention encompasses modifications and similar arrangements apparent to those skilled in the art. Therefore, the scope of the claims should be interpreted in the broadest way to encompass all obvious modifications and similar arrangements.

Claims (22)

一種快閃記憶體的資料內部搬移方法,由一主裝置執行,包含:偵測到一固態硬碟中的一輸出入通道的一使用狀態滿足一條件時,產生一內部搬移命令;以及提供上述內部搬移命令以指示上述固態硬碟於上述輸出入通道中執行一內部資料搬移作業。A flash memory internal data transfer method executed by a host device includes: generating an internal transfer command when detecting that a use state of an input / output channel in a solid-state hard disk meets a condition; and providing the above; The internal moving command instructs the solid-state hard disk to perform an internal data moving operation in the input / output channel. 如申請專利範圍第1項所述的快閃記憶體的資料內部搬移方法,包含:寫入上述內部搬移命令至一遞交佇列;以及發送一遞交門鈴給上述固態硬碟的一處理單元,使得上述處理單元從上述遞交佇列讀取上述內部搬移命令,並且依據上述內部搬移命令指示一快閃控制器要求上述輸出入通道執行一複製回寫程序將上述輸出入通道中的一來源位置的使用者資料搬移至一目的地位置。The flash memory data internal moving method according to the first patent application scope includes: writing the internal moving command to a submission queue; and sending a doorbell to a processing unit of the solid-state hard disk, so that The processing unit reads the internal transfer command from the delivery queue, and instructs a flash controller to request the input / output channel to execute a copy-write program to use a source location in the input / output channel according to the internal transfer command. This information is moved to a destination location. 如申請專利範圍第1項所述的快閃記憶體的資料內部搬移方法,包含:於提供上述內部搬移命令前,儲存多筆資料搬移紀錄至一資料緩衝區,其中,上述資料搬移紀錄中之每一者包含一對的一來源位置及一目的地位置,以及上述來源位置及上述目的地位置中之任一者以邏輯單元編號、資料平面編號、實體區塊編號、實體頁面編號及區段編號表示;以及儲存指向一第一筆資料搬移紀錄的一記憶體位址至上述內部搬移命令,使得上述固態硬碟從上述資料緩衝區取得上述來源位置及上述實體位址。According to the flash memory data internal moving method as described in the first item of the patent application scope, the method includes: storing multiple data moving records in a data buffer before providing the internal moving command, wherein, among the above data moving records, Each includes a pair of a source location and a destination location, and any one of the source location and the destination location is identified by a logical unit number, a data plane number, a physical block number, a physical page number, and a section The number indicates; and a memory address pointing to a first data movement record is stored to the internal movement command, so that the solid-state hard disk obtains the source location and the physical address from the data buffer. 如申請專利範圍第3項所述的快閃記憶體的資料內部搬移方法,包含:從上述固態硬碟接收到相應於上述內部搬移命令的一完成元件後,依據上述來源位置及上述目的地位置更新一實體儲存對照表,其中,上述實體儲存對照表指出每一邏輯區塊位址的資料實際儲存於上述固態硬碟中之一儲存單元中的哪個位置。The internal data transfer method of the flash memory according to item 3 of the scope of patent application, comprising: after receiving a completion component corresponding to the internal transfer command from the solid-state hard disk, according to the source location and the destination location Update a physical storage comparison table, wherein the physical storage comparison table indicates where the data of each logical block address is actually stored in a storage unit in the solid-state hard disk. 如申請專利範圍第1項所述的快閃記憶體的資料內部搬移方法,包含:於提供上述內部搬移命令前,儲存多筆資料搬移紀錄至一資料緩衝區,其中,上述資料搬移紀錄中之每一者包含一來源位置,以及上述來源位置以邏輯單元編號、資料平面編號、實體區塊編號、實體頁面編號及區段編號表示;以及儲存指向一第一筆資料搬移紀錄的一記憶體位址至上述內部搬移命令,使得上述固態硬碟從上述資料緩衝區取得上述來源位置,依據上述來源位置決定一目的地位置,並儲存上述目的地位置至上述資料緩衝區。According to the flash memory data internal moving method as described in the first item of the patent application scope, the method includes: storing multiple data moving records in a data buffer before providing the internal moving command, wherein, among the above data moving records, Each includes a source location, and the source location is represented by a logical unit number, a data plane number, a physical block number, a physical page number, and a section number; and a memory address storing a pointer to a first data transfer record To the internal move command, the solid-state hard disk obtains the source location from the data buffer, determines a destination location based on the source location, and stores the destination location into the data buffer. 如申請專利範圍第5項所述的快閃記憶體的資料內部搬移方法,包含:從上述資料緩衝區取得相應於每一上述來源位置的上述目的地位置;以及依據上述來源位置及上述目的地位置更新一實體儲存對照表,其中,上述實體儲存對照表指出每一邏輯區塊位址的資料實際儲存於上述固態硬碟中之一儲存單元中的哪個位置。The internal data transfer method of the flash memory according to item 5 of the scope of the patent application, comprising: obtaining the above-mentioned destination location corresponding to each of the above-mentioned source locations from the above-mentioned data buffer; and according to the above-mentioned source location and the above-mentioned destination The location updates a physical storage lookup table, where the physical storage lookup table indicates where the data of each logical block address is actually stored in a storage unit in the solid state hard disk. 一種快閃記憶體的資料內部搬移裝置,包含:一主裝置,偵測到一固態硬碟中的一輸出入通道的一使用狀態滿足一條件時,產生一內部搬移命令;以及提供上述內部搬移命令以指示上述固態硬碟於上述輸出入通道中執行一內部資料搬移作業。A flash memory internal data transfer device includes: a main device that generates an internal transfer command when it detects that a use status of an input / output channel in a solid-state hard disk meets a condition; and provides the above-mentioned internal transfer The command instructs the solid-state hard disk to perform an internal data transfer operation in the input / output channel. 如申請專利範圍第7項所述的快閃記憶體的資料內部搬移裝置,包含:一遞交佇列;其中,上述主裝置寫入上述內部搬移命令至上述遞交佇列;以及發送一遞交門鈴給上述固態硬碟的一處理單元,使得上述處理單元從上述遞交佇列讀取上述內部搬移命令,並且依據上述內部搬移命令指示一快閃控制器要求上述輸出入通道執行一複製回寫程序將上述輸出入通道中的一來源位置的使用者資料搬移至一目的地位置。According to the flash memory data internal transfer device described in item 7 of the patent application scope, including: a submission queue; wherein the main device writes the internal transfer command to the submission queue; and sends a doorbell to A processing unit of the solid-state hard disk, so that the processing unit reads the internal transfer command from the delivery queue, and instructs a flash controller to request the input / output channel to execute a copy-write-back program to execute the above-mentioned internal transfer command according to the internal transfer command User data from a source location in the input / output channel is moved to a destination location. 如申請專利範圍第7項所述的快閃記憶體的資料內部搬移裝置,包含:一資料緩衝區;其中,上述主裝置於提供上述內部搬移命令前,儲存多筆資料搬移紀錄至上述資料緩衝區,其中,上述資料搬移紀錄中之每一者包含一對的一來源位置及一實體位址,以及上述來源位置及上述目的地位置中之任一者以邏輯單元編號、資料平面編號、實體區塊編號、實體頁面編號及區段編號表示;以及儲存指向上述第一筆資料搬移紀錄的一記憶體位址至上述內部搬移命令,使得上述固態硬碟從上述資料緩衝區取得上述來源位置及上述實體位址。According to the flash memory data internal moving device described in item 7 of the patent application scope, including: a data buffer; wherein the main device stores multiple data moving records to the data buffer before providing the internal moving command. Area, wherein each of the above-mentioned data transfer records includes a one-to-one source location and an entity address, and any one of the above-mentioned source location and the above-mentioned destination location is represented by a logical unit number, a data plane number, an entity Block number, physical page number, and section number indication; and storing a memory address pointing to the first data transfer record to the internal transfer command, so that the solid-state hard disk obtains the source location and the above from the data buffer The physical address. 如申請專利範圍第9項所述的快閃記憶體的資料內部搬移裝置,其中,上述主裝置從上述固態硬碟接收到相應於上述內部搬移命令的一完成元件後,依據上述來源位置及上述目的地位置更新一實體儲存對照表,其中,上述實體儲存對照表指出每一邏輯區塊位址的資料實際儲存於上述固態硬碟中之一儲存單元中的哪個位置。According to the flash memory data internal moving device according to item 9 of the patent application scope, wherein the main device receives a completion component corresponding to the internal moving command from the solid-state hard disk, according to the above source location and the above The destination location updates a physical storage lookup table, where the physical storage lookup table indicates where the data of each logical block address is actually stored in a storage unit in the solid state hard disk. 如申請專利範圍第7項所述的快閃記憶體的資料內部搬移裝置,包含:一資料緩衝區;其中,上述主裝置於提供上述內部搬移命令前,儲存多筆資料搬移紀錄至一資料緩衝區,其中,上述資料搬移紀錄中之每一者包含一來源位置,以及上述來源位置以邏輯單元編號、資料平面編號、實體區塊編號、實體頁面編號及區段編號表示;以及儲存指向上述第一筆資料搬移紀錄的一記憶體位址至上述內部搬移命令,使得上述固態硬碟從上述資料緩衝區取得上述來源位置,依據上述來源位置決定一目的地位置,並儲存上述目的地位置至一資料緩衝區。According to the flash memory data internal moving device described in item 7 of the patent application scope, including: a data buffer; wherein the main device stores multiple data moving records to a data buffer before providing the internal moving command. Area, wherein each of the above-mentioned data transfer records includes a source location, and the above-mentioned source location is represented by a logical unit number, a data plane number, a physical block number, a physical page number, and a section number; and A memory address of a data transfer record to the internal transfer command enables the solid-state hard disk to obtain the source location from the data buffer, determine a destination location based on the source location, and store the destination location to a data Buffer. 如申請專利範圍第11項所述的快閃記憶體的資料內部搬移裝置,其中,上述主裝置從上述資料緩衝區取得相應於每一上述來源位置的上述目的地位置;以及依據上述來源位置及上述目的地位置更新一實體儲存對照表,其中,上述實體儲存對照表指出每一邏輯區塊位址的資料實際儲存於上述固態硬碟中之一儲存單元中的哪個位置。According to the flash memory data internal moving device according to item 11 of the patent application scope, wherein the main device obtains the above-mentioned destination location corresponding to each of the above-mentioned source locations from the above-mentioned data buffer area; and The destination location updates a physical storage lookup table, where the physical storage lookup table indicates where in the storage unit in the solid state hard disk the data of each logical block address is actually stored. 如申請專利範圍第7項所述的快閃記憶體的資料內部搬移裝置,其中,上述固態硬碟中的上述輸出入通道的上述使用狀態滿足上述條件指上述固態硬碟中的一儲存單元的可用空間不足。According to the flash memory data internal moving device according to item 7 of the patent application scope, wherein the above-mentioned use state of the input / output channel in the solid-state hard disk satisfies the above-mentioned condition, it refers to a storage unit in the solid-state hard disk. Not enough free space. 如申請專利範圍第7項所述的快閃記憶體的資料內部搬移裝置,其中,上述固態硬碟中的上述輸出入通道的上述使用狀態滿足上述條件指上述輸出入通道中的一實體區塊的一抹除次數超過一閥值。According to the flash memory data internal moving device according to item 7 of the patent application scope, wherein the above-mentioned use state of the input / output channel in the solid-state hard disk satisfies the above condition refers to a physical block in the input / output channel The number of erasures exceeds a threshold. 一種快閃記憶體的資料內部搬移方法,由一固態硬碟中的一處理單元執行,包含:取得由一主裝置產生的一內部搬移命令,其中,上述內部搬移命令指示上述固態硬碟於一輸出入通道中執行一內部資料搬移作業,包含指向一資料緩衝區中的一第一筆資料搬移紀錄的一記憶體位址;從上述資料緩衝區中的上述記憶體位址開始取得多筆資料搬移紀錄,其中,上述資料搬移紀錄中之每一者包含一來源位置;為每一上述來源位置決定上述輸出入通道中的一目的地位置;指示一快閃控制器要求上述輸出入通道執行一複製回寫程序將上述輸出入通道中的每一上述來源位置的使用者資料搬移至上述決定的目的地位置;以及回覆每一上述來源位置的上述目的地位置給上述主裝置。A flash memory data internal moving method is executed by a processing unit in a solid-state hard disk and includes: obtaining an internal moving command generated by a host device, wherein the internal moving command instructs the solid-state hard disk to a An internal data transfer operation is performed in the input / output channel, including a memory address pointing to a first data transfer record in a data buffer; multiple data transfer records are obtained starting from the above memory address in the data buffer In which, each of the above-mentioned data transfer records includes a source location; determining a destination location in the input / output channel for each of the above source locations; instructing a flash controller to request the input / output channel to perform a copy back The writing program moves the user data of each of the above source locations in the input and output channels to the determined destination location; and responds to the destination location of each of the above source locations to the host device. 如申請專利範圍第15項所述的快閃記憶體的資料內部搬移方法,包含:從上述主裝置接收一遞交門鈴後,從一遞交佇列讀取上述內部搬移命令。The flash memory data internal transfer method according to item 15 of the scope of patent application includes: after receiving a delivery doorbell from the main device, reading the internal transfer command from a delivery queue. 如申請專利範圍第15項所述的快閃記憶體的資料內部搬移方法,包含:當寫入上述目的地位置中之任一者失敗時,重新決定一目的地位置;以及指示上述快閃控制器要求上述輸出入通道執行一複製回寫程序將上述相應來源位置的使用者資料搬移至上述重新決定的目的地位置。The flash memory data internal moving method according to item 15 of the scope of patent application, comprising: when writing to any of the above destination locations fails, re-determining a destination location; and instructing the above flash control The processor requests the input / output channel to execute a copy-back write procedure to move the user data of the corresponding source location to the re-determined destination location. 如申請專利範圍第15項所述的快閃記憶體的資料內部搬移方法,包含:當上述複製回寫程序執行後,儲存相應於所有上述來源位置的上述目的地位置至上述資料緩衝區;儲存指向上述資料緩衝區中的一第一筆目的地位置的一記憶體位址至一完成元件;以及寫入上述完成元件至一完成佇列。The internal data transfer method of the flash memory according to item 15 of the scope of the patent application, which includes: after the copy-write-back procedure is executed, storing the destination locations corresponding to all the source locations to the data buffer; storing A memory address pointing to a first destination position in the data buffer to a completion element; and writing the completion element to a completion queue. 一種快閃記憶體的資料內部搬移裝置,包含:一快閃控制器;以及一處理單元,耦接於上述快閃控制器,取得由一主裝置產生的一內部搬移命令,其中,上述內部搬移命令指示一固態硬碟於一輸出入通道中執行一內部資料搬移作業,包含指向一資料緩衝區中的一第一筆資料搬移紀錄的一記憶體位址;從上述資料緩衝區中的上述記憶體位址開始取得多筆資料搬移紀錄,其中,上述資料搬移紀錄中之每一者包含一來源位置;為每一上述來源位置決定上述輸出入通道中的一目的地位置;指示上述快閃控制器要求上述輸出入通道執行一複製回寫程序將上述輸出入通道中的每一上述來源位置的使用者資料搬移至上述決定的目的地位置;以及回覆每一上述來源位置的上述目的地位置給上述主裝置。A flash memory data internal moving device includes: a flash controller; and a processing unit coupled to the flash controller to obtain an internal moving command generated by a main device, wherein the internal moving The command instructs a solid state hard disk to perform an internal data transfer operation in an input / output channel, including a memory address pointing to a first data transfer record in a data buffer; from the above memory position in the data buffer Start to obtain multiple data transfer records, where each of the data transfer records includes a source location; determine a destination location in the input / output channel for each of the source locations; instruct the flash controller request The input / output channel executes a copy and write procedure to move the user data of each of the source locations in the input / output channel to the determined destination location; and responds to the destination location of each of the source locations to the master Device. 如申請專利範圍第19項所述的快閃記憶體的資料內部搬移裝置,其中,上述處理單元從上述主裝置接收一遞交門鈴後,從一遞交佇列讀取上述內部搬移命令。According to the flash memory data internal moving device according to item 19 of the patent application scope, wherein the processing unit receives a delivery doorbell from the main device, and reads the internal moving command from a delivery queue. 如申請專利範圍第19項所述的快閃記憶體的資料內部搬移裝置,其中,當寫入上述目的地位置中之任一者失敗時,上述處理單元重新決定一目的地位置;以及指示上述快閃控制器要求上述輸出入通道執行一複製回寫程序將上述相應來源位置的資料搬移至上述重新決定的目的地位置。The flash memory data internal moving device according to item 19 of the scope of patent application, wherein when writing to any of the above destination locations fails, the processing unit newly determines a destination location; and instructs the above destination location; The flash controller requires the I / O channel to execute a copy-back program to move the data of the corresponding source position to the re-determined destination position. 如申請專利範圍第19項所述的快閃記憶體的資料內部搬移裝置,其中,當上述複製回寫程序執行後,上述處理單元儲存相應於所有上述來源位置的上述目的地位置至上述資料緩衝區;儲存指向上述資料緩衝區中的一第一筆目的地位置的一記憶體位址至一完成元件;以及寫入上述完成元件至一完成佇列。According to the flash memory data internal moving device according to item 19 of the patent application scope, wherein after the copy-write-back program is executed, the processing unit stores the destination locations corresponding to all the source locations to the data buffer Area; storing a memory address pointing to a first destination location in the data buffer to a completion element; and writing the completion element to a completion queue.
TW107101541A 2017-09-22 2018-01-16 Methods for internal data movement of a flash memory and apparatuses using the same TWI679535B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN202210242579.7A CN114546293A (en) 2017-09-22 2018-03-14 Data internal moving method of flash memory and device using the same
CN201810209548.5A CN109542335B (en) 2017-09-22 2018-03-14 Data internal moving method of flash memory and device using the same
US16/015,703 US10782910B2 (en) 2017-09-22 2018-06-22 Methods for internal data movements of a flash memory device and apparatuses using the same

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US201762561824P 2017-09-22 2017-09-22
US62/561,824 2017-09-22

Publications (2)

Publication Number Publication Date
TW201915743A TW201915743A (en) 2019-04-16
TWI679535B true TWI679535B (en) 2019-12-11

Family

ID=66991786

Family Applications (2)

Application Number Title Priority Date Filing Date
TW107101541A TWI679535B (en) 2017-09-22 2018-01-16 Methods for internal data movement of a flash memory and apparatuses using the same
TW108139908A TWI726475B (en) 2017-09-22 2018-01-16 Methods for internal data movement of a flash memory and apparatuses using the same

Family Applications After (1)

Application Number Title Priority Date Filing Date
TW108139908A TWI726475B (en) 2017-09-22 2018-01-16 Methods for internal data movement of a flash memory and apparatuses using the same

Country Status (1)

Country Link
TW (2) TWI679535B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11580017B2 (en) 2020-04-27 2023-02-14 Silicon Motion, Inc. Method and apparatus and computer program product for preparing logical-to-physical mapping information for host side
TWI756854B (en) * 2020-04-27 2022-03-01 慧榮科技股份有限公司 Method and apparatus and computer program product for managing data storage
US11262938B2 (en) * 2020-05-05 2022-03-01 Silicon Motion, Inc. Method and apparatus for performing access management of a memory device with aid of dedicated bit information
TWI748507B (en) * 2020-06-08 2021-12-01 瑞昱半導體股份有限公司 Data access system, and method for operating a data access system
TWI790568B (en) * 2021-03-15 2023-01-21 宏碁股份有限公司 Work status control method for memory device and data storage system
JP2022147448A (en) 2021-03-23 2022-10-06 キオクシア株式会社 Memory system and data management method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103761988A (en) * 2013-12-27 2014-04-30 华为技术有限公司 SSD (solid state disk) and data movement method
TW201543227A (en) * 2014-05-01 2015-11-16 Wuunet Technology Co Ltd Electronic apparatus interacting with external device
TWI520153B (en) * 2013-11-05 2016-02-01 威盛電子股份有限公司 Non-volatile memory device and operation method thereof
CN105745628A (en) * 2014-06-27 2016-07-06 华为技术有限公司 Terminal, service provision apparatus, and coupon server, electronic wallet system having same, control method thereof, and recording medium in which computer program is recorded
US9465731B2 (en) * 2012-12-31 2016-10-11 Sandisk Technologies Llc Multi-layer non-volatile memory system having multiple partitions in a layer

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9465731B2 (en) * 2012-12-31 2016-10-11 Sandisk Technologies Llc Multi-layer non-volatile memory system having multiple partitions in a layer
TWI520153B (en) * 2013-11-05 2016-02-01 威盛電子股份有限公司 Non-volatile memory device and operation method thereof
CN103761988A (en) * 2013-12-27 2014-04-30 华为技术有限公司 SSD (solid state disk) and data movement method
TW201543227A (en) * 2014-05-01 2015-11-16 Wuunet Technology Co Ltd Electronic apparatus interacting with external device
CN105745628A (en) * 2014-06-27 2016-07-06 华为技术有限公司 Terminal, service provision apparatus, and coupon server, electronic wallet system having same, control method thereof, and recording medium in which computer program is recorded

Also Published As

Publication number Publication date
TW202006553A (en) 2020-02-01
TWI726475B (en) 2021-05-01
TW201915743A (en) 2019-04-16

Similar Documents

Publication Publication Date Title
CN109542335B (en) Data internal moving method of flash memory and device using the same
TWI679535B (en) Methods for internal data movement of a flash memory and apparatuses using the same
US11593259B2 (en) Directed sanitization of memory
US10209894B2 (en) Memory system and method for controlling nonvolatile memory
TWI506430B (en) Method of recording mapping information method, and memory controller and memory storage apparatus using the same
US8417875B2 (en) Non-volatile memory controller processing new request before completing current operation, system including same, and method
TWI399643B (en) Flash memory storage system and controller and data writing method thereof
US9146691B2 (en) Method for managing commands in command queue, memory control circuit unit and memory storage apparatus
TWI446349B (en) Non-volatile memory access method and system, and non-volatile memory controller
TWI735918B (en) Method for performing access management of memory device, associated memory device and controller thereof, associated host device and associated electronic device
US11675698B2 (en) Apparatus and method and computer program product for handling flash physical-resource sets
TW202018514A (en) Apparatus and computer program product for performing operations to namespaces of a flash memory device
TWI421870B (en) Data writing method for a flash memory, and controller and storage system using the same
TW201403316A (en) Data writing method, memory controller and memory storage device
TW201426303A (en) Data reading method, memory controller and memory storage device
TWI670595B (en) Methods of proactive ecc failure handling
TWI540428B (en) Data writing method, memory controller and memory storage apparatus
TWI533309B (en) Data writing method, memory storage device and memory control circuit unit
CN108877862B (en) Data organization of page stripes and method and device for writing data into page stripes
KR20210142863A (en) Apparatus and method for increasing operation efficiency in a memory system
TWI814590B (en) Data processing method and the associated data storage device
JP6721765B2 (en) Memory system and control method