CN105975403A - Address mapping method and system as well as solid-state disk - Google Patents

Address mapping method and system as well as solid-state disk Download PDF

Info

Publication number
CN105975403A
CN105975403A CN201610274370.3A CN201610274370A CN105975403A CN 105975403 A CN105975403 A CN 105975403A CN 201610274370 A CN201610274370 A CN 201610274370A CN 105975403 A CN105975403 A CN 105975403A
Authority
CN
China
Prior art keywords
address mapping
capacity
solid
mapping mechanism
address
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.)
Pending
Application number
CN201610274370.3A
Other languages
Chinese (zh)
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.)
Inspur Beijing Electronic Information Industry Co Ltd
Original Assignee
Inspur Beijing Electronic Information Industry 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 Inspur Beijing Electronic Information Industry Co Ltd filed Critical Inspur Beijing Electronic Information Industry Co Ltd
Priority to CN201610274370.3A priority Critical patent/CN105975403A/en
Publication of CN105975403A publication Critical patent/CN105975403A/en
Pending legal-status Critical Current

Links

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/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • G06F12/0615Address space extension

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The invention discloses an address mapping method and system as well as a solid-state disk. The method comprises the steps of determining the capacity of a mapping table in the solid-state disk; judging whether the capacity is greater than a preset capacity threshold or not; if the capacity is greater than the preset capacity threshold, setting an address mapping mechanism of the solid-state disk as a first address mapping mechanism; and if the capacity is smaller than or equal to the preset capacity threshold, setting the address mapping mechanism of the solid-state disk as a second address mapping mechanism, wherein the mapping table capacity required by the first address mapping mechanism is smaller than that of the second address mapping mechanism, and the mapping performance of the second address mapping mechanism is superior to that of the first address mapping mechanism. According to the method and system as well as the solid-state disk, the advantages of two different address mapping mechanisms can be combined, so that the solid-state disk can have relatively high mapping performance while the mapping table of the solid-state disk occupies relatively small space.

Description

一种地址映射方法、系统及固态硬盘A kind of address mapping method, system and solid-state hard disk

技术领域technical field

本发明涉及固态硬盘技术领域,特别涉及一种地址映射方法、系统及固态硬盘。The invention relates to the technical field of solid-state hard drives, in particular to an address mapping method, system and solid-state hard drives.

背景技术Background technique

当前,SSD(即Solid State Drives,固态硬盘)中需要通过某一种地址映射机制,将来自文件系统的逻辑地址转换成相应的物理地址。Currently, SSDs (Solid State Drives, solid state drives) need to use a certain address mapping mechanism to convert logical addresses from the file system into corresponding physical addresses.

而固态硬盘中常用的地址映射机制包括页地址映射机制、块地址映射机制以及混合地址映射机制。这三种地址映射机制有着各自的优缺点,比如,页地址映射机制的映射性能出色,但其所需的映射表容量较大;块地址映射机制的映射性能较差,不过其所需的映射表容量则要小得多;而混合地址映射机制由于是通过结合页地址映射机制以及块地址映射机制后得到的一种地址映射机制,其的优缺点介于页地址映射机制和块地址映射机制之间。The commonly used address mapping mechanisms in solid state disks include page address mapping mechanisms, block address mapping mechanisms, and hybrid address mapping mechanisms. These three address mapping mechanisms have their own advantages and disadvantages. For example, the page address mapping mechanism has excellent mapping performance, but the required mapping table capacity is large; the block address mapping mechanism has poor mapping performance, but the required mapping The table capacity is much smaller; and the hybrid address mapping mechanism is an address mapping mechanism obtained by combining the page address mapping mechanism and the block address mapping mechanism, and its advantages and disadvantages are between the page address mapping mechanism and the block address mapping mechanism. between.

由于当前固态硬盘要么是采用页地址映射机制,要么是采用块地址映射机制或混合地址映射机制,所以使得现有固态硬盘要么映射性能较差,要么映射表需要占用较大的空间。Since the current solid-state disk either adopts a page address mapping mechanism, or adopts a block address mapping mechanism or a mixed address mapping mechanism, the existing solid-state disk either has poor mapping performance, or the mapping table needs to occupy a large space.

综上所述可以看出,如何在固态硬盘的映射表占用较小空间的同时,确保固态硬盘具有较高的映射性能是目前有待解决的问题。From the above, it can be seen that how to ensure high mapping performance of the solid state disk while the mapping table of the solid state disk occupies a small space is a problem to be solved at present.

发明内容Contents of the invention

有鉴于此,本发明的目的在于提供一种地址映射方法、系统及固态硬盘,在固态硬盘的映射表占用较小空间的同时,确保了固态硬盘具有较高的映射性能。其具体方案如下:In view of this, the object of the present invention is to provide an address mapping method, system and solid-state hard disk, which ensures high mapping performance of the solid-state hard disk while the mapping table of the solid-state hard disk occupies a small space. The specific plan is as follows:

