[go: up one dir, main page]

TWI820473B - Method and apparatuse and computer program product for handling sudden power off recovery - Google Patents

Method and apparatuse and computer program product for handling sudden power off recovery Download PDF

Info

Publication number
TWI820473B
TWI820473B TW110131169A TW110131169A TWI820473B TW I820473 B TWI820473 B TW I820473B TW 110131169 A TW110131169 A TW 110131169A TW 110131169 A TW110131169 A TW 110131169A TW I820473 B TWI820473 B TW I820473B
Authority
TW
Taiwan
Prior art keywords
pseudo
data
power outage
layer unit
flash memory
Prior art date
Application number
TW110131169A
Other languages
Chinese (zh)
Other versions
TW202147126A (en
Inventor
簡介信
包鎰華
Original Assignee
慧榮科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 慧榮科技股份有限公司 filed Critical 慧榮科技股份有限公司
Priority to TW110131169A priority Critical patent/TWI820473B/en
Publication of TW202147126A publication Critical patent/TW202147126A/en
Application granted granted Critical
Publication of TWI820473B publication Critical patent/TWI820473B/en

Links

Images

Landscapes

  • Electrical Discharge Machining, Electrochemical Machining, And Combined Machining (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

A method for handling sudden power off recovery (SPOR), performed by a processing unit of an electronic device, includes: driving a flash interface to program data sent by a host into pseudo single level cell (pSLC) blocks through multiple channels in a SLC mode after detecting that SPO happens in the electronic device, thereby enabling dynamic random access memory (DRAM) data to be programmed into the pSLC blocks in as short time as possible.

Description

瞬間斷電回復處理方法及裝置以及電腦程式產品 Instantaneous power outage recovery processing methods and devices and computer program products

本發明涉及資料儲存裝置,尤指一種快閃記憶裝置的資料存取控制方法及電腦程式產品。 The present invention relates to a data storage device, and in particular, to a data access control method and computer program product of a flash memory device.

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

由於自然或人為引起的瞬間斷電可能讓揮發性動態隨機存取記憶體中儲存的資料丟失,因此,本發明實施例提出一種的瞬間斷電回復處理方法及裝置以及電腦程式產品,使用NAND快閃記憶體來解決如上所述的問題。 Since a momentary power outage caused by nature or man-made may cause the data stored in the volatile dynamic random access memory to be lost, the embodiment of the present invention proposes a momentary power outage recovery processing method and device as well as a computer program product, using NAND fast Flash memory to solve the problems mentioned above.

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

本發明提出一種瞬間斷電回復處理方法,該方法由電子裝置的處理單元執行,包含以下步驟:根據主裝置發出給該電子裝置的一個或多個主機寫入命令中攜帶的資訊判斷是否發生電力只能維持以秒為單位的運作後瞬間斷電;於偵測到該電子裝置發生瞬間斷電後,驅動閃存介面將該主裝置傳送的資料以單層式單元模式通過多個通道寫入多個邏輯單元號的擬單層式單元塊,其中,該些擬單層式單元塊於正常運行時被保留下來而不寫入資料,直到偵測到發生瞬間斷電;以及當偵測到該主裝置發出命令指示修剪該些擬單層式單元塊時,或者當偵測到該些擬單層式單元塊都已經被該主裝置讀取時,驅動該閃存介面抹除所有擬單層式單元塊的記憶單元。 The present invention proposes an instantaneous power outage recovery processing method. The method is executed by a processing unit of an electronic device and includes the following steps: determining whether power is generated based on the information carried in one or more host write commands sent by the main device to the electronic device. It can only maintain operation in seconds after a momentary power outage; after detecting a momentary power outage of the electronic device, the driver flash memory interface writes the data transmitted by the host device into multiple channels through multiple channels in single-layer unit mode. pseudo-single-layer unit blocks of logical unit numbers, wherein these pseudo-single-layer unit blocks are retained without writing data during normal operation until an instantaneous power outage is detected; and when the When the master device issues a command to instruct the pruning of the pseudo-single-layer cell blocks, or when it detects that the pseudo-single-layer cell blocks have been read by the master device, the flash memory interface is driven to erase all pseudo-single-layer cell blocks. Memory unit of unit block.

本發明另提出一種電腦程式產品,包含可實施如上所述方法的程式碼,用於讓處理單元載入並執行。 The present invention also provides a computer program product, which includes program code that can implement the above method and is used for loading and executing by a processing unit.

本發明提出一種瞬間斷電回復處理裝置,至少包含處理單元,用以於載入並執行相關韌體或軟體指令時實施如上所述的方法。 The present invention proposes an instant power-off recovery processing device, which at least includes a processing unit for implementing the above method when loading and executing relevant firmware or software instructions.

上述實施例的優點之一,通過擬單層式單元塊的設置及多通道的單層式單元模式的資料寫入,使得動態隨機存取記憶體的資料能夠以盡可能短的時間寫入擬單層式單元塊。 One of the advantages of the above embodiment is that through the arrangement of pseudo-single-layer unit blocks and the data writing of multi-channel single-layer unit mode, the data of the dynamic random access memory can be written into the pseudo-simulator in the shortest possible time. Single storey unit block.

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

100:系統架構 100:System architecture

110:主裝置 110: Main device

130:控制器 130:Controller

131:處理單元 131: Processing unit

135:主裝置介面 135: Main device interface

137:靜態隨機存取記憶體 137: Static random access memory

139:閃存介面 139:Flash memory interface

150:動態隨機存取記憶體 150:Dynamic Random Access Memory

170:LUN 170:LUN

170#0~170#8:LUN 170#0~170#8:LUN

170#0-0~170#8-0:正常塊 170#0-0~170#8-0: normal block

170#0-1~170#8-1:擬單層式單元塊 170#0-1~170#8-1: Pseudo single-layer unit block

CH#0~CH#2:輸出入通道 CH#0~CH#2: input and output channels

CE#0~CE#2:晶片致能控制訊號 CE#0~CE#2: Chip enable control signal

310~370:邏輯區段 310~370: Logical section

LBA#0~LBA#36863:邏輯區塊位址 LBA#0~LBA#36863: logical block address

S510~S560:方法步驟 S510~S560: Method steps

610:邏輯-實體表 610: Logic-Entity Table

630:實體位置資訊 630: Entity location information

630-0:(實體)區塊編號 630-0: (entity) block number

630-1:(實體)頁面編號 630-1: (entity) page number

630-2:(實體)平面編號 630-2: (entity) plane number

630-3:邏輯單元編號以及輸出入通道編號 630-3: Logic unit number and input and output channel number

650:實體區塊 650:Physical block

655:實體區域 655:Entity area

S710~S730:方法步驟 S710~S730: Method steps

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

圖2為閃存介面與邏輯單元號(Logical Unit Number LUN)之間的連接示意圖。 Figure 2 is a schematic diagram of the connection between the flash memory interface and the logical unit number (Logical Unit Number LUN).

圖3為依據本發明實施例的邏輯區段示意圖。 Figure 3 is a schematic diagram of a logical section according to an embodiment of the present invention.

圖4為依據本發明實施例的LUN的實體塊分割示意圖。 Figure 4 is a schematic diagram of physical block partitioning of LUN according to an embodiment of the present invention.

圖5為依據本發明實施例的瞬間斷電回復處理的方法流程圖。 FIG. 5 is a flow chart of a method for instantaneous power outage recovery processing according to an embodiment of the present invention.

圖6為依據本發明實施例的邏輯-實體表(Logical-to-Physical L2P Table)與實體位置間的對應示意圖。 Figure 6 is a logical-to-physical L2P table according to an embodiment of the present invention. Table) and the corresponding diagram of the entity position.

圖7為依據本發明實施例的瞬間斷電回復處理的方法流程圖。 FIG. 7 is a flow chart of a method for instantaneous power outage recovery processing according to an embodiment of the present invention.

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

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

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

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

參考圖1。系統架構100包含主裝置110、控制器130、動態隨機存取記憶體150(Dynamic Random Access Memory DRAM)及邏輯單元號(Logical Unit Number LUN)170。此系統架構100可實施於伺服器、個人電腦、筆記型電腦(Laptop PC)、平板電腦、手機、數位相機、數位攝影機等電子產品。控制器130是一種特殊應用積體電路(Application-Specific Integrated Circuit ASIC),用來控制LUN 170的資料存取,可包含處理單元131、主裝置介面135及閃存介面 139。LUN 170提供的儲存空間(例如16、32、64Gigabytes GBs)可作為開機碟(Boot Disk)及快取資料(Cache Data)的儲存空間。LUN 170中的記憶單元可為三層式單元(Triple Level Cells,TLCs)或四層式單元(Quad-Level Cells QLCs)。當記憶體單元為TLC而可記錄8個狀態時,一個實體字元線可包含頁面P#0(可稱為最低位元頁面,Most Significant Bit MSB page)、頁面P#1(可稱為中間位元頁面,CSB,Center Significant Bit page)及頁面P#2(可稱為最高位元頁面,Least Significant Bit LSB page)。當記憶體單元為QLC而可記錄16個狀態時,除了MSB、CSB以及LSB頁面之外,更包括TSB(可稱為頂部位元,TSB,Top Significant Bit)頁面。靜態隨機存取記憶體(Static Random Access Memory SRAM)137可用於緩存處理單元131於執行過程中需要的資料,例如,變數、資料表(Data Tables)等。處理單元131可通過閃存介面139與NAND閃存170通信,例如,可採用開放NAND快閃(Open NAND Flash Interface ONFI)、雙倍資料率開關(DDR Toggle)或其他介面。 Refer to Figure 1. The system architecture 100 includes a main device 110, a controller 130, a dynamic random access memory 150 (Dynamic Random Access Memory DRAM), and a logical unit number (Logical Unit Number LUN) 170. This system architecture 100 can be implemented in servers, personal computers, laptop computers (Laptop PC), tablet computers, mobile phones, digital cameras, digital video cameras and other electronic products. The controller 130 is an Application-Specific Integrated Circuit ASIC used to control data access of the LUN 170 and may include a processing unit 131, a main device interface 135 and a flash memory interface. 139. The storage space provided by LUN 170 (such as 16, 32, and 64Gigabytes GBs) can be used as storage space for boot disk and cache data. The memory cells in LUN 170 can be triple level cells (Triple Level Cells, TLCs) or quad-level cells (Quad-Level Cells QLCs). When the memory unit is TLC and can record 8 states, a physical word line can include page P#0 (can be called the lowest bit page, Most Significant Bit MSB page), page P#1 (can be called the middle Bit page, CSB, Center Significant Bit page) and page P#2 (can be called the Least Significant Bit LSB page). When the memory unit is QLC and can record 16 states, in addition to the MSB, CSB and LSB pages, it also includes the TSB (can be called the top bit, TSB, Top Significant Bit) page. Static Random Access Memory (Static Random Access Memory SRAM) 137 can be used to cache data required by the processing unit 131 during execution, such as variables, data tables, etc. The processing unit 131 can communicate with the NAND flash memory 170 through the flash memory interface 139, for example, open NAND flash (Open NAND Flash Interface ONFI), double data rate switch (DDR Toggle) or other interfaces can be used.

控制器130包含處理單元131,通過主裝置介面135與主裝置110通信。主裝置介面135可為通用快閃記憶儲存(Universal Flash Storage UFS)、快速非揮發記憶體(Non-Volatile Memory Express NVMe)、通用序列匯流排(Universal Serial Bus,USB)、先進技術附著(advanced technology attachment,ATA)、序列先進技術附著(serial advanced technology attachment,SATA)、快速周邊元件互聯(peripheral component interconnect express,PCI-E)或其他介面。主裝置110及處理單元131中之任一者可使用多種方式實施,如使用通用硬體(例如,單一處理器、具平行處理能力的多處理器,或其他具運算能力的處理器),並且在執行韌體或軟體指令(Instructions)時,提供之後描述的功能。多處理器為單一的運算元件,可配備二或更多的獨立處理器(又稱為多核)來讀取及執行 程式指令。 The controller 130 includes a processing unit 131 that communicates with the host device 110 through a host device interface 135 . The main device interface 135 can be universal flash storage (Universal Flash Storage UFS), fast non-volatile memory (Non-Volatile Memory Express NVMe), universal serial bus (Universal Serial Bus, USB), advanced technology attachment (advanced technology attachment (ATA), serial advanced technology attachment (SATA), peripheral component interconnect express (PCI-E) or other interfaces. Either the main device 110 or the processing unit 131 may be implemented in a variety of ways, such as using general-purpose hardware (eg, a single processor, a multi-processor with parallel processing capabilities, or other processors with computing capabilities), and When executing firmware or software instructions (Instructions), the functions described later are provided. A multiprocessor is a single computing element that can be equipped with two or more independent processors (also called multi-core) to read and execute Program instructions.

參考圖2,閃存介面139可包含三個輸出入通道(I/O channels,以下簡稱通道)CH#0至CH#2,每一個通道連接三個LUN,例如,通道CH#0連接LUN 170#0至170#2,通道CH#1連接LUN 170#3至170#5,依此類推。換句話說,多個LUN可共享一個通道。例如,處理單元131可驅動閃存介面139發出致能訊號CE#0來致能LUN 170#0、170#3及170#6,接著以並行的方式從致能的LUN讀取使用者資料,或者寫入使用者資料至致能的LUN。 Referring to Figure 2, the flash memory interface 139 may include three I/O channels (hereinafter referred to as channels) CH#0 to CH#2. Each channel is connected to three LUNs. For example, channel CH#0 is connected to LUN 170#. 0 to 170#2, channel CH#1 connects LUN 170#3 to 170#5, and so on. In other words, multiple LUNs can share a channel. For example, the processing unit 131 can drive the flash memory interface 139 to issue the enable signal CE#0 to enable LUNs 170#0, 170#3, and 170#6, and then read user data from the enabled LUNs in a parallel manner, or Write user data to enabled LUN.

資料儲存裝置中的儲存空間可邏輯性地切割為多個區段(Partitions),用來儲存不同類型的資料,每個區段使用一段連續邏輯位址,例如,邏輯區塊位址(Logical Block Address,LBA),以作區分。舉例來說,每個LBA可關聯512位元組(Bytes)、4KB、16KB等大小的資料,下述中將以4KB為例進行說明,但不以此為限。參考圖3,第一區段310可包含6GB的空間,位址範圍從LBA#0至LBA#1,572,863,用於對應主裝置110的使用者資料(簡稱資料),例如:作業系統相關的程式碼。第二區段330可包含2GB的空間,位址範圍從LBA#1,572,864至LBA#2,097,151,用於對應主裝置110的資料,例如:應用程式相關的程式碼。第三區段350可包含5GB的空間,位址範圍從LBA#2,097,152至LBA#3,407,871,用於對應主裝置110的資料,例如:主裝置110於運行時產生的快取資料。動態隨機存取記憶體150儲存主裝置110於運行過程中需要的資料,例如變數、資料表、執行緒內容(Thread Context)等。為了防止瞬間斷電造成動態隨機存取記憶體150中儲存的資料丟失,主裝置110於偵測到瞬間斷電時,立即要求資料儲存裝置將動態隨機存取記憶體150所儲存的資料通過主裝置介面135寫入LUN 170。為了達到此目的,資料儲存裝置可設置第四區段370,包含5GB的空間,位址範圍從LBA#3,407,872至LBA#4,718,591,用於對應動態隨機存取記憶 體150中所儲存的資料。第四區段370的大小可為固定值,例如5GB,亦可與儲存動態隨機存取記憶體150的大小相等。之後,主裝置110於系統回復時,可通過要求資料儲存裝置提供第四區段370的資料,如此一來,主裝置110可迅速地取回原本動態隨機存取記憶體150所儲存的資料。 The storage space in the data storage device can be logically divided into multiple partitions (Partitions) to store different types of data. Each partition uses a continuous logical address, such as a logical block address (Logical Block Address, LBA) to distinguish. For example, each LBA can be associated with data of 512 bytes, 4KB, 16KB, etc. In the following description, 4KB will be used as an example, but it is not limited to this. Referring to Figure 3, the first section 310 may include 6GB of space, with addresses ranging from LBA#0 to LBA#1,572,863, used to correspond to user data (referred to as data) of the main device 110, such as operating system-related program codes. . The second section 330 may include 2GB of space, with addresses ranging from LBA#1,572,864 to LBA#2,097,151, used to correspond to data of the main device 110, such as application-related program codes. The third section 350 may include 5GB of space, with addresses ranging from LBA#2,097,152 to LBA#3,407,871, used to correspond to data of the main device 110, such as cache data generated by the main device 110 when it is running. The dynamic random access memory 150 stores data required by the main device 110 during operation, such as variables, data tables, thread content (Thread Context), etc. In order to prevent the data stored in the dynamic random access memory 150 from being lost due to a momentary power outage, when the main device 110 detects a momentary power outage, it immediately requests the data storage device to transfer the data stored in the dynamic random access memory 150 through the host device. Device interface 135 writes to LUN 170. In order to achieve this purpose, the data storage device can be set up with a fourth section 370, including 5GB of space, with addresses ranging from LBA#3,407,872 to LBA#4,718,591, for corresponding dynamic random access memory The data stored in body 150. The size of the fourth section 370 may be a fixed value, such as 5GB, or may be equal to the size of the DRAM 150 . Afterwards, when the system recovers, the main device 110 can request the data storage device to provide the data of the fourth section 370 . In this way, the main device 110 can quickly retrieve the data originally stored in the dynamic random access memory 150 .

參考圖4,資料儲存裝置中的每個LUN的實體塊(Physical Blocks)可依據不同的運作目的或編程方式而區分成一般塊(Normal Blocks)及擬單層式單元塊(pseudo SLC,pSLC Blocks)。參考圖4,例如,LUN 170#0中的實體塊可配置為包含800個一般塊170#0-0及400個pSLC塊170#0-1,LUN 170#1中的實體塊可配置為包含800個一般塊170#1-0及400個pSLC塊170#1-1,依此類推。處理單元131較佳將LUN 170#0至170#8中實體塊以及擬單層式單元塊的配置資訊記錄於靜態隨機存取記憶體137。一般塊用以提供第一區段310、第二區段330以及第三區段350的儲存空間,儲存主裝置於正常運行時寫入的資料,例如,作業系統、應用程式的檔案。由於每個LUN中的記憶單元為TLC或QLC,處理單元131可驅動閃存介面139使用多段式編程方式,例如粗略(Foggy)編程以及精細(Fine)編程來將資料寫入一般塊的記憶單元。 Referring to Figure 4, the physical blocks (Physical Blocks) of each LUN in the data storage device can be divided into normal blocks (Normal Blocks) and pseudo single-layer unit blocks (pseudo SLC, pSLC Blocks) according to different operating purposes or programming methods. ). Referring to Figure 4, for example, the physical blocks in LUN 170#0 can be configured to include 800 general blocks 170#0-0 and 400 pSLC blocks 170#0-1, and the physical blocks in LUN 170#1 can be configured to include 800 general blocks 170#1-0 and 400 pSLC blocks 170#1-1, and so on. The processing unit 131 preferably records the configuration information of the physical blocks and pseudo-single-layer unit blocks in LUNs 170#0 to 170#8 in the static random access memory 137. The general block is used to provide storage space in the first section 310, the second section 330, and the third section 350 to store data written by the host device during normal operation, such as operating system and application files. Since the memory cells in each LUN are TLC or QLC, the processing unit 131 can drive the flash memory interface 139 to use multi-stage programming methods, such as coarse (Foggy) programming and fine (Fine) programming to write data into the memory cells of general blocks.

另一方面,快取資料等擬單層式單元塊則提供第四區段370的儲存空間,所以,pSLC塊於正常運行時被保留下來而不寫入資料。當處理單元131偵測到瞬間斷電發生時,才依據主裝置110的要求,將動態隨機存取記憶體150中所儲存的資料寫入至pSLC塊。偵測到瞬間斷電後,來自主裝置110的電力通常只能維持資料儲存裝置數秒(例如1~5秒間)的運作,因此,資料儲存裝置需利用這段時間來將動態隨機存取記憶體150所儲存的資料寫入至LUN 170。如果於正常運行時有資料佔據pSLC塊中的記憶單元,處理單元131還需要耗費時間把pSLC塊所儲存的資料搬移至一般塊,然後執行抹除作業等 等,不僅需要花費時間,也會消耗所剩無幾的電力,無法在容許的時間內將動態隨機存取記憶體150的資料寫入pSLC塊。處理單元131採用單層式單元(Single Level Cells,SLC)模式及交錯頁編程(Interleave Page Programming)方式,並通過所有通道來將動態隨機存取記憶體150的資料寫入至pSLC塊中的記憶單元,即以最快的方式將動態隨機存取記憶體150的資料寫入至資料儲存裝置的pSLC塊中,例如,以300MB/s或更高的資料傳輸率將資料寫入至資料儲存裝置的pSLC塊中。雖然實施例描述了三個通道,每個通道連接三個LUN作為範例,但是所屬技術領域的技術人員可修改NAND閃存架構來包含更多或更少的通道及LUN,本發明不應因此受侷限。 On the other hand, the pseudo-single-level unit block such as cache data provides the storage space of the fourth section 370, so the pSLC block is retained without writing data during normal operation. When the processing unit 131 detects that a momentary power outage occurs, it writes the data stored in the dynamic random access memory 150 to the pSLC block according to the request of the main device 110 . After detecting a momentary power outage, the power from the host device 110 can usually only maintain the operation of the data storage device for a few seconds (for example, 1 to 5 seconds). Therefore, the data storage device needs to use this time to convert the dynamic random access memory into The data stored in 150 is written to LUN 170. If there is data occupying the memory unit in the pSLC block during normal operation, the processing unit 131 also needs to spend time moving the data stored in the pSLC block to the general block, and then perform erasure operations, etc. Waiting, not only takes time, but also consumes the remaining power, and the data of the dynamic random access memory 150 cannot be written into the pSLC block within the allowed time. The processing unit 131 adopts a single level cell (Single Level Cells, SLC) mode and an interleave page programming (Interleave Page Programming) method, and writes the data of the dynamic random access memory 150 into the memory in the pSLC block through all channels. unit, that is, writing the data of the dynamic random access memory 150 to the pSLC block of the data storage device in the fastest way, for example, writing the data to the data storage device at a data transfer rate of 300MB/s or higher. in the pSLC block. Although the embodiment describes three channels, each channel is connected to three LUNs as an example, those skilled in the art can modify the NAND flash memory architecture to include more or less channels and LUNs, and the invention should not be limited thereby. .

參考圖5所示的資料編程方法的流程圖,由處理單元131於載入相關軟體或韌體程式碼時執行。在步驟S510,處理單元131偵測是否有斷電中斷事件,如果是則執行步驟S520,如果否則執行步驟S540。 Referring to the flow chart of the data programming method shown in FIG. 5 , it is executed by the processing unit 131 when loading relevant software or firmware code. In step S510, the processing unit 131 detects whether there is a power outage interruption event. If so, step S520 is executed. If not, step S540 is executed.

在步驟S520,處理單元131以多通道以及交錯頁編程將來自主裝置110的資料寫入pSLC塊,其中,pSLC塊為採用SLC模式來進行資料編程的實體塊。 In step S520, the processing unit 131 uses multi-channel and interleaved page programming to write data from the master device 110 into the pSLC block, where the pSLC block is a physical block that uses the SLC mode for data programming.

在步驟S530,處理單元131依據pSLC塊所儲存的資料來更新邏輯-實體(Logical-to-Physical,L2P)映射表,其中,L2P映射表較佳儲存在SRAM 137中。 In step S530, the processing unit 131 updates a logical-to-Physical (L2P) mapping table according to the data stored in the pSLC block, where the L2P mapping table is preferably stored in the SRAM 137.

在步驟S540,處理單元131以多通道以及交錯頁編程將來自主裝置110的資料寫入一般塊。 In step S540, the processing unit 131 writes data from the master device 110 into the general block using multi-channel and interleaved page programming.

在步驟S550,處理單元131依據一般塊所儲存的資料來更新邏輯-實體L2P映射表。 In step S550, the processing unit 131 updates the logical-to-physical L2P mapping table according to the data stored in the general block.

在步驟S560,處理單元131將更新的L2P映射表寫入一般塊,其中,處理單元131較佳以SLC模式將更新的L2P映射表寫入一般塊。 In step S560, the processing unit 131 writes the updated L2P mapping table into the general block, wherein the processing unit 131 preferably writes the updated L2P mapping table into the general block in SLC mode.

之後,當主裝置110恢復電力之後,資料儲存裝置再依據主裝置110的要求,將pSLC塊所儲存的資料上傳至動態隨機存取記憶體150, 之後,處理單元131可將pSLC塊予以抹除,當再次發生斷電中斷事件時,處理單元131可再將資料寫入pSLC塊。 Afterwards, when the power of the main device 110 is restored, the data storage device uploads the data stored in the pSLC block to the dynamic random access memory 150 according to the request of the main device 110. Afterwards, the processing unit 131 can erase the pSLC block. When a power outage interrupt event occurs again, the processing unit 131 can write data into the pSLC block again.

為了記錄邏輯位置(由主裝置110管理)及實體位置(由控制器130管理)間的對應關係,控制器130可於SRAM 137中維護L2P映射表,依序儲存每個邏輯位址的資料實際儲存於哪個實體位址的資訊,讓控制器130處理關於特定邏輯位址的讀取或寫入命令時,可快速查找出對應的實體位址。另外,由於SRAM 137的大小有限,因此,L2P映射表可分割成複數個子表,控制器130再輪流將子表上傳至SRAM 137中。參考圖6,舉例來說,子表610較佳依照順序儲存相應於每一邏輯位址的實體位址資訊。子表610所需的空間較佳與邏輯位址的總數成正比。邏輯位址可以LBA表示,每個LBA對應到一個固定大小的邏輯區塊,例如512B或4KB,並且此LBA的資料儲存於LUN 170的實體位址。子表610依序儲存從LBA#26624至LBA#27647的實體位址資訊。實體位址資訊630例如包括四個位元組,其中,位元組630-0記錄(實體)區塊編號,位元組630-1記錄頁面編號及偏移量(offset);位元組630-2紀錄平面編號,位元組630-3記錄邏輯單元編號以及輸出入通道編號等等。例如,相應於LBA#26626的實體位址資訊630可指向區塊650中的一個區域655。 In order to record the correspondence between the logical location (managed by the host device 110) and the physical location (managed by the controller 130), the controller 130 can maintain an L2P mapping table in the SRAM 137, and store the actual data of each logical address in sequence. The information stored in which physical address allows the controller 130 to quickly find the corresponding physical address when processing a read or write command about a specific logical address. In addition, since the size of the SRAM 137 is limited, the L2P mapping table can be divided into a plurality of sub-tables, and the controller 130 uploads the sub-tables to the SRAM 137 in turn. Referring to FIG. 6 , for example, the sub-table 610 preferably stores the physical address information corresponding to each logical address in order. The space required for subtable 610 is preferably proportional to the total number of logical addresses. The logical address can be represented by LBA. Each LBA corresponds to a fixed-size logical block, such as 512B or 4KB, and the data of this LBA is stored in the physical address of LUN 170. The sub-table 610 stores the physical address information from LBA#26624 to LBA#27647 in sequence. The physical address information 630 includes, for example, four bytes, wherein the byte 630-0 records the (physical) block number, the byte 630-1 records the page number and offset (offset); the byte 630 -2 records the plane number, and byte 630-3 records the logical unit number, input and output channel number, etc. For example, physical address information 630 corresponding to LBA #26626 may point to a region 655 in block 650.

於步驟S510的一些實施例,處理單元131可偵測每個從主裝置110發出的命令是否為立即待命命令(STANDBY IMMEDIATE command),立即待命命令的內容可參考ATA命令集-4(ATA Command Set-4,ACS-4)第7.48節的規範。雖然立即待命命令原為主裝置110指示資料儲存裝置進入待命模式(Standby Mode),但是主裝置110及控制器130可協議當主裝置110偵測到發生瞬間斷電時,發出立即待命命令,指示處理單元131將後續傳送的資料以最快的速度寫入LUN 170。雖然實施例舉出立即待命命令做例子,主裝置110可使用其他命令指示處理單元131,用以達成相同的技術效果。 In some embodiments of step S510, the processing unit 131 may detect whether each command issued from the main device 110 is an immediate standby command (STANDBY IMMEDIATE command). For the content of the immediate standby command, please refer to ATA Command Set-4 (ATA Command Set). -4, ACS-4) specifications in Section 7.48. Although the immediate standby command originally instructs the main device 110 to enter the standby mode, the main device 110 and the controller 130 can agree that when the main device 110 detects a momentary power outage, an immediate standby command is issued to instruct the data storage device to enter standby mode. The processing unit 131 writes subsequently transmitted data into the LUN 170 at the fastest speed. Although the embodiment takes the immediate standby command as an example, the main device 110 can use other commands to instruct the processing unit 131 to achieve the same technical effect.

於步驟S510的另一些實施例,處理單元131可觀察命令佇列(Command Queue)中的主裝置寫入命令(Host Write Commands)來判斷電子裝置是否發生瞬間斷電。相對於大量資料儲存裝置(Mass Storage)提供超過如100GB以上儲存空間的應用場景,當主裝置110將LUN 170作為開機碟及快取資料的儲存空間時,於正常運行的情況下,主裝置110發出長資料寫入命令是罕見的。所以,當處理單元131在命令佇列中發現到一個長資料寫入命令後接著一個連續寫入命令時,可判斷電子裝置很可能發生瞬間斷電。主裝置命令通常包含起始邏輯位址及長度的參數,長資料寫入命令可指主裝置寫入命令中的長度超過一個預設閥值(例如1MB),並且連續寫入命令可指主裝置寫入命令中的起始邏輯位址為命令佇列中的前一個主裝置寫入命令的結束邏輯位址的下一個位址。 In other embodiments of step S510, the processing unit 131 may observe the host write commands (Host Write Commands) in the command queue (Command Queue) to determine whether a momentary power outage occurs in the electronic device. Compared with application scenarios where a mass storage device (Mass Storage) provides more than 100GB of storage space, when the main device 110 uses the LUN 170 as a boot disk and cache data storage space, under normal operation, the main device 110 It is rare to issue long data write commands. Therefore, when the processing unit 131 finds a long data write command followed by a continuous write command in the command queue, it can be determined that the electronic device is likely to experience a momentary power outage. The master device command usually contains the parameters of the starting logical address and length. The long data write command can refer to the length of the master device write command exceeding a preset threshold (such as 1MB), and the continuous write command can refer to the master device. The starting logical address in the write command is the address next to the ending logical address of the previous master write command in the command queue.

於步驟S510的更另一些實施例,處理單元131可觀察命令佇列中的主裝置寫入命令的起始邏輯位址是否落入預設區間來判斷電子裝置是否發生瞬間斷電。例如,參考圖3,當發現任何主裝置寫入命令的起始邏輯位址介於LBA#3407872及LBA#4718591之間時,處理單元131判斷電子裝置很可能發生瞬間斷電。 In some other embodiments of step S510, the processing unit 131 may observe whether the starting logical address of the master device write command in the command queue falls into a preset range to determine whether a momentary power outage occurs in the electronic device. For example, referring to FIG. 3 , when it is found that the starting logical address of any master device write command is between LBA#3407872 and LBA#4718591, the processing unit 131 determines that an instantaneous power outage is likely to occur in the electronic device.

於步驟S520,處理單元131可先通過閃存介面139發出SLC模式致能命令(SLC MODE ENABLE Command),接著發出一連串的編程頁面命令(PROGRAM PAGE Commands)用來將資料寫入預先配置的pSLC塊。SLC模式的資料寫入指閃存介面139編程pSLC塊中的每個記憶單元成為兩個狀態中的一個,而不是八或十六個狀態中的一個。所屬技術領域人員可理解SLC模式的資料寫入速度優於TLC或QLC模式中使用粗略-精細技術的資料寫入速度。 In step S520, the processing unit 131 may first issue an SLC mode enable command (SLC MODE ENABLE Command) through the flash memory interface 139, and then issue a series of program page commands (PROGRAM PAGE Commands) to write data into the preconfigured pSLC block. Data writing in SLC mode means that the flash memory interface 139 programs each memory cell in the pSLC block to be in one of two states, rather than one of eight or sixteen states. Those skilled in the art will understand that the data writing speed in the SLC mode is better than the data writing speed in the TLC or QLC mode using coarse-fine technology.

於步驟S520的較佳實施例,處理單元131可驅動閃存介面以交錯頁編程的方式寫入資料,以圖4的通道CH#0舉例,閃存介面139可發出致能訊號CE#0來致能LUN 170#0並通過通道CH#0傳送資料給 pSLC塊170#0-1,接著於資料傳送完畢後發出指令給pSLC塊170#0-1來開始編程其中的記憶單元。於pSLC塊170#0-1實際編程記憶單元的期間,閃存介面139可發出致能訊號CE#1來致能LUN 170#1並通過通道CH#0傳送資料給pSLC塊170#1-1,依此類推。 In the preferred embodiment of step S520, the processing unit 131 can drive the flash memory interface to write data in a staggered page programming manner. Taking channel CH#0 in Figure 4 as an example, the flash memory interface 139 can send an enable signal CE#0 to enable LUN 170#0 and transmits data to The pSLC block 170#0-1 then sends an instruction to the pSLC block 170#0-1 to start programming the memory cells therein after the data transmission is completed. During the actual programming of the memory unit in pSLC block 170#0-1, the flash memory interface 139 can send out the enable signal CE#1 to enable LUN 170#1 and transmit data to pSLC block 170#1-1 through channel CH#0. And so on.

於步驟S520的較佳實施例,處理單元131可驅動閃存介面139通過所有通道寫入主裝置110傳送的資料。 In the preferred embodiment of step S520, the processing unit 131 can drive the flash memory interface 139 to write the data transmitted by the host device 110 through all channels.

參考圖7所示的方法流程圖,由處理單元131於載入相關軟體或韌體程式碼時執行。於偵測到電子裝置已經完成瞬間斷電回復後(步驟S710),處理單元131驅動閃存介面170抹除LUN 170中所有pSLC塊的記憶單元,讓pSLC塊處於就緒狀態,供下次可能發生的瞬間斷電運用(步驟S730)。 Referring to the method flow chart shown in FIG. 7 , the method is executed by the processing unit 131 when loading relevant software or firmware code. After detecting that the electronic device has completed the instantaneous power-off recovery (step S710), the processing unit 131 drives the flash memory interface 170 to erase the memory units of all pSLC blocks in the LUN 170, leaving the pSLC blocks in a ready state for possible next occurrences. Instantaneous power-off operation (step S730).

處理單元131可檢視每個從主裝置110發出的資料集管理命令(DATA SET MANAGEMENT command)的內容判斷是否指示修剪(Trim)pSLC塊,資料集管理命令的內容可參考ATA命令集-4(ATA Command Set-4 ACS-4)第7.6節的規範。資料集管理命令可包含LBA及修剪位元(Trim Bit)等參數,處理單元131可參考L2P映射表的資訊判斷資料集管理命令中的LBA是否關聯於一個pSLC塊且修剪位元設為“1”。如果是,處理單元131判斷電子裝置已經完成瞬間斷電回復。雖然實施例舉出資料集管理命令做例子,主裝置110可使用其他命令指示處理單元131,用以達成相同的技術效果。 The processing unit 131 may check the content of each data set management command (DATA SET MANAGEMENT command) issued from the host device 110 to determine whether to instruct pSLC blocks to be trimmed. The content of the data set management command may refer to ATA Command Set-4 (ATA Command Set-4 ACS-4) Specifications in Section 7.6. The data set management command may include parameters such as LBA and trim bit (Trim Bit). The processing unit 131 may refer to the information in the L2P mapping table to determine whether the LBA in the data set management command is associated with a pSLC block and the trim bit is set to “1” ". If yes, the processing unit 131 determines that the electronic device has completed the instantaneous power-off recovery. Although the embodiment takes the data set management command as an example, the main device 110 can use other commands to instruct the processing unit 131 to achieve the same technical effect.

於步驟S710的另一些實施例,處理單元131可紀錄主裝置讀取命令(Host Read Commands)的執行來判斷電子裝置是否已經完成瞬間斷電回復。處理單元131可參考L2P映射表的內容記錄每個關聯於pSLC塊的主裝置讀取命令的執行。當L2P映射表中對應於pSLC塊的所有LBA的資料都已經被主裝置110讀取後,處理單元131判斷電子裝置已經完成瞬間斷電回復。 In other embodiments of step S710, the processing unit 131 may record the execution of host read commands (Host Read Commands) to determine whether the electronic device has completed instantaneous power-off recovery. The processing unit 131 may record the execution of each master read command associated with the pSLC block with reference to the contents of the L2P mapping table. When all the LBA data corresponding to the pSLC block in the L2P mapping table have been read by the host device 110, the processing unit 131 determines that the electronic device has completed instantaneous power-off recovery.

本發明所述的方法中的全部或部分步驟可以電腦程式實現,例如電 腦的作業系統、電腦中特定硬體的驅動程式、或軟體應用程式。此外,也可實現於如上所示的其他類型程式。所屬技術領域具有通常知識者可將本發明實施例的方法撰寫成電腦程式,為求簡潔不再加以描述。依據本發明實施例方法實施的電腦程式.可儲存於適當的電腦可讀取資料載具,例如DVD、CD-ROM、USB碟、硬碟,亦可置於可通過網路(例如,網際網路,或其他適當載具)存取的網路伺服器。 All or part of the steps in the method of the present invention can be implemented by computer programs, such as The computer's operating system, drivers for specific hardware in the computer, or software applications. In addition, it can also be implemented in other types of programs as shown above. Those with ordinary skill in the art can write the methods of the embodiments of the present invention into computer programs, which will not be described again for the sake of simplicity. The computer program implemented according to the method of the embodiment of the present invention can be stored in an appropriate computer-readable data carrier, such as DVD, CD-ROM, USB disk, hard disk, or can be placed in a computer program that can be accessed through a network (such as the Internet). route, or other appropriate vehicle).

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

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

S510~S560:方法步驟 S510~S560: Method steps

Claims (9)

一種瞬間斷電回復處理方法,由一電子裝置中的一處理單元執行,包含:根據一主裝置發出給該電子裝置的一個或多個主機寫入命令中攜帶的資訊判斷是否發生電力只能維持以秒為單位的運作後瞬間斷電;當在一命令佇列中發現一長資料寫入命令後接著一連續寫入命令,或者一主機寫入命令的一起始邏輯位址落入一預設區間時,判斷該電子裝置發生瞬間斷電;於偵測到該電子裝置發生瞬間斷電後,驅動一閃存介面將該主裝置傳送的資料以一單層式單元模式通過多個通道寫入多個邏輯單元號的擬單層式單元塊,其中,該些擬單層式單元塊於正常運行時被保留下來而不寫入資料,直到偵測到發生瞬間斷電;當該主裝置恢復電力後,紀錄一主裝置讀取命令的執行,其中該主裝置發出該主裝置讀取命令,請求從該些擬單層式單元塊讀取資料;以及當偵測到該些擬單層式單元塊都已經被該主裝置讀取時,判斷該主裝置已經完成瞬間斷電回復操作,並且驅動該閃存介面抹除所有擬單層式單元塊的記憶單元。 An instant power outage recovery processing method, executed by a processing unit in an electronic device, includes: judging whether the power can only be maintained based on the information carried in one or more host write commands issued by a host device to the electronic device. Momentary power outage after operation in seconds; when a long data write command is found in a command queue followed by a continuous write command, or a starting logical address of a host write command falls into a default interval, it is determined that the electronic device has experienced a momentary power outage; after detecting that the electronic device has experienced a momentary power outage, it drives a flash memory interface to write the data transmitted by the host device into multiple channels through multiple channels in a single-layer unit mode. pseudo-single-layer unit blocks of logical unit numbers, wherein these pseudo-single-layer unit blocks are retained during normal operation without writing data until an instantaneous power outage is detected; when the main device restores power and then record the execution of a master device read command, wherein the master device issues the master device read command to request data to be read from the pseudo single-layer unit blocks; and when the pseudo single-layer units are detected When all the blocks have been read by the host device, it is determined that the host device has completed the instantaneous power-off recovery operation, and drives the flash memory interface to erase all memory cells of the pseudo-single-layer unit block. 如請求項1所述的瞬間斷電回復處理方法,其中每個該邏輯單元號中的每個實體塊區分為一般塊或該擬單層式單元塊,該擬單層式單元塊中的記憶單元為三層式單元或四層式單元,以及該單層式單元模式的資料寫入編程每個該擬單層式單元塊中的每個記憶單元成為兩個狀態中的一個。 The instant power-off recovery processing method as described in claim 1, wherein each physical block in each logical unit number is divided into a general block or the pseudo-single-layer unit block, and the memory in the pseudo-single-layer unit block The cell is a three-level cell or a four-level cell, and data writing in the single-level cell mode programs each memory cell in each of the pseudo-single-level cell blocks to become one of two states. 如請求項2所述的瞬間斷電回復處理方法,包含:於偵測到該電子裝置發生瞬間斷電後,驅動該閃存介面將該主裝置 傳送的資料以交錯頁編程的方式寫入該些邏輯單元號的該擬單層式單元塊。 The instant power outage recovery processing method described in claim 2 includes: after detecting that the electronic device has experienced an instant power outage, driving the flash memory interface to restore the main device to the main device. The transmitted data is written into the pseudo-single-layer unit block of the logical unit numbers in a staggered page programming manner. 如請求項1所述的瞬間斷電回復處理方法,包含:偵測到該主裝置已經完成瞬間斷電回復後,驅動該閃存介面抹除所有該些擬單層式單元塊的記憶單元。 The instantaneous power-off recovery processing method described in claim 1 includes: after detecting that the host device has completed the instantaneous power-off recovery, driving the flash memory interface to erase all the memory cells of the pseudo-single-layer unit blocks. 一種電腦程式產品,包含用於瞬間斷電回復處理的一程式碼,其中,當一電子裝置中的一處理單元載入並執行上述程式碼時,實施如請求項1至4中任一項所述的瞬間斷電回復處理方法。 A computer program product, including a program code for instant power outage recovery processing, wherein when a processing unit in an electronic device loads and executes the above program code, the implementation is as described in any one of claims 1 to 4. The instant power outage recovery processing method described above. 一種瞬間斷電回復處理裝置,包含:一主裝置介面;一閃存介面;以及一處理單元,耦接於該主裝置介面及該閃存介面,根據一主裝置經由該主裝置介面發出給該瞬間斷電回復處理裝置的一個或多個主機寫入命令中攜帶的資訊判斷是否發生電力只能維持以秒為單位的運作後瞬間斷電;當在一命令佇列中發現一長資料寫入命令後接著一連續寫入命令,或者在該命令佇列中發現一主機寫入命令的一起始邏輯位址落入一預設區間時,判斷該瞬間斷電回復處理發生瞬間斷電;於偵測到該瞬間斷電回復處理裝置發生瞬間斷電後,驅動該閃存介面將該主裝置通過該主裝置介面傳送的資料以一單層式單元模式通過多個通道寫入多個邏輯單元號的擬單層式單元塊,其中,該些擬單層式單元塊於正常運行時被保留下來而不寫入資料,直到偵測到發生瞬間斷電;當該主裝置恢復電力後,紀錄一主裝置讀取命令的執行,其中該主裝置發出該主裝置讀取命令,請求從該些擬單層式單元塊讀取資料;以及當偵測到該些擬單層式單元塊都已經被該主裝置讀取時,判斷該主裝置已經完成瞬間斷電回復操作,並且驅動該閃存介面抹除所有擬單層式單元塊的記憶單元。 An instant power-off recovery processing device includes: a main device interface; a flash memory interface; and a processing unit, coupled to the main device interface and the flash memory interface, according to a main device sending a message to the instant power outage through the main device interface. One or more host write commands of the call reply processing device use the information carried in the write command to determine whether power is generated and can only maintain operation in seconds before a momentary power outage; when a long data write command is found in a command queue Then a continuous write command is issued, or a starting logical address of a host write command is found in the command queue to fall into a preset range, it is determined that an instantaneous power outage has occurred in the instantaneous power-off recovery processing; upon detection After a momentary power outage occurs in the instantaneous power-off recovery processing device, the flash memory interface is driven to write the data transmitted by the main device through the main device interface into a single-layer unit mode through multiple channels and into multiple logical unit numbers. Hierarchical unit blocks, in which these pseudo-single-layer unit blocks are retained without writing data during normal operation until a momentary power outage is detected; when the main device restores power, a main device read is recorded Execution of the fetch command, in which the master device issues the master device read command to request data to be read from the pseudo-single-layer unit blocks; and when it is detected that the pseudo-single-layer unit blocks have been read by the master device When reading, it is determined that the host device has completed the instantaneous power-off recovery operation, and drives the flash memory interface to erase all the memory cells of the pseudo-single-layer unit block. 如請求項6所述的瞬間斷電回復處理裝置,其中每個該邏輯單元號中的每個實體塊區分為一般塊或該擬單層式單元塊,該擬單層式單元塊中的記憶單元為三層式單元或四層式單元,以及該單層式單元模式的資料寫入編程每個該擬單層式單元塊中的每個記憶單元成為兩個狀態中的一個。 The instant power-off recovery processing device as described in claim 6, wherein each physical block in each logical unit number is divided into a general block or the pseudo-single-layer unit block, and the memory in the pseudo-single-layer unit block The cell is a three-level cell or a four-level cell, and data writing in the single-level cell mode programs each memory cell in each of the pseudo-single-level cell blocks to become one of two states. 如請求項7所述的瞬間斷電回復處理裝置,其中該處理單元偵測到該電子裝置發生瞬間斷電後,驅動該閃存介面將該主裝置傳送的資料以交錯頁編程的方式寫入該些邏輯單元號的該擬單層式單元塊。 The instant power outage recovery processing device as described in claim 7, wherein the processing unit detects that the electronic device has an instant power outage and drives the flash memory interface to write the data transmitted by the host device into the flash memory interface in a staggered page programming manner. These pseudo-single-layer unit blocks have certain logical unit numbers. 如請求項6所述的瞬間斷電回復處理裝置,其中該處理單元於偵測到該主裝置已經完成瞬間斷電回復後,驅動該閃存介面抹除所有擬單層式單元塊的記憶單元。 The instantaneous power-off recovery processing device as described in claim 6, wherein the processing unit drives the flash memory interface to erase all memory cells of the pseudo-single-layer unit block after detecting that the host device has completed instantaneous power-off recovery.
TW110131169A 2019-05-21 2019-05-21 Method and apparatuse and computer program product for handling sudden power off recovery TWI820473B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW110131169A TWI820473B (en) 2019-05-21 2019-05-21 Method and apparatuse and computer program product for handling sudden power off recovery

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW110131169A TWI820473B (en) 2019-05-21 2019-05-21 Method and apparatuse and computer program product for handling sudden power off recovery

Publications (2)

Publication Number Publication Date
TW202147126A TW202147126A (en) 2021-12-16
TWI820473B true TWI820473B (en) 2023-11-01

Family

ID=80784005

Family Applications (1)

Application Number Title Priority Date Filing Date
TW110131169A TWI820473B (en) 2019-05-21 2019-05-21 Method and apparatuse and computer program product for handling sudden power off recovery

Country Status (1)

Country Link
TW (1) TWI820473B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104077174A (en) * 2009-03-27 2014-10-01 Lsi公司 Storage system logical block address de-allocation management and data hardening
TW201521027A (en) * 2013-11-28 2015-06-01 Phison Electronics Corp Method for data management and memory storage device and memory control circuit unit
US20160268000A1 (en) * 2015-03-09 2016-09-15 Ocz Storage Solutions, Inc. Power fail saving modes in solid state drive with mlc memory
US20180260331A1 (en) * 2017-03-10 2018-09-13 Toshiba Memory Corporation Multibit nand media using pseudo-slc caching technique
CN108762669A (en) * 2018-05-18 2018-11-06 深圳忆联信息系统有限公司 The method, apparatus and computer equipment of writing speed when promoting power down

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104077174A (en) * 2009-03-27 2014-10-01 Lsi公司 Storage system logical block address de-allocation management and data hardening
TW201521027A (en) * 2013-11-28 2015-06-01 Phison Electronics Corp Method for data management and memory storage device and memory control circuit unit
US20160268000A1 (en) * 2015-03-09 2016-09-15 Ocz Storage Solutions, Inc. Power fail saving modes in solid state drive with mlc memory
US20180260331A1 (en) * 2017-03-10 2018-09-13 Toshiba Memory Corporation Multibit nand media using pseudo-slc caching technique
CN108762669A (en) * 2018-05-18 2018-11-06 深圳忆联信息系统有限公司 The method, apparatus and computer equipment of writing speed when promoting power down

Also Published As

Publication number Publication date
TW202147126A (en) 2021-12-16

Similar Documents

Publication Publication Date Title
KR102610395B1 (en) Memory system comprising non-volatile memory device
CN107908571B (en) Data writing method, flash memory device and storage equipment
CN111984441B (en) Instant power-off recovery processing method and device and computer readable storage medium
US8489805B2 (en) Memory devices operated within a communication protocol standard timeout requirement
US20090049234A1 (en) Solid state memory (ssm), computer system including an ssm, and method of operating an ssm
US12014081B2 (en) Host managed buffer to store a logical-to physical address table for a solid state drive
CN114327240B (en) Computer readable storage medium, data storage method and device for flash memory
US11269559B2 (en) Data processing device
TWI754396B (en) Method and apparatus and computer program product for storing data in flash memory
KR102809599B1 (en) Controller, memory system and operating method thereof
US20220083280A1 (en) Method and apparatus to reduce latency for random read workloads in a solid state drive
KR102595233B1 (en) Data processing system and operating method thereof
KR20220085708A (en) Logical to physical address indirection table in a persistent memory in a solid state drive
KR20230166612A (en) Memory controller and operating method thereof
US12260122B2 (en) Storage controller providing status information of zone region, method of operating the same, and method of operating electronic device having the same
KR20200114086A (en) Controller, memory system and operating method thereof
KR102425470B1 (en) Data storage device and operating method thereof
KR20220103340A (en) Data storage device and operating method thereof
TWI820473B (en) Method and apparatuse and computer program product for handling sudden power off recovery
TWI741296B (en) Method and apparatuse and computer program product for handling sudden power off recovery
KR102879451B1 (en) Data storage device and operating method thereof
KR20240015513A (en) Memory system and operating method thereof
TWI876739B (en) Method and computer program product and apparatus for configuring current block to program data
EP4435579A1 (en) Storage controller providing status information of zone region
US20240143226A1 (en) Data storage device and method for managing a write buffer