CN115480698A - Operation method and device of ZNS flash memory solid-state disk and electronic equipment - Google Patents

Operation method and device of ZNS flash memory solid-state disk and electronic equipment Download PDF

Info

Publication number
CN115480698A
CN115480698A CN202211078101.1A CN202211078101A CN115480698A CN 115480698 A CN115480698 A CN 115480698A CN 202211078101 A CN202211078101 A CN 202211078101A CN 115480698 A CN115480698 A CN 115480698A
Authority
CN
China
Prior art keywords
flash memory
flash
partition
block
blocks
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211078101.1A
Other languages
Chinese (zh)
Inventor
肖凯西
张明
王悦
梁天健
何周阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Corp Ltd
Original Assignee
China Telecom Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Priority to CN202211078101.1A priority Critical patent/CN115480698A/en
Publication of CN115480698A publication Critical patent/CN115480698A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0616Improving the reliability of storage systems in relation to life time, e.g. increasing Mean Time Between Failures [MTBF]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The application discloses an operation method and device of a ZNS flash memory solid-state disk, and belongs to the technical field of storage. The method comprises the following steps: according to flash memory blocks included by each flash memory chip in the ZNS flash memory solid-state disk, a storage pool is established, wherein each flash memory block in the storage pool is correspondingly marked with a wear value; in response to the reconfiguration of a storage partition triggered by the write operation of the designated original partition for the ZNS flash solid state disk, selecting a target flash block based on the operation parallelism and the wear value of the flash block in the storage pool, wherein the operation parallelism is determined according to the similarity and difference of the flash chips to which the flash block belongs; building a reconstruction partition corresponding to the designated original partition based on the target flash memory blocks; performing the write operation based on the reconstructed partition. The method can balance the abrasion in the ZNS flash memory solid-state disk, and is beneficial to prolonging the service life of the ZNS flash memory solid-state disk.

Description

