WO2019047842A1 - 一种固态硬盘的逻辑分区方法及装置 - Google Patents

一种固态硬盘的逻辑分区方法及装置 Download PDF

Info

Publication number
WO2019047842A1
WO2019047842A1 PCT/CN2018/104094 CN2018104094W WO2019047842A1 WO 2019047842 A1 WO2019047842 A1 WO 2019047842A1 CN 2018104094 W CN2018104094 W CN 2018104094W WO 2019047842 A1 WO2019047842 A1 WO 2019047842A1
Authority
WO
WIPO (PCT)
Prior art keywords
unit
logical
solid state
units
logical unit
Prior art date
Application number
PCT/CN2018/104094
Other languages
English (en)
French (fr)
Inventor
王杰华
刘子明
殷军博
Original Assignee
郑州云海信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 郑州云海信息技术有限公司 filed Critical 郑州云海信息技术有限公司
Publication of WO2019047842A1 publication Critical patent/WO2019047842A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0617Improving the reliability of storage systems in relation to availability
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Definitions

  • the present invention relates to the field of hard disk partitioning, and in particular to a logical partitioning method and device for a solid state hard disk.
  • the SSD is a new type of storage device.
  • the storage medium uses NandFlash and the control protocol uses the NVMe (Non-Volatile Memory express) standard.
  • SSDs are more efficient, and users get faster operational feedback or data read and write when using SSDs, so SSDs are becoming a popular hardware product.
  • the so-called logical partition is to divide the whole space of a complete solid state hard disk into a plurality of independent spatial regions according to the requirements of the user, and the independent spatial region is a logical partition.
  • Each logical partition can be set to a different spatial capacity, different attributes, and different uses, and the logical partitions are relatively independent and can be managed separately by the user.
  • the NVMe standard uses logical partition units that allocate consecutive hard disks to form logical partitions. After adding and deleting logical partitions of different sizes, there will be discontinuous logical partition units in the SSD, which cannot be fully utilized, thereby reducing the space utilization efficiency of the SSD and making it difficult to ensure high availability of the SSD.
  • the object of the present invention is to provide a logical partitioning method and device for a solid state hard disk, which improves the space utilization efficiency of the solid state hard disk, thereby ensuring higher availability of the solid state hard disk.
  • the present invention provides a logical partitioning method for a solid state hard disk, including:
  • the idle logical unit in the solid state hard disk is recorded and recorded as follows:
  • the target idle logical unit whose acquisition quantity matches the total number of units is specifically:
  • the target idle logical unit is obtained according to the content recorded by the bitmap.
  • the method further comprises:
  • mapping the target idle logical unit to a logical partition is specifically:
  • the correspondence between the target idle logical unit and the ID information of the logical partition is recorded by the unit mapping table to map the target idle logical unit to a logical partition.
  • the method further comprises:
  • the target idle logical unit is found and deleted according to the ID information in the unit mapping table.
  • the method further comprises:
  • the method further includes:
  • the present invention also provides a logical partitioning device for a solid state hard disk, including:
  • a capacity preset module for acquiring a preset capacity of the logical partition
  • a unit calculation module configured to calculate a total number of units required according to a preset capacity and a unit capacity of the logic unit
  • a unit mapping module is configured to acquire a target idle logical unit whose number matches the total number of units, and map the target idle logical unit to a logical partition.
  • the device further comprises:
  • a mapping table generation module for generating a unit mapping table.
  • the device further comprises:
  • the unit deleting module is configured to find and delete the target idle logical unit according to the ID information in the unit mapping table.
  • the device further comprises:
  • the modification module is used to modify the content recorded in the bitmap and the unit mapping table accordingly.
  • the logical partitioning method of the solid state hard disk uses the logical unit as a basic unit constituting the logical partition, and records and records the idle logical unit in the solid state hard disk, thereby being able to record the idle logic when the logical partition needs to be generated.
  • a corresponding number of target idle logical units are selected in the unit to form a logical partition. Since the method counts all idle logical units in the solid state hard disk, and the idle logical unit may be discontinuous due to the current partitioning situation, the logical unit is continuously allocated to form logic according to the prior art.
  • the advantage of partitioning is that the method provided by the present invention can also use the logical unit when the logical unit is discontinuous, thereby mapping and combining the discrete logical units into components of the logical partition to avoid waste of space. Therefore, the method relatively improves the space utilization efficiency of the solid state hard disk, thereby ensuring higher availability of the solid state hard disk.
  • the present invention also provides a logical partitioning device for a solid state hard disk, and the advantageous effects are as described above.
  • FIG. 1 is a flowchart of a logical partitioning method of a solid state hard disk according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a logical partitioning method of another solid state hard disk according to an embodiment of the present invention
  • FIG. 3 is a structural diagram of a logical partition device of a solid state hard disk according to an embodiment of the present invention.
  • the core of the invention is to provide a logical partitioning method for a solid state hard disk, which improves the space utilization efficiency of the solid state hard disk, thereby ensuring higher availability of the solid state hard disk.
  • the core of the present invention also provides a logical partitioning device for a solid state hard disk.
  • FIG. 1 is a flowchart of a logical partitioning method of a solid state hard disk according to an embodiment of the present invention. Referring to FIG. 1, the specific steps of the logical partitioning method of the solid state hard disk include:
  • Step S10 Acquire a preset capacity of the logical partition.
  • a logical partition needs to be generated, the user needs to set the partition size first, so that the number of logical units used can be determined according to the partition size in the subsequent steps.
  • the setting of the logical partition size may be defined according to the actual role of the logical partition, or may be determined according to the user's experience, and is not specifically limited herein.
  • Step S11 Calculate the total number of required units according to the preset capacity and the unit capacity of the logical unit.
  • the logical unit is the basic building block of the logical partition.
  • the logical unit is a unit that constitutes a logical partition, that is, a logical partition is generated by a combination of logical units. It can be understood that, in this step, the total number of required units is calculated according to the preset capacity of the logical partition and the unit capacity of the logical unit, so that the corresponding number of logics can be obtained according to the total number of units obtained in this step in the subsequent steps. Units are organized into logical partitions.
  • Step S12 Count the idle logical unit in the solid state hard disk and record.
  • the idle logical unit is the smallest component unit for composing a new logical partition.
  • the idle logical unit in the solid state hard disk is recorded and recorded for the purpose of subsequent use.
  • the logic unit is idle, the corresponding number of idle logic units can be selected according to the idle logic unit information recorded in this step.
  • Step S13 Acquire a target idle logical unit whose number matches the total number of units, and map the target idle logical unit to a logical partition.
  • This step is to select the corresponding number of idle logical units required to form a logical partition in the idle logical unit recorded in the above step. Since there may be different logical partitions occupying discrete logical units in the solid state hard disk, there are discontinuous idle logical units. Therefore, in the above steps, it is equivalent to integrating the discrete idle logical units, and the use of the discontinuous idle logical units is realized in the step.
  • the logical partitioning method of the solid state hard disk uses the logical unit as a basic unit constituting the logical partition, and records and records the idle logical unit in the solid state hard disk, thereby being able to record the idle logic when the logical partition needs to be generated.
  • a corresponding number of target idle logical units are selected in the unit to form a logical partition. Since the method counts all idle logical units in the solid state hard disk, and the idle logical unit may be discontinuous due to the current partitioning situation, the logical unit is continuously allocated to form logic according to the prior art.
  • the advantage of partitioning is that the method provided by the present invention can also use the logical unit when the logical unit is discontinuous, thereby mapping and combining the discrete logical units into components of the logical partition to avoid waste of space. Therefore, the method relatively improves the space utilization efficiency of the solid state hard disk, thereby ensuring higher availability of the solid state hard disk.
  • the idle logical unit in the solid state hard disk is counted and recorded as follows:
  • the target idle logical unit whose acquisition quantity matches the total number of units is specifically:
  • the target idle logical unit is obtained according to the content recorded by the bitmap.
  • bitmap is the abbreviation of bitmap.
  • bitmap is to use each bit to store a certain state. It is suitable for large-scale data, but the data state is not a lot of situations. It is usually used to judge whether a certain data exists. .
  • each logical unit may correspond to a bit of a bitmap. If the logical partition unit of the corresponding position is used, the bit is marked as 1, and if not used, it is marked as 0.
  • FIG. 2 is a flowchart of a logical partitioning method of another solid state hard disk according to an embodiment of the present invention. Steps S10-S12 in FIG. 2 are the same as those in FIG. 1, and are not described herein again.
  • the method before mapping the target idle logical unit to a logical partition, the method further includes:
  • Step S20 Generate a unit mapping table.
  • step S13 is specifically:
  • Step S21 Record the correspondence between the target idle logical unit and the ID information of the logical partition through the unit mapping table to map the target idle logical unit into a logical partition.
  • a unit mapping table may be generated and the correspondence between the logical partition and the logical unit may be recorded in the mapping table, so that the user can intuitively Understand the allocation of logical units, and facilitate the user's subsequent operations on logical units and logical partitions. It should be noted that the step of generating the unit mapping table only needs to be performed between the unit mapping tables, but the specific execution order is not limited.
  • the method further includes:
  • Step S22 Find the target idle logical unit according to the ID information in the unit mapping table and delete it.
  • the ID information is a unique identifier unique to the logical unit for characterizing its own identity. Therefore, in the mapping table, the corresponding idle logical unit can be found according to the ID information, and the idle logical unit can be deleted.
  • the idle logical unit constitutes a logical partition, so deleting the idle logical unit is equivalent to deleting the logical partition.
  • the method further includes:
  • Step S23 Perform corresponding modification on the content recorded in the bitmap and the unit mapping table.
  • the method further includes:
  • the space capacity of the idle logical unit in the solid state hard disk may not meet the space requirement of the user for the logical partition, and the logical partition cannot be normally generated. Therefore, it can be determined whether the total capacity of the idle logical unit satisfies the preset capacity before acquiring the idle logical unit, and if so, the allocation is continued; otherwise, the error message is prompted and the user is waiting for further processing.
  • a logical partitioning method for a solid state hard disk is described in detail.
  • the present invention further provides a logical partitioning device for a solid state hard disk. Since the embodiment of the device portion and the embodiment of the method portion correspond to each other, For the embodiment of the device part, please refer to the description of the embodiment of the method part, and details are not described herein.
  • FIG. 3 is a structural diagram of a logical partition device of a solid state hard disk according to an embodiment of the present invention.
  • a logical partitioning device for a solid state hard disk according to an embodiment of the present invention includes:
  • the capacity preset module 10 is configured to acquire a preset capacity of the logical partition.
  • the unit calculation module 11 is configured to calculate a required total number of units according to the preset capacity and the unit capacity of the logic unit.
  • the statistical recording module 12 is configured to count idle logical units in the solid state hard disk and perform recording.
  • the unit mapping module 13 is configured to acquire a target idle logical unit whose number matches the total number of units, and map the target idle logical unit to a logical partition.
  • the logical partitioning device of the solid state hard disk uses the logical unit as a basic unit constituting the logical partition, and records and records the idle logical unit in the solid state hard disk, thereby being able to record the idle logic when the logical partition needs to be generated.
  • a corresponding number of target idle logical units are selected in the unit to form a logical partition. Since the device counts all the idle logical units in the solid state hard disk, and the idle logical unit may be discontinuous due to the current partitioning situation, the logical units are continuously allocated to form logic according to the prior art.
  • the advantage of partitioning is that the apparatus provided by the present invention can also use the logical unit in the case where the logical unit is discontinuous, thereby mapping and combining the discrete logical units into components of the logical partition to avoid waste of space. Therefore, the device relatively improves the space utilization efficiency of the solid state hard disk, thereby ensuring higher availability of the solid state hard disk.
  • the device further includes:
  • a mapping table generation module for generating a unit mapping table.
  • the device further includes:
  • the unit deleting module is configured to find and delete the target idle logical unit according to the ID information in the unit mapping table.
  • the device further includes:
  • the modification module is used to modify the content recorded in the bitmap and the unit mapping table accordingly.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种固态硬盘的逻辑分区方法及装置,该方法包括:获取逻辑分区的预设容量(S10);根据预设容量以及逻辑单元的单元容量计算所需的单元总数(S11);其中,逻辑单元为逻辑分区的基本组成单元;统计固态硬盘中的空闲逻辑单元并进行记录(S12);获取数量与单元总数相匹配的目标空闲逻辑单元,并将目标空闲逻辑单元映射为逻辑分区(S13)。可见,本方法在逻辑单元不连续的情况下同样能够使用该逻辑单元,进而将不连续的逻辑单元进行映射组合成为逻辑分区的组成部分以避免空间的浪费。因此,本方法相对提高了固态硬盘的空间利用效率,进而保证了固态硬盘具有更高可用性。

Description

一种固态硬盘的逻辑分区方法及装置
本申请要求于2017年9月7日提交中国专利局、申请号为201710800786.9、发明名称为“一种固态硬盘的逻辑分区方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及硬盘分区领域,特别是涉及一种固态硬盘的逻辑分区方法及装置。
背景技术
固态硬盘是一种新型存储设备,其存储介质采用NandFlash,控制协议采用NVMe(Non-Volatile Memory express)标准。固态硬盘具有更高的工作效率,用户在使用固态硬盘时能够得到更加快速的操作反馈或数据读写,因此固态硬盘逐渐成为广受用户欢迎的硬件产品。
目前在使用固态硬盘时往往需要通过NVMe标准所提供的命令进行逻辑分区。所谓逻辑分区,就是将一块完整的固态硬盘的整体空间按照用户的要求划分为多个独立空间区域,该独立空间区域即逻辑分区。每个逻辑分区可以设定为不同的空间容量,不同的属性以及不同的用途,并且逻辑分区均相对独立并且可以由用户单独管理。
尽管逻辑分区能够使固态硬盘应用于不同类型的工作,大大增加了固态硬盘的对于工作类型的扩展性,但是由于NVMe标准采用分配连续的硬盘的逻辑分区单元以组成逻辑分区的方式,因此当多次添加并删除不同大小的逻辑分区后,会导致固态硬盘中存在不连续的逻辑分区单元,无法被充分利用,进而降低了固态硬盘的空间利用效率,难以保证固态硬盘的高可用性。
由此可见,提供一种固态硬盘的逻辑分区方法,以提高固态硬盘的空间利用效率进而保证固态硬盘具有高可用性,是本领域技术人员亟待解决的问题。
发明内容
本发明的目的是提供一种固态硬盘的逻辑分区方法及装置,提高固态硬盘的空间利用效率,进而保证固态硬盘具有更高可用性。
为解决上述技术问题,本发明提供一种固态硬盘的逻辑分区方法,包括:
获取逻辑分区的预设容量;
根据预设容量以及逻辑单元的单元容量计算所需的单元总数;其中,逻辑单元为逻辑分区的基本组成单元;
统计固态硬盘中的空闲逻辑单元并进行记录;
获取数量与单元总数相匹配的目标空闲逻辑单元,并将目标空闲逻辑单元映射为逻辑分区。
优选的,统计固态硬盘中的空闲逻辑单元并进行记录具体为:
统计空闲逻辑单元并以位图的形式进行记录;
相应的,获取数量与单元总数相匹配的目标空闲逻辑单元具体为:
根据位图所记录的内容获取目标空闲逻辑单元。
优选的,在将目标空闲逻辑单元映射为逻辑分区之前,该方法进一步包括:
生成单元映射表;
相应的,将目标空闲逻辑单元映射为逻辑分区具体为:
通过单元映射表记录目标空闲逻辑单元与逻辑分区的ID信息之间的对应关系在以将目标空闲逻辑单元映射为逻辑分区。
优选的,该方法进一步包括:
在单元映射表中根据ID信息查找到目标空闲逻辑单元并进行删除。
优选的,该方法进一步包括:
对位图以及单元映射表中所记录的内容进行相应修改。
优选的,在统计固态硬盘中的空闲逻辑单元并进行记录后,该方法进一步包括:
判断空闲逻辑单元的总容量是否满足预设容量;
如果是,则执行获取数量与单元总数相匹配的目标空闲逻辑单元的步 骤,
否则,提示错误信息。
此外,本发明还提供一种固态硬盘的逻辑分区装置,包括:
容量预设模块,用于获取逻辑分区的预设容量;
单元计算模块,用于根据预设容量以及逻辑单元的单元容量计算所需的单元总数;
统计记录模块,用于统计固态硬盘中的空闲逻辑单元并进行记录;
单元映射模块,用于获取数量与单元总数相匹配的目标空闲逻辑单元,并将目标空闲逻辑单元映射为逻辑分区。
优选的,该装置进一步包括:
映射表生成模块,用于生成单元映射表。
优选的,该装置进一步包括:
单元删除模块,用于在单元映射表中根据ID信息查找到目标空闲逻辑单元并进行删除。
优选的,该装置进一步包括:
修改模块,用于对位图以及单元映射表中所记录的内容进行相应修改。
本发明所提供的固态硬盘的逻辑分区方法,将逻辑单元作为组成逻辑分区的基本单元,通过统计并记录固态硬盘中的空闲逻辑单元,进而在需要生成逻辑分区时,能够在所记录的空闲逻辑单元中选取相应数量目标空闲逻辑单元以组成逻辑分区。由于本方法所统计的是固态硬盘中所有的空闲逻辑单元,而空闲逻辑单元可能会受当前分区情况的影响会存在不连续的情况,因此相比于现有技术中连续分配逻辑单元以组成逻辑分区的好处在于,本发明所提供的方法,在逻辑单元不连续的情况下同样能够使用该逻辑单元,进而将不连续的逻辑单元进行映射组合成为逻辑分区的组成部分以避免空间的浪费。因此,本方法相对提高了固态硬盘的空间利用效率,进而保证了固态硬盘具有更高可用性。此外,本发明还提供一种固态硬盘的逻辑分区装置,有益效果如上所述。
附图说明
图1为本发明实施例提供的一种固态硬盘的逻辑分区方法流程图;
图2为本发明实施例提供的另一种固态硬盘的逻辑分区方法流程图;
图3为本发明实施例提供的一种固态硬盘的逻辑分区装置结构图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下,所获得的所有其他实施例,都属于本发明保护范围。
本发明的核心是提供一种固态硬盘的逻辑分区方法,提高固态硬盘的空间利用效率,进而保证固态硬盘具有更高可用性。此外,本发明的核心还提供一种固态硬盘的逻辑分区装置。
为了使本技术领域的人员更好地理解本发明方案,下面结合附图和具体实施方式对本发明作进一步的详细说明。
实施例一
图1为本发明实施例提供的一种固态硬盘的逻辑分区方法流程图。请参考图1,固态硬盘的逻辑分区方法的具体步骤包括:
步骤S10:获取逻辑分区的预设容量。
可以理解的是,当需要生成逻辑分区时,用户需要先进行对于分区大小的设定,进而才能够在后续步骤中根据分区大小确定使用的逻辑单元数量。对于逻辑分区大小的设定可以根据该逻辑分区的实际作用进行规定,也可以根据用户的使用经验而定,在此不做具体限定。
步骤S11:根据预设容量以及逻辑单元的单元容量计算所需的单元总数。
其中,逻辑单元为逻辑分区的基本组成单元。
需要说明的是,逻辑单元为组成逻辑分区的单位,即通过逻辑单元的 组合生成逻辑分区。可以理解的是,在本步骤中根据逻辑分区的预设容量以及逻辑单元的单元容量计算所需的单元总数的目的是,能够在后续步骤中依照本步骤所得到的单元总数获取相应数量的逻辑单元以组成逻辑分区。
步骤S12:统计固态硬盘中的空闲逻辑单元并进行记录。
可以理解的是,新的逻辑分区中应该不存在数据,因此空闲逻辑单元是用于组成新的逻辑分区的最小组成单位,统计固态硬盘中的空闲逻辑单元并记录的目的是,当后续需要使用空闲逻辑单元时能根据本步骤所记录的空闲逻辑单元信息选取相应数量的空闲逻辑单元。
步骤S13:获取数量与单元总数相匹配的目标空闲逻辑单元,并将目标空闲逻辑单元映射为逻辑分区。
本步骤是在上述步骤中所记录的空闲逻辑单元中,选取组成逻辑分区所需的相应数量的空闲逻辑单元。由于在固态硬盘中可能存在不同逻辑分区占用着不连续的逻辑单元的情况,进而存在不连续的空闲逻辑单元。因此在上述步骤中相当于对不连续的空闲逻辑单元进行了整合,近而在步骤实现了对不连续的空闲逻辑单元的使用。
本发明所提供的固态硬盘的逻辑分区方法,将逻辑单元作为组成逻辑分区的基本单元,通过统计并记录固态硬盘中的空闲逻辑单元,进而在需要生成逻辑分区时,能够在所记录的空闲逻辑单元中选取相应数量目标空闲逻辑单元以组成逻辑分区。由于本方法所统计的是固态硬盘中所有的空闲逻辑单元,而空闲逻辑单元可能会受当前分区情况的影响会存在不连续的情况,因此相比于现有技术中连续分配逻辑单元以组成逻辑分区的好处在于,本发明所提供的方法,在逻辑单元不连续的情况下同样能够使用该逻辑单元,进而将不连续的逻辑单元进行映射组合成为逻辑分区的组成部分以避免空间的浪费。因此,本方法相对提高了固态硬盘的空间利用效率,进而保证了固态硬盘具有更高可用性。
实施例二
在上述实施例的基础上,作为一种优选的实施方式,统计固态硬盘中 的空闲逻辑单元并进行记录具体为:
统计空闲逻辑单元并以位图的形式进行记录;
相应的,获取数量与单元总数相匹配的目标空闲逻辑单元具体为:
根据位图所记录的内容获取目标空闲逻辑单元。
需要说明的是,位图就是bitmap的缩写,所谓bitmap,就是用每一位来存放某种状态,适用于大规模数据,但数据状态又不是很多的情况,通常用来判断某个数据是否存在。在具体使用时,可以每一个逻辑单元对应一个位图的比特位,若对应的位置的逻辑分区单元已使用,则该比特位标记为1,若没有使用,则标记为0。
图2为本发明实施例提供的另一种固态硬盘的逻辑分区方法流程图。图2中步骤S10-S12与图1相同,在此不再赘述。
如图2所示,作为一种优选的实施方式,在将目标空闲逻辑单元映射为逻辑分区之前,该方法进一步包括:
步骤S20:生成单元映射表。
相应的,步骤S13具体为:
步骤S21:通过单元映射表记录目标空闲逻辑单元与逻辑分区的ID信息之间的对应关系在以将目标空闲逻辑单元映射为逻辑分区。
可以理解的是,为了明确逻辑分区中的逻辑单元的信息以及逻辑单元所属的逻辑分区,可以生成单元映射表并将逻辑分区与逻辑单元之间的对应关系记录在映射表中,进而用户可以直观的了解逻辑单元的分配情况,并且能够方便用户对逻辑单元以及逻辑分区的后续操作。需要说明的是,生成单元映射表的步骤只需要在使用该单元映射表之间进行,但是对于具体的执行顺序不做限定。
如图2所示,在上述实施方式的基础上,作为一种优选的实施方式,该方法进一步包括:
步骤S22:在单元映射表中根据ID信息查找到目标空闲逻辑单元并进行删除。
需要说明的是,ID信息是逻辑单元所特有的用于表征自身身份的唯一标识,因此在映射表中可以根据ID信息查找到对应的空闲逻辑单元,进而能够将空闲逻辑单元进行删除操作,由于空闲逻辑单元组成了逻辑分区,因此将空闲逻辑单元进行删除进而相当于删除了逻辑分区。
如图2所示,在上述实施方式的基础上,作为一种优选的实施方式,该方法进一步包括:
步骤S23:对位图以及单元映射表中所记录的内容进行相应修改。
可以理解的是,由于逻辑单元与逻辑分区的对应关系记录于单元映射表中,而逻辑单元的使用情况记录于位图中,因此当有逻辑单元被删除或是进行改动时,上述的对应关系以及使用情况可能都会产生相应的改变,因此在进行了逻辑单元的删改时需要对位图以及单元映射表中所记录的内容进行相应修改。
此外,作为一种优选的实施方式,在统计固态硬盘中的空闲逻辑单元并进行记录后,该方法进一步包括:
判断空闲逻辑单元的总容量是否满足预设容量,如果是,则执行步骤S21,
否则,提示错误信息。
需要说明的是,当进行空闲逻辑单元获取时,可能会存在固态硬盘中的空闲逻辑单元的空间容量无法满足用户对于逻辑分区的空间需求的情况,进而无法正常生成逻辑分区。因此,可以在获取空闲逻辑单元之前判断判断空闲逻辑单元的总容量是否满足预设容量,如果是,则继续分配,否则,提示错误信息并等待用户做进一步处理。
实施例三
在上文中对于一种固态硬盘的逻辑分区方法的实施例进行了详细的描述,本发明还提供一种固态硬盘的逻辑分区装置,由于装置部分的实施例与方法部分的实施例相互对应,因此装置部分的实施例请参见方法部分的 实施例的描述,这里暂不赘述。
图3为本发明实施例提供的一种固态硬盘的逻辑分区装置结构图。如图3所示,本发明实施例提供的一种固态硬盘的逻辑分区装置,包括:
容量预设模块10,用于获取逻辑分区的预设容量。
单元计算模块11,用于根据预设容量以及逻辑单元的单元容量计算所需的单元总数。
统计记录模块12,用于统计固态硬盘中的空闲逻辑单元并进行记录。
单元映射模块13,用于获取数量与单元总数相匹配的目标空闲逻辑单元,并将目标空闲逻辑单元映射为逻辑分区。
本发明所提供的固态硬盘的逻辑分区装置,将逻辑单元作为组成逻辑分区的基本单元,通过统计并记录固态硬盘中的空闲逻辑单元,进而在需要生成逻辑分区时,能够在所记录的空闲逻辑单元中选取相应数量目标空闲逻辑单元以组成逻辑分区。由于本装置所统计的是固态硬盘中所有的空闲逻辑单元,而空闲逻辑单元可能会受当前分区情况的影响会存在不连续的情况,因此相比于现有技术中连续分配逻辑单元以组成逻辑分区的好处在于,本发明所提供的装置,在逻辑单元不连续的情况下同样能够使用该逻辑单元,进而将不连续的逻辑单元进行映射组合成为逻辑分区的组成部分以避免空间的浪费。因此,本装置相对提高了固态硬盘的空间利用效率,进而保证了固态硬盘具有更高可用性。
在实施例三的基础上,作为一种优选的实施方式,该装置进一步包括:
映射表生成模块,用于生成单元映射表。
在实施例三的基础上,作为一种优选的实施方式,该装置进一步包括:
单元删除模块,用于在单元映射表中根据ID信息查找到目标空闲逻辑单元并进行删除。
在实施例三的基础上,作为一种优选的实施方式,该装置进一步包括:
修改模块,用于对位图以及单元映射表中所记录的内容进行相应修改。
以上对本发明所提供的一种固态硬盘的逻辑分区方法及装置进行了详细介绍。说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以对本发明进行若干改进和修饰,这些改进和修饰也落入本发明权利要求的保护范围内。
还需要说明的是,在本说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。

Claims (10)

  1. 一种固态硬盘的逻辑分区方法,其特征在于,包括:
    获取逻辑分区的预设容量;
    根据所述预设容量以及逻辑单元的单元容量计算所需的单元总数;其中,所述逻辑单元为所述逻辑分区的基本组成单元;
    统计固态硬盘中的空闲逻辑单元并进行记录;
    获取数量与所述单元总数相匹配的目标空闲逻辑单元,并将所述目标空闲逻辑单元映射为所述逻辑分区。
  2. 根据权利要求1所述的方法,其特征在于,所述统计固态硬盘中的空闲逻辑单元并进行记录具体为:
    统计所述空闲逻辑单元并以位图的形式进行记录;
    相应的,所述获取数量与所述单元总数相匹配的目标空闲逻辑单元具体为:
    根据所述位图所记录的内容获取所述目标空闲逻辑单元。
  3. 根据权利要求1所述的方法,其特征在于,在所述将所述目标空闲逻辑单元映射为所述逻辑分区之前,该方法进一步包括:
    生成单元映射表;
    相应的,所述将所述目标空闲逻辑单元映射为所述逻辑分区具体为:
    通过所述单元映射表记录所述目标空闲逻辑单元与所述逻辑分区的ID信息之间的对应关系在以将所述目标空闲逻辑单元映射为所述逻辑分区。
  4. 根据权利要求3所述的方法,其特征在于,该方法进一步包括:
    在所述单元映射表中根据所述ID信息查找到所述目标空闲逻辑单元并进行删除。
  5. 根据权利要求4所述的方法,其特征在于,该方法进一步包括:
    对所述位图以及所述单元映射表中所记录的内容进行相应修改。
  6. 根据权利要求1至5任意一项所述的方法,其特征在于,在所述统计固态硬盘中的空闲逻辑单元并进行记录后,该方法进一步包括:
    判断所述空闲逻辑单元的总容量是否满足所述预设容量;
    如果是,则执行获取数量与所述单元总数相匹配的目标空闲逻辑单元的步骤,
    否则,提示错误信息。
  7. 一种固态硬盘的逻辑分区装置,其特征在于,包括:
    容量预设模块,用于获取逻辑分区的预设容量;
    单元计算模块,用于根据所述预设容量以及逻辑单元的单元容量计算所需的单元总数;
    统计记录模块,用于统计固态硬盘中的空闲逻辑单元并进行记录;
    单元映射模块,用于获取数量与所述单元总数相匹配的目标空闲逻辑单元,并将所述目标空闲逻辑单元映射为所述逻辑分区。
  8. 根据权利要求7所述的装置,其特征在于,该装置进一步包括:
    映射表生成模块,用于生成单元映射表。
  9. 根据权利要求8所述的装置,其特征在于,该装置进一步包括:
    单元删除模块,用于在所述单元映射表中根据所述ID信息查找到所述目标空闲逻辑单元并进行删除。
  10. 根据权利要求9所述的装置,其特征在于,该装置进一步包括:
    修改模块,用于对所述位图以及所述单元映射表中所记录的内容进行相应修改。
PCT/CN2018/104094 2017-09-07 2018-09-05 一种固态硬盘的逻辑分区方法及装置 WO2019047842A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710800786.9 2017-09-07
CN201710800786.9A CN107704199A (zh) 2017-09-07 2017-09-07 一种固态硬盘的逻辑分区方法及装置

Publications (1)

Publication Number Publication Date
WO2019047842A1 true WO2019047842A1 (zh) 2019-03-14

Family

ID=61172195

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/104094 WO2019047842A1 (zh) 2017-09-07 2018-09-05 一种固态硬盘的逻辑分区方法及装置

Country Status (2)

Country Link
CN (1) CN107704199A (zh)
WO (1) WO2019047842A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107704199A (zh) * 2017-09-07 2018-02-16 郑州云海信息技术有限公司 一种固态硬盘的逻辑分区方法及装置
CN109491612A (zh) * 2018-11-15 2019-03-19 苏州韦科韬信息技术有限公司 一种固态硬盘的逻辑分区方法及装置
CN113590032A (zh) * 2021-06-30 2021-11-02 郑州云海信息技术有限公司 固态硬盘名称空间的创建方法、装置、设备及可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101556557A (zh) * 2009-05-14 2009-10-14 浙江大学 一种基于对象存储设备的对象文件组织方法
CN103777903A (zh) * 2014-01-23 2014-05-07 武汉市烽视威科技有限公司 一种适用于流媒体服务的数据存储方法
CN106897229A (zh) * 2017-02-28 2017-06-27 郑州云海信息技术有限公司 一种硬盘分区方法及系统
CN106959825A (zh) * 2017-03-21 2017-07-18 浙江宇视科技有限公司 基于raid磁盘阵列的数据读取方法及装置
CN107704199A (zh) * 2017-09-07 2018-02-16 郑州云海信息技术有限公司 一种固态硬盘的逻辑分区方法及装置

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060074872A1 (en) * 2004-09-30 2006-04-06 International Business Machines Corporation Adaptive database buffer memory management using dynamic SQL statement cache statistics
CN100382048C (zh) * 2005-11-08 2008-04-16 中兴通讯股份有限公司 一种内存管理方法
CN100590609C (zh) * 2008-02-22 2010-02-17 浙江大学 一种基于非连续页的动态内存管理方法
CN103064794B (zh) * 2013-02-04 2016-05-25 烽火通信科技股份有限公司 实现mpls标签高效管理的方法
US10048865B2 (en) * 2014-10-24 2018-08-14 Microsoft Technology Licensing, Llc Disk partition stitching and rebalancing using a partition table
CN105302738B (zh) * 2015-12-09 2018-09-11 北京东土科技股份有限公司 一种内存分配方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101556557A (zh) * 2009-05-14 2009-10-14 浙江大学 一种基于对象存储设备的对象文件组织方法
CN103777903A (zh) * 2014-01-23 2014-05-07 武汉市烽视威科技有限公司 一种适用于流媒体服务的数据存储方法
CN106897229A (zh) * 2017-02-28 2017-06-27 郑州云海信息技术有限公司 一种硬盘分区方法及系统
CN106959825A (zh) * 2017-03-21 2017-07-18 浙江宇视科技有限公司 基于raid磁盘阵列的数据读取方法及装置
CN107704199A (zh) * 2017-09-07 2018-02-16 郑州云海信息技术有限公司 一种固态硬盘的逻辑分区方法及装置

Also Published As

Publication number Publication date
CN107704199A (zh) 2018-02-16

Similar Documents

Publication Publication Date Title
US20230315290A1 (en) Namespaces allocation in non-volatile memory devices
EP3367251B1 (en) Storage system and solid state hard disk
US9229826B2 (en) Volatile memory representation of nonvolatile storage device set
CN110663019B (zh) 用于叠瓦式磁记录(smr)的文件系统
US10108450B2 (en) Mechanism for SSDs to efficiently manage background activity with notify
JP6890401B2 (ja) 多重モード格納管理装置、多重モード格納装置、及びその選別潜在露出(sue)マッピング動作方法
US11262916B2 (en) Distributed storage system, data processing method, and storage node
WO2021082157A1 (zh) 一种元数据、数据存储、共享方法、系统及设备
WO2017185579A1 (zh) 一种数据存储方法及装置
CN108255415B (zh) 建立多重命名空间方法与存取多重命名空间的数据的方法
JP2017021805A (ja) 不揮発性メモリ装置内でデータ属性基盤データ配置を利用可能にするインターフェイス提供方法及びコンピュータ装置
WO2019047842A1 (zh) 一种固态硬盘的逻辑分区方法及装置
WO2013004136A1 (zh) 分布式存储方法、装置和系统
WO2017084348A1 (zh) Ip硬盘的管理方法和装置
WO2019149261A1 (zh) 分布式文件系统的文件存储方法及分布式文件系统
CN109144406B (zh) 分布式存储系统中元数据存储方法、系统及存储介质
WO2016115920A1 (zh) 存储管理方法、装置及流媒体系统
WO2022257302A1 (zh) Ai训练平台的训练任务创建方法、装置、系统及介质
WO2019072250A1 (zh) 一种文件管理方法、文件管理系统、电子设备及存储介质
WO2020192710A1 (zh) 基于lsm数据库的垃圾处理的方法、固态硬盘以及存储装置
JP2016500459A (ja) 監視レコード管理方法及びデバイス
CN112181274B (zh) 提升存储设备性能稳定性的大块的组织方法及其存储设备
CN104133970A (zh) 一种数据空间管理方法及装置
CN109902033B (zh) 应用于NVMe SSD控制器的namespace的LBA分配方法和映射方法
WO2022252063A1 (zh) 数据存取方法、存储控制器和存储设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18852844

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18852844

Country of ref document: EP

Kind code of ref document: A1