[go: up one dir, main page]

CN107329909B - A data management method and device - Google Patents

A data management method and device Download PDF

Info

Publication number
CN107329909B
CN107329909B CN201710511787.1A CN201710511787A CN107329909B CN 107329909 B CN107329909 B CN 107329909B CN 201710511787 A CN201710511787 A CN 201710511787A CN 107329909 B CN107329909 B CN 107329909B
Authority
CN
China
Prior art keywords
metadata
block address
logical block
data
mapping
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
Application number
CN201710511787.1A
Other languages
Chinese (zh)
Other versions
CN107329909A (en
Inventor
苗森
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710511787.1A priority Critical patent/CN107329909B/en
Publication of CN107329909A publication Critical patent/CN107329909A/en
Application granted granted Critical
Publication of CN107329909B publication Critical patent/CN107329909B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0866Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches for peripheral storage systems, e.g. disk cache
    • G06F12/0873Mapping of cache memory to specific storage devices or parts thereof
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data management method, which comprises the following steps: establishing a first mapping for metadata, allocating a first logic block address, and taking the first logic block address as first metadata; establishing a second mapping for the first metadata, allocating a second logical block address, saving the second logical block address at a set position, and taking the second logical block address as second metadata; and processing the second metadata as user data. By the method, the problem of complexity of using two sets of flows because the system treats the user data and the metadata differently is solved. In addition, due to the introduction of multi-level mapping, the data searching efficiency can be improved, and the data amount written and stored when the system is powered off is reduced. The application also discloses a data management device, which has the beneficial effects.

Description

一种数据管理方法及装置A data management method and device

技术领域technical field

本申请涉及数据管理领域,特别涉及一种数据管理方法及装置。The present application relates to the field of data management, and in particular, to a data management method and device.

背景技术Background technique

生活中,硬盘已经随处可见。它是电脑主要的存储媒介之一,由一个或者多个铝制或者玻璃制的碟片组成。其主要分为固态硬盘(Solid State Drive,简称SSD)、机械硬盘(Hard Disk Drive,简称HDD)、混合硬盘(Hybrid Hard Drive,简称HHD)。而固态硬盘又称为电子硬盘或者固态电子盘,是由控制单元和固态存储单元组成的硬盘,固态存储单元一般是DRAM(Dynamic Random Access Memory,中文名称:动态随机存取存储器)或者Flash(中文名称:闪存)芯片。Hard drives can be seen everywhere in life. It is one of the main storage media for computers and consists of one or more aluminum or glass discs. It is mainly divided into Solid State Drive (SSD), Hard Disk Drive (HDD), and Hybrid Hard Drive (HHD). The solid-state hard disk, also known as electronic hard disk or solid-state electronic disk, is a hard disk composed of a control unit and a solid-state storage unit. The solid-state storage unit is generally DRAM (Dynamic Random Access Memory, Chinese name: dynamic random access memory) or Flash (Chinese Name: flash memory) chip.

SSD在读取过程中的数据称为用户数据(host data),而只有这些数据是不够的,需要用另一种数据对齐进行管理,这种数据称之为元数据(meta data),常见的元数据有l2p表,trim bitmap(块位图)和super block info(超级块包信息)等。The data in the reading process of SSD is called user data (host data), and only this data is not enough, it needs to be managed with another data alignment, this kind of data is called meta data (meta data), common Metadata includes l2p table, trim bitmap (block bitmap) and super block info (super block package information).

目前对于用户数据和元数据的管理,业界一般是区分对待的,也就是用户数据使用一套专门的读、写和GC(Garbage Collection,中文名称:垃圾回收)方案,而元数据使用另一套完全不同的读、写和GC方案。这种做法由于采用了两套完全不同的方案,显得逻辑极其复杂,而且开发和测试的难度也相当大。At present, the management of user data and metadata is generally treated differently in the industry, that is, user data uses a set of special read, write and GC (Garbage Collection, Chinese name: garbage collection) schemes, while metadata uses another set Completely different read, write and GC schemes. This approach is extremely complicated in logic due to the use of two completely different solutions, and the development and testing are also quite difficult.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本申请提供了一种数据管理方法和装置,解决了系统因区别对待用户数据和元数据而使用两套流程的复杂度问题,将用户数据和元数据当成同一种数据类型进行处理的方法,在读写和GC等流程上使用相同的流程。该方法如下:In view of this, the present application provides a data management method and device, which solves the complexity problem of using two sets of processes for the system to treat user data and metadata differently, and treats user data and metadata as the same data type for processing. method, using the same process for processes such as read and write and GC. The method is as follows:

本发明所提供的技术方案如下:The technical scheme provided by the present invention is as follows:

为元数据建立第一映射,分配第一逻辑区块地址,并将所述第一逻辑区块地址作为第一元数据;establishing a first mapping for the metadata, assigning a first logical block address, and using the first logical block address as the first metadata;

为所述第一元数据建立第二映射,分配第二逻辑区块地址,并将所述第二逻辑区块地址保存于设定位置,将所述第二逻辑区块地址作为第二元数据;Create a second mapping for the first metadata, assign a second logical block address, save the second logical block address in a set location, and use the second logical block address as the second metadata ;

将所述第二元数据作为用户数据进行处理。The second metadata is processed as user data.

其中,将所述第二元数据作为用户数据处理包括:Wherein, processing the second metadata as user data includes:

在上电时读出所述第二元数据,通过所述第二元数据恢复所述第一元数据。The second metadata is read out at power-on, and the first metadata is restored through the second metadata.

其中,将讲述第二元数据作为用户数据进行处理包括:Wherein, processing the second metadata as user data includes:

刷写所述第二元数据到flash,将所述第二元数据保存到flash的相应位置。The second metadata is flashed to the flash, and the second metadata is saved to the corresponding position of the flash.

其中,所述元数据包括l2p表或trim bitmap或super block info。Wherein, the metadata includes l2p table or trim bitmap or super block info.

其中,将所述第二逻辑区块地址保存于设定位置包括:Wherein, saving the second logical block address in the set position includes:

将所述第二逻辑区块地址按顺序存储在所述第一元数据之后。The second logical block address is sequentially stored after the first metadata.

本申请还提供一种数据管理的装置,所述装置包括:The present application also provides an apparatus for data management, the apparatus comprising:

第一元数据模块,用于为元数据建立第一映射,分配第一逻辑区块地址,并将所述第一逻辑区块地址作为第一元数据;a first metadata module for establishing a first mapping for metadata, assigning a first logical block address, and using the first logical block address as the first metadata;

第二元数据模块,为所述第一元数据建立第二映射,分配第二逻辑区块地址,将所述第二逻辑区块地址保存于设定位置,并将所述第二逻辑区块地址作为第二元数据;The second metadata module establishes a second mapping for the first metadata, allocates a second logical block address, saves the second logical block address in a set location, and stores the second logical block address address as second metadata;

数据管理模块,用于将所述第二元数据作为用户数据进行处理。A data management module, configured to process the second metadata as user data.

其中,所述数据管理模块包括:Wherein, the data management module includes:

数据恢复子模块,用于在上电时读出所述第二元数据,并通过所述第二元数据恢复所述第一元数据。A data recovery submodule, configured to read out the second metadata when powered on, and recover the first metadata through the second metadata.

其中,所述数据管理模块包括:Wherein, the data management module includes:

数据刷写子模块,用于刷写所述第二元数据到flash,并将所述第二元数据保存到flash的相应位置。The data flashing submodule is used for flashing the second metadata to the flash, and saving the second metadata to the corresponding position of the flash.

其中,所述数据存储模块具体为将所述第二逻辑区块地址按顺序存放在第一元数据之后的模块。The data storage module is specifically a module that stores the second logical block address after the first metadata in sequence.

本申请通过引入第一映射和第二映射组成的二级映射,使得系统将meta data和host data当成同一种数据类型进行处理,解决了现有技术中系统因区别处理host data和meta data而使用两套流程的复杂度问题,而且因为二级映射,提高了host data的查找效率。而且本申请在下电时只需要保存该多级映射,也就是一个索引表,不需要保存全部数据,减少了系统下电时保存的数据量。本申请还提供了一种数据管理装置,具有上述有益效果,此处不再赘述。In the present application, by introducing a secondary mapping composed of a first mapping and a second mapping, the system can process meta data and host data as the same data type, which solves the problem that the system in the prior art uses different processing host data and meta data. The complexity of the two sets of processes, and because of the secondary mapping, the search efficiency of host data is improved. Moreover, the present application only needs to save the multi-level mapping, that is, an index table, when the system is powered off, and does not need to save all the data, which reduces the amount of data saved when the system is powered off. The present application also provides a data management device, which has the above beneficial effects, which will not be repeated here.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts.

图1为本申请实施例所提供的数据管理方法流程图;1 is a flowchart of a data management method provided by an embodiment of the present application;

图2为本申请实施例所提供的第一种映射关系示意图;2 is a schematic diagram of a first mapping relationship provided by an embodiment of the present application;

图3为本申请实施例所提供的第二种映射关系示意图;3 is a schematic diagram of a second mapping relationship provided by an embodiment of the present application;

图4为本申请实施例所提供的数据管理装置结构示意图。FIG. 4 is a schematic structural diagram of a data management apparatus provided by an embodiment of the present application.

具体实施方式Detailed ways

为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments It is a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

请参考图1,下面介绍本申请的第一实施例:Please refer to FIG. 1 , the first embodiment of the present application is described below:

S101:为元数据建立第一映射,分配第一逻辑区块地址,并将所述第一逻辑区块地址作为第一元数据;S101: establish a first mapping for metadata, allocate a first logical block address, and use the first logical block address as the first metadata;

其中,元数据的形式种类有很多,例如l2p表、trim bitmap和super block info等,当然还有其它类型的元数据,在此不一一赘述。Among them, there are many types of metadata, such as l2p table, trim bitmap, super block info, etc. Of course, there are other types of metadata, which will not be repeated here.

其中,第一映射可以有多种形式,可以是表、图、文,也可以是其他形式,本申请不限定映射形式。第一映射可以存放在super block的16K空间中,由Control Mananger(控制管理器)模块在上电初始后立即读出。也可以存放在其他设定位置,本申请在此不做限定。所谓第一映射,指的是元数据的逻辑区块地址和物理区块地址的对应关系。The first mapping may have various forms, which may be tables, figures, texts, or other forms, and the application does not limit the mapping forms. The first map can be stored in the 16K space of the super block, and is read out by the Control Mananger module immediately after the initial power-on. It can also be stored in other setting positions, which is not limited in this application. The so-called first mapping refers to the correspondence between the logical block address and the physical block address of the metadata.

第一逻辑区块地址指的是元数据在系统中的位置,读数据的时候需要查找这个逻辑区块地址对应的物理区块地址。The first logical block address refers to the location of the metadata in the system. When reading data, it is necessary to search for the physical block address corresponding to the logical block address.

第一元数据通常指的就是该第一逻辑区块地址,也可以将第一逻辑区块地址与元数据合在一起统称为第一元数据。The first metadata generally refers to the first logical block address, and the first logical block address and metadata may also be collectively referred to as the first metadata.

S102:为所述第一元数据建立第二映射,分配第二逻辑区块地址,并将所述第二逻辑区块地址保存于设定位置,将所述第二逻辑区块地址作为第二元数据;S102: Establish a second mapping for the first metadata, assign a second logical block address, save the second logical block address in a set location, and use the second logical block address as the second logical block address metadata;

同样的,第二映射和第一映射类似,也可以有多种形式,此处不再赘述。Similarly, the second mapping is similar to the first mapping, and may also have various forms, which will not be repeated here.

对S101中得到的第一元数据再建立一个映射,即第二映射,并为其分配第二逻辑区块地址。所谓第二映射,指的是第一元数据的逻辑区块地址和物理区块地址的对应关系。Another mapping, that is, a second mapping, is established for the first metadata obtained in S101, and a second logical block address is assigned to it. The so-called second mapping refers to the correspondence between the logical block address and the physical block address of the first metadata.

逻辑区块地址可以保存于第二映射之后,也可以按顺序存储在第一元数据之后,本申请在此不做限定。The logical block address may be stored after the second mapping, or may be sequentially stored after the first metadata, which is not limited in this application.

这里的第二元数据和第一元数据都是“元数据”,只是其内容上有所区别。这里的“元数据”意即指它不是用户数据,区别于用户数据而言。第一映射是元数据的物理区块地址和逻辑区块地址之间对应关系的映射,第二映射为第一元数据的物理区块地址和逻辑区块地址之间对应关系的映射。The second metadata and the first metadata here are both "metadata", but their contents are different. "Metadata" here means that it is not user data, and is different from user data. The first mapping is the mapping of the correspondence between the physical block addresses and the logical block addresses of the metadata, and the second mapping is the mapping of the correspondence between the physical block addresses and the logical block addresses of the first metadata.

S103:将所述第二元数据作为用户数据进行处理。S103: Process the second metadata as user data.

下电时将第二元数据执行和用户数据一样的写(host write)流程,上电恢复时将第二元数据执行和用户数据一样的读(host read)流程。其中,读流程是指在上电时读出所述第二元数据,通过所述第二元数据恢复所述第一元数据。GC(Gabage Collection)流程,GC流程是将几个Block(区块)中的有效数据集中搬到一个新的Block上,再把这几个Block擦除掉,产生新的可用的Block。When the power is turned off, the second metadata is executed in the same write (host write) process as the user data, and when the power is restored, the second metadata is executed in the same read (host read) process as the user data. Wherein, the read process refers to reading the second metadata at power-on, and restoring the first metadata through the second metadata. GC (Gabage Collection) process, the GC process is to move the valid data in several blocks (blocks) to a new block, and then erase these blocks to generate new available blocks.

基于上述技术方案,本申请实施例提供的数据管理方法,对第一元数据建立二级映射,将元数据当做用户数据处理,解决了现有技术中区分用户数据和元数据而使用两套流程的复杂方法,大大降低了开发和测试的难度。Based on the above technical solutions, the data management method provided by the embodiments of the present application establishes a secondary mapping for the first metadata, and treats the metadata as user data, which solves the problem of using two sets of processes to distinguish user data and metadata in the prior art The complex method greatly reduces the difficulty of development and testing.

下面参见图2,图2为本发明实施例所提供的数据管理方法时的映射关系图。在上述实施例的基础上,将所述元数据具体为l2p表,映射的形式为映射表。用户数据在系统中的存放位置对于系统而言使用lba(Logical Block Address,英文简称LBA或lba,中文名称:逻辑区块地址)来标识的,对于SSD 而言是通过pba(Physics Block Address,英文简称:PBA或pba,中文简称:物理区块地址)去查找其在cache(中文名称:高速缓冲存储器)或flash中的位置,因此在SSD中需要有一张映射表来存储lba到pba的映射,这就是l2p表。Referring to FIG. 2 below, FIG. 2 is a mapping relationship diagram of a data management method provided by an embodiment of the present invention. On the basis of the above embodiment, the metadata is specifically an l2p table, and the mapping form is a mapping table. The storage location of user data in the system is identified by lba (Logical Block Address, English abbreviation LBA or lba, Chinese name: logical block address) for the system, and pba (Physics Block Address, English name for SSD) Abbreviation: PBA or pba, Chinese abbreviation: physical block address) to find its location in the cache (Chinese name: cache memory) or flash, so there needs to be a mapping table in the SSD to store the mapping from lba to pba, This is the l2p table.

具体方法如下:The specific method is as follows:

S201:系统运行时建立一个Buffer(缓冲器),用于保存delta数据。S201: A Buffer (buffer) is established when the system is running to save the delta data.

这里的delta数据一般是元数据的delta数据,如l2p的delta数据,或者trimbitmap(块位图)或superblock info(超级块包)。The delta data here is generally the delta data of metadata, such as l2p delta data, or trimbitmap (block bitmap) or superblock info (super block package).

S202:当buffer满了之后,开始刷写flash,当flash同样饱和之后,刷一定数量的base,这些刷写过程中生成的数据也就是一级映射。S202: When the buffer is full, start to flash the flash. When the flash is also saturated, flash a certain number of bases. The data generated during the flashing process is also the first-level mapping.

这些刷写过程中会产生delta数据,通过delta数据可以知道其对应的数据存放位置。例如刷写flash时产生的delta1数据,则通过该delta1数据可以找到对应的存储器为flash,这样产生的映射就是一级映射。Delta data will be generated during the flashing process, and the corresponding data storage location can be known through the delta data. For example, the delta1 data generated when flashing is written, the corresponding memory can be found to be flash through the delta1 data, and the resulting mapping is a first-level mapping.

S203:系统给一级映射分配一个新的lba,将新的lba保存到设定位置。S203: The system allocates a new lba to the first-level mapping, and saves the new lba to the set position.

系统给一级映射分配一个lba,该lba可以放在l2p表中,也可以放在l2p表之后顺序排放,当然也可以但不建议放在其他位置。如图2所示便是存放于相应的Delta数据之后。这样lba-l2P表的映射又构成了一个新的“l2p表”,一个新的元数据,它就是二级映射。The system allocates an lba to the first-level mapping. The lba can be placed in the l2p table, or placed in the l2p table in order. Of course, it can also be placed in other locations, but it is not recommended. As shown in Figure 2, it is stored after the corresponding Delta data. In this way, the mapping of the lba-l2P table constitutes a new "l2p table", a new metadata, which is the secondary mapping.

S204:在下电时将新的“l2p表”以和用户数据同样的写流程刷写到flash。在上电时,使用和用户数据同样的读流程恢复该新的元数据。S204: When the power is turned off, the new "l2p table" is written to the flash with the same writing process as the user data. On power-up, the new metadata is restored using the same read process as user data.

若将一、二级映射对应的数据分别称为一、二级数据,那么在上电时,读出二级数据数据后使用二级数据恢复一级映射表对应的一级数据,再利用一级数据恢复base data。If the data corresponding to the primary and secondary mappings are called primary and secondary data respectively, then when the power is turned on, after reading the secondary data data, use the secondary data to restore the primary data corresponding to the primary mapping table, and then use the secondary data to restore the primary data corresponding to the primary mapping table. Level data restores base data.

此外,因为建立了二级映射,系统在下电时不需要保存全部的数据,只要保存一、二级映射即可,减少了保存的数据量。而且,二级映射表可以放在super block的16k空间中,由Control Mananger模块在上电初始后立即读出。In addition, because the secondary mapping is established, the system does not need to save all the data when the system is powered off, only the primary and secondary mappings can be saved, which reduces the amount of data saved. Moreover, the secondary mapping table can be placed in the 16k space of the super block and read out by the Control Mananger module immediately after the initial power-on.

以8TB的磁盘容量为例计算,每个partition(分区)的容量是2TB,为计算方便暂时忽略OP(Over-provisioning,中文名称:预留空间)等。Taking the 8TB disk capacity as an example, the capacity of each partition (partition) is 2TB, and OP (Over-provisioning, Chinese name: reserved space) is temporarily ignored for the convenience of calculation.

图2中各段对应的逻辑空间为:The logical space corresponding to each segment in Figure 2 is:

用户数据2TBUser data 2TB

元数据2GBMetadata 2GB

Delta数据2GB*1/3=2/3GBDelta data 2GB*1/3=2/3GB

一级映射(2GB+2/3GB)*4/4KB=8/3MBLevel 1 mapping (2GB+2/3GB)*4/4KB=8/3MB

对应的LBA范围为:The corresponding LBA ranges are:

用户LBA范围:[0,512M-1]User LBA range: [0,512M-1]

元数据LBA范围:[512M,512M+512K-1]Metadata LBA range: [512M, 512M+512K-1]

Delta数据LBA范围:[512M+512K,512M+4/3*512K-1]Delta data LBA range: [512M+512K, 512M+4/3*512K-1]

一级映射LBA范围:[512M+4/3*512K,512M+4/3*512K+2/3K-1]Level 1 mapping LBA range: [512M+4/3*512K, 512M+4/3*512K+2/3K-1]

二级映射LBA范围:大于512M+4/3*512K+2/3KSecondary mapping LBA range: greater than 512M+4/3*512K+2/3K

参考图3,当第一映射,第二映射已经如上述实施例中方法建立并保存完毕时,根据数据量的大小可以建立更多级的映射,利用第二级的l2p表建立第三级映射,利用第三级的l2p表建立第四级映射……各级映射按顺序存放。当然,这里的l2p表只是元数据的一种,根据实际情况也可以利用其它元数据。每一级映射如图2所示按顺序存放。上电时,利用最后一级映射对应的数据恢复上一级数据,逐级恢复,多级索引。Referring to Fig. 3, when the first mapping and the second mapping have been established and saved as in the above-mentioned embodiment, more levels of mapping can be established according to the size of the data volume, and the third-level mapping can be established by using the l2p table of the second level. , use the third-level l2p table to establish the fourth-level mapping... The mappings at all levels are stored in order. Of course, the l2p table here is only one kind of metadata, and other metadata can also be used according to the actual situation. Each level of mapping is stored in order as shown in Figure 2. When powered on, use the data corresponding to the last level of mapping to restore the data of the previous level, restore level by level, and use multi-level indexing.

由于本实施例的方法部分与上述实施例相互对应,因此本实施例的方法部分请参见上述实施例的描述,这里暂不赘述。Since the method part of this embodiment corresponds to the above-mentioned embodiment, reference is made to the description of the above-mentioned embodiment for the method part of this embodiment, which will not be repeated here.

下面请参见图4,图4为本申请所提供的一种数据管理装置结构示意图;该装置可以包括:Please refer to FIG. 4 below, which is a schematic structural diagram of a data management device provided by the application; the device may include:

第一元数据模块101,用于为元数据建立第一映射,分配第一逻辑区块地址,并将所述第一逻辑区块地址作为第一元数据;The first metadata module 101 is used for establishing a first mapping for metadata, assigning a first logical block address, and using the first logical block address as the first metadata;

第二元数据模块102,为所述第一元数据建立第二映射,分配第二逻辑区块地址,将所述第二逻辑区块地址保存于设定位置,并将所述第二逻辑区块地址作为第二元数据;The second metadata module 102 establishes a second mapping for the first metadata, allocates a second logical block address, saves the second logical block address in a set location, and stores the second logical block address block address as second metadata;

数据管理模块103,用于将所述第二元数据作为用户数据进行处理。The data management module 103 is configured to process the second metadata as user data.

基于上述实施例,数据管理模块103还可以包括一个数据刷写子模块201 和一个数据恢复子模块202。Based on the above embodiment, the data management module 103 may further include a data refresh submodule 201 and a data recovery submodule 202 .

其中,数据刷写子模块201用于刷写所述第二元数据到flash,将所述第二元数据保存到flash的相应位置。The data flashing sub-module 201 is used for flashing the second metadata to the flash, and saving the second metadata to a corresponding position of the flash.

数据恢复子模块202用于通过所述第二元数据恢复所述第一元数据。The data recovery sub-module 202 is configured to recover the first metadata through the second metadata.

即对应的工作流程为:That is, the corresponding workflow is:

S301:第一元数据模块对元数据建立第一映射,分配第一逻辑区块地址,将所述第一逻辑区块地址作为第一元数据。S301: The first metadata module establishes a first mapping for metadata, allocates a first logical block address, and uses the first logical block address as the first metadata.

通常,对于有板上DRAM(动态随机存取存储器)的SSD来说,只要查找DRAM中的第一映射,获取到物理区块地址后访问flash从到得到host data;对于Sandforce(一种控制芯片)的SSD来说,它需要先查看映射关系是否存放在RAM(随机存储存储器)中,所在,则直接根据映射关系读取host data, 若不在,则需要将映射关系从flash中读取出来在读取hostdata。元数据可以是l2p表、superblock info、trim bitmap等。Usually, for an SSD with on-board DRAM (dynamic random access memory), it is only necessary to search for the first mapping in the DRAM, and after obtaining the physical block address, access the flash to obtain host data; for Sandforce (a control chip) ), it needs to check whether the mapping relationship is stored in RAM (random storage memory) first, then read the host data directly according to the mapping relationship, if not, you need to read the mapping relationship from the flash. Read hostdata. Metadata can be l2p tables, superblock info, trim bitmap, etc.

S302:第二元数据模块对第一元数据建立第二映射,分配第二逻辑区块地址,将第二逻辑区块地址保存于设定位置,将第二逻辑区块地址作为第二元数据。S302: The second metadata module establishes a second mapping for the first metadata, assigns a second logical block address, saves the second logical block address in a set location, and uses the second logical block address as the second metadata .

过程同S301中类似,不过所述设定位置可以按顺序存放在第一元数据之后,也可以放在第一元数据中的某个位置,本申请在此不做限定。数据存储模块还负责保存第二映射,例如可以保存在super block的16k空间中,这样在上电初始后可以由Control Manager模块立即读出。当然也可以存放在其他位置。The process is similar to that in S301, but the set position may be stored in sequence after the first metadata, or may be stored in a certain position in the first metadata, which is not limited in this application. The data storage module is also responsible for saving the second map, for example, it can be stored in the 16k space of the super block, so that it can be read by the Control Manager module immediately after the initial power-on. Of course, it can also be stored in other locations.

S303:数据管理模块以和用户数据同样的流程对第二元数据进行处理。S303: The data management module processes the second metadata in the same process as the user data.

上述过程包括下电时数据管理模块的数据刷写子模块201以和用户数据写操作同样的方式对第二元数据进行处理。刷写过程包括刷写所述第二元数据到flash,将所述第二元数据保存到flash的相应位置。上电时数据管理模块中的数据恢复子模块202通过第二元数据恢复第一元数据,通过第一元数据获得需要的用户数据位置并获取用户数据。还可以包括一个GC单元,用于数据的回收处理。若有按上述流程生成的第三元数据,则通过第三元数据恢复第二元数据、第二元数据恢复第一元数据这种逐级恢复的方式。The above process includes that the data refresh sub-module 201 of the data management module processes the second metadata in the same manner as the user data write operation when the power is turned off. The flashing process includes flashing the second metadata to the flash, and saving the second metadata to a corresponding position of the flash. When powered on, the data recovery sub-module 202 in the data management module recovers the first metadata through the second metadata, obtains the required user data location and obtains the user data through the first metadata. It can also include a GC unit for data recovery processing. If there is third metadata generated according to the above process, the second metadata is restored through the third metadata, and the first metadata is restored through the second metadata.

以上对本申请所提供的一种数据管理方法及装置进行了详细介绍。说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的系统而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也落入本申请权利要求的保护范围内。The data management method and device provided by the present application have been described in detail above. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant part can be referred to the description of the method. It should be pointed out that for those of ordinary skill in the art, without departing from the principles of the present application, several improvements and modifications can also be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

还需要说明的是,在本说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities or operations. There is no such actual relationship or sequence between operations. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element

说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments can be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant part can be referred to the description of the method.

专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的子模块及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Professionals may further realize that the sub-modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software or a combination of the two, in order to clearly illustrate the differences between hardware and software. Interchangeability, the above description has generally described the components and steps of each example in terms of function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of the present invention.

Claims (7)

1.一种数据管理方法,其特征在于,所述方法包括:1. a data management method, is characterized in that, described method comprises: 为元数据建立第一映射,分配第一逻辑区块地址,并将所述第一逻辑区块地址作为第一元数据;establishing a first mapping for the metadata, assigning a first logical block address, and using the first logical block address as the first metadata; 为所述第一元数据建立第二映射,分配第二逻辑区块地址,将所述第二逻辑区块地址保存于设定位置,将所述第二逻辑区块地址作为第二元数据;establishing a second mapping for the first metadata, assigning a second logical block address, saving the second logical block address in a set location, and using the second logical block address as the second metadata; 将所述第二元数据作为用户数据进行处理;processing the second metadata as user data; 其中,将所述第二元数据作为用户数据处理包括:Wherein, processing the second metadata as user data includes: 在上电时读出所述第二元数据,通过所述第二元数据恢复所述第一元数据。The second metadata is read out at power-on, and the first metadata is restored through the second metadata. 2.根据权利要求1的方法,其特征在于,将讲述第二元数据作为用户数据进行处理包括:2. The method according to claim 1, wherein processing the narration second metadata as user data comprises: 刷写所述第二元数据到flash,将所述第二元数据保存到flash的相应位置。The second metadata is flashed to the flash, and the second metadata is saved to the corresponding position of the flash. 3.根据权利要求1的方法,其特征在于,所述元数据包括l2p表或trim bitmap或superblock info。3. The method according to claim 1, wherein the metadata comprises l2p table or trim bitmap or superblock info. 4.根据权利要求1的方法,其特征在于,将所述第二逻辑区块地址保存于设定位置包括:4. The method according to claim 1, wherein storing the second logical block address in a set position comprises: 将所述第二逻辑区块地址按顺序存储在所述第一元数据之后。The second logical block address is sequentially stored after the first metadata. 5.一种数据管理的装置,其特征在于,所述装置包括:5. An apparatus for data management, wherein the apparatus comprises: 第一元数据模块,用于为元数据建立第一映射,分配第一逻辑区块地址,并将所述第一逻辑区块地址作为第一元数据;a first metadata module for establishing a first mapping for metadata, assigning a first logical block address, and using the first logical block address as the first metadata; 第二元数据模块,为所述第一元数据建立第二映射,分配第二逻辑区块地址,将所述第二逻辑区块地址保存于设定位置,并将所述第二逻辑区块地址作为第二元数据;The second metadata module establishes a second mapping for the first metadata, allocates a second logical block address, saves the second logical block address in a set location, and stores the second logical block address address as second metadata; 数据管理模块,用于将所述第二元数据作为用户数据进行处理;a data management module for processing the second metadata as user data; 其中,所述数据管理模块包括:Wherein, the data management module includes: 数据恢复子模块,用于在上电时读出所述第二元数据,并通过所述第二元数据恢复所述第一元数据。A data recovery submodule, configured to read out the second metadata when powered on, and recover the first metadata through the second metadata. 6.根据权利要求5所述的装置,其特征在于,所述数据管理模块包括:6. The apparatus according to claim 5, wherein the data management module comprises: 数据刷写子模块,用于刷写所述第二元数据到flash,将所述第二元数据保存到flash的相应位置。The data flashing submodule is used for flashing the second metadata to the flash, and saving the second metadata to the corresponding position of the flash. 7.根据权利要求6所述的装置,其特征在于,还包括:7. The apparatus of claim 6, further comprising: 数据存储模块,用于将所述第二逻辑区块地址按顺序存放在第一元数据之后。A data storage module, configured to store the second logical block address after the first metadata in sequence.
CN201710511787.1A 2017-06-27 2017-06-27 A data management method and device Active CN107329909B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710511787.1A CN107329909B (en) 2017-06-27 2017-06-27 A data management method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710511787.1A CN107329909B (en) 2017-06-27 2017-06-27 A data management method and device

Publications (2)

Publication Number Publication Date
CN107329909A CN107329909A (en) 2017-11-07
CN107329909B true CN107329909B (en) 2020-07-07

Family

ID=60197207

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710511787.1A Active CN107329909B (en) 2017-06-27 2017-06-27 A data management method and device

Country Status (1)

Country Link
CN (1) CN107329909B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108920613A (en) * 2018-06-28 2018-11-30 郑州云海信息技术有限公司 A kind of metadata management method, system and equipment and storage medium
CN109086222B (en) * 2018-07-24 2023-08-25 浪潮电子信息产业股份有限公司 Data recovery method of solid state disk and solid state disk
CN109460186A (en) * 2018-11-02 2019-03-12 深圳忆联信息系统有限公司 A kind of method and its system promoting solid state hard disk reading performance
CN110673984B (en) * 2019-09-10 2022-12-27 苏州浪潮智能科技有限公司 Trim table data storage and recovery method, device and related equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103049390A (en) * 2012-12-14 2013-04-17 华为技术有限公司 Applied metadata processing method and storing system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101794261B (en) * 2009-11-24 2013-05-08 深圳市硅格半导体有限公司 Mapping table data recovery method and device
US8886870B2 (en) * 2010-05-25 2014-11-11 Marvell World Trade Ltd. Memory access table saving and restoring system and methods
US8341340B2 (en) * 2010-07-21 2012-12-25 Seagate Technology Llc Multi-tier address mapping in flash memory
US8924832B1 (en) * 2012-06-26 2014-12-30 Western Digital Technologies, Inc. Efficient error handling mechanisms in data storage systems
CN104461391B (en) * 2014-12-05 2019-08-02 上海宝存信息科技有限公司 A kind of storage device metadata management approach and system
KR20160070920A (en) * 2014-12-10 2016-06-21 에스케이하이닉스 주식회사 Memory system including semiconductor memory device and controller having map table and operating method thereof

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103049390A (en) * 2012-12-14 2013-04-17 华为技术有限公司 Applied metadata processing method and storing system

Also Published As

Publication number Publication date
CN107329909A (en) 2017-11-07

Similar Documents

Publication Publication Date Title
TWI739859B (en) Method of operating storage device managing multi-namespace
US11048624B2 (en) Methods for multi-stream garbage collection
US10324832B2 (en) Address based multi-stream storage device access
US10452562B2 (en) File access method and related device
US9342256B2 (en) Epoch based storage management for a storage device
EP2631916A1 (en) Data deletion method and device
CN107329909B (en) A data management method and device
US11620066B2 (en) Storage device with expandible logical address space and operating method thereof
TW201931132A (en) Method for managing flash memory module and associated flash memory controller and electronic device
US11175850B2 (en) Selective erasure of data in a SSD
CN113220242B (en) Storage management method, apparatus, and computer readable medium
US9558108B2 (en) Half block management for flash storage devices
US11010079B2 (en) Concept for storing file system metadata within solid-stage storage devices
US20140297921A1 (en) Method of Partitioning Physical Block and Memory System Thereof
KR20130032603A (en) Method and apparatus for storing data in flash memory using address mapping with various block sizes
CN105426127A (en) File storage method and apparatus for distributed cluster system
US20150324281A1 (en) System and method of implementing an object storage device on a computer main memory system
US20130275655A1 (en) Memory management method and memory controller and memory storage device using the same
CN104536903A (en) Mixed storage method and system for conducting classified storage according to data attributes
CN105718206A (en) Flash translation layer capable of perceiving RAID (Redundant Array of Independent Disks) and implementation method thereof
CN103473266A (en) Solid state disk and method for deleting repeating data thereof
JP2007220107A (en) Apparatus and method for managing mapping information of nonvolatile memory
KR20140100113A (en) Storage device and data processing method thereof
US11372774B2 (en) Method and system for a solid state drive with on-chip memory integration
CN108664217B (en) A caching method and system for reducing write performance jitter of solid state disk storage system

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