ZNSSSD management methods and data writing methods, storage devices, controllers

By obtaining the least common multiple of the storage unit partitions of the ZNS SSD and re-dividing them into target partitions, the problems of high management complexity and low read/write efficiency of ZNS SSDs from different manufacturers are solved, thus improving compatibility and efficiency.

CN117215485BActive Publication Date: 2026-11-10SHANGHAI HONGXINYU MICROELECTRONICS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311177299.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-12
Publication Date
2026-11-10
Estimated Expiration
2043-09-12

AI Technical Summary

Technical Problem

ZNS SSDs produced by different manufacturers are of different types, making compatibility difficult. In addition, ZNS SSDs divide storage units into multiple partitions, each with different sizes and performance characteristics, resulting in high management complexity and low read/write efficiency.

Method used

By obtaining the storage space of the current partition of multiple storage units, finding the least common multiple, and re-dividing them into target partitions, the size and combination of partitions can be dynamically adjusted to optimize the storage layout and improve read and write efficiency.

Benefits of technology

It achieves compatibility with different manufacturers and types of solid-state drives, reduces management complexity, improves read and write efficiency, and extends the lifespan of solid-state drives.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117215485B_ABST
    Figure CN117215485B_ABST
Patent Text Reader

Abstract

This application proposes a ZNS SSD management method, a data writing method, a storage device, and a controller. This application re-partitions multiple connected storage units, ensuring compatibility with different manufacturers and types of SSDs. By dynamically adjusting the size and combination of partitions, it optimizes the storage layout, improves read / write efficiency, reduces management complexity, and provides users with a superior storage experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of memory management technology, specifically to a ZNS SSD (Zoned Namespaces SSD) management method and data writing method, storage device, and controller. Background Technology

[0002] Solid-state drives (SSDs) are now widely used in large data centers and enterprise software applications. A new type of SSD, commercially known as ZNS SSD, has been introduced. Unlike traditional SSDs that support both random writes and reads, ZNS SSDs only allow sequential writes within their zones, but support random reads. ZNS SSDs closely mirror the physical layout of the underlying flash memory, significantly simplifying the FTL (Flash Translation Layer) within the ZNS SSD. This improvement greatly reduces the amount of DRAM (Dynamic Random Access Memory) required by ZNS SSDs and significantly lowers their cost. While ZNS SSDs offer efficient storage solutions for servers, the different types of SSDs from various manufacturers make compatibility difficult. Furthermore, ZNS SSDs divide storage units into multiple zones, each with different sizes and performance characteristics. Therefore, when multiple types of SSDs are connected, the host needs to manage a large number of storage units with varying partition sizes, increasing management complexity and impacting read / write efficiency. Summary of the Invention

[0003] In view of this, this application provides a ZNS SSD management method and data writing method, storage device, and controller, which can improve the problems of incompatibility between different manufacturers and different types of solid-state drives, high management complexity, and low read and write efficiency.

[0004] This application provides a ZNS SSD management method, including: Get the storage space of the current partition of multiple storage units; Obtain the least common multiple of the storage space of the current partition of the plurality of storage units; Each of the aforementioned storage units is re-divided into multiple target partitions, and the storage space of each target partition is equal to the least common multiple.

[0005] This application provides a ZNS SSD management method, including: Get the storage space of the current partition of multiple storage units; Find the storage unit with the smallest storage space in the current partition, pair it with other storage units one by one, and find the least common multiple of the storage space of each pair in the current partition. From the plurality of storage units, select the plurality of storage units corresponding to the smallest least common multiple as a group; The storage units of each group are re-divided into multiple target partitions, and the storage space of each target partition is equal to the least common multiple of the corresponding groups.

[0006] This application provides a data writing method, including: In response to receiving a write request, the storage of the data contained in the write request is obtained; Determine whether the storage of the data has reached a preset threshold; If so, then obtain the storage space of the current partition of the multiple storage units, then obtain the least common multiple of the storage space of the current partition of the multiple storage units, and re-divide each of the storage units into multiple target partitions, the storage space of each target partition being equal to the least common multiple; If not, obtain the storage space of the current partition of multiple storage units, then obtain the storage unit with the smallest storage space of the current partition, pair it with other storage units one by one, and obtain the least common multiple of the storage space of each paired current partition; then select multiple storage units corresponding to the smallest least common multiple from the multiple storage units as a group, and re-divide the storage units of each group into multiple target partitions, the storage space of each target partition being equal to the least common multiple of each group; Write the data to the corresponding target partition.

[0007] Optionally, when the data storage does not reach a preset threshold, the data is written into the corresponding target partition, including: obtaining the remaining erase count of the storage unit of each group, and writing the data into the target partition corresponding to the group with the largest remaining erase count; and / or, obtaining the remaining erase count of the storage unit of each group, and writing the data into the target partition corresponding to the group with a remaining erase count less than a preset erase count threshold.

[0008] Optionally, when the data occupancy does not reach a preset threshold, the data is written into the corresponding target partition, including: selecting the target partition with the largest remainder when the data occupancy is divided by the storage space, and writing the data into the target partition with the largest remainder.

[0009] Optionally, the preset threshold is the least common multiple of the storage space of the current partition of all currently accessed storage units.

[0010] Optionally, the method further includes: selecting multiple storage units from all accessed storage units according to preset information; and performing any of the ZNS SSD management methods described above on the selected multiple storage units.

[0011] Optionally, the preset information includes at least one of the following: the type of stored data, the storage space occupied by the stored data, and the used space of each storage unit.

[0012] This application provides a storage device, comprising: The upper-layer interface is used to receive write requests from the upper-layer program; Storage interface for connecting solid-state drives; A central processing unit for executing the methods described in any of the preceding methods.

[0013] This application provides a controller that stores an adaptive management program, which, when executed by a processor, implements the method described in any of the preceding claims.

[0014] As described above, this application re-partitions the multiple access storage units, which can be compatible with different types of solid-state drives from different manufacturers. By dynamically adjusting the size and combination of partitions, the storage layout can be optimized, read and write efficiency can be improved, management complexity can be reduced, and a good storage experience can be provided to users. Attached Figure Description

[0015] Figure 1 A flowchart illustrating the ZNS SSD management method provided in the first embodiment of this application; Figure 2 A flowchart illustrating the ZNS SSD management method provided in the second embodiment of this application; Figure 3a This is a schematic diagram of the storage unit structure in the ZNS SSD; Figure 3b This is a schematic diagram of data writing provided in an embodiment of this application; Figure 4 A flowchart illustrating the ZNS SSD management method provided in the third embodiment of this application; Figure 5 A schematic diagram illustrating how to obtain a target storage address, provided as an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a storage device provided in an embodiment of this application. Detailed Implementation

[0016] To address the aforementioned problems in the prior art, this application provides a ZNS SSD management method, a data writing method, a storage device, and a controller. These protection subjects are based on the same concept, and their problem-solving principles are essentially the same or similar. The implementation methods of each protection subject can be referred to mutually, and repeated details will not be elaborated.

[0017] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly described below in conjunction with specific embodiments and corresponding drawings. Obviously, the embodiments described below are only a part of the embodiments of this application, and not all of them. Unless otherwise specified, the following embodiments and their technical features can be combined with each other, and also belong to the technical solutions of this application.

[0018] First Embodiment like Figure 1 The diagram shown is a flowchart of a ZNS SSD management method provided in an embodiment of this application. The communication architecture upon which this method is based consists of a host and multiple solid-state drives (SSDs) connected to the host. The host can be the executing entity of this method. Specifically, the host can be a server that sends instructions to each SSD. The CPU (also known as SSD CPU or SSD controller) of each SSD parses the information contained in the instruction. For example, in a data writing scenario, the instruction includes the data to be stored and the storage address. Of course, the instruction may also contain other information, which will not be described in detail here. The SSD CPU controls the storage unit to write the data to the corresponding storage address. The process of the storage unit writing data can be found in existing technologies.

[0019] The method includes at least the following steps S11 to S13.

[0020] S11: Get the storage space of the current partition of multiple storage units.

[0021] The multiple storage units can be based on multiple solid-state drives (SSDs) currently connected to the host. These SSDs may be from different manufacturers and of different types, or from the same manufacturer but of different types, or from different manufacturers but of the same type. Therefore, the specifications of the multiple storage units will differ.