一种应用于固态硬盘的地址映射方法,包括:An address mapping method applied to a solid state disk, comprising:

确定固态硬盘中映射表的容量大小;Determine the capacity of the mapping table in the solid state drive;

判断所述容量大小是否大于预设容量阈值;judging whether the capacity is greater than a preset capacity threshold;

若所述容量大小大于所述预设容量阈值,则将所述固态硬盘的地址映射机制设为第一地址映射机制;If the capacity is greater than the preset capacity threshold, setting the address mapping mechanism of the solid-state hard disk as a first address mapping mechanism;

若所述容量大小小于或等于所述预设容量阈值,则将所述固态硬盘的地址映射机制设为第二地址映射机制;If the capacity is less than or equal to the preset capacity threshold, setting the address mapping mechanism of the solid-state hard disk as a second address mapping mechanism;

其中,所述第一地址映射机制所需的映射表容量小于所述第二地址映射机制所需的映射表容量,且所述第二地址映射机制自身的映射性能优于所述第一地址映射机制自身的映射性能。Wherein, the mapping table capacity required by the first address mapping mechanism is smaller than the mapping table capacity required by the second address mapping mechanism, and the mapping performance of the second address mapping mechanism itself is better than that of the first address mapping mechanism. The mapping performance of the mechanism itself.

优选的,所述预设容量阈值为预先根据所述固态硬盘的存储空间大小,确定的关于映射表容量的阈值。Preferably, the preset capacity threshold is a threshold value about the capacity of the mapping table determined in advance according to the storage space of the solid-state hard disk.

优选的,所述第一地址映射机制为混合地址映射机制,所述第二地址映射机制为页地址映射机制。Preferably, the first address mapping mechanism is a hybrid address mapping mechanism, and the second address mapping mechanism is a page address mapping mechanism.

优选的,所述第一地址映射机制为块地址映射机制,所述第二地址映射机制为页地址映射机制。Preferably, the first address mapping mechanism is a block address mapping mechanism, and the second address mapping mechanism is a page address mapping mechanism.

优选的,所述第一地址映射机制为块地址映射机制,所述第二地址映射机制为混合地址映射机制。Preferably, the first address mapping mechanism is a block address mapping mechanism, and the second address mapping mechanism is a hybrid address mapping mechanism.

优选的,所述地址映射方法,还包括:按照预设的垃圾清除周期,定期对所述固态硬盘中失效的映射表进行清理。Preferably, the address mapping method further includes: periodically cleaning up invalid mapping tables in the solid-state hard disk according to a preset garbage removal cycle.

本发明还公开了一种应用于固态硬盘的地址映射系统,包括:The invention also discloses an address mapping system applied to solid-state hard drives, including:

容量确定模块,用于确定固态硬盘中映射表的容量大小;A capacity determination module, configured to determine the capacity of the mapping table in the solid state drive;

判断模块,用于判断所述容量大小是否大于预设容量阈值;A judging module, configured to judge whether the capacity is greater than a preset capacity threshold;

映射控制模块,用于当所述容量大小大于所述预设容量阈值,则将所述固态硬盘的地址映射机制设为第一地址映射机制,当所述容量大小小于或等于所述预设容量阈值,则将所述固态硬盘的地址映射机制设为第二地址映射机制;A mapping control module, configured to set the address mapping mechanism of the solid-state hard disk as the first address mapping mechanism when the capacity is greater than the preset capacity threshold, and set the address mapping mechanism of the solid state disk to the first address mapping mechanism, and when the capacity is less than or equal to the preset capacity threshold, then the address mapping mechanism of the solid state disk is set as the second address mapping mechanism;

其中,所述第一地址映射机制所需的映射表容量小于所述第二地址映射机制所需的映射表容量,且所述第二地址映射机制自身的映射性能优于所述第一地址映射机制自身的映射性能。Wherein, the mapping table capacity required by the first address mapping mechanism is smaller than the mapping table capacity required by the second address mapping mechanism, and the mapping performance of the second address mapping mechanism itself is better than that of the first address mapping mechanism. The mapping performance of the mechanism itself.

优选的,所述第一地址映射机制为混合地址映射机制,所述第二地址映射机制为页地址映射机制。Preferably, the first address mapping mechanism is a hybrid address mapping mechanism, and the second address mapping mechanism is a page address mapping mechanism.

优选的,所述地址映射系统,还包括:Preferably, the address mapping system further includes:

清理模块,用于按照预设的垃圾清除周期,定期对所述固态硬盘中失效的映射表进行清理。The cleaning module is configured to regularly clean up the invalid mapping table in the solid-state hard disk according to the preset garbage cleaning cycle.

本发明还公开了一种固态硬盘,包括前述的地址映射系统。The invention also discloses a solid-state hard disk, which includes the aforementioned address mapping system.

本发明中,地址映射方法包括:确定固态硬盘中映射表的容量大小;然后判断容量大小是否大于预设容量阈值;若容量大小大于预设容量阈值,则将固态硬盘的地址映射机制设为第一地址映射机制;若容量大小小于或等于预设容量阈值,则将固态硬盘的地址映射机制设为第二地址映射机制;其中,第一地址映射机制所需的映射表容量小于第二地址映射机制所需的映射表容量,且第二地址映射机制自身的映射性能优于第一地址映射机制自身的映射性能。可见,本发明可根据固态硬盘中映射表的容量大小程度,来灵活地选择不同的地址映射机制。也即,当固态硬盘中映射表的容量小于或等于预设容量阈值,由于此时映射表的容量较小,所以可采用映射性能较好的第二地址映射机制作为固态硬盘的地址映射机制;当固态硬盘中映射表的容量大于预设阈值,由于此时映射表的容量较大,所以可以采用对映射表容量需求较低的第一地址映射机制。综上可见,本发明综合了两种不同地址映射机制的优点,使得在固态硬盘的映射表占用较小空间的同时,确保了固态硬盘具有较高的映射性能。In the present invention, the address mapping method includes: determining the capacity of the mapping table in the solid-state hard disk; then judging whether the capacity is greater than the preset capacity threshold; if the capacity is greater than the preset capacity threshold, setting the address mapping mechanism of the solid-state hard disk to the first An address mapping mechanism; if the capacity is less than or equal to the preset capacity threshold, the address mapping mechanism of the solid-state hard disk is set as the second address mapping mechanism; wherein, the capacity of the mapping table required by the first address mapping mechanism is smaller than that of the second address mapping The capacity of the mapping table required by the mechanism, and the mapping performance of the second address mapping mechanism itself is better than that of the first address mapping mechanism itself. It can be seen that the present invention can flexibly select different address mapping mechanisms according to the capacity of the mapping table in the solid state disk. That is, when the capacity of the mapping table in the solid-state hard disk is less than or equal to the preset capacity threshold, since the capacity of the mapping table is small at this time, the second address mapping mechanism with better mapping performance can be used as the address mapping mechanism of the solid-state hard disk; When the capacity of the mapping table in the solid state disk is greater than the preset threshold, since the capacity of the mapping table is larger at this time, the first address mapping mechanism that requires less capacity of the mapping table may be used. It can be seen from the above that the present invention combines the advantages of two different address mapping mechanisms, so that the mapping table of the solid-state hard disk occupies a small space while ensuring high mapping performance of the solid-state hard disk.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the 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 It is an embodiment of the present invention, and those skilled in the art can also obtain other drawings according to the provided drawings without creative work.

图1为本发明实施例公开的一种应用于固态硬盘的地址映射方法流程图;FIG. 1 is a flow chart of an address mapping method applied to a solid-state hard disk disclosed in an embodiment of the present invention;

图2为本发明实施例公开的一种应用于固态硬盘的地址映射系统结构示意图。FIG. 2 is a schematic structural diagram of an address mapping system applied to a solid-state disk disclosed in an embodiment of the present invention.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

本发明实施例公开了一种应用于固态硬盘的地址映射方法,参见图1所示,该方法包括:The embodiment of the present invention discloses an address mapping method applied to a solid-state hard disk, as shown in FIG. 1, the method includes:

步骤S11:确定固态硬盘中映射表的容量大小;Step S11: Determine the capacity of the mapping table in the solid state disk;

步骤S12:判断上述容量大小是否大于预设容量阈值;Step S12: judging whether the above-mentioned capacity is greater than a preset capacity threshold;

步骤S13:若上述容量大小大于预设容量阈值,则将固态硬盘的地址映射机制设为第一地址映射机制;若上述容量大小小于或等于预设容量阈值,则将固态硬盘的地址映射机制设为第二地址映射机制;Step S13: If the above-mentioned capacity is greater than the preset capacity threshold, then set the address mapping mechanism of the solid-state hard disk to the first address mapping mechanism; if the above-mentioned capacity is less than or equal to the preset capacity threshold, then set the address mapping mechanism of the solid-state hard disk to is the second address mapping mechanism;

其中,第一地址映射机制所需的映射表容量小于第二地址映射机制所需的映射表容量,且第二地址映射机制自身的映射性能优于第一地址映射机制自身的映射性能。Wherein, the capacity of the mapping table required by the first address mapping mechanism is smaller than that required by the second address mapping mechanism, and the mapping performance of the second address mapping mechanism itself is better than that of the first address mapping mechanism itself.

