TWI633434B - Method, system, and computer readable medium for managing solid state drive - Google Patents

Method, system, and computer readable medium for managing solid state drive Download PDF

Info

Publication number
TWI633434B
TWI633434B TW106123291A TW106123291A TWI633434B TW I633434 B TWI633434 B TW I633434B TW 106123291 A TW106123291 A TW 106123291A TW 106123291 A TW106123291 A TW 106123291A TW I633434 B TWI633434 B TW I633434B
Authority
TW
Taiwan
Prior art keywords
page
logical block
address
solid state
size
Prior art date
Application number
TW106123291A
Other languages
Chinese (zh)
Other versions
TW201908975A (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 TW106123291A priority Critical patent/TWI633434B/en
Application granted granted Critical
Publication of TWI633434B publication Critical patent/TWI633434B/en
Publication of TW201908975A publication Critical patent/TW201908975A/en

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一種管理固態硬碟之方法、系統及電腦可讀取媒體。管理固態硬碟的方法包括以下步驟。獲取一固態硬碟的一頁面的一頁面尺寸。獲取一檔案系統的一邏輯區塊的一邏輯區塊尺寸。依據頁面尺寸及邏輯區塊尺寸,建立固態硬碟的頁面的一頁面位址與檔案系統的邏輯區塊的一邏輯區塊位址之間的一映射關係。當讀取或寫入固態硬碟的一資料時,獲取資料對應的一目標邏輯區塊位址。以及依據目標邏輯區塊位址及映射關係,獲取一目標頁面位址,其中目標邏輯區塊位址對應該目標頁面位址。A method, system and computer readable medium for managing a solid state hard disk. The method of managing a solid state hard disk includes the following steps. Get a page size of a page of a solid state drive. Obtain a logical block size of a logical block of a file system. According to the page size and the logical block size, a mapping relationship between a page address of the page of the solid state hard disk and a logical block address of the logical block of the file system is established. When a data of the solid state drive is read or written, a target logical block address corresponding to the data is obtained. And obtaining a target page address according to the target logical block address and the mapping relationship, wherein the target logical block address corresponds to the target page address.

Description

管理固態硬碟之方法、系統及電腦可讀取媒體Method, system and computer readable medium for managing solid state hard disks

本發明是有關於一種管理固態硬碟之方法、系統及電腦可讀取媒體。The present invention relates to a method, system and computer readable medium for managing a solid state hard disk.

隨著科技進步,愈來愈常見使用固態硬碟 (Solid State Disk/Solid State Drive, SSD) 作為電子裝置的儲存裝置。固態硬碟的電氣特性與傳統硬碟 (Hard Disk Drive, HDD) 不同,固態硬碟的讀寫操作係以頁面 (page) 為單位,其中,一個頁面的頁面尺寸可以為4KB (kilobyte)、8KB或16KB。As technology advances, Solid State Disk/Solid State Drive (SSD) is increasingly used as a storage device for electronic devices. The electrical characteristics of a solid state drive are different from those of a traditional hard disk (HDD). The read and write operations of a solid state drive are in units of pages. The page size of a page can be 4 KB (kilobyte), 8 KB. Or 16KB.

然而,在部份的作業系統中,其檔案系統的邏輯區塊尺寸係以傳統硬碟的最小磁區 (sector) 尺寸,例如512位元組 (byte),作為檔案系統中的最小操作單位。在這樣的情況下,檔案系統無法直接管理儲存在固態硬碟中的檔案。因此,如何使固態硬碟可供檔案系統操作係為目前業界努力的方向之一。However, in some operating systems, the logical block size of the file system is the smallest sector size of a conventional hard disk, such as 512 bytes, as the smallest unit of operation in the file system. In this case, the file system cannot directly manage the files stored on the SSD. Therefore, how to make the solid-state hard disk available for the file system operation is one of the current efforts of the industry.

本發明係有關於一種管理固態硬碟之方法、系統及電腦可讀取媒體。移除固態硬碟的快閃記憶體轉換層,透過位於驅動程式層的位址映射單元負責實體頁面位址與邏輯區塊位址之間的映射關係處理。將固態硬碟的每個頁面模擬成符合檔案系統操作規範的邏輯區塊尺寸,可使固態硬碟相容於各版本的Windows作業系統,提高系統相容性。The present invention relates to a method, system and computer readable medium for managing a solid state drive. The flash memory conversion layer of the solid state hard disk is removed, and the mapping between the physical page address and the logical block address is handled by the address mapping unit located at the driver layer. Simulating each page of a solid state drive into a logical block size that conforms to the file system's operating specifications allows the solid state drive to be compatible with all versions of the Windows operating system, improving system compatibility.

根據本發明之第一方面,提出一種管理固態硬碟之方法。管理固態硬碟的方法包括以下步驟。獲取一固態硬碟的一頁面的一頁面尺寸。獲取一檔案系統的一邏輯區塊的一邏輯區塊尺寸。依據頁面尺寸及邏輯區塊尺寸,建立固態硬碟的頁面的一頁面位址與檔案系統的邏輯區塊的一邏輯區塊位址之間的一映射關係。當讀取或寫入固態硬碟的一資料時,獲取資料對應的一目標邏輯區塊位址。以及依據目標邏輯區塊位址及映射關係,獲取一目標頁面位址,其中目標邏輯區塊位址對應該目標頁面位址。According to a first aspect of the present invention, a method of managing a solid state hard disk is presented. The method of managing a solid state hard disk includes the following steps. Get a page size of a page of a solid state drive. Obtain a logical block size of a logical block of a file system. According to the page size and the logical block size, a mapping relationship between a page address of the page of the solid state hard disk and a logical block address of the logical block of the file system is established. When a data of the solid state drive is read or written, a target logical block address corresponding to the data is obtained. And obtaining a target page address according to the target logical block address and the mapping relationship, wherein the target logical block address corresponds to the target page address.

根據本發明之第二方面,提出一種管理固態硬碟之系統。管理固態硬碟的系統包括一固態硬碟、一檔案系統以及一位址映射單元。固態硬碟包括一頁面,此頁面具有一頁面尺寸。檔案系統包括一邏輯區塊,此邏輯區塊具有一邏輯區塊尺寸。位址映射單元用以依據頁面尺寸及邏輯區塊尺寸,建立固態硬碟的頁面的一頁面位址與檔案系統的邏輯區塊的一邏輯區塊位址之間的一映射關係。其中,當讀取或寫入固態硬碟的一資料時,位址映射單元獲取依據資料對應的一目標邏輯區塊位址,以及依據目標邏輯區塊位址及映射關係,獲取一目標頁面位址,其中目標邏輯區塊位址對應目標頁面位址。According to a second aspect of the present invention, a system for managing a solid state hard disk is provided. The system for managing solid state drives includes a solid state drive, a file system, and a bitmap mapping unit. The solid state drive includes a page with a page size. The file system includes a logical block having a logical block size. The address mapping unit is configured to establish a mapping relationship between a page address of the page of the solid state hard disk and a logical block address of the logical block of the file system according to the page size and the logical block size. Wherein, when reading or writing a data of the solid state hard disk, the address mapping unit acquires a target logical block address corresponding to the data, and acquires a target page bit according to the target logical block address and the mapping relationship. Address, where the target logical block address corresponds to the target page address.

根據本發明之第三方面,提出一種電腦可讀取媒體。電腦可讀取媒體儲存有一軟體程式。此軟體程式執行時,將使具有一控制器之一電子裝置進行一管理固態硬碟的方法。此方法包括以下步驟。獲取一固態硬碟的一頁面的一頁面尺寸。獲取一檔案系統的一邏輯區塊的一邏輯區塊尺寸。依據頁面尺寸及邏輯區塊尺寸,建立固態硬碟的頁面的一頁面位址與檔案系統的邏輯區塊的一邏輯區塊位址之間的一映射關係。當讀取或寫入固態硬碟的一資料時,獲取資料對應的一目標邏輯區塊位址。以及依據目標邏輯區塊位址及映射關係,獲取一目標頁面位址,其中目標邏輯區塊位址對應該目標頁面位址。According to a third aspect of the invention, a computer readable medium is provided. The computer readable media stores a software program. When the software program is executed, the electronic device having one controller performs a method of managing the solid state hard disk. This method includes the following steps. Get a page size of a page of a solid state drive. Obtain a logical block size of a logical block of a file system. According to the page size and the logical block size, a mapping relationship between a page address of the page of the solid state hard disk and a logical block address of the logical block of the file system is established. When a data of the solid state drive is read or written, a target logical block address corresponding to the data is obtained. And obtaining a target page address according to the target logical block address and the mapping relationship, wherein the target logical block address corresponds to the target page address.

為了對本發明之上述及其他方面有更佳的瞭解,下文特舉實施例,並配合所附圖式詳細說明如下:In order to better understand the above and other aspects of the present invention, the following detailed description of the embodiments and the accompanying drawings

以下提出各種實施例進行詳細說明,然而,實施例僅用以作為範例說明,並不會限縮本發明欲保護之範圍。此外,實施例中的圖式省略部份元件,以清楚顯示本發明的技術特點。The various embodiments are described in detail below, however, the examples are intended to be illustrative only and not to limit the scope of the invention. Further, the drawings in the embodiments omits some of the elements to clearly show the technical features of the present invention.

傳統硬碟 (Hard Disk Drive, HDD) 在儲存資料時,係以512位元組 (byte) 大小的一個磁區 (sector) 作為分割單位,以進行讀寫。在微軟Windows 10 Redstone 1更新之前的作業系統中的檔案系統,其操作的邏輯區塊的邏輯區塊尺寸係為512位元組。The Hard Disk Drive (HDD) stores a data in a sector of 512 bytes (sector) for reading and writing. In the file system in the operating system prior to the Microsoft Windows 10 Redstone 1 update, the logical block size of the logical block in which it operates is 512 bytes.

而固態硬碟 (Solid State Disk/Solid State Drive, SSD) 以記憶體儲存資料。舉例來說,固態硬碟以NAND型快閃記憶體 (NAND flash) 儲存資料。固態硬碟的讀寫操作係以頁面 (page) 為單位,其中,一個頁面的頁面尺寸大小可以為4KB (kilobyte,千位元組)、8KB、16KB或更大的頁面尺寸。因此,固態硬碟與微軟Windows 10作業系統的Redstone 1更新之前的檔案系統具有相容性的問題。The Solid State Disk/Solid State Drive (SSD) stores data in memory. For example, solid state drives store data in NAND flash memory. The read and write operations of the solid state drive are in units of pages, wherein the page size of one page can be 4 KB (kilobyte, kilobyte), 8 KB, 16 KB or larger. Therefore, the SSD has compatibility issues with the file system prior to Redstone 1 update of the Microsoft Windows 10 operating system.

對此,固態硬碟透過在檔案系統與實體資料儲存層之間的一快閃記憶體轉換層 (Flash Translation Layer, FTL),將固態硬碟的一個頁面模擬多個尺寸較小的邏輯區塊,以克服固態硬碟與檔案系統之間的相容性問題。In this regard, the solid state hard disk emulates a plurality of smaller logical blocks by one page of the solid state hard disk through a flash translation layer (FTL) between the file system and the physical data storage layer. To overcome the compatibility problem between solid state hard disk and file system.

請參照第1A圖,其繪示模擬512位元組 (512 byte emulation, 512e) 之固態硬碟120a與作業系統150a連接之示意圖。在本範例中,模擬512位元組之固態硬碟120a的一個頁面的頁面尺寸為4K。應該理解的是,一個頁面的頁面尺寸並不以4KB為限,頁面尺寸可以例如是8KB、16KB或更大的頁面尺寸。模擬512位元組之固態硬碟120a透過storAHCI驅動程式建立與作業系統150a之間的連接。作業系統150a的檔案系統130a僅能對邏輯區塊尺寸為512位元組的邏輯區塊進行操作。Please refer to FIG. 1A, which illustrates a schematic diagram of a 512-byte emulation (512e) solid state hard disk 120a connected to the operating system 150a. In this example, the page size of one page of the 512-bit solid state hard disk 120a is 4K. It should be understood that the page size of one page is not limited to 4 KB, and the page size may be, for example, a page size of 8 KB, 16 KB or more. The solid state hard disk 120a simulating 512 bytes establishes a connection with the operating system 150a through the storAHCI driver. The file system 130a of the operating system 150a can only operate on logical blocks having a logical block size of 512 bytes.

因此,必須先將模擬512位元組之固態硬碟120a的一個頁面模擬成多個512位元組大小的邏輯區塊,以供檔案系統130a操作。舉例來說,頁面尺寸為4KB的頁面模擬為8個512 byte的邏輯區塊。模擬512位元組之固態硬碟120a的一個頁面 (4KB) 可透過快閃記憶體轉換層122a模擬為8個邏輯區塊大小為512位元組的邏輯區塊。換言之,模擬512位元組之固態硬碟120a透過快閃記憶體轉換層122a輸出的邏輯區塊的邏輯區塊大小為512位元組。檔案系統130a可對快閃記憶體轉換層122a模擬出來的512位元組大小的邏輯區塊進行操作。模擬512位元組之固態硬碟120a經快閃記憶體轉換層映射 (mapping) 處理後,係輸出邏輯區塊尺寸為512位元組之邏輯區塊,無法再更動。Therefore, one page of the 512-bit solid state hard disk 120a must first be simulated into a plurality of 512-byte-sized logical blocks for operation by the file system 130a. For example, a page with a page size of 4 KB is emulated as 8 512 byte logical blocks. A page (4 KB) of the 512-bit solid state hard disk 120a can be simulated as a logical block of 8 logical block sizes of 512 bytes through the flash memory conversion layer 122a. In other words, the logical block size of the logical block outputted by the solid-state hard disk 120a simulating the 512-bit unit through the flash memory conversion layer 122a is 512 bytes. The file system 130a can operate on a 512 byte-sized logical block that is simulated by the flash memory translation layer 122a. After the 512-bit solid state hard disk 120a is processed by the flash memory conversion layer mapping, the logical block whose logical block size is 512 bytes is output and cannot be changed.

作業系統150a可以例如是微軟Windows 10 Redstone 1更新之前的作業系統,舉例來說,Windows XP作業系統、Windows 7作業系統等。檔案系統130a可以例如為NTFS (New Technology File System) 檔案系統。NTFS檔案系統的常見磁區分割大小在16TB (terabyte) 以下,在NTFS檔案系統中,最小的容量單元為4KB大小的叢集 (cluster)。為了避免與硬碟之間的相容性問題,每個叢集由8個512位元組的邏輯區塊組成。The operating system 150a may be, for example, an operating system prior to the Microsoft Windows 10 Redstone 1 update, for example, a Windows XP operating system, a Windows 7 operating system, and the like. The file system 130a may be, for example, an NTFS (New Technology File System) file system. The NTFS file system has a common partition size of 16TB (terabyte). In the NTFS file system, the smallest capacity unit is a 4KB cluster. To avoid compatibility issues with hard disks, each cluster consists of eight 512-bit logical blocks.

請參照第1B圖,其繪示原生4K (4K native, 4Kn) 之固態硬碟120b與作業系統150b連接之示意圖。在本範例中,原生4K之固態硬碟120b的一個頁面的頁面尺寸為4K。應該理解的是,一個頁面的頁面尺寸並不以4KB為限,頁面尺寸可以例如是8KB、16KB或更大的頁面尺寸。原生4K之固態硬碟120b透過storAHCI驅動程式建立與作業系統150b之間的連接。作業系統150b可以例如是微軟Windows 10作業系統Redstone 1更新之後的作業系統,舉例來說,Windows 10 Redstone 1、Windows 10 Redstone 2、Windows 10 Redstone 3等。檔案系統130b可以例如為NTFS檔案系統。作業系統150b的檔案系統130b能對邏輯區塊尺寸為4KB的邏輯區塊進行操作。Please refer to FIG. 1B, which illustrates a schematic diagram of a native 4K (4K native, 4Kn) solid state hard disk 120b connected to the operating system 150b. In this example, the page size of one page of the native 4K solid state hard disk 120b is 4K. It should be understood that the page size of one page is not limited to 4 KB, and the page size may be, for example, a page size of 8 KB, 16 KB or more. The native 4K solid state drive 120b establishes a connection with the operating system 150b via the storAHCI driver. The operating system 150b may be, for example, an operating system after the update of the Microsoft Windows 10 operating system Redstone 1, for example, Windows 10 Redstone 1, Windows 10 Redstone 2, Windows 10 Redstone 3, and the like. The file system 130b can be, for example, an NTFS file system. The file system 130b of the operating system 150b is capable of operating on logical blocks having a logical block size of 4 KB.

原生4K之固態硬碟120b的一個頁面經過快閃記憶體轉換層122a進行映射處理後,映射處理後的邏輯區塊之邏輯區塊尺寸仍係為4KB。換言之,原生4K之固態硬碟120b經快閃記憶體轉換層122a輸出的邏輯區塊的邏輯區塊尺寸係為4KB。檔案系統130b可對4KB大小的邏輯區塊進行操作。原生4K之固態硬碟120b經快閃記憶體轉換層映射處理後輸出邏輯區塊尺寸為4KB之邏輯區塊,無法再更動。After one page of the native 4K solid state hard disk 120b is mapped by the flash memory conversion layer 122a, the logical block size of the mapped logical block is still 4 KB. In other words, the logical block size of the logical block output by the native 4K solid state hard disk 120b via the flash memory conversion layer 122a is 4 KB. The file system 130b can operate on logical blocks of 4 KB size. The native 4K solid state hard disk 120b is processed by the flash memory conversion layer mapping process and outputs a logical block having a logical block size of 4 KB, which cannot be changed any more.

請參照第2圖,其繪示依照本發明一實施例之管理固態硬碟的系統20之示意圖。系統20包括一位址映射單元210、一固態硬碟220以及一作業系統250。固態硬碟220包括一頁面,頁面具有一頁面尺寸。頁面尺寸可以例如是4KB、8KB、16KB或其他頁面尺寸。固態硬碟220透過storAHCI驅動程式建立與位址映射單元210及作業系統250之間的連接。作業系統250包括一檔案系統230。檔案系統230包括一邏輯區塊,邏輯區塊具有一邏輯區塊尺寸。邏輯區塊尺寸可以例如是512位元組、4KB或其他尺寸。Referring to FIG. 2, a schematic diagram of a system 20 for managing a solid state hard disk in accordance with an embodiment of the present invention is shown. System 20 includes a bit mapping unit 210, a solid state drive 220, and an operating system 250. The solid state drive 220 includes a page having a page size. The page size can be, for example, 4 KB, 8 KB, 16 KB, or other page size. The solid state hard disk 220 establishes a connection with the address mapping unit 210 and the operating system 250 through the storAHCI driver. Operating system 250 includes a file system 230. File system 230 includes a logical block having a logical block size. The logical block size can be, for example, 512 bytes, 4 KB, or other size.

位址映射單元210建立固態硬碟220中的一頁面位址與檔案系統230的一邏輯區塊位址之間的邏輯實體位址映射 (logical-to-physical address mapping) 關係。其中,位址映射單元210可以例如是藉由使用一晶片、晶片內的一電路區塊、一韌體電路、含有數個電子元件及導線的電路板或儲存複數組程式碼的一儲存媒體來實現,也可藉由電腦系統、伺服器等電子裝置執行對應軟體、驅動程式或程式來實現。作業系統250可以例如是微軟Windows作業系統,舉例來說,Windows XP作業系統、Windows 7作業系統、Windows 10 Redstone 1、Windows 10 Redstone 2、Windows 10 Redstone 3等。檔案系統230可以例如為NTFS檔案系統。The address mapping unit 210 establishes a logical-to-physical address mapping relationship between a page address in the solid state drive 220 and a logical block address of the file system 230. The address mapping unit 210 can be, for example, by using a chip, a circuit block in the chip, a firmware circuit, a circuit board containing a plurality of electronic components and wires, or a storage medium storing a complex array code. The implementation can also be implemented by executing a corresponding software, driver or program by an electronic device such as a computer system or a server. The operating system 250 can be, for example, a Microsoft Windows operating system, for example, a Windows XP operating system, a Windows 7 operating system, Windows 10 Redstone 1, Windows 10 Redstone 2, Windows 10 Redstone 3, and the like. File system 230 can be, for example, an NTFS file system.

請同時參照第2圖及第3圖。第3圖繪示依照本發明一實施例之管理固態硬碟的方法之流程圖。第3圖繪示之電池管理固態硬碟的方法可應用於如第2圖所示之系統20。為了清楚說明上述各項元件的運作以及本發明實施例的管理固態硬碟的方法,以下將搭配第3圖之流程圖詳細說明如下。然而,本發明所屬技術領域中具有通常知識者均可瞭解,本揭露實施例的擴充方法並不侷限應用於第2圖的系統20,也不侷限於第3圖之流程圖的各項步驟順序。Please refer to both Figure 2 and Figure 3. FIG. 3 is a flow chart of a method for managing a solid state hard disk according to an embodiment of the invention. The method of battery management solid state hard disk shown in FIG. 3 can be applied to the system 20 as shown in FIG. In order to clearly explain the operation of the above various elements and the method of managing the solid state hard disk according to the embodiment of the present invention, the following will be described in detail with reference to the flowchart of FIG. However, those skilled in the art to which the present invention pertains can understand that the expansion method of the disclosed embodiment is not limited to the system 20 of FIG. 2, nor is it limited to the sequence of steps of the flowchart of FIG. .

根據本發明一實施例,首先,於步驟S302,位址映射單元210施加一識別裝置指令 (Identify Device Command) 至固態硬碟220,以獲取固態硬碟220的一頁面的一頁面尺寸。於步驟S304,位址映射單元210獲取檔案系統230的一邏輯區塊的一邏輯區塊尺寸。於步驟S306,位址映射單元210依據頁面尺寸及邏輯區塊尺寸,建立固態硬碟220的頁面的頁面位址與檔案系統230的邏輯區塊的邏輯區塊位址之間的一映射關係。映射關係可以依據頁面尺寸及邏輯區塊尺寸之間的一比例值、頁面位址、頁面的一子頁面位址以及邏輯區塊位址而建立。進一步說,透過下式(1),可建立固態硬碟220的頁面的頁面位址與檔案系統230的邏輯區塊的邏輯區塊位址之間的映射關係。 (1) 以頁面尺寸及邏輯區塊尺寸之間的一比例值對邏輯區塊位址執行一除法運算,經過此除法運算所得之商數為頁面位址,此除法運算所得之餘數則為此頁面位址的頁面中的子頁面位址。其中PS為頁面尺寸、LBS為邏輯區塊尺寸、PBA為頁面位址、SPBA為子頁面位址,以及LBA為邏輯區塊位址。 According to an embodiment of the present invention, first, in step S302, the address mapping unit 210 applies an identification device command (Identify Device Command) to the solid state hard disk 220 to obtain a page size of a page of the solid state hard disk 220. In step S304, the address mapping unit 210 acquires a logical block size of a logical block of the file system 230. In step S306, the address mapping unit 210 establishes a mapping relationship between the page address of the page of the solid state hard disk 220 and the logical block address of the logical block of the file system 230 according to the page size and the logical block size. The mapping relationship can be established according to a ratio between the page size and the logical block size, the page address, a sub-page address of the page, and the logical block address. Further, by the following formula (1), a mapping relationship between the page address of the page of the solid state hard disk 220 and the logical block address of the logical block of the file system 230 can be established. (1) Perform a division operation on the logical block address by a proportional value between the page size and the logical block size, and the quotient obtained by the division operation is the page address, and the remainder obtained by the division operation is The subpage address in the page of the page address. The PS is the page size, the LBS is the logical block size, the PBA is the page address, the SPBA is the sub-page address, and the LBA is the logical block address.

固態硬碟220的頁面的頁面位址與檔案系統230的邏輯區塊的邏輯區塊位址之間的映射關係亦可由上述式(1)改寫如下式(2)。 (2) The mapping relationship between the page address of the page of the solid state hard disk 220 and the logical block address of the logical block of the file system 230 can also be rewritten by the following formula (1) by the following formula (2). (2)

請參照第4A圖,其繪示一邏輯實體映射關係之示意圖。在本發明一實施例中,固態硬碟的頁面尺寸可以例如是4KB,檔案系統的邏輯區塊尺寸可以例如是512位元組。舉例來說,邏輯區塊位址為15之邏輯區塊,透過上述式(1)或式(2)之映射關係,對應於頁面位址為1的頁面,並對應於此頁面中的子頁面位址為7的子頁面。Please refer to FIG. 4A, which illustrates a schematic diagram of a logical entity mapping relationship. In an embodiment of the invention, the page size of the solid state drive may be, for example, 4 KB, and the logical block size of the file system may be, for example, 512 bytes. For example, a logical block with a logical block address of 15 and a mapping relationship of the above formula (1) or (2) corresponds to a page with a page address of 1, and corresponds to a subpage in the page. A subpage with a address of 7.

請參照第4B圖,其繪示另一邏輯實體映射關係之示意圖。在本發明另一實施例中,固態硬碟的頁面尺寸可以例如是4KB,檔案系統的邏輯區塊尺寸可以例如是4KB。舉例來說,邏輯區塊位址為1之邏輯區塊,透過上述式(1)或式(2)之映射關係,對應於頁面位址為1的頁面,並對應於此頁面中的子頁面位址為0的子頁面。Please refer to FIG. 4B, which illustrates a schematic diagram of another logical entity mapping relationship. In another embodiment of the invention, the page size of the solid state drive may be, for example, 4 KB, and the logical block size of the file system may be, for example, 4 KB. For example, a logical block with a logical block address of 1 and a mapping relationship of the above formula (1) or (2) corresponds to a page with a page address of 1 and corresponds to a subpage in the page. A subpage with a address of 0.

依據本發明之實施例,固態硬碟220直接以頁面的頁面尺寸輸出頁面至位址映射單元210,位址映射單元210依據頁面尺寸及邏輯區塊尺寸,將固態硬碟220的頁面模擬成符合檔案系統230操作規範的邏輯區塊尺寸 (例如為512位元組或4KB),並建立固態硬碟220的頁面的頁面位址與檔案系統230的邏輯區塊的邏輯區塊位址之間的映射關係,可使固態硬碟相容於各版本的Windows作業系統。According to the embodiment of the present invention, the solid state hard disk 220 directly outputs the page to the address mapping unit 210 in the page size of the page. The address mapping unit 210 simulates the page of the solid state hard disk 220 into conformity according to the page size and the logical block size. The file system 230 operates on a logical block size (e.g., 512 bytes or 4 KB) and establishes between the page address of the page of the solid state hard disk 220 and the logical block address of the logical block of the file system 230. The mapping relationship makes the solid state drive compatible with all versions of the Windows operating system.

請參照第3圖,於位址映射單元210建立固態硬碟220的頁面的頁面位址與檔案系統230的邏輯區塊的邏輯區塊位址之間的映射關係之後,於步驟S308,當主機或使用者讀取或寫入固態硬碟的一資料時,位址映射單元210獲取此資料對應的目標邏輯區塊位址。隨後,於步驟S310,位址映射單元210依據目標邏輯區塊位址及映射關係,獲取對應於目標邏輯區塊位址的目標頁面位址。Referring to FIG. 3, after the address mapping unit 210 establishes a mapping relationship between the page address of the page of the SSD 220 and the logical block address of the logical block of the file system 230, the host is executed in step S308. Or when the user reads or writes a data of the solid state hard disk, the address mapping unit 210 acquires the target logical block address corresponding to the data. Then, in step S310, the address mapping unit 210 acquires the target page address corresponding to the target logical block address according to the target logical block address and the mapping relationship.

在本發明一實施例中,第3圖繪示之管理固態硬碟之方法係由位址映射單元210執行。位址映射單元210可藉由電腦系統、伺服器等具有控制器之電子裝置執行對應軟體、驅動程式或程式來實現。位址映射單元210位於固態硬碟220及檔案系統230之間的一驅動程式層,非位於固態硬碟220的韌體中。In an embodiment of the invention, the method for managing the solid state hard disk in FIG. 3 is performed by the address mapping unit 210. The address mapping unit 210 can be implemented by executing a corresponding software, driver, or program by an electronic device having a controller such as a computer system or a server. The address mapping unit 210 is located in a driver layer between the solid state hard disk 220 and the file system 230, and is not located in the firmware of the solid state hard disk 220.

依據本發明之實施例所提出之管理固態硬碟的方法、系統及電腦可讀取媒體,可移除固態硬碟的快閃記憶體轉換層,透過位於驅動程式層的位址映射單元負責實體頁面位址與邏輯區塊位址之間的映射關係處理,可減少固態硬碟的背景活動 (SSD Background Activity) 以及固態硬碟的控制器的運算負擔。A method, system and computer readable medium for managing a solid state hard disk according to an embodiment of the present invention, which can remove a flash memory conversion layer of a solid state hard disk, and is responsible for an entity through an address mapping unit located at a driver layer The mapping between the page address and the logical block address reduces the SSD Background Activity and the computational burden of the SSD controller.

再者,依據本發明之實施例所提出之管理固態硬碟的方法、系統及電腦可讀取媒體,可於辨識固態硬碟的頁面的頁面尺寸以及邏輯區塊的邏輯區塊尺寸後,依據頁面尺寸及邏輯區塊尺寸,將固態硬碟的每個頁面模擬成符合檔案系統操作規範的邏輯區塊尺寸,可使固態硬碟相容於各版本的Windows作業系統,提高系統相容性,較快閃記憶體轉換層的使用有更大的彈性。Furthermore, the method, system, and computer readable medium for managing a solid state hard disk according to an embodiment of the present invention can identify the page size of the page of the solid state hard disk and the logical block size of the logical block according to the The page size and logical block size simulate each page of the solid state drive into a logical block size that conforms to the file system operating specification, making the solid state drive compatible with each version of the Windows operating system, improving system compatibility. The use of a faster flash memory conversion layer is more flexible.

此外,依據本發明之實施例所提出之管理固態硬碟的方法、系統及電腦可讀取媒體,固態硬碟在進行耗損平均 (Wear Leveling) 抹寫時,固態硬碟的輸出及輸入資料的大小係為一致,不須額外的讀寫動作來搬移資料,可減少額外的計算次數,進而降低固態硬碟的控制器的運算負擔。In addition, a method, system, and computer readable medium for managing a solid state hard disk according to an embodiment of the present invention, and a solid state hard disk output and input data when performing a wear level averaging The size is the same, no additional reading and writing to move the data, can reduce the number of additional calculations, and thus reduce the computing burden of the solid state hard disk controller.

綜上所述,雖然本發明已以實施例揭露如上,然其並非用以限定本發明。本發明所屬技術領域中具有通常知識者,在不脫離本發明之精神和範圍內,當可作各種之更動與潤飾。因此,本發明之保護範圍當視後附之申請專利範圍所界定者為準。In conclusion, the present invention has been disclosed in the above embodiments, but it is not intended to limit the present invention. A person skilled in the art can make various changes and modifications without departing from the spirit and scope of the invention. Therefore, the scope of the invention is defined by the scope of the appended claims.

120a、120b、220‧‧‧固態硬碟
122a、122b‧‧‧快閃記憶體轉換層
130a、130b、230‧‧‧檔案系統
150a、150b、250‧‧‧作業系統
20‧‧‧系統
210‧‧‧位址映射單元
S302~S310‧‧‧流程步驟
120a, 120b, 220‧‧‧ solid state hard drives
122a, 122b‧‧‧ flash memory conversion layer
130a, 130b, 230‧‧‧ file system
150a, 150b, 250‧‧‧ operating systems
20‧‧‧ system
210‧‧‧ address mapping unit
S302~S310‧‧‧ Process steps

第1A圖繪示模擬512位元組之固態硬碟與作業系統連接之示意圖。 第1B圖繪示原生4K之固態硬碟與作業系統連接之示意圖。 第2圖繪示依照本發明一實施例之管理固態硬碟的系統之示意圖。 第3圖繪示依照本發明一實施例之管理固態硬碟的方法之流程圖。 第4A圖繪示一邏輯實體映射關係之示意圖。 第4B圖繪示一邏輯實體映射關係之示意圖。FIG. 1A is a schematic diagram showing the connection of a solid-state hard disk simulating a 512-bit group to an operating system. FIG. 1B is a schematic diagram showing the connection of a native 4K solid state hard disk to an operating system. 2 is a schematic diagram of a system for managing a solid state hard disk according to an embodiment of the invention. FIG. 3 is a flow chart of a method for managing a solid state hard disk according to an embodiment of the invention. FIG. 4A is a schematic diagram showing a logical entity mapping relationship. FIG. 4B is a schematic diagram showing a logical entity mapping relationship.

Claims (9)

一種管理固態硬碟的方法,該方法包括:獲取一固態硬碟的一頁面的一頁面尺寸;獲取一檔案系統的一邏輯區塊的一邏輯區塊尺寸;依據該頁面尺寸及該邏輯區塊尺寸,建立該固態硬碟的該頁面的一頁面位址與該檔案系統的該邏輯區塊的一邏輯區塊位址之間的一映射關係,其中該映射關係是依據該頁面尺寸及該邏輯區塊尺寸的一比例值、該頁面位址、該頁面的一子頁面位址以及該邏輯區塊位址建立;當讀取或寫入該固態硬碟的一資料時,獲取該資料對應的一目標邏輯區塊位址;以及依據該目標邏輯區塊位址及該映射關係,獲取一目標頁面位址,其中該目標邏輯區塊位址對應該目標頁面位址。 A method for managing a solid state hard disk, the method comprising: obtaining a page size of a page of a solid state hard disk; acquiring a logical block size of a logical block of a file system; and according to the page size and the logical block a mapping between a page address of the page of the solid state hard disk and a logical block address of the logical block of the file system, wherein the mapping relationship is based on the page size and the logic a scale value of the block size, the page address, a sub-page address of the page, and the logical block address establishment; when reading or writing a data of the solid state drive, obtaining the corresponding data a target logical block address; and obtaining a target page address according to the target logical block address and the mapping relationship, wherein the target logical block address corresponds to the target page address. 如申請專利範圍第1項所述之方法,其中該映射關 其中PS為該頁面尺寸、LBS為該邏輯區塊尺寸、PBA為該頁面位址、SPBA為該子頁面位址,以及LBA為該邏輯區塊位址。 The method of claim 1, wherein the mapping is Where PS is the page size, LBS is the logical block size, PBA is the page address, SPBA is the sub-page address, and LBA is the logical block address. 如申請專利範圍第1項所述之方法,其中獲取該頁面尺寸之步驟包括:施加一識別裝置指令(Identify Device Command)以獲取該固態硬碟的該頁面尺寸。 The method of claim 1, wherein the step of obtaining the size of the page comprises: applying an Identify Device Command to obtain the page size of the solid state drive. 如申請專利範圍第1項所述之方法,該方法係由一位址映射單元執行,該位址映射單元位於該固態硬碟及該檔案系統之間的一驅動程式層。 The method of claim 1, wherein the method is performed by a bitmap mapping unit located in a driver layer between the solid state hard disk and the file system. 一種管理固態硬碟的系統,該系統包括:一固態硬碟,包括一頁面,該頁面具有一頁面尺寸;一檔案系統,包括一邏輯區塊,該邏輯區塊具有一邏輯區塊尺寸;以及一位址映射單元,用以依據該頁面尺寸及該邏輯區塊尺寸,建立該固態硬碟的該頁面的一頁面位址與該檔案系統的該邏輯區塊的一邏輯區塊位址之間的一映射關係;其中,當讀取或寫入該固態硬碟的一資料時,該位址映射單元依據該資料對應的一目標邏輯區塊位址及該映射關係,獲取一目標頁面位址,其中該目標邏輯區塊位址對應該目標頁面位址,該位址映射單元依據該頁面尺寸及該邏輯區塊尺寸的一比例值、該頁面位址、該頁面的一子頁面位址以及該邏輯區塊位址建立該映射關係。 A system for managing a solid state hard disk, the system comprising: a solid state hard disk comprising a page having a page size; a file system comprising a logical block, the logical block having a logical block size; a one-bit mapping unit, configured to establish, between the page size and the logical block size, a page address of the page of the solid state drive and a logical block address of the logical block of the file system a mapping relationship; wherein, when reading or writing a data of the solid state hard disk, the address mapping unit acquires a target page address according to a target logical block address corresponding to the data and the mapping relationship The target logical block address corresponds to a target page address, the address mapping unit according to the page size and a scale value of the logical block size, the page address, a sub-page address of the page, and The logical block address establishes the mapping relationship. 如申請專利範圍第5項所述之系統,其中該映射關 其中,PS為該頁面尺寸、LBS為該邏輯區塊尺寸、PBA為該頁面位址、SPBA為該子頁面位址,以及LBA為該邏輯區塊位址。 For example, the system described in claim 5, wherein the mapping is Wherein, PS is the page size, LBS is the logical block size, PBA is the page address, SPBA is the sub-page address, and LBA is the logical block address. 如申請專利範圍第5項所述之系統,其中該位址映射單元施加一識別裝置指令(Identify Device Command)至該固態硬碟,以獲取該固態硬碟的該頁面尺寸。 The system of claim 5, wherein the address mapping unit applies an Identify Device Command to the solid state hard disk to obtain the page size of the solid state hard disk. 如申請專利範圍第5項所述之系統,其中該位址映射單元位於該固態硬碟及該檔案系統之間的一驅動程式層。 The system of claim 5, wherein the address mapping unit is located at a driver layer between the solid state drive and the file system. 一種非暫時性電腦可讀取媒體,其上儲存有一軟體程式,該軟體程式執行時,將使具有一控制器之一電子裝置進行一管理固態硬碟的方法,該方法包含:獲取一固態硬碟的一頁面的一頁面尺寸;獲取一檔案系統的一邏輯區塊的一邏輯區塊尺寸;依據該頁面尺寸及該邏輯區塊尺寸,建立該固態硬碟的該頁面的一頁面位址與該檔案系統的該邏輯區塊的一邏輯區塊位址之間的一映射關係,其中該映射關係是依據該頁面尺寸及該邏輯區塊尺寸的一比例值、該頁面位址、該頁面的一子頁面位址以及該邏輯區塊位址建立;當讀取或寫入該固態硬碟的一資料時,獲取該資料對應的一目標邏輯區塊位址;以及依據該目標邏輯區塊位址及該映射關係,獲取一目標頁面位址,其中該目標邏輯區塊位址對應該目標頁面位址。 A non-transitory computer readable medium having a software program stored thereon, the software program executing a method for managing a solid state hard disk by an electronic device having a controller, the method comprising: acquiring a solid state hard a page size of a page of the disc; obtaining a logical block size of a logical block of a file system; and establishing a page address of the page of the solid state hard disk according to the page size and the logical block size a mapping relationship between a logical block address of the logical block of the file system, wherein the mapping relationship is a scale value according to the page size and the logical block size, the page address, the page a sub-page address and the logical block address establishment; when reading or writing a data of the solid-state hard disk, acquiring a target logical block address corresponding to the data; and according to the target logical block bit And the mapping relationship, obtaining a target page address, wherein the target logical block address corresponds to the target page address.
TW106123291A 2017-07-12 2017-07-12 Method, system, and computer readable medium for managing solid state drive TWI633434B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW106123291A TWI633434B (en) 2017-07-12 2017-07-12 Method, system, and computer readable medium for managing solid state drive

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW106123291A TWI633434B (en) 2017-07-12 2017-07-12 Method, system, and computer readable medium for managing solid state drive

Publications (2)

Publication Number Publication Date
TWI633434B true TWI633434B (en) 2018-08-21
TW201908975A TW201908975A (en) 2019-03-01

Family

ID=63959939

Family Applications (1)

Application Number Title Priority Date Filing Date
TW106123291A TWI633434B (en) 2017-07-12 2017-07-12 Method, system, and computer readable medium for managing solid state drive

Country Status (1)

Country Link
TW (1) TWI633434B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI754206B (en) 2020-01-10 2022-02-01 祥碩科技股份有限公司 Data storage system, data storage device and management method thereof

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140082261A1 (en) * 2011-10-05 2014-03-20 Lsi Corporation Self-journaling and hierarchical consistency for non-volatile storage
TW201510723A (en) * 2009-09-03 2015-03-16 Pioneer Chip Technology Ltd Page based management of flash storage
TW201523249A (en) * 2013-08-16 2015-06-16 Lsi Corp Variable-size flash translation layer
CN106293521A (en) * 2016-08-02 2017-01-04 华中科技大学 A kind of mapping granule adaptive flash translation layer (FTL) management method
US20170123990A1 (en) * 2015-10-29 2017-05-04 SK Hynix Inc. Data storage device and operating method thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201510723A (en) * 2009-09-03 2015-03-16 Pioneer Chip Technology Ltd Page based management of flash storage
US20140082261A1 (en) * 2011-10-05 2014-03-20 Lsi Corporation Self-journaling and hierarchical consistency for non-volatile storage
TW201523249A (en) * 2013-08-16 2015-06-16 Lsi Corp Variable-size flash translation layer
US20170123990A1 (en) * 2015-10-29 2017-05-04 SK Hynix Inc. Data storage device and operating method thereof
CN106293521A (en) * 2016-08-02 2017-01-04 华中科技大学 A kind of mapping granule adaptive flash translation layer (FTL) management method

Also Published As

Publication number Publication date
TW201908975A (en) 2019-03-01

Similar Documents

Publication Publication Date Title
US11640353B2 (en) Memory system, data storage device, user device and data management method thereof
US9928167B2 (en) Information processing system and nonvolatile storage unit
US8239618B2 (en) System and method for emulating preconditioning of solid-state device
TWI548990B (en) Memory storage apparatus and method for restoring thereof, memory controller
KR20190057887A (en) Data storage device and operating method thereof
CN113220242B (en) Storage management method, apparatus, and computer readable medium
US9268688B2 (en) Data management method, memory controller and memory storage apparatus
TW201933110A (en) Method and system for testing firmware of solid-state storage device, and electronic apparatus
US20200057725A1 (en) Data storage device and operating method thereof
KR102507140B1 (en) Data storage device and operating method thereof
CN108604162B (en) Method and system for providing access to production data for application virtual machines
US8751756B2 (en) Method and apparatus for writing data in memory system
TW201217968A (en) Data writing method, memory controller and memory storage apparatus
CN111625188A (en) Memory and data writing method and memory system thereof
US9128624B2 (en) Flash memory storage system for simulating rewritable disc device, flash memory controller, computer system, and method thereof
TW202028981A (en) Data storage devices and methods for firmware failure prevention
CN111324414B (en) NVM storage media emulator
CN113885808A (en) Mapping information recording method, memory control circuit unit and memory device
KR20200017664A (en) Method of accessing data in storage device, method of managing data in storage device and storage device performing the same
TWI633434B (en) Method, system, and computer readable medium for managing solid state drive
CN109002265B (en) Data processing method and related device
TWI503841B (en) Writing method, memory controller and memory storage device
KR20210018570A (en) Controller, operating method thereof and storage device including the same
JPWO2016194199A1 (en) Storage device
CN108984109A (en) The control method of access efficiency is promoted on flash memory