Operation method and device of ZNS flash memory solid-state disk and electronic equipment
Technical Field
The present application relates to the field of storage technologies, and in particular, to an operating method and apparatus for a ZNS flash solid-state disk, an electronic device, and a computer-readable storage medium.
Background
The ZNS (Zoned Namespace) protocol is derived from the NVMe standard, redefining the solid-state storage interface (ZNS interface). The ZNS interface simplifies the design mode of combining the traditional block device interface with a Flash Translation Layer (FTL), provides a more transparent access way for upper application, avoids garbage recovery in the device, reduces the cost of the storage device, and improves the performance of the storage device. Meanwhile, some hardware manufacturers synchronously develop a flash memory solid-state disk (ZNS-SSD) based on a ZNS interface, aiming at improving the performance and utilization rate of the storage system. However, due to the unique nature of the ZNS interface, new ZNS-SSD hardware still faces many challenges while exerting extreme performance in a power assisted data center. The service life of the ZNS-SSD is an important factor influencing the cost and the reliability of the data center. Specifically, the ZNS interface divides the logical address space into partitions (zones) with fixed sizes, and the ZNS-SSD erases data in a partition mapping mode to recover the space, so that the wear inside the partitions is unbalanced, and the service life of the ZNS-SSD is shortened seriously.
Therefore, the operation method of the ZNS flash memory solid-state disk in the prior art needs to be improved.
Disclosure of Invention
The embodiment of the application provides an operation method and device for a ZNS flash memory solid-state disk, and the problems that the inside of the ZNS flash memory solid-state disk is unevenly worn and the service life of the ZNS flash memory solid-state disk is seriously shortened can be solved.
In a first aspect, an embodiment of the present application discloses an operation method for a ZNS flash memory solid-state disk, including:
establishing a storage pool according to flash memory blocks included by each flash memory chip in a ZNS flash memory solid-state disk, wherein each flash memory block in the storage pool is correspondingly marked with a wear value;
in response to the reconfiguration of a storage partition triggered by the write operation of the designated original partition for the ZNS flash solid state disk, selecting a target flash block based on the operation parallelism and the wear value of the flash block in the storage pool, wherein the operation parallelism is determined according to the similarity and difference of the flash chips to which the flash block belongs;
building a reconstruction partition corresponding to the designated original partition based on the target flash memory blocks;
performing the write operation based on the reconstructed partition.
Optionally, after the building a reconstructed partition corresponding to the specified original partition based on the target flash memory block, the method further includes:
establishing a partition mapping relation between the reconstruction partition and each flash memory block included in the reconstruction partition;
after the performing the write operation based on the reconstructed partition, further comprising:
responding to the erasing operation aiming at the specified original partition, and acquiring a flash memory block included in the reconstruction partition corresponding to the specified original partition according to the partition mapping relation;
executing a flash block erasing operation based on the acquired flash block;
updating the wear value of the flash memory block erased by executing the flash memory block erasing operation, and deleting the partition mapping relation between the acquired flash memory block and the corresponding reconstruction partition.
Optionally, the executing a flash block erasing operation based on the acquired flash block includes:
and executing flash block erasing operation on the flash block which stores the data in the obtained flash block.
Optionally, said selecting a target flash memory block based on the operating parallelism of the flash memory blocks in the storage pool and the wear value comprises:
and selecting the flash memory blocks with the wear values meeting the wear value equalization condition from the storage pool as target flash memory blocks by taking the operation parallelism of the selected flash memory blocks as a preferred condition.
Optionally, with the operational parallelism of the selected flash memory block as a preferred condition, selecting a flash memory block from the storage pool, the wear value of which satisfies a wear value equalization condition, as a target flash memory block, includes:
determining a data hot degree type matched with the write operation according to the data operation hot degree matched with the specified original partition aimed at by the write operation;
determining the number of the flash memory blocks contained in a reconstruction partition corresponding to the designated original partition according to the capacity of the designated original partition;
and selecting the number of empty flash memory blocks with the wear values matched with the data heat types and the difference value between the wear values smaller than a preset difference threshold value from the storage pool as target flash memory blocks under the condition that the operation parallelism of the selected flash memory blocks is preferred.
Optionally, the operation parallelism condition includes, from high to low: selecting the number of empty flash blocks from the storage pool, the number of empty flash blocks being the target flash block, the number of empty flash blocks having the wear values matching the data heat type and the difference between the wear values being less than a preset difference threshold, with the operational parallelism of the selected flash blocks being a preferred condition, including:
the conditions for initializing the parallelism of the current operation are as follows: all the flash memory blocks are operated in parallel;
selecting the number of empty flash memory blocks from the storage pool which match the current operation parallelism condition, the wear values match the data heat types, and the difference between the wear values is smaller than a preset difference threshold;
in response to a successful selection, determining the selected empty flash block as a target flash block;
in response to a selection failure, decreasing the current operational parallelism condition, jumping to executing the selecting the number of empty flash blocks from the storage pool that match the current operational parallelism condition, and the wear values match the data heat type, and the difference between the wear values is less than a preset difference threshold until the current operational parallelism condition is not a serial operation of the flash blocks.
Optionally, the data heat type includes: cold data, hot data, and, an unknown heat, the wear value matching the data heat type, including any of:
where the data heat type matches thermal data, the wear value is below a first wear value threshold;
where the data heat type matches cold data, the wear value is above a second wear value threshold;
in the event that the data heat type matches an unknown heat, the wear value matches an on-chip average wear value;
wherein the first wear value threshold is less than the second wear value threshold.
In a second aspect, an embodiment of the present application discloses an operating device for a ZNS flash memory solid-state disk, including:
the storage pool building module is used for building a storage pool according to flash memory blocks included in each flash memory chip in the ZNS flash memory solid-state disk, wherein each flash memory block in the storage pool is correspondingly marked with a wear value;
the target flash memory block selection module is used for responding to the reconstruction of a storage partition triggered by the write operation of the designated original partition aiming at the ZNS flash memory solid-state disk, and selecting a target flash memory block based on the operation parallelism and the abrasion value of the flash memory block in the storage pool, wherein the operation parallelism is determined according to the difference and the sameness of the flash memory chip to which the flash memory block belongs;
the partition reconstruction module is used for constructing a reconstruction partition corresponding to the specified original partition based on the target flash memory block;
and the first flash memory solid-state disk operating module is used for executing the writing operation based on the reconstruction partition.
Optionally, after the reconstructing partition corresponding to the designated original partition is constructed based on the target flash memory block, the apparatus further includes:
a partition mapping relationship establishing module, configured to establish a partition mapping relationship between the reconstruction partition and each flash memory block included in the reconstruction partition;
optionally, after the performing the write operation based on the reconstructed partition, the method further includes:
a candidate erasure flash memory block obtaining module, configured to respond to an erasure operation for the specified original partition, and obtain, according to the partition mapping relationship, a flash memory block included in the reconstructed partition corresponding to the specified original partition;
the second flash memory solid-state disk operating module is used for executing flash memory block erasing operation based on the obtained flash memory block;
and the flash memory block information maintenance module is used for updating the wear value of the flash memory block erased by executing the flash memory block erasing operation and deleting the partition mapping relation between the acquired flash memory block and the corresponding reconstruction partition.
Optionally, the executing a flash block erasing operation based on the acquired flash block includes:
and executing flash memory block erasing operation on the flash memory blocks which store data in the obtained flash memory blocks.
Optionally, the selecting a target flash memory block based on the operation parallelism and the wear value of the flash memory blocks in the storage pool includes:
and selecting the flash memory blocks with the wear values meeting the wear value equalization condition from the storage pool as target flash memory blocks by taking the operation parallelism of the selected flash memory blocks as a preferred condition.
Optionally, with the operational parallelism of the selected flash memory block as a preferred condition, selecting a flash memory block from the storage pool, the wear value of which satisfies a wear value equalization condition, as a target flash memory block, includes:
determining a data hot degree type matched with the write operation according to the data operation hot degree matched with the specified original partition aimed at by the write operation;
determining the number of the flash memory blocks contained in a reconstruction partition corresponding to the designated original partition according to the capacity of the designated original partition;
and selecting the number of empty flash memory blocks with the wear values matched with the data heat types and the difference value between the wear values smaller than a preset difference threshold value from the storage pool as target flash memory blocks under the condition that the operation parallelism of the selected flash memory blocks is preferred.
Optionally, the operation parallelism condition includes, from high to low: selecting the number of empty flash blocks from the storage pool, the number of empty flash blocks being the target flash block, the number of empty flash blocks having the wear values matching the data heat type and the difference between the wear values being less than a preset difference threshold, with the operational parallelism of the selected flash blocks being a preferred condition, including:
the conditions for initializing the parallelism of the current operation are as follows: all the flash memory blocks are operated in parallel;
selecting the number of empty flash memory blocks which are matched with the current operation parallelism condition from the storage pool, the abrasion values of which are matched with the data heat types, and the difference value between the abrasion values of which is less than a preset difference threshold value;
in response to a successful selection, determining the selected empty flash block as a target flash block;
in response to a selection failure, decreasing the current operational parallelism condition, jumping to executing the selecting the number of empty flash blocks from the storage pool that match the current operational parallelism condition, and the wear values match the data heat type, and the difference between the wear values is less than a preset difference threshold until the current operational parallelism condition is not a serial operation of the flash blocks.
Optionally, the data heat type includes: cold data, hot data, and, an unknown heat, the wear value matching the data heat type, including any of:
where the data heat type matches thermal data, the wear value is below a first wear value threshold;
where the data heat type matches cold data, the wear value is above a second wear value threshold;
in the event that the data heat type matches an unknown heat, the wear value matches an on-chip average wear value;
wherein the first wear value threshold is less than the second wear value threshold.
In a third aspect, an embodiment of the present application further discloses an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor, when executing the computer program, implements the operation method of the ZNS flash solid-state disk according to the embodiment of the present application.
In a fourth aspect, the present application discloses a computer readable storage medium, on which a computer program is stored, which when executed by a processor, performs the steps of the operation method of the ZNS flash solid state disk disclosed in the present application.
According to the operation method of the ZNS flash memory solid-state disk, a storage pool is established according to flash memory blocks contained in each flash memory chip in the ZNS flash memory solid-state disk, wherein each flash memory block in the storage pool is correspondingly marked with a wear value; in response to the reconfiguration of a storage partition triggered by the write operation of the designated original partition for the ZNS flash solid state disk, selecting a target flash block based on the operation parallelism and the wear value of the flash block in the storage pool, wherein the operation parallelism is determined according to the similarity and difference of the flash chips to which the flash block belongs; building a reconstruction partition corresponding to the designated original partition based on the target flash memory blocks; and executing the writing operation based on the reconstructed partition, so that the abrasion inside the ZNS flash memory solid-state disk can be balanced, and the service life of the ZNS flash memory solid-state disk can be prolonged.
The foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.
Drawings
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
FIG. 1 is one of the flow charts of the operation method of a ZNS flash memory solid state disk disclosed in the embodiment of the application;
FIG. 2 is a schematic diagram of a reconstructed partition in a ZNS flash solid state disk operation method disclosed in an embodiment of the application;
FIG. 3 is another schematic diagram of a reconstructed partition in a ZNS flash solid state disk operating method disclosed by an embodiment of the application;
FIG. 4 is a second flowchart of an operation method of a ZNS flash memory solid-state disk disclosed in the embodiment of the application;
FIG. 5 is a schematic diagram of an operating device of a ZNS flash solid state disk disclosed in an embodiment of the application;
FIG. 6 is a second schematic diagram of an operating device of a ZNS flash solid state disk disclosed in the embodiments of the present application;
FIG. 7 schematically shows a block diagram of an electronic device for performing a method according to the present application; and
fig. 8 schematically shows a memory unit for holding or carrying program code implementing a method according to the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The ZNS interface divides the logical address space into fixed-size partitions (zones). When all data of one Zone fail, the ZNS flash memory solid-state disk directly erases all flash memory blocks contained in the Zone to recycle space and ensure utilization rate. However, in actual use, not all flash blocks contain data when an erase operation is performed. That is, due to the limitations of the ZNS interface, part of the flash blocks inside a Zone do not hold data, but perform an additional erase operation. In the long run, this extra erase operation worsens the wear of the normal flash blocks, resulting in a reduced capacity of the ZNS flash solid state disk. Even if the Libzbd provides a partial flash block erasing command for upper-layer application, the fixed partition mapping mode still causes unbalanced wear inside the Zone, and the service life of the ZNS flash solid-state disk is seriously shortened.
Based on the above, the embodiment of the application discloses an operation method of a ZNS flash memory solid-state disk, which performs partition reconstruction according to the wear degree of flash memory blocks, and executes partition erasing and writing operation triggered by ZNS interface calling based on reconstructed partitions so as to balance the wear of the flash memory blocks in the ZNS flash memory solid-state disk and prolong the service life of the ZNS flash memory solid-state disk.
As shown in fig. 1, an operation method of a ZNS flash solid-state disk disclosed in an embodiment of the present application includes: step 110 to step 140.
And 110, building a storage pool according to flash memory blocks included by each flash memory chip in the ZNS flash memory solid-state disk, wherein each flash memory block in the storage pool is correspondingly marked with a wear value.
In some embodiments of the application, the flash memory blocks included by each flash memory chip in the ZNS flash memory solid-state disk can be marked by respectively numbering each flash memory chip in the ZNS flash memory solid-state disk and respectively numbering the flash memory blocks included by each flash memory chip, and the storage pool in the ZNS flash memory solid-state disk is established according to the numbered flash memory blocks. The number of each flash memory block can carry the number information of the flash memory chip to which the flash memory block belongs. For example, the number "Block 0_1" indicates that the flash memory chip to which the flash Block belongs is 0, and is located at the position No. 1 of the flash memory chip with the number 0. Therefore, the flash memory chip can distinguish the flash memory blocks and the flash memory blocks by the numbers of the flash memory blocks.
In some embodiments of the present application, the built storage pool is in units of flash blocks.
In the process of building the storage pool, the storage pool can be built according to all flash memory blocks included in each flash memory chip in the ZNS flash memory solid-state disk, damaged flash memory blocks can be discarded, and the storage pool is built only according to all intact flash memory blocks included in each flash memory chip in the ZNS flash memory solid-state disk.
In the embodiment of the application, in the process of establishing the storage pool and storing the storage pool, the wear value of each flash memory block in the storage pool needs to be recorded. The wear value is positively correlated to the degree of wear. For example, the more the number of times of erasing, the larger the wear value. In some embodiments of the present application, the number of times a flash block is erased may be taken as the wear value for that flash block. For example, an erase count record field may be added for each of the flash blocks in the storage pool to mark the wear value of each of the flash blocks.
And 120, in response to the reconstruction of the storage partition triggered by the write operation of the designated original partition aiming at the ZNS flash solid state disk, selecting a target flash memory block based on the operation parallelism and the abrasion value of the flash memory block in the storage pool.
And determining the parallelism of the operations according to the similarities and differences of the flash memory chips to which the flash memory blocks belong.
In the embodiment of the application, the partitions are dynamically reconstructed according to the writing requirements of the ZNS flash memory solid-state disk. For example, when a data writing interface of the ZNS flash memory solid-state disk is called, the written data file is carried in the interface, and the designated original partition of the ZNS flash memory solid-state disk and the like are carried out. If the write operation for the specified original partition is the first write operation, the operating method of the ZNS flash solid-state disk in the embodiment of the present application reconstructs a reconstructed partition corresponding to the specified original partition based on the flash memory blocks in the storage pool. Namely, the writing operation of the designated original partition of the ZNS flash memory solid-state disk can trigger the reconstruction of the storage partition, so that a reconstructed partition corresponding to the designated original partition is reconstructed.
In an embodiment of the present application, said selecting a target flash block based on the operational parallelism and the wear value of the flash blocks in the storage pool comprises: and selecting the flash memory blocks with the wear values meeting the wear value equalization condition from the storage pool as target flash memory blocks by taking the operation parallelism of the selected flash memory blocks as a preferred condition. Namely, when the partition needs to be reconstructed, the flash memory blocks in the storage pool are selected according to the operation parallelism and the abrasion value of the flash memory blocks, and the partition is reconstructed to obtain the reconstructed partition.
In the embodiment of the present application, when selecting flash memory blocks for building a reconstruction partition, the following two principles are mainly included: a high parallelism principle and a wear leveling principle.
The high parallelism principle is an operation parallelism condition for operating the flash memory blocks, namely, blocks contained in the reconstruction partition should span a plurality of flash memory chips as much as possible in order to fully exert the parallelism of flash memory chip levels.
In the embodiment of the application, the operation parallelism of the flash memory blocks is determined according to the similarities and differences of the flash memory chips to which the flash memory blocks belong, the flash memory blocks belonging to different flash memory chips can be operated in parallel, and the operation parallelism is high; and the flash memory blocks in the same flash memory chip can only be operated in series, and the operation parallelism is low. Therefore, in the embodiment of the present application, when performing partition reconstruction, it is preferable to select flash memory blocks of different flash memory chips to construct a reconstructed partition. For example, a flash block is preferably selected from the flash blocks of each flash chip to obtain a plurality of flash blocks, and then a predetermined number of flash blocks are selected from the plurality of flash blocks to construct a reconstruction partition.
Wherein, the wear leveling principle is the wear value condition of the flash memory block. Examples may include: the method can comprise the following steps: the building is to reconstruct the wear value consistency between the flash memory blocks of the subareas, and/or separately store cold data and hot data (namely, the cold data is stored in the flash memory blocks with larger wear values, and the hot data is stored in the flash memory blocks with smaller wear values), so as to achieve the wear balance of all the flash memory blocks.
In an embodiment of the present application, the wear value leveling condition is used to define which flash block or blocks it includes for a given flash memory chip to be selected for building a reconstructed partition. In some embodiments of the present application, the wear value equalization condition is used to instruct at least selecting flash memory blocks with equivalent wear values in different flash memory chips for reconstruction, so as to obtain a reconstructed partition. In this way, the reconstructed partition has high operational parallelism, and the wear of the flash memory blocks caused by the writing and erasing operations of the reconstructed partition can be balanced.
In some embodiments of the present application, the reconstructed partition may be constructed by selecting flash blocks based only on the consistency of the operational parallelism and the wear value. For example, when the partition needs to be reconstructed, the flash memory block with the lowest wear value in different flash memory chips may be selected as the candidate flash memory block, and then, the specified number of flash memory blocks with the wear values smaller than the preset difference threshold value are selected from the candidate flash memory blocks to be reconstructed, so as to obtain the reconstructed partition.
In other embodiments of the present application. The wear value leveling condition is also used to indicate a hot and cold data partition storage. For example, when selecting flash memory blocks in different flash memory chips, the flash memory blocks with wear values matched with the data heat types can be selected according to the data heat types matched with the partitions to be reconstructed, and partition reconstruction is performed, so that the wear values of the flash memory blocks are further balanced.
Correspondingly, with the operational parallelism of the selected flash memory block as a preferred condition, selecting the flash memory block with the wear value meeting the wear value equalization condition from the storage pool as a target flash memory block, and including: determining a data hot degree type matched with the write operation according to the data operation hot degree matched with the specified original partition aimed at by the write operation; determining the number of the flash memory blocks contained in a reconstruction partition corresponding to the designated original partition according to the capacity of the designated original partition; and selecting the number of empty flash memory blocks with the wear values matched with the data heat types and the difference value between the wear values smaller than a preset difference threshold value from the storage pool as target flash memory blocks under the condition that the operation parallelism of the selected flash memory blocks is preferred.
In the embodiments of the present application, data with high data operation heat (e.g., frequently read and written) is referred to as "hot data", and data with low data operation heat (e.g., less frequently read and written) is referred to as "cold data". When an original partition is frequently operated, the data stored in the original partition may be considered as hot data, that is, the original partition matches the hot data, and accordingly, the write operation for the original partition is considered to match the hot data. Similarly, when the operation frequency of a certain original partition is low, the data stored in the original partition may be considered as cold data, that is, the original partition matches the cold data, and correspondingly, the write operation for the original partition is considered as matching the cold data.
Then, when the upper layer application calls the ZNS interface to perform a write operation on the original partition that matches the hot data, the write operation may be considered to match the hot data. Accordingly, if the original partition is full and other original partitions need to be allocated, it can be assumed that the newly allocated original partition also matches hot data. Thus, when reconstructing a reconstructed partition corresponding to an original partition that matches hot data, it may be considered that the reconstructed partition also needs to match hot data. Similarly, when a reconstruction partition corresponding to the original partition matching the cold data needs to be reconstructed, it can be considered that the reconstruction partition also needs to match the cold data.
However, when writing to a certain original partition for the first time, it may not be possible to obtain the data operation heat matching the original partition, and in this case, it may not be possible to determine whether the data matching the write operation for the original partition is cold data or hot data. In order to enable the reconstruction partition to match the corresponding data hot type, in the embodiment of the present application, the data hot types matched by the write operation are divided into three types, which are respectively denoted as: cold data, hot data, and, unknown heat. When it cannot be determined that the specified original partition targeted by the write operation matches cold data or hot data, the data hot type that the specified original partition matches may be considered as: the heat is unknown.
Before reconstructing the partition, the number of flash memory blocks needed when the reconstruction partition corresponding to the specified original partition is constructed needs to be determined according to the capacity of the specified original partition. In general, an original partition of a flash solid state disk may be configured to include one or more flash blocks.
Next, the number of flash blocks from the storage pool is selected to build a reconstructed partition.
For example, in the case that the write operation matches hot data (i.e. the data hot type is hot data), the number of empty flash memory blocks with the wear values lower than a first wear value threshold and the difference between the wear values smaller than a preset difference threshold are selected from the storage pool as target flash memory blocks, with the operational parallelism of the selected flash memory blocks as a preferred condition.
For another example, in the case that the write operation matches cold data (i.e. the data heat type is cold data), the number of empty flash memory blocks with the wear values higher than the second wear value threshold and the difference between the wear values smaller than the preset difference threshold are selected from the storage pool as target flash memory blocks, with the operational parallelism of the selected flash memory blocks as a preferred condition.
For another example, in a case where the write operation matches an unknown heat (i.e., the data heat type is an unknown heat), the number of empty flash memory blocks, in which the wear value within each flash memory chip matches an in-chip average wear value and a difference between the wear values is smaller than a preset difference threshold, is selected from the storage pool as a target flash memory block, with the operational parallelism of the selected flash memory blocks as a preferred condition.
Wherein the first wear value threshold is less than the second wear value threshold.
The operation parallelism of the flash memory blocks is an optimal condition, namely, the wear leveling principle must be satisfied, and the operation parallelism condition is satisfied as much as possible. The following description, in conjunction with a specific embodiment, illustrates the applicability of the high parallelism and wear leveling principles in selecting flash blocks for building reconstructed partitions.
In some embodiments of the present application, the parallelism-of-operation condition comprises, in order from high to low: the flash blocks operate all in parallel, the flash blocks operate partially in parallel, and the flash blocks operate in series. The flash memory blocks are all operated in parallel to indicate that the selected flash memory blocks belong to different flash memory chips respectively, the flash memory blocks are partially operated in parallel to indicate that the selected flash memory blocks belong to at least two flash memory chips, and the flash memory blocks are operated in series to indicate that the selected flash memory blocks belong to the same flash memory chip.
Correspondingly, said selecting, with said operational parallelism of the selected flash memory blocks as a preferred condition, said number of empty flash memory blocks from said storage pool for which said wear values match said data heat type and for which the difference between said wear values is smaller than a preset difference threshold, as target flash memory blocks, comprises: substeps S1 to substep S5.
In the substep S1, initializing the parallelism condition of the current operation is: the flash blocks all operate in parallel.
And a substep S2, selecting the number of empty flash memory blocks which are matched with the current operation parallelism condition from the storage pool, wherein the wear values are matched with the data heat types, and the difference value between the wear values is smaller than a preset difference threshold value.
And S3, determining whether the number of empty flash memory blocks is successfully selected, if so, executing S4, otherwise, executing S5.
And a substep S4, responding to successful selection, determining the selected empty flash memory block as a target flash memory block.
And a substep S5, responding to the selection failure, reducing the parallelism condition of the current operation, and skipping to execute the substep S2 until the parallelism condition of the current operation is the serial operation of the flash memory blocks.
For example, according to the condition that the parallelism of the flash memory block operation is the highest, at most one empty flash memory block with the wear value matching with the data heat type in different flash memory chips can be selected to obtain the number of empty flash memory blocks which is larger than or equal to the number. Then, on condition that the difference between said wear values of the flash memory blocks is smaller than a preset difference threshold, further selecting said number of empty flash memory blocks from the selected empty flash memory blocks. And if the number of the empty flash memory blocks can be selected, confirming that the selection is successful, and selecting the number of the empty flash memory blocks as target flash memory blocks. In this case, the distribution of the target flash block in the flash memory chip is shown in fig. 2, and the target flash block includes: the flash memory Block numbered Block0_0 in flash chip 0, the flash memory Block numbered Block1_1 in flash chip 1, the flash memory Block numbered Block2_1 in flash chip 2, and the flash memory Block numbered Block3_0 in flash chip 3. That is, the target flash memory blocks are distributed in different flash memory chips, and the target flash memory blocks can be all operated in parallel.
If the number of empty flash memory blocks cannot be selected, the selection is confirmed to fail, and at the moment, parallelism needs to be sacrificed and the selection needs to be carried out again. That is, the operational parallelism condition is reduced by one level, e.g., the current operational parallelism condition is reinitialized to: the flash blocks are partially operated in parallel, and then a jump is made to substep S2 to reselect said number of empty flash blocks. If the target flash block can be successfully selected under the condition that the flash blocks are partially operated in parallel, in this case, the distribution of the selected target flash block in the flash memory chip is as shown in fig. 3, and the target flash block includes: the flash memory Block numbered Block1_5 in the flash memory chip 1, the flash memory Block numbered Block2_5 in the flash memory chip 2, and the flash memory blocks numbered Block3_4 and Block3_5 in the flash memory chip 3. I.e. at least part of the targeted flash blocks are distributed in different flash chips, the targeted flash blocks may be operated partially in parallel.
If the operating parallelism condition is reduced to the lowest level, i.e. the flash memory blocks operate in series, the target flash memory blocks can be successfully selected, in which case the selected target flash memory blocks are all distributed in one flash memory chip and can only operate in series.
In some embodiments of the present application, if the number of flash blocks for which the difference between the wear values is smaller than a preset difference threshold cannot be successfully selected after the operational parallelism condition is reduced to the lowest level (i.e. flash block serial operation), a failure message may be returned, or, without setting any condition, the number of empty flash blocks is directly selected as the target flash block.
In some embodiments of the present application, when selecting the number of empty flash blocks from the storage pool that match the current operational parallelism condition, and the wear values match the data heat types, and the difference between the wear values is less than a preset difference threshold, the current operational parallelism condition is used to define which flash chips the selected empty flash blocks come from, and which flash block or blocks in a certain flash chip are selected as determined by the data heat types matched by the write operation.
The data heat type comprises: cold data, hot data, and, for example, unknown heat, the wear value matches the data heat type, including any of: where the data heat type matches thermal data, the wear value is below a first wear value threshold; in the event that the data heat type matches cold data, the wear value is above a second wear value threshold; in the event that the data heat type matches an unknown heat, the wear value matches an average wear value within a chip. Wherein the first wear value threshold is less than the second wear value threshold.
Wherein the first wear value threshold and the second wear value threshold are empirically determined, and for example, the first wear value threshold may be set as: the erasing times are less than the abrasion value corresponding to 20% of the total erasing times; and setting the second abrasion value threshold value as an abrasion value corresponding to the erasing times larger than 70% of the total erasing times. And dynamically calculating the average abrasion value in the chip according to the abrasion values of all flash block marks in the corresponding flash memory chip.
Specifically, for example, when the write operation matches the hot data, a flash block with a low wear value in a certain flash chip is selected (for example, an empty flash block with a lowest wear value is selected) as a target flash block; when the write operation matches the cold data, selecting a flash block with a high wear value in a certain flash chip (for example, selecting an empty flash block with a highest wear value) as a target flash block; when the data heat matching the write operation is unknown, a flash memory block with an inner wear value of a certain flash memory chip close to the average wear value of the flash memory block in the flash memory chip (referred to as an "inner wear value of the chip") is selected as a target flash memory block.
By this, selecting a specified number of target flash blocks for building a reconstructed partition based on a highly parallel principle and a wear-leveling principle is accomplished.
And step 130, building a reconstruction partition corresponding to the specified original partition based on the target flash memory block.
And then, based on the target flash memory blocks selected in the previous step, building a reconstructed partition corresponding to the specified original partition. For example, based on the selected addresses of the target flash memory blocks, the addresses of the flash memory blocks included in the partition writing operation in the prior art can be assigned, so as to implement partition reconstruction. For a specific embodiment of building a storage partition based on discrete flash blocks, reference may be made to the prior art, and details thereof are not described here.
As shown in fig. 4, after the building a reconstructed partition corresponding to the specified original partition based on the target flash memory blocks, the method further comprises: and step 135.
Step 135, establishing a partition mapping relationship between the reconstructed partition and each flash block included in the reconstructed partition.
For example, a partition mapping relationship between a reconstructed partition and each of the flash memory blocks included in the reconstructed partition may be established by storing a correspondence table between the number of the reconstructed partition and the identification of the flash memory block constituting the reconstructed partition. By way of specific example, for a reconstructed partition zone _1 shown by a dashed box in fig. 2, the partition mapping relationship between the reconstructed partition zone _1 and the flash Block may be represented as a corresponding relationship in the shape of (zone _1, { Block0_0, block1 \, 1, block2 \, 1, block3 \, 0 }), wherein zone _1 represents the identification of the reconstructed partition zone, and { Block0_0, block1 \, 1, block2 \, 1, block3 \, 0} represents the set of numbers of the flash Block forming the reconstructed partition zone _ 1.
Step 140, performing the write operation based on the reconstructed partition.
After the reconstruction partition corresponding to the designated original partition is constructed, the write operation is performed based on the constructed reconstruction partition.
As shown in fig. 4, after the performing the write operation based on the reconstructed partition, the method further includes: step 150 to step 170.
Step 150, in response to the erasing operation for the designated original partition, acquiring the flash memory blocks included in the reconstructed partition corresponding to the designated original partition according to the partition mapping relationship.
In the file system of the ZNS flash memory solid-state disk, when the ZNS interface is called, the ZNS interface is based on the original subarea, in some embodiments of the application, in order to adapt to continuous writing or erasing of the original subarea, a mapping relation between the designated original subarea and the reconstructed subarea needs to be established, so that the reconstructed subarea corresponding to the designated original subarea can be conveniently determined when the ZNS operation interface of the subsequent ZNS flash memory solid-state disk is called. In this way, when the erasing operation for the specified original partition is received, the reconstructed partition corresponding to the specified original partition for which the erasing operation is directed can be determined according to the mapping relationship between the original partition and the reconstructed partition, so that the erasing operation for the reconstructed partition is realized.
In the embodiment of the application, the erasing operation on the reconstruction partition is realized by executing the erasing operation on the flash memory block included in the reconstruction partition.
Further, according to the partition mapping relationship between the reconstruction partition established when the reconstruction partition is established and the flash memory block for establishing the reconstruction partition, the flash memory block included in the reconstruction partition to be erased can be determined.
And step 160, executing a flash memory block erasing operation based on the acquired flash memory block.
After the flash memory blocks in the reconstruction partition to be erased are obtained, the flash memory blocks in the reconstruction partition to be erased are erased, and then the reconstruction partition to be erased can be erased. For example, for the reconstructed partition identified as zone _1, the erase operation for the reconstructed partition is completed after the flash blocks numbered Block1_1, block1 \ 2, block2 \, 1, and Block3 \, 0 are erased to be empty flash blocks.
In some embodiments of the present application, the performing a flash block erase operation based on the obtained flash block includes: and executing flash block erasing operation on the flash block which stores the data in the obtained flash block. In the embodiment of the application, when all the data in the reconstruction partition are invalid, only the flash memory blocks storing the data in the flash memory blocks forming the reconstruction partition are erased, and the erasing operation is not performed on the empty flash memory blocks, so that the abrasion to the flash memory blocks can be reduced.
Step 170, updating the wear value of the flash memory block erased by the flash memory block erasing operation, and deleting the partition mapping relationship between the acquired flash memory block and the corresponding reconstructed partition.
When the reconstruction partition is erased, all the flash memory blocks for constructing the reconstruction partition are empty flash memory blocks, and all the flash memory blocks for constructing the reconstruction partition can be released by deleting the partition mapping relation between the reconstruction partition and all the flash memory blocks for constructing the reconstruction partition, so that the released flash memory blocks can be used for constructing other reconstruction partitions when partition reconstruction is carried out subsequently.
After each flash memory block is erased once, the number of erasing times of the flash memory block needs to be added with 1, namely, the wear value of the flash memory block is updated, so as to accurately record the wear condition of the flash memory block, and the flash memory block with even wear can be accurately selected in the reconstruction partition.
According to the operation method of the ZNS flash memory solid-state disk, a storage pool is established according to flash memory blocks contained in each flash memory chip in the ZNS flash memory solid-state disk, wherein each flash memory block in the storage pool is correspondingly marked with a wear value; in response to the reconfiguration of a storage partition triggered by the write operation of the designated original partition for the ZNS flash solid state disk, selecting a target flash block based on the operating parallelism and the wear value of the flash blocks in the storage pool, wherein the operating parallelism is determined according to the similarity and difference of the flash chips to which the flash blocks belong; building a reconstruction partition corresponding to the designated original partition based on the target flash memory blocks; and executing the writing operation based on the reconstructed partition, so that the abrasion inside the ZNS flash memory solid-state disk can be balanced, and the service life of the ZNS flash memory solid-state disk can be prolonged.
According to the operation method of the ZNS flash memory solid-state disk, the flash memory blocks with specific abrasion degrees are preferentially used to reconstruct the subareas according to the abrasion degrees of each flash memory block according to the cold and hot degrees of data during operation, so that the abrasion degrees of all the flash memory blocks are balanced, the abrasion degrees of the flash memory blocks in the ZNS flash memory solid-state disk are effectively balanced, and the service life of the ZNS flash memory solid-state disk is prolonged. On the other hand, the operation parallelism of the reconstructed partition can be further improved by selecting the flash memory block to carry out partition reconstruction under the condition that the operation parallelism is preferable, and the operation speed of the ZNS flash memory solid-state disk is improved.
Furthermore, when the partition is erased, only the flash memory block with the data stored in the corresponding reconstruction partition is erased, so that the additional erasing operation of the empty flash memory block caused by the complete erasing of the whole physical partition in the prior art is effectively avoided, the meaningless abrasion to the flash memory block can be reduced, and the service life of the ZNS flash memory solid-state disk is prolonged.
As shown in fig. 5, an operating device of a ZNS flash memory solid-state disk disclosed in an embodiment of the present application includes:
the storage pool building module 510 is configured to build a storage pool according to flash memory blocks included in each flash memory chip inside a ZNS flash memory solid-state disk, where each flash memory block in the storage pool is correspondingly marked with a wear value;
a target flash block selection module 520, configured to select a target flash block based on the operation parallelism and the wear value of a flash block in the storage pool, in response to a storage partition reconfiguration triggered by a write operation for specifying an original partition for the ZNS flash solid-state disk, where the operation parallelism is determined according to the identity of a flash chip to which the flash block belongs;
a partition reconstruction module 530, 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 operating module 540, configured to perform the write operation based on the reconstructed partition.
In some embodiments of the present application, as shown in fig. 6, after the building a reconstructed partition corresponding to the specified original partition based on the target flash memory block, the apparatus further includes:
a partition mapping relationship establishing module 535, configured to establish a partition mapping relationship between the reconstructed partition and each flash memory block included in the reconstructed partition;
in some embodiments of the present application, after the performing the write operation based on the reconstructed partition, the method further includes:
a candidate erasure flash block acquiring module 550, configured to respond to an erasure operation for the specified original partition, and acquire, according to the partition mapping relationship, a flash block included in the reconstructed partition corresponding to the specified original partition;
the second flash memory solid-state disk operating module 560 is configured to execute a flash memory block erasing operation based on the acquired flash memory block;
the flash block information maintenance module 570 is configured to update the wear value of the flash block erased by performing the flash block erasing operation, and delete the obtained partition mapping relationship between the flash block and the corresponding reconstructed partition.
In some embodiments of the present application, the performing a flash block erase operation based on the acquired flash block includes:
and executing flash block erasing operation on the flash block which stores the data in the obtained flash block.
In some embodiments of the present application, said selecting a target flash block based on said wear value and operational parallelism of flash blocks in said storage pool comprises:
and selecting the flash memory blocks with the wear values meeting the wear value equalization condition from the storage pool as target flash memory blocks by taking the operation parallelism of the selected flash memory blocks as a preferred condition.
In some embodiments of the present application, selecting, as a target flash block, a flash block from the storage pool whose wear value satisfies a wear value equalization condition, with the operational parallelism of the selected flash block as a preferred condition, includes:
determining a data hot degree type matched with the write operation according to the data operation hot degree matched with the specified original partition aimed at by the write operation;
determining the number of the flash memory blocks contained in the reconstruction partition corresponding to the designated original partition according to the capacity of the designated original partition;
and selecting the number of empty flash memory blocks with the wear values matched with the data heat types and the difference value between the wear values smaller than a preset difference threshold value from the storage pool as target flash memory blocks under the condition that the operation parallelism of the selected flash memory blocks is preferred.
In some embodiments of the present application, the parallelism-of-operation condition comprises, in order from high to low: selecting the number of empty flash blocks from the storage pool, the number of empty flash blocks being the target flash block, the number of empty flash blocks having the wear values matching the data heat type and the difference between the wear values being less than a preset difference threshold, with the operational parallelism of the selected flash blocks being a preferred condition, including:
the conditions for initializing the parallelism of the current operation are as follows: all the flash memory blocks are operated in parallel;
selecting the number of empty flash memory blocks which are matched with the current operation parallelism condition from the storage pool, the abrasion values of which are matched with the data heat types, and the difference value between the abrasion values of which is less than a preset difference threshold value;
in response to a successful selection, determining the selected empty flash block as a target flash block;
in response to a selection failure, decreasing the current operational parallelism condition, jumping to executing the selecting the number of empty flash blocks from the storage pool that match the current operational parallelism condition, and the wear values match the data heat type, and the difference between the wear values is less than a preset difference threshold until the current operational parallelism condition is not a serial operation of the flash blocks.
In some embodiments of the present application, the data heat type includes: cold data, hot data, and, an unknown heat, the wear value matching the data heat type, including any of:
where the data heat type matches thermal data, the wear value is below a first wear value threshold;
where the data heat type matches cold data, the wear value is above a second wear value threshold;
in the event that the data heat type matches an unknown heat, the wear value matches an on-chip average wear value;
wherein the first wear value threshold is less than the second wear value threshold.
The operation device of the ZNS flash solid-state disk disclosed in the embodiment of the present application is used to implement the operation method of the ZNS flash solid-state disk described in the embodiment of the present application, and specific implementations of each module of the device are not described again, and reference may be made to the specific implementations of corresponding steps in the method embodiment.
The operating device of the ZNS flash memory solid-state disk disclosed by the embodiment of the application builds a storage pool according to flash memory blocks included by each flash memory chip in the ZNS flash memory solid-state disk, wherein each flash memory block in the storage pool is correspondingly marked with a wear value; in response to the reconfiguration of a storage partition triggered by the write operation of the designated original partition for the ZNS flash solid state disk, selecting a target flash block based on the operation parallelism and the wear value of the flash block in the storage pool, wherein the operation parallelism is determined according to the similarity and difference of the flash chips to which the flash block belongs; building a reconstruction partition corresponding to the designated original partition based on the target flash memory blocks; and executing the writing operation based on the reconstructed partition, so that the abrasion inside the ZNS flash memory solid-state disk can be balanced, and the service life of the ZNS flash memory solid-state disk can be prolonged.
The operating means of the ZNS flash memory solid-state disk that this application embodiment disclosed, through the cold and hot degree according to data when the operation, according to the degree of wear of every flash memory piece, preferentially use the flash memory piece reconstruction subregion of specific degree of wear to the degree of wear of balanced all flash memory pieces, thereby the degree of wear of the inside flash memory piece of effective balanced ZNS flash memory solid-state disk, the life of extension ZNS flash memory solid-state disk. On the other hand, the flash memory blocks are selected to carry out partition reconstruction under the condition that the operation parallelism is optimized, so that the operation parallelism of the reconstructed partitions can be further improved, and the operation speed of the ZNS flash memory solid-state disk is improved.
Furthermore, when the partition is erased, the flash memory block in which the data is stored in the corresponding reconstruction partition is only erased, so that the additional erasing operation of the empty flash memory block caused by the complete erasing of the whole physical partition in the prior art is effectively avoided, the meaningless abrasion to the flash memory block can be reduced, and the service life of the ZNS flash memory solid-state disk is prolonged.
The embodiments in the present specification are all described in a progressive manner, and each embodiment focuses on differences from other embodiments, and portions that are the same and similar between the embodiments may be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The operation method and the device of the ZNS flash memory solid-state disk provided by the present application are described in detail above, and a specific example is applied in the description to explain the principle and the implementation manner of the present application, and the description of the above embodiment is only used to help understanding the method and one core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Various component embodiments of the present application may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components in an electronic device according to embodiments of the present application. The present application may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present application may be stored on a computer readable medium or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
For example, fig. 7 shows an electronic device that may implement a method according to the present application. The electronic device can be a PC, a mobile terminal, a personal digital assistant, a tablet computer and the like. The electronic device conventionally comprises a processor 710 and a memory 720 and program code 730 stored on said memory 720 and executable on the processor 710, said processor 710 implementing the method described in the above embodiments when executing said program code 730. The memory 720 may be a computer program product or a computer readable medium. The memory 720 may 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 performing any of the method steps of the above-described method. For example, the storage space 7201 for the program code 730 may include respective computer programs for implementing the various steps in the above methods, respectively. The program code 730 is computer readable code. The computer programs may be read from or written to one or more computer program products. These computer program products comprise a program code carrier such as a hard disk, a Compact Disc (CD), a memory card or a floppy disk. The computer program comprises computer readable code which, when run on an electronic device, causes the electronic device to perform the method according to the above embodiments.
The embodiment of the application also discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the steps of the operation method of the ZNS flash memory solid-state disk are realized.
Such a computer program product may be a computer-readable storage medium that may have memory segments, memory spaces, etc. arranged similarly to memory 720 in the electronic device shown in fig. 7. The program code may be stored in a computer readable storage medium, for example, compressed in a suitable form. The computer readable storage medium is typically a portable or fixed storage unit as described with reference to fig. 8. Typically, the storage unit comprises computer readable code 730', said computer readable code 730' being code read by a processor, which when executed by the processor implements the steps of the method described above.
Reference herein to "one embodiment," "an embodiment," or "one or more embodiments" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Moreover, it is noted that instances of the word "in one embodiment" are not necessarily all referring to the same embodiment.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the application may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The application may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. An operation method of a ZNS flash memory solid-state disk is characterized by comprising the following steps:
establishing a storage pool according to flash memory blocks included by each flash memory chip in a ZNS flash memory solid-state disk, wherein each flash memory block in the storage pool is correspondingly marked with a wear value;
in response to the reconfiguration of a storage partition triggered by the write operation of the designated original partition for the ZNS flash solid state disk, selecting a target flash block based on the operation parallelism and the wear value of the flash block in the storage pool, wherein the operation parallelism is determined according to the similarity and difference of the flash chips to which the flash block belongs;
building a reconstruction partition corresponding to the designated original partition based on the target flash memory blocks;
performing the write operation based on the reconstructed partition.
2. The method according to claim 1, wherein after said building a reconstructed partition corresponding to said specified original partition based on said target flash memory blocks, further comprising:
establishing a partition mapping relation between the reconstruction partition and each flash memory block included in the reconstruction partition;
after the performing the write operation based on the reconstructed partition, further comprising:
responding to the erasing operation aiming at the specified original partition, and acquiring a flash memory block included in the reconstructed partition corresponding to the specified original partition according to the partition mapping relation;
executing a flash block erasing operation based on the acquired flash block;
updating the wear value of the flash memory block erased by executing the flash memory block erasing operation, and deleting the partition mapping relation between the acquired flash memory block and the corresponding reconstruction partition.
3. The method according to claim 2, wherein said performing a flash block erase operation based on said acquired flash blocks comprises:
and executing flash memory block erasing operation on the flash memory blocks which store data in the obtained flash memory blocks.
4. The method of any of claims 1 to 3, wherein selecting a target flash block based on the wear value and operational parallelism of flash blocks in the storage pool comprises:
and selecting the flash memory blocks with the wear values meeting the wear value equalization condition from the storage pool as target flash memory blocks by taking the operation parallelism of the selected flash memory blocks as a preferred condition.
5. The method according to claim 4, wherein selecting the flash memory block with the wear value satisfying the wear value equalization condition from the storage pool as a target flash memory block with the operational parallelism of the selected flash memory block as a preferred condition comprises:
determining a data hot degree type matched with the write operation according to the data operation hot degree matched with the specified original partition aimed at by the write operation;
determining the number of the flash memory blocks contained in a reconstruction partition corresponding to the designated original partition according to the capacity of the designated original partition;
and selecting the number of empty flash memory blocks with the wear values matched with the data heat types and the difference value between the wear values smaller than a preset difference threshold value from the storage pool as target flash memory blocks under the condition that the operation parallelism of the selected flash memory blocks is preferred.
6. The method of claim 5, wherein the operational parallelism condition comprises, in order from high to low: selecting the number of empty flash blocks from the storage pool, the number of empty flash blocks being the target flash block, the number of empty flash blocks having the wear values matching the data heat type and the difference between the wear values being less than a preset difference threshold, with the operational parallelism of the selected flash blocks being a preferred condition, including:
the conditions for initializing the parallelism of the current operation are as follows: the flash memory blocks are all operated in parallel;
selecting the number of empty flash memory blocks which are matched with the current operation parallelism condition from the storage pool, the abrasion values of which are matched with the data heat types, and the difference value between the abrasion values of which is less than a preset difference threshold value;
in response to a successful selection, determining the selected empty flash block as a target flash block;
in response to a selection failure, decreasing the current operational parallelism condition, jumping to executing the selecting the number of empty flash blocks from the storage pool that match the current operational parallelism condition, and the wear values match the data heat type, and the difference between the wear values is less than a preset difference threshold until the current operational parallelism condition is not a serial operation of the flash blocks.
7. The method of claim 5, wherein the data heat type comprises: cold data, hot data, and, an unknown heat, the wear value matching the data heat type, including any of:
where the data heat type matches thermal data, the wear value is below a first wear value threshold;
in the event that the data heat type matches cold data, the wear value is above a second wear value threshold;
in the event that the data heat type matches an unknown heat, the wear value matches an on-chip average wear value;
wherein the first wear value threshold is less than the second wear value threshold.
8. An operating device of a ZNS flash memory solid state disk is characterized by comprising:
the storage pool building module is used for building a storage pool according to flash memory blocks included in each flash memory chip in the ZNS flash memory solid-state disk, wherein each flash memory block in the storage pool is correspondingly marked with a wear value;
the target flash memory block selection module is used for responding to the reconstruction of a storage partition triggered by the write operation of the designated original partition aiming at the ZNS flash memory solid-state disk, and selecting a target flash memory block based on the operation parallelism and the abrasion value of the flash memory block in the storage pool, wherein the operation parallelism is determined according to the difference and the sameness of the flash memory chip to which the flash memory block belongs;
the partition reconstruction module is used for constructing a reconstruction partition corresponding to the specified original partition based on the target flash memory block;
and the first flash memory solid-state disk operating module is used for executing the writing operation based on the reconstruction partition.
9. An electronic device comprising a memory, a processor and program code stored on the memory and executable on the processor, wherein the processor when executing the program code implements the method of operation of the ZNS flash solid state disk of any of claims 1 to 7.
10. A computer readable storage medium having stored thereon program code, characterised in that the program code when executed by a processor implements the steps of a method of operation of a ZNS flash solid state disk as claimed in any one of claims 1 to 7.
CN202211078101.1A 2022-09-05 2022-09-05 Operation method and device of ZNS flash memory solid-state disk and electronic equipment Pending CN115480698A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211078101.1A CN115480698A (en) 2022-09-05 2022-09-05 Operation method and device of ZNS flash memory solid-state disk and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211078101.1A CN115480698A (en) 2022-09-05 2022-09-05 Operation method and device of ZNS flash memory solid-state disk and electronic equipment

