Address mapping method in storage device

By setting up multiple partitions with different mapping units smaller than 4K in the SSD, and using the mapping method of discontinuous PBA sets and PBA continuous metadata blocks, the problem of low performance of SSD when processing small data blocks is solved, and a more efficient implementation is achieved. Efficient write performance and lower memory costs.

CN119357077APending Publication Date: 2025-01-24RUIZHENG (HANGZHOU) TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410978430.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

When existing SSDs process read and write access to small data blocks, they need to perform a large number of read-replacement-write operations, resulting in reduced performance.

Method used

Design an address mapping method in a storage device. By setting multiple partitions with different mapping units inside the storage device, and using a non -continuous PBA collection and PBA continuous metadata block in the mapping table, to optimize the data of the data Renewable of writing and mapping tables.

Benefits of technology

By setting up the partitions of different mapping units less than 4K, the writing performance of small data block access is improved, and the storage space occupied by the overall mapping table is reduced through a compact mapping form, thereby reducing the memory cost of the storage equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357077A_ABST
    Figure CN119357077A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer storage, in particular to an address mapping method in storage equipment. Comprising the following steps: S1, setting a plurality of partitions with different mapping units in a storage device; s2, dividing the mapping table of the storage equipment according to the partitions in the step S1, wherein each partition corresponds to one sub-mapping table; s3, dividing the interior of the sub-mapping table into a plurality of mapping groups; s4, setting a mapping mode in the mapping group; and S5, when the mapping table is updated after the data is written, determining mapping table items partially overlapped with the written data LBA in the mapping table, and updating the first PBA and / or information representing PBA continuity in the mapping table items. Compared with the prior art, a plurality of partitions with different mapping units smaller than 4K can be arranged in the storage equipment and are used for improving the writing performance when small data blocks are accessed; and meanwhile, the mapping tables of different partitions can adopt a more compact mapping form according to the continuity of data writing, so that the storage space occupied by the whole mapping table is reduced, and the memory cost of the storage equipment is further reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of computer storage, in particular to an address mapping method in a storage device. Background Art

[0002] With the advancement of storage technology, solid-state drives (SSDs) have gradually become the main medium for data storage in individuals, enterprises and data centers. Compared with traditional mechanical disks (hard-disk drives, HDDs), they have greatly alleviated the pressure on the storage end and released the performance potential of the overall system.

[0003] The main storage medium of SSD is NAND. During the use of NAND, it is generally managed in the form of super blocks. When a super block is full of data, a new super block will be applied for subsequent data writing. In addition, data can only be written sequentially in NAND, and the data cannot be updated in situ. Therefore, during the use of SSD, a garbage collection mechanism is needed to recycle the space, that is, select a super block with more invalid data, move the valid data in the super block to other super blocks, and then erase the super block. After that, the super block can be used as a new super block.

[0004] Normally, the data blocks written to NAND generally correspond to one or more logical block addresses (LBAs), and each logical block address corresponds to a fixed size, such as 512B or 4KB. The size of the LBA is specified by the host when the SSD is formatted. Since NAND cannot be updated in-situ, the mapping between its LBA and physical block address (PBA) is not fixed after the data is written to NAND, so a flash translation layer (FTL) is required in the SSD to record and maintain the mapping relationship between LBA and PBA.

[0005] In the current SSD design, the mapping of LBA and PBA generally adopts a fixed-size mapping unit, such as 4KB. In order to maximize the performance of the SSD, the mapping table is generally stored in the DDR inside the SSD, and its size is generally one thousandth of the SSD capacity. For example, the mapping table size of a 4TB SSD is about 4GB (using a 4KB mapping unit size); if a smaller mapping unit is used, the size of the mapping table will increase exponentially. For example, if a 512B mapping unit is used, the mapping table size is 8 times that of a 4KB mapping unit. When the size of LBA is smaller than the size of mapping unit and the write request from the host is unaligned (i.e., the initial LBA or the ending LBA of the write request is not aligned with the mapping unit), a read-modify-write (RMW) operation needs to be performed inside the SSD to resolve the mismatch between LBA and mapping unit. For example, when the LBA size is 512B and the mapping unit size is 4KB, if the host performs a 512B write operation, the SSD needs to first search the mapping table for the 4KB PBA corresponding to the LBA where the 512B data is located, then read the 4KB data from the PBA, and use the 512B data written by the host to replace the 512B data at the original corresponding position, and finally write the entire 4KB data to NAND and update the mapping table.

[0006] In some actual scenarios, most of the read and write accesses of applications to SSDs are small data blocks, such as 256B or 512B. Since SSDs use larger mapping units, such as 4KB, a large number of read, modify and write operations are involved, which reduces the performance of the SSD and applications. Summary of the invention

[0007] In order to overcome the deficiencies of the prior art, the present invention provides an address mapping method in a storage device.

[0008] To achieve the above purpose, a method for address mapping in a storage device is designed, comprising the following steps: S1, setting a plurality of partitions with different mapping units inside the storage device; S2, dividing the mapping table of the storage device according to the partitions in step S1, each partition corresponds to a sub-mapping table; S3, the sub-mapping table is divided into multiple mapping groups; S4, setting the mapping mode within the mapping group; S5, when the mapping table is updated after the data is written, the mapping table entries partially overlapping with the LBA of the written data are determined, and the first PBA and / or information representing the continuity of the PBA in these mapping table entries are updated.

[0009] In the step S1, the size and mapping unit of each partition are specified by the host when initializing the partition.

[0010] In the step S1, the sizes of the different mapping units are no larger than 4K.

[0011] In step S3, each mapping group contains a fixed number of LBAs; mapping groups in different sub-mapping tables may contain different numbers of LBAs.

[0012] The mapping method in step S4 is: mapping within a mapping group, using a discontinuous PBA set and a PBA continuity metadata block.

[0013] The mapping method is specifically as follows: after the LBA is sorted, when the PBAs corresponding to the sequential LBAs are continuous, the corresponding PBAs are deleted and represented in the form of a continuous data block (m, n). When a discontinuous PBA appears, the PBA is retained to form a discontinuous PBA set, where m indicates that the first deleted PBA corresponds to the mth element in the mapping group, and n indicates that n PBAs are deleted consecutively.

[0014] The mapping method in step S4 is a mapping within a mapping group, using a discontinuous PBA set and a continuous number of PBAs.

[0015] The mapping method is as follows: after LBA is sorted, when the PBAs corresponding to the sequential LBAs are continuous, the corresponding PBAs are deleted, and the number of continuous PBAs starting from the current PBA is recorded as a representative of the continuous number of PBAs. When a discontinuous PBA appears, the PBA is retained.

[0016] When the storage device performs data recovery, for the selected source super block, the LBA corresponding to the valid data block is first confirmed and marked in the bit map representing the LBA of the entire disk, and then the read command of the valid data is issued in sequence from small to large LBA according to the mark in the bit map, and the data read from the NAND is transferred to the pre-applied continuous buffer space, and finally the data is written into the destination super block in the order after the LBA is sorted from the buffer space, and the address mapping table is updated according to the returned PBA address and its continuity.

[0017] A write cache is set in the storage device. For write requests from the host side, the write cache is first used for buffering; when the amount of data in the write cache reaches a set threshold, the LBAs in the cache are sorted, and then the LBA area with the longest continuous length is selected, and the corresponding data is written to NAND, and finally the address mapping table is updated according to the returned PBA address and its continuity.

[0018] Compared with the prior art, the present invention can set up multiple partitions with different mapping units smaller than 4K inside the storage device to improve the write performance when accessing small data blocks; at the same time, the mapping tables of different partitions can adopt a more compact mapping form according to the continuity of data writing, thereby reducing the storage space occupied by the overall mapping table, and further reducing the memory cost of the storage device. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a schematic diagram of a multi-partition mapping table in Embodiment 1 of the present invention.

[0020] Figure 2 It is a schematic diagram of the mapping method of discontinuous PBA sets and PBA continuity metadata blocks in the first embodiment of the present invention.

[0021] Figure 3 The present invention is a flowchart of GC data recovery using LBA sorting in the method of the present invention.

[0022] Figure 4 It is a schematic diagram of adding a write cache in the method of the present invention.

[0023] Figure 5 It is a flow chart of the host side writing data when using write cache in the method of the present invention.

[0024] Figure 6 It is a flow chart of the host end reading data when using write cache in the method of the present invention.

[0025] Figure 7 It is a schematic diagram of the mapping method between PBA and the number of consecutive PBAs used in the second embodiment of the present invention. DETAILED DESCRIPTION

[0026] The present invention will be further described below with reference to the accompanying drawings. Embodiment 1

[0027] like Figures 1 to 6 As shown, the address mapping method in the storage device in this embodiment includes the following steps: S1, setting a plurality of partitions with different mapping units inside the storage device; S2, dividing the mapping table of the storage device according to the partitions in step S1, each partition corresponds to a sub-mapping table; S3, the sub-mapping table is divided into multiple mapping groups; S4, setting the mapping mode within the mapping group; S5, when the mapping table is updated after the data is written, the mapping table entries partially overlapping with the LBA of the written data are determined, and the first PBA and / or information representing the continuity of the PBA in these mapping table entries are updated.

[0028] like Figure 1 As shown. In step S1, the size and mapping unit of each partition are specified by the host when the partition is initialized. In step S1, the sizes of several different mapping units are not greater than 4K. In step S3, each mapping group contains a fixed number of LBAs; mapping groups of different sub-mapping tables can contain different numbers of LBAs.

[0029] like Figure 2 As shown, the mapping method in step S4 is: mapping within a mapping group, using a discontinuous PBA set and a PBA continuity metadata block.

[0030] The specific mapping method is as follows: After the LBA is sorted, when the PBAs corresponding to the sequential LBAs are continuous, the corresponding PBAs are deleted and represented in the form of a continuous data block (m, n). When a discontinuous PBA appears, the PBA is retained to form a discontinuous PBA set, where m indicates that the first deleted PBA corresponds to the mth element in the mapping group, and n indicates that n PBAs are deleted consecutively.

[0031] like Figure 3 As shown, when the storage device recovers data, for the selected source super block, it first confirms the LBA corresponding to the valid data block therein, and marks it in the bit map representing the LBA of the entire disk, and then sends the read command of the valid data in the order of LBA from small to large according to the mark in the bit map, and transfers the data read from the NAND to the pre-applied continuous buffer space, and finally writes the LBA continuous data from the buffer space into the destination super block in sequence, and updates the address mapping table according to the returned PBA address and its continuity.

[0032] like Figures 4 to 5 As shown, a write cache is set in the storage device. For the write request from the host, the write cache is first used for buffering; when the amount of data in the write cache reaches the set threshold, the LBAs in the cache are sorted, and then the LBA area with the longest continuous length is selected, and the corresponding data is written to the NAND, and finally the address mapping table is updated according to the returned PBA address and its continuity.

[0033] like Figure 6 As shown, when there is a write cache, when reading data, based on the LBA corresponding to the read request, first determine whether the write cache contains part or all of the data corresponding to the read request. If so, return the contained data; then, based on the remaining LBA in the read request, determine one or more mapping groups that can cover the remaining LBA, and restore the PBA corresponding to the remaining LBA from the mapping group, and finally read the corresponding data from the NAND according to the PBA and return it. Embodiment 2

[0034] This embodiment only describes the differences from the first embodiment, and the similarities are not described again.

[0035] The difference between this embodiment and the first embodiment is that Figure 7 As shown, the mapping method of this embodiment is a mapping within a mapping group, using a discontinuous PBA set and a continuous number of PBAs.

[0036] The mapping method is as follows: after the LBA is sorted, when the PBAs corresponding to the sequential LBAs are continuous, the corresponding PBAs are deleted, and the number of continuous PBAs starting from the current PBA is recorded as a representative of the number of continuous PBAs. When a discontinuous PBA appears, the PBA is retained.

[0037] The present invention can set up multiple partitions with different mapping units smaller than 4K inside the storage device to improve the write performance when accessing small data blocks; at the same time, the mapping tables of different partitions can adopt a more compact mapping form according to the continuity of data writing, thereby reducing the storage space occupied by the overall mapping table, and further reducing the memory cost of the storage device.

Claims

1. An address mapping method in a storage device, characterized in that: The steps include: S1, setting a plurality of partitions with different mapping units inside the storage device; S2, dividing the mapping table of the storage device according to the partitions in step S1, each partition corresponds to a sub-mapping table; S3, the sub-mapping table is divided into multiple mapping groups; S4, setting the mapping mode within the mapping group; S5, when the mapping table is updated after the data is written, the mapping table entries partially overlapping with the LBA of the written data are determined, and the first PBA and / or information representing the continuity of the PBA in these mapping table entries are updated.

2. The address mapping method in a storage device according to claim 1, characterized in that: In the step S1, the size and mapping unit of each partition are specified by the host when initializing the partition.

3. The address mapping method in a storage device according to claim 1, characterized in that: In the step S1, the sizes of the different mapping units are no larger than 4K.

4. The address mapping method in a storage device according to claim 1, characterized in that: In step S3, each mapping group contains a fixed number of LBAs; mapping groups in different sub-mapping tables may contain different numbers of LBAs.

5. The address mapping method in a storage device according to claim 1, characterized in that: The mapping method in step S4 is: mapping within a mapping group, using a discontinuous PBA set and a PBA continuity metadata block.

6. The address mapping method in a storage device according to claim 5, characterized in that: The mapping method is specifically as follows: after the LBA is sorted, when the PBAs corresponding to the sequential LBAs are continuous, the corresponding PBAs are deleted and represented in the form of a continuous data block (m, n). When a discontinuous PBA appears, the PBA is retained to form a discontinuous PBA set, where m indicates that the first deleted PBA corresponds to the mth element in the mapping group, and n indicates that n PBAs are deleted consecutively.

7. The address mapping method in a storage device according to claim 1, characterized in that: The mapping method in step S4 is a mapping within a mapping group, using a discontinuous PBA set and a continuous number of PBAs.

8. The address mapping method in a storage device according to claim 7, characterized in that: The mapping method is as follows: after LBA is sorted, when the PBAs corresponding to the sequential LBAs are continuous, the corresponding PBAs are deleted, and the number of continuous PBAs starting from the current PBA is recorded as a representative of the continuous number of PBAs. When a discontinuous PBA appears, the PBA is retained.

9. The address mapping method in a storage device according to claim 1, characterized in that: When the storage device performs data recovery, for the selected source super block, the LBA corresponding to the valid data block is first confirmed and marked in the bit map representing the LBA of the entire disk, and then the read command of the valid data is issued in sequence from small to large LBA according to the mark in the bit map, and the data read from the NAND is transferred to the pre-applied continuous buffer space, and finally the data is written into the destination super block in the order after the LBA is sorted from the buffer space, and the address mapping table is updated according to the returned PBA address and its continuity.

10. The address mapping method in a storage device according to claim 1, characterized in that: A write cache is set in the storage device. For write requests from the host side, the write cache is first used for buffering; when the amount of data in the write cache reaches a set threshold, the LBAs in the cache are sorted, and then the LBA area with the longest continuous length is selected, and the corresponding data is written to NAND, and finally the address mapping table is updated according to the returned PBA address and its continuity.

Citation Information

Cited By

  • Adaptive mapping flash memory control method and flash memory control system

    CN122045078A