WO2014029087A1 - 访问固态硬盘空间的方法、装置及系统 - Google Patents

访问固态硬盘空间的方法、装置及系统 Download PDF

Info

Publication number
WO2014029087A1
WO2014029087A1 PCT/CN2012/080464 CN2012080464W WO2014029087A1 WO 2014029087 A1 WO2014029087 A1 WO 2014029087A1 CN 2012080464 W CN2012080464 W CN 2012080464W WO 2014029087 A1 WO2014029087 A1 WO 2014029087A1
Authority
WO
WIPO (PCT)
Prior art keywords
space
block request
ssd
disk
block
Prior art date
Application number
PCT/CN2012/080464
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 华为技术有限公司
Priority to CN201280002464.5A priority Critical patent/CN103827837B/zh
Priority to PCT/CN2012/080464 priority patent/WO2014029087A1/zh
Publication of WO2014029087A1 publication Critical patent/WO2014029087A1/zh

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/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems

Definitions

  • the present invention relates to the field of storage technologies, and in particular, to a method, apparatus, and system for accessing a solid state hard disk space. Background technique
  • a data center usually consists of three parts: server, network, and storage.
  • a solid state disk (SSD) is used instead of a conventional disk as a storage device.
  • the SSD is a hard disk made of a solid state electronic chip array, and is composed of a control unit and a storage unit, wherein the storage unit is responsible for storage. Data, the control unit is responsible for reading and writing data. Since the SSD does not contain mechanical components, it does not require seek operations and has good random read and write performance. However, because SSDs are more expensive than traditional disks, SSDs are often used as a cache for traditional disks to speed up user access to the disk. Since the SSD has a limited capacity and is usually smaller than the capacity of the disk, it is necessary to periodically write data that is not used in the SSD to the disk.
  • the disk space is usually divided into M parts (M is a natural number) disk subspace according to the SSD capacity, and the SSD space is divided into N (N is a natural number) SETs ( Block set), for each disk subspace, according to the division of SSD space, it is divided into N SETs.
  • M is a natural number
  • N is a natural number
  • SETs Block set
  • the location of the data stored in the disk space corresponds to a fixed SET.
  • the SSD is known.
  • Some SETs in space will be accessed frequently for reading, writing, and erasing of data; for example, assuming that the first SET on each disk subspace is frequently accessed in M disk subspaces, it corresponds to the SSD space.
  • the first SET on the SSD space will be accessed frequently, thereby reducing the cache efficiency and efficiency of the SSD.
  • the embodiment of the invention provides a method, a device and a system for accessing a solid-state hard disk space, so as to solve the problem that the cache efficiency and the use efficiency of the SSD in the prior art are not high.
  • a method for accessing a space of a solid state hard disk including at least two packets, each packet being a packet obtained by equally dividing a plurality of block sets SET included in the SSD space, wherein The SETs in each of the packets have the same index number, and the SETs having the same offset in the at least two packets belong to the same logical group, and the method includes:
  • Mapping a block request for accessing disk space to a first logical group on the SSD space acquiring, by a mapping function, an index number of the first SET mapped by the block request within the first logical group;
  • the block request is written to the first SET.
  • the mapping, that the block request for accessing the disk space, to the first logical grouping on the SSD space includes:
  • the acquiring, by using a mapping function, the first SET that the block request is mapped in the first logical group Index number including:
  • the writing the block request to the first SET including:
  • an apparatus for accessing a space of a solid state hard disk comprising:
  • a dividing unit configured to divide a solid-state hard disk SSD space including a plurality of block sets SET into at least two packets, wherein the SETs in each of the packets have the same index number, and the at least two packets have the same Offset SETs belong to the same logical grouping;
  • a mapping unit configured to map a block request for accessing the disk space to the first logical grouping on the SSD space divided by the dividing unit;
  • an obtaining unit configured to acquire, by using a mapping function, an index number of the first SET mapped by the block request in the first logical group mapped by the mapping unit;
  • a writing unit configured to write the block request to the first SET corresponding to an index number acquired by the acquiring unit.
  • the mapping unit includes: a start offset obtaining subunit, configured to acquire a block request for accessing the disk space on the disk space.
  • a SET number calculation subunit configured to calculate, according to the start offset obtained by the start offset acquisition subunit, a SET number of the second SET corresponding to the block request on the disk space;
  • a packet number calculation subunit configured to calculate, according to the number of SETs included in each of the at least two packets and the SET number of the second SET calculated by the SET number calculation subunit The packet number of the first logical grouping on the SSD space.
  • the acquiring unit includes:
  • An input value obtaining subunit configured to obtain an input value of the mapping function according to a starting offset of the block request on the disk space
  • an index number obtaining subunit configured to modulate the preset parameter by using the input value obtained by the input value obtaining subunit, and obtain an index number of the first SET mapped by the block request in the first logical group.
  • the writing unit includes:
  • a SET number determining subunit configured to determine a SET number of the first SET in the SSD space according to a packet number of the first logical group and an index number of the first SET;
  • the block request writing subunit is configured to write the block request to the first SET by determining a SET number of the first SET determined by the subunit according to the SET number.
  • a system for accessing a solid state hard disk space comprising: a disk, a solid state hard disk SSD, and a controller,
  • the controller is configured to divide an SSD space including several SETs to obtain at least two packets, wherein SETs in each packet have the same index number, and the SETs with the same offset in the at least two packets Belong to the same logical grouping, when receiving a block request to access the disk space of the disk,
  • the block request is mapped to a first logical group on the SSD space of the SSD, and the index number of the first SET mapped by the block request in the first logical group is obtained by a mapping function, and the block request is written Enter the first SET.
  • the controller is specifically configured to obtain a starting offset of a block request for accessing the disk space on the disk space, according to the The starting offset calculates a SET number of the second SET corresponding to the block request on the disk space, according to the number of SETs included in each of the at least two packets and the SET number of the second SET Calculating a packet number of the first logical group on the SSD space to which the block request is mapped.
  • the controller is specifically configured to perform a starting offset on the disk space according to the block request. And shifting, obtaining an input value of the mapping function, and modulating the preset parameter by using the input value, and acquiring an index number of the first SET mapped by the block request in the first logical group.
  • the controller is specifically configured to be used according to the foregoing Determining a SET number of the first SET in the SSD space by a packet number of a logical group and an index number of the first SET, and writing the block request according to a SET number of the first SET Said the first SET.
  • the SSD space including several SETs is equally divided to obtain at least two packets, wherein the SETs in each packet have the same index number, and the SETs having the same offset in at least two packets belong to the same Logical grouping, when receiving a block request for accessing disk space, mapping the block request to a first logical group on the SSD space, and obtaining, by a mapping function, an index of the first SET mapped by the block request within the first logical group Number, the block request is written to the first SET.
  • the SSD space is grouped, so that the block request is mapped to a certain logical group after the partition, and since each logical group includes a SET that is consistent with the number of the packets, the SSD space is uniformly accessed.
  • FIG. 1A is a flow chart of an embodiment of a method for accessing a solid state hard disk space according to the present invention
  • FIG. 1B is a schematic diagram of a mapping relationship between a disk and an SSD in the prior art
  • FIG. 1C is a schematic diagram of grouping SSD spaces according to an embodiment of the present invention
  • FIG. 2A is a flow chart of another embodiment of a method for accessing a solid state hard disk space according to the present invention.
  • FIG. 2B is a schematic diagram of an application example in conjunction with the embodiment of FIG. 2A;
  • FIG. 3 is a block diagram of an embodiment of an apparatus for accessing a solid state hard disk space according to the present invention
  • FIG. 4 is a block diagram of an embodiment of a system for accessing a solid state hard disk space of the present invention.
  • DETAILED DESCRIPTION OF THE INVENTION The following embodiments of the present invention provide methods, apparatus, and systems for accessing SSD space.
  • Step 101 Map a block request for accessing disk space to a first logical grouping on an SSD space.
  • the disk space is usually larger than the SSD, and the SSD has good access performance. Therefore, the SSD can be used as a disk cache to speed up the user's access to the disk.
  • the SSD space including several block sets SET may be equally divided to obtain at least two packets, wherein the SETs in each packet have the same index number, and at least two packets have the same Offset SETs belong to the same logical grouping.
  • the foregoing SSD space partitioning does not need to be performed every time the SSD space is accessed, and may be performed only once when the SSD space is initially accessed, and each subsequent access to the SSD space may be accessed based on the partitioning result at the initial access.
  • This embodiment is not limited in this embodiment.
  • FIG. 1B it is a schematic diagram of a mapping relationship between a disk and an SSD in the prior art:
  • the direct mapping between the disk and the SSD is adopted, that is, the i-th SET on each disk subspace is mapped to the i-th SET on the SSD space (i ranges from 1 to N), due to the common M disk subspaces, so equivalent to M SETs on the disk subspace correspond to a SET on the SSD space.
  • FIG. 1C it is a schematic diagram of grouping SSD spaces in an embodiment of the present invention:
  • N SETs in the SSD space are K-divided to obtain K groups, each of which is divided into The group contains N/K SETs, wherein N/K SETs in each packet have the same index number.
  • the index numbers of the K packets are 0 to K-1, respectively;
  • the SETs having the same offset in the packet belong to the same logical grouping.
  • the logical grouping has a packet number of 0 to N/K1.
  • this step optionally, obtaining a starting offset of the block request for accessing the disk space on the disk space, and calculating a SET number of the second SET corresponding to the block request in the disk space according to the starting offset,
  • the packet number of the first logical group on the mapped SSD space is calculated based on the number of SETs included in each of the at least two packets and the SET number of the second SET.
  • Step 102 Acquire, by the mapping function, an index number of the first SET mapped by the block request within the first logical group.
  • the starting offset of the block request on the disk space obtaining an input value of the mapping function, and modulating the preset parameter by using the input value, acquiring the first SET mapped by the block request in the first logical group Index number.
  • the mapping function may be specifically a hash function; at this time, the input value may include: a starting offset of the block request on the disk space, or a pseudo-random use of the starting offset of the block request on the disk space The random value generated by the function.
  • Step 103 Write a block request to the first SET.
  • this embodiment groups the SSD space, thereby mapping the block request to a certain logical group after division, since each logical group includes a SET consistent with the number of packets, thereby realizing
  • FIG. 2A it is a flowchart of another embodiment of a method for accessing a space of a solid state hard disk according to the present invention. The embodiment is described in conjunction with a specific application example:
  • Step 201 Obtain a starting offset of the block request for accessing the disk space on the disk space.
  • the disk space is usually larger than the SSD, and the SSD has good access performance, so the SSD can be used as a disk cache to speed up the user's access speed to the disk.
  • the SSD space including several block sets SET may be equally divided to obtain at least two packets, wherein the SETs in each packet have the same index number, and at least two packets have SETs of the same offset belong to the same logical grouping.
  • the foregoing SSD space division does not need to be performed every time the SSD space is accessed, and may be performed only once when the SSD space is initially accessed, and each subsequent The access to the SSD space at one time can be accessed based on the result of the division at the time of initial access, which is not limited in this embodiment.
  • mapping between the disk and the SSD and the description of the SSD space are consistent with the description of the embodiment shown in FIG. 1 , and details are not described herein again.
  • a schematic diagram of an application example shown in FIG. 2B is assumed, assuming that the disk space is 40G, the SSD space is 10G, and each SET in the SSD space is composed of 512 blocks, each block having a size of 4 KB.
  • the index numbers of the five groups are 0, 1, 2, 3, and 4; the group numbers of the 1000 logical groups are 0 to 999.
  • the starting offset of a block request that normally accesses disk space on disk space is represented by its starting sector offset.
  • each SET has a size of 2M and each sector has a size of 512Kb
  • the starting sector offsets for block requests that access disk space are 12288, 12296, and 12304, respectively.
  • Step 202 Calculate, according to the starting offset, the SET number of the second SET corresponding to the disk space. After obtaining the starting sector offset of the block request on the disk space, it is necessary to calculate the SET on the disk space to which the block request belongs based on the starting sector offset.
  • each SET contains 4096 sectors
  • Step 203 Calculate a packet number of the first logical group on the mapped SSD space according to the number of SETs included in each of the at least two packets and the SET number of the second SET.
  • Step 204 Obtain an input value of the mapping function according to the starting offset of the block request on the disk space.
  • the mapping function assumed in this embodiment is a hash function, and the input value of the hash function uses the starting sector offset of the block request in the disk space, that is, the input values of the three block requests are 12288, 12296 and 12304.
  • Step 205 Perform modulo on the preset parameter by the input value, and obtain an index number of the first SET that the block requests to be mapped in the first logical group.
  • the hash function is used to modulate the starting sector offset of each block request on the disk space according to the number of times of the SSD space, as the index number of the block requesting the logical group to which it belongs.
  • Step 206 Determine the SET number of the first SET in the SSD space according to the packet number of the first logical group and the index number of the first SET.
  • the packet number (base) of the logical group mapped by each block request, and the index number (index) within each logical group are obtained, and at this time, three block requests are calculated in the entire SSD space according to the following formula.
  • the above three block requests are respectively mapped to three SETs whose SET numbers are 2002, 2 and 3002. Therefore, when the data hotspot area appears on the disk, the block request mapped to the entire space of the SSD will tend to be balanced.
  • Step 207 Write the block request to the first SET according to the SET number of the first SET in the SSD space.
  • this embodiment groups the SSD space to map the block request to a certain logical group after division. Since each logical group includes a SET that is consistent with the number of packets, the SSD is realized. Uniform access to space improves the efficiency and efficiency of SSD caching.
  • the present invention also provides an embodiment of an apparatus and system for accessing SSD space.
  • the apparatus includes: a dividing unit 310, a mapping unit 320, an obtaining unit 330, and a writing unit 340.
  • the dividing unit 310 is configured to divide the SSD space including the plurality of block sets SET into at least two packets, wherein the SETs in each of the packets have the same index number, and the at least two groups SETs with the same offset belong to the same logical grouping;
  • the mapping unit 320 is configured to map a block request for accessing the disk space to the first logical grouping on the SSD space divided by the dividing unit 310;
  • the obtaining unit 330 is configured to acquire, by using a mapping function, an index number of the first SET mapped by the block request in the first logical group mapped by the mapping unit 320;
  • the writing unit 340 is configured to write the block request to the first SET corresponding to the index number acquired by the acquiring unit 330.
  • mapping unit 320 may include (not shown in FIG. 3):
  • a start offset obtaining subunit configured to obtain a starting offset of the block request for accessing the disk space on the disk space
  • a SET number calculation subunit configured to calculate, according to the start offset obtained by the start offset acquisition subunit, a SET number of the second SET corresponding to the block request on the disk space;
  • a packet number calculation subunit configured to calculate, according to the number of SETs included in each of the at least two packets and the SET number of the second SET calculated by the SET number calculation subunit The packet number of the first logical grouping on the SSD space.
  • the obtaining unit 330 may include (not shown in FIG. 7):
  • An input value acquisition subunit configured to obtain an input value of the mapping function according to the starting offset of the block request on the disk space; optionally, the mapping function may be specifically a hash function;
  • the input value may include: a starting offset of the block request on the disk space, or a random value generated by using a pseudo-random function for a starting offset of the block on the disk space;
  • an index number obtaining subunit configured to modulate the preset parameter by using the input value obtained by the input value obtaining subunit, and obtain an index number of the first SET mapped by the block request in the first logical group.
  • the writing unit 340 may include (not shown in FIG. 3):
  • a SET number determining subunit configured to determine a SET number of the first SET in the SSD space according to a packet number of the first logical group and an index number of the first SET;
  • FIG. 4 it is a block diagram of an embodiment of a system for accessing a solid state hard disk space according to the present invention:
  • the system includes: a disk 410, a solid state drive SSD 420, and a controller 430.
  • the controller 410 is configured to divide the SSD space including a plurality of block sets SET into at least two packets, wherein the SETs in each of the packets have the same index number, and the at least two SETs having the same offset within a packet belong to the same logical group, and when receiving a block request for accessing the disk space of the disk, mapping the block request to the first logic on the SSD space of the SSD And grouping, obtaining, by the mapping function, an index number of the first SET that the block requests are mapped within the first logical group, and writing the block request to the first SET.
  • the controller 430 may be specifically configured to obtain a starting offset of a block request for accessing the disk space on the disk space, and calculate the block request according to the starting offset. Calculating, by the SET number of the second SET corresponding to the disk space, the mapping of the block request according to the number of SETs included in each of the at least two packets and the SET number of the second SET The packet number of the first logical grouping on the SSD space.
  • the controller 430 may be specifically configured to obtain an input value of the mapping function according to a starting offset of the block request on the disk space, and use the input value to obtain a preset parameter. And obtaining an index number of the first SET mapped by the block request within the first logical group.
  • the controller 430 may be specifically configured to determine, according to the packet number of the first logical group and the index number of the first SET, a SET number of the first SET in the SSD space. The block request is written to the first SET according to the SET number of the first SET.
  • the SSD space including several SETs is equally divided to obtain at least two packets, wherein the SETs in each packet have the same index number, and the SETs having the same offset in the at least two packets belong to The same logical grouping, when receiving a block request for accessing the disk space, mapping the block request to the first logical group on the SSD space, and acquiring, by the mapping function, the first SET mapped by the block request within the first logical group The index number is written to the first SET.
  • the SSD space is grouped, so that the block request is mapped to a certain logical group after the partition, and since each logical group includes a SET that is consistent with the number of the packets, the SSD space is uniformly accessed. Improve the cache efficiency and efficiency of SSD.
  • the techniques in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, the technical solution in the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product, which may be stored in a storage medium such as a ROM/RAM. , disk, CD, etc., including a number of instructions to make one
  • a computer device (which may be a personal computer, server, or network device, etc.) performs the methods described in various embodiments of the present invention or in some portions of the embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

访问硬盘空间的方法、装置及系统,该固态硬盘SSD空间包括至少两个分组,每个分组为将所述SSD空间中包含的若干块集合SET进行等分所获得的分组,其中所述每个分组内的SET具有相同的索引号,至少两个分组内具有相同偏移的SET属于同一个逻辑分组,该方法包括:将对磁盘空间进行访问的块请求映射到所述SSD空间上的第一逻辑分组;通过映射函数获取块请求在第一逻辑分组内所映射的第一SET的索引号;将块请求写入第一SET。本发明实施例将SSD空间进行分组,从而将块请求映射到划分后的某个逻辑分组上,由于每个逻辑分组内包括与分组的数量一致的SET,由此实现了SSD空间的均匀访问,提高了SSD的缓存效率和使用效率。

Description

访问固态硬盘空间的方法、 装置及系统
技术领域 本发明涉及存储技术领域, 特别涉及访问固态硬盘空间的方法、 装置及系统。 背景技术
数据中心通常由服务器、 网络和存储设备三部分组成。现有技术中逐步采用固态 硬盘 (Sol id State Disk, SSD ) 替代传统磁盘作为存储设备, SSD 是用固态电子芯 片阵列制成的硬盘,由控制单元和存储单元两部分组成,其中存储单元负责存储数据, 控制单元负责读取、 写入数据。 由于 SSD不包含机械部件, 因此不需要寻道操作, 具 有良好的随机读写性能。但是, 由于 SSD价格高于传统磁盘, 因此通常将 SSD作为传 统磁盘的缓存, 以加速用户对磁盘的访问速度。 由于 SSD容量有限, 通常比磁盘的容 量小, 因此需要定期将 SSD中暂时不用的数据写入磁盘。
现有技术中在实现磁盘与 SSD之间的映射时,通常将磁盘空间按照 SSD容量等分 为 M份(M为自然数)磁盘子空间, 将 SSD空间划分成 N (N为自然数)个 SET (块集 合), 对于每个磁盘子空间按照 SSD空间的划分方式相应划分为 N个 SET。 按照上述 方式对磁盘空间和 SSD空间进行划分后,磁盘与 SSD之间采用直接映射方式, 即每个 磁盘子空间上的第 i个 SET均映射到 SSD空间上的第 i个 SET上 (i的取值范围为 1 至 N), 由于共有 M个磁盘子空间, 因此相当于磁盘子空间上的 M个 SET对应 SSD空 间上的一个 SET。
现有技术中, 由于磁盘空间上的某些数据会被经常访问, 这些数据存储在磁盘空 间的位置对应到固定的 SET, 根据磁盘空间上 SET与 SSD空间上 SET之间的映射关系 可知, SSD空间上的某些 SET将被频繁访问, 进行数据的读写和擦除; 例如, 假设 M 个磁盘子空间中, 每个磁盘子空间上的第一个 SET被经常访问, 则对应到 SSD空间, 该 SSD空间上的第一个 SET将被频繁访问, 由此降低了 SSD的缓存效率和使用效率。 发明内容
本发明实施例提供一种访问固态硬盘空间的方法、装置及系统, 以解决现有技术 中 SSD的缓存效率和使用效率不高的问题。
为了解决上述技术问题, 本发明实施例公开了如下技术方案: 一方面,提供一种访问固态硬盘空间的方法,所述固态硬盘 SSD空间包括至少两 个分组,每个分组为将所述 SSD空间中包含的若干块集合 SET进行等分所获得的分组, 其中所述每个分组内的 SET具有相同的索引号,所述至少两个分组内具有相同偏移的 SET属于同一个逻辑分组, 所述方法包括:
将对磁盘空间进行访问的块请求映射到所述 SSD空间上的第一逻辑分组; 通过映射函数获取所述块请求在所述第一逻辑分组内所映射的第一 SET 的索引 号;
将所述块请求写入所述第一 SET。
结合上述一方面,在第一种可能的实现方式中,所述将对磁盘空间进行访问的块 请求映射到所述 SSD空间上的第一逻辑分组, 包括:
获取对所述磁盘空间进行访问的块请求在所述磁盘空间上的起始偏移; 根据所述起始偏移计算所述块请求在所述磁盘空间上所对应第二 SET的 SET编 号;
根据所述至少两个分组中的每个分组所包含的 SET数量和所述第二 SET 的 SET 编号计算所述块请求所映射的所述 SSD空间上的第一逻辑分组的分组号。
结合上述一方面, 和 /或第一种可能的实现方式, 在第二种可能的实现方式中, 所述通过映射函数获取所述块请求在所述第一逻辑分组内所映射的第一 SET 的索引 号, 包括:
根据所述块请求在所述磁盘空间上的起始偏移, 获取所述映射函数的输入值; 通过所述输入值对预设参数求模,获取所述块请求在所述第一逻辑分组内所映射 的第一 SET的索引号。
结合上述一方面, 和 /或第一种可能的实现方式, 和 /或第二种可能的实现方式, 在第三种可能的实现方式中, 所述将所述块请求写入所述第一 SET, 包括:
根据所述第一逻辑分组的分组号和所述第一 SET 的索引号, 确定所述第一 SET 在所述 SSD空间内的 SET编号;
按照所述第一 SET在所述 SSD空间内的 SET编号, 将所述块请求写入所述第一
SET。
另一方面, 提供一种访问固态硬盘空间的装置, 所述装置包括:
划分单元,用于将包含若干块集合 SET的固态硬盘 SSD空间进行等分, 获得至少 两个分组,其中所述每个分组内的 SET具有相同的索引号,所述至少两个分组内具有 相同偏移的 SET属于同一个逻辑分组; 映射单元,用于将对磁盘空间进行访问的块请求映射到所述划分单元所划分的所 述 SSD空间上的第一逻辑分组;
获取单元,用于通过映射函数获取所述块请求在所述映射单元所映射的第一逻辑 分组内所映射的第一 SET的索引号;
写入单元,用于将所述块请求写入与所述获取单元所获取的索引号对应的所述第 一 SET。
结合上述另一方面, 在第一种可能的实现方式中, 所述映射单元包括: 起始偏移获取子单元,用于获取对所述磁盘空间进行访问的块请求在所述磁盘空 间上的起始偏移;
SET编号计算子单元, 用于根据所述起始偏移获取子单元获取的起始偏移计算所 述块请求在所述磁盘空间上所对应第二 SET的 SET编号;
分组号计算子单元,用于根据所述至少两个分组中的每个分组所包含的 SET数量 和所述 SET编号计算子单元所计算的第二 SET的 SET编号计算所述块请求所映射的所 述 SSD空间上的第一逻辑分组的分组号。
结合上述另一方面,和 /或第一种可能的实现方式,在第二种可能的实现方式中, 所述获取单元包括:
输入值获取子单元,用于根据所述块请求在所述磁盘空间上的起始偏移, 获取所 述映射函数的输入值;
索引号获取子单元,用于通过所述输入值获取子单元获取的输入值对预设参数求 模, 获取所述块请求在所述第一逻辑分组内所映射的第一 SET的索引号。
结合上述另一方面,和 /或第一种可能的实现方式,和 /或第二种可能的实现方式, 在第三种可能的实现方式中, 所述写入单元包括:
SET编号确定子单元, 用于根据所述第一逻辑分组的分组号和所述第一 SET的索 引号, 确定所述第一 SET在所述 SSD空间内的 SET编号;
块请求写入子单元, 用于按照所述 SET编号确定子单元所确定的第一 SET的 SET 编号, 将所述块请求写入所述第一 SET。
又一方面, 提供一种访问固态硬盘空间的系统, 所述系统包括: 磁盘、 固态硬盘 SSD和控制器,
所述控制器, 用于将包含若干 SET的 SSD空间进行等分, 获得至少两个分组, 其 中每个分组内的 SET 具有相同的索引号, 所述至少两个分组内具有相同偏移的 SET 属于同一个逻辑分组, 当接收到对所述磁盘的磁盘空间进行访问的块请求时,将所述 块请求映射到所述 SSD的 SSD空间上的第一逻辑分组,通过映射函数获取所述块请求 在所述第一逻辑分组内所映射的第一 SET 的索引号, 并将所述块请求写入所述第一 SET。
结合上述又一方面, 在第一种可能的实现方式中, 所述控制器, 具体用于获取对 所述磁盘空间进行访问的块请求在所述磁盘空间上的起始偏移,根据所述起始偏移计 算所述块请求在所述磁盘空间上所对应第二 SET的 SET编号,根据所述至少两个分组 中的每个分组所包含的 SET数量和所述第二 SET的 SET编号计算所述块请求所映射的 所述 SSD空间上的第一逻辑分组的分组号。
结合上述又一方面,和 /或第一种可能的实现方式,在第二种可能的实现方式中, 所述控制器, 具体用于根据所述块请求在所述磁盘空间上的起始偏移, 获取所述映射 函数的输入值,通过所述输入值对预设参数求模, 获取所述块请求在所述第一逻辑分 组内所映射的第一 SET的索引号。
结合上述又一方面,和 /或第一种可能的实现方式,和 /或第二种可能的实现方式, 在第三种可能的实现方式中,所述控制器, 具体用于根据所述第一逻辑分组的分组号 和所述第一 SET的索引号,确定所述第一 SET在所述 SSD空间内的 SET编号, 按照所 述第一 SET的 SET编号, 将所述块请求写入所述第一 SET。
本发明实施例中, 将包含若干 SET的 SSD空间进行等分, 获得至少两个分组, 其 中每个分组内的 SET具有相同的索引号,至少两个分组内具有相同偏移的 SET属于同 一个逻辑分组, 当接收到对磁盘空间进行访问的块请求时,将块请求映射到 SSD空间 上的第一逻辑分组, 通过映射函数获取块请求在第一逻辑分组内所映射的第一 SET 的索引号, 将块请求写入该第一 SET。 本发明实施例将 SSD空间进行分组, 从而将块 请求映射到划分后的某个逻辑分组上,由于每个逻辑分组内包括与分组的数量一致的 SET, 由此实现了 SSD空间的均匀访问, 提高了 SSD的缓存效率和使用效率。 附图说明 为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现 有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅 是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前 提下, 还可以根据这些附图获得其他的附图。
图 1A为本发明访问固态硬盘空间的方法的一个实施例流程图;
图 1B为现有技术中磁盘与 SSD之间的映射关系示意图; 图 1C为本发明实施例中对 SSD空间进行分组的示意图;
图 2A为本发明访问固态硬盘空间的方法的另一个实施例流程图;
图 2B为结合图 2A实施例的一个应用实例示意图;
图 3为本发明访问固态硬盘空间的装置的实施例框图;
图 4为本发明访问固态硬盘空间的系统的实施例框图。 具体实施方式 本发明如下实施例提供了访问固态硬盘空间的方法、 装置及系统。
为了使本技术领域的人员更好地理解本发明实施例中的技术方案,并使本发明实 施例的上述目的、特征和优点能够更加明显易懂, 下面结合附图对本发明实施例中技 术方案作进一步详细的说明。
参见图 1A, 为本发明访问固态硬盘空间的方法的一个实施例流程图: 步骤 101 : 将对磁盘空间进行访问的块请求映射到 SSD空间上的第一逻辑分组。 根据磁盘与固态硬盘 SSD各自的特点, 磁盘的空间通常大于 SSD, 而 SSD具有良 好的访问性能, 因此可以将 SSD作为磁盘的缓存, 以加速用户对磁盘的访问速度。本 实施例中在访问 SSD空间之前,可以将包含若干块集合 SET的 SSD空间进行等分, 获 得至少两个分组, 其中每个分组内的 SET具有相同的索引号, 至少两个分组内具有 相同偏移的 SET属于同一个逻辑分组。需要说明的是, 上述对 SSD空间进行划分无需 在每一次访问 SSD空间时都执行,可以仅在初始访问 SSD空间时执行一次,后续每一 次访问 SSD空间都可以基于初始访问时的划分结果进行访问,对此本实施例不进行限 制。
参见图 1B, 为现有技术中磁盘与 SSD之间的映射关系示意图:
将磁盘空间按照 SSD容量等分为 M个 (M为自然数)磁盘子空间, 将 SSD空间划 分成 N ( N为自然数) 个 SET, 对于每个磁盘子空间按照 SSD空间的划分方式相应划 分为 N个 SET。 如图 IB所示, 其中 SSD包含的 N个 SET的编号为从 0至 N-l, 磁盘上 包含的 N X M个 SET的编号为从 0至 N X (M-1)。 其中, 磁盘与 SSD之间采用直接映射 方式, 即每个磁盘子空间上的第 i个 SET均映射到 SSD空间上的第 i个 SET上 (i的 取值范围为 1至 N), 由于共有 M个磁盘子空间, 因此相当于磁盘子空间上的 M个 SET 对应 SSD空间上的一个 SET。
参见图 1C, 为本发明实施例中对 SSD空间进行分组的示意图:
本发明实施例中, 将 SSD空间中的 N个 SET进行 K等分, 获得 K个分组, 每个分 组内包含 N/K个 SET , 其中每个分组内的 N/K个 SET具有相同的索引号, 如图 1C所 示, K个分组的索引号分别为 0至 K-1 ; 其中, K个分组中具有相同偏移的 SET属于 同一个逻辑分组, 如图 1C所示, 逻辑分组的分组号分别为 0至 N/K-l。
本步骤中,可选的,获取对磁盘空间进行访问的块请求在磁盘空间上的起始偏移, 根据起始偏移计算该块请求在磁盘空间上所对应的第二 SET的 SET编号,根据至少两 个分组中的每个分组所包含的 SET数量和第二 SET的 SET编号计算块请求所映射的 SSD空间上的第一逻辑分组的分组号。
步骤 102: 通过映射函数获取块请求在第一逻辑分组内所映射的第一 SET的索引 号。
可选的, 根据块请求在磁盘空间上的起始偏移, 获取映射函数的输入值, 通过该 输入值对预设参数求模, 获取块请求在第一逻辑分组内所映射的第一 SET的索引号。
可选的, 映射函数可以具体为哈希函数; 此时, 输入值可以包括: 块请求在磁盘 空间上的起始偏移, 或者,对块请求在磁盘空间上的起始偏移使用伪随机函数生成的 随机值。
步骤 103: 将块请求写入第一 SET。
可选的, 根据第一逻辑分组的分组号和第一 SET的索引号, 确定第一 SET在 SSD 空间内的 SET编号, 按照第一 SET在 SSD空间内的 SET编号, 将该块请求写入第一 SET。
由上述实施例可见, 该实施例将 SSD空间进行分组, 从而将块请求映射到划分后 的某个逻辑分组上, 由于每个逻辑分组内包括与分组的数量一致的 SET, 由此实现了
SSD空间的均匀访问, 提高了 SSD的缓存效率和使用效率。 参见图 2A, 为本发明访问固态硬盘空间的方法的另一个实施例流程图, 该实施 例结合一个具体的应用实例进行描述:
步骤 201 : 获取对磁盘空间进行访问的块请求在磁盘空间上的起始偏移。
根据磁盘与固态硬盘 SSD各自的特点, 磁盘的空间通常大于 SSD, 而 SSD具有良 好的访问性能, 因此可以将 SSD作为磁盘的缓存, 以加速用户对磁盘的访问速度。本 实施例中在执行访问 SSD空间之前,可以将包含若干块集合 SET的 SSD空间进行等分, 获得至少两个分组, 其中每个分组内的 SET具有相同的索引号, 至少两个分组内具 有相同偏移的 SET属于同一个逻辑分组。需要说明的是, 上述对 SSD空间进行划分无 需在每一次访问 SSD空间时都执行,可以仅在初始访问 SSD空间时执行一次,后续每 一次访问 SSD空间都可以基于初始访问时的划分结果进行访问,对此本实施例不进行 限制。
本实施例中,磁盘与 SSD之间的映射关系, 以及对 SSD空间进行分组的描述与前 述图 1所示的实施例的描述一致, 在此不再赘述。
本实施例中, 结合图 2B示出的一种应用实例示意图, 假设磁盘空间为 40G, SSD 空间为 10G, 且 SSD空间中的每个 SET由 512个块组成, 每个块大小为 4KB。 则相应 的, 磁盘空间按照 SSD空间的大小被划分为 M=40G/10G=4个磁盘子空间, 又每个 SET 大小为 512 X 4KB=2M, 贝 U SSD空间被划分成 N=10G/2M=5000个 SET, 磁盘空间相应被 划分成 40G/2M=20000个 SET。 本实施例中, 假设将 SSD空间进行五等分, 获得五个 分组, 即 K=5, 则每个分组内包含 Ν/Κ=5000/5=1000个 SET, 即 SSD的实际映射空间 为 1000个 SET的大小。 其中, 五个分组的索引号依次为 0、 1、 2、 3、 4; 1000个逻 辑分组的分组号依次为 0至 999。
通常对磁盘空间进行访问的块请求在磁盘空间上的起始偏移用其起始扇区偏移 进行表示。本步骤中,如前所述,假设每个 SET的大小为 2M,每个扇区的大小为 512Kb, 则每个 SET包含 2M/512KB=4096个扇区。假设对磁盘空间进行访问的块请求的起始扇 区偏移分别为 12288、 12296、 12304。
步骤 202 : 根据起始偏移计算块请求在磁盘空间上所对应第二 SET的 SET编号。 在获得了块请求在磁盘空间上的起始扇区偏移后,需要根据该起始扇区偏移计算 块请求所属的磁盘空间上的 SET。
由于每个 SET包含 4096个扇区, 因此每个块请求所对应的磁盘空间上的 SET分 别为, 12288/4096=3, 12296/4096=3, 12304/4096=3, 其中, "/"表示除取整, 即同 属于在磁盘空间上的第 3个 SET, 相应的在磁盘空间上的 SET编号为 2。
步骤 203 : 根据至少两个分组中的每个分组所包含的 SET数量和第二 SET的 SET 编号计算块请求所映射的 SSD空间上的第一逻辑分组的分组号。
由于 SSD每个分组内包含 1000个 SET, 根据步骤 203中计算得到的三个块请求 在磁盘空间上的 SET编号均为 2, 因此对应 SSD 的逻辑分组的分组号 (base ) 为: 2%1000=2 (%表示除取余数), 即三个块请求同样对应 SSD空间上分组号 (base ) 为 2 的逻辑分组, 即 SSD空间上的第三个逻辑分组内的 SET。
步骤 204: 根据块请求在磁盘空间上的起始偏移, 获取映射函数的输入值。 本实施例中假设采用的映射函数为哈希函数,且哈希函数的输入值采用块请求在 磁盘空间上的起始扇区偏移, 即三个块请求的输入值分别为 12288, 12296和 12304。 步骤 205: 通过输入值对预设参数求模, 获取块请求在第一逻辑分组内所映射的 第一 SET的索引号。
本实施例中, 采用哈希函数对每个块请求在磁盘空间上的起始扇区偏移按照 SSD 空间的等分次数求模, 作为此块请求在其所属的逻辑分组内的索引号。
结合图 2B, 用三个块请求在磁盘空间上的起始扇区偏移 12288, 12296和 12304 分别对 5求模,对应分组号为 2的逻辑组内的索引号 ( index)分别为: 12288%5- 1=2, 12296%5-1=0, 12304%5-1=3, 即三个块请求分别映射到分组号(base )为 2的逻辑分 组内, 索引号 (index) 分别为 2、 0、 和 3的 SET上。
步骤 206:根据第一逻辑分组的分组号和第一 SET的索引号,确定第一 SET在 SSD 空间内的 SET编号。
根据前述步骤, 获得了每个块请求所映射的逻辑分组的分组号 (base ), 和在每 个逻辑分组内的索引号(index),此时根据如下公式计算三个块请求在整个 SSD空间 上映射的 SET的编号 (Real set ):
Real set=index X N/K +base, 其中, K=5, N=5000, base=2;
对于第一个块请求, 按照上述公式, 其在整个 SSD空间上映射的 SET编号(Real set ) 为: 2 X 5000/5+2=2000+2=2002;
同理, 对于第二个块请求, 其在整个 SSD空间上映射的 SET编号(Real set )为: 0 X 5000/5+2=2;对于第三个块请求,其在整个 SSD空间上映射的 SET编号(Real set ) 为: 3 X 5000/5+2=3002;
由此可知, 三个块请求按照现有技术, 将同时映射到 SSD空间上编号为 2的 SET
3上; 而按照本发明实施例, 则将上述三个块请求分别映射到了 SET编号为 2002、 2 和 3002的 3个 SET上。 因此, 应用本发明实施例, 当磁盘上出现数据热点区域时, 则映射到 SSD整个空间的块请求将趋于均衡。
步骤 207: 按照第一 SET在 SSD空间内的 SET编号, 将块请求写入第一 SET。 由上述实施例可见, 该实施例将 SSD空间进行分组, 从而将块请求映射到划分后 的某个逻辑分组上, 由于每个逻辑分组内包括与分组的数量一致的 SET, 由此实现了 SSD空间的均匀访问, 提高了 SSD的缓存效率和使用效率。 与本发明访问固态硬盘空间的方法实施例相对应,本发明还提供了访问固态硬盘 空间的装置及系统的实施例。
参见图 3, 为本发明访问固态硬盘空间的装置的实施例框图: 该装置包括: 划分单元 310、 映射单元 320、 获取单元 330和写入单元 340。 其中,划分单元 310,用于将包含若干块集合 SET的固态硬盘 SSD空间进行等分, 获得至少两个分组,其中所述每个分组内的 SET具有相同的索引号,所述至少两个分 组内具有相同偏移的 SET属于同一个逻辑分组;
映射单元 320, 用于将对磁盘空间进行访问的块请求映射到所述划分单元 310所 划分的所述 SSD空间上的第一逻辑分组;
获取单元 330, 用于通过映射函数获取所述块请求在所述映射单元 320所映射的 第一逻辑分组内所映射的第一 SET的索引号;
写入单元 340, 用于将所述块请求写入与所述获取单元 330所获取的索引号对应 的所述第一 SET。
可选的, 所述映射单元 320可以包括 (图 3中未示出):
起始偏移获取子单元,用于获取对所述磁盘空间进行访问的块请求在所述磁盘空 间上的起始偏移;
SET编号计算子单元, 用于根据所述起始偏移获取子单元获取的起始偏移计算所 述块请求在所述磁盘空间上所对应第二 SET的 SET编号;
分组号计算子单元,用于根据所述至少两个分组中的每个分组所包含的 SET数量 和所述 SET编号计算子单元所计算的第二 SET的 SET编号计算所述块请求所映射的所 述 SSD空间上的第一逻辑分组的分组号。
可选的, 所述获取单元 330可以包括 (图 7中未示出):
输入值获取子单元,用于根据所述块请求在所述磁盘空间上的起始偏移, 获取所 述映射函数的输入值; 可选的, 所述映射函数可以具体为哈希函数; 所述输入值可以 包括: 所述块请求在所述磁盘空间上的起始偏移, 或者, 对所述块请求在所述磁盘空 间上的起始偏移使用伪随机函数生成的随机值;
索引号获取子单元,用于通过所述输入值获取子单元获取的输入值对预设参数求 模, 获取所述块请求在所述第一逻辑分组内所映射的第一 SET的索引号。
可选的, 所述写入单元 340可以包括 (图 3中未示出):
SET编号确定子单元, 用于根据所述第一逻辑分组的分组号和所述第一 SET的索 引号, 确定所述第一 SET在所述 SSD空间内的 SET编号;
块请求写入子单元, 用于按照所述 SET编号确定子单元所确定的第一 SET的 SET 编号, 将所述块请求写入所述第一 SET。 参见图 4, 为本发明访问固态硬盘空间的系统的实施例框图:
该系统包括: 磁盘 410、 固态硬盘 SSD420和控制器 430。
其中, 所述控制器 410, 用于将包含若干块集合 SET的所述 SSD空间进行等分, 获得至少两个分组,其中所述每个分组内的 SET具有相同的索引号,所述至少两个分 组内具有相同偏移的 SET属于同一个逻辑分组,当接收到对所述磁盘的磁盘空间进行 访问的块请求时,将所述块请求映射到所述 SSD的 SSD空间上的第一逻辑分组,通过 映射函数获取所述块请求在所述第一逻辑分组内所映射的第一 SET的索引号,并将所 述块请求写入所述第一 SET。
可选的, 所述控制器 430, 可以具体用于获取对所述磁盘空间进行访问的块请求 在所述磁盘空间上的起始偏移,根据所述起始偏移计算所述块请求在所述磁盘空间上 所对应第二 SET的 SET编号,根据所述至少两个分组中的每个分组所包含的 SET数量 和所述第二 SET的 SET编号计算所述块请求所映射的所述 SSD空间上的第一逻辑分组 的分组号。
可选的, 所述控制器 430, 可以具体用于根据所述块请求在所述磁盘空间上的起 始偏移, 获取所述映射函数的输入值, 通过所述输入值对预设参数求模, 获取所述块 请求在所述第一逻辑分组内所映射的第一 SET的索引号。
可选的, 所述控制器 430, 可以具体用于根据所述第一逻辑分组的分组号和所述 第一 SET的索引号,确定所述第一 SET在所述 SSD空间内的 SET编号, 按照所述第一 SET的 SET编号, 将所述块请求写入所述第一 SET。 由上述实施例可见, 将包含若干 SET的 SSD空间进行等分, 获得至少两个分组, 其中每个分组内的 SET具有相同的索引号, 所述至少两个分组内具有相同偏移的 SET 属于同一个逻辑分组, 当接收到对磁盘空间进行访问的块请求时, 将块请求映射到 SSD空间上的第一逻辑分组, 通过映射函数获取块请求在第一逻辑分组内所映射的第 一 SET的索引号, 将块请求写入该第一 SET。 本发明实施例将 SSD空间进行分组, 从 而将块请求映射到划分后的某个逻辑分组上,由于每个逻辑分组内包括与分组的数量 一致的 SET, 由此实现了 SSD空间的均匀访问, 提高了 SSD的缓存效率和使用效率。
本领域的技术人员可以清楚地了解到本发明实施例中的技术可借助软件加必需 的通用硬件平台的方式来实现。基于这样的理解,本发明实施例中的技术方案本质上 或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产 品可以存储在存储介质中, 如 R0M/RAM、 磁碟、 光盘等, 包括若干指令用以使得一台 计算机设备(可以是个人计算机, 服务器, 或者网络设备等)执行本发明各个实施例 或者实施例的某些部分所述的方法。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部 分互相参见即可, 每个实施例重点说明的都是与其他实施例的不同之处。尤其, 对于 系统实施例而言, 由于其基本相似于方法实施例, 所以描述的比较简单, 相关之处参 见方法实施例的部分说明即可。
以上所述的本发明实施方式, 并不构成对本发明保护范围的限定。任何在本发明 的精神和原则之内所作的修改、等同替换和改进等,均应包含在本发明的保护范围之 内。

Claims

权 利 要 求
1、 一种访问固态硬盘空间的方法, 其特征在于, 所述固态硬盘 SSD空间包 括至少两个分组,每个分组为将所述 SSD空间中包含的若干块集合 SET进行等分 所获得的分组, 其中所述每个分组内的 SET具有相同的索引号, 所述至少两个分 组内具有相同偏移的 SET属于同一个逻辑分组, 所述方法包括:
将对磁盘空间进行访问的块请求映射到所述 SSD空间上的第一逻辑分组; 通过映射函数获取所述块请求在所述第一逻辑分组内所映射的第一 SET 的 索引号;
将所述块请求写入所述第一 SET。
2、 根据权利要求 1所述的方法, 其特征在于, 所述将对磁盘空间进行访问 的块请求映射到所述 SSD空间上的第一逻辑分组, 包括:
获取对所述磁盘空间进行访问的块请求在所述磁盘空间上的起始偏移; 根据所述起始偏移计算所述块请求在所述磁盘空间上所对应第二 SET的 SET 编号;
根据所述至少两个分组中的每个分组所包含的 SET数量和所述第二 SET的 SET编号计算所述块请求所映射的所述 SSD空间上的第一逻辑分组的分组号。
3、 根据权利要求 1或 2所述的方法, 其特征在于, 所述通过映射函数获取 所述块请求在所述第一逻辑分组内所映射的第一 SET的索引号, 包括:
根据所述块请求在所述磁盘空间上的起始偏移, 获取所述映射函数的输入 值;
通过所述输入值对预设参数求模,获取所述块请求在所述第一逻辑分组内所 映射的第一 SET的索引号。
4、 根据权利要求 3所述的方法, 其特征在于, 所述映射函数具体为哈希函 数;
所述输入值包括: 所述块请求在所述磁盘空间上的起始偏移, 或者, 对所述 块请求在所述磁盘空间上的起始偏移使用伪随机函数生成的随机值。
5、 根据权利要求 1至 4任意一项所述的方法, 其特征在于, 所述将所述块 请求写入所述第一 SET, 包括:
根据所述第一逻辑分组的分组号和所述第一 SET 的索引号, 确定所述第一 SET在所述 SSD空间内的 SET编号;
按照所述第一 SET在所述 SSD空间内的 SET编号,将所述块请求写入所述第 一 SET。
6、 一种访问固态硬盘空间的装置, 其特征在于, 所述装置包括: 划分单元, 用于将包含若干块集合 SET的固态硬盘 SSD空间进行等分, 获得 至少两个分组, 其中每个分组内的 SET具有相同的索引号, 所述至少两个分组内 具有相同偏移的 SET属于同一个逻辑分组;
映射单元,用于将对磁盘空间进行访问的块请求映射到所述划分单元所划分 的所述 SSD空间上的第一逻辑分组;
获取单元,用于通过映射函数获取所述块请求在所述映射单元所映射的第一 逻辑分组内所映射的第一 SET的索引号;
写入单元,用于将所述块请求写入与所述获取单元所获取的索引号对应的所 述第一 SET。
7、 根据权利要求 6所述的装置, 其特征在于, 所述映射单元包括: 起始偏移获取子单元,用于获取对所述磁盘空间进行访问的块请求在所述磁 盘空间上的起始偏移;
SET编号计算子单元, 用于根据所述起始偏移获取子单元获取的起始偏移计 算所述块请求在所述磁盘空间上所对应第二 SET的 SET编号;
分组号计算子单元, 用于根据所述至少两个分组中的每个分组所包含的 SET 数量和所述 SET编号计算子单元所计算的第二 SET的 SET编号计算所述块请求所 映射的所述 SSD空间上的第一逻辑分组的分组号。
8、 根据权利要求 6或 7所述的装置, 其特征在于, 所述获取单元包括: 输入值获取子单元, 用于根据所述块请求在所述磁盘空间上的起始偏移, 获 取所述映射函数的输入值;
索引号获取子单元,用于通过所述输入值获取子单元获取的输入值对预设参 数求模, 获取所述块请求在所述第一逻辑分组内所映射的第一 SET的索引号。
9、 根据权利要求 8所述的装置, 其特征在于, 所述映射函数具体为哈希函 数;
所述输入值包括: 所述块请求在所述磁盘空间上的起始偏移, 或者, 对所述 块请求在所述磁盘空间上的起始偏移使用伪随机函数生成的随机值。
10、根据权利要求 6至 9任意一项所述的装置, 其特征在于, 所述写入单元 包括:
SET编号确定子单元, 用于根据所述第一逻辑分组的分组号和所述第一 SET 的索引号, 确定所述第一 SET在所述 SSD空间内的 SET编号;
块请求写入子单元,用于按照所述 SET编号确定子单元所确定的第一 SET的
SET编号, 将所述块请求写入所述第一 SET。
11、 一种访问固态硬盘空间的系统, 其特征在于, 所述系统包括: 磁盘、 固 态硬盘 SSD和控制器,
所述控制器, 用于将包含若干块集合 SET的所述 SSD空间进行等分, 获得至 少两个分组, 其中所述每个分组内的 SET具有相同的索引号, 所述至少两个分组 内具有相同偏移的 SET属于同一个逻辑分组,当接收到对所述磁盘的磁盘空间进 行访问的块请求时,将所述块请求映射到所述 SSD的 SSD空间上的第一逻辑分组, 通过映射函数获取所述块请求在所述第一逻辑分组内所映射的第一 SET 的索引 号, 并将所述块请求写入所述第一 SET。
12、 根据权利要求 11所述的系统, 其特征在于,
所述控制器,具体用于获取对所述磁盘空间进行访问的块请求在所述磁盘空 间上的起始偏移,根据所述起始偏移计算所述块请求在所述磁盘空间上所对应第 二 SET的 SET编号,根据所述至少两个分组中的每个分组所包含的 SET数量和所 述第二 SET的 SET编号计算所述块请求所映射的所述 SSD空间上的第一逻辑分组 的分组号。
13、 根据权利要求 11或 12所述的系统, 其特征在于,
所述控制器, 具体用于根据所述块请求在所述磁盘空间上的起始偏移, 获取 所述映射函数的输入值, 通过所述输入值对预设参数求模, 获取所述块请求在所 述第一逻辑分组内所映射的第一 SET的索引号。
14、 根据权利要求 11至 13任意一项所述的系统, 其特征在于, 所述控制器,具体用于根据所述第一逻辑分组的分组号和所述第一 SET的索 引号, 确定所述第一 SET在所述 SSD空间内的 SET编号, 按照所述第一 SET的
SET编号, 将所述块请求写入所述第一 SET。
PCT/CN2012/080464 2012-08-22 2012-08-22 访问固态硬盘空间的方法、装置及系统 WO2014029087A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201280002464.5A CN103827837B (zh) 2012-08-22 2012-08-22 访问固态硬盘空间的方法、装置及系统
PCT/CN2012/080464 WO2014029087A1 (zh) 2012-08-22 2012-08-22 访问固态硬盘空间的方法、装置及系统

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2012/080464 WO2014029087A1 (zh) 2012-08-22 2012-08-22 访问固态硬盘空间的方法、装置及系统

Publications (1)

Publication Number Publication Date
WO2014029087A1 true WO2014029087A1 (zh) 2014-02-27

Family

ID=50149350

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/080464 WO2014029087A1 (zh) 2012-08-22 2012-08-22 访问固态硬盘空间的方法、装置及系统

Country Status (2)

Country Link
CN (1) CN103827837B (zh)
WO (1) WO2014029087A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019072250A1 (zh) * 2017-10-13 2019-04-18 杭州海康威视系统技术有限公司 一种文件管理方法、文件管理系统、电子设备及存储介质

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113515471B (zh) 2016-06-14 2024-06-18 伊姆西Ip控股有限责任公司 用于管理存储系统的方法和装置
CN109582593B (zh) * 2018-11-05 2022-09-30 华侨大学 一种基于计算的ftl地址映射读、写方法
CN112464593B (zh) * 2020-11-25 2022-09-02 海光信息技术股份有限公司 Rom位映射关系生成方法、装置、处理器芯片及服务器
CN116795735B (zh) * 2023-08-23 2023-11-03 四川云海芯科微电子科技有限公司 固态硬盘空间分配方法、装置、介质及系统

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101604227A (zh) * 2009-07-17 2009-12-16 杭州华三通信技术有限公司 数据存储的方法及设备
CN102023809A (zh) * 2009-09-21 2011-04-20 成都市华为赛门铁克科技有限公司 存储系统、从存储系统读取数据的方法及写入数据的方法
CN102576333A (zh) * 2009-10-05 2012-07-11 马维尔国际贸易有限公司 非易失性存储器中的数据高速缓存

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102043593B (zh) * 2010-12-17 2013-03-13 曙光信息产业股份有限公司 一种基于Region的磁盘外置cache管理方法
CN102521147B (zh) * 2011-11-17 2015-03-25 曙光信息产业(北京)有限公司 一种使用高速非易失介质做缓存的管理方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101604227A (zh) * 2009-07-17 2009-12-16 杭州华三通信技术有限公司 数据存储的方法及设备
CN102023809A (zh) * 2009-09-21 2011-04-20 成都市华为赛门铁克科技有限公司 存储系统、从存储系统读取数据的方法及写入数据的方法
CN102576333A (zh) * 2009-10-05 2012-07-11 马维尔国际贸易有限公司 非易失性存储器中的数据高速缓存

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019072250A1 (zh) * 2017-10-13 2019-04-18 杭州海康威视系统技术有限公司 一种文件管理方法、文件管理系统、电子设备及存储介质

Also Published As

Publication number Publication date
CN103827837A (zh) 2014-05-28
CN103827837B (zh) 2016-08-03

Similar Documents

Publication Publication Date Title
JP6796304B2 (ja) 最終レベルキャッシュシステム及び対応する方法
EP3869316B1 (en) Hybrid storage
KR102170539B1 (ko) 저장 장치에 의해 데이터를 저장하기 위한 방법 및 저장 장치
US9244619B2 (en) Method of managing data storage device and data storage device
WO2012126317A1 (zh) 文件存储方法和装置
JP5530863B2 (ja) ストレージシステムのためのi/o変換方法及び装置
WO2017148242A1 (zh) 一种访问叠瓦式磁记录smr硬盘的方法及服务器
WO2018019119A1 (zh) 一种面向连续数据存储的动态局部并行数据布局方法及装置
WO2013097618A1 (zh) 存储虚拟化的装置、存储系统及数据存储方法及系统
WO2014029087A1 (zh) 访问固态硬盘空间的方法、装置及系统
WO2013175529A1 (en) Storage system and storage control method for using storage area based on secondary storage as cache area
JP2011515727A5 (zh)
KR20190052546A (ko) 키-밸류 스토리지 장치 및 상기 키-밸류 스토리지 장치의 동작 방법
CN103176754A (zh) 一种海量小文件读取存储方法
CN108064374A (zh) 一种数据访问方法、装置和系统
CN103473266A (zh) 固态硬盘及其删除重复数据的方法
US10853252B2 (en) Performance of read operations by coordinating read cache management and auto-tiering
WO2021062982A1 (zh) 管理hmb内存的方法、装置、计算机设备及存储介质
US20150052327A1 (en) Dynamic memory relocation
JP2012208916A (ja) 仮想ボリュームに領域を割り当てるための方法及び装置
WO2012149815A1 (zh) 磁盘缓存的管理方法及装置
US9069471B2 (en) Passing hint of page allocation of thin provisioning with multiple virtual volumes fit to parallel data access
CN115543187A (zh) 一种数据处理方法及设备
KR20150127434A (ko) 메모리제어장치 및 메모리제어장치의 동작 방법
JP6559752B2 (ja) ストレージシステムおよび制御方法

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: 12883210

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: 12883210

Country of ref document: EP

Kind code of ref document: A1