Publications (1)

Publication Number Publication Date
CN115480698A true CN115480698A (en) 2022-12-16

Family

ID=84392492

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211078101.1A Pending CN115480698A (en) 2022-09-05 2022-09-05 Operation method and device of ZNS flash memory solid-state disk and electronic equipment

Country Status (1)

Country Link
CN (1) CN115480698A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117873406A (en) * 2024-03-11 2024-04-12 武汉麓谷科技有限公司 Method for controlling wear balance of ZNS solid state disk

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117873406A (en) * 2024-03-11 2024-04-12 武汉麓谷科技有限公司 Method for controlling wear balance of ZNS solid state disk

Similar Documents

Publication Publication Date Title
KR100910680B1 (en) Method and apparatus for managing an erase count block
KR100914089B1 (en) Maintaining erase counts in non-volatile storage systems
US7240178B2 (en) Non-volatile memory and non-volatile memory data rewriting method
CN102890656B (en) The method improving FLASH service life
KR101091844B1 (en) Flash memory system scanning bad block fast and bad bolck managing method thereof
US20100174845A1 (en) Wear Leveling for Non-Volatile Memories: Maintenance of Experience Count and Passive Techniques
US20090265403A1 (en) File system
US20100318760A1 (en) Memory controller, nonvolatile storage device, and nonvolatile storage system
US20140181378A1 (en) Control device, control method, and program
KR20050084879A (en) Tracking the least frequently erased blocks in non-volatile memory systems
CN104298465A (en) Block grouping method in SSD
CN108415851B (en) Method and device for improving starting speed of flash memory equipment
CN107678981A (en) Data processing method and device
JP2008059228A (en) File system
US7644260B2 (en) File update system and boot management system of mobile communication terminal, method of updating file in mobile communication terminal, and method of booting mobile communication terminal
JP2005174279A (en) Flash memory, mapping control apparatus and method for flash memory
CN115480698A (en) Operation method and device of ZNS flash memory solid-state disk and electronic equipment
KR100703680B1 (en) Flash file system
CN112596668A (en) Bad block processing method and system for memory
US20070005929A1 (en) Method, system, and article of manufacture for sector mapping in a flash device
CN111949569A (en) Storage device and control method and control device thereof
CN112527693A (en) Wear leveling method, system, equipment and medium for solid state disk
CN115237351B (en) NAND block dynamic remapping and read-write command processing method and storage device
JP4153535B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
CN114063905B (en) Log storage method, log storage device, storage equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination