CN111708481B - Solid State Disk (SSD) double-area wear leveling method based on super block - Google Patents

Solid State Disk (SSD) double-area wear leveling method based on super block Download PDF

Info

Publication number
CN111708481B
CN111708481B CN202010332619.8A CN202010332619A CN111708481B CN 111708481 B CN111708481 B CN 111708481B CN 202010332619 A CN202010332619 A CN 202010332619A CN 111708481 B CN111708481 B CN 111708481B
Authority
CN
China
Prior art keywords
block
area
data
superblock
super
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.)
Expired - Fee Related
Application number
CN202010332619.8A
Other languages
Chinese (zh)
Other versions
CN111708481A (en
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.)
Zhejiang University ZJU
Original Assignee
Zhejiang University ZJU
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 Zhejiang University ZJU filed Critical Zhejiang University ZJU
Priority to CN202010332619.8A priority Critical patent/CN111708481B/en
Publication of CN111708481A publication Critical patent/CN111708481A/en
Application granted granted Critical
Publication of CN111708481B publication Critical patent/CN111708481B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • 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/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]

Abstract

The invention discloses a Solid State Disk (SSD) wear leveling method based on a super block structure, which is characterized in that under the super block structure of a solid state disk, a whole system is divided into two blocks (A, B), and respective super blocks (D) of the two blocks are arranged in a hot-cold staggered manner, and when garbage is recovered, a staggered recovery (C) manner is adopted, hot data of the super blocks are recovered into a cold data block (400) of the other block according to a staggered rule, and the cold data is recovered into a hot data block (300) of the other block. The invention is also compatible with a method for processing excessive effective data in garbage recovery by using the spare block (700) on the basis of double-area wear balance. In general, the invention reduces the read-write overhead of the additional flash memory, and achieves the effects of improving the performance and prolonging the service life.

Description

Solid State Disk (SSD) double-area wear leveling method based on super block
Technical Field
The invention relates to a Solid State Disk (SSD) double-area wear leveling method based on a super block, belonging to the field of electronic information and integrated circuit design.
Background
In 1967, Floating Gate transistors (Floating Gate transistors) were developed by the korean scientists ginger and chinese scientists in bell laboratories and laid the foundation of the solid state disk SSD technology. Compared with an MOSFET, the Floating Gate transistor has more Floating gates, namely a Floating Gate layer, and the Floating Gate layer is wrapped by a high-impedance material and insulated from top to bottom, so that charges can be stored, and the data of the SSD is not easy to lose. From the technical parameters, the SSD has advantages of good performance, low power consumption, good shock resistance and falling resistance compared to the HDD, but the HDD currently has an advantage in price, however, with the replacement and improvement of the SSD technology, the advantage of price will not exist in the future.
The storage medium of the solid state disk SSD mainly comprises Flash, RAM,3D XPoint and the like. NAND Flash has the following important characteristics:
1) flash physical block write-over disabled
The inability to overwrite means that the flash memory must first erase the data in the block to write the new data to the original location. Therefore, in order to increase the speed of the flash memory, the concept of valid data and invalid data is introduced, that is, when new data needs to be written, the original data block is not erased, the new data is written into a new page position, the data is marked as valid data, and the original data is invalid data. However, as the system operates, the valid data increases, and the invalid data continues to increase and become garbage data. The existence of Garbage data enables the storage space of the flash memory to be continuously reduced, so that the whole system is forced to perform Garbage Collection operation, namely Garbage Collection (GC). The essence of the garbage collection operation is to move valid data in the flash block to a new free block and erase the flash block, thereby freeing up new storage space.
2) Flash memory block with threshold erase operation
Due to the physical characteristics of flash memory, a single physical block of flash memory will be exhausted in life and become a bad block after multiple erasures. This means that when the solid state disk system is operated daily, a small part of blocks cannot be looked at for centralized operation, otherwise, the small part of flash memory blocks will become bad blocks in a short time, and the system performance is reduced or even the system is scrapped. Therefore, the whole solid state disk system needs to add a Wear Leveling mechanism (Wear Leveling) which needs to ensure that the real-time update of the data is evenly distributed to each flash memory block.
3) Hot data and cold data
Hot data refers to a particular data or group of data stored in a solid state disk system that is characterized by frequent updates that may occur in the past or in the future. Cold data is the inverse of hot data, i.e., data that is updated infrequently or even not over a long period of time. The existence of the cold and hot data enables a wear leveling mechanism to avoid the long-term retention of the cold data in a flash memory block and the frequent updating of the hot data among the flash memory blocks in a small range while considering uniform erasing and writing. Both long-term retention of cold data and locally frequent updates of hot data will cause an increase in the erasure variance between flash blocks.
4) Read-write amplification of solid state disk
The read-write amplification of the solid state disk refers to the number of extra read-write operations required to be added when one read-write operation is completed, compared with the normal read-write operation. Read-write amplification generally derives from three aspects: firstly, when reading and writing once, the updating of the mapping table is involved. Because the memory space of the solid state disk cannot store the mapping table entry of the whole hard disk, when one read-write operation hits an address outside the memory mapping table entry, an additional read-write operation is required to update the mapping table entry in the memory, thereby causing read-write amplification. Secondly, when reading and writing once, the garbage recycling operation is triggered. When the read-write operation is finished and the next read-write operation is to arrive, the threshold set by the system is reached so as to trigger garbage collection, and then the system carries out effective data transfer and erasing operation on a specific flash memory block, so that the large read-write amplification is caused. And thirdly, triggering the wear leveling operation when the erasing variance of the system flash memory block reaches a threshold value. The system is characterized in that the erasing times of the flash memory blocks are balanced, the hot data are moved into the blocks which have less erasing times and store the cold data collectively, and the cold data are moved into the blocks which have more erasing times and store the hot data. This extra move operation will also cause a lot of read and write amplification.
5) Super block
Flash blocks are wrapped in a plane structure (600) of a solid state disk, typically a plane having tens or even hundreds of flash blocks, and a solid state disk containing several planes. In the traditional process of reading and writing data of the solid state disk, reading and writing operations according to the sequence of blocks are adopted, the reading and writing of the previous data and the next data are concentrated in a flash memory block or a plane, and the design does not fully utilize the cache in the plane, because when a system writes the data into or reads the data block, the data needs to be firstly transferred into the cache and then interacts with the outside through the cache. If the front and back read-write operations are all concentrated in one plane, the whole solid state disk system cannot perform any operation when data enters the cache and then is taken out from the cache. The creation of a superblock solves this problem by grouping a certain number of flash blocks of different planes into a superblock and converting all operations on the blocks into operations on the whole superblock. For example, after writing data into the cache of one flash block, the next time data is written into the cache of another plane's flash block, while the first flash block writes the cached data into the actual storage medium.
From recent research, the super block architecture has entered the research field of various colleges and universities and the research and development field of enterprises due to its unique read-write advantages. However, the conventional solid state disk architecture still has the phenomena that the wear leveling effect is not obvious, the performance is seriously affected due to overlarge reading and writing amplification, and even under the new super block architecture, the requirement on the wear leveling method is necessarily more innovative and practical. The balance effect of the wear balance method is improved, and the read-write amplification phenomenon of the wear balance method is improved, so that the goals of various scholars are constantly pursued.
Disclosure of Invention
In order to solve the problems that the traditional wear leveling method has an unobvious effect and the performance is seriously affected due to overlarge reading and writing amplification in the conventional super block architecture, the invention provides a Solid State Disk (SSD) double-area wear leveling processing method based on a super block. Compared with the existing wear-leveling method for the solid state disk, the method disclosed by the invention integrates the existing super block structure (D) into the wear-leveling method, and creatively provides the super block-based dual-region processing method (C) at the same time, so that the method ensures that hot data is recycled into a cold data block during garbage recycling, and the wear-leveling method is integrated into the garbage recycling.
The invention also provides a spare area replacement mechanism in consideration of the condition of excessive effective data in a physical block during garbage collection processing. The physical block with more effective data is replaced by the spare block (700), and meanwhile, an index linked list (G) capable of being increased and deleted is established in the memory to store effective information (800,900 and 1000) of the replacement block and the original block, so that the method for preventing the effective data from being transferred to a plurality of blocks and realizing garbage collection is realized, the data transfer operation during garbage collection is further reduced, the performance is improved, and meanwhile, the degree of wear is reduced.
In order to achieve the purpose, the invention adopts the following technical scheme:
a Solid State Disk (SSD) double-area wear leveling processing method based on a super block comprises the following steps:
step 1: dividing a plane in the solid state disk SSD into a plane for storing hot data blocks and a plane for storing cold data blocks, and dividing the solid state disk SSD into an area A and an area B, wherein the area A and the area B have the same plane number;
step 2: dividing the area A and the area B into a plurality of super blocks respectively, wherein each super block consists of one physical block in all planes in one area, the block head of the super block in the area A is a hot data block, and the block head of the super block in the area B is a cold data block;
and step 3: establishing a spare area replacement mechanism, and when the super block triggers garbage collection, firstly judging whether spare area replacement needs to be carried out on the garbage collection blocks in the super block; if yes, triggering a spare area replacement mechanism, otherwise not triggering;
and 4, step 4: establishing a garbage collection mechanism, transferring the hot data in the super block needing garbage collection to the cold data block in another area, transferring the cold data in the super block needing garbage collection to the hot data block in another area, erasing the super block needing garbage collection, and placing the super block in another area for standby.
Further, the spare area replacement mechanism specifically includes:
when the super block triggers garbage collection, the cold data block and the hot data block contained in the super block are called as garbage collection blocks, whether the garbage collection blocks in the super block need to be replaced by spare areas or not is judged at first, and the judgment conditions are as follows:
Figure BDA0002465508190000041
wherein P isvFor the effective number of pages, P, of one of the garbage collection blocks in a super blockaThe total page number of all garbage collection blocks in the super block is represented by beta as a proportional parameter; if the formula is established, a spare area replacement block in the same plane as the garbage collection block needs to be selected for replacement, the spare area replacement block and other garbage collection blocks which are not replaced serve as new super blocks, and the step 4 is entered into garbage collection operation; if the formula is not satisfied, the spare area is not required to be replaced, and the step 4 is directly entered;
further, the garbage recycling mechanism is specifically as follows:
when the superblock needing garbage collection is located in the area A (B), selecting an idle superblock in the area B (A) as an effective data transfer destination block, transferring hot data in the superblock needing garbage collection in the area A (B) into a cold data block of the idle superblock in the area B (A), transferring cold data in the superblock needing garbage collection in the area A (B) into the hot data block of the idle superblock in the area B (A), taking the idle superblock in the area B (A) after data transfer as an area A (B) superblock, then erasing the superblock needing garbage collection in the area A (B), and putting the superblock into the area B (A) to serve as an idle superblock for standby;
minimum hot data block erase times N for superblocks performing garbage collectionhe-minThe following requirements are met:
(A,B)Nhe-min>(B,A)Nce-max+λ*(elimit-ebmax)/(B,A)Nce-max
wherein N isheRepresenting the number of erasures of a hot data block, NceRepresenting the number of times of erasing of the cold data block, (A, B) Nhe-minRepresenting the minimum hot data block erasure times in the superblock of zone A (zone B), (B, A) Nce-maxRepresenting the maximum number of cold block erasures in the superblock of zone B (zone A), λ being the adjustment factor, elimitRepresenting the number of physical block erase limits set by the system, ebmaxRepresenting the maximum number of physical block erasures in the system.
The effective benefits of the invention are:
1) the invention integrates the super block structure into the wear leveling method, and carries out double-area processing based on the super block, namely, the SSD is divided into an area A and an area B, the area A and the area B have the same plane number, and a physical block is taken from all planes in one area to form a super block, so that the number of the physical blocks in each super block is the same. And cold data blocks and hot data blocks are arranged in a specified super block in a crossed manner, the block head of the super block in the area A is a hot data block, and the block head of the super block in the area B is a cold data block. Thus, when cold and hot data are separated, according to the double-zone mode of the system, the hot data/cold data of the super block in the zone A can be moved into the cold data/hot data block of the super block in the zone B, and the hot data/cold data of the super block in the zone B can be moved into the cold data/hot data block of the super block in the zone A, and double-zone circulation is performed, so that a more ideal cold and hot data separation effect is achieved. Therefore, by the wear leveling processing method, the cold and hot data processing operation in wear leveling can be realized during garbage recovery, so that the system loss caused by the separation of the cold and hot data during operation is saved.
2) The present invention proposes a spare area replacement mechanism. If a large amount of effective data exists in the garbage collection block, no matter how good the separation effect of cold and hot data is, the additional read-write times caused in practice are still very large. For this situation, the spare area replacement mechanism may determine whether the spare area replacement block needs to be replaced by the spare area replacement block before performing garbage collection, and if so, select a spare area replacement block in the same plane as the garbage collection block to replace (the replacement block may be directly located by the physical address of the original block and the arrangement number of the replacement block, which is convenient for subsequent read-write operations), and use the spare area replacement block and other garbage collection blocks that are not replaced as new super blocks to perform the next garbage collection operation. The mechanism can guarantee that garbage recovery is realized under the condition that a plurality of blocks are not transferred by effective data, system loss caused by a large amount of effective data in the physical blocks is effectively treated, data transfer operation during garbage recovery is reduced, and the degree of wear is reduced while the performance is improved.
3) The spare area replacement mechanism provided by the invention is provided with a trigger condition, and judges whether a process needing to be executed is regarded as the trigger condition of the spare area replacement mechanism, the trigger condition can be flexibly set according to different application scenes, and the specific formula is as follows:
Figure BDA0002465508190000051
Pvfor the effective number of pages, P, of one of the garbage collection blocks in a super blockaBeta is a proportional parameter, the larger the beta parameter,
Figure BDA0002465508190000052
the smaller the value is, the higher the trigger frequency of the replacement mechanism is relative to the whole system, and since the trigger of the mechanism can improve the performance and the service life of the system, but more replacement blocks are needed to complete the mechanism, the beta parameter can be increased under the scenes that the requirements on the performance and the service life are high and the storage capacity is large and sufficient. On the contrary, the smaller the beta parameter is,
Figure BDA0002465508190000053
the larger the value is, compared with the whole system, the replacement mechanism has lower trigger frequency, smaller requirement on the number of replacement blocks, and reduced contribution to improving the performance and the service life of the system, so that the beta parameter can be reduced in some scenes with low requirements on the performance and the service life and smaller storage capacity. The setting of the trigger condition ensures the wide application of the mechanism.
Drawings
FIG. 1 is a general framework diagram of a Solid State Disk (SSD) dual-area wear leveling method based on superblocks;
FIG. 2 is a plan structure diagram of a solid state disk SSD;
FIG. 3 is a superblock map;
FIG. 4 is a schematic diagram of a dual-zone wear leveling process based on superblocks;
FIG. 5 is a schematic diagram of a spare area replacement mechanism;
in the figure: a: a double-area wear-balanced area A, wherein each super block head is a thermal data block;
b: a B area with balanced double-area wear, wherein the head of each super block is a cold data block;
c: representing a cold-hot data dual-zone exchange operation;
d: representing a super block composition structure schematic diagram;
e: representing a spare area replacement operation;
f: dividing a standby area;
g: representing the mapping chain table structure of the replacement block and the original physical block;
100: pages with effective data stored in the physical blocks;
200: a page within the physical block storing invalid data;
300: a hot data block that performs dual zone wear leveling;
400: performing a cold data block of dual zone wear leveling;
600: represents a plane;
700: replacing blocks in a spare area in a plane structure;
800: the physical address of the replaced physical block;
900: the serial number of the spare area replacement block can find the physical address of the spare area replacement block;
1000: the number of valid data pages of the physical block being replaced.
Detailed Description
The invention is further illustrated with reference to the following figures and examples. The technical features of the embodiments of the present invention can be combined correspondingly without mutual conflict.
The overall system framework of the method for balancing the wear of the dual-area of the solid state disk is shown in fig. 1, and the block structure (hot data block 300, cold data block 400), the spare area replacement block 700, and the plane 600 form a physical unit. The logical structure is composed of double-zone division (A zone and B zone), cold and hot data double-zone exchange operation C, super block D, spare zone replacement operation E and spare zone division F.
Block entity division
The solid state disk SSD is divided into a dual area A and a dual area B, wherein the dual area A and the dual area B have the same plane number, and a super block D is defined to be composed of one of all planes 600 in one area (one block refers to a hot data block 300 or a cold data block 400).
Second, dislocation cold and hot data arrangement
As shown in fig. 3, the super block D is defined to be arranged with the cold data blocks 400 and the hot data blocks 300 arranged in a cross from left to right. The block header of the superblock in area a is specified as a hot data block 300, and the block header of the superblock in area B is specified as a cold data block 400. The super block is formed by combining a certain number of physical blocks of different planes into a super block, and all operations on one physical block are converted into operations on the whole super block. For example, after writing data into the buffer memory of one physical block, the next time data is written into the buffer memory of another physical block of the plane, and at the same time the first physical block writes the buffered data into the actual storage medium.
As shown in fig. 2, the planes in the SSD are divided into a plane storing hot data blocks and a plane storing cold data blocks by the above-described operations, and in fig. 1, the number of the planes storing hot data and the planes storing cold data in the a and B areas is equal.
Hot data refers to a particular data or group of data stored in a solid state disk system that is characterized by frequent updates that may occur in the past or in the future. Cold data is the inverse of hot data, i.e., data that is updated infrequently or even not over a long period of time. The existence of the cold and hot data enables a wear leveling mechanism to avoid the long-term retention of the cold data in a flash memory block and the frequent updating of the hot data among the flash memory blocks in a small range while considering uniform erasing and writing. Both long-term retention of cold data and locally frequent updates of hot data will cause an increase in the erasure variance between flash blocks.
Three, dislocation cold and hot data transfer
In the operation process of the solid-state system, when new valid data cannot be stored in one super block D, a garbage collection mechanism is started, the valid data in the super block is moved into the new super block, and cold data blocks and hot data contained in the super block which needs to perform garbage collection operation are collectively called as garbage collection blocks. As shown in fig. 4, according to the dual-region wear leveling method of the present invention, if the superblock in the region a enters the garbage collection mode, the spare superblock in the region B is selected as the valid data storage target, and the selected target needs to satisfy the following condition (i):
Figure BDA0002465508190000081
wherein N isheRepresenting the number of erasures of a hot data block, NceRepresenting the number of erasures of a cold data block, ANhe-minRepresenting the minimum number of erasures, BN, of hot data blocks in the superblock of zone Ace-maxRepresenting the maximum number of times of erasing cold data blocks in the super block of the B area; λ is the adjustment factor, elimitRepresenting the limit number of times of erasing of the physical block set by the system, ebmaxRepresenting the maximum number of erasures of a physical block in the system. Wherein the function of lambda is to regulate (e)limit-ebmax)/BNce-maxIs made to be in an exponential order with BNce-maxUnder the same exponential level. Prevention of cause (e)limit-ebmax)/BNce-maxMisjudgment due to excessive value, e.g. at early stage of system elimitIs 105-106Index rating, and ebmaxUsually in the range of 10-102Index grade, BNce-maxIs also in the range of 10-102Exponential order, where λ can be taken to be 10-2,10-3The plus right is at the same or lower 1 index level. As long as one of the values is in accordance, the target is judged to meet the condition.
The formula of the first condition is satisfied, and the maximum erasing times of the cold data block 400 in the free super block selected in the B area is ensured to be less than the minimum erasing times of the hot data block 300 in the super block in the A area, so that the garbage collection is ensured not to transfer the hot data into a physical block with higher abrasion degree.
After the free superblock in zone B is selected, the hot data in the superblock in zone a is moved into the cold data block 400 of the free superblock in zone B, and the cold data in the superblock in zone a is moved into the hot data block 300 of the free superblock in zone B. After the data movement is completed, the A-zone superblock is erased and added to the B-zone to serve as a free superblock for use.
If the super block of the B area enters the garbage collection mode, the similar process is executed, the hot data of the B area is transferred into the cold data block 400 of the super block of the A area, the cold data of the B area is transferred into the hot data block 300 of the A area, and finally the super block of the B area is erased and put into the A area to serve as a spare super block for standby. The spare super block in the area A needs to satisfy the similar condition of formula II:
Figure BDA0002465508190000082
wherein N isheRepresenting the number of erasures of a hot data block, NceRepresenting the number of erasures, BN, of cold data blockshe-minRepresenting the minimum number of erasures, AN, of hot data blocks in the B-zone superblockce-maxRepresents the maximum erasing times of cold data block in the super block of the area A, lambda is the regulating factor, elimitRepresenting the limit number of times of erasing of the physical block set by the system, ebmaxRepresenting the maximum number of erasures of a physical block in the system.
λ (e) in the above formulas (r) and (g)limit-ebmax)/(B,A)Nce-maxAs a balance factor, a prevention threshold value (N)he-minAnd Nce-max) Too close to cause poor abrasion effect; e.g. of the typelimit-ebmaxSubtracting the maximum block erasing times from the limit block erasing times to ensure that the selection of the idle super block is wider and more uniform; divided by Nce-maxIt is ensured that superblocks with smaller erase times have a higher probability of being selected.
Spare area replacement mechanism
Through the two-zone wear leveling example described in the second and third paragraphs, migration of hot and cold data and garbage collection operation can be fused, however, if a large amount of valid data exists in one block (hot data block 300 or cold data block 400), no matter how good the hot and cold data are separated, the additional read-write times actually caused are still very large.
In view of the above limitations, the present invention provides a spare area replacement mechanism, which first determines whether the garbage collection mechanism needs to be started before starting the garbage collection mechanism.
In one embodiment of the present invention, if a large amount of valid data exists in the garbage collection block as shown in E of fig. 1, it is first determined whether a spare area replacement operation is required according to the following formula,
Figure BDA0002465508190000091
wherein P isvIs valid for physical blocksNumber of pages, PαBeta is a proportional parameter for the total number of physical blocks.
If the formula is satisfied, a spare area replacement mechanism is started, and if the formula is not satisfied, replacement operation is not performed, wherein beta is an adjustable parameter and is different according to different application scenes. For example, the beta parameter value enables the effective page number to be more than 20% of the total page number to trigger the replacement mechanism, and compared with the whole system, the replacement mechanism has higher triggering frequency, greatly prolongs the performance life of the system, but has high requirements on the number of the replacement blocks, and is suitable for scenes with high requirements on the performance life and large and sufficient storage capacity. And when the beta parameter value is taken, the effective page number accounts for more than 80% of the total page number to trigger the replacement mechanism, compared with the whole system, the replacement mechanism has lower triggering frequency and smaller promotion on the performance life of the system, but has small requirement on the number of the replacement blocks, and is suitable for scenes with low performance life requirement and smaller storage capacity.
When the condition (c) is satisfied, the flash memory system replaces the garbage collection block by finding a spare area replacement block (e.g., a frame structure shown in fig. 1E) in the same plane as the garbage collection block, and the spare area replacement block and other garbage collection blocks that are not replaced form a new super block and participate in the garbage collection mechanism.
In one embodiment of the present invention, after the spare area replacement block is selected to replace the garbage collection block, a one-way linked list structure G as shown in fig. 5 may be established in the memory. Each node N in the chain tabledExpressed as:
Nd={pbn,r,num_vaild}
the linked list stores the physical address pbn 800 of the original block (physical block for which the replacement mechanism needs to be executed), the spare area replacement block arrangement number r 900, and the number num _ changed 1000 of the valid data of the original block, where the physical address of the spare area replacement block can be locked by r. The linked list actually works as follows:
1. when the read operation hits the original block
The data is read directly from the original block without creating additional flash operations.
2. When the write operation hits the original block
The physical address of the replacement block of the spare area is found through the linked list, written into the replacement block, and num _ changed in the linked list is reduced by 1. And when num _ variable is reduced to 0, erasing the original block, adding the original block into the spare area replacement block, deleting the current linked list node, releasing the memory space, and ensuring that the linked list cannot be infinitely increased along with the operation of the system.
Note: since the presence of the flash map ensures that the write operation misses the valid data page in the hit block (modify data operation), the write operation hit invalid data page is not treated as a case.
By integrating the above examples, the double-zone wear leveling method ensures that the cold and hot data separation effect is realized simultaneously during garbage collection through the unique double-zone structures A and B, and the method processes the application scene with excessive effective data through the spare block replacement mechanism, so that the effects of reducing extra reading and writing, improving the system performance, balancing and reducing the wear degree are achieved on the whole, and the method is widely applicable to the application scene with higher requirements on the flash memory performance life.
Examples
The present embodiment is used to show a specific implementation effect, and the block entity division, the staggered hot and cold data arrangement, the staggered hot and cold data transfer, and the spare area replacement mechanism in the present embodiment all adopt the rules and functions described above, which are not described herein again.
In combination with the above example, the invention adopts C language to build a solid state disk simulation platform, build a plane, a physical block, a super block, and a flash memory read-write-erase operation bottom structure unit, and specify basic time consumption information (table 1) of the flash memory read-write-erase operation, wherein the time consumption of the write operation across the super block means that front and back write operations hit in different super blocks, and the flash memory system needs additional read-write operations to update a mapping table of a memory, and compared with the conventional write operation, the invention has more overhead of one-time read operation and one-time write operation.
The invention compares the average time consumption of a general wear leveling method, a double-zone wear leveling method and a double-zone spare zone replacement method under the condition of certain writing times and the erasing variance of a physical block of a system. The method and the device intuitively embody the improvement of the performance and the service life of the solid state disk. The general wear leveling method is represented by a double-pool wear leveling method with a cold and hot data separation idea, the method focuses on dividing a system into a hot data pool and a cold data pool, and the wear leveling effect is achieved by moving cold and hot data in the system operation process; the dual-area wear leveling method comprises the dual-area structure of the invention, and the dual-area spare area replacement method is based on the dual-area wear leveling method and adds the spare area replacement method into the dual-area wear leveling method.
TABLE 1 basic time consumption information
Figure BDA0002465508190000111
Table 2 comparative data
Figure BDA0002465508190000112
The data in table 2 shows the average time consumption of the general wear leveling method, the dual-zone wear leveling method, and the dual-zone spare replacement method as compared to the total block erase variance as the write operation of the solid state disk system is run. It can be seen that when the write operation is performed ten million times or million times, since the general wear leveling method does not reach the condition enabling leveling algorithm, the average time consumption and the erase variance are not different from those of the dual-zone wear leveling method, but the dual-zone spare-zone replacement method does not trigger the data moving operation and the erase operation when part of the blocks transfer data, so that the average time consumption and the erase variance are slightly ahead.
When the write operation reaches thousands of times, the general wear leveling method triggers the leveling algorithm, thereby generating additional read and write operations. As can be seen from table 2, the average time consumption and the erasure variance of the general wear leveling method and the two-zone wear leveling method in ten million times are different, but the difference is not obvious because the range triggered by the general wear leveling method is still small. When the write operation reaches the level of hundreds of millions, billions and billions, the frequency and the range of the triggering equalization algorithm of the common wear equalization method are gradually increased, so that the statistical data are obviously different from those of the double-zone wear equalization method, and the double-zone wear equalization method has better average time delay and erasure variance. After the spare area replacement method is added, it can be seen that the delay and variance are further improved.
The foregoing lists merely illustrate specific embodiments of the invention. It is obvious that the invention is not limited to the above embodiments, but that many variations are possible. All modifications which can be derived or suggested by a person skilled in the art from the disclosure of the present invention are to be considered within the scope of the invention.

Claims (5)

1. A Solid State Disk (SSD) double-area wear leveling method based on a super block is characterized by comprising the following steps:
step 1: dividing a plane in the solid state disk SSD into a plane for storing hot data blocks and a plane for storing cold data blocks, and dividing the solid state disk SSD into an area A and an area B, wherein the area A and the area B have the same plane number;
step 2: dividing the area A and the area B into a plurality of super blocks respectively, wherein each super block consists of one physical block in all planes in one area, the block head of the super block in the area A is a hot data block, and the block head of the super block in the area B is a cold data block;
and step 3: establishing a spare area replacement mechanism, and when the super block triggers garbage collection, firstly judging whether spare area replacement needs to be carried out on the garbage collection blocks in the super block; if yes, triggering a spare area replacement mechanism, otherwise not triggering; the method specifically comprises the following steps:
when the super block triggers garbage collection, the cold data block and the hot data block contained in the super block are called as garbage collection blocks, whether the garbage collection blocks in the super block need to be replaced by spare areas or not is judged at first, and the judgment conditions are as follows:
Figure FDA0002952183820000011
wherein, PvIs one of the super blocksEffective number of pages, P, of individual garbage collection blocksaThe total page number of all garbage collection blocks in the super block is represented by beta as a proportional parameter; if the formula is established, a spare area replacement block in the same plane as the garbage collection block needs to be selected for replacement, the spare area replacement block and other garbage collection blocks which are not replaced serve as new super blocks, and the step 4 is carried out to carry out garbage collection operation; if the formula is not satisfied, the spare area is not required to be replaced;
and 4, step 4: establishing a garbage collection mechanism, transferring the hot data in the super block needing garbage collection to the cold data block in another area, transferring the cold data in the super block needing garbage collection to the hot data block in another area, erasing the super block needing garbage collection, and placing the super block in another area for standby.
2. The method as claimed in claim 1, wherein the number of planes storing hot data blocks and the number of planes storing cold data blocks in the areas a and B are equal.
3. The method according to claim 1, wherein the spare area replacement mechanism in step 3 further includes:
when the spare area replacement block is selected to replace the garbage collection block, a chained list is established in the system memory, and each node N in the chained listdExpressed as:
Nd={pbn,r,num_vaild}
pbn represents the physical address of the physical block that needs to execute the replacement mechanism, r is the arrangement number of the replacement blocks in the spare area, and num _ changed is the effective page number of the physical block that needs to execute the replacement mechanism;
if the effective page of the physical block executing the spare area replacement mechanism needs to be updated, marking the page as invalid, writing new data into the spare area replacement block, and subtracting 1 from num _ changed in the node; when num _ changed is 0, deleting the node and adding the physical block into an erasure queue;
and if the read operation is executed, directly reading the data of the original physical block.
4. The method for processing the SSD dual-area wear leveling of the solid state disk based on the superblock according to claim 1, wherein the step 4 specifically comprises:
a. when the super block needing garbage collection is located in the area A, selecting an idle super block in the area B as an effective data transfer destination block; the selection conditions of the free super blocks in the B area are as follows:
Figure FDA0002952183820000021
wherein N isheRepresenting the number of erasures of a hot data block, NceRepresenting the number of erasures of a cold data block, ANhe-minRepresenting the minimum number of hot block erasures, BN, in the superblock of zone Ace-maxRepresents the maximum number of cold data block erasures in the super block of the B area, lambda is the adjustment factor, elimitRepresenting the number of physical block erase limits set by the system, ebmaxRepresenting the maximum number of physical block erasures in the system;
transferring hot data in a superblock needing garbage recovery in an area A into a cold data block of an idle superblock in an area B, transferring cold data in the superblock needing garbage recovery in the area A into a hot data block of the idle superblock in the area B, taking the idle superblock in the area B after data transfer as the superblock in the area A, then erasing the superblock needing garbage recovery in the area A, and putting the superblock in the area B as the idle superblock for standby;
b. when the super block needing garbage collection is located in the area B, selecting the idle super block in the area A as an effective data transfer destination block; the selection conditions of the free super block of the area A are as follows:
Figure FDA0002952183820000022
wherein the content of the first and second substances,BNhe-minrepresenting the minimum number of hot block erasures in the B-zone superblock, ANce-maxRepresenting the maximum number of cold data block erasures in the superblock of the area A;
and transferring cold data in the superblock needing garbage recovery in the B area to a hot data block of an idle superblock in the A area, transferring hot data in the superblock needing garbage recovery in the B area to a cold data block of the idle superblock in the A area, taking the idle superblock in the A area after data transfer as the superblock in the B area, then erasing the superblock needing garbage recovery in the B area, and putting the superblock in the A area as the idle superblock for standby.
5. The method for the SSD double-area wear leveling processing based on the super block as claimed in claim 4, wherein λ is 10-2Or 10-3
CN202010332619.8A 2020-04-24 2020-04-24 Solid State Disk (SSD) double-area wear leveling method based on super block Expired - Fee Related CN111708481B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010332619.8A CN111708481B (en) 2020-04-24 2020-04-24 Solid State Disk (SSD) double-area wear leveling method based on super block

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010332619.8A CN111708481B (en) 2020-04-24 2020-04-24 Solid State Disk (SSD) double-area wear leveling method based on super block

