CN117873406A - Method for controlling wear balance of ZNS solid state disk - Google Patents

Method for controlling wear balance of ZNS solid state disk Download PDF

Info

Publication number
CN117873406A
CN117873406A CN202410272508.0A CN202410272508A CN117873406A CN 117873406 A CN117873406 A CN 117873406A CN 202410272508 A CN202410272508 A CN 202410272508A CN 117873406 A CN117873406 A CN 117873406A
Authority
CN
China
Prior art keywords
data
zone
block
solid state
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
CN202410272508.0A
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.)
Wuhan Lugu Technology Co ltd
Original Assignee
Wuhan Lugu Technology Co 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 Wuhan Lugu Technology Co ltd filed Critical Wuhan Lugu Technology Co ltd
Priority to CN202410272508.0A priority Critical patent/CN117873406A/en
Publication of CN117873406A publication Critical patent/CN117873406A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a method for controlling wear balance of a ZNS solid state disk, which adopts a method that a track Block array is formed by continuous good blocks of Plane, so as to form a Zone, and ensure the characteristic of bicontinuous logical address and physical address of the Zone; further, by maintaining a mapping table of Logic Plane Block and selectively opening Raid for critical data, hardware overhead and user cost are reduced. Meanwhile, the classification module and the predictive clustering module are adopted to grade the heat indexes of the stored data before the data is stored and match the heat indexes with the Zone types, so that the reasonable distribution of the data is improved, the problem of write amplification caused by wear balance is reduced, and the service life of the ZNS solid state disk is prolonged. The method solves the problem that the ZNS solid state disk performance is reduced due to the conventional common solid state disk wear balancing strategy.

Description

Method for controlling wear balance of ZNS solid state disk
Technical Field
The invention relates to the field of solid state disk storage, in particular to a method for controlling wear balance of a ZNS solid state disk.
Background
The solid state disk (Solid State Drive, SSD) is a hard disk made of a solid state electronic memory chip array, and the Solid State Disk (SSD) is composed of a control unit, a memory unit (FLASH chip, DRAM chip) and the like. The ZNS solid state disk belongs to a special Solid State Disk (SSD). The ZNS solid state disk is based on ZNS partition introduced in NVMe1.4a protocol, and the main components of the ZNS solid state disk comprise a controller chip, a storage chip, a power management module, an interface circuit and the like. The ZNS solid state disk is characterized in that a Solid State Disk (SSD) is divided into different data areas, and data of different applications are stored into specific partitions, so that higher storage capacity, faster storage performance and the like are realized.
The storage unit of the Solid State Disk (SSD) is composed of flash memory particles, but with the extension of the service time, the flash memory particles are gradually worn out in the use process, and when the writing or erasing times of a certain unit reach a certain threshold value, the unit is permanently and physically damaged. Currently, the main four types of NAND in the market, namely SLC, MLC, TLC and QLC, are respectively from high to low according to life span: SLC > MLC > TLC > QLC. Typically, the flash memory chip of the QLC type SSD, which has the lowest erasable programming number, can be erased only hundreds of times. When a certain application carries out frequent erasing on a certain storage unit, the ZNS solid state disk can be damaged due to the fact that the certain storage unit reaches the erasable limit in advance than other storage units, and the service life of the ZNS solid state disk is greatly shortened. Currently, to address this issue, wear Leveling (weather Leveling) is applied to Solid State Disks (SSDs) to avoid unnecessary P/E Wear. Wear Leveling (weather Leveling) is to distribute the erasing/writing cycle to the storage units, so as to avoid continuous erasing/writing operation to the same storage unit, thereby effectively prolonging the service life of the SSD.
For the Wear-Leveling (weather Leveling) algorithm, block units in a Solid State Disk (SSD) are mainly divided into two types: data blocks and free blocks. The data block is a main component of the flash memory and is used for storing data; and the idle blocks account for about 2% of the whole flash memory, and are mainly used for a buffer Wear balance (weather Leveling) algorithm. Although the storage unit structure of the ZNS solid state disk is the same as that of a traditional Solid State Disk (SSD), the management mode of data is completely different. Therefore, the Wear-Leveling (weather Leveling) algorithm designed for a common Solid State Disk (SSD) is not fully applicable to the ZNS solid state disk. Wear balance (weather Leveling) of a common solid state disk is realized by continuously changing a physical address corresponding to a logical address through an FTL layer. However, for the ZNS solid state disk, the physical capacity of the solid state disk is divided into a plurality of LBAs, and then the LBAs are segmented, and each segmented LBA region is managed in a Zone manner. Because the data stored in the NAND Flash is not affected by power failure, the user data of these Zones are finally stored in the NAND Flash. The NVME ZNS protocol specifies that the order of LBA writes needs to be kept continuous, i.e. the LBA0 write of the current Zone is initiated, which LBA of the next write to the current Zone must be LBA1. Therefore, it is common practice to force the physical addresses of the LBA and the corresponding NAND Flash to be bound, which results in a Zone that is frequently erased by an application program and programmed to be used with a much higher frequency, while other zones are operated with a lower frequency, so that the Zone is easily disabled due to lifetime exhaustion. Whereas if SLC mode storage is only used, the physical capacity is sacrificed although the erasure life is improved, which leads to an increase in cost. Furthermore, the ZNS solid state disk characteristics work by adopting different data partition placement according to the type and the access frequency of data, namely the ZNS solid state disk has certain dependence on the binding relationship between LBA and physical address. Because of the local distribution of data, when a host requests are concentrated in one or several partitions, the blocks corresponding to the partitions are frequently erased, which may lead to wear imbalance among physical blocks. The traditional method is adopted, namely, the corresponding mapping relation is changed to provide wear balance, the design requirement of ZNS SSD on data arrangement according to the type of the data is not met, and the discontinuous addresses can be caused to influence the read-write performance of the ZNS SSD. Currently, there is no design for wear balancing of ZNS solid state disks in the market.
Disclosure of Invention
The invention provides a method for controlling wear balance of a ZNS solid state disk, and aims to ensure the service life of the ZNS solid state disk. According to the protocol specification of the ZNS solid state disk, when the ZNS solid state disk is initialized, blocks with close erasing times are distributed in the same Zone as much as possible, so that the erasing times of each Block in the same Zone are basically the same or similar; meanwhile, in order to avoid the reduction of the service life of the ZNS solid state disk caused by the transitional use of a certain Zone, the heat index of the data to be processed is calculated so as to be placed in the corresponding Zone, and the data erasing uniformity is improved. When a certain Zone is frequently erased, the current hot data Zone and the current cold data Zone are exchanged through the wear balance optimization module, so that the large difference of the erasing times between blocks is prevented, the erasing times of all physical blocks on the Nand Flash medium are at an average level, and the overall service life of the ZNS solid state disk is prolonged.
Specifically, the invention relates to a method for controlling wear balance of a ZNS solid state disk, wherein the ZNS solid state disk at least comprises a control unit and a plurality of logic units; each logic unit comprises a plurality of planes, and the control unit at least comprises a classification module, a predictive clustering module, a wear balance optimizing module and a scanning addressing module; the method is characterized by comprising the following steps of:
step one, bad Block scanning is carried out on a plurality of blocks in planes corresponding to each logic unit LUN through the scanning addressing module; and selecting N+1 continuous good blocks from the plurality of good blocks scanned by each Plane respectively, and arranging and addressing the good blocks to obtain the vertical band formed by arranging the N+1 good blocks in total of the Plane0Logic-Block0 and the Plane0Logic-Block1.
Step two, extracting the Logic Block0 of each Plane of all the Logic unit LUNs to form a Logic Block0 stripe, the Logic Block1 of all the Logic unit LUNs to form a Logic Block1 stripe, and the like, so as to form a plurality of Logic Block stripe arrays, wherein the Nth Logic Block stripe is formed by the Logic Block N of all the Logic unit LUNs.
Thirdly, carrying out one-to-one mapping on the Block of the Raid Block0 stripe and the Raid Block1 stripe with the Zone0, the Zone 1; wherein the number of Raid blocks per Zone is equal.
Step four, the classification module obtains the erasing times X of each Block in each Zone and the maximum erasing times Xmax in the blocks forming each Zone, calculates the variance Var (X) of each Raid Block strip according to the erasing times X, and compares the variance Var (X) with a set threshold value: when Var (X) is greater than the set threshold, starting a correction mapping program until Var (X) is less than the set threshold; the correction program enables the erasing times of the blocks in the Raid Block to be close, and the variance Var (X) is smaller than a set threshold value.
Step five, the classification module sorts the N+1 Zones according to the maximum erasing times Xmax of the Block with the largest erasing times in each Zone, and classifies the Zones into three types according to the arrangement sequence, and the 1 st to [ (N+1)/3 ] Zones are set as a hot data pool; setting [ (n+1)/3 ] +1 to [ (n+2)/3 ] Zone as a warm data pool; setting [ n+2/3] +1th to (n+1) th Zone as a cold data pool; wherein "[ ]" means a rounding operation.
Step six, a mapping table of LogicPlanBlock is established and maintained, mapping information of the Zone and the corresponding Block is recorded in the mapping table, each piece of mapping information at least comprises Logic2 PhyPlanBlockMap [ Raid Block Number ] [ LUN Number ] [ PlanNumber ] [ Block X ], and when the mapping relation of the Zone and the corresponding Block is transformed, the mapping table is updated; wherein Raid Block Number represents a Raid Block sequence number; LUN Number represents a logical unit Number; the Plane Number represents the Plane Number; block X represents the current erasing times of the corresponding Block of the mapping relation; and the mapping table is stored in the ZNS solid state disk, and is read into a DRAM buffer after the system is started.
The wear balance optimizing module is further provided with a counting module, wherein the counting module is used for recording the accumulated executing erasing operation times V (i) of the ith Zone in a period of use time of the ZNS solid state disk; and the control module sets an erasing threshold, and executes a wear balance optimization algorithm when the accumulated erasing times V (i) +Xmax of a certain Zone is larger than the erasing threshold, wherein the wear balance optimization module comprises a background dynamic wear balance task and a foreground dynamic wear balance task.
And eight, selecting a plurality of intact blocks remained on each physical Plane in the step one to form a reserved Zone Raid Block, wherein the Zone Raid Block is used for processing a foreground dynamic wear balancing task, and the size of the Zone Raid Block is equal to that of the Raid Zone.
Step nine, before the data to be written is written into a buffer, calculating the data heat index through the predictive clustering module, judging the data heat level, and writing the data into the Zone of the corresponding data pool according to the calculation result; the buffer memory comprises a first buffer memory, a second buffer memory and a third buffer memory, and corresponds to the hot data pool, the warm data pool and the cold data pool one by one respectively.
Further, in the step seven, the number of times of erasing each Zone that the background dynamic wear leveling task scans the meeting condition obtains a maximum value and a minimum value, and if the interval between the maximum value and the minimum value exceeds a set threshold, data exchange between the zones is started, and the data exchange step at least includes:
1) Two Plane Block regions are opened in the cache, 2 Plane Block are read to the cache,
2) Erasing the two Plane blocks, and writing the Plane Block data with large erasing times into the Plane Block with small erasing times; writing the data from the Plane Block with small erasing times into the Plane Block with large erasing times in the cache; and by analogy, the data of the Plane blocks in the two Zones are completely exchanged, and the data exchange with balanced dynamic wear of the background is completed.
Further, in the step seven, the foreground dynamic wear leveling task directly writes data into the reserved Zone Raid Block in the step nine, so as to ensure timely response when user data is written; each time one data is written, simultaneously moving the same amount of cold data to a physical position corresponding to a Zone of a hot data pool; and waiting for the LBA data request writing corresponding to the Zone of the current hot data pool, and directly writing the LBA data request writing to the Raid Block corresponding to the Zone of the previous cold data pool.
Further, the revision mapping program is configured to: exchanging the mapping relation between blocks and Zone among Raid blocks according to a preset exchange rule, wherein the preset exchange rule is as follows: and acquiring the erasing times of each Block in the current Zone, sequencing the blocks according to the sequence from large to small, and then sequentially replacing the mapping relation of the Block with the larger erasing times with the good Block in the standby pool until the variance Var (X) is smaller than the set threshold value.
Further, the good blocks in the standby pool consist of the remaining unaddressed good blocks in each Plane, and when the replacement is performed, the priority sequence selected is as follows: with Plane > with Die > with LUN, and the number of erasures of good blocks for replacement is smaller than the number of erasures of Block to be replaced.
Further, when the good blocks in the standby pool are formed by addressed blocks in each Plane, mapping relations of the two addressed blocks are directly exchanged, and the sequence number of the Zone where the good Block to be replaced is larger than the sequence number of the Zone where the good Block to be replaced is located.
Further, the step of calculating the data heat index and judging the data heat level by the predictive clustering module further includes:
7-1) establishing a standard sample data set, and training, classifying and learning the predictive clustering module through the standard sample data, wherein the standard sample data at least comprises system metadata, media stream data, a system file and a user file;
7-2) after training, processing the data written into the Zone, and respectively putting the data with the same or similar data types into corresponding buffers.
Further, the classification learning is realized by inputting different types of standard data samples at a plurality of indefinite intervals, and the method specifically comprises the following steps of:
8-1) judging the data type, and counting the corresponding writing or modifying frequency f of the data type in a period of time; the data type is multimedia data, and P is 0.5; the data type is system metadata or application data, and P is 1.2; when the data is other types of data, P is 1;
8-2) calculating a data type heat indexWherein
Wherein the method comprises the steps ofA write frequency correction coefficient representing write data, the initial value being 1;a write time correction coefficient indicating a data type, the initial value being 1; f represents the number of times a certain type of data is written; f represents the total writing times of the data; t0, T1 and T2 represent time moments; in this way, the popularity value of each content item may be dynamically adjusted while reducing the fluctuation problem.
Further, after the training is finished, the data written into the Zone are processed, the data with the same or similar data types are respectively put into the corresponding buffers, the steps further comprise the step of calculating the heat index of the data to obtain the heat value of the data to be written, the predictive clustering module labels the data to be written according to the heat value, the controller judges the data with the same label as the same or similar data, the data are written into the corresponding buffers, and the data to be written into the Zone are written once when the buffers are full.
Further, the correction coefficientThe correction coefficientWhereinIndicating the write frequency of the data type corresponding to the cut-off time; the calculation formula can dynamically adjust the proportion weight of each data type according to the type frequency of the data to be written, and improves the accuracy of the heat index calculation.
The invention has the beneficial effects that:
the capacity of each Zone of the ZNS solid state disk is equal, and the dynamic balance cost of firmware is simplified.
2. The foreground and background dynamic balance design reduces the data response time delay of enterprise-level users and improves the read-write performance of the ZNS solid state disk.
3. The Raid can be started on key data according to the needs, the NAND Flash does not need to store data in an SLC mode, and cost of a user is saved.
4. Only one Logic Plane Block mapping table is required to be maintained, and the mapping table is updated once after data exchange is completed, so that the space overhead for maintaining the mapping table is reduced, and the query efficiency is improved.
5. The wear balance design greatly prolongs the service life of the ZNS solid state disk, and ensures that the Zone cannot be used due to the fact that the service life of NAND Flash can not be reached too early when data are frequently written.
6. By performing heat classification on the data to be written, the data with different heat is respectively distributed to the corresponding hot or warm or cold data storage areas, so that the distribution uniformity of the stored data is improved, and the phenomenon that the hot data is frequently erased and written for a certain fixed Zone for many times is avoided. And a wear balancing strategy is formulated for the ZNS solid state disk, so that the problem that the performance of the ZNS solid state disk is reduced due to the conventional common solid state disk wear balancing strategy is solved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the related art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is apparent that the drawings in the following description are only embodiments of the present application, and other drawings may be obtained according to the provided drawings without inventive effort to those skilled in the art.
The structures, proportions, sizes, etc. shown in the drawings are shown only in connection with the present disclosure, and should not be construed as limiting the scope of the invention, since any modification, variation in proportions, or adjustment of the size, which would otherwise be used by those skilled in the art, would not have the essential significance of the present disclosure, would not affect the efficacy or otherwise be achieved, and would still fall within the scope of the present disclosure.
Fig. 1 is a schematic diagram of a Raid Block structure in an embodiment of the present application.
Fig. 2 is a schematic diagram of a Zone composition structure according to an embodiment of the present application.
Fig. 3 is a schematic diagram of a ZNS SSD background wear leveling firmware processing procedure according to an embodiment of the application.
Fig. 4 is a flowchart of background Zone data exchange according to an embodiment of the present application.
Fig. 5 is a schematic diagram of a ZNS SSD foreground wear leveling firmware processing flow according to one embodiment of the application.
Fig. 6 is a flowchart of background Zone data exchange according to an embodiment of the present application.
Fig. 7 is a flow chart of foreground Zone data exchange according to an embodiment of the present application.
Detailed Description
Embodiments of the present application will now be described more fully hereinafter with reference to the accompanying drawings, in which it is shown, and in which it is evident that the embodiments described are exemplary only some, and not all embodiments of the application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The method for controlling the wear balance of the ZNS solid state disk ensures that when a certain Zone is frequently erased by a user, the current hot data Zone and cold data Zone are exchanged, so that the erasing times of all physical blocks on a Nand Flash medium are approximately at an average level, and the premature failure of a physical storage unit corresponding to the certain Zone due to frequent erasing is avoided. The method for controlling wear balance of the ZNS solid state disk at least comprises a control unit and a plurality of logic units; and each logic unit comprises a plurality of planes, and the control unit at least comprises a classification module, a predictive clustering module, a wear balance optimization module and a scanning addressing module. The method for controlling wear balance of the ZNS solid state disk comprises the following steps:
scanning each logic unit LUN through a scanning addressing module to obtain the distribution condition of the Block good blocks in the corresponding Plane; and selecting N+1 continuous good blocks from the plurality of good blocks scanned by each Plane respectively, and arranging and addressing the good blocks to obtain the vertical band formed by arranging the N+1 good blocks in total of the Plane0Logic-Block0 and the Plane0Logic-Block1. Because the logical addresses of the Zone are continuous, the logical addresses are composed of a plurality of blocks, and the logical addresses and the physical addresses of the Zone can be kept continuous as far as possible by composing the Zone by using the blocks with the continuous physical addresses, thereby being beneficial to improving the reading and writing speed. Further, by scanning good blocks in each Plane, a Zone consisting of good blocks, in which no bad blocks exist, can be obtained, and the performance and stability of the Zone can be improved.
Step two, extracting the Logic Block0 of each Plane of all the Logic unit LUNs to form a Raid Block0 stripe, namely, the Block0 of Plane0, the Block0 of Plane1 and the Block0 of Plane 2. By analogy, the Logic Block1 of all the Logic units LUNs forms a Raid Block1 stripe, and the Nth Raid Block stripe is formed by the Logic Block N of all the Logic units LUNs; then several Raid Block stripe arrays may be organized as shown in fig. 1. For convenience of explanation, the application assumes that the selected blocks are good blocks; in practice, if the sequence numbers of a certain selected Block are discontinuous, the sequence numbers are arranged according to more than ten orders, and the implementation of the invention is not affected. For example, if Block1 in Plane0 is a bad Block, the selected Block skips the bad Block and is sequentially forward.
Thirdly, carrying out one-to-one mapping on the Block of the Raid Block0 stripe and the Raid Block1 stripe with the Zone0, the Zone 1; wherein the number of Raid blocks per Zone is equal as shown in fig. 2. Through the mapping, the mapping relation between the blocks in the band of the Raid Block and the corresponding Zone can be established, so that a basis is provided for the subsequent formation of a mapping table. The write data in each Zone must be written sequentially, so that only the mapping relation between the Zone and the Block is required to be maintained, the mapping relation between each Block and the current write address is not required to be maintained, the storage space of the mapping table can be greatly reduced, and the query efficiency is improved.
And step four, acquiring the erasing times X of each Block in each Zone and the maximum erasing times Xmax of the blocks forming each Zone through a classification module. For a certain Zone, the data writing must be sequentially written, and when the Zone is erased by a RESET command, the number of times of erasing of the blocks constituting the Zone is increased once as a whole. The maximum number of times that the current Zone has been erased can be obtained by obtaining the maximum number of times of erasing Xmax of the Block of each Zone. Calculating a variance Var (X) of each Raid Block stripe according to the erasing times X, and comparing the variance Var (X) with a set threshold value: when Var (X) is greater than the set threshold, starting a correction mapping program until Var (X) is less than the set threshold; the correction program enables the erasing times of the blocks in the Raid Block to be close, and the variance Var (X) is smaller than a set threshold value. Before the Zones are stored with data, all the Zones of the ZNS solid state disk are subjected to one-time equalization optimization, and at the moment, the data in the Zones do not need to be moved, so that the Zones can keep better uniformity, the service life of the Zones of the ZNS solid state disk is prolonged, the stability of the Zones of the ZNs solid state disk is improved, and the write amplification is reduced.
The revision mapping program is configured to: exchanging the mapping relation between blocks and Zone among Raid blocks according to a preset exchange rule, wherein the preset exchange rule is as follows: and acquiring the erasing times of each Block in the current Zone, sequencing the blocks according to the sequence from large to small, and then sequentially replacing the mapping relation of the Block with the larger erasing times with the good Block in the standby pool until the variance Var (X) is smaller than the set threshold value. While good blocks of the spare pool may include two sources, one consisting of the remaining good blocks in each Plane that are not addressed, the priority order of selection when replaced is in turn: the number of times of erasing of good blocks used for replacement is smaller than that of erasing of blocks to be replaced, and the good blocks with the same Plane are preferably selected as replacement good blocks, so that the addressing time can be reduced, and the continuity of data reading and writing is ensured; the other is composed of addressed blocks in each Plane, when the blocks are replaced, the mapping relation of the two addressed blocks is directly exchanged, and the sequence number of a Zone where a good Block to be replaced is larger than that of a Zone where the good Block to be replaced is located, so that the Zone which is subjected to wear balance optimization in the front can be guaranteed not to be damaged again, and meanwhile, the blocks with close erasing times are distributed in the same Zone, and write amplification is reduced.
Step five, the classification module sorts the N+1 Zones according to the maximum erasing times Xmax of the Block with the largest erasing times in each Zone, and classifies the Zones into three types according to the arrangement sequence, and the 1 st to [ (N+1)/3 ] Zones are set as a hot data pool; setting [ (n+1)/3 ] +1 to [ (n+2)/3 ] Zone as a warm data pool; setting [ n+2/3] +1th to (n+1) th Zone as a cold data pool; wherein "[ ]" means a rounding operation. The Zones are classified by the classification module, the Zones are properly classified, then the data are stored in the corresponding Zones according to the heat index of the data, the hot data can be stored in the hot data pool, the warm data are stored in the warm data pool, and the cold data are stored in the cold data pool, so that the mixing of the cold data and the hot data is avoided to the greatest extent, and the write amplification caused by wear balance is reduced. In another embodiment, the hot data may be stored in a cold data pool, the warm data may be stored in a warm data pool, and the cold data may be stored in a hot data pool; the method can avoid mixing of cold and hot data, reduce the number of times of starting wear leveling, play a role in wear leveling when storing data, and be favorable for reducing the number of times of erasing caused by wear leveling.
Furthermore, in the n+1 Zone, the number of the Zone of different data storage types can be equalized, and also can be unevenly set according to the needs, preferably, the number of the Zone in the cold data pool and the hot data pool is set to be equal, which is beneficial to data replacement in later wear equalization.
Step six, a mapping table of LogicPlanBlock is established and maintained, mapping information of the Zone and the corresponding Block is recorded in the mapping table, each piece of mapping information at least comprises Logic2 PhyPlanBlockMap [ Raid Block Number ] [ LUN Number ] [ PlanNumber ] [ Block X ], and when the mapping relation of the Zone and the corresponding Block is transformed, the mapping table is updated; wherein Raid Block Number represents a Raid Block sequence number; LUN Number represents a logical unit Number; the Plane Number represents the Plane Number; block X represents the current number of erasures corresponding to the mapping relationship. The erasing times information of the Block is stored in the mapping table, 1 is automatically increased when the erasing is performed once, the erasing times of the Block can be obtained only by one query, the re-query is not needed at the later stage, the efficiency of the system is improved, and the resource expense is saved.
And the mapping table is stored in the ZNS solid state disk, and is read into a DRAM buffer after the system is started. When the mapping table is updated, the mapping relationship is directly modified in the DRAM cache. In order to reduce the write amplification of the ZNS solid state disk and ensure that the mapping table is updated and stored in time, the system performs overlay storage on the mapping table in the ZNS solid state disk by the mapping table in the DRAM cache at intervals. The DRAM buffering can use the buffer of the ZNS solid state disk, and can also use the system memory.
The wear balance optimizing module is further provided with a counting module, wherein the counting module is used for recording the accumulated executing erasing operation times V (i) of the ith Zone in a period of use time of the ZNS solid state disk; and the control module sets an erasing threshold, and executes a wear balance optimization algorithm when the accumulated erasing times V (i) +Xmax of a certain Zone is larger than the erasing threshold, wherein the wear balance optimization algorithm comprises a background dynamic wear balance task and a foreground dynamic wear balance task.
Fig. 3 is a schematic diagram of a background dynamic wear leveling task flow. And the background dynamic wear balancing task scans the number of times of erasing of each Zone meeting the condition to obtain a maximum value and a minimum value, and if the interval between the maximum value and the minimum value exceeds a set threshold value, starting data exchange between the zones, wherein the data exchange step at least comprises the following steps:
1) Two corresponding Plane Block regions are opened in the cache, 2 Plane Block are read to the cache,
2) Erasing the two Plane blocks, and writing the Plane Block data with large erasing times into the Plane Block with small erasing times; writing the data from the Plane Block with small erasing times into the Plane Block with large erasing times in the cache; and by analogy, the data of the Plane blocks in the two Zone are completely exchanged, and the data exchange with balanced background dynamic wear is completed so far, as shown in fig. 4.
Fig. 5 is a schematic diagram of a foreground dynamic wear leveling process. The foreground dynamic wear balancing task directly writes data into the reserved Zone Raid Block in the step eight, so that the problem that the normal read-write function is affected due to occupation of the Zone is avoided, and timely response when user data is written is ensured. Each time one data is written, simultaneously moving the same amount of cold data to a physical Block position corresponding to a Zone of a hot data pool; and waiting for the LBA data request writing corresponding to the Zone of the current hot data pool, and directly writing the LBA data request writing to the Raid Block corresponding to the Zone of the previous cold data pool, as shown in fig. 6.
And step eight, forming a reserved Zone Raid Block by a plurality of intact blocks left on each physical Plane in the step one, wherein the Zone Raid Block is used for processing a foreground dynamic wear leveling task, and the size of the Zone Raid Block is equal to that of the Raid Zone, as shown in fig. 7. Through the Zone Raid Block that reserves, can avoid additionally taking more buffer space, avoid influencing ZNS solid state disk's performance when carrying out the foreground dynamic wear.
Step nine, before the data to be written is written into the buffer, calculating the data heat index through a predictive clustering module, judging the data heat level, and writing the data into the Zone of the corresponding data pool according to the calculation result; the buffer memory comprises a first buffer memory, a second buffer memory and a third buffer memory, and corresponds to the hot data pool, the warm data pool and the cold data pool one by one respectively.
In one embodiment, the step of calculating the data heat index and determining the data heat level by the predictive clustering module further comprises:
1) Establishing a standard sample data set, and training, classifying and learning the predictive clustering module through the standard sample data, wherein the standard sample data at least comprises system metadata, media stream data, a system file and a user file; the standard sample data can be configured according to the actual needs of users. The classification learning is realized by inputting different types of standard data samples at multiple indefinite intervals, and specifically comprises the following steps:
1-1) judging the data type, and counting the corresponding writing or modifying frequency f of the data type in a period of time; setting different parameters P according to different data types, wherein the data types are multimedia data, and the P is 0.2-0.5; the data type is system metadata or application program data, and P is 1-1.2; when the data is other types of data, P is 0.9-1; wherein the data of P is obtained empirically from standard sample data input results.
1-2) calculating a data type heat indexWherein
Wherein the method comprises the steps ofA correction coefficient representing a write frequency of the write data, the correction coefficientWhen the value is 1, the writing frequency of certain data in the time period is unchanged;write time correction coefficients representing data types, said correction coefficientsThe method comprises the steps of carrying out a first treatment on the surface of the f represents the number of times a certain type of data is written; f represents the total writing times of the data; t0, T1, T2 denote a moment in time, in whichIndicating the write frequency of the data type corresponding to the time of the cut-off. In this way, when a certain data type is written in a large amount over a period of time, the data heat index can be made to rise rapidly; and when a certain data type is written in a period of time, the data heat index can be accelerated to be reduced, so that the data type can be accurately judged. By dynamically adjusting the heat value of each content item, the problem of erroneous decisions due to fluctuations in the data heat index is reduced. The calculation formula can dynamically adjust the proportion weight of each data type according to the type frequency of the data to be written, and improves the accuracy of the heat index calculation.
2) After training, processing the data written into the Zone, calculating the heat index of the data to be written into the Zone, and respectively putting the data with the same or similar data types into corresponding buffers. Specifically, the method further comprises the steps of calculating a data heat index to obtain a heat value of data to be written, and according to the heat value, after the predictive clustering module labels the data to be written respectively, the controller judges the data with the same label as the same or similar data, writes the data into a corresponding buffer, and writes the data to be written into a corresponding Zone once when the buffer is full.
According to the method for controlling wear balance of the ZNS solid state disk, the continuous good blocks of the Plane form the Raid Block array to form the Zone, so that the characteristic of bicontinuous logical address and physical address of the Zone is ensured; meanwhile, a classification model and a predictive clustering module are adopted before data storage to grade and match the heat indexes of the stored data with the Zone types, so that reasonable data distribution is improved, and the problem of write amplification caused by wear balance is reduced. Further, by maintaining a mapping table of Logic Plane Block and selectively opening Raid for critical data, hardware overhead and user cost are reduced.
In the present specification, each embodiment is described in a progressive manner, or a parallel manner, or a combination of progressive and parallel manners, and each embodiment is mainly described as a difference from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
It should be noted that, in the description of the present application, it should be understood that the directions or positional relationships indicated by the terms "upper", "lower", "top", "bottom", "inner", "outer", etc. are based on the directions or positional relationships shown in the drawings, are merely for convenience of describing the present application and simplifying the description, and do not indicate or imply that the apparatus or element to be referred to must have a specific direction, be configured and operated in the specific direction, and thus should not be construed as limiting the present application. When an element is referred to as being "connected" to another element, it can be directly connected to the other element or intervening elements may also be present.
It is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that an article or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such article or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in an article or apparatus that comprises such element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for controlling wear balance of ZNS solid state disk, ZNS solid state disk includes control unit, several logic units at least; each logic unit comprises a plurality of planes, and the control unit at least comprises a classification module, a prediction clustering module, a wear balance optimization module and a scanning addressing module; the method is characterized by comprising the following steps of:
step one, carrying out bad Block scanning on a plurality of blocks in planes corresponding to each logic unit LUN through the scanning addressing module; selecting N+1 continuous good blocks from a plurality of good blocks scanned by each Plane respectively, and arranging and addressing the good blocks to obtain a vertical band formed by arranging the N+1 good blocks in total of the Plane0Logic-Block0 and the Plane0Logic-Block1.
Step two, extracting the Logic Block0 of each Plane of all the Logic unit LUNs to form a Logic Block0 stripe, and the Logic Block1 of all the Logic unit LUNs to form a Logic Block1 stripe, and so on, so as to form a plurality of Logic Block stripe arrays, wherein the N-th Logic Block stripe is formed by the Logic Block N of all the Logic unit LUNs;
thirdly, carrying out one-to-one mapping on the Block of the Raid Block0 stripe and the Raid Block1 stripe with the Zone0, the Zone 1; wherein the number of Raid blocks of each Zone is equal;
step four, the classification module obtains the erasing times X of each Block in each Zone and the maximum erasing times Xmax in the blocks forming each Zone, calculates the variance Var (X) of each Raid Block strip according to the erasing times X, and compares the variance Var (X) with a set threshold value: when Var (X) is greater than the set threshold, starting a correction mapping program until Var (X) is less than the set threshold;
step five, the classification module sorts the N+1 Zones according to the maximum erasing times Xmax of the Block with the largest erasing times in each Zone, and divides the Zones into three data pools according to the arrangement sequence, wherein the 1 st to [ (N+1)/3 ] Zones are set as hot data pools; the [ (n+1)/3 ] +1 to [ (n+2)/3 ] Zone is set as a warm data pool; the [ n+2/3] +1th to (n+1) th Zone is set as a cold data pool; "[ ]" means rounding;
step six, a mapping table of LogicPlanBlock is established and maintained, mapping information of the Zone and the corresponding Block is recorded in the mapping table, each piece of mapping information at least comprises Logic2 PhyPlanBlockMap [ Raid Block Number ] [ LUN Number ] [ PlanNumber ] [ Block X ], and when the mapping relation of the Zone and the corresponding Block is transformed, the mapping table is updated; wherein Raid Block Number represents a Raid Block sequence number; LUN Number represents a logical unit Number; the Plane Number represents the Plane Number; block X represents the current erasing times of the corresponding Block of the mapping relation; the mapping table is stored in the ZNS solid state disk, and after the system is started, the mapping table is read into a DRAM buffer;
the wear balance optimizing module is further provided with a counting module, wherein the counting module is used for recording the accumulated executing erasing operation times V (i) of the ith Zone in a period of use time of the ZNS solid state disk; the control module sets an erasing threshold, and when the accumulated erasing times V (i) +Xmax of a certain Zone is larger than the erasing threshold, a wear balance optimization algorithm is executed, wherein the wear balance optimization module comprises a background dynamic wear balance task and a foreground dynamic wear balance task;
step eight, selecting a plurality of intact blocks left on each physical Plane in the step one to form a reserved Zone Raid Block, wherein the Zone Raid Block is used for processing a foreground dynamic wear balancing task, and the size of the Zone Raid Block is equal to that of the Raid Zone;
step nine, before the data to be written is written into a buffer, calculating the data heat index through the predictive clustering module, judging the data heat level, and writing the data into the Zone of the corresponding data pool according to the calculation result; the buffer memory comprises a first buffer memory, a second buffer memory and a third buffer memory, and corresponds to the hot data pool, the warm data pool and the cold data pool one by one respectively.
2. The method for controlling wear leveling of a ZNS solid state disk according to claim 1, wherein: in the seventh step, the number of times of erasing each Zone that the background dynamic wear leveling task scans the meeting conditions obtains a maximum value and a minimum value, and if the interval between the maximum value and the minimum value exceeds a set threshold, data exchange between the zones is started, and the data exchange step at least includes:
1) Two Plane Block regions are opened in the cache, 2 Plane Block are read to the cache,
2) Erasing the two Plane blocks, and writing the Plane Block data with large erasing times into the Plane Block with small erasing times; writing the data from the Plane Block with small erasing times into the Plane Block with large erasing times in the cache; and by analogy, the data of the Plane blocks in the two Zones are completely exchanged, and the data exchange with balanced dynamic wear of the background is completed.
3. The method for controlling wear leveling of a ZNS solid state disk according to claim 1, wherein: in the seventh step, the foreground dynamic wear leveling task directly writes data into the reserved Zone Raid Block in the eighth step, so as to ensure timely response when user data is written; each time one data is written, simultaneously moving the same amount of cold data to a physical position corresponding to a Zone of a hot data pool; and waiting for the LBA data request writing corresponding to the Zone of the current hot data pool, and directly writing the LBA data request writing to the Raid Block corresponding to the Zone of the previous cold data pool.
4. The method for controlling wear leveling of a ZNS solid state disk according to claim 1, wherein: the revision mapping program is configured to: exchanging the mapping relation between blocks and Zone among Raid blocks according to a preset exchange rule, wherein the preset exchange rule is as follows: and acquiring the erasing times of each Block in the current Zone, sequencing the blocks according to the sequence from large to small, and then sequentially replacing the mapping relation of the Block with the larger erasing times with the good Block in the standby pool until the variance Var (X) is smaller than the set threshold value.
5. The method for controlling wear leveling of a ZNS solid state disk of claim 4, wherein: the good blocks in the standby pool consist of the remaining good blocks which are not addressed in each Plane, and when the good blocks are replaced, the priority sequence selected is as follows in sequence: with Plane > with Die > with LUN, and the number of erasures of good blocks for replacement is smaller than the number of erasures of Block to be replaced.
6. The method for controlling wear leveling of a ZNS solid state disk of claim 4, wherein: and when the blocks in the standby pool are replaced by addressed blocks in each Plane, the mapping relation of the two addressed blocks is directly exchanged, and the serial number of the Zone where the good Block to be replaced is larger than the serial number of the Zone where the good Block to be replaced is located.
7. The method for controlling wear leveling of a ZNS solid state disk according to claim 1, wherein: the step of calculating the data heat index and judging the data heat level by the predictive clustering module further comprises the following steps:
7-1) establishing a standard sample data set, and training, classifying and learning the predictive clustering module through the standard sample data, wherein the standard sample data at least comprises system metadata, media stream data, a system file and a user file;
7-2) after training, processing the data written into the Zone, and respectively putting the data with the same or similar data types into corresponding buffers.
8. The method for controlling wear leveling of a ZNS solid state disk of claim 7, wherein: the classification learning is realized by inputting different types of standard data samples at multiple indefinite intervals, and specifically comprises the following steps:
8-1) judging the data type, and counting the corresponding writing or modifying frequency f of the data type in a period of time; the data type is multimedia data, and P is 0.5; the data type is system metadata or application data, and P is 1.2; when the data is other types of data, P is 1;
8-2) calculating a data type heat indexWherein
Wherein the method comprises the steps ofA write frequency correction coefficient indicating write data;write time correction coefficients representing the data type; f represents the number of times a certain type of data is written; f represents the total writing times of data in a certain time period; t0, T1, T2 denote a certain moment.
9. The method for controlling wear leveling of a ZNS solid state disk of claim 7, wherein: step 7-2) further comprises:
9-1) calculating the heat index of the data to obtain a heat value of the data to be written, respectively labeling the data to be written by the predictive clustering module according to the heat value,
9-2) the controller judges the data with the same label as the same or similar data, and writes the data into the corresponding buffer, and when the buffer is full, the data to be written is written into the corresponding Zone once.
10. The method for controlling wear leveling of a ZNS solid state disk of claim 8, wherein: the correction coefficientThe correction coefficientWhereinIndicating the write frequency of the data type corresponding to the time of the cut-off.
CN202410272508.0A 2024-03-11 2024-03-11 Method for controlling wear balance of ZNS solid state disk Pending CN117873406A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410272508.0A CN117873406A (en) 2024-03-11 2024-03-11 Method for controlling wear balance of ZNS solid state disk

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410272508.0A CN117873406A (en) 2024-03-11 2024-03-11 Method for controlling wear balance of ZNS solid state disk

