CN107807786B - Storage device and data mapping method thereof - Google Patents
Storage device and data mapping method thereof Download PDFInfo
- Publication number
- CN107807786B CN107807786B CN201610809613.9A CN201610809613A CN107807786B CN 107807786 B CN107807786 B CN 107807786B CN 201610809613 A CN201610809613 A CN 201610809613A CN 107807786 B CN107807786 B CN 107807786B
- Authority
- CN
- China
- Prior art keywords
- volatile memory
- data
- data mapping
- memory
- mapping table
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0608—Saving storage space on storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0655—Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
- G06F3/0658—Controller construction arrangements
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0683—Plurality of storage devices
Abstract
The present invention provides a storage device, comprising: a non-volatile memory; a volatile memory for recording a local data mapping table of partial memory space of the non-volatile memory; a memory controller connected with a main control end and used for controlling the access of the non-volatile memory and the volatile memory, wherein the memory controller assigns a corresponding priority degree to each file stored in the non-volatile memory and establishes the region mapping table according to the data mapping relation corresponding to the file with the highest priority degree according to the priority degree corresponding to each file.
Description
Technical Field
The present invention relates to a storage device, and more particularly, to a storage device and a data mapping method thereof.
Background
With the development of technology, the transmission speed of storage devices in computer systems is becoming faster and faster, such as Solid-state disks (Solid-state disks), which are nonvolatile memories capable of fast data access. In recent years, various computer manufacturers have established standards for nonvolatile Memory transmission, such as Advanced Host Controller Interface (AHCI), Non-volatile Memory (NVMe), and the like. The two standard levels are interface standards including an instruction set, a flash memory access control, a Register Transfer Level (Register Transfer Level), a driver layer, and the like at the storage device and the operating system.
In addition, the cost of NAND flash memory (NAND flash) is becoming lower and more, and large-capacity solid state drives that could not be achieved by the prior art are becoming more and more popular in the market today. However, for a large-capacity solid state drive, the data mapping mechanism used in the conventional small-capacity solid state drive is high in production cost, and it is difficult to reduce the production cost. In the conventional data mapping mechanism for a small-capacity solid state drive, a volatile memory (e.g., DRAM) is configured in a controller of the solid state drive, and in order to achieve the effect of fast access, all mapping tables of data of the whole capacity of a flash memory in the solid state drive are put into the volatile memory, but the size of the data mapping table in the volatile memory is almost fixed to one thousandth of that of the flash memory. In short, if the capacity of the flash memory of the conventional solid state drive is 1TB, the size of the data mapping table in the volatile memory needs to be at least 1GB, which results in an excessively high cost of the volatile memory.
Therefore, a solid state drive and a data mapping method thereof are needed to solve the above problems.
Disclosure of Invention
The present invention provides a storage device, comprising: a non-volatile memory; a volatile memory for recording a local data mapping table of partial memory space of the non-volatile memory; a memory controller connected with a main control end and used for controlling the access of the non-volatile memory and the volatile memory, wherein the memory controller assigns a corresponding priority degree to each file stored in the non-volatile memory and establishes the region mapping table according to the data mapping relation corresponding to the file with the highest priority degree according to the priority degree corresponding to each file.
The invention also provides a data mapping method, which is used for a storage device, wherein the storage device comprises: a non-volatile memory, a volatile memory and a memory controller, the method comprising: connecting the storage device with a main control end; recording a local data mapping table of partial storage space of the non-volatile memory by using the volatile memory; assigning a priority level to each file stored in the non-volatile memory by using the memory controller; the memory controller is used to establish the local mapping table according to the data mapping relationship corresponding to the file with the highest priority level according to the priority level corresponding to each file.
Drawings
FIG. 1 is a block diagram of a computer system according to an embodiment of the present invention.
FIG. 2 is a diagram illustrating a local data mapping table according to an embodiment of the invention.
FIG. 3 is a flowchart of a data mapping method for a memory device according to an embodiment of the invention.
Description of reference numerals:
100-computer system 110-central processing unit
111-memory controller 120-system memory
121-data pool 130-storage device
131 memory controller 132 volatile memory
133 non-volatile memory 200 area data mapping table
202-high priority zone 204-second-high priority zone
206-common data area 208-recently used area
S310-S370
Detailed Description
In order to make the aforementioned and other features and advantages of the invention more comprehensible, embodiments accompanied with figures are described in detail below.
FIG. 1 is a block diagram of a computer system according to an embodiment of the present invention. In one embodiment, the computer system 100 includes a CPU 110, a system memory 120 and a storage device 130. The cpu 110 and the system memory 120 can be regarded as a host. The memory device 130 includes a memory controller 131, a volatile memory 132 and a non-volatile memory 132. For example, the memory controller 131 may support NVMe standard, the volatile memory 132 is a Dynamic Random Access Memory (DRAM), and the non-volatile memory 133 is a NAND flash memory, but the invention is not limited thereto. In addition, a PCIe or SATA bus is used as a communication bridge between the system memory 120 and the storage device 130. In one embodiment, the CPU 110 further comprises a memory controller 111 for controlling data access of the system memory 120, wherein the system memory 120 is, for example, a DRAM. In another embodiment, the memory controller 111 is independent of the central processor 110.
In one embodiment, memory controller 111 partitions a pool of data 121 from system memory 120. When the cpu 110 wants to write data into the storage device 130, the cpu 110 writes the cache data into the data pool 121 (for example, for DMA access) of the system memory 120 through the memory controller 111, and the memory controller 131 then obtains the cache data from the data pool 121 and writes the cache data into the nonvolatile memory 132.
It should be understood that the memory controller 131 writes data into the non-volatile memory 132 through a Flash Translation Layer (FTL) that is responsible for providing the correspondence between the file system and the physical data Layer in the non-volatile memory 132 so that the operating system can still see the same file system as a conventional hard disk. It should be noted that the flash translation layer is also commonly referred to as a data map, and is stored in the volatile memory 132, and the size of the volatile memory 132 is much smaller than one thousandth of the size of the non-volatile memory 133. Therefore, the data mapping table stored in the volatile memory 132 cannot completely correspond to all the data in the non-volatile memory 133. The datamap in this case is also referred to as a local datamap. It should be understood that a complete data map, called global data map, is stored in the non-volatile memory 133.
In one embodiment, not all files in the solid state drive need to be accessed preferentially by the operating system executed by the central processing unit 110. Usually, the system data needs to be read randomly (random access), and the data mapping table of the part of the system data needs to be stored in the volatile memory 132. In addition, the importance of different system data can be differentiated according to the classification and usage. Furthermore, the access time of the volatile memory 132 is much shorter than that of the non-volatile memory, so if the mapping relationship of the data to be read from the non-volatile memory is recorded in the data mapping table of the volatile memory, the memory controller 131 can directly read the desired data from the non-volatile memory 133 according to the data mapping relationship. If the mapping relationship of the data to be read from the non-volatile memory 133 is not recorded in the local data mapping table of the volatile memory 132, the memory controller 131 needs to find the corresponding mapping relationship from the global data mapping table in the non-volatile memory before the desired data can be read from the non-volatile memory 133. In one embodiment, if the size of the non-volatile memory 133 is 1T bit group, the volatile memory 132 of the present invention can only use 32M bit group size.
In one embodiment, when the memory controller 111 writes the data to be stored into the nonvolatile memory 133 from the system memory through the memory controller 131, the cpu 110 marks the priority of the data to be written, and the memory controller 131 determines whether the written data stored in the nonvolatile memory 133 needs to establish the corresponding relationship in the local data mapping table in the volatile memory 132 according to the priority of the written data.
For example, the priority level of the write data can be divided into a plurality of levels, such as levels 0-7, wherein level 0 represents the highest priority and level 7 represents the lowest priority, but those skilled in the art can adjust the number of levels of the priority level according to the actual situation. Generally, the files of system data in an operating system often have a small file size (e.g., K bit blocks to MB bit blocks) and are important. Furthermore, the slow read speed of the solid state drive is usually random read, because it needs to query the local data map of the volatile memory frequently, which is described in the above embodiments. The memory controller 131 needs to determine whether the mapping relationship of the data to be randomly read is stored in the local data mapping table of the volatile memory 132, so the system data with high importance is usually assigned with the highest priority. In other words, when the cpu 110 wants to read the system data from the non-volatile memory 133, the mapping relationship of the system data must exist in the local data mapping table of the volatile memory 132, so that the memory controller 131 can directly read the required system data from the non-volatile memory 133 according to the mapping relationship.
In contrast, it is less important for the operating system to have a larger file capacity, such as multimedia files, user data, etc. When reading the files with larger capacity from the non-volatile memory 133, although the data mapping relationship of the large files is not stored in the local data mapping table in the volatile memory 132, the memory controller 131 needs to read the corresponding data mapping relationship from the global data mapping table in the non-volatile memory 133 before reading the desired data from the non-volatile memory 133. Although there is an extra operation of looking up the global data mapping table, since the large files are read continuously, the continuous reading can be performed by knowing the page (page) and block (block) where the file starts and ends in the nonvolatile memory 133. In addition, the transmission speed of the solid state disk drive for continuous reading is very fast, so that a user does not feel any delay.
FIG. 2 is a diagram illustrating a local data mapping table according to an embodiment of the invention. In one embodiment, the local data map 200 stored in the volatile memory 132 can be divided into several areas, for example: a high priority field 202, a second highest priority field 204, a frequently used data field 206, and a recently used field 208. Generally, the data mapping relationship of the data newly accessed from the nonvolatile memory 133 is written into the recently used area 208, and the same action can be taken regardless of the system file, the user data, the general file, the large-capacity file, and so on. The high priority area 202 is a data map that preferentially stores system data of the operating system or specifically designated high priority data, and the data map of the area is usually less changed once written. The next highest priority area 204 stores the data mapping relationship of the generally important file, and the data in this area may be changed with the data access operation of different priority levels, i.e. the data mapping relationship of the data with lower priority level is preferentially deleted from this area to be replaced with the data mapping relationship of the data with higher priority level. The frequently used data area 206 stores the data mapping relationship of the most recently used data.
FIG. 3 is a flowchart of a data mapping method for a memory device according to an embodiment of the invention. In step S310, a local data mapping table associated with the non-volatile memory 133 is established in the volatile memory 132 by the memory controller 131. It should be noted that the local data map does not completely correspond to the entire storage space of the non-volatile memory 133. The non-volatile memory 133 stores a global data mapping table for recording data mapping relations corresponding to all memory spaces of the non-volatile memory 133.
In step S320, the master assigns a priority level to each file stored in the nonvolatile memory 133 through the memory controller 131.
In step S330, the data mapping relationship corresponding to the file with higher priority level is written into the local data mapping table according to the priority level of each file. In the present invention, the system data of the operating system usually has the highest priority, because the total capacity of the system data may be only a few GB, so the required data mapping table is not too large, and may only occupy tens of MB. Since the system data most requires the fastest access speed, the data mapping relationship needs to be stored in the volatile memory to increase the access speed.
In step S340, when a master needs to read data in the nonvolatile memory 133, the memory controller 131 first queries whether the data mapping relationship of the data to be read is recorded in the local data mapping table. If yes, go to step S350; if not, step S360 is performed.
In step S350, the memory controller 131 reads the required data directly from the non-volatile memory 133 according to the queried data mapping relationship.
In step S360, the memory controller 131 obtains the data mapping relationship of the data to be read from the global data mapping table in the non-volatile memory 133.
In step S370, the memory controller 131 reads the desired data from the non-volatile memory 133 according to the data mapping relationship obtained from the global data mapping table.
In summary, the present invention provides a storage device (e.g. a solid state drive) and a data mapping method thereof. The data mapping method of the invention can effectively reduce the size of the volatile memory in the large-capacity solid state drive without greatly influencing the access efficiency of the solid state drive, thereby greatly reducing the manufacturing cost of the large-capacity solid state drive.
Although the present invention has been described with reference to the preferred embodiments, it should be understood that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined by the appended claims.
Claims (6)
1. A memory device, comprising:
a non-volatile memory for storing a global data mapping table corresponding to all memory spaces of the non-volatile memory;
a volatile memory for recording a local data mapping table of partial memory space of the non-volatile memory, the size of the local data mapping table is smaller than the global data mapping table;
a memory controller, which is used for connecting with a main control end and controlling the access of the non-volatile memory and the volatile memory, wherein, the memory controller assigns a corresponding priority degree to each file stored in the non-volatile memory, and establishes the regional data mapping table according to the data mapping relation corresponding to the file with the highest priority degree according to the priority degree corresponding to each file;
when the master control end wants to read the data in the non-volatile memory through the memory controller, the memory controller determines whether the data mapping relation corresponding to the data that wants to be read is stored in the local data mapping table,
if yes, the memory controller reads data from the non-volatile memory directly according to the data mapping relation corresponding to the data to be read in the local data mapping table;
if not, the memory controller inquires the global data mapping table of the non-volatile memory to obtain the data mapping relation corresponding to the data to be read, and reads the data from the non-volatile memory according to the obtained data mapping relation.
2. The memory device as claimed in claim 1, wherein the master assigns the priority level corresponding to each file stored in the non-volatile memory through the memory controller.
3. The storage device of claim 2 wherein the system data of the master has a highest priority level.
4. A data mapping method is applied to a storage device, and the storage device comprises: a non-volatile memory, a volatile memory and a memory controller, the method comprising:
connecting the storage device with a main control end;
recording a local data mapping table of partial storage space of the non-volatile memory by using the volatile memory; the non-volatile memory stores a global data mapping table corresponding to all storage spaces of the non-volatile memory, and the size of the local data mapping table is smaller than that of the global data mapping table;
assigning a priority level to each file stored in the non-volatile memory by using the memory controller;
establishing the local data mapping table by using the memory controller according to the priority level corresponding to each file and the data mapping relation corresponding to the file with the highest priority level;
when the main control end wants to read the data in the non-volatile memory through the memory controller, the memory controller is used for judging whether the data mapping relation corresponding to the data which is wanted to be read is stored in the local data mapping table;
if yes, directly reading data from the non-volatile memory by using the memory controller according to the data mapping relation corresponding to the data to be read in the local data mapping table;
if not, the memory controller is used for inquiring the global data mapping table of the non-volatile memory to obtain the data mapping relation corresponding to the data to be read, and the data is read from the non-volatile memory according to the obtained data mapping relation.
5. The data mapping method as claimed in claim 4, wherein the master assigns the priority level corresponding to each file stored in the non-volatile memory through the memory controller.
6. The data mapping method of claim 5, wherein the system data of the master has a highest priority level.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610809613.9A CN107807786B (en) | 2016-09-08 | 2016-09-08 | Storage device and data mapping method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610809613.9A CN107807786B (en) | 2016-09-08 | 2016-09-08 | Storage device and data mapping method thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107807786A CN107807786A (en) | 2018-03-16 |
CN107807786B true CN107807786B (en) | 2021-09-07 |
Family
ID=61576006
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610809613.9A Active CN107807786B (en) | 2016-09-08 | 2016-09-08 | Storage device and data mapping method thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107807786B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101271380A (en) * | 2007-03-19 | 2008-09-24 | 威刚科技股份有限公司 | mixed density memory storage device |
CN101923512A (en) * | 2009-05-29 | 2010-12-22 | 晶天电子(深圳)有限公司 | Two-layer, three-layer flash-memory devices, intelligent storage switch and two-layer, three layers of controller |
CN102122233A (en) * | 2010-01-08 | 2011-07-13 | 群联电子股份有限公司 | Method for managing block and writing data, flash memory storage system and controller |
CN103425600A (en) * | 2013-08-23 | 2013-12-04 | 中国人民解放军国防科学技术大学 | Address mapping method for flash translation layer of solid state drive |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1474414A (en) * | 2002-08-05 | 2004-02-11 | 希旺科技股份有限公司 | Non-volatile memory storage system needing no redundant column and its writing -in method |
US20150378884A1 (en) * | 2013-04-08 | 2015-12-31 | Avalanche Technology, Inc. | Storage system controlling addressing of solid storage disks (ssd) |
US9209835B2 (en) * | 2013-11-27 | 2015-12-08 | Seagate Technology Llc | Read retry for non-volatile memories |
CN104503707B (en) * | 2014-12-24 | 2018-03-06 | 华为技术有限公司 | Read the method and device of data |
-
2016
- 2016-09-08 CN CN201610809613.9A patent/CN107807786B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101271380A (en) * | 2007-03-19 | 2008-09-24 | 威刚科技股份有限公司 | mixed density memory storage device |
CN101923512A (en) * | 2009-05-29 | 2010-12-22 | 晶天电子(深圳)有限公司 | Two-layer, three-layer flash-memory devices, intelligent storage switch and two-layer, three layers of controller |
CN102122233A (en) * | 2010-01-08 | 2011-07-13 | 群联电子股份有限公司 | Method for managing block and writing data, flash memory storage system and controller |
CN103425600A (en) * | 2013-08-23 | 2013-12-04 | 中国人民解放军国防科学技术大学 | Address mapping method for flash translation layer of solid state drive |
Also Published As
Publication number | Publication date |
---|---|
CN107807786A (en) | 2018-03-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100923990B1 (en) | Computing system based on characteristcs of flash storage | |
US6704852B2 (en) | Control device applicable to flash memory card and method for building partial lookup table | |
US11620066B2 (en) | Storage device with expandible logical address space and operating method thereof | |
JP2009048613A (en) | Solid state memory, computer system including the same, and its operation method | |
US10909031B2 (en) | Memory system and operating method thereof | |
US20190317892A1 (en) | Memory system, data processing system, and operating method of memory system | |
JP2010146326A (en) | Storage device, method of controlling same, and electronic device using storage device | |
KR20200022641A (en) | Data Storage Device and Operation Method Thereof, Storage System Having the Same | |
KR20170051563A (en) | Data storage device and operating method thereof | |
CN110908594A (en) | Operation method of memory system and memory system | |
KR20120055707A (en) | Memory system | |
KR20200121645A (en) | Controller, operating method thereof and memory system | |
KR20210051921A (en) | Memory system and operating method thereof | |
TW201928960A (en) | Memory system and operating method thereof | |
US9904622B2 (en) | Control method for non-volatile memory and associated computer system | |
TWI749903B (en) | Flash memory controller, memory device and method for accessing flash memory module | |
US20230418485A1 (en) | Host device, storage device, and electronic device | |
US20220382454A1 (en) | Storage device and method of operating the same | |
CN107807786B (en) | Storage device and data mapping method thereof | |
TWI616755B (en) | Storage device and associated data mapping method | |
KR20180121733A (en) | Data storage device and operating method thereof | |
US20230305743A1 (en) | Memory controller and memory system including the same | |
TWI434284B (en) | Method of active flash management, and associated memory device and controller thereof | |
US20230342046A1 (en) | Memory controller and memory system including the same | |
US11188265B2 (en) | Method for performing storage space management, associated data storage device, and controller thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |