Movatterモバイル変換


[0]ホーム

URL:


CN110007868B - A kind of SSD disk metadata storage method, device, controller and storage medium - Google Patents

A kind of SSD disk metadata storage method, device, controller and storage medium
Download PDF

Info

Publication number
CN110007868B
CN110007868BCN201910294458.5ACN201910294458ACN110007868BCN 110007868 BCN110007868 BCN 110007868BCN 201910294458 ACN201910294458 ACN 201910294458ACN 110007868 BCN110007868 BCN 110007868B
Authority
CN
China
Prior art keywords
metadata
capacity
block
saved
upper limit
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
CN201910294458.5A
Other languages
Chinese (zh)
Other versions
CN110007868A (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.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co LtdfiledCriticalSuzhou Inspur Intelligent Technology Co Ltd
Priority to CN201910294458.5ApriorityCriticalpatent/CN110007868B/en
Publication of CN110007868ApublicationCriticalpatent/CN110007868A/en
Application grantedgrantedCritical
Publication of CN110007868BpublicationCriticalpatent/CN110007868B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The application discloses a method for storing metadata of an SSD, which limits the capacity of the metadata stored in the SSD by an upper limit of a preferred capacity determined based on the required size, so that all blocks which can be used for storing the metadata are not in an occupied state due to no limitation, the quantity of blocks which are in the occupied state in a normalized mode is obviously reduced, other blocks are not in an unoccupied state, the abrasion degree of a corresponding storage medium is not increased, and the service life of the SSD is prolonged. The application also discloses an SSD disk metadata storage device, a controller and a computer readable storage medium, which have the beneficial effects.

Description

Translated fromChinese
一种SSD盘元数据存储方法、装置、控制器及存储介质A kind of SSD disk metadata storage method, device, controller and storage medium

技术领域technical field

本申请涉及固态硬盘数据存储技术领域,特别涉及一种SSD盘元数据存储方法、装置、控制器及计算机可读存储介质。The present application relates to the technical field of solid-state disk data storage, and in particular, to a method, device, controller, and computer-readable storage medium for storing metadata of an SSD disk.

背景技术Background technique

SSD(Solid State Disk,固态硬盘)是一种使用固态电子存储芯片阵列制成的硬盘,由于其相比于机械硬盘拥有更快的存取速度,被广泛应用在各行各业。SSD (Solid State Disk, solid-state drive) is a hard disk made of a solid-state electronic storage chip array, which is widely used in all walks of life due to its faster access speed than mechanical hard disks.

元数据,作为描述数据的数据,在SSD盘中也需要占用一定的存储空间,现今在将待保存元数据存储在SSD盘中时,会逐渐占用完所有可用于存储元数据的Block,举个例子,假设一共最多有100个Block可用于存储元数据,那么在SSD盘数据写入、擦除、再写入的过程中,这100个Block会逐渐全部被占用完,直到再次需要保存的元数据没有新Block可用时,会清空最先被占用的Block中保存的元数据以供再次写入。也就是说,在首次用完所有可用的Block后,之后需要保存的新元数据都将会采用新的覆盖旧的形式完成写入,而在此过程中,这100个Block都将常态化的处于占用状态,占用状态下将不断磨损存储介质,使得存储介质在长期不间断的磨损下,寿命快速缩短,进而增加更换成本,同时也为数据丢失埋下了隐患。Metadata, as the data describing data, also needs to occupy a certain amount of storage space in the SSD disk. Nowadays, when the metadata to be saved is stored in the SSD disk, all the blocks that can be used to store the metadata will gradually be used up. For example, For example, assuming that there are at most 100 blocks available for storing metadata, then in the process of writing, erasing, and rewriting SSD disk data, these 100 blocks will gradually be occupied until the metadata that needs to be saved again. When no new block is available for data, the metadata saved in the first occupied block will be emptied for rewriting. That is to say, after all available blocks are used up for the first time, the new metadata that needs to be saved will be written in the form of new overwriting the old ones, and during this process, these 100 blocks will be normalized. In the occupied state, the storage medium will be constantly worn out in the occupied state, so that the life of the storage medium will be shortened rapidly under the long-term uninterrupted wear and tear, thereby increasing the replacement cost, and at the same time laying a hidden danger for data loss.

因此,如何克服现有SSD盘在存储元数据时存在的上述缺陷,提供一种能够尽可能的减少存储介质磨损、延长SSD盘使用寿命的SSD盘元数据存储机制,是本领域技术人员亟待解决的问题。Therefore, how to overcome the above-mentioned defects existing in the existing SSD disks in storing metadata, and provide an SSD disk metadata storage mechanism that can reduce the wear and tear of the storage medium as much as possible and prolong the service life of the SSD disk, is an urgent solution for those skilled in the art. The problem.

发明内容SUMMARY OF THE INVENTION

本申请的目的在于提供一种SSD盘元数据存储方法、装置、控制器及计算机可读存储介质,旨在解决现有SSD盘在存储元数据时,由于不对需要使用的Block进行管理,使得所有可用于存储元数据的Block都将常态化的处于被占用状态,使得对应的存储介质会因为持续被占用而被持续磨损,最终使得该SSD盘的使用寿命快速降低的问题。The purpose of this application is to provide an SSD disk metadata storage method, device, controller and computer-readable storage medium, which aims to solve the problem that when the existing SSD disk stores metadata, because the blocks that need to be used are not managed, all the Blocks that can be used to store metadata will be normally occupied, so that the corresponding storage medium will continue to be worn out due to continuous occupancy, and eventually the service life of the SSD will be rapidly reduced.

为实现上述目的,本申请提供一种SSD盘元数据存储方法,该方法包括:To achieve the above purpose, the present application provides a method for storing metadata of an SSD disk, the method comprising:

根据目标SSD盘的总容量计算得到存储一份完整元数据的所需容量;Calculate the required capacity to store a complete metadata according to the total capacity of the target SSD;

根据所述所需容量确定所述目标SSD盘的优选容量上限,并将所述优选容量上限设置为所述目标SSD盘已占用列表的容量上限;其中,所述优选容量上限大于等于所述所需容量、小于所述目标SSD盘中可用于存储元数据的总容量,所述已占用列表用于存放存储有元数据的Block和统计各所述Block中存储的有效元数据大小;Determine the upper limit of the preferred capacity of the target SSD according to the required capacity, and set the upper limit of the preferred capacity as the upper limit of the capacity of the occupied list of the target SSD; wherein the upper limit of the preferred capacity is greater than or equal to the upper limit of the capacity The required capacity is less than the total capacity that can be used to store metadata in the target SSD disk, and the occupied list is used to store Blocks that store metadata and count the effective metadata size stored in each of the Blocks;

当接收到元数据保存请求时,根据所述元数据保存请求确定与待保存元数据对应的待保存容量,并根据已占用列表确定当前的已占用容量;When receiving the metadata storage request, determine the to-be-saved capacity corresponding to the to-be-saved metadata according to the metadata storage request, and determine the current occupied capacity according to the occupied list;

判断当前的已占用容量与所述待保存容量的和是否大于所述优选容量上限;Judging whether the sum of the current occupied capacity and the to-be-saved capacity is greater than the upper limit of the preferred capacity;

当大于所述优选容量上限时,将所述待保存元数据存储于从可用空Block池中选取出的可用空Block中,得到新Block,并使用所述新Block替换最早进入所述已占用列表的、与所述新Block中存储的有效元数据数一致的旧Block,且将所述旧Block清空后添加进所述可用空Block池。When it is greater than the upper limit of the preferred capacity, the metadata to be saved is stored in the available empty Block selected from the available empty Block pool, a new Block is obtained, and the new Block is used to replace the earliest entry into the occupied list The old Block that is consistent with the number of valid metadata stored in the new Block, and the old Block is emptied and added to the available empty Block pool.

可选的,根据所述所需容量确定所述目标SSD盘的优选容量上限,包括:Optionally, determining the upper limit of the preferred capacity of the target SSD according to the required capacity, including:

将所述所需容量设置为所述目标SSD盘的优选容量上限。The required capacity is set as the upper limit of the preferred capacity of the target SSD disk.

可选的,该SSD盘元数据存储方法还包括:Optionally, the SSD disk metadata storage method further includes:

当所述待保存元数据在保存至所述可用空Block过程中出现写失败时,重新选取另一个可用空Block保存出现所述写失败及之后的待保存元数据,并将出现所述写失败的Block标记为异常Block,并将所述异常Block作为临时Block添加进所述已占用列表。When the to-be-saved metadata fails to be written during the process of saving to the available empty Block, re-select another available empty Block to save the to-be-saved metadata in and after the write failure, and the write failure will occur The block is marked as an abnormal block, and the abnormal block is added to the occupied list as a temporary block.

可选的,在将所述待保存元数据存储于从可用空Block池中选取出的可用空Block中之前,还包括:Optionally, before the metadata to be saved is stored in the available empty Block selected from the available empty Block pool, it also includes:

获取所述可用空Block池中每个可用空Block的擦写次数;Obtain the number of times of erasing and writing of each available empty Block in the available empty Block pool;

对应的,将所述待保存元数据存储于从可用空Block池中选取出的可用空Block中,包括:Correspondingly, the metadata to be saved is stored in the available empty Block selected from the available empty Block pool, including:

将所述待保存元数据存储于所述可用空Block池中擦写次数最少的可用空Block中。The metadata to be saved is stored in the available empty Block with the least number of erasing and writing times in the available empty Block pool.

为实现上述目的,本申请还提供了一种SSD盘元数据存储装置,包括:In order to achieve the above purpose, the present application also provides an SSD disk metadata storage device, including:

基准所需容量计算单元,用于根据目标SSD盘的总容量计算得到存储一份完整元数据的所需容量;The benchmark required capacity calculation unit is used to calculate the required capacity to store a complete metadata according to the total capacity of the target SSD;

上限确定及设置单元,用于根据所述所需容量确定所述目标SSD盘的优选容量上限,并将所述优选容量上限设置为所述目标SSD盘已占用列表的容量上限;其中,所述优选容量上限大于等于所述所需容量、小于所述目标SSD盘中可用于存储元数据的总容量,所述已占用列表用于存放存储有元数据的Block和统计各所述Block中存储的有效元数据大小;an upper limit determination and setting unit, configured to determine the upper limit of the preferred capacity of the target SSD according to the required capacity, and set the upper limit of the preferred capacity as the upper limit of the capacity of the occupied list of the target SSD; wherein, the Preferably, the upper limit of the capacity is greater than or equal to the required capacity and less than the total capacity of the target SSD disk that can be used to store metadata. effective metadata size;

容量参数确定单元,用于当接收到元数据保存请求时,根据所述元数据保存请求确定与待保存元数据对应的待保存容量,并根据已占用列表确定当前的已占用容量;a capacity parameter determination unit, configured to determine the to-be-saved capacity corresponding to the to-be-saved metadata according to the metadata save request, and to determine the current occupied capacity according to the occupied list when a metadata save request is received;

容量判断单元,用于判断当前的已占用容量与所述待保存容量的和是否大于所述优选容量上限;a capacity judgment unit, configured to judge whether the sum of the current occupied capacity and the to-be-saved capacity is greater than the upper limit of the preferred capacity;

Block替换单元,用于当大于所述优选容量上限时,将所述待保存元数据存储于从可用空Block池中选取出的可用空Block中,得到新Block,并使用所述新Block替换最早进入所述已占用列表的、与所述新Block中存储的有效元数据数一致的旧Block,且将所述旧Block清空后添加进所述可用空Block池。A block replacement unit, configured to store the metadata to be saved in the available empty Block selected from the available empty Block pool when the upper limit of the preferred capacity is larger, obtain a new Block, and use the new Block to replace the oldest block Enter the old Block in the occupied list that is consistent with the number of valid metadata stored in the new Block, and add the old Block to the available empty Block pool after clearing the old Block.

可选的,所述优选容量上限确定及设置单元包括:Optionally, the preferred capacity upper limit determination and setting unit includes:

最优容量上限设置子单元,用于将所述所需容量设置为所述目标SSD盘的优选容量上限。The optimal capacity upper limit setting subunit is used to set the required capacity as the preferred capacity upper limit of the target SSD disk.

可选的,该SSD盘元数据存储装置还包括:Optionally, the SSD disk metadata storage device further includes:

写失败处理单元,用于当所述待保存元数据在保存至所述可用空Block过程中出现写失败时,重新选取另一个可用空Block保存出现所述写失败及之后的待保存元数据,并将出现所述写失败的Block标记为异常Block,并将所述异常Block作为临时Block添加进所述已占用列表。a write failure processing unit, configured to reselect another available empty Block to save the metadata to be saved after the write failure and later when the to-be-saved metadata fails to be written during the process of being saved to the available empty Block, The block in which the write failure occurs is marked as an abnormal block, and the abnormal block is added to the occupied list as a temporary block.

可选的,该SSD盘元数据存储装置还包括:Optionally, the SSD disk metadata storage device further includes:

擦写次数获取单元,用于在将所述待保存元数据存储于从可用空Block池中选取出的可用空Block中之前,获取所述可用空Block池中每个可用空Block的擦写次数;The erasing times obtaining unit is used to obtain the erasing times of each available empty Block in the available empty Block pool before storing the metadata to be saved in the available empty Block selected from the available empty Block pool ;

对应的,所述Block替换单元包括:Correspondingly, the Block replacement unit includes:

待保存元数据优选存储子单元,用于将所述待保存元数据存储于所述可用空Block池中擦写次数最少的可用空Block中。The metadata to be saved is preferably a storage subunit, which is used for storing the metadata to be saved in the available empty Block with the least number of erasures and writes in the available empty Block pool.

为实现上述目的,本申请还提供了一种SSD盘元数据存储控制器,该控制器包括:In order to achieve the above object, the present application also provides an SSD disk metadata storage controller, the controller includes:

存储器,用于存储计算机程序;memory for storing computer programs;

处理器,用于执行所述计算机程序时实现如上述内容所描述的SSD盘元数据存储方法。The processor is configured to implement the SSD disk metadata storage method described in the above content when executing the computer program.

为实现上述目的,本申请还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上述内容所描述的SSD盘元数据存储方法。In order to achieve the above purpose, the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the SSD disk unit as described above is realized. Data storage method.

根据本申请提供的SSD盘元数据存储方法可以看出,本申请首先根据SSD盘的总容量计算得到存储一份完整元数据的所需大小,这是由于两者之间存在相对固定的换算关系,而一份完整元数据的所需大小是指能够描述该SSD盘存储的所有数据的元数据的大小,也就是说该SSD盘其实最少只需要数量为能存储该所需大小元数据的Block即可完成对所有数据的描述,而大于该数量的Block则在很大概率上没必要被使用,或者说在被使用的Block数大于该数量时,很大概率上存在无效元数据,而无效元数据则是完全没有必要存在的,也没有必要因为无效元数据占用导致Block对应的存储介质被磨损,进而降低SSD盘寿命。According to the SSD disk metadata storage method provided by this application, it can be seen that the application first calculates the required size for storing a piece of complete metadata according to the total capacity of the SSD disk. This is because there is a relatively fixed conversion relationship between the two. , and the required size of a complete metadata refers to the size of the metadata that can describe all the data stored in the SSD, that is to say, the SSD actually needs at least the number of Blocks that can store the metadata of the required size. The description of all data can be completed, and blocks larger than this number are not necessary to be used in a high probability, or when the number of blocks used is larger than this number, there is a high probability that there is invalid metadata, which is invalid. Metadata does not need to exist at all, and there is no need to wear the storage medium corresponding to the block due to the occupation of invalid metadata, thereby reducing the lifespan of the SSD disk.

因此,本申请根据该所需大小确定出优选容量上限,该优选容量上限用于限制该SSD盘中存储的元数据,使其不会因为没限制而使得所有可用于存储元数据的Block都处于占用状态,在已占用列表当前的已占用容量与新来的待保存元数据的待保存大小的和大于该优选容量上限时,就会触发使用新Block替换最先存放进该已占用列表中的旧Block的操作,而旧Block将会在清空后成为新的可用空Block添加进可用空Block池中。通过本申请提供的技术方案,常态化处于被占用状态的Block数量将会得到明显降低,其它Block都将因为处于非占用状态而不会增加对应存储介质的磨损程度,使得该SSD盘的使用寿命得以延长。Therefore, the present application determines a preferred upper limit of capacity according to the required size, and the preferred upper limit of capacity is used to limit the metadata stored in the SSD, so that all blocks that can be used to store metadata will not be in the Occupied status, when the sum of the current occupied capacity of the occupied list and the to-be-saved size of the newly-coming metadata to be saved is greater than the upper limit of the preferred capacity, it will trigger the use of a new block to replace the block that was first stored in the occupied list. The operation of the old block, and the old block will become a new free block after being emptied and added to the free block pool. Through the technical solutions provided in this application, the number of blocks that are normally occupied will be significantly reduced, and other blocks will not increase the wear degree of the corresponding storage medium because they are in an unoccupied state, so that the service life of the SSD disk will be reduced. be extended.

本申请同时还提供了一种SSD盘元数据存储装置、控制器及计算机可读存储介质,具有上述有益效果,在此不再赘述。The present application also provides an SSD disk metadata storage device, a controller, and a computer-readable storage medium, which have the above beneficial effects, and are not repeated here.

附图说明Description of drawings

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

图1为本申请实施例提供的一种SSD盘元数据存储方法的流程图;1 is a flowchart of a method for storing metadata of an SSD disk according to an embodiment of the present application;

图2为本申请实施例提供的SSD盘元数据存储方法中一种优选的存储待保存元数据的方法的流程图;2 is a flowchart of a preferred method for storing metadata to be saved in the SSD disk metadata storage method provided by the embodiment of the present application;

图3为本申请实施例提供的一种SSD盘元数据存储装置的结构框图。FIG. 3 is a structural block diagram of an SSD disk metadata storage device according to an embodiment of the present application.

具体实施方式Detailed ways

本申请的目的在于提供一种SSD盘元数据存储方法、装置、控制器及计算机可读存储介质,旨在解决现有SSD盘在存储元数据时,由于不对需要使用的Block进行管理,使得所有可用于存储元数据的Block都将常态化的处于被占用状态,使得对应的存储介质会因为持续被占用而被持续磨损,最终使得该SSD盘的使用寿命快速降低的问题。The purpose of this application is to provide an SSD disk metadata storage method, device, controller and computer-readable storage medium, which aims to solve the problem that when the existing SSD disk stores metadata, because the blocks that need to be used are not managed, all the Blocks that can be used to store metadata will be normally occupied, so that the corresponding storage medium will continue to be worn out due to continuous occupancy, and eventually the service life of the SSD will be rapidly reduced.

为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。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 work fall within the protection scope of the present application.

实施例一Example 1

请参见图1,图1为本申请实施例提供的一种SSD盘元数据存储方法的流程图,其包括以下步骤:Please refer to FIG. 1. FIG. 1 is a flowchart of a method for storing metadata of an SSD disk provided by an embodiment of the present application, which includes the following steps:

S101:根据目标SSD盘的总容量计算得到存储一份完整元数据的所需容量;S101: Calculate the required capacity for storing a complete metadata according to the total capacity of the target SSD;

元数据(Metadata),又称中介数据、中继数据,是一种描述数据的数据(dataabout data),主要是描述数据属性(property)的信息,用来支持如指示存储位置、历史数据、资源查找、文件记录等功能。通常在固定的应用场景下,能够将存储在该SSD盘中的所有数据全部进行描述的元数据的大小是固定的,也就是本申请确定出一份完整元数据的所需容量的过程,是根据在目标应用场景下的目标SSD盘的总容量计算得到的,两者之间存在一个相对固定的换算关系,该换算关系的具体参数会根据实际场景的不同灵活调整,同时也会参考出于安全考虑采用的冗余规则(例如RAID 0方式)和其它可能对所需容量造成影响的因素,此处并不做具体限定。Metadata, also known as intermediary data, relay data, is a kind of data describing data (dataabout data), mainly describing the information of data properties (property), used to support such as indicating storage location, historical data, resources Search, file recording and other functions. Usually in a fixed application scenario, the size of the metadata that can describe all the data stored in the SSD is fixed, that is, the process of determining the required capacity of a complete metadata in this application is Calculated based on the total capacity of the target SSD in the target application scenario, there is a relatively fixed conversion relationship between the two. The specific parameters of the conversion relationship will be flexibly adjusted according to the actual scenario. Redundancy rules (such as RAID 0 mode) adopted for safety consideration and other factors that may affect the required capacity are not specifically limited here.

其中,一份完整的元数据,是指能够描述完存储于该SSD盘中的所有实际数据的元数据,在此之外的元数据都将是因为实际修改而产生的新元数据,新元数据与未修改部分的旧元数据将构成新一份完整的元数据,至于被修改部分的旧元数据将作为无效元数据。Among them, a complete metadata refers to the metadata that can describe all the actual data stored in the SSD, and the metadata other than this will be the new metadata generated by the actual modification. The data and the old metadata of the unmodified part will constitute a new complete metadata, and the old metadata of the modified part will be regarded as invalid metadata.

S102:根据所需容量确定目标SSD盘的优选容量上限,并将优选容量上限设置为目标SSD盘已占用列表的容量上限;S102: Determine the upper limit of the preferred capacity of the target SSD according to the required capacity, and set the upper limit of the preferred capacity as the upper limit of the capacity of the occupied list of the target SSD;

在S101的基础上,本步骤旨在根据与一份完整元数据对应的所需容量确定得到该目标SSD盘的优选容量上限,并将该优选容量上限设置为该目标SSD盘已占用列表的容量上限。其中,该优选容量上限大于等于该所需容量、小于该目标SSD盘中可用于存储元数据的总容量,该已占用列表用于存放存储有元数据的Block和统计各该Block中存储的有效元数据大小,该Block按照时间先后顺序依次排列于该已占用列表中。On the basis of S101, this step aims to determine and obtain the upper limit of the preferred capacity of the target SSD according to the required capacity corresponding to a piece of complete metadata, and set the upper limit of the preferred capacity as the capacity of the occupied list of the target SSD upper limit. Wherein, the upper limit of the preferred capacity is greater than or equal to the required capacity and less than the total capacity of the target SSD disk that can be used to store metadata, and the occupied list is used to store the Blocks that store metadata and to count the valid data stored in the Blocks. Metadata size, the Blocks are arranged in the occupied list in chronological order.

也就是说,该优选容量上限的取值下限(可以取到)为该所需容量,也就是存储一份完整元数据对应的所需容量,也就是绝对不允许无效元数据的存在;相对的,取值上限(不能取到)为与现有技术一致的可用于存储元数据的总容量。也就是说,根据应用场景下对严格程度要求的不同,使用在此范围内取到的值来约束Block的使用的话,都相对于现有技术的使用方式存在有益效果,使存储介质的整体磨损程度得以降低,进而延长该SSD盘的使用寿命。由于容量具体表现为每个Block的元数据存储能力和Block的数量,因此容量实际可换算为Block的数量。That is to say, the lower limit (which can be obtained) of the upper limit of the preferred capacity is the required capacity, that is, the required capacity corresponding to storing a complete metadata, that is, the existence of invalid metadata is absolutely not allowed; relative , the upper limit of the value (unavailable) is the total capacity that can be used to store metadata consistent with the prior art. That is to say, according to the different requirements for strictness in the application scenario, if the value obtained within this range is used to restrict the use of Block, it will have beneficial effects compared with the use method of the prior art, which will cause the overall wear and tear of the storage medium. The level is reduced, thereby prolonging the service life of the SSD. Since the capacity is embodied in the metadata storage capacity of each block and the number of blocks, the capacity can actually be converted into the number of blocks.

S103:当接收到元数据保存请求时,根据元数据保存请求确定与待保存元数据对应的待保存容量,并根据已占用列表确定当前的已占用容量;S103: when a metadata storage request is received, determine the to-be-saved capacity corresponding to the to-be-saved metadata according to the metadata storage request, and determine the current occupied capacity according to the occupied list;

在S102的基础上,本步骤以及后续步骤将对实际有新元数据需要保存时的处理方式进行描述:首先,本步骤用于从接收到的元数据保存请求中提取得到待保存元数据对应的待保存容量,以及根据已占用列表确定当前的已占用容量(也可以理解为当前已存储的有效元数据的大小)。On the basis of S102, this step and subsequent steps will describe the processing method when there is actually new metadata that needs to be saved: First, this step is used to extract the metadata corresponding to the metadata to be saved from the received metadata storage request. The capacity to be saved, and the current occupied capacity is determined according to the occupied list (it can also be understood as the size of the currently stored valid metadata).

S104:判断当前的已占用容量与待保存容量的和是否大于优选容量上限;S104: Determine whether the sum of the current occupied capacity and the capacity to be saved is greater than the upper limit of the preferred capacity;

在S103的基础上,本步骤旨在判断当前的已占用容量与待保存容量的和是否大于该已占用列表的容量上限(即该优选容量上限),以期通过本步骤的判断过结果决定后续采用何种方式存储该待保存元数据。On the basis of S103, this step aims to determine whether the sum of the current occupied capacity and the capacity to be saved is greater than the upper limit of the capacity of the occupied list (that is, the upper limit of the preferred capacity), so as to decide the subsequent use of the occupied list based on the judgment result of this step. How to store the metadata to be saved.

S105:将待保存元数据存储于从可用空Block池中选取出的可用空Block中,得到新Block,将新Block存放进已占用列表的末尾;S105: Store the metadata to be saved in the available empty Block selected from the available empty Block pool, obtain a new Block, and store the new Block at the end of the occupied list;

本步骤建立在S104的判断结果为当前的已占用容量与待保存容量的和未大于该已占用列表的容量上限的基础上,说明当前已占用列表中存储的有效元数据大小还未超过容量上限,还能够在不替换旧Block的情况下支持存储该待保存元数据的新Block存入,因此只需要将待保存元数据存储于从可用空Block池中选取出的可用空Block中,得到新Block,并将该新Block存放进已占用列表的末尾即可,且在存入后更新有效元数据大小即可。This step is based on the fact that the judgment result of S104 is that the sum of the current occupied capacity and the capacity to be saved is not greater than the upper limit of the capacity of the occupied list, indicating that the size of the valid metadata stored in the current occupied list has not exceeded the upper limit of the capacity , can also support the storage of the new Block storing the metadata to be saved without replacing the old Block, so it is only necessary to store the metadata to be saved in the available empty Block selected from the available empty Block pool to obtain a new block. Block, and store the new block at the end of the occupied list, and update the effective metadata size after saving.

S106:将待保存元数据存储于从可用空Block池中选取出的可用空Block中,得到新Block,并使用新Block替换最早进入已占用列表的、与新Block中存储的有效元数据数一致的旧Block,且将旧Block清空后添加进可用空Block池。S106: Store the metadata to be saved in the available empty Block selected from the available empty Block pool, obtain a new Block, and use the new Block to replace the earliest entry into the occupied list and the number of valid metadata stored in the new Block is equal to one The old blocks that are caused by the block, and the old blocks are emptied and added to the pool of available empty blocks.

本步骤建立在S104的判断结果为当前的已占用容量与待保存容量的和大于该已占用列表的容量上限的基础上,说明根据当前已占用列表中存储的有效元数据的大小已经无法支持在不进行替换的情况下存入新Block,因此,本步骤还需要使用新Block替换最早进入已占用列表的、与新Block中存储的有效元数据数一致的旧Block,且将旧Block清空后添加进可用空Block池。This step is based on the fact that the judgment result of S104 is that the sum of the current occupied capacity and the capacity to be saved is greater than the upper limit of the capacity of the occupied list, indicating that the size of the valid metadata stored in the current occupied list cannot support the A new block is stored without replacement. Therefore, in this step, the new block needs to be used to replace the old block that entered the occupied list first and is consistent with the number of valid metadata stored in the new block, and the old block is emptied. Add to the available empty Block pool.

其中,可用空Block池为可用空Block的集中存放处,用于存放所有可用于存储元数据的可用空Block。Among them, the available empty block pool is a centralized storage place for available empty blocks, which is used to store all available empty blocks that can be used to store metadata.

根据本实施例对本申请发明点的描述,可以看出,本申请为了改善现有SSD盘存储元数据机制下存在的技术缺陷,在满足元数据功能完成的基础上,通过为已占用列表设置容量上限的方式让常态化处于占用状态的Block的数量得以减少,且这些Block都是因为其中存储是有效元数据而必须处于占用状态,尽可能的减少了无效元数据对Block的占用,进而减少了对存储介质的磨损,延长了SSD盘的整体使用寿命。According to the description of the invention points of the present application in this embodiment, it can be seen that, in order to improve the technical defects existing in the existing SSD disk storage metadata mechanism, the present application, on the basis of satisfying the completion of the metadata function, sets the capacity for the occupied list by setting the capacity for the occupied list. The upper limit method reduces the number of blocks that are normally occupied, and these blocks must be occupied because the storage in them is valid metadata, which reduces the occupation of blocks by invalid metadata as much as possible, and thus reduces the number of blocks. The wear and tear of the storage medium extends the overall service life of the SSD disk.

同时,针对在将待保存元数据保存至Block的过程中可能出现的写失败情况,本申请也提供了相应的解决方案:当待保存元数据在保存至可用空Block过程中出现写失败时,重新选取另一个可用空Block保存出现写失败及之后的待保存元数据,并将出现写失败的Block标记为异常Block,并将异常Block作为临时Block添加进已占用列表。需要说明的是,由于写失败的出现概率通常较低,因此作为小概率事件的异常Block将作为临时Block按顺序添加进已占用列表,且由于已占用列表会基于有效元数据大小与容量上限进行比对,异常Block中存储的写失败元数据将不会被计数。而该临时Block将会在后续的新旧Block替换中,在基于相同有效元数据大小的替换规则下逐渐被替换掉,消除现有技术中也不对写失败出现的异常Block进行管理造成的不必要磨损问题。At the same time, the present application also provides a corresponding solution for the possible write failure in the process of saving the metadata to be saved to the Block: when the metadata to be saved fails to be written in the process of saving the metadata to an available empty Block, Re-select another available empty block to save the metadata to be saved after the write failure and later, mark the block with the write failure as an abnormal block, and add the abnormal block as a temporary block to the occupied list. It should be noted that since the probability of write failure is usually low, abnormal blocks that are small probability events will be added to the occupied list as temporary blocks in order, and the occupied list will be based on the effective metadata size and capacity limit. By comparison, the write failure metadata stored in the abnormal block will not be counted. The temporary block will be gradually replaced in the subsequent replacement of old and new blocks under the replacement rule based on the same effective metadata size, eliminating unnecessary wear and tear caused by the management of abnormal blocks that fail to write in the prior art question.

实施例二Embodiment 2

请参见图2,图2为本申请实施例提供的SSD盘元数据存储方法中一种优选的存储待保存元数据的方法的流程图,在实施例一的基础上,本实施例旨在挑选最合适用与存储该待保存元数据的可用空Block的方式来实现,包括以下步骤:Please refer to FIG. 2. FIG. 2 is a flowchart of a preferred method for storing metadata to be stored in the SSD disk metadata storage method provided by the embodiment of the application. On the basis of the first embodiment, this embodiment aims to select The most suitable way to store the available empty Block of the metadata to be saved is to implement, including the following steps:

S201:获取可用空Block池中每个可用空Block的擦写次数;S201: Obtain the number of times of erasing and writing each available empty Block in the available empty Block pool;

按照本申请实施例对可用空Block来源的介绍可以看出,可用空Block的来源不外乎两种:一种是从未被使用的可用空Block,其擦写次数为零;另一种是之前被使用过,但由于替换操作后被清空为可用空Block的Block,其擦写次数为被执行过的清空次数。According to the introduction of the sources of available empty blocks in the embodiments of this application, it can be seen that there are no more than two sources of available empty blocks: one is an available empty block that has never been used, and the number of erasing and writing is zero; the other is A block that has been used before, but is emptied as an available empty block after the replacement operation, the number of times of erasing and writing is the number of times that it has been emptied.

本实施例为了尽可能的延长该目标SSD盘的使用寿命,也就需要在各Block的使用上达成尽可能的平衡,使得在轮换使用的方式下,将磨损程度摊平,使得整体磨损程度较低,因此本步骤需要获取每个空Block的擦写次数,以便后续步骤基于该擦写次数选取最合适用于存储该待保存元数据的可用空Block。In this embodiment, in order to prolong the service life of the target SSD disk as much as possible, it is necessary to achieve as much balance as possible in the use of each block, so that in the mode of rotating use, the wear degree is evened out, so that the overall wear degree is relatively low. Therefore, in this step, the number of times of erasing and writing of each empty Block needs to be obtained, so that the subsequent steps can select the most suitable available empty Block for storing the metadata to be saved based on the number of times of erasing and writing.

S202:将待保存元数据存储于可用空Block池中擦写次数最少的可用空Block中。S202: Store the metadata to be saved in the available empty Block with the least number of erasing and writing times in the available empty Block pool.

在S201的基础上,本步骤旨在将待保存元数据存储于可用空Block池中擦写次数最少的可用空Block中,也就是说,每次选取可用空Block时,都选取擦写次数最少的,那么下次再进入可用空Block池的Block将因为擦写次数的增加不会被再次选取到,进而让可用空Block的使用在良好的轮询方式下使得磨损程度整体较低,使得SSD盘的使用寿命得到进一步的延长。On the basis of S201, this step aims to store the metadata to be saved in the available empty Block with the least number of erasing and writing times in the available empty Block pool, that is to say, every time an available empty Block is selected, the least number of erasing and writing times is selected. , then the blocks that enter the available empty block pool next time will not be selected again due to the increase in the number of erasing and writing, so that the use of available empty blocks in a good polling method will reduce the overall wear level, making the SSD The service life of the disc is further extended.

进一步的,为了方便选取擦写次数最少的可用空Block,还可以将可用空Block池中的可用空Block按擦写次数的多少进行排序(例如按从小到大的顺序依次从表的顶部开始排列),得到排序表。每当需要时,就选取排列于排序表顶部的可用空Block来存储该待保存元数据。Further, in order to facilitate the selection of the available empty blocks with the least number of erasing and writing, the available empty blocks in the available empty Block pool can also be sorted according to the number of erasing and writing times (for example, in ascending order from the top of the table). ) to get a sorted table. Whenever needed, an available empty Block arranged at the top of the sorting list is selected to store the metadata to be saved.