Publications (1)

Publication Number Publication Date
CN117873406A true CN117873406A (en) 2024-04-12

Family

ID=90595013

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410272508.0A Pending CN117873406A (en) 2024-03-11 2024-03-11 Method for controlling wear balance of ZNS solid state disk

Country Status (1)

Country Link
CN (1) CN117873406A (en)

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110107016A1 (en) * 2009-10-29 2011-05-05 Hynix Semiconductor Inc. Solid state storage systems and methods for flexibly controlling wear leveling
US20150347025A1 (en) * 2014-05-27 2015-12-03 Kabushiki Kaisha Toshiba Host-controlled garbage collection
US20160188455A1 (en) * 2014-12-29 2016-06-30 Sandisk Technologies Inc. Systems and Methods for Choosing a Memory Block for the Storage of Data Based on a Frequency With Which the Data is Updated
CN106844227A (en) * 2017-01-14 2017-06-13 郑州云海信息技术有限公司 Solid state hard disc abrasion equilibrium method and device based on grouping mechanism
US20170329522A1 (en) * 2014-11-20 2017-11-16 Shannon Systems Ltd. Raid system and method based on solid-state storage medium
US20190171372A1 (en) * 2017-12-01 2019-06-06 Micron Technology, Inc. Wear Leveling in Solid State Drives
US20200042224A1 (en) * 2018-08-02 2020-02-06 EMC IP Holding Company LLC Managing wear balancing in mapped raid storage systems
CN111708481A (en) * 2020-04-24 2020-09-25 浙江大学 Solid State Disk (SSD) double-area wear leveling method based on super block
US20210089226A1 (en) * 2019-09-20 2021-03-25 International Business Machines Corporation Adaptive wear leveling for drive arrays
CN112817880A (en) * 2021-03-17 2021-05-18 深圳市安信达存储技术有限公司 Solid state disk, wear balance method thereof and terminal equipment
CN114546295A (en) * 2022-04-25 2022-05-27 武汉麓谷科技有限公司 Intelligent write allocation method and device based on ZNS solid state disk
US20220261160A1 (en) * 2021-02-18 2022-08-18 Western Digital Technologies, Inc. Wear Leveling Methods For Zoned Namespace Solid State Drive
CN115480698A (en) * 2022-09-05 2022-12-16 中国电信股份有限公司 Operation method and device of ZNS flash memory solid-state disk and electronic equipment
CN115686372A (en) * 2022-11-07 2023-02-03 武汉麓谷科技有限公司 ZNS solid state disk ZRWA function-based data management method
US20230297243A1 (en) * 2020-08-20 2023-09-21 Inspur Suzhou Intelligent Technology Co., Ltd. Method and apparatus for predicting service life of solid-state disk, and computer-readable storage medium
CN117453152A (en) * 2023-12-25 2024-01-26 武汉麓谷科技有限公司 ZNS solid state disk Zone LBA management method and algorithm of block management command
US20240069741A1 (en) * 2022-08-30 2024-02-29 Micron Technology, Inc. Dynamic wear leveling techniques

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110107016A1 (en) * 2009-10-29 2011-05-05 Hynix Semiconductor Inc. Solid state storage systems and methods for flexibly controlling wear leveling
US20150347025A1 (en) * 2014-05-27 2015-12-03 Kabushiki Kaisha Toshiba Host-controlled garbage collection
US20170329522A1 (en) * 2014-11-20 2017-11-16 Shannon Systems Ltd. Raid system and method based on solid-state storage medium
US20160188455A1 (en) * 2014-12-29 2016-06-30 Sandisk Technologies Inc. Systems and Methods for Choosing a Memory Block for the Storage of Data Based on a Frequency With Which the Data is Updated
CN106844227A (en) * 2017-01-14 2017-06-13 郑州云海信息技术有限公司 Solid state hard disc abrasion equilibrium method and device based on grouping mechanism
US20190171372A1 (en) * 2017-12-01 2019-06-06 Micron Technology, Inc. Wear Leveling in Solid State Drives
US20200042224A1 (en) * 2018-08-02 2020-02-06 EMC IP Holding Company LLC Managing wear balancing in mapped raid storage systems
US20210089226A1 (en) * 2019-09-20 2021-03-25 International Business Machines Corporation Adaptive wear leveling for drive arrays
CN111708481A (en) * 2020-04-24 2020-09-25 浙江大学 Solid State Disk (SSD) double-area wear leveling method based on super block
US20230297243A1 (en) * 2020-08-20 2023-09-21 Inspur Suzhou Intelligent Technology Co., Ltd. Method and apparatus for predicting service life of solid-state disk, and computer-readable storage medium
US20220261160A1 (en) * 2021-02-18 2022-08-18 Western Digital Technologies, Inc. Wear Leveling Methods For Zoned Namespace Solid State Drive
CN112817880A (en) * 2021-03-17 2021-05-18 深圳市安信达存储技术有限公司 Solid state disk, wear balance method thereof and terminal equipment
CN114546295A (en) * 2022-04-25 2022-05-27 武汉麓谷科技有限公司 Intelligent write allocation method and device based on ZNS solid state disk
US20240069741A1 (en) * 2022-08-30 2024-02-29 Micron Technology, Inc. Dynamic wear leveling techniques
CN115480698A (en) * 2022-09-05 2022-12-16 中国电信股份有限公司 Operation method and device of ZNS flash memory solid-state disk and electronic equipment
CN115686372A (en) * 2022-11-07 2023-02-03 武汉麓谷科技有限公司 ZNS solid state disk ZRWA function-based data management method
CN117453152A (en) * 2023-12-25 2024-01-26 武汉麓谷科技有限公司 ZNS solid state disk Zone LBA management method and algorithm of block management command

Similar Documents

Publication Publication Date Title
US9098395B2 (en) Logical block management method for a flash memory and control circuit storage system using the same
US8103820B2 (en) Wear leveling method and controller using the same
CN108121503B (en) NandFlash address mapping and block management method
CN106874213B (en) Solid state disk hot data identification method fusing multiple machine learning algorithms
CN108108128A (en) A kind of abrasion equilibrium method and SSD for mixing SSD
US8738876B2 (en) Method for performing block management, and associated memory device and controller thereof
US20190286328A1 (en) Partially written block treatment
US8392647B2 (en) Solid state storage system for controlling reserved area flexibly and method for controlling the same
US10949291B2 (en) Partially written superblock treatment
US11809723B2 (en) Unbalanced plane management method, associated data storage device and controller thereof
CN102292711A (en) Solid state memory formatting
KR20090077538A (en) Semiconductor memory devices and wear leveling methods thereof
CN108829346B (en) User writing request processing method of solid state disk adapting to flash memory page difference
CN102880556A (en) Wear leveling method and system of Nand Flash
CN107423229B (en) Buffer area improvement method for page-level FTL
TW201917581A (en) Method for managing flash memory module and associated flash memory controller
CN101414282B (en) Average abrasion method and controller using the same
CN101634967A (en) Block management method for flash memory, storage system and controller
CN116457885A (en) Data processing method, device and system
CN111352593B (en) Solid state disk data writing method for distinguishing fast writing from normal writing
US9959052B1 (en) Media based cache for data storage device
CN102637145B (en) Method for managing blocks, memory device and controller thereof
CN117873406A (en) Method for controlling wear balance of ZNS solid state disk
CN114281251B (en) Data distribution and reprogramming optimization method for 3D TLC flash memory
CN115827511A (en) Method and device for setting cache

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