ZNS flash solid state drive operating method, device, and electronic device
By forming a storage pool in the ZNS flash solid-state drive and marking the wear value, selecting the target flash blocks for parallelism and wear leveling, and dynamically reconstructing the partitions, the problem of uneven wear is solved, the service life is extended, and the performance is improved.
Patent Information
- Application Number
- CN202211078101.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-05
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2042-09-05
AI Technical Summary
The uneven wear of ZNS flash solid-state drives leads to a shortened service life, which cannot be effectively addressed by existing technologies.
By forming a storage pool, marking the wear value of each flash memory block, selecting the target flash memory block based on the operation parallelism and wear value of the flash memory block, dynamically reconstructing the partition, and performing write and erase operations in parallel to balance the wear.
It extends the service life of ZNS flash solid state drives, balances the wear of internal flash blocks, and improves the reliability and performance of storage devices.
Smart Images

Figure CN115480698B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage technology, and in particular to an operating method, device, electronic device, and computer-readable storage medium of a ZNS flash solid-state drive. Background Art
[0002] The ZNS (Zoned Namespace) protocol, introduced by the NVMe standard, redefines the solid-state storage interface (ZNS interface). The ZNS interface simplifies the design of the traditional block device interface combined with the Flash Translation Layer (FTL), providing a more transparent access path for upper-layer applications, avoiding internal garbage collection, reducing storage device costs, and improving storage device performance. Simultaneously, some hardware vendors have developed flash solid-state drives (ZNS-SSDs) based on the ZNS interface, aiming to improve storage system performance and utilization. However, due to the unique characteristics of the ZNS interface, new ZNS-SSD hardware still faces numerous challenges while enabling data centers to achieve extreme performance. Among them, the lifespan of ZNS-SSDs is a significant factor affecting data center costs and reliability. Specifically, the ZNS interface divides the logical address space into fixed-size zones. ZNS-SSDs use a zone mapping method to erase data to reclaim space, resulting in uneven wear within the zones and significantly shortening the lifespan of the ZNS-SSDs.
[0003] It can be seen that the operating method of the ZNS flash solid state drive in the prior art needs to be improved. Summary of the Invention
[0004] The embodiments of the present application provide a method and device for operating a ZNS flash memory solid-state drive, which can solve the problem of uneven internal wear of the ZNS flash memory solid-state drive, which seriously shortens the service life of the ZNS flash memory solid-state drive.
[0005] In a first aspect, an embodiment of the present application discloses a method for operating a ZNS flash solid-state drive, comprising:
[0006] A storage pool is formed based on the flash memory blocks included in each flash memory chip inside the ZNS flash solid state drive, wherein each flash memory block in the storage pool is marked with a wear value;
[0007] In response to a storage partition reconstruction triggered by a write operation to a designated raw partition of the ZNS flash solid state drive, selecting a target flash block based on the operational parallelism of the flash blocks in the storage pool and the wear value, wherein the operational parallelism is determined according to the similarities and differences of the flash chips to which the flash blocks belong;
[0008] Based on the target flash memory block, forming a reconstructed partition corresponding to the specified original partition;
[0009] The write operation is performed based on the reconstructed partition.
[0010] Optionally, after forming a reconstructed partition corresponding to the designated original partition based on the target flash memory block, the method further includes:
[0011] Establishing a partition mapping relationship between the reconstruction partition and each of the flash memory blocks included in the reconstruction partition;
[0012] After performing the write operation based on the reconstructed partition, the method further includes:
[0013] In response to an erase operation on the designated original partition, obtaining, according to the partition mapping relationship, a flash memory block included in the reconstructed partition corresponding to the designated original partition;
[0014] Based on the acquired flash memory block, performing a flash memory block erase operation;
[0015] The wear value of the flash memory block erased by performing the flash memory block erase operation is updated, and the partition mapping relationship between the obtained flash memory block and the corresponding reconstruction partition is deleted.
[0016] Optionally, performing a flash memory block erase operation based on the acquired flash memory block includes:
[0017] A flash memory block erasing operation is performed on the flash memory block storing data among the acquired flash memory blocks.
[0018] Optionally, selecting a target flash memory block based on the operation parallelism of the flash memory blocks in the storage pool and the wear value includes:
[0019] Taking the operation parallelism of the selected flash memory block as a preferred condition, a flash memory block whose wear value meets a wear value leveling condition is selected from the storage pool as a target flash memory block.
[0020] Optionally, taking the operation parallelism of the selected flash memory blocks as a preferred condition, selecting a flash memory block whose wear value satisfies a wear value leveling condition from the storage pool as a target flash memory block includes:
[0021] Determining a data heat type matched by the write operation according to a data operation heat matched by the specified original partition targeted by the write operation;
[0022] Determining, based on the capacity of the designated original partition, the number of flash memory blocks included in the reconstructed partition corresponding to the designated original partition;
[0023] Taking the operation parallelism of the selected flash memory blocks as the preferred condition, select the number of empty flash memory blocks from the storage pool whose wear values match the data heat type and the difference between the wear values is less than the preset difference threshold as the target flash memory blocks.
[0024] Optionally, the operation parallelism conditions include, from high to low, parallel operation of all flash memory blocks, parallel operation of some flash memory blocks, and serial operation of flash memory blocks. Taking the operation parallelism of the selected flash memory blocks as the preferred condition, selecting, from the storage pool, a number of empty flash memory blocks whose wear values match the data heat type and whose differences between the wear values are less than a preset difference threshold as target flash memory blocks, includes:
[0025] Initialize the current operation parallelism condition as follows: all flash memory blocks operate in parallel;
[0026] Selecting, from the storage pool, the number of empty flash memory blocks that match the current operation parallelism condition, whose wear values match the data heat type, and whose wear value differences are less than a preset difference threshold;
[0027] In response to a successful selection, determining the selected empty flash memory block as a target flash memory block;
[0028] In response to a selection failure, the current operation parallelism condition is lowered, and the process jumps to executing the process of selecting the number of empty flash blocks from the storage pool that match the current operation parallelism condition, whose wear values match the data heat type, and whose difference between the wear values is less than a preset difference threshold, until the current operation parallelism condition is a non-flash block serial operation.
[0029] Optionally, the data heat type includes: cold data, hot data, and unknown heat, and the wear value matches the data heat type, including any of the following situations:
[0030] In a case where the data heat type matches hot data, the wear value is lower than a first wear value threshold;
[0031] In a case where the data heat type matches cold data, the wear value is higher than a second wear value threshold;
[0032] In a case where the data heat type matches unknown heat, the wear value matches an average wear value within the chip;
[0033] The first wear value threshold is smaller than the second wear value threshold.
[0034] In a second aspect, an embodiment of the present application discloses an operating device for a ZNS flash solid-state drive, comprising:
[0035] A storage pool building module is used to build a storage pool based on the flash memory blocks included in each flash memory chip inside the ZNS flash solid state drive, wherein each flash memory block in the storage pool is marked with a wear value;
[0036] a target flash block selection module, configured to select a target flash block in response to a storage partition reconstruction triggered by a write operation to a specified raw partition of the ZNS flash solid state drive, based on the operation parallelism of the flash blocks in the storage pool and the wear value, wherein the operation parallelism is determined according to the similarities and differences of the flash chips to which the flash blocks belong;
[0037] A partition reconstruction module, configured to construct a reconstructed partition corresponding to the specified original partition based on the target flash memory block;
[0038] The first flash solid state disk operation module is configured to perform the write operation based on the reconstructed partition.
[0039] Optionally, after forming the reconstructed partition corresponding to the designated original partition based on the target flash memory block, the apparatus further includes:
[0040] A partition mapping relationship establishing module, configured to establish a partition mapping relationship between the reconstructed partition and each of the flash memory blocks included in the reconstructed partition;
[0041] Optionally, after performing the write operation based on the reconstructed partition, the method further includes:
[0042] a candidate erased flash memory block acquisition module, configured to, in response to an erase operation on the designated original partition, acquire, according to the partition mapping relationship, a flash memory block included in the reconstructed partition corresponding to the designated original partition;
[0043] A second flash memory solid state disk operation module is configured to perform a flash memory block erase operation based on the acquired flash memory block;
[0044] The flash memory block information maintenance module is used to update the wear value of the flash memory block erased by the flash memory block erase operation, and delete the partition mapping relationship between the acquired flash memory block and the corresponding reconstructed partition.
[0045] Optionally, performing a flash memory block erase operation based on the acquired flash memory block includes:
[0046] A flash memory block erasing operation is performed on the flash memory block storing data among the acquired flash memory blocks.
[0047] Optionally, selecting a target flash memory block based on the operation parallelism of the flash memory blocks in the storage pool and the wear value includes:
[0048] Taking the operation parallelism of the selected flash memory block as a preferred condition, a flash memory block whose wear value meets a wear value leveling condition is selected from the storage pool as a target flash memory block.
[0049] Optionally, taking the operation parallelism of the selected flash memory blocks as a preferred condition, selecting a flash memory block whose wear value satisfies a wear value leveling condition from the storage pool as a target flash memory block includes:
[0050] Determining a data heat type matched by the write operation according to a data operation heat matched by the specified original partition targeted by the write operation;
[0051] Determining, based on the capacity of the designated original partition, the number of flash memory blocks included in the reconstructed partition corresponding to the designated original partition;
[0052] Taking the operation parallelism of the selected flash memory blocks as the preferred condition, select the number of empty flash memory blocks from the storage pool whose wear values match the data heat type and the difference between the wear values is less than the preset difference threshold as the target flash memory blocks.
[0053] Optionally, the operation parallelism conditions include, from high to low, parallel operation of all flash memory blocks, parallel operation of some flash memory blocks, and serial operation of flash memory blocks. Taking the operation parallelism of the selected flash memory blocks as the preferred condition, selecting, from the storage pool, a number of empty flash memory blocks whose wear values match the data heat type and whose differences between the wear values are less than a preset difference threshold as target flash memory blocks, includes:
[0054] Initialize the current operation parallelism condition as follows: all flash memory blocks operate in parallel;
[0055] Selecting, from the storage pool, the number of empty flash memory blocks that match the current operation parallelism condition, whose wear values match the data heat type, and whose wear value differences are less than a preset difference threshold;
[0056] In response to a successful selection, determining the selected empty flash memory block as a target flash memory block;
[0057] In response to a selection failure, the current operation parallelism condition is lowered, and the process jumps to executing the process of selecting the number of empty flash blocks from the storage pool that match the current operation parallelism condition, whose wear values match the data heat type, and whose difference between the wear values is less than a preset difference threshold, until the current operation parallelism condition is a non-flash block serial operation.
[0058] Optionally, the data heat type includes: cold data, hot data, and unknown heat, and the wear value matches the data heat type, including any of the following situations:
[0059] In a case where the data heat type matches hot data, the wear value is lower than a first wear value threshold;
[0060] In a case where the data heat type matches cold data, the wear value is higher than a second wear value threshold;
[0061] In a case where the data heat type matches unknown heat, the wear value matches an average wear value within the chip;
[0062] The first wear value threshold is smaller than the second wear value threshold.
[0063] In a third aspect, an embodiment of the present application further discloses an electronic device, comprising a memory, a processor, and a computer program stored on the memory and runnable on the processor. When the processor executes the computer program, the operating method of the ZNS flash solid-state disk described in the embodiment of the present application is implemented.
[0064] In a fourth aspect, an embodiment of the present application discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps of the operating method of the ZNS flash solid-state disk disclosed in the embodiment of the present application.
[0065] An operating method for a ZNS flash memory solid-state disk disclosed in an embodiment of the present application is configured to form a storage pool based on the flash memory blocks included in each flash memory chip inside the ZNS flash memory solid-state disk, wherein each flash memory block in the storage pool is marked with a wear value; in response to a storage partition reconstruction triggered by a write operation to a specified original partition of the ZNS flash memory solid-state disk, a target flash memory block is selected based on the operational parallelism of the flash memory blocks in the storage pool and the wear value, wherein the operational parallelism is determined based on the similarities and differences of the flash memory chips to which the flash memory blocks belong; based on the target flash memory block, a reconstruction partition corresponding to the specified original partition is formed; and performing the write operation based on the reconstruction partition can balance the wear inside the ZNS flash memory solid-state disk and help extend the service life of the ZNS flash memory solid-state disk.
[0066] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0068] Figure 1 This is one of the flow charts of the operating method of the ZNS flash solid state drive disclosed in the embodiment of the present application;
[0069] Figure 2 This is a schematic diagram of partition reconstruction in the operating method of the ZNS flash solid state drive disclosed in an embodiment of the present application;
[0070] Figure 3 This is another schematic diagram of partition reconstruction in the method for operating the ZNS flash solid state drive disclosed in an embodiment of the present application;
[0071] Figure 4 This is the second flowchart of the operating method of the ZNS flash solid state drive disclosed in the embodiment of the present application;
[0072] Figure 5 This is one of the schematic diagrams of the operating device structure of the ZNS flash solid state disk disclosed in the embodiment of the present application;
[0073] Figure 6 This is the second structural diagram of the operating device of the ZNS flash solid state disk disclosed in the embodiment of the present application;
[0074] Figure 7 A block diagram schematically shows an electronic device for executing the method according to the present application; and
[0075] Figure 8 The figure schematically shows a storage unit for storing or carrying a program code for implementing the method according to the present application. DETAILED DESCRIPTION
[0076] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0077] The ZNS interface divides the logical address space into fixed-size partitions (Zones). When all the data in a Zone becomes invalid, the ZNS flash SSD directly erases all the flash blocks contained in this Zone to reclaim space and ensure utilization. However, in actual use, not all flash blocks contain data when an erase operation is performed. In other words, due to the limitations of the ZNS interface, some flash blocks within the Zone do not store data, but additional erase operations are performed. Over time, these additional erase operations will worsen the wear of normal flash blocks, resulting in a reduction in the capacity of the ZNS flash SSD. Even if Libzbd provides upper-level applications with partial flash block erase commands, the fixed partition mapping method still leads to uneven wear within the Zone, seriously shortening the service life of the ZNS flash SSD.
[0078] Based on this, an operating method of a ZNS flash memory solid-state drive is disclosed in an embodiment of the present application. Partitions are reconstructed according to the degree of wear of the flash memory blocks, and partition erase and write operations triggered by ZNS interface calls are executed based on the reconstructed partitions to achieve balanced wear of the flash memory blocks inside the ZNS flash memory solid-state drive, thereby extending the service life of the ZNS flash memory solid-state drive.
[0079] like Figure 1 As shown, an operating method of a ZNS flash solid state drive disclosed in an embodiment of the present application includes: steps 110 to 140.
[0080] Step 110: Build a storage pool based on the flash memory blocks included in each flash memory chip inside the ZNS flash solid state drive, wherein each flash memory block in the storage pool is marked with a wear value.
[0081] In some embodiments of the present application, the flash memory blocks included in each flash memory chip inside the ZNS flash memory solid state disk can be marked by numbering each flash memory chip inside the ZNS flash memory solid state disk and numbering the flash memory blocks included in each flash memory chip, and a storage pool inside the ZNS flash memory solid state disk can be formed according to the numbered flash memory blocks. The number of each flash memory block can carry the numbering information of the flash memory chip to which the flash memory block belongs. For example, the number "Block 0_1" is used to indicate that the flash memory chip to which the flash memory block belongs is numbered 0 and is located at position 1 of the flash memory chip numbered 0. In this way, not only the flash memory blocks can be distinguished by the numbering of the flash memory blocks, but also the flash memory chips described in the flash memory blocks can be distinguished.
[0082] In some embodiments of the present application, the storage pool is organized in units of flash memory blocks.
[0083] In the process of building a storage pool, the storage pool can be built based on all the flash blocks included in each flash chip inside the ZNS flash solid state drive, or the damaged flash blocks can be discarded and the storage pool can be built only based on all the intact flash blocks included in each flash chip inside the ZNS flash solid state drive.
[0084] In embodiments of the present application, during the formation and maintenance of a storage pool, it is necessary to record the wear value of each flash memory block in the storage pool. The wear value is positively correlated with the degree of wear. For example, the greater the number of erasures, the greater the wear value. In some embodiments of the present application, the number of erasures of a flash memory block can be used as the wear value of the flash memory block. For example, a field recording the number of erasures can be added to each flash memory block in the storage pool to mark the wear value of each flash memory block.
[0085] Step 120 : In response to a storage partition reconstruction triggered by a write operation to a designated raw partition of the ZNS flash solid state disk, a target flash block is selected based on the operation parallelism of the flash blocks in the storage pool and the wear value.
[0086] The operation parallelism is determined according to the similarities and differences of the flash memory chips to which the flash memory blocks belong.
[0087] In an embodiment of the present application, partitions are dynamically reconstructed based on the write requirements for the ZNS flash memory solid state disk. For example, when the data write interface of the ZNS flash memory solid state disk is called, the interface will carry the written data file, as well as the specified original partition of the ZNS flash memory solid state disk, etc. If the write operation for the specified original partition is the first write operation, the operating method of the ZNS flash memory solid state disk described in the embodiment of the present application will reconstruct a reconstructed partition corresponding to the specified original partition based on the flash memory blocks in the storage pool. That is, the write operation for the specified original partition of the ZNS flash memory solid state disk can trigger the reconstruction of the storage partition, thereby reconstructing a reconstructed partition corresponding to the specified original partition.
[0088] In an embodiment of the present application, selecting a target flash memory block based on the operational parallelism and the wear value of the flash memory blocks in the storage pool includes: using the operational parallelism of the selected flash memory blocks as a preferred condition, selecting a flash memory block from the storage pool whose wear value satisfies a wear value leveling condition as the target flash memory block. That is, when partition reconstruction is required, a flash memory block in the storage pool is selected based on the operational parallelism and wear value of the flash memory blocks, and partition reconstruction is performed to obtain a reconstructed partition.
[0089] In the embodiment of the present application, when selecting the flash memory blocks for forming the reconstruction partition, the following two principles are mainly included: high parallelism principle and wear leveling principle.
[0090] Among them, the high parallelism principle is the operational parallelism condition for operating the flash memory block, that is, in order to give full play to the parallelism at the flash memory chip level, the blocks contained in the reconstruction partition should span multiple flash memory chips as much as possible.
[0091] In an embodiment of the present application, the operational parallelism of a flash memory block is determined based on the similarities and differences between the flash memory chips to which the flash memory block belongs. Flash memory blocks belonging to different flash memory chips can be operated in parallel, resulting in high operational parallelism; whereas flash memory blocks within the same flash memory chip can only be operated serially, resulting in low operational parallelism. Therefore, in an embodiment of the present application, when performing partition reconstruction, it is preferred to select flash memory blocks from different flash memory chips to form a reconstruction partition. For example, a flash memory block is preferentially selected from the flash memory blocks of each flash memory chip to obtain multiple flash memory blocks. Subsequently, a specified number of flash memory blocks are selected from these multiple flash memory blocks to form a reconstruction partition.
[0092] The wear leveling principle is a wear value condition for the flash memory blocks. For example, it may include: consistency of wear values between flash memory blocks in the reconstructed partition, and / or separate storage of hot and cold data (i.e., cold data is stored in flash memory blocks with larger wear values, and hot data is stored in flash memory blocks with smaller wear values), thereby achieving wear leveling across all flash memory blocks.
[0093] In embodiments of the present application, the wear value balancing condition is used to determine which flash memory block or blocks within a specified flash memory chip are selected for forming a reconstruction partition. In some embodiments of the present application, the wear value balancing condition is used to indicate that at least flash memory blocks with comparable wear values across different flash memory chips are selected for reconstruction to form a reconstructed partition. This allows for a higher degree of operational parallelism in the reconstructed partition and also balances the wear on the flash memory blocks caused by write and erase operations within the reconstructed partition.
[0094] In some embodiments of the present application, flash memory blocks can be selected based solely on operational parallelism and wear value consistency to form a reconstruction partition. For example, when a partition needs to be reconstructed, the flash memory blocks with the lowest wear values across different flash memory chips can be selected as candidate flash memory blocks. Subsequently, a specified number of flash memory blocks whose wear value differences are less than a preset difference threshold are selected from the candidate flash memory blocks for reconstruction to obtain a reconstructed partition.
[0095] In other embodiments of the present application, the wear value balancing condition is also used to indicate hot and cold data partition storage. For example, when selecting flash memory blocks in different flash memory chips, it is also possible to select flash memory blocks whose wear values match the data heat type of the partition to be reconstructed, and perform partition reconstruction, thereby further balancing the wear values of the flash memory blocks.
[0096] Correspondingly, taking the operation parallelism of the selected flash memory block as the preferred condition, a flash memory block whose wear value meets the wear value balancing condition is selected from the storage pool as the target flash memory block, including: determining the data heat type matched by the write operation according to the data operation heat matched by the specified original partition targeted by the write operation; determining the number of flash memory blocks contained in the reconstructed partition corresponding to the specified original partition according to the capacity of the specified original partition; taking the operation parallelism of the selected flash memory block as the preferred condition, selecting the number of empty flash memory blocks whose wear values match the data heat type and the difference between the wear values is less than the preset difference threshold from the storage pool as the target flash memory block.
[0097] In the embodiments of the present application, data with high data operation heat (such as being frequently read and written) is referred to as "hot data", and data with low data operation heat (such as being read and written less frequently) is referred to as "cold data". When a certain original partition is frequently operated, the data stored in the original partition can be considered as hot data, that is, the original partition matches hot data, and accordingly, the write operation to the original partition is considered to match hot data. Similarly, when the operation frequency of a certain original partition is very low, the data stored in the original partition can be considered as cold data, that is, the original partition matches cold data, and accordingly, the write operation to the original partition is considered to match cold data.
[0098] Then, when the upper-layer application calls the ZNS interface to perform a write operation on the original partition that matches the hot data, it can be considered that the write operation matches the hot data. Correspondingly, if the original partition is full and another original partition needs to be allocated, it can be considered that the newly allocated original partition also matches the hot data. In this way, when reconstructing the partition corresponding to the original partition that matches the hot data, it can be considered that the reconstructed partition also needs to match the hot data. Similarly, when reconstructing the partition corresponding to the original partition that matches the cold data, it can be considered that the reconstructed partition also needs to match the cold data.
[0099] However, when writing to a raw partition for the first time, it may be impossible to obtain the data operation heat that matches the raw partition. In this case, it is also impossible to determine whether the data matched by the write operation for the raw partition is cold data or hot data. In order to enable the reconstructed partition to match the corresponding data heat type, in an embodiment of the present application, the data heat types matched by the write operation are divided into three types, namely: cold data, hot data, and unknown heat. When it is impossible to determine whether the specified raw partition targeted by the write operation matches cold data or hot data, it can be considered that the data heat type matched by the specified raw partition is: unknown heat.
[0100] Before reconstructing the partition, the number of flash blocks required to construct the reconstructed partition corresponding to the specified original partition needs to be determined based on the capacity of the specified original partition. Typically, the original partition of the flash solid state drive can be configured to include one or more flash blocks.
[0101] Next, the aforementioned number of flash blocks are selected from the storage pool to form a reconstruction partition.
[0102] For example, in the case where the write operation matches hot data (that is, the data heat type is hot data), with the operation parallelism of the selected flash memory block as the preferred condition, the number of empty flash memory blocks whose wear values are lower than the first wear value threshold and the difference between the wear values is less than the preset difference threshold are selected from the storage pool as target flash memory blocks.
[0103] For another example, when the write operation matches cold data (i.e., the data heat type is cold data), with the operation parallelism of the selected flash memory blocks as the preferred condition, the number of empty flash memory blocks whose wear values are higher than the second wear value threshold and the difference between the wear values is less than the preset difference threshold are selected from the storage pool as target flash memory blocks.
[0104] For another example, in the case where the write operation matches unknown heat (that is, the data heat type is unknown heat), taking the operation parallelism of the selected flash memory block as the preferred condition, the number of empty flash memory blocks whose wear values in each flash memory chip match the average wear value in the chip and whose difference between the wear values is less than the preset difference threshold are selected from the storage pool as target flash memory blocks.
[0105] The first wear value threshold is smaller than the second wear value threshold.
[0106] The operation parallelism of the flash memory blocks is a preferred condition, that is, the wear leveling principle must be met and the operation parallelism condition must be met as much as possible. The following describes the application of the high parallelism principle and the wear leveling principle in selecting the flash memory blocks used to form the reconstruction partition with a specific embodiment.
[0107] In some embodiments of the present application, the operation parallelism conditions, from highest to lowest, include: all flash memory blocks in parallel, partial flash memory blocks in parallel, and flash memory blocks in series. The all flash memory blocks in parallel operation indicates that the selected flash memory blocks belong to different flash memory chips, the partial flash memory blocks in parallel operation indicates that the selected flash memory blocks belong to at least two flash memory chips, and the serial flash memory block operation indicates that the selected flash memory blocks belong to the same flash memory chip.
[0108] Correspondingly, the operation parallelism of the selected flash memory blocks is used as a preferred condition, and the number of empty flash memory blocks whose wear values match the data heat type and the difference between the wear values is less than the preset difference threshold are selected from the storage pool as target flash memory blocks, including: sub-steps S1 to S5.
[0109] Sub-step S1, initializing the current operation parallelism condition to: all flash memory blocks operate in parallel.
[0110] Sub-step S2: selecting from the storage pool the number of empty flash memory blocks that match the current operation parallelism condition, whose wear values match the data heat type, and whose wear value differences are less than a preset difference threshold.
[0111] Sub-step S3, determining whether the number of empty flash memory blocks are successfully selected, if so, executing sub-step S4, otherwise, executing sub-step S5.
[0112] Sub-step S4: in response to the selection being successful, determining the selected empty flash memory block as the target flash memory block.
[0113] Sub-step S5, in response to selection failure, reducing the current operation parallelism condition, and jumping to execute sub-step S2 until the current operation parallelism condition is flash memory block serial operation.
[0114] For example, first, according to the condition of maximum parallelism of flash memory block operations, at most one empty flash memory block whose wear value matches the data heat type can be selected from different flash memory chips to obtain more than or equal to the number of empty flash memory blocks. Afterwards, on the condition that the difference between the wear values of the flash memory blocks is less than a preset difference threshold, the number of empty flash memory blocks can be further selected from the selected empty flash memory blocks. If the number of empty flash memory blocks can be selected, it is confirmed that the selection is successful, and the number of empty flash memory blocks will be selected as the target flash memory blocks. In this case, the distribution of the target flash memory blocks in the flash memory chip is as follows: Figure 2 As shown, the target flash blocks include: the flash block labeled Block0_0 in flash chip 0, the flash block labeled Block1_1 in flash chip 1, the flash block labeled Block2_1 in flash chip 2, and the flash block labeled Block3_0 in flash chip 3. That is, the target flash blocks are distributed across different flash chips, and all of them can be operated on in parallel.
[0115] If the number of empty flash blocks cannot be selected, it is confirmed that the selection has failed. In this case, it is necessary to sacrifice parallelism and reselect. That is, the operation parallelism condition is reduced by one level. For example, the current operation parallelism condition is reinitialized to: partial parallel operation of flash blocks. After that, jump to sub-step S2 and reselect the number of empty flash blocks. If the target flash blocks can be successfully selected under the condition of partial parallel operation of flash blocks, in this case, the distribution of the selected target flash blocks in the flash memory chip is as follows: Figure 3 As shown, the target flash blocks include: the flash block numbered Block1_5 in flash chip 1, the flash block numbered Block2_5 in flash chip 2, and the flash blocks numbered Block3_4 and Block3_5 in flash chip 3. That is, at least some of the target flash blocks are distributed across different flash chips, and the target flash blocks can be partially operated in parallel.
[0116] If the operation parallelism condition is reduced to the lowest level, that is, when the flash memory blocks are operated serially, the target flash memory blocks can be successfully selected. In this case, the selected target flash memory blocks are all distributed in one flash memory chip and can only be operated serially.
[0117] In some embodiments of the present application, if after the operation parallelism condition is reduced to the lowest level (i.e., serial operation of the flash memory blocks), it is still not possible to successfully select the number of flash memory blocks whose difference between the wear values is less than the preset difference threshold, a failure message can be returned, or, without setting any conditions, the number of empty flash memory blocks can be directly selected as the target flash memory blocks.
[0118] In some embodiments of the present application, when selecting the number of empty flash memory blocks that match the current operation parallelism condition, whose wear values match the data heat type, and whose difference between the wear values is less than a preset difference threshold from the storage pool, the current operation parallelism condition is used to limit which flash memory chips the selected empty flash memory blocks come from, and which flash memory block or blocks in a certain flash memory chip are selected is determined by the data heat type that matches the write operation.
[0119] Taking the data heat type including cold data, hot data, and unknown heat as an example, the wear value matches the data heat type in any of the following cases: when the data heat type matches hot data, the wear value is lower than a first wear value threshold; when the data heat type matches cold data, the wear value is higher than a second wear value threshold; when the data heat type matches unknown heat, the wear value matches the average wear value within the chip. The first wear value threshold is lower than the second wear value threshold.
[0120] The first and second wear thresholds are determined empirically. For example, the first wear threshold can be set to the wear value corresponding to an erase count of less than 20% of the total erasable count, and the second wear threshold can be set to the wear value corresponding to an erase count of greater than 70% of the total erasable count. The average wear value within the chip is dynamically calculated based on the wear values marked on all flash memory blocks within the corresponding flash memory chip.
[0121] For example, when the write operation matches hot data, a flash memory block with a low wear value in a flash memory chip (for example, an empty flash memory block with the lowest wear value) is selected as the target flash memory block; when the write operation matches cold data, a flash memory block with a high wear value in a flash memory chip (for example, an empty flash memory block with the highest wear value) is selected as the target flash memory block; when the heat of the data matched by the write operation is unknown, a flash memory block with a wear value in a flash memory chip close to the average wear value of the flash memory blocks in the flash memory chip (referred to as the "average wear value in the chip" in this article) is selected as the target flash memory block.
[0122] At this point, the selection of a specified number of target flash memory blocks for forming a reconstruction partition based on the high parallelism principle and the wear leveling principle is completed.
[0123] Step 130: Building a reconstructed partition corresponding to the designated original partition based on the target flash memory block.
[0124] Next, based on the target flash memory blocks selected in the previous step, a reconstructed partition corresponding to the specified original partition is constructed. For example, based on the addresses of the selected target flash memory blocks, the addresses of the flash memory blocks included in the partition during the conventional partition write operation can be assigned, thereby achieving partition reconstruction. Specific implementations of constructing storage partitions based on discrete flash memory blocks can be found in the prior art and will not be further described here.
[0125] like Figure 4 As shown, after forming the reconstructed partition corresponding to the designated original partition based on the target flash memory block, the method further includes: step 135.
[0126] Step 135 : establishing a partition mapping relationship between the reconstructed partition and each of the flash memory blocks included in the reconstructed partition.
[0127] For example, a partition mapping relationship between a reconstructed partition and each of the flash memory blocks included in the reconstructed partition can be established by storing a corresponding relationship table between the number of the reconstructed partition and the identifier of the flash memory block that constitutes the reconstructed partition. Figure 2The reconstructed partition zone_1 shown in the dotted box, the partition mapping relationship between the reconstructed partition zone_1 and the flash memory block can be expressed as a corresponding relationship in the form of (zone_1,{Block0_0,Block1_1,Block2_1,Block3_0}), where zone_1 represents the identifier of the reconstructed partition, and {Block0_0,Block1_1,Block2_1,Block3_0} represents the set of flash memory block numbers that constitute the reconstructed partition zone_1.
[0128] Step 140: Execute the write operation based on the reconstructed partition.
[0129] After the reconstructed partition corresponding to the specified original partition is formed, the write operation is performed based on the formed reconstructed partition.
[0130] like Figure 4 As shown, after performing the write operation based on the reconstructed partition, the method further includes: steps 150 to 170.
[0131] Step 150 : In response to an erase operation on the designated original partition, obtain, according to the partition mapping relationship, a flash memory block included in the reconstructed partition corresponding to the designated original partition.
[0132] In the file system of a ZNS flash solid-state drive, the ZNS interface is called based on the original partition. In some embodiments of the present application, in order to accommodate the continuous writing or erasing of the original partition, it is necessary to establish a mapping relationship between the specified original partition and the reconstructed partition. This facilitates the determination of the reconstructed partition corresponding to the specified original partition when the ZNS operation interface of the ZNS flash solid-state drive is subsequently called. In this way, when an erase operation is received for the specified original partition, the reconstructed partition corresponding to the specified original partition targeted by the erase operation can be determined based on the mapping relationship between the original partition and the reconstructed partition, thereby implementing the erase operation on the reconstructed partition.
[0133] In the embodiment of the present application, the erasing operation on the reconstructed partition is implemented by performing an erasing operation on the flash memory blocks included in the reconstructed partition.
[0134] Furthermore, the flash memory blocks included in the reconstructed partition to be erased can be determined based on the partition mapping relationship between the reconstructed partition and the flash memory blocks constituting the reconstructed partition established when the reconstructed partition is formed.
[0135] Step 160: Perform a flash memory block erase operation based on the acquired flash memory block.
[0136] After obtaining the flash memory blocks included in the partition to be erased and reconstructed, the partition to be erased and reconstructed can be erased by performing an erase operation on the flash memory blocks included in the partition to be erased and reconstructed. For example, for the reconstructed partition identified as zone_1, the erase operation for the reconstructed partition is completed after the flash memory blocks numbered Block1_1, Block1_2, Block2_1, and Block3_0 are erased to empty flash memory blocks.
[0137] In some embodiments of the present application, performing a flash block erase operation based on the obtained flash memory blocks includes performing a flash block erase operation on the flash memory blocks storing data among the obtained flash memory blocks. In embodiments of the present application, when all data within a reconstructed partition is invalid, only the flash memory blocks storing data among the flash memory blocks constituting the reconstructed partition are erased, and the erase operation is not performed on the empty flash memory blocks, thereby reducing wear on the flash memory blocks.
[0138] Step 170: Update the wear value of the flash memory block erased by performing the flash memory block erase operation, and delete the partition mapping relationship between the obtained flash memory block and the corresponding reconstruction partition.
[0139] After the reconstructed partition is erased, all the flash memory blocks that make up the reconstructed partition are empty flash memory blocks. The partition mapping relationship between the reconstructed partition and all the flash memory blocks that make up the reconstructed partition can be deleted to release all the flash memory blocks that make up the reconstructed partition. In this way, when the partition is subsequently reconstructed, the released flash memory blocks can be used to form other reconstructed partitions.
[0140] For each flash memory block, after performing an erase operation, the erase count of the flash memory block needs to be increased by 1, that is, the wear value of the flash memory block needs to be updated to accurately record the wear of the flash memory block, so as to facilitate the accurate selection of the flash memory block with balanced wear in the reconstruction partition.
[0141] An operating method for a ZNS flash memory solid-state disk disclosed in an embodiment of the present application is configured to form a storage pool based on the flash memory blocks included in each flash memory chip inside the ZNS flash memory solid-state disk, wherein each flash memory block in the storage pool is marked with a wear value; in response to a storage partition reconstruction triggered by a write operation to a specified original partition of the ZNS flash memory solid-state disk, a target flash memory block is selected based on the operational parallelism of the flash memory blocks in the storage pool and the wear value, wherein the operational parallelism is determined based on the similarities and differences of the flash memory chips to which the flash memory blocks belong; based on the target flash memory block, a reconstruction partition corresponding to the specified original partition is formed; and performing the write operation based on the reconstruction partition can balance the wear inside the ZNS flash memory solid-state disk and help extend the service life of the ZNS flash memory solid-state disk.
[0142] The operating method of the ZNS flash memory solid-state drive disclosed in the embodiments of the present application is to reconstruct partitions by preferentially using flash memory blocks with a specific degree of wear according to the degree of wear of each flash memory block based on the hotness or coldness of the data at runtime, thereby balancing the wear of all flash memory blocks, thereby effectively balancing the wear of flash memory blocks within the ZNS flash memory solid-state drive and extending the service life of the ZNS flash memory solid-state drive. On the other hand, by selecting flash memory blocks for partition reconstruction based on the optimal conditions of operational parallelism, the operational parallelism of the partition reconstruction can be further improved, thereby increasing the operating speed of the ZNS flash memory solid-state drive.
[0143] Furthermore, when erasing a partition, by erasing only the flash memory blocks storing data in the corresponding reconstructed partition, the additional erasing operation of the empty flash memory blocks caused by erasing the entire physical partition in the prior art is effectively avoided, which can reduce the meaningless wear of the flash memory blocks and thus extend the service life of the ZNS flash solid state drive.
[0144] The operating device of the ZNS flash solid state disk disclosed in the embodiment of the present application is as follows: Figure 5 As shown, the device includes:
[0145] The storage pool forming module 510 is configured to form a storage pool based on the flash memory blocks included in each flash memory chip within the ZNS flash solid state drive, wherein each flash memory block in the storage pool is marked with a wear value;
[0146] a target flash block selection module 520 configured to select a target flash block in response to a storage partition reconstruction triggered by a write operation to a specified raw partition of the ZNS flash solid state drive, based on the operation parallelism of the flash blocks in the storage pool and the wear value, wherein the operation parallelism is determined according to the similarities and differences of the flash chips to which the flash blocks belong;
[0147] A partition reconstruction module 530 is configured to construct a reconstructed partition corresponding to the specified original partition based on the target flash memory block;
[0148] The first flash solid state disk operation module 540 is configured to perform the write operation based on the reconstructed partition.
[0149] In some embodiments of the present application, Figure 6 As shown, after forming the reconstructed partition corresponding to the specified original partition based on the target flash memory block, the device further includes:
[0150] A partition mapping relationship establishing module 535 is configured to establish a partition mapping relationship between the reconstructed partition and each of the flash memory blocks included in the reconstructed partition;
[0151] In some embodiments of the present application, after performing the write operation based on the reconstructed partition, the method further includes:
[0152] a candidate erased flash memory block acquisition module 550, configured to, in response to an erase operation on the designated original partition, acquire, according to the partition mapping relationship, a flash memory block included in the reconstructed partition corresponding to the designated original partition;
[0153] A second flash memory solid state disk operation module 560 is configured to perform a flash memory block erase operation based on the acquired flash memory block;
[0154] The flash memory block information maintenance module 570 is configured to update the wear value of the flash memory block erased by the flash memory block erase operation, and delete the partition mapping relationship between the acquired flash memory block and the corresponding reconstructed partition.
[0155] In some embodiments of the present application, performing a flash memory block erase operation based on the acquired flash memory block includes:
[0156] A flash memory block erasing operation is performed on the flash memory block storing data among the acquired flash memory blocks.
[0157] In some embodiments of the present application, selecting a target flash memory block based on the operation parallelism of the flash memory blocks in the storage pool and the wear value includes:
[0158] Taking the operation parallelism of the selected flash memory block as a preferred condition, a flash memory block whose wear value meets a wear value leveling condition is selected from the storage pool as a target flash memory block.
[0159] In some embodiments of the present application, based on the operation parallelism of the selected flash memory blocks as a preferred condition, selecting a flash memory block whose wear value satisfies a wear value leveling condition from the storage pool as a target flash memory block includes:
[0160] Determining a data heat type matched by the write operation according to a data operation heat matched by the specified original partition targeted by the write operation;
[0161] Determining, based on the capacity of the designated original partition, the number of flash memory blocks included in the reconstructed partition corresponding to the designated original partition;
[0162] Taking the operation parallelism of the selected flash memory blocks as the preferred condition, select the number of empty flash memory blocks from the storage pool whose wear values match the data heat type and the difference between the wear values is less than the preset difference threshold as the target flash memory blocks.
[0163] In some embodiments of the present application, the operation parallelism conditions include, from high to low, parallel operation of all flash memory blocks, parallel operation of some flash memory blocks, and serial operation of flash memory blocks. Taking the operation parallelism of the selected flash memory blocks as the preferred condition, selecting, from the storage pool, the number of empty flash memory blocks whose wear values match the data heat type and whose differences between the wear values are less than a preset difference threshold as target flash memory blocks includes:
[0164] Initialize the current operation parallelism condition as follows: all flash memory blocks operate in parallel;
[0165] Selecting, from the storage pool, the number of empty flash memory blocks that match the current operation parallelism condition, whose wear values match the data heat type, and whose wear value differences are less than a preset difference threshold;
[0166] In response to a successful selection, determining the selected empty flash memory block as a target flash memory block;
[0167] In response to a selection failure, the current operation parallelism condition is lowered, and the process jumps to executing the process of selecting the number of empty flash blocks from the storage pool that match the current operation parallelism condition, whose wear values match the data heat type, and whose difference between the wear values is less than a preset difference threshold, until the current operation parallelism condition is a non-flash block serial operation.
[0168] In some embodiments of the present application, the data heat type includes: cold data, hot data, and unknown heat, and the wear value matches the data heat type, including any of the following situations:
[0169] In a case where the data heat type matches hot data, the wear value is lower than a first wear value threshold;
[0170] In a case where the data heat type matches cold data, the wear value is higher than a second wear value threshold;
[0171] In a case where the data heat type matches unknown heat, the wear value matches an average wear value within the chip;
[0172] The first wear value threshold is smaller than the second wear value threshold.
[0173] The operating device of the ZNS flash solid-state disk disclosed in the embodiment of the present application is used to implement the operating method of the ZNS flash solid-state disk described in the embodiment of the present application. The specific implementation methods of each module of the device will not be repeated here. Please refer to the specific implementation methods of the corresponding steps in the method embodiment.
[0174] An embodiment of the present application discloses an operating device for a ZNS flash memory solid-state disk, which forms a storage pool based on the flash memory blocks included in each flash memory chip inside the ZNS flash memory solid-state disk, wherein each flash memory block in the storage pool is marked with a wear value; in response to a storage partition reconstruction triggered by a write operation to a specified original partition of the ZNS flash memory solid-state disk, a target flash memory block is selected based on the operational parallelism of the flash memory blocks in the storage pool and the wear value, wherein the operational parallelism is determined according to the similarities and differences of the flash memory chips to which the flash memory block belongs; based on the target flash memory block, a reconstruction partition corresponding to the specified original partition is formed; and the write operation is performed based on the reconstruction partition, which can balance the wear inside the ZNS flash memory solid-state disk and help extend the service life of the ZNS flash memory solid-state disk.
[0175] The operating device for a ZNS flash memory solid-state drive disclosed in an embodiment of the present application prioritizes using flash memory blocks with a specific degree of wear to reconstruct partitions based on the hotness or coldness of the data and the degree of wear of each flash memory block during operation, thereby balancing the wear of all flash memory blocks. This effectively balances the wear of flash memory blocks within the ZNS flash memory solid-state drive and extends the service life of the ZNS flash memory solid-state drive. Furthermore, by selecting flash memory blocks for partition reconstruction based on optimal operational parallelism, the operational parallelism of partition reconstruction can be further improved, thereby increasing the operating speed of the ZNS flash memory solid-state drive.
[0176] Furthermore, when erasing a partition, by erasing only the flash memory blocks storing data in the corresponding reconstructed partition, the additional erasing operation of the empty flash memory blocks caused by erasing the entire physical partition in the prior art is effectively avoided, which can reduce the meaningless wear of the flash memory blocks and thus extend the service life of the ZNS flash solid state drive.
[0177] Each embodiment in this specification is described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between the various embodiments can be referred to in conjunction with each other. For the device embodiments, since they are generally similar to the method embodiments, their description is relatively simple, and for relevant parts, reference can be made to the description of the method embodiments.
[0178] The above is a detailed introduction to the operating method and device of a ZNS flash solid-state drive provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
[0179] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0180] The various component embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It will be appreciated by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all of the functions of some or all of the components in the electronic device according to the embodiment of the present application. The application can also be implemented as a device or apparatus program (for example, a computer program and a computer program product) for performing a part or all of the methods described herein. Such a program implementing the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0181] For example, Figure 7 An electronic device that can implement the method according to the present application is shown. The electronic device can be a PC, a mobile terminal, a personal digital assistant, a tablet computer, etc. The electronic device conventionally includes a processor 710 and a memory 720, and program code 730 stored on the memory 720 and executable on the processor 710. When the processor 710 executes the program code 730, the method described in the above embodiments is implemented. The memory 720 can be a computer program product or a computer-readable medium. The memory 720 can be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk, or a ROM. The memory 720 has a storage space 7201 for program code 730 of a computer program for executing any of the method steps described above. For example, the storage space 7201 for program code 730 can include individual computer programs for implementing various steps in the above method. The program code 730 is computer-readable code. These computer programs can be read from or written to one or more computer program products. These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards, or floppy disks. The computer program includes a computer-readable code, and when the computer-readable code is run on an electronic device, the electronic device is caused to execute the method according to the above embodiment.
[0182] An embodiment of the present application further discloses a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the steps of the operating method of the ZNS flash solid-state disk as described in the first embodiment of the present application are implemented.
[0183] Such a computer program product may be a computer-readable storage medium having a computer program product. Figure 7 The memory 720 in the electronic device shown is similarly arranged as a storage segment, storage space, etc. The program code can be compressed and stored in the computer readable storage medium in an appropriate form. The computer readable storage medium is generally as shown in FIG. Figure 8 The portable or fixed storage unit generally includes computer-readable code 730', which is a code read by a processor and implements the steps of the above-described method when the code is executed by the processor.
[0184] References herein to "one embodiment," "an embodiment," or "one or more embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Furthermore, please note that instances of the phrase "in one embodiment" do not necessarily all refer to the same embodiment.
[0185] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of this description.
[0186] In the claims, any reference signs placed between brackets shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in the claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present application may be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names.
[0187] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for operating a ZNS flash solid state drive, characterized in that: include: A storage pool is formed based on the flash memory blocks included in each flash memory chip inside the ZNS flash solid state drive, wherein each flash memory block in the storage pool is marked with a wear value; In response to a storage partition reconstruction triggered by a write operation to a designated raw partition of the ZNS flash solid state drive, selecting a target flash block based on the operational parallelism of the flash blocks in the storage pool and the wear value, wherein the operational parallelism is determined according to the similarities and differences of the flash chips to which the flash blocks belong; Based on the target flash memory block, forming a reconstructed partition corresponding to the specified original partition; performing the write operation based on the reconstructed partition; The selecting a target flash memory block based on the operation parallelism of the flash memory blocks in the storage pool and the wear value includes: Taking the operation parallelism of the selected flash memory block as a preferred condition, a flash memory block whose wear value meets a wear value leveling condition is selected from the storage pool as a target flash memory block.
2. The method according to claim 1, characterized in that After forming a reconstructed partition corresponding to the specified original partition based on the target flash memory block, the method further includes: Establishing a partition mapping relationship between the reconstruction partition and each of the flash memory blocks included in the reconstruction partition; After performing the write operation based on the reconstructed partition, the method further includes: In response to an erase operation on the designated original partition, obtaining, according to the partition mapping relationship, a flash memory block included in the reconstructed partition corresponding to the designated original partition; Based on the acquired flash memory block, performing a flash memory block erase operation; The wear value of the flash memory block erased by performing the flash memory block erase operation is updated, and the partition mapping relationship between the obtained flash memory block and the corresponding reconstruction partition is deleted.
3. The method according to claim 2, characterized in that The step of performing a flash memory block erase operation based on the acquired flash memory block includes: A flash memory block erasing operation is performed on the flash memory block storing data among the acquired flash memory blocks.
4. The method according to claim 1, wherein Taking the operation parallelism of the selected flash memory block as a preferred condition, selecting a flash memory block whose wear value satisfies a wear value leveling condition from the storage pool as a target flash memory block, comprising: Determining a data heat type matched by the write operation according to a data operation heat matched by the specified original partition targeted by the write operation; Determining, based on the capacity of the designated original partition, the number of flash memory blocks included in the reconstructed partition corresponding to the designated original partition; Taking the operation parallelism of the selected flash memory blocks as the preferred condition, select the number of empty flash memory blocks from the storage pool whose wear values match the data heat type and the difference between the wear values is less than the preset difference threshold as the target flash memory blocks.
5. The method according to claim 4, characterized in that The operation parallelism conditions include, from high to low, parallel operation of all flash memory blocks, parallel operation of some flash memory blocks, and serial operation of flash memory blocks. Taking the operation parallelism of the selected flash memory blocks as the preferred condition, selecting, from the storage pool, the number of empty flash memory blocks whose wear values match the data heat type and whose differences between the wear values are less than a preset difference threshold as target flash memory blocks, includes: Initialize the current operation parallelism condition as follows: all flash memory blocks operate in parallel; Selecting, from the storage pool, the number of empty flash memory blocks that match the current operation parallelism condition, whose wear values match the data heat type, and whose wear value differences are less than a preset difference threshold; In response to a successful selection, determining the selected empty flash memory block as a target flash memory block; In response to a selection failure, the current operation parallelism condition is lowered, and the process jumps to executing the process of selecting the number of empty flash blocks from the storage pool that match the current operation parallelism condition, whose wear values match the data heat type, and whose difference between the wear values is less than a preset difference threshold, until the current operation parallelism condition is a non-flash block serial operation.
6. The method according to claim 4, characterized in that The data heat type includes: cold data, hot data, and unknown heat. The wear value matches the data heat type, including any of the following situations: In a case where the data heat type matches hot data, the wear value is lower than a first wear value threshold; In a case where the data heat type matches cold data, the wear value is higher than a second wear value threshold; In a case where the data heat type matches unknown heat, the wear value matches an average wear value within the chip; The first wear value threshold is smaller than the second wear value threshold.
7. An operating device for a ZNS flash solid state disk, characterized in that: include: A storage pool building module is used to build a storage pool based on the flash memory blocks included in each flash memory chip inside the ZNS flash solid state drive, wherein each flash memory block in the storage pool is marked with a wear value; a target flash block selection module, configured to select a target flash block in response to a storage partition reconstruction triggered by a write operation to a specified raw partition of the ZNS flash solid state drive, based on the operation parallelism of the flash blocks in the storage pool and the wear value, wherein the operation parallelism is determined according to the similarities and differences of the flash chips to which the flash blocks belong; A partition reconstruction module, configured to construct a reconstructed partition corresponding to the specified original partition based on the target flash memory block; a first flash solid state disk operation module, configured to perform the write operation based on the reconstructed partition; The selecting a target flash memory block based on the operation parallelism of the flash memory blocks in the storage pool and the wear value includes: Taking the operation parallelism of the selected flash memory block as a preferred condition, a flash memory block whose wear value meets a wear value leveling condition is selected from the storage pool as a target flash memory block.
8. An electronic device comprising a memory, a processor, and a program code stored in the memory and executable on the processor, wherein: When the processor executes the program code, the operating method of the ZNS flash solid state disk according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium having program code stored thereon, characterized in that: When the program code is executed by a processor, the steps of the operating method of the ZNS flash solid state disk according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Solid state disk wear balancing method and device and computer readable storage medium
CN111124305A
Method, device and equipment for determining super block of partition space, and storage medium
CN111240601A