因为情况复杂,无法一一列举进行阐述,本领域技术人员应能意识到根据本申请提供的基本方法原理结合实际情况可以存在很多的例子,在不付出足够的创造性劳动下,应均在本申请的保护范围内。Due to the complexity of the situation, it is impossible to enumerate and describe them one by one. Those skilled in the art should be aware that there can be many examples based on the basic method principles provided in this application combined with the actual situation. within the scope of protection.

实施例三Embodiment 3

下面请参见图3,图3为本申请实施例提供的一种SSD盘元数据存储装置的结构框图,该系统可以包括:Please refer to FIG. 3 below. FIG. 3 is a structural block diagram of an SSD disk metadata storage device provided by an embodiment of the present application. The system may include:

基准所需容量计算单元100,用于根据目标SSD盘的总容量计算得到存储一份完整元数据的所需容量;The benchmark requiredcapacity calculation unit 100 is configured to calculate the required capacity for storing a complete metadata according to the total capacity of the target SSD;

上限确定及设置单元200,用于根据所需容量确定目标SSD盘的优选容量上限,并将优选容量上限设置为目标SSD盘已占用列表的容量上限;其中,优选容量上限大于等于所需容量、小于目标SSD盘中可用于存储元数据的总容量,已占用列表用于存放存储有元数据的Block和统计各Block中存储的有效元数据大小;The upper limit determination and settingunit 200 is used to determine the upper limit of the preferred capacity of the target SSD according to the required capacity, and set the upper limit of the preferred capacity as the upper limit of the capacity of the occupied list of the target SSD; wherein, the upper limit of the preferred capacity is greater than or equal to the required capacity, It is less than the total capacity of the target SSD disk that can be used to store metadata, and the occupied list is used to store blocks that store metadata and to count the effective metadata size stored in each block;

容量参数确定单元300,用于当接收到元数据保存请求时,根据元数据保存请求确定与待保存元数据对应的待保存容量,并根据已占用列表确定当前的已占用容量;A capacityparameter determination unit 300, configured to determine the to-be-saved capacity corresponding to the to-be-saved metadata according to the metadata save request when receiving the metadata save request, and to determine the current occupied capacity according to the occupied list;

容量判断单元400,用于判断当前的已占用容量与待保存容量的和是否大于优选容量上限;Acapacity judgment unit 400, configured to judge whether the sum of the current occupied capacity and the capacity to be saved is greater than the upper limit of the preferred capacity;

Block替换单元500,用于当大于优选容量上限时,将待保存元数据存储于从可用空Block池中选取出的可用空Block中,得到新Block,并使用新Block替换最早进入已占用列表的、与新Block中存储的有效元数据数一致的旧Block,且将旧Block清空后添加进可用空Block池。Theblock replacement unit 500 is configured to store the metadata to be saved in the available empty Block selected from the available empty Block pool when it is greater than the upper limit of the preferred capacity, obtain a new Block, and use the new Block to replace the earliest entry into the occupied list. , The old block that is consistent with the number of valid metadata stored in the new block, and the old block is emptied and added to the available empty block pool.

其中,该上限确定及设置单元200可以包括:Wherein, the upper limit determination and settingunit 200 may include:

最优容量上限设置子单元,用于将所需容量设置为目标SSD盘的优选容量上限。The optimal capacity upper limit setting subunit is used to set the required capacity as the optimal capacity upper limit of the target SSD disk.

进一步的,该SSD盘元数据存储装置还可以包括:Further, the SSD disk metadata storage device may also include:

写失败处理单元,用于当待保存元数据在保存至可用空Block过程中出现写失败时,重新选取另一个可用空Block保存出现写失败及之后的待保存元数据,并将出现写失败的Block标记为异常Block,并将异常Block作为临时Block添加进已占用列表。The write failure processing unit is used to re-select another available empty block to save the metadata to be saved after the write failure and the subsequent to-be-saved metadata when the to-be-saved metadata fails to be saved during the process of saving it to an available empty block, and will fail the write-failure. The block is marked as an abnormal block, and the abnormal block is added to the occupied list as a temporary block.

更进一步的,该SSD盘元数据存储装置还可以包括:Further, the SSD disk metadata storage device may also include:

擦写次数获取单元,用于在将待保存元数据存储于从可用空Block池中选取出的可用空Block中之前,获取可用空Block池中每个可用空Block的擦写次数;The erasing and writing times obtaining unit is used to obtain the erasing and writing times of each available empty Block in the available empty Block pool before storing the metadata to be saved in the available empty Block selected from the available empty Block pool;

