Group-based namespace management method, device and readable storage medium

CN117908787BActive Publication Date: 2026-09-18YEESTOR MICROELECTRONICS CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311850752.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-28
Publication Date
2026-09-18
Estimated Expiration
2043-12-28

AI Technical Summary

Technical Problem

[0005]本申请实施例通过提供一种基于群组化的命名空间管理方法、设备和可读存储介质,解决了相关技术中将存储的资料,全量迁移到因为删除产生的闲置空间,迁移耗时长,降低了固态硬盘的使用效率以及使用寿命的技术问题,实现了提升逻辑映射表中命名空间维护的效率,降低存储系统负载的技术效果

Benefits of technology

[0041] By employing a method that determines the memory usage of the namespace to be created based on the received namespace creation instruction; determines the number of groups to be created based on the memory usage and the preset storage usage of the groups; allocates the groups to be created to the namespace to be created in the logical mapping table based on the number of groups, and determines the group sequence number corresponding to the group to be created; and generates a namespace start table and a group sequence number table based on the group sequence number, this method effectively solves the technical problem in related technologies where migrating all stored data to the idle space generated by deletion is time-consuming, reduces the utilization efficiency and lifespan of solid-state drives, and achieves the technical effect of improving the efficiency of namespace maintenance in the logical mapping table and reducing the load on the storage system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117908787B_ABST
    Figure CN117908787B_ABST
Patent Text Reader

Abstract

The application discloses a namespace management method and device based on grouping and a readable storage medium, relates to the field of storage control, and comprises the following steps: determining the memory occupation of a namespace to be created according to a received namespace creation instruction; determining the group quantity of a group to be created based on the memory occupation and preset storage occupation of the group; allocating the group to be created to the namespace to be created in a logical mapping table based on the group quantity, and determining the group serial number corresponding to the group to be created; and generating a namespace start table and a group serial number table based on the group serial number, so that the technical problem that the storage data is fully migrated to idle space generated due to deletion, the migration time is long, and the use efficiency and service life of the solid state disk are reduced is effectively solved, the technical effect of improving the namespace maintenance efficiency in the logical mapping table and reducing the storage system load is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of storage control, and more particularly to a group-based namespace management method, device, and readable storage medium. Background Technology

[0002] The logical mapping table inside an SSD (Solid State Drive) is generally managed by mapping logical addresses to the physical addresses of the storage particles.

[0003] Namespaces are created sequentially and allocated as contiguous intervals. When the controller deletes and recreates namespaces, the new namespaces may need to be created across two or more non-contiguous intervals because their sizes differ from the original namespaces. Using the new namespace in this case requires knowing the storage size of each previous namespace, leading to inefficiency. To address this issue, related technologies migrate all stored data to the idle space created by the deletion when the solid-state drive (SSD) is idle, thus ensuring namespace continuity.

[0004] However, this method involves a large amount of data migration, which takes a long time and reduces the efficiency and lifespan of solid-state drives. Summary of the Invention

[0005] This application provides a group-based namespace management method, device, and readable storage medium, which solves the technical problem in related technologies that the migration of all stored data to the idle space generated by deletion is time-consuming, reducing the efficiency and lifespan of solid-state drives. It achieves the technical effect of improving the efficiency of namespace maintenance in the logical mapping table and reducing the load on the storage system.

[0006] This application provides a group-based namespace management method, which includes:

[0007] Based on the received namespace creation instructions, determine the memory usage of the namespace to be created;

[0008] Based on the memory usage and the preset storage usage of the groups, the number of groups to be created is determined;

[0009] Based on the number of groups, the group to be created is allocated to the namespace to be created in the logical mapping table, and the group number corresponding to the group to be created is determined;

[0010] A namespace start table and a group number table are generated based on the group number.

[0011] Optionally, the step of allocating the groups to be created to the namespace to be created within the logical mapping table based on the number of groups, and determining the group sequence number corresponding to the groups to be created, includes:

[0012] Identify the free groups within the logical mapping table;

[0013] Based on the group number of the idle group, and in ascending or descending order, determine the number of groups to be created corresponding to the number of groups.

[0014] Assign the group to be created to the namespace to be created.

[0015] Optionally, the step of generating a namespace start table and a group number table based on the group number includes:

[0016] Based on the group number, determine the group sequence corresponding to the namespace to be created in ascending or descending order;

[0017] Fill the consecutive portions of the group sequence into the group number table;

[0018] Determine the row number of the first-ranked group to be created in the continuous segment;

[0019] Fill the empty portion of the namespace start table with the row number and the identifier of the namespace to be created.

[0020] Optionally, after the step of generating the namespace start table and the group number table based on the group number, the following steps are included:

[0021] Upon receiving an address query instruction, the namespace to be queried is determined based on the address query instruction;

[0022] Based on the identifier of the namespace to be queried and the namespace start table, determine the position information of the namespace to be queried in the group sequence table;

[0023] Based on the location information, the address information corresponding to the address query instruction is determined in the logical mapping table.

[0024] Optionally, the step of determining the position information of the namespace to be queried in the group sequence table based on the identifier of the namespace to be queried and the namespace start table includes:

[0025] Based on the identifier of the namespace to be queried, determine the starting row number and offset row number in the namespace start table;

[0026] Based on the starting row number, determine the group sequence corresponding to the namespace to be queried in the group sequence number table;

[0027] The group number in the group sequence is determined based on the offset row number, thereby determining the location information.

[0028] Optionally, the step of determining the address information corresponding to the address query instruction in the logical mapping table based on the location information includes:

[0029] Based on the group number corresponding to the location information, the corresponding group to be queried is determined in the logical mapping table;

[0030] The address information is determined in the query group based on the offset corresponding to the address query instruction.

[0031] Optionally, after the step of generating the namespace start table and the group number table based on the group number, the following steps are included:

[0032] Upon receiving a namespace deletion instruction, the group to be deleted corresponding to the namespace deletion instruction is determined based on the namespace start table and the group sequence number table.

[0033] Perform a clearing action on the storage content corresponding to the group to be deleted;

[0034] Perform a clear and rearrange operation on the namespace start table and the group sequence number table.

[0035] Optionally, the step of performing a cleanup and rearrangement operation on the namespace start table and the group sequence number table includes:

[0036] Clear the namespace start table and the group sequence number table, and clear the corresponding record of the namespace to be deleted corresponding to the namespace deletion instruction;

[0037] Based on the deleted empty parts, the remaining contents of the namespace start table and the group sequence number table are fully migrated to ensure that the records in the namespace start table and the group sequence number table are continuous.

[0038] Furthermore, this application also proposes a group-based namespace management device, which includes a memory, a processor, and a group-based namespace management program stored in the memory and executable on the processor. When the processor executes the group-based namespace management program, it implements the steps of the group-based namespace management method described above.

[0039] Furthermore, this application also proposes a computer-readable storage medium storing a group-based namespace management program, which, when executed by a processor, implements the steps of the group-based namespace management method as described above.

[0040] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:

[0041] By employing a method that determines the memory usage of the namespace to be created based on the received namespace creation instruction; determines the number of groups to be created based on the memory usage and the preset storage usage of the groups; allocates the groups to be created to the namespace to be created in the logical mapping table based on the number of groups, and determines the group sequence number corresponding to the group to be created; and generates a namespace start table and a group sequence number table based on the group sequence number, this method effectively solves the technical problem in related technologies where migrating all stored data to the idle space generated by deletion is time-consuming, reduces the utilization efficiency and lifespan of solid-state drives, and achieves the technical effect of improving the efficiency of namespace maintenance in the logical mapping table and reducing the load on the storage system. Attached Figure Description

[0042] Figure 1 This is a flowchart illustrating an embodiment of the group-based namespace management method of this application;

[0043] Figure 2 This is a schematic diagram of the namespace start table and group sequence number table in Embodiment 1 of the group-based namespace management method of this application;

[0044] Figure 3 This is a flowchart illustrating steps S240-S270 in Embodiment 2 of the group-based namespace management method of this application;

[0045] Figure 4 This is a flowchart illustrating steps S310-S330 in Embodiment 3 of the group-based namespace management method of this application;

[0046] Figure 5 This is a flowchart illustrating steps S410-S430 in Embodiment 4 of the group-based namespace management method of this application;

[0047] Figure 6 This is a schematic diagram of the hardware structure involved in the embodiment of the group-based namespace management device of this application. Detailed Implementation

[0048] In related technologies, the logical address mapping table (L2p mapping table) inside an SSD is generally managed by mapping logical addresses to the physical addresses of the storage particles. Namespaces are created sequentially using contiguous intervals. At this point, the Namespace LBA (Logical Block Address) can be directly converted to the SSD's internal LBA using offsets for operation. However, when the controller deletes and recreates certain Namespaces, the new Namespaces may need to be established in more than two non-contiguous intervals because their storage size differs from the original Namespaces. For example...

[0049] When the disk is empty, NS1, 2, 3, and 4 are created sequentially and allocated to their respective consecutive intervals. LBA conversion can then be performed directly using offsets. 2. When the controller deletes NS2 and NS4, 2GB of space becomes available on the SSD. The controller then needs to create a new Namespace, NS5, with a size of 2GB. The firmware allocates the free 2GB space to NS5, so NS5 will be created in two non-consecutive intervals. In this situation, LBA conversion using offsets becomes quite complex because it requires knowing the specific information of all Namespaces preceding NS5. Furthermore, Namespaces can be deleted and recreated, making the operation quite complicated and reducing overall efficiency. The main technical solution adopted in this application embodiment is: to establish a space start table and a group sequence number table, and to divide the physical space stored in the logical mapping table into several group spaces. Based on the memory usage of the namespace to be created, group spaces are allocated to the namespace in the physical space stored in the logical mapping table, and the relevant information of the group spaces is filled into the space start table and the group sequence number table. This achieves the technical effect of improving processing efficiency when querying or modifying namespaces.

[0050] To better understand the above technical solutions, exemplary embodiments of this application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of this application and to fully convey the scope of this application to those skilled in the art.

[0051] Example 1

[0052] Embodiment 1 of this application discloses a group-based namespace management method, referring to... Figure 1 The group-based namespace management method includes:

[0053] Step S110: Determine the memory usage of the namespace to be created based on the received namespace creation instruction.

[0054] In this embodiment, a namespace is a fundamental logical space concept in the NVMe (Nonvolatile memory express) protocol. Simply put, a namespace logically divides the user space of an NVMe SSD; each namespace has its own storage unit and can be independently formatted and encrypted. The namespace creation instruction is executed when a namespace is created. Memory usage refers to the amount of storage space required by the namespace to be created.

[0055] As an optional implementation, when the main controller receives a namespace creation instruction, it determines the memory usage of the namespace to be created based on the information contained in the namespace creation instruction.

[0056] Step S120: Based on the memory usage and the preset storage usage of the group, determine the number of groups to be created.

[0057] In this embodiment, a group refers to the physical space where the logical mapping table is located being pre-divided into several groups of a preset size. The size of each group can be the same or different. The preset storage occupancy refers to the storage space capacity of each group.

[0058] As an optional implementation, the preset storage usage of the groups is obtained, the memory usage of the namespace to be created is determined, and the number of groups is determined by dividing the memory usage by the preset storage usage. For example, when the ratio is an integer, the integer is used as the number of groups. When the ratio is a decimal, the integer part of the decimal is added to one to obtain the number of groups.

[0059] Step S130: Based on the number of groups, allocate the groups to be created to the namespace to be created in the logical mapping table, and determine the group number corresponding to the groups to be created.

[0060] In this embodiment, the logical mapping table records the mapping relationship between logical addresses and physical addresses of storage particles in the solid-state drive. The group to be created is the storage space where the logical mapping table is located. Among the pre-divided groups, the unused groups are also called group spaces. When pre-dividing groups, each group is assigned a group number according to ascending or descending order, and the group number uniquely identifies a group.

[0061] As an optional implementation, based on the number of groups, a certain number of groups are selected as the groups to be created from the storage space corresponding to the logical mapping table, and a group number is determined for each group to be created. The group numbers can be non-contiguous or contiguous.

[0062] Step S140: Generate a namespace start table and a group number table based on the group number.

[0063] In this embodiment, namespace management commands are actually processed using a namespace start table and a group sequence number table. The namespace start table and group sequence number table are represented as a row or a column. The group sequence number table is as follows: Figure 2 As shown, is Figure 2 The `NS_Group_Info_Table` in the `<namespace>` table records the groups corresponding to each namespace, arranged in sequential order by group number. The namespace start table is... Figure 2 The NS_Start_Table in the table records the group number of the first group in the group number table for each namespace, in a preset order.

[0064] As an optional implementation, based on the groups to be created corresponding to the namespaces to be created, the group numbers are arranged in ascending or descending order and filled into consecutive parts of the group number table, so that the group sequence appears as several consecutive rows. Then, the group number in the first row of this group sequence in the group number table is associated with the identifier of the namespace to be created and filled into the empty positions in the namespace start table. For example, it is filled into the next row after the already filled row.

[0065] For example, logical mapping tables are typically stored entirely in a separate cache space, which is then divided into groups of equal size, such as... Figure 2 The L2P table portion, i.e., the logical mapping table, requires all groups to be the same size, which can be determined by the firmware. When the controller creates a new namespace, we can determine the number of groups needed for that namespace based on its memory usage, and record the allocated groups sequentially in the NS_Group_Info_Table. The independent caches linked together by these groups constitute the storage space for the logical mapping table corresponding to that namespace. Simultaneously, the sequence number of the first group belonging to each namespace is recorded in the NS_Start_Table. For example... Figure 2 In NS1, the group number of the group starting in namespace 1 is 0, and in NS2, the group number of the group starting in namespace 2 is 1.

[0066] As an optional implementation of this embodiment, based on the received namespace creation instruction, the memory usage of the namespace to be created is determined, and the size information of the namespace to be created is obtained through the namespace creation instruction. Based on the memory usage and the preset storage usage of the groups, the number of groups to be created is determined. The size information of the namespace to be created is compared with the preset storage usage of the groups to calculate how many groups are needed to meet the storage requirements of the namespace to be created. Based on the number of groups, the groups to be created are allocated to the namespace to be created in the physical space corresponding to the logical mapping table, and the group sequence number corresponding to the group to be created is determined. Allocation is performed in the physical space corresponding to the logical mapping table to ensure that the namespace to be created can continuously occupy the required number of groups, and a unique group sequence number is assigned to each group. A namespace start table and a group sequence number table are generated based on the group sequence number. The namespace start table is generated according to the allocated group sequence number, recording the starting group sequence number and other relevant information of each namespace. The group sequence number table is generated, recording the sequence number of each group and the corresponding namespace information.

[0067] For example, based on the received namespace creation instruction, it is determined that a namespace of 100GB needs to be created. The memory usage of the namespace to be created is determined, and the size of the namespace to be created is determined to be 100GB. The number of groups to be created is determined, and the number of groups required to meet the storage requirements of the namespace to be created is calculated: 100GB / 10GB = 10 groups. Within the physical space corresponding to the logical mapping table, 10 consecutive groups are allocated for the namespace to be created, and the group number corresponding to each group is determined. A namespace start table and a group number table are generated. Based on the allocated group numbers, a namespace start table is generated, recording the starting group number and other relevant information for the namespace. A group number table is generated, recording the number of each group and its corresponding namespace information.

[0068] The technical solutions described in the embodiments of this application have at least the following technical effects or advantages:

[0069] Based on the received namespace creation instruction, the memory usage of the namespace to be created is determined; based on the memory usage and the preset storage usage of the groups, the number of groups to be created is determined; based on the number of groups, the groups to be created are allocated to the namespace to be created in the logical mapping table, and the group sequence number corresponding to the group to be created is determined; based on the group sequence number, a namespace start table and a group sequence number table are generated. Therefore, this effectively solves the technical problem in related technologies where migrating all stored data to the idle space generated by deletion is time-consuming, reducing the utilization efficiency and lifespan of solid-state drives. It achieves the technical effect of improving the efficiency of namespace maintenance in the logical mapping table and reducing the load on the storage system. Furthermore, in a multi-concurrency namespace environment, read or write commands are issued based on the base namespace. This approach allows for direct processing of read or write commands without the need for Namespace LBA to be converted to LBA addressed by disk capacity.

[0070] Based on Embodiment 1, Embodiment 2 of this application proposes a group-based namespace management method, wherein step S130 includes:

[0071] Step S210: Determine the free groups within the logical mapping table.

[0072] In this embodiment, a free group refers to an unused group within the storage space where the logical mapping table resides. The logical mapping table is traversed to find unoccupied groups, and their group numbers and location information are recorded.

[0073] Step S220: Based on the group number of the idle group, determine the group to be created corresponding to the number of groups, based on ascending or descending order.

[0074] In this embodiment, the group numbers of the idle groups are sorted in ascending or descending order according to the number of groups. Consecutive groups are then selected from the sorted idle groups, ensuring that their number equals the number of groups to be created.

[0075] Step S230: Assign the group to be created to the namespace to be created.

[0076] In this embodiment, the selected groups are marked as occupied, they are assigned to the namespace to be created, and their group number and location information are recorded.

[0077] For example, suppose the storage space corresponding to the logical mapping table has the following free groups:

[0078] Group number 1, free; Group number 2, free; Group number 3, occupied; Group number 4, free; Group number 5, free. The received namespace creation command is to create a namespace of size 100GB, with a preset group storage usage of 10GB. Based on this command, the logical mapping table is traversed to record the group numbers and position information of the free groups: 1, 2, 4, 5. The groups to be created are determined, and the group numbers of the free groups are sorted in ascending or descending order according to the number of groups: 1, 2, 4, 5. Consecutive groups are selected from the sorted free groups, making their number equal to the number of groups to be created. The groups to be created are assigned to the namespaces to be created, and the selected groups are marked as occupied. Their group numbers and position information are recorded.

[0079] Optionally, refer to Figure 3 Step S140 includes:

[0080] Step S240: Based on the group number, determine the group sequence corresponding to the namespace to be created in ascending or descending order.

[0081] In this embodiment, the groups are sorted in ascending or descending order according to their group numbers, and a group sequence corresponding to the namespace to be created is generated based on the sorted groups. That is, the group sequence is a group arranged in a certain order.

[0082] Step S250: Fill the group sequence into the consecutive portions of the group number table.

[0083] In this embodiment, the determined group sequence is filled into the consecutive parts of the group number table to ensure that they are consecutive.

[0084] Step S260: Determine the row number corresponding to the first-ranked group to be created in the continuous portion.

[0085] In this embodiment, the row number corresponding to the group to be created is determined, and the row number corresponding to the group to be created that is first sorted in the populated group number table is determined.

[0086] Step S270: Fill the empty portion of the namespace start table with the row number and the identifier of the namespace to be created.

[0087] In this embodiment, the row numbers and the identifier of the namespace to be created are then filled into the free parts of the namespace start table, and these parts are marked as occupied.

[0088] As another optional implementation, after determining the namespace to be created, refer to... Figure 2For namespace 2, the corresponding group sequence is 1, 32767, 2000, 1000. That is, group 1 is in the first row. Fill the group sequence into the group number table, and fill the empty part of the namespace start table with group number 1 and the namespace identifier NS2.

[0089] By employing the following methods: identifying free groups within the logical mapping table; determining the number of groups to be created based on their group numbers (in ascending or descending order); allocating these groups to the namespaces to be created; and then filling the namespace start table and group number table according to the group numbers and namespace identifiers, the system manages the addition, modification, and deletion of namespaces through the namespace start table and group number table, thereby improving hard drive utilization efficiency.

[0090] Based on Embodiment 1, Embodiment 3 of this application proposes a grouped namespace management method, referring to... Figure 4 After step S140, the following steps are included:

[0091] Step S310: Upon receiving an address query instruction, determine the namespace to be queried based on the address query instruction.

[0092] In this embodiment, the namespace to be queried is the namespace that needs to be queried. An address lookup command typically requests a specific address within that namespace. Therefore, the namespace to be queried is first determined based on the address lookup command. Then, the required address information is obtained from the group corresponding to the namespace to be queried.

[0093] Step S320: Based on the identifier of the namespace to be queried and the namespace start table, determine the position information of the namespace to be queried in the group sequence table.

[0094] In this embodiment, the location information refers to the row number of the namespace to be queried in the group sequence table.

[0095] Step S330: Determine the address information corresponding to the address query instruction in the logical mapping table based on the location information.

[0096] In this embodiment, after determining the location information, the corresponding group number is determined in the group number table based on the location information, the corresponding physical address is determined in the storage space corresponding to the logical mapping table based on the group number, and the data stored in the physical address is obtained, that is, the address information corresponding to the address query instruction.

[0097] As an optional implementation, the namespace to be queried is determined. When an address query command is received, the identifier of the namespace to be queried is extracted from the query command. The position information of the namespace to be queried in the group sequence number table is determined. The identifier of the namespace to be queried is searched in the namespace start table to determine its corresponding row number. The position information of the namespace to be queried in the group sequence number table is found using the row number, thus determining the position information of the namespace to be queried in the group sequence number table. The address information corresponding to the address query command is determined. Based on the determined position information, the corresponding address information is found in the logical mapping table, thus determining the address information corresponding to the address query command.

[0098] For example, suppose the received address query instruction is for namespace A. Determine the location of the namespace to be queried in the group sequence number table. Search for the identifier of namespace A in the namespace start table, and determine its corresponding row number as 3. Using row number 3, find the group number 2890 corresponding to the third row in the group sequence number table. Based on the determined location information, i.e., group number 2890, find the group corresponding to group number 2890 in the physical space corresponding to the logical mapping table, and retrieve the data in the group as the address information corresponding to the address query instruction.

[0099] Optionally, step S320 includes:

[0100] Step S321: Based on the identifier of the namespace to be queried, determine the starting row number and offset row number in the namespace start table.

[0101] In this embodiment, the starting row number is the row number of the first row of the group sequence corresponding to the namespace in the group sequence table; that is, the row number is relative to the group sequence table. The offset row number indicates which position of the determined group in the group sequence.

[0102] Based on the identifier of the namespace to be queried, determine the starting row number and offset row number in the namespace start table. Traverse the namespace start table to find the row number corresponding to the namespace to be queried; this row number is the starting row number. (The process is repeated in the original text.)

[0103] Step S322: Determine the group sequence corresponding to the namespace to be queried in the group sequence table based on the starting row number.

[0104] In this embodiment, the group sequence corresponding to the namespace to be queried is determined in the group sequence number table based on the starting row number, and the corresponding group sequence is found in the group sequence number table using the starting row number.

[0105] Step S323: Determine the corresponding group number in the group sequence based on the offset row number to determine the position information.

[0106] In this embodiment, the corresponding group number in the group sequence is determined based on the offset row number to determine the position information. The corresponding group number in the group sequence is determined based on the offset row number, which is the position information of the namespace to be queried in the group number table.

[0107] For example, assuming the identifier of the namespace to be queried is "NamespaceA", the starting row number corresponding to this namespace is found in the namespace start table as 3 and the offset row number is 2. Based on the starting row number 3, the group number corresponding to row number 3 is found in the group number table as 5. Based on the offset row number 2, the next row in the group sequence corresponding to group number 5 is determined, which is group number 27. Therefore, the position information is 27.

[0108] Optionally, step S330 includes:

[0109] Step S331: Based on the group number corresponding to the location information, determine the corresponding group to be queried in the logical mapping table.

[0110] In this embodiment, the group to be queried is found in the physical space corresponding to the logical mapping table based on the group number in the location information.

[0111] Step S332: Determine the address information in the query group based on the offset corresponding to the address query instruction.

[0112] In this embodiment, the offset refers to the specific storage location within the group. The specific address offset to be queried is determined according to the address query instruction. The corresponding address information is then found within the group to be queried based on the offset.

[0113] For example, assuming the group number corresponding to the location information is 5, the corresponding group space to be queried is found to be "GroupE" in the logical mapping table. Assuming the offset corresponding to the address query instruction is "0x34", the corresponding address information, i.e., the mapping relationship between logical address and physical address, is found in the group space to be queried "GroupE" based on the offset "0x34".

[0114] By employing a method that, upon receiving an address query command, determines the namespace to be queried based on the command; determines the location of the namespace in the group sequence table based on its identifier and the namespace start table; and determines the address information corresponding to the address query command in the logical mapping table based on the location information, direct read and write operations on the namespace are achieved without requiring a translation through the namespace's logical address, thus improving hard drive query efficiency.

[0115] Based on Embodiment 1, Embodiment 4 of this application proposes a group-based namespace management method, referring to... Figure 5 After step S140, the following steps are included:

[0116] Step S410: Upon receiving a namespace deletion instruction, determine the group to be deleted corresponding to the namespace deletion instruction based on the namespace start table and the group sequence number table.

[0117] As an optional implementation, based on the received namespace deletion instruction, the starting line number and offset line number of the corresponding namespace to be deleted are found from the namespace start table. Based on the starting line number and offset line number, the group sequence corresponding to the namespace to be deleted is determined from the group sequence table. The corresponding group to be deleted is then found based on the group sequence.

[0118] Step S420: Perform a clearing action on the storage content corresponding to the group to be deleted.

[0119] As an optional implementation, clear the stored content in the group to be deleted to ensure that the data is correctly removed.

[0120] Step S430: Perform a clearing and rearrangement operation on the namespace start table and the group sequence number table.

[0121] As an optional implementation, the starting row number and offset row number of the namespace to be deleted are removed from the space start table, and the contents of the list are rearranged to ensure that the gaps in the table are filled reasonably. Similarly, the group sequence corresponding to the namespace to be deleted is removed from the group sequence number table, and the contents of the list are rearranged to ensure that the gaps in the table are filled reasonably.

[0122] In this embodiment, if the master controller deletes a namespace, the firmware only needs to release the group to which the namespace belongs and clear the contents of the namespace start table and group sequence number table to reclaim and reuse the storage space where these groups, i.e., the logical mapping tables, are located. After the master controller performs multiple namespace deletion and creation operations, the contents of the namespace start table and group sequence number table only need to be organized, without the need for a large amount of data migration.

[0123] For example, a mark-and-delete approach can be used, marking the spaces of the group to be deleted as deleted instead of immediately clearing their contents, thus reducing the time cost of data migration and clearing. When performing the clearing and rearrangement operation, the characteristics of the space start table and the group sequence number table can be combined to employ efficient data structures and algorithms for table rearrangement, thereby improving the efficiency of the rearrangement.

[0124] For example, suppose a namespace deletion command is received to delete the namespace "NamespaceA". Based on the namespace start table and the group sequence number table, the group to be deleted corresponding to "NamespaceA" is determined to be "GroupC". Then, a cleanup operation is performed to clear the storage content in "GroupC". Finally, a cleanup and rearrangement operation is performed on the namespace start table and the group sequence number table, removing the row number and sequence corresponding to "NamespaceA" from the table and rearranging the contents of the list.

[0125] Optionally, step S430 includes:

[0126] Step S431: Clear the corresponding record of the namespace to be deleted in the namespace start table and the group sequence number table.

[0127] Step S432: Based on the deleted empty parts, migrate the remaining contents of the namespace start table and the group sequence number table in their entirety to make the records in the namespace start table and the group sequence number table continuous.

[0128] In this embodiment, the corresponding records of the namespace deletion instructions for the namespaces to be deleted are cleared from the namespace start table and the group sequence number table. This means marking the records of the namespaces to be deleted as deleted, or removing these records from the tables. Based on the vacant portions after deletion, the remaining contents of the namespace start table and the group sequence number table are fully migrated to ensure that the records in the tables are continuous.

[0129] As an alternative implementation, the location of the deleted record is identified, and the position and size of the vacancy are determined. The remaining records in the table are shifted forward to fill the vacancy, making the records continuous. The indexes or pointers in the namespace start table and group sequence number table are updated to reflect the new position of the record.

[0130] As an alternative implementation, incremental migration can be used to move records in the table incrementally, reducing the overall data migration time cost. During full migration, multi-threading or parallel processing can be combined to improve migration efficiency.