需要说明的是,固态硬盘中映射表的容量大小,也即固态硬盘中映射表所占空间的大小,是动态变化,通常会随着固态硬盘使用时间的变化而发生变化。步骤S11中,所谓确定固态硬盘中映射表的容量大小,是指确定固态硬盘中当前已有映射表的所占存储空间大小。It should be noted that the capacity of the mapping table in the solid-state disk, that is, the size of the space occupied by the mapping table in the solid-state disk, changes dynamically, and usually changes with the use time of the solid-state disk. In step S11, the so-called determination of the capacity of the mapping table in the solid state disk refers to determining the size of the storage space currently occupied by the existing mapping table in the solid state disk.

另外,需要进一步说明的是,上述步骤S12中的预设容量阈值具体为预先根据固态硬盘的存储空间大小,确定的关于映射表容量的阈值。通常来说,上述预设容量阈值的大小与固态硬盘存储空间的大小呈正相关关系,也即,固态硬盘存储空间越大,上述预设容量阈值也就可以设为一个较大的数值。In addition, it needs to be further explained that the preset capacity threshold in the above step S12 is specifically a threshold for the capacity of the mapping table determined in advance according to the storage space of the solid-state hard disk. Generally speaking, the above preset capacity threshold is positively correlated with the size of the storage space of the solid state disk, that is, the larger the storage space of the solid state disk, the above preset capacity threshold can be set to a larger value.

可见,本发明实施例可根据固态硬盘中映射表的容量大小程度,来灵活地选择不同的地址映射机制。也即,当固态硬盘中映射表的容量小于或等于预设容量阈值,由于此时映射表的容量较小,所以可采用映射性能较好的第二地址映射机制作为固态硬盘的地址映射机制;当固态硬盘中映射表的容量大于预设阈值,由于此时映射表的容量较大,所以可以采用对映射表容量需求较低的第一地址映射机制。综上可见,本发明实施例综合了两种不同地址映射机制的优点,使得在固态硬盘的映射表占用较小空间的同时,确保了固态硬盘具有较高的映射性能。It can be seen that in the embodiment of the present invention, different address mapping mechanisms can be flexibly selected according to the capacity of the mapping table in the solid state disk. That is, when the capacity of the mapping table in the solid-state hard disk is less than or equal to the preset capacity threshold, since the capacity of the mapping table is small at this time, the second address mapping mechanism with better mapping performance can be used as the address mapping mechanism of the solid-state hard disk; When the capacity of the mapping table in the solid state disk is greater than the preset threshold, since the capacity of the mapping table is larger at this time, the first address mapping mechanism that requires less capacity of the mapping table may be used. To sum up, the embodiment of the present invention combines the advantages of two different address mapping mechanisms, so that the solid-state hard disk has a relatively high mapping performance while the mapping table of the solid-state hard disk occupies a small space.

本发明实施例公开了一种具体的应用于固态硬盘的地址映射方法,相对于上一实施例,本实施例对技术方案作了进一步的说明和优化。具体的:The embodiment of the present invention discloses a specific address mapping method applied to solid state disks. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. specific:

根据上一实施例可知,第一地址映射机制所需的映射表容量小于第二地址映射机制所需的映射表容量,且第二地址映射机制自身的映射性能优于第一地址映射机制自身的映射性能。基于这一规则,本发明实施例公开了以下三种可行的组合方案。其中,According to the previous embodiment, it can be seen that the capacity of the mapping table required by the first address mapping mechanism is smaller than that required by the second address mapping mechanism, and the mapping performance of the second address mapping mechanism itself is better than that of the first address mapping mechanism itself. Mapping performance. Based on this rule, the embodiment of the present invention discloses the following three feasible combination schemes. in,

第一种组合方案具体为,第一地址映射机制为混合地址映射机制,第二地址映射机制为页地址映射机制。Specifically, the first combination scheme is that the first address mapping mechanism is a hybrid address mapping mechanism, and the second address mapping mechanism is a page address mapping mechanism.

第二种组合方案具体为,第一地址映射机制为块地址映射机制,第二地址映射机制为页地址映射机制。The second combination scheme specifically includes that the first address mapping mechanism is a block address mapping mechanism, and the second address mapping mechanism is a page address mapping mechanism.

第三种组合方案具体为,第一地址映射机制为块地址映射机制,第二地址映射机制为混合地址映射机制。The third combination scheme specifically includes that the first address mapping mechanism is a block address mapping mechanism, and the second address mapping mechanism is a hybrid address mapping mechanism.