[0022] Optionally, the host determines whether the types are the same by using the storage page information of the storage unit of the solid-state drive. The storage page information refers to the number of storage pages in a single block of the storage unit, such as 4K or 8K.

[0023] This application can first identify solid-state drives (SSDs) that support resizing partitions (or support partition repartitioning). For example, it can determine whether a SSD supports resizing partitions by consulting the SSD's specifications or contacting the SSD manufacturer. Then, steps S11 to S13 are performed on multiple SSDs that support resizing partitions.

[0024] In one implementation scenario, not all of the multiple solid-state drives currently connected to the host may support changing partition sizes; some may include one or more solid-state drives that do not support changing partition sizes. The host can manage these solid-state drives in accordance with existing practices in this field.

[0025] The host obtains the current partition's storage space from the SSD CPU through corresponding commands or APIs (Application Programming Interfaces). Storage space can represent the partition's storage space or, in other words, the partition size.

[0026] Optionally, the storage unit is NAND flash, and the storage space is block capacity.

[0027] S12: Obtain the least common multiple of the storage space of the current partition of the plurality of storage units.

[0028] The host can compare two storage units in pairs, obtain the least common multiple of the storage space of the current partitions of the two units, and repeat this process until all storage units have been compared. The final least common multiple is then set as the final partition size to be divided, which is called the storage space of the target partition.

[0029] For example: Suppose a host currently has six solid-state drives (SSDs) connected: A, B, C, D, E, and F. The current partition sizes of SSDs A, B, C, and D are different, for example, their storage space is 4K, 6K, 8K, and 10K respectively. SSD E has the same current partition size as SSD A, and SSD F has the same current partition size as SSD B. The host can select only the SSDs (or their storage units) with different current partition sizes for matching. First, the host finds the least common multiple (LCM) of the current partition space of SSD A and SSD B, which is 12K. Second, it finds the LCM between 12K and the current partition space of SSD C, which is 24K. Third, it finds the LCM between 24K and the current partition space of SSD D, which is 120K. Therefore, the LCM of the current partition space of these six SSDs is 120K. If new solid-state drives are subsequently added, i.e., new storage units are added, the above process is repeated for all storage units to recalculate the new least common multiple.

[0030] S13: The storage units are re-divided into multiple target partitions, and the storage space of each target partition is equal to the least common multiple.

[0031] This application embodiment re-partitions the multiple access storage units, which can be compatible with different types of solid-state drives from different manufacturers. By dynamically adjusting the size and combination of partitions, the storage layout can be optimized, read and write efficiency can be improved, management complexity can be reduced, and a good storage experience can be provided to users.

[0032] After the target partitions are re-partitioned, the logical address range (LBA) corresponding to each target partition changes compared to the partitions before partitioning (i.e., the aforementioned current partition). Therefore, this application will form a new address mapping table, which will be stored in the SSD CPU. Subsequently, data read / write operations between the host and the connected SSDs will be performed based on this new address mapping table.

[0033] The storage space M1 of a single target partition is greater than the storage space M0 of any partition before partitioning, i.e., M1 > M0, and M1 is an even multiple of M0. Therefore, in scenarios involving large amounts of data (data that occupies a large amount of storage), the write speed is relatively fast.

[0034] Second Embodiment like Figure 2 As shown, the ZNS SSD management method provided in this application embodiment is also based on a communication architecture consisting of a host and multiple solid-state drives (and their storage units) connected to the host. The same features as the first embodiment described above can be found in the foregoing and will not be repeated here.

[0035] The method includes at least the following steps S21 to S25.

[0036] S21: Obtain the storage space of the current partition of multiple storage units.

[0037] S22: Obtain the storage unit with the smallest storage space in the current partition, pair it with other storage units one by one, and obtain the least common multiple of the storage space of each pairing in the current partition.

[0038] S23: Select a group of storage cells that correspond to the smallest least common multiple of the values ​​from a group of storage cells.

[0039] like Figure 2 As shown, in one example, for multiple storage units other than the grouped units, steps S22 and S23 are repeated, and step S24 is executed: determining whether all storage units have been grouped; if not, the first and second steps are continued until all storage units have been grouped. If yes, step S25 is executed.

[0040] S25: The storage units of each group are re-divided into multiple target partitions, and the storage space of each target partition is equal to the least common multiple of the corresponding groups.

[0041] For example: Suppose the host is currently connected to 6 solid-state drives (SSDs) A, B, C, D, E, and F. The current partition sizes of SSDs A, B, C, and D are different, and the storage space of the storage units are 4K, 6K, 8K, and 10K respectively. SSD E has the same current partition size as SSD A, and SSD F has the same current partition size as SSD B.

[0042] In step S22: the storage units corresponding to solid-state drives A and B are paired up, and the least common multiple of the storage space of their current partitions is 12K; the storage units corresponding to solid-state drives A and C are paired up, and the least common multiple of the storage space of their current partitions is 8K; the storage units corresponding to solid-state drives A and D are paired up, and the least common multiple of the storage space of their current partitions is 20K.

[0043] In step S23: the least common multiple of the smallest value is 8K, so the storage units corresponding to solid-state drives A and C are grouped into group 1. Since solid-state drives E and A have the same partition size, the storage unit corresponding to solid-state drive E is also included in group 1. At this time, group 1 includes the storage units corresponding to solid-state drives A, C and E.

[0044] For the storage units corresponding to SSDs B, D, and F (excluding Group 1), SSD B and SSD D are paired up, and the least common multiple of the storage space of their current partitions is 30K; the partition sizes of SSD B and SSD F are equal. Therefore, the storage units corresponding to SSDs B, D, and F can be divided into a group, which is called Group 2 to distinguish it from the aforementioned Group 1.

[0045] In step S25, the storage space of a single target partition in group 1 is 8K, and the storage space of a single target partition in group 2 is 30K. In any group, the storage space of a single target partition is greater than the storage space of any partition before partitioning, and is an even multiple of the storage space before partitioning.

[0046] During the data writing phase, this application can select appropriate groups to perform the writing operation based on the data size (i.e., the data storage).

[0047] In one example, if the data size is x and the storage space of the target partition is y, the group with the largest remainder after dividing x by y can be selected to perform the write operation.

[0048] In another example, this application can perform the write operation based on the remaining erase counts of the storage units in each group. For example, it can select the group to which the storage unit with the most remaining erase counts belongs and perform the write operation; and / or, write the data to the target partition corresponding to the group with the remaining erase counts less than a preset erase count threshold. For example, since the preset erase count threshold can indicate that the current remaining erase counts have reached a preset value (e.g., a warning value), the data can be preferentially written to the target partition corresponding to the group with the remaining erase counts less than the preset erase count threshold, so that the groups that are about to reach or have already reached the preset value (e.g., the warning value) will undergo relatively fewer erase and write operations, thereby achieving a more balanced erase and write (i.e., wear leveling). As another example, when it is determined that the remaining erase counts of the target partition corresponding to a preset group or all groups are less than the preset erase count threshold, the group to which the storage unit with the most remaining erase counts belongs is selected and the write operation is performed. For example, in a scenario where two write requests are received within a preset period, for one write request, the group containing the storage unit with the most remaining erase counts is selected for the write operation. For the other write request, the data is written to the target partition corresponding to the group with fewer than a preset erase count threshold. By using two preset wear leveling methods, different wear leveling methods can be flexibly selected based on the size of the data being written, thus maximizing the balance between erasing and writing. In the aforementioned first embodiment, the target partition has a large storage space, and the data written to the solid-state drive will be scattered across different locations within the target partition, for example... Figure 3a The different pages of different blocks or different pages of the same block shown can cause write amplification, meaning that the ratio between the actual data written to the SSD and the data calculated by the host is large. Since only sequential writing is allowed in the target partition of the ZNS SSD, erasing a certain address requires erasing other pages of the target partition together. This results in additional erase and write operations, increasing the number of erases and the amount of data erased, thereby reducing the lifespan of the SSD.

[0049] Combination Figure 3b As shown, taking two blocks, 0 and 1, as an example, two invalid pages G remain. A valid page indicates that data has already been written to it. If data needs to be written to a new page, according to the storage principle of the storage unit, the two invalid pages must be erased before the write operation can be performed. This requires the additional space provided by the ZNS SSD, namely block 2. The solid arrows indicate the specific process, as follows: First, a completely free block 2 is located in the ZNS SSD. Then, pages ABCDEFH from block 0 and page A from block 1 are copied to the free block 2. Next, all data in block 0 is erased, and pages BCDEFH from block 1 are copied to block 0, leaving two free pages in block 0. Then, all data in block 1 is erased, thus writing data to all pages in block 2 and some pages in block 0. Finally, the free pages in block 0 and block 1 are obtained, allowing for normal write operations. This process shows that the first embodiment, due to the large target storage space, requires additional erase and write operations during the data writing phase, leading to an increase in the number of erases and the amount of data erased, thereby reducing the lifespan of the SSD.

[0050] Compared to the first embodiment mentioned above, the partition sizes of each group in this second embodiment are different. When performing a write operation on data with a small storage footprint, the host can prioritize finding a suitable group to write the data to the target partition of that group, thereby reducing additional erase and write operations, reducing the number of erases, reducing the amount of data erased, and helping to reduce the impact on the lifespan of the solid-state drive.

[0051] In addition, in the first embodiment mentioned above, if some target partitions contain relatively little data and some target partitions contain a lot of data, it will cause some target partitions to be frequently erased and written, while other target partitions will be erased and written relatively less. This uneven erasure and writing (i.e. uneven wear) will eventually lead to a shortened lifespan of the solid-state drives to which some target partitions belong.

[0052] Compared to the first embodiment described above, this second embodiment can select appropriate groups based on the data size (for example, prioritize the group to which the storage unit with the most remaining erase counts belongs) to perform the erase and write operations, thereby optimizing the data storage method and achieving a more balanced erase and write operation.

[0053] Third Embodiment like Figure 4 As shown, the data writing method provided in this application embodiment is also based on a communication architecture consisting of a host and multiple solid-state drives (and their storage units) connected to the host. The same features as those in the above embodiments can be found in the foregoing and will not be repeated here.

[0054] The data writing method includes at least the following steps S31 to S34.

[0055] S31: In response to receiving a write request, obtain the storage of the data contained in the write request.

[0056] S32: Determine whether the data storage has reached the preset threshold.

[0057] If so, then step S331, namely the steps of the ZNS SSD management method described in the first embodiment above, is executed to re-divide each storage unit into multiple target partitions.

[0058] If not, then step S332, namely the steps of the ZNS SSD management method described in the second embodiment above, is executed to obtain groups that each include multiple storage units.

[0059] And S34: Write the data to the corresponding target partition.

[0060] For ease of description and understanding, the partitioning of the first embodiment described above can be referred to as SUPER ZONE mode, and the partitioning of the first embodiment can be referred to as MIN ZONE mode.

[0061] The host can be equipped with a judgment module to select an appropriate mode based on the data usage, so that the SSD partition can be used effectively. When the data usage is greater than or equal to a preset threshold (e.g., 120K), it enters SUPER ZONE mode; when the data usage is less than the preset threshold (e.g., 120K), it enters MIN ZONE mode.

[0062] This application allows setting the preset threshold according to actual needs. For example, it can be the least common multiple of the storage space of the current partition of all current storage units. Taking the first embodiment mentioned above, with six solid-state drives (SSDs) A, B, C, D, E, and F currently connected, as an example, the least common multiple is 120K. Larger data is written using SUPER ZONE mode, which ensures a faster data write rate; smaller data is written using MIN ZONE mode, which selects appropriate groups to reduce the number of erases and the amount of data erased, thus promoting wear leveling of the SSDs.

[0063] When the data occupancy has not reached a preset threshold, in one implementation, the host can first obtain the remaining erase counts of the storage units in each group, and then write the data to the target partition corresponding to the group with the largest remaining erase count, and / or write the data to the target partition corresponding to the group with a remaining erase count less than the preset erase count threshold. For example, since the preset erase count threshold can indicate that the current remaining erase count has reached a preset value (e.g., a warning value), the data can be preferentially written to the target partition corresponding to the group with a remaining erase count less than the preset erase count threshold, so that the groups that are about to reach or have already reached the preset value (e.g., the warning value) will undergo relatively fewer erase and write operations, thereby achieving a more balanced erase and write (i.e., wear leveling). Another example is that when it is determined that the remaining erase counts of the target partitions corresponding to a preset group or all groups are less than the preset erase count threshold, the group to which the storage unit with the largest remaining erase count belongs is selected, and the write operation is performed. For example, in a scenario where two write requests are received within a preset period, for one write request, the group to which the storage unit with the most remaining erase counts belongs is selected and the write operation is performed. For the other write request, the data is written to the target partition corresponding to the group with fewer than the preset erase count threshold. By using two preset wear leveling methods, different wear leveling methods can be flexibly selected according to the size of the data being written, so as to achieve the maximum balance between erasure and writing.

[0064] In another possible implementation, the host can first select the target partition with the largest remainder when the data's storage space is divided by the storage space, and write the data to the target partition with the largest remainder; for example, if the data's storage space is x and the target partition's storage space is y, the group with the largest remainder after x is divided by y (the smallest remainder is zero) can be selected, and the data can be written to the group.

[0065] In step S34, the logical storage page address is used as an index to look up the data in the new address mapping table, determine the physical storage page address corresponding to the logical storage page address, and use it as the target storage address. Then, the data is written to the target storage address. Figure 5 As shown, the logical word line address 4 is used as an index to look up the first-level mapping table to determine the corresponding physical word line address 4 and the corresponding second-level mapping table address 4; then, the logical storage page address is used as an index to look up the corresponding second-level mapping table to determine the physical storage page address 1 corresponding to the logical storage page address 1, which is used as the target storage address, and then the data is written.

[0066] Upon receiving a write request, the number of storage units currently connected to the host can be greater than the number of storage units used in the aforementioned steps S331 or S332. That is, this application may not use all currently connected storage units (e.g., all storage units support changing partition sizes), but rather select a portion of the storage units for SUPER ZONE or MINZONE mode. Therefore, the data writing method further includes: selecting multiple storage units from all connected storage units according to preset information; and executing the ZNS SSD management method described in the first embodiment 1 and / or 2 on the selected multiple storage units.

[0067] Optionally, the preset information includes at least one of the following: the type of stored data, the storage space occupied by the stored data, and the used space of each storage unit. The type of stored data can be divided into data accessed by the APP, user configuration information data, and other types of data. The storage space occupied by the stored data can be divided according to the aforementioned preset threshold, or divided into multiple size levels according to multiple different thresholds.

[0068] Before writing data, the host can perform the following steps: S301: Determine the preset information and its types and quantities, and allocate a number of corresponding storage units for each type of preset information to form a flash memory group.

[0069] S302: In response to receiving a write request, determine the corresponding target flash memory group based on the feature information of the write request. That is, the selected multiple storage cells.

[0070] Optionally, it can be determined whether the flash memory group has sufficient physical space to write the data requested for the write request. If so, the data is written to the target partition obtained based on the flash memory group; if not, one or more of the currently accessed storage units are selected and added to the flash memory group, and after executing the aforementioned SUPER ZONE mode or MIN ZONE mode, the data is written to the corresponding target partition.

[0071] It should be noted that although step designations such as S31 and S32 are used in this embodiment, their purpose is to more clearly and concisely describe the corresponding content, and they do not constitute a substantial restriction on the order. Those skilled in the art may, for example, execute S331 before or after S32 in specific implementations, but these should all be within the scope of protection of this application. For example, the host of this application can execute steps S331 and S332 first, that is, before receiving a write request, it has already completed the partitioning using the aforementioned SUPERZONE mode and MINZONE mode, and stored the new address mapping tables corresponding to these two modes in, for example, an SSD CPU. When a write request is received, the host selects the corresponding new address mapping table according to the data storage space of the write request, thereby writing the data to the target partition obtained according to the corresponding mode. Of course, the host of this application can also execute one of steps S331 and S332 first, and then select the corresponding mode according to the data storage space when a write request is received.

[0072] This application embodiment also provides a storage device 5, such as... Figure 6 As shown, it includes an upper-layer interface 51, a storage interface 52, and a central processing unit 53.

[0073] The upper-layer interface 51 is used to receive write requests from the upper-layer program; The storage interface 52 is used to connect a solid-state drive; The central processing unit 53 is used to execute the steps of any of the methods described in the foregoing embodiments (including the ZNS SSD management method described in the first and second embodiments and the data writing method described in the third embodiment). For specific principles and processes, please refer to the above embodiments, which will not be repeated here.

[0074] This application also provides a controller, including the storage device 5 as described above, or a method that runs any of the above embodiments to realize the partition re-partitioning of the ZNS SSD. For related descriptions, please refer to the above embodiments, which will not be repeated here.

[0075] It should be understood that the storage device 5 and controller provided in this application embodiment are complete devices and also have the structure of the corresponding known devices. Here, only the components involving the partition re-division of ZNS SSD in the device are described, and other components are not described in detail.

[0076] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. For those skilled in the art, any equivalent structural transformations made using the content of this specification and drawings are similarly included within the patent protection scope of this application.

[0077] Although this document uses terms such as "first," "second," etc., to describe various types of information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. Furthermore, the singular forms "a," "an," and "the" are intended to also include the plural forms. The terms "or" and "and / or" are interpreted as inclusive, or meaning either one or any combination thereof. Exceptions to this definition only arise when combinations of elements, functions, steps, or operations are inherently mutually exclusive in some way.

Claims

1. A data writing method, characterized in that, include: In response to receiving a write request, the storage of the data contained in the write request is obtained; Determine whether the storage of the data has reached a preset threshold; If so, the following steps are performed: S11, obtain the storage space of the current partition of the multiple storage units; S12, obtain the least common multiple of the storage space of the current partition of the multiple storage units; and S13, re-divide each of the storage units into multiple target partitions, the storage space of each target partition being equal to the least common multiple; S14, write the data into the corresponding target partition. If not, proceed with the following steps: S21, obtain the storage space of the current partition of multiple storage units; S22, obtain the storage unit with the smallest storage space of the current partition from the ungrouped storage units, pair it with each other ungrouped storage unit, and obtain the least common multiple of the storage space of each paired current partition; S23, select the storage unit corresponding to the smallest least common multiple of each paired value as a group, repeat S22 and S23 for other storage units except the group, and proceed with S24, determine whether the grouping of all the multiple storage units is completed, if the grouping is completed, proceed with S25, re-divide the storage units of each group into multiple target partitions, and the storage space of each target partition is equal to the least common multiple corresponding to each group; S26, write the data into the corresponding target partition.

2. The method according to claim 1, characterized in that, When the data storage does not reach a preset threshold, the data is written into the corresponding target partition, including: Obtain the remaining erase counts for each group's storage unit, and write the data to the target partition corresponding to the group with the largest remaining erase count; and / or, Obtain the remaining erase count for each group's storage unit, and write the data to the target partition corresponding to the group whose remaining erase count is less than a preset erase count threshold.

3. The method according to claim 1, characterized in that, When the data storage does not reach a preset threshold, the data is written into the corresponding target partition, including: Select the target partition with the largest remainder when the data's storage space is divided by the storage space, and write the data to the target partition with the largest remainder.

4. The method according to any one of claims 1 to 3, characterized in that, The preset threshold is the least common multiple of the storage space of the current partition of all currently accessed storage units.

5. The method according to any one of claims 1 to 3, characterized in that, The method further includes: selecting multiple storage units from all accessed storage units according to preset information; Perform steps S11 to S13 on the selected multiple memory cells, or perform steps S21 to S25.

6. The method according to claim 5, characterized in that, The preset information includes at least one of the following: the type of stored data, the storage space occupied by the stored data, and the used space of each storage unit.

7. A storage device, characterized in that, include: The upper-layer interface is used to receive write requests from the upper-layer program; Storage interface for connecting solid-state drives; A central processing unit for performing the method as described in any one of claims 1 to 6.

8. A controller, characterized in that, An adaptive management program is stored, which, when executed by a processor, implements the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Zoned namespace with zone grouping

    US20200167274A1

  • Memory management device, data recorder, and memory area setting method

    WO2010103780A1