Publications (2)

Publication Number Publication Date
CN111708481A CN111708481A (en) 2020-09-25
CN111708481B true CN111708481B (en) 2021-04-06

Family

ID=72536684

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010332619.8A Expired - Fee Related CN111708481B (en) 2020-04-24 2020-04-24 Solid State Disk (SSD) double-area wear leveling method based on super block

Country Status (1)

Country Link
CN (1) CN111708481B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112214168B (en) * 2020-09-27 2022-10-11 湖南智存合壹信息科技有限公司 Method for setting cold and hot data of solid state disk and data storage system
CN115712386A (en) * 2021-08-23 2023-02-24 华为技术有限公司 Super block management method and device
CN114064516B (en) * 2021-11-16 2022-08-30 深圳市时创意电子有限公司 Data processing method and device, computer equipment and storage medium
CN114924690B (en) * 2022-02-23 2024-04-19 华东师范大学 Method for optimizing read performance of flash memory based on unbalanced wear
CN116382598B (en) * 2023-06-05 2023-09-08 深圳大普微电子科技有限公司 Data moving method, flash memory device controller and flash memory device
CN117472590B (en) * 2023-12-27 2024-03-19 苏州元脑智能科技有限公司 Storage scheduling method, storage scheduling component, storage device, computer equipment and medium
CN117806573A (en) * 2024-03-01 2024-04-02 山东云海国创云计算装备产业创新中心有限公司 Solid state disk searching method, device, equipment and medium
CN117873406A (en) * 2024-03-11 2024-04-12 武汉麓谷科技有限公司 Method for controlling wear balance of ZNS solid state disk

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102866956A (en) * 2012-09-14 2013-01-09 上海宝存信息科技有限公司 System and method for data real-time tracking and storage based on solid-state storage medium
CN110658995A (en) * 2019-09-05 2020-01-07 苏州浪潮智能科技有限公司 Solid state disk, configuration data management method and device thereof, and storage medium
WO2020073233A1 (en) * 2018-10-10 2020-04-16 Alibaba Group Holding Limited System and method for data recovery in parallel multi-tenancy ssd with finer granularity

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105335098B (en) * 2015-09-25 2019-03-26 华中科技大学 A kind of log file system performance improvement method based on storage level memory

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102866956A (en) * 2012-09-14 2013-01-09 上海宝存信息科技有限公司 System and method for data real-time tracking and storage based on solid-state storage medium
WO2020073233A1 (en) * 2018-10-10 2020-04-16 Alibaba Group Holding Limited System and method for data recovery in parallel multi-tenancy ssd with finer granularity
CN110658995A (en) * 2019-09-05 2020-01-07 苏州浪潮智能科技有限公司 Solid state disk, configuration data management method and device thereof, and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
面向3D NAND 闪存的数据分配和管理算法研究;卢祚;《中国优秀硕士学位论文全文数据库信息科技辑》;20200315;正文58-66页 *

Also Published As

Publication number Publication date
CN111708481A (en) 2020-09-25

Similar Documents

Publication Publication Date Title
CN111708481B (en) Solid State Disk (SSD) double-area wear leveling method based on super block
US11893238B2 (en) Method of controlling nonvolatile semiconductor memory
CN107193646B (en) High-efficiency dynamic page scheduling method based on mixed main memory architecture
TWI489373B (en) Data storage device and method for managing blocks of a flash memory
CN106547703A (en) A kind of FTL optimization methods based on block group structure
CN106294197B (en) Page replacement method for NAND flash memory
JP2014517425A (en) Block management configuration of SLC / MLC hybrid memory
CN111984188B (en) Management method and device of hybrid memory data and storage medium
CN110413537B (en) Flash translation layer facing hybrid solid state disk and conversion method
CN103136121A (en) Cache management method for solid-state disc
CN103688246A (en) A non-volatile memory and a method with small logical groups distributed among active SLC and MLC memory partitions
CN110688326A (en) Flash memory wear leveling algorithm based on multiple thresholds
CN109471594B (en) M L C flash memory read-write method
CN105389135A (en) Solid-state disk internal cache management method
CN108845957B (en) Replacement and write-back self-adaptive buffer area management method
TW201917581A (en) Method for managing flash memory module and associated flash memory controller
KR101403922B1 (en) Apparatus and method for data storing according to an access degree
CN111580754B (en) Write-friendly flash memory solid-state disk cache management method
CN111352593B (en) Solid state disk data writing method for distinguishing fast writing from normal writing
Lin et al. Dynamic garbage collection scheme based on past update times for NAND flash-based consumer electronics
CN112130749B (en) Data storage device and non-volatile memory control method
US11249920B2 (en) Non-volatile memory device using efficient page collection mapping in association with cache and method of operating the same
CN113010091B (en) Method for writing data into solid state disk, method and device for recycling garbage
CN115827511A (en) Method and device for setting cache
Forouhar et al. DA-FTL: Dynamic associative flash translation layer

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
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20210406