需要说明一下的是,上述页地址映射机制的基本映射单元是页,在这种机制下,每一逻辑页都被映射到任意一个物理页。页地址映射机制具有信息管理灵活度高、空间利用率高以及垃圾回收负载小等方面的优点,也即,映射性能较好,不过这种机制需要的映射表容量较大。上述块地址映射机制的基本映射单位是块,在这种机制下,整个地址空间首先被表示为多个块,而每个块又包含多个页,每个页通过所属块号以及块内偏移量进行确定。块地址映射机制只需很小的RAM空间来存储映射表信息,不过这种映射机制不灵活,逻辑页只能被映射到同一个物理页,映射性能相对较差。而混合地址映射机制则是通过结合页地址映射机制以及块地址映射机制后得到的一种地址映射机制,其的优缺点介于页地址映射机制和块地址映射机制之间。It should be noted that the basic mapping unit of the above page address mapping mechanism is a page, and under this mechanism, each logical page is mapped to any physical page. The page address mapping mechanism has the advantages of high information management flexibility, high space utilization rate, and small garbage collection load, that is, better mapping performance, but this mechanism requires a larger mapping table capacity. The basic mapping unit of the above-mentioned block address mapping mechanism is a block. Under this mechanism, the entire address space is first represented as multiple blocks, and each block contains multiple pages. The displacement is determined. The block address mapping mechanism requires only a small RAM space to store the mapping table information, but this mapping mechanism is not flexible, and a logical page can only be mapped to the same physical page, and the mapping performance is relatively poor. The hybrid address mapping mechanism is an address mapping mechanism obtained by combining the page address mapping mechanism and the block address mapping mechanism, and its advantages and disadvantages are between the page address mapping mechanism and the block address mapping mechanism.

基于上述内容可知,上述三种映射机制所需映射表的大小关系为:页地址映射机制>混合地址映射机制>块地址映射机制。上述三种映射机制映射性能的大小关系为:页地址映射机制>混合地址映射机制>块地址映射机制。Based on the above content, it can be seen that the size relationship of the mapping tables required by the above three mapping mechanisms is: page address mapping mechanism>hybrid address mapping mechanism>block address mapping mechanism. The magnitude relationship of the mapping performance of the above three mapping mechanisms is: page address mapping mechanism>mixed address mapping mechanism>block address mapping mechanism.

可见,本发明实施例根据固态硬盘中映射表的容量大小程度,可灵活地选择不同的地址映射机制。也即,当固态硬盘中映射表的容量小于或等于预设容量阈值,采用映射性能较好的第二地址映射机制作为固态硬盘的地址映射机制;当固态硬盘中映射表的容量大于预设阈值,则采用对映射表容量需求较低的第一地址映射机制。通过这种根据映射表容量大小来灵活选择地址映射机制的方式能够综合两种不同地址映射机制的优点,使得在固态硬盘的映射表占用较小空间的同时,确保了固态硬盘具有较高的映射性能。It can be seen that in the embodiment of the present invention, different address mapping mechanisms can be flexibly selected according to the capacity of the mapping table in the solid state disk. That is, when the capacity of the mapping table in the solid-state hard disk is less than or equal to the preset capacity threshold, the second address mapping mechanism with better mapping performance is used as the address mapping mechanism of the solid-state hard disk; when the capacity of the mapping table in the solid-state hard disk is greater than the preset threshold , the first address mapping mechanism with a lower requirement on the capacity of the mapping table is adopted. Through this method of flexibly selecting the address mapping mechanism according to the size of the mapping table, the advantages of two different address mapping mechanisms can be combined, so that the mapping table of the solid-state hard disk occupies a small space while ensuring that the solid-state hard disk has a high mapping. performance.

为了减少失效映射表对固态硬盘映射性能造成的影响,本实施例中的地址映射方法,还可以进一步包括:按照预设的垃圾清除周期,定期对固态硬盘中失效的映射表进行清理。In order to reduce the impact of the invalid mapping table on the mapping performance of the solid-state hard disk, the address mapping method in this embodiment may further include: regularly cleaning the invalid mapping table in the solid-state hard disk according to a preset garbage removal cycle.

相应的,本发明实施例还公开了一种应用于固态硬盘的地址映射系统,参见图2所示,该系统包括:Correspondingly, the embodiment of the present invention also discloses an address mapping system applied to solid-state hard drives, as shown in Figure 2, the system includes:

容量确定模块21,用于确定固态硬盘中映射表的容量大小;Capacity determining module 21, is used for determining the capacity size of mapping table in the solid-state hard disk;

判断模块22,用于判断容量大小是否大于预设容量阈值;A judging module 22, configured to judge whether the capacity is greater than a preset capacity threshold;

映射控制模块23,用于当容量大小大于预设容量阈值,则将固态硬盘的地址映射机制设为第一地址映射机制,当容量大小小于或等于预设容量阈值,则将固态硬盘的地址映射机制设为第二地址映射机制;The mapping control module 23 is used to set the address mapping mechanism of the solid-state hard disk as the first address mapping mechanism when the capacity is greater than the preset capacity threshold, and set the address mapping mechanism of the solid-state hard disk to The mechanism is set as the second address mapping mechanism;

其中,第一地址映射机制所需的映射表容量小于第二地址映射机制所需的映射表容量,且第二地址映射机制自身的映射性能优于第一地址映射机制自身的映射性能。Wherein, the capacity of the mapping table required by the first address mapping mechanism is smaller than that required by the second address mapping mechanism, and the mapping performance of the second address mapping mechanism itself is better than that of the first address mapping mechanism itself.

需要进一步说明的是,上述预设容量阈值具体为预先根据固态硬盘的存储空间大小,确定的关于映射表容量的阈值。通常来说,上述预设容量阈值的大小与固态硬盘存储空间的大小呈正相关关系,也即,固态硬盘存储空间越大,上述预设容量阈值也就可以设为一个较大的数值。It should be further explained that the above-mentioned preset capacity threshold is specifically a threshold for the capacity of the mapping table determined in advance according to the storage space of the solid-state hard disk. Generally speaking, the above preset capacity threshold is positively correlated with the size of the storage space of the solid state disk, that is, the larger the storage space of the solid state disk, the above preset capacity threshold can be set to a larger value.

根据上述内容可知,第一地址映射机制所需的映射表容量小于第二地址映射机制所需的映射表容量,且第二地址映射机制自身的映射性能优于第一地址映射机制自身的映射性能。基于这一规则,本发明实施例公开了以下三种可行的组合方案。其中,According to the above content, it can be seen that the capacity of the mapping table required by the first address mapping mechanism is smaller than the capacity of the mapping table required by the second address mapping mechanism, and the mapping performance of the second address mapping mechanism itself is better than that of the first address mapping mechanism itself . Based on this rule, the embodiment of the present invention discloses the following three feasible combination schemes. in,

第一种组合方案具体为,第一地址映射机制为混合地址映射机制,第二地址映射机制为页地址映射机制。Specifically, the first combination scheme is that the first address mapping mechanism is a hybrid address mapping mechanism, and the second address mapping mechanism is a page address mapping mechanism.

第二种组合方案具体为,第一地址映射机制为块地址映射机制,第二地址映射机制为页地址映射机制。The second combination scheme specifically includes that the first address mapping mechanism is a block address mapping mechanism, and the second address mapping mechanism is a page address mapping mechanism.

第三种组合方案具体为,第一地址映射机制为块地址映射机制,第二地址映射机制为混合地址映射机制。The third combination scheme specifically includes that the first address mapping mechanism is a block address mapping mechanism, and the second address mapping mechanism is a hybrid address mapping mechanism.

为了减少失效映射表对固态硬盘映射性能造成的影响,本实施例中的地址映射系统,还可以进一步包括:In order to reduce the impact of the failure mapping table on the mapping performance of the solid-state hard disk, the address mapping system in this embodiment may further include:

清理模块,用于按照预设的垃圾清除周期,定期对固态硬盘中失效的映射表进行清理。The cleaning module is configured to regularly clean up invalid mapping tables in the solid state disk according to a preset garbage cleaning cycle.

可见,本发明实施例可根据固态硬盘中映射表的容量大小程度,来灵活地选择不同的地址映射机制。也即,当固态硬盘中映射表的容量小于或等于预设容量阈值,由于此时映射表的容量较小,所以可采用映射性能较好的第二地址映射机制作为固态硬盘的地址映射机制;当固态硬盘中映射表的容量大于预设阈值,由于此时映射表的容量较大,所以可以采用对映射表容量需求较低的第一地址映射机制。综上可见,本发明实施例综合了两种不同地址映射机制的优点,使得在固态硬盘的映射表占用较小空间的同时,确保了固态硬盘具有较高的映射性能。It can be seen that in the embodiment of the present invention, different address mapping mechanisms can be flexibly selected according to the capacity of the mapping table in the solid state disk. That is, when the capacity of the mapping table in the solid-state hard disk is less than or equal to the preset capacity threshold, since the capacity of the mapping table is small at this time, the second address mapping mechanism with better mapping performance can be used as the address mapping mechanism of the solid-state hard disk; When the capacity of the mapping table in the solid state disk is greater than the preset threshold, since the capacity of the mapping table is larger at this time, the first address mapping mechanism that requires less capacity of the mapping table may be used. To sum up, the embodiment of the present invention combines the advantages of two different address mapping mechanisms, so that the solid-state hard disk has a relatively high mapping performance while the mapping table of the solid-state hard disk occupies a small space.

另外,本发明实施例还进一步公开了一种固态硬盘,包括前述公开的地址映射系统。关于该地址映射系统的详细内容可参考前述实施例中公开的相关内容,在此不再重复赘述。In addition, the embodiment of the present invention further discloses a solid-state hard disk, including the address mapping system disclosed above. For details about the address mapping system, reference may be made to related content disclosed in the foregoing embodiments, and details are not repeated here.

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

以上对本发明所提供的一种地址映射方法、系统及固态硬盘进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The address mapping method, system and solid-state hard disk provided by the present invention have been described above in detail. In this paper, specific examples are used to illustrate the principle and implementation of the present invention. The description of the above embodiments is only used to help understand the present invention. The method of the invention and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and scope of application. In summary, the content of this specification should not be understood To limit the present invention.

Claims (10)