[0131] For example, suppose we want to delete the namespace "NamespaceA", which occupies positions 1 and 2 in the namespace start table and corresponds to group sequence 3 in the group sequence number table. First, mark the records at positions 1 and 2 in the namespace start table as deleted, or remove them from the table. Then, identify the position and size of the vacant portion, and shift the remaining records in the namespace start table forward to fill the vacant portion. Simultaneously, update the indexes or pointers in the namespace start table to reflect the new positions of the records. The same operation applies to the group sequence number table.

[0132] By employing a method that, upon receiving a namespace deletion command, determines the group to be deleted based on the namespace start table and the group sequence number table; performs a clearing operation on the storage content corresponding to the group to be deleted; and performs a clearing and rearrangement operation on the namespace start table and the group sequence number table, direct read and write operations on the namespace are achieved without needing to perform a translation through the logical address of the namespace, thus improving hard drive query efficiency. Simultaneously, it eliminates the need for extensive data migration of the storage space containing the logical mapping table, extending the hard drive's lifespan and utilization efficiency. This extended lifespan is beneficial because storage particles have a limited number of read / write operations; frequent full data migrations significantly shorten the lifespan of storage particles.

[0133] This application also proposes a group-based namespace management device, referring to... Figure 6 , Figure 6 This is a schematic diagram of the hardware operating environment based on grouping namespace management device involved in the embodiments of this application.

[0134] like Figure 6As shown, the group-based namespace management device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk drive. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.

[0135] Those skilled in the art will understand that Figure 6 The structure shown does not constitute a limitation on group-based namespace management devices and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0136] Optionally, the memory 1005 is electrically connected to the processor 1001, which can be used to control the operation of the memory 1005 and can also read data in the memory 1005 to implement group-based namespace management.

[0137] Optionally, such as Figure 6 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a data storage module, a network communication module, a user interface module, and a group-based namespace management program.

[0138] Optionally, in Figure 6 In the group-based namespace management device shown, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with users; the processor 1001 and memory 1005 in the group-based namespace management device of this application can be set in the group-based namespace management device.

[0139] like Figure 6As shown, the group-based namespace management device calls the group-based namespace management program stored in the memory 1005 through the processor 1001, and executes the relevant steps of the group-based namespace management method provided in this application embodiment:

[0140] Based on the received namespace creation instructions, determine the memory usage of the namespace to be created;

[0141] Based on the memory usage and the preset storage usage of the groups, the number of groups to be created is determined;

[0142] Based on the number of groups, the group to be created is allocated to the namespace to be created in the logical mapping table, and the group number corresponding to the group to be created is determined;

[0143] A namespace start table and a group number table are generated based on the group number.

[0144] Optionally, the processor 1001 may invoke a group-based namespace management program stored in memory 1005 and further perform the following operations:

[0145] Identify the free groups within the logical mapping table;

[0146] Based on the group number of the idle group, and in ascending or descending order, determine the number of groups to be created corresponding to the number of groups.

[0147] Assign the group to be created to the namespace to be created.

[0148] Optionally, the processor 1001 may invoke a group-based namespace management program stored in memory 1005 and further perform the following operations:

[0149] Based on the group number, determine the group sequence corresponding to the namespace to be created in ascending or descending order;

[0150] Fill the consecutive portions of the group sequence into the group number table;

[0151] Determine the row number of the first-ranked group to be created in the continuous segment;

[0152] Fill the empty portion of the namespace start table with the row number and the identifier of the namespace to be created.

[0153] Optionally, the processor 1001 may invoke a group-based namespace management program stored in memory 1005 and further perform the following operations:

[0154] Upon receiving an address query instruction, the namespace to be queried is determined based on the address query instruction;

[0155] Based on the identifier of the namespace to be queried and the namespace start table, determine the position information of the namespace to be queried in the group sequence table;

[0156] Based on the location information, the address information corresponding to the address query instruction is determined in the logical mapping table.

[0157] Optionally, the processor 1001 may invoke a group-based namespace management program stored in memory 1005 and further perform the following operations:

[0158] Based on the identifier of the namespace to be queried, determine the starting row number and offset row number in the namespace start table;

[0159] Based on the starting row number, determine the group sequence corresponding to the namespace to be queried in the group sequence number table;

[0160] The group number in the group sequence is determined based on the offset row number, thereby determining the location information.

[0161] Optionally, the processor 1001 may invoke a group-based namespace management program stored in memory 1005 and further perform the following operations:

[0162] Based on the group number corresponding to the location information, the corresponding group to be queried is determined in the logical mapping table;

[0163] The address information is determined in the query group based on the offset corresponding to the address query instruction.

[0164] Optionally, the processor 1001 may invoke a group-based namespace management program stored in memory 1005 and further perform the following operations:

[0165] Upon receiving a namespace deletion instruction, the group to be deleted corresponding to the namespace deletion instruction is determined based on the namespace start table and the group sequence number table.

[0166] Perform a clearing action on the storage content corresponding to the group to be deleted;

[0167] Perform a clear and rearrange operation on the namespace start table and the group sequence number table.

[0168] Optionally, the processor 1001 may invoke a group-based namespace management program stored in memory 1005 and further perform the following operations:

[0169] Clear the namespace start table and the group sequence number table, and clear the corresponding record of the namespace to be deleted corresponding to the namespace deletion instruction;

[0170] Based on the deleted empty parts, the remaining contents of the namespace start table and the group sequence number table are fully migrated to ensure that the records in the namespace start table and the group sequence number table are continuous.

[0171] Furthermore, embodiments of this application also propose a computer-readable storage medium storing a group-based namespace management program, which, when executed by a processor, implements the relevant steps of any embodiment of the group-based namespace management method described above.

[0172] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0173] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0174] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0175] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0176] It should be noted that any reference signs placed between parentheses in the claims should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. This application can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

[0177] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0178] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A group-based namespace management method, characterized by, The group-based namespace management method includes: Based on the received namespace creation instructions, determine the memory usage of the namespace to be created; Based on the memory usage and the preset storage usage of the groups, the number of groups to be created is determined; Based on the number of groups, the group to be created is allocated to the namespace to be created in the logical mapping table, and the group number corresponding to the group to be created is determined; Generate a namespace start table and a group number table based on the group number; The steps of generating the namespace start table and the group number table based on the group number include: Based on the group number, determine the group sequence corresponding to the namespace to be created in ascending or descending order; Fill the consecutive portions of the group sequence into the group number table; Determine the row number of the first-ranked group to be created in the continuous segment; Fill the empty portion of the namespace start table with the row number and the identifier of the namespace to be created.

2. The group-based namespace management method of claim 1, wherein, The step of allocating the groups to be created to the namespace to be created within the logical mapping table based on the number of groups, and determining the group number corresponding to the groups to be created, includes: Identify the free groups within the logical mapping table; Based on the group number of the idle group, and in ascending or descending order, determine the number of groups to be created corresponding to the number of groups. Assign the group to be created to the namespace to be created.

3. The namespace management method based on grouping as described in claim 1, characterized in that, After the step of generating the namespace start table and the group number table based on the group number, the following steps are included: Upon receiving an address query instruction, the namespace to be queried is determined based on the address query instruction; Based on the identifier of the namespace to be queried and the namespace start table, determine the position information of the namespace to be queried in the group sequence table; Based on the location information, the address information corresponding to the address query instruction is determined in the logical mapping table.

4. The group-based namespace management method as described in claim 3, characterized in that, The step of determining the position information of the namespace to be queried in the group sequence table based on the identifier of the namespace to be queried and the namespace start table includes: Based on the identifier of the namespace to be queried, determine the starting row number and offset row number in the namespace start table; Based on the starting row number, determine the group sequence corresponding to the namespace to be queried in the group sequence number table; The group number in the group sequence is determined based on the offset row number, thereby determining the location information.

5. The group-based namespace management method as described in claim 3, characterized in that, The step of determining the address information corresponding to the address query instruction in the logical mapping table based on the location information includes: Based on the group number corresponding to the location information, the corresponding group to be queried is determined in the logical mapping table; The address information is determined in the query group based on the offset corresponding to the address query instruction.

6. The namespace management method based on grouping as described in claim 1, characterized in that, After the step of generating the namespace start table and the group number table based on the group number, the following steps are included: Upon receiving a namespace deletion instruction, the group to be deleted corresponding to the namespace deletion instruction is determined based on the namespace start table and the group sequence number table. Perform a clearing action on the storage content corresponding to the group to be deleted; Perform a clear and rearrange operation on the namespace start table and the group sequence number table.

7. The group-based namespace management method as described in claim 6, characterized in that, The step of performing a cleanup and rearrangement operation on the namespace start table and the group sequence number table includes: Clear the namespace start table and the group sequence number table, and clear the corresponding record of the namespace to be deleted corresponding to the namespace deletion instruction; Based on the deleted empty parts, the remaining contents of the namespace start table and the group sequence number table are fully migrated to ensure that the records in the namespace start table and the group sequence number table are continuous.

8. A group-based namespace management device, characterized in that, The method includes a memory, a processor, and a group-based namespace management program stored in the memory and executable on the processor, wherein the processor, when executing the group-based namespace management program, implements the steps of the group-based namespace management method as described in any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a group-based namespace management program, which, when executed by a processor, implements the steps of the group-based namespace management method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • An LBA allocation method and a mapping method of namespaces applied to an NVMe SSD (Solid State Disk) controller

    CN109902033A