对应的,该Block替换单元500可以包括:Correspondingly, theBlock replacement unit 500 may include:

待保存元数据优选存储子单元,用于将待保存元数据存储于可用空Block池中擦写次数最少的可用空Block中。The metadata to be saved is preferably a storage subunit, which is used to store the metadata to be saved in the available empty Block with the least number of erasing and writing times in the available empty Block pool.

本实施例作为一个对应于上述方法实施例的系统实施例存在,具有方法实施例的全部有益效果,此处不再一一赘述。This embodiment exists as a system embodiment corresponding to the foregoing method embodiment, and has all the beneficial effects of the method embodiment, which will not be repeated here.

基于上述实施例,本申请还提供了一种SSD盘元数据存储控制器,该控制器可以包括存储器和处理器,其中,该存储器中存有计算机程序,该处理器调用该存储器中的计算机程序时,可以实现上述实施例所提供的步骤。当然,该控制器还可以包括各种必要的网络接口、电源以及其它零部件等。Based on the above embodiments, the present application also provides an SSD disk metadata storage controller, the controller may include a memory and a processor, wherein a computer program is stored in the memory, and the processor calls the computer program in the memory , the steps provided in the above embodiments can be implemented. Of course, the controller may also include various necessary network interfaces, power supplies, and other components.

本申请还提供了一种计算机可读存储介质,其上存有计算机程序,该计算机程序被执行终端或处理器执行时可以实现上述实施例所提供的步骤。该存储介质可以包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random AccessMemory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by an execution terminal or a processor, the steps provided in the foregoing embodiments can be implemented. The storage medium may include: U disk, removable hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.

说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。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 units 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 possibilities of hardware and software. Interchangeability, the above description has generally described the components and steps of each example in terms of functionality. 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 this application.

本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想。对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也落入本申请权利要求的保护范围内。Specific examples are used herein to illustrate the principles and implementations of the present application, and the descriptions of the above embodiments are only used to help understand the methods and core ideas of the present application. 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 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 the process, method, article, or device that includes the element.

Claims (10)

Translated fromChinese
1.一种SSD盘元数据存储方法,其特征在于,包括:1. a SSD disk metadata storage method, is characterized in that, comprises:根据目标SSD盘的总容量计算得到存储一份完整元数据的所需容量;Calculate the required capacity to store a complete metadata according to the total capacity of the target SSD;根据所述所需容量确定所述目标SSD盘的优选容量上限,并将所述优选容量上限设置为所述目标SSD盘已占用列表的容量上限;其中,所述优选容量上限大于等于所述所需容量、小于所述目标SSD盘中可用于存储元数据的总容量,所述已占用列表用于存放存储有元数据的Block和统计各所述Block中存储的有效元数据大小;Determine the upper limit of the preferred capacity of the target SSD according to the required capacity, and set the upper limit of the preferred capacity as the upper limit of the capacity of the occupied list of the target SSD; wherein the upper limit of the preferred capacity is greater than or equal to the upper limit of the capacity The required capacity is less than the total capacity that can be used to store metadata in the target SSD disk, and the occupied list is used to store Blocks that store metadata and count the effective metadata size stored in each of the Blocks;当接收到元数据保存请求时,根据所述元数据保存请求确定与待保存元数据对应的待保存容量,并根据已占用列表确定当前的已占用容量;When receiving the metadata storage request, determine the to-be-saved capacity corresponding to the to-be-saved metadata according to the metadata storage request, and determine the current occupied capacity according to the occupied list;判断当前的已占用容量与所述待保存容量的和是否大于所述优选容量上限;Judging whether the sum of the current occupied capacity and the to-be-saved capacity is greater than the upper limit of the preferred capacity;若大于所述优选容量上限,则将所述待保存元数据存储于从可用空Block池中选取出的可用空Block中,得到新Block,并使用所述新Block替换最早进入所述已占用列表的、与所述新Block中存储的有效元数据数一致的旧Block,且将所述旧Block清空后添加进所述可用空Block池。If it is greater than the upper limit of the preferred capacity, the metadata to be saved is stored in the available empty Block selected from the available empty Block pool, a new Block is obtained, and the new Block is used to replace the earliest entry into the occupied list The old Block that is consistent with the number of valid metadata stored in the new Block, and the old Block is emptied and added to the available empty Block pool.2.根据权利要求1所述的SSD盘元数据存储方法,其特征在于,根据所述所需容量确定所述目标SSD盘的优选容量上限,包括:2. The SSD disk metadata storage method according to claim 1, wherein determining the preferred upper limit of the capacity of the target SSD according to the required capacity, comprising:将所述所需容量设置为所述目标SSD盘的优选容量上限。The required capacity is set as the upper limit of the preferred capacity of the target SSD disk.3.根据权利要求1所述的SSD盘元数据存储方法,其特征在于,还包括:3. SSD disk metadata storage method according to claim 1, is characterized in that, also comprises:当所述待保存元数据在保存至所述可用空Block过程中出现写失败时,重新选取另一个可用空Block保存出现所述写失败及之后的待保存元数据,并将出现所述写失败的Block标记为异常Block,并将所述异常Block作为临时Block添加进所述已占用列表。When the to-be-saved metadata fails to be written during the process of saving to the available empty Block, re-select another available empty Block to save the to-be-saved metadata in and after the write failure, and the write failure will occur The block is marked as an abnormal block, and the abnormal block is added to the occupied list as a temporary block.4.根据权利要求1至3任一项所述的SSD盘元数据存储方法,其特征在于,在将所述待保存元数据存储于从可用空Block池中选取出的可用空Block中之前,还包括:4. The SSD disk metadata storage method according to any one of claims 1 to 3, wherein before the metadata to be saved is stored in an available empty Block selected from an available empty Block pool, Also includes:获取所述可用空Block池中每个可用空Block的擦写次数;Obtain the number of times of erasing and writing of each available empty Block in the available empty Block pool;对应的,将所述待保存元数据存储于从可用空Block池中选取出的可用空Block中,包括:Correspondingly, the metadata to be saved is stored in the available empty Block selected from the available empty Block pool, including:将所述待保存元数据存储于所述可用空Block池中擦写次数最少的可用空Block中。The metadata to be saved is stored in the available empty Block with the least number of erasing and writing times in the available empty Block pool.5.一种SSD盘元数据存储装置,其特征在于,包括:5. An SSD disk metadata storage device, characterized in that, comprising:基准所需容量计算单元,用于根据目标SSD盘的总容量计算得到存储一份完整元数据的所需容量;The benchmark required capacity calculation unit is used to calculate the required capacity to store a complete metadata according to the total capacity of the target SSD;上限确定及设置单元,用于根据所述所需容量确定所述目标SSD盘的优选容量上限,并将所述优选容量上限设置为所述目标SSD盘已占用列表的容量上限;其中,所述优选容量上限大于等于所述所需容量、小于所述目标SSD盘中可用于存储元数据的总容量,所述已占用列表用于存放存储有元数据的Block和统计各所述Block中存储的有效元数据大小;an upper limit determination and setting unit, configured to determine a preferred upper limit of the capacity of the target SSD according to the required capacity, and set the preferred upper limit as the upper limit of the capacity of the occupied list of the target SSD; wherein, the Preferably, the upper limit of the capacity is greater than or equal to the required capacity and less than the total capacity of the target SSD disk that can be used to store metadata. effective metadata size;容量参数确定单元,用于当接收到元数据保存请求时,根据所述元数据保存请求确定与待保存元数据对应的待保存容量,并根据已占用列表确定当前的已占用容量;a capacity parameter determination unit, configured to determine the to-be-saved capacity corresponding to the to-be-saved metadata according to the metadata save request, and to determine the current occupied capacity according to the occupied list when a metadata save request is received;容量判断单元,用于判断当前的已占用容量与所述待保存容量的和是否大于所述优选容量上限;a capacity judgment unit, configured to judge whether the sum of the current occupied capacity and the to-be-saved capacity is greater than the upper limit of the preferred capacity;Block替换单元,用于当大于所述优选容量上限时,将所述待保存元数据存储于从可用空Block池中选取出的可用空Block中,得到新Block,并使用所述新Block替换最早进入所述已占用列表的、与所述新Block中存储的有效元数据数一致的旧Block,且将所述旧Block清空后添加进所述可用空Block池。A block replacement unit, configured to store the metadata to be saved in the available empty Block selected from the available empty Block pool when the upper limit of the preferred capacity is larger, obtain a new Block, and use the new Block to replace the oldest block Enter the old Block in the occupied list that is consistent with the number of valid metadata stored in the new Block, and add the old Block to the available empty Block pool after clearing the old Block.6.根据权利要求5所述的SSD盘元数据存储装置,其特征在于,所述优选容量上限确定及设置单元包括:6. The SSD disk metadata storage device according to claim 5, wherein the preferred capacity upper limit determination and setting unit comprises:最优容量上限设置子单元,用于将所述所需容量设置为所述目标SSD盘的优选容量上限。The optimal capacity upper limit setting subunit is used to set the required capacity as the preferred capacity upper limit of the target SSD disk.7.根据权利要求5所述的SSD盘元数据存储装置,其特征在于,还包括:7. The SSD disk metadata storage device according to claim 5, further comprising:写失败处理单元,用于当所述待保存元数据在保存至所述可用空Block过程中出现写失败时,重新选取另一个可用空Block保存出现所述写失败及之后的待保存元数据,并将出现所述写失败的Block标记为异常Block,并将所述异常Block作为临时Block添加进所述已占用列表。a write failure processing unit, configured to reselect another available empty Block to save the metadata to be saved after the write failure and later when the to-be-saved metadata fails to be written during the process of being saved to the available empty Block, The block in which the write failure occurs is marked as an abnormal block, and the abnormal block is added to the occupied list as a temporary block.8.根据权利要求5至7任一项所述的SSD盘元数据存储装置,其特征在于,还包括:8. The SSD disk metadata storage device according to any one of claims 5 to 7, further comprising:擦写次数获取单元,用于在将所述待保存元数据存储于从可用空Block池中选取出的可用空Block中之前,获取所述可用空Block池中每个可用空Block的擦写次数;The erasing times obtaining unit is used to obtain the erasing times of each available empty Block in the available empty Block pool before storing the metadata to be saved in the available empty Block selected from the available empty Block pool ;对应的,所述Block替换单元包括:Correspondingly, the Block replacement unit includes:待保存元数据优选存储子单元,用于将所述待保存元数据存储于所述可用空Block池中擦写次数最少的可用空Block中。The metadata to be saved is preferably a storage subunit, which is used for storing the metadata to be saved in the available empty Block with the least number of erasures and writes in the available empty Block pool.9.一种SSD盘元数据存储控制器,其特征在于,包括:9. An SSD disk metadata storage controller, comprising:存储器,用于存储计算机程序;memory for storing computer programs;处理器,用于执行所述计算机程序时实现如权利要求1至4任一项所述的SSD盘元数据存储方法。The processor is configured to implement the SSD disk metadata storage method according to any one of claims 1 to 4 when executing the computer program.10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至4任一项所述的SSD盘元数据存储方法。10. A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the SSD according to any one of claims 1 to 4 is implemented Disk metadata storage method.
CN201910294458.5A2019-04-122019-04-12 A kind of SSD disk metadata storage method, device, controller and storage mediumActiveCN110007868B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201910294458.5ACN110007868B (en)2019-04-122019-04-12 A kind of SSD disk metadata storage method, device, controller and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201910294458.5ACN110007868B (en)2019-04-122019-04-12 A kind of SSD disk metadata storage method, device, controller and storage medium

Publications (2)

Publication NumberPublication Date
CN110007868A CN110007868A (en)2019-07-12
CN110007868Btrue CN110007868B (en)2022-07-22

Family

ID=67171417

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201910294458.5AActiveCN110007868B (en)2019-04-122019-04-12 A kind of SSD disk metadata storage method, device, controller and storage medium

Country Status (1)

CountryLink
CN (1)CN110007868B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114020739A (en)*2021-10-252022-02-08迈普通信技术股份有限公司 Table entry storage method, device, electronic device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102968279A (en)*2012-11-132013-03-13浪潮电子信息产业股份有限公司Thin provisioning method for storage system
CN104571963A (en)*2014-12-312015-04-29曙光信息产业股份有限公司Method and device for processing RAID (Redundant Array of Independent Disks) metadata
CN104571929A (en)*2013-10-092015-04-29四川佳品软件有限公司Read-write balance type high-speed data acquisition queue memory method for magnetic disc

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102968279A (en)*2012-11-132013-03-13浪潮电子信息产业股份有限公司Thin provisioning method for storage system
CN104571929A (en)*2013-10-092015-04-29四川佳品软件有限公司Read-write balance type high-speed data acquisition queue memory method for magnetic disc
CN104571963A (en)*2014-12-312015-04-29曙光信息产业股份有限公司Method and device for processing RAID (Redundant Array of Independent Disks) metadata

Also Published As

Publication numberPublication date
CN110007868A (en)2019-07-12

Similar Documents

PublicationPublication DateTitle
US7962807B2 (en)Semiconductor storage apparatus managing system, semiconductor storage apparatus, host apparatus, program and method of managing semiconductor storage apparatus
JP5970645B2 (en) Increasing spare area in memory to extend memory life
US8990538B2 (en)Managing memory with limited write cycles in heterogeneous memory systems
US9733844B2 (en)Data migration method, data migration apparatus, and storage device
US9129699B2 (en)Semiconductor storage apparatus and method including executing refresh in a flash memory based on a reliability period using degree of deterioration and read frequency
US9037828B2 (en)Transferring storage resources between snapshot storage pools and volume storage pools in a data storage system
US10289317B2 (en)Memory apparatus and methods thereof for write amplification aware wear leveling
EP2718806A2 (en)Managing data placement on flash-based storage by use
CN111857554A (en)Adaptive change of RAID redundancy level
WO2020000817A1 (en)Method, system, and apparatus for allocating hard disks belonging to placement group, and storage medium
JP2017123110A (en)Data storage device, data storage method, and program
US20100306484A1 (en)Heterogeneous storage array optimization through eviction
US20150199152A1 (en)Method of managing redundant array of independent disks (raid) groups in a solid state disk array
CN109992445B (en) A processing method, device, electronic device and storage medium for modifying a write operation
CN110007868B (en) A kind of SSD disk metadata storage method, device, controller and storage medium
WO2025180322A1 (en)Storage block replacement method and apparatus based on solid state drive
JP2021135538A (en) Storage controller and storage control program
US10268598B2 (en)Primary memory module with record of usage history
US9785374B2 (en)Storage device management in computing systems
CN116339617A (en)Automatic deletion in persistent storage
CN111124283A (en) A storage space management method, system, electronic device and storage medium
CN114647534A (en)Data storage method and device based on digital control equipment
CN111913661B (en)Cache equipment replacement method and electronic equipment
JP4778538B2 (en) Storage data management system and storage data management program
US11403198B2 (en)Managing data within solid state drive storage based on recurring write quotas

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant
CP03Change of name, title or address

Address after:Building 9, No.1, guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Wuzhong District, Suzhou City, Jiangsu Province

Patentee after:Suzhou Yuannao Intelligent Technology Co.,Ltd.

Country or region after:China

Address before:Building 9, No.1, guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Wuzhong District, Suzhou City, Jiangsu Province

Patentee before:SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd.

Country or region before:China


[8]ページ先頭

©2009-2025 Movatter.jp