1.一种应用于固态硬盘的地址映射方法,其特征在于,包括:1. An address mapping method applied to solid-state hard drives, characterized in that, comprising: 确定固态硬盘中映射表的容量大小;Determine the capacity of the mapping table in the solid state drive; 判断所述容量大小是否大于预设容量阈值;judging whether the capacity is greater than a preset capacity threshold; 若所述容量大小大于所述预设容量阈值,则将所述固态硬盘的地址映射机制设为第一地址映射机制;If the capacity is greater than the preset capacity threshold, setting the address mapping mechanism of the solid-state hard disk as a first address mapping mechanism; 若所述容量大小小于或等于所述预设容量阈值,则将所述固态硬盘的地址映射机制设为第二地址映射机制;If the capacity is less than or equal to the preset capacity threshold, setting the address mapping mechanism of the solid-state hard disk as a second address mapping mechanism; 其中,所述第一地址映射机制所需的映射表容量小于所述第二地址映射机制所需的映射表容量,且所述第二地址映射机制自身的映射性能优于所述第一地址映射机制自身的映射性能。Wherein, the mapping table capacity required by the first address mapping mechanism is smaller than the mapping table capacity required by the second address mapping mechanism, and the mapping performance of the second address mapping mechanism itself is better than that of the first address mapping mechanism. The mapping performance of the mechanism itself. 2.根据权利要求1所述的应用于固态硬盘的地址映射方法,其特征在于,所述预设容量阈值为预先根据所述固态硬盘的存储空间大小,确定的关于映射表容量的阈值。2. The address mapping method applied to a solid-state hard disk according to claim 1, wherein the preset capacity threshold is a threshold value about the capacity of the mapping table determined in advance according to the storage space of the solid-state hard disk. 3.根据权利要求1所述的应用于固态硬盘的地址映射方法,其特征在于,所述第一地址映射机制为混合地址映射机制,所述第二地址映射机制为页地址映射机制。3. The address mapping method applied to solid state disks according to claim 1, wherein the first address mapping mechanism is a hybrid address mapping mechanism, and the second address mapping mechanism is a page address mapping mechanism. 4.根据权利要求1所述的应用于固态硬盘的地址映射方法,其特征在于,所述第一地址映射机制为块地址映射机制,所述第二地址映射机制为页地址映射机制。4. The address mapping method applied to a solid state disk according to claim 1, wherein the first address mapping mechanism is a block address mapping mechanism, and the second address mapping mechanism is a page address mapping mechanism. 5.根据权利要求1所述的应用于固态硬盘的地址映射方法,其特征在于,所述第一地址映射机制为块地址映射机制,所述第二地址映射机制为混合地址映射机制。5. The address mapping method applied to solid state disks according to claim 1, wherein the first address mapping mechanism is a block address mapping mechanism, and the second address mapping mechanism is a hybrid address mapping mechanism. 6.根据权利要求1至5任一项所述的应用于固态硬盘的地址映射方法,其特征在于,还包括:6. The address mapping method applied to a solid state disk according to any one of claims 1 to 5, further comprising: 按照预设的垃圾清除周期,定期对所述固态硬盘中失效的映射表进行清理。According to the preset garbage removal cycle, the invalid mapping table in the solid state disk is cleaned regularly. 7.一种应用于固态硬盘的地址映射系统,其特征在于,包括:7. An address mapping system applied to solid-state hard drives, characterized in that, comprising: 容量确定模块,用于确定固态硬盘中映射表的容量大小;A capacity determination module, configured to determine the capacity of the mapping table in the solid state drive; 判断模块,用于判断所述容量大小是否大于预设容量阈值;A judging module, configured to judge whether the capacity is greater than a preset capacity threshold; 映射控制模块,用于当所述容量大小大于所述预设容量阈值,则将所述固态硬盘的地址映射机制设为第一地址映射机制,当所述容量大小小于或等于所述预设容量阈值,则将所述固态硬盘的地址映射机制设为第二地址映射机制;A mapping control module, configured to set the address mapping mechanism of the solid-state hard disk as the first address mapping mechanism when the capacity is greater than the preset capacity threshold, and set the address mapping mechanism of the solid state disk to the first address mapping mechanism, and when the capacity is less than or equal to the preset capacity threshold, then the address mapping mechanism of the solid state disk is set as the second address mapping mechanism; 其中,所述第一地址映射机制所需的映射表容量小于所述第二地址映射机制所需的映射表容量,且所述第二地址映射机制自身的映射性能优于所述第一地址映射机制自身的映射性能。Wherein, the capacity of the mapping table required by the first address mapping mechanism is smaller than the capacity of the mapping table required by the second address mapping mechanism, and the mapping performance of the second address mapping mechanism itself is better than that of the first address mapping mechanism. The mapping performance of the mechanism itself. 8.根据权利要求7所述的应用于固态硬盘的地址映射系统,其特征在于,所述第一地址映射机制为混合地址映射机制,所述第二地址映射机制为页地址映射机制。8 . The address mapping system applied to solid state disks according to claim 7 , wherein the first address mapping mechanism is a hybrid address mapping mechanism, and the second address mapping mechanism is a page address mapping mechanism. 9.根据权利要求7或8所述的应用于固态硬盘的地址映射系统,其特征在于,还包括:9. The address mapping system applied to solid-state hard drives according to claim 7 or 8, further comprising: 清理模块,用于按照预设的垃圾清除周期,定期对所述固态硬盘中失效的映射表进行清理。The cleaning module is configured to regularly clean up the invalid mapping table in the solid-state hard disk according to the preset garbage cleaning cycle. 10.一种固态硬盘,其特征在于,包括如权利要求7至9任一项所述的地址映射系统。10. A solid state hard drive, comprising the address mapping system according to any one of claims 7 to 9.
CN201610274370.3A 2016-04-28 2016-04-28 Address mapping method and system as well as solid-state disk Pending CN105975403A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610274370.3A CN105975403A (en) 2016-04-28 2016-04-28 Address mapping method and system as well as solid-state disk

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610274370.3A CN105975403A (en) 2016-04-28 2016-04-28 Address mapping method and system as well as solid-state disk

Publications (1)

Publication Number Publication Date
CN105975403A true CN105975403A (en) 2016-09-28

Family

ID=56993793

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610274370.3A Pending CN105975403A (en) 2016-04-28 2016-04-28 Address mapping method and system as well as solid-state disk

Country Status (1)

Country Link
CN (1) CN105975403A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101241472A (en) * 2008-03-07 2008-08-13 威盛电子股份有限公司 Mapping management method and system
CN102364450A (en) * 2011-06-27 2012-02-29 浪潮电子信息产业股份有限公司 A method for NandFlash physical address and logical address mapping
CN103019958A (en) * 2012-10-31 2013-04-03 香港应用科技研究院有限公司 Method for managing data in solid state memory using data attributes
CN104077235A (en) * 2013-03-26 2014-10-01 擎泰科技股份有限公司 Method and memory system for dividing physical blocks
CN104133779A (en) * 2013-05-02 2014-11-05 擎泰科技股份有限公司 Non-volatile storage device and method for dynamically adjusting mapping mode thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101241472A (en) * 2008-03-07 2008-08-13 威盛电子股份有限公司 Mapping management method and system
CN102364450A (en) * 2011-06-27 2012-02-29 浪潮电子信息产业股份有限公司 A method for NandFlash physical address and logical address mapping
CN103019958A (en) * 2012-10-31 2013-04-03 香港应用科技研究院有限公司 Method for managing data in solid state memory using data attributes
CN104077235A (en) * 2013-03-26 2014-10-01 擎泰科技股份有限公司 Method and memory system for dividing physical blocks
CN104133779A (en) * 2013-05-02 2014-11-05 擎泰科技股份有限公司 Non-volatile storage device and method for dynamically adjusting mapping mode thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
马福祥: "SSD中一种地址映射算法研究", 《电子设计工程》 *

Similar Documents

Publication Publication Date Title
US20210255775A1 (en) File management method, distributed storage system, and management node
JP7404442B2 (en) A management system for operating storage media in multiple modes, a storage system including the same, and a method for managing storage media using the same
JP6890401B2 (en) Multiple mode storage management device, multiple mode storage device, and its selection latent exposure (SUE) mapping operation method
CN106681934B (en) Method and device for garbage collection of storage device
CN105159800B (en) Data reconstruction method, data back up method and relevant device, system
US9535628B2 (en) Memory system with shared file system
WO2019015479A1 (en) Method for achieving data copying in ftl of solid state drive, system and solid state drive
CN104462225B (en) The method, apparatus and system of a kind of digital independent
CN102662606B (en) Raid configuration information processing method and raid controller
CN105283855A (en) Method and device for addressing
US20140173178A1 (en) Joint Logical and Physical Address Remapping in Non-volatile Memory
EP3120250A1 (en) Solid state drive operations
CN103793332B (en) Data storage method and device based on memory, processor and electronic equipment
JP6522168B2 (en) Method and apparatus for managing a storage device
JP2016524770A (en) Method for writing data to flash memory device, flash memory device and storage system
CN113918087B (en) Storage device and method for managing namespace in storage device
CN107329909B (en) A data management method and device
KR20150139017A (en) Apparatus and method for controlling memory
CN108628762A (en) More NameSpaces
WO2022037016A1 (en) Method and system for storing tree structure data, and related apparatus
CN103412779B (en) A kind of patch file network system realization of embedded real-time operating system
TWM528459U (en) Data storage systems and electronic device
CN108762681A (en) A kind of solid state disk and its reading/writing method and device
CN105975403A (en) Address mapping method and system as well as solid-state disk
CN101866677A (en) Method for using memory

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20160928