CN111124305A - Solid state disk wear leveling method and device and computer readable storage medium - Google Patents

Solid state disk wear leveling method and device and computer readable storage medium Download PDF

Info

Publication number
CN111124305A
CN111124305A CN201911328658.4A CN201911328658A CN111124305A CN 111124305 A CN111124305 A CN 111124305A CN 201911328658 A CN201911328658 A CN 201911328658A CN 111124305 A CN111124305 A CN 111124305A
Authority
CN
China
Prior art keywords
block
erasing
data
linked list
idle
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.)
Granted
Application number
CN201911328658.4A
Other languages
Chinese (zh)
Other versions
CN111124305B (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.)
Inspur Electronic Information Industry Co Ltd
Original Assignee
Inspur Electronic Information Industry 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 Inspur Electronic Information Industry Co Ltd filed Critical Inspur Electronic Information Industry Co Ltd
Priority to CN201911328658.4A priority Critical patent/CN111124305B/en
Publication of CN111124305A publication Critical patent/CN111124305A/en
Priority to PCT/CN2020/110986 priority patent/WO2021120665A1/en
Application granted granted Critical
Publication of CN111124305B publication Critical patent/CN111124305B/en
Active 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
    • G06F3/0616Improving the reliability of storage systems in relation to life time, e.g. increasing Mean Time Between Failures [MTBF]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • G06F12/0646Configuration or reconfiguration

Landscapes

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

Abstract

The application discloses a method and a device for wear leveling of a solid state disk and a computer readable storage medium. Constructing a plurality of idle block linked lists and dirty block linked lists which are prioritized by the erasing times of the data blocks, and classifying the data blocks into corresponding lists according to the erasing times, the block types and the allowable range of the erasing times; if an idle block linked list meeting the wear leveling condition exists, setting a reset label for a block corresponding to a data block with the lowest erasing frequency; if the block reset instruction of the host is not received within the specified time, taking the data block with the lowest erasing frequency in each dirty block chain table as a source data block, and taking the data block with the highest erasing frequency in each idle block chain table as a target data block for data transfer; when a request for applying for a data block is received, the data block is selected from the idle block chain table with the lowest erasing times, so that the wear balance of the solid state disk based on the ZNS protocol is realized, the wear balance of each data block in the solid state disk is favorably ensured, and the service life of the solid state disk is effectively prolonged.

Description

Solid state disk wear leveling method and device and computer readable storage medium
Technical Field
The present disclosure relates to wear leveling technologies, and in particular, to a method and an apparatus for wear leveling of a solid state disk, and a computer readable storage medium.
Background
With the rapid development of cloud computing and internet technologies, mass data are generated at all times in daily work and life and need to be stored, and the data storage technology is correspondingly developed to meet the actual storage requirement of explosively-increased data. The SSD (Solid State Drives) is a hard disk made of an array of Solid State electronic memory chips, and is composed of a control unit and a Solid State memory unit. Because of its stable performance, such as fast read-write speed and low energy consumption, it effectively overcomes many defects of mechanical hard disk, and is widely used.
The storage unit of the solid state disk comprises a plurality of data blocks (blocks), and the data blocks are the minimum erasing unit of the solid state disk. Because the solid state disk has no rewriting mechanism, after a data block is fully written with data, the data on the data block needs to be erased to write new data, the erasing frequency of each data block is limited, the service life of the solid state disk depends on the data block with the minimum service life, and in order to prolong the service life of the solid state disk, the erasing operation of each data block needs to be subjected to wear leveling so as to ensure that the erasing frequency of each data block is the same.
The host side and the solid state disk can cooperate based on a ZNS (Zoned Namespace) protocol. In the using process of the solid state disk, the host end is responsible for garbage recovery to improve the space utilization rate of the solid state disk, correspondingly, the solid state disk can move data due to wear balance, and in the data moving process, all data are effective data and need to be moved. Garbage collection refers to moving effective pages in several physical data blocks with full data to new idle physical data blocks, and then erasing the several source data blocks, thereby improving the space utilization rate of the solid state disk. In the garbage recycling process, the space recovery rate is considered, the continuous and rapid supply of idle blocks by the solid state disk energy source is ensured, and the wear times, namely the wear balance of the whole disk and the wear times of a single data block, are considered, so that the service life of the solid state disk is ensured.
In the related art, in the process of implementing wear leveling based on the ZNS protocol, when zoneopen (open block) applies for a new physical block, the physical block with a low erase count is not necessarily provided to the zoneopen, which results in uneven wear of each data block.
In view of this, how to implement wear leveling of a solid state disk based on a ZNS protocol is a technical problem to be solved by those skilled in the art.
Disclosure of Invention
The application provides a solid state disk wear leveling method, a solid state disk wear leveling device and a computer readable storage medium, which realize solid state disk wear leveling based on a ZNS protocol and effectively prolong the service life of a solid state disk.
In order to solve the above technical problems, embodiments of the present invention provide the following technical solutions:
an embodiment of the present invention provides a method for wear leveling of a solid state disk, including:
the method comprises the steps that a plurality of idle block linked lists and dirty block linked lists which are prioritized by the erasing times of data blocks and used for storing the data blocks are constructed in advance, and each data block is classified into the idle block linked list or the dirty block linked list based on the erasing times and the erasing average value difference, the block type and the erasing time allowable range corresponding to each list;
when detecting that an idle block linked list meeting the wear leveling condition exists, setting a reset label for a block corresponding to a data block with the lowest erasing times; if a block reset instruction issued by a host end is not received within a preset time threshold, taking a data block with the lowest erasing frequency in each dirty block linked list as a source data block, and taking a data block with the highest erasing frequency in each idle block linked list as a target data block for data transfer;
when a request for applying for a data block is received, selecting the data block from the idle block chain table with the lowest erasing times;
the erasing times of the data blocks in the same idle block linked list or dirty block linked list are within the same erasing time allowable range, and the number of the tables is determined based on a preset abrasion threshold value and the erasing mean value; the block types are a free block and a dirty data block.
Optionally, when it is detected that there is an idle block linked list that meets the wear leveling condition, setting a reset tag for a block corresponding to the idle block linked list with the lowest erase frequency as:
and when detecting that the total number of the data blocks contained in the free block chain table with the maximum value of the allowable range of the erasing times lower than the erasing average value is lower than a number threshold, setting a reset label for the block corresponding to the free block chain table with the lowest erasing times.
Optionally, when a request for applying for a data block is received, selecting a data block from the idle block chain table with the lowest erasing frequency as:
when a request for applying for a data block is received, determining a target idle block linked list with the lowest erasing times from each idle block linked list;
and feeding back the data block with the lowest erasing times in the target idle block linked list.
Optionally, before the pre-constructing a plurality of free block linked lists and dirty block linked lists that are prioritized by the number of times of erasing the data block and are used for storing the data block, the method further includes:
and randomizing the abrasion times of each data block in the solid state disk according to a block logic number randomization algorithm.
Optionally, after the pre-constructing a plurality of free block linked lists and dirty block linked lists that are prioritized by the number of times of erasing the data block and are used for storing the data block, the method further includes:
and after the erasing mean value changing instruction is received, adjusting the data blocks stored in each idle block chain table and each dirty block chain table based on the difference value between the current erasing times of the data blocks and the updated erasing mean value.
Optionally, the allowable range of the number of times of erasing of each free block linked list and each dirty block linked list is determined according to the wear threshold and the total number of the lists.
Another aspect of the embodiments of the present invention provides a solid state disk wear leveling apparatus, including:
the table pre-construction module is used for pre-constructing a plurality of idle block linked lists and dirty block linked lists which are prioritized by the erasing times of the data blocks and are used for storing the data blocks; the erasing times of the data blocks in the same idle block linked list or dirty block linked list are within the same erasing time allowable range, and the number of the tables is determined based on a preset abrasion threshold value and the erasing mean value;
the data block classification module is used for classifying each data block into an idle block linked list or a dirty block linked list based on the erasing times and the erasing average value difference, the block type and the erasing time allowable range corresponding to each table; the block types are idle blocks and dirty data blocks;
the wear leveling processing module is used for setting a reset label for a block corresponding to a data block with the lowest erasing frequency when detecting that an idle block linked list meeting a wear leveling condition exists; if a block reset instruction issued by a host end is not received within a preset time threshold, taking a data block with the lowest erasing frequency in each dirty block linked list as a source data block, and taking a data block with the highest erasing frequency in each idle block linked list as a target data block for data transfer;
and the data block providing module is used for selecting the data block from the idle block chain table with the lowest erasing times when a request for applying for the data block is received.
Optionally, the system further includes a table updating module, where the table updating module is configured to adjust the free block linked lists and the data blocks stored in the dirty block linked lists based on a difference between a current erasing frequency of the data block and an updated erasing mean value after receiving the erasing mean value changing instruction.
The embodiment of the present invention further provides a solid state disk wear leveling device, which includes a processor, where the processor is configured to implement the steps of the solid state disk wear leveling method according to any one of the preceding items when executing a computer program stored in a memory.
Finally, an embodiment of the present invention provides a computer-readable storage medium, where a solid state disk wear leveling program is stored on the computer-readable storage medium, and when being executed by a processor, the solid state disk wear leveling program implements the steps of the solid state disk wear leveling method according to any one of the foregoing embodiments.
The technical scheme provided by the application has the advantages that the data blocks are classified into different tables according to the difference between the erasing times and the erasing mean value to realize priority discrimination, repeated operation caused by comparison between every two data blocks is avoided, and the data block priority classification efficiency is improved; the data moving is realized by improving and exchanging the data blocks with low erasing times in the dirty block linked list and the data blocks with high erasing times in the idle block linked list, the total erasing times of the data blocks in the dirty block linked list is increased, the total erasing times of the data blocks in the idle block linked list is reduced, and the number of the data blocks which are lower than the average erasing times in the idle block linked list is increased, so that the data blocks with low erasing times can be provided all the time when zoneopen applies for the data blocks, the wear balance of the solid state disk based on the ZNS protocol is realized, the wear balance of each data block in the solid state disk is favorably ensured, and the service life of the solid state disk is effectively prolonged.
In addition, the embodiment of the invention also provides a corresponding implementation device and a computer readable storage medium for the solid state disk wear leveling method, so that the method has higher practicability, and the device and the computer readable storage medium have corresponding advantages.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the related art, the drawings required to be used in the description of the embodiments or the related art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for wear leveling of a solid state disk according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of another wear leveling method for a solid state disk according to an embodiment of the present invention;
fig. 3 is a structural diagram of an embodiment of a solid state disk wear leveling apparatus according to an embodiment of the present invention;
fig. 4 is a structural diagram of another specific embodiment of a solid state disk wear leveling device according to an embodiment of the present invention;
fig. 5 is a structural diagram of another embodiment of a solid state disk wear leveling device according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and claims of this application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "comprising" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may include other steps or elements not expressly listed.
Having described the technical solutions of the embodiments of the present invention, various non-limiting embodiments of the present application are described in detail below.
Referring to fig. 1, fig. 1 is a schematic flow chart of a method for wear leveling of a solid state disk according to an embodiment of the present invention, where the embodiment of the present invention includes the following:
s101: a plurality of idle block linked lists and dirty block linked lists which are prioritized by the erasing times of the data blocks and used for storing the data blocks are constructed in advance, and each data block is classified into the idle block linked list or the dirty block linked list based on the erasing times and the erasing average value difference, the block type and the erasing time allowable range corresponding to each list.
In the present application, there are a plurality of idle block linked lists and dirty block linked lists, each idle block linked list and each dirty block linked list have a unique priority level, and the priority levels of the lists are distinguished by the number of times of database erasure. Each priority level uniquely corresponds to a group of allowable range of erasing times, and the erasing times of the data blocks in the same idle block linked list or the same dirty block linked list are within the same allowable range of erasing times. Before the idle block linked list and the dirty block linked list are constructed, a wear threshold value is preset, the total number of the idle block linked list and the dirty block linked list can be determined according to the wear threshold value and the erase mean value, the total number of the idle block linked list and the total number of the dirty block linked list can be the same or different, and the method is not limited at all. Of course, after the number of tables is determined, the allowable range of the erasing times of each free block linked list and each dirty block linked list can be determined according to the wear threshold and the total number of the tables.
It can be understood that after the free block chain table and the dirty block chain table are constructed, the free block chain table is used for storing free data blocks, where a free data block refers to a data block whose data block is empty or has a free space capacity to accommodate data, and these data blocks may be new data blocks, that is, data blocks that have not been subjected to an erase operation, or data blocks that have undergone multiple erase operations; the free block chain table is used for storing dirty data blocks, where a dirty data block refers to a data block in which data is written, and the data block may be a data block in which data is newly written full, that is, a data block in which an erase operation is not performed, or a data block in which multiple erase operations are performed. The total number of the data blocks stored in each free block chain table and each dirty block chain table can be determined according to an actual application scenario, which is not limited in this application. Because the priority levels of each idle block linked list and each dirty block linked list are distinguished based on the erasing times of the data blocks, and correspondingly, each idle block linked list and each dirty block linked list correspond to a unique erasing time allowable range, the data blocks can be classified into the idle block linked list or the dirty block linked list based on the erasing times and the erasing average value difference, the block type and the erasing time allowable range corresponding to each list, wherein the block type is an idle block and a dirty data block.
For example, the wear threshold is 100, and according to the threshold limit of wear leveling distance average 100, that is, 100 < the wear count of the current data block-the erase average < 100, the total number of tables of the idle block linked list and the dirty block linked list may be 20, that is, 20 priorities may be set for the idle block linked list and the dirty block linked list, each priority may include 10 PEs, based on which, the allowable range of the erase count of the first idle block linked list may be 0 to 10, the allowable range of the erase count of the second idle block linked list may be 10 to 20, the allowable range of the erase count of the third idle block linked list may be 20 to 30, the allowable range of the erase count of the fourth idle block linked list may be 30 to 40, the allowable range of the erase count of the fifth idle block linked list may be 40 to 50, and the allowable range of the erase count of the sixth idle block linked list may be 50 to 60, the allowable range of the erasing times of the seventh idle block linked list can be 60-70, the allowable range of the erasing times of the eighth idle block linked list can be 70-80, the allowable range of the erasing times of the ninth idle block linked list can be 80-90, the allowable range of the erasing times of the tenth idle block linked list can be 90-100, the allowable range of the erasing times of the eleventh idle block linked list can be-10-0, the allowable range of the erasing times of the twelfth idle block linked list can be-10-20, the allowable range of the erasing times of the thirteenth idle block linked list can be-20-30, the allowable range of the erasing times of the fourteenth idle block linked list can be-30-40, the allowable range of the erasing times of the fifteenth idle block linked list can be-40-50, the allowable range of the erasing times of the sixteenth idle block linked list can be-50-60, the allowable range of the erasing times of the seventeenth idle block linked list can be-60 to-70, the allowable range of the erasing times of the eighteenth idle block linked list can be-70 to-80, the allowable range of the erasing times of the nineteenth idle block linked list can be-80 to-90, and the allowable range of the erasing times of the twentieth idle block linked list can be-90 to-100. And adding the data blocks into different idle block linked lists according to the difference between the data block PE and the mean value PE, wherein the current data block is an idle data block, the erasing times are 25 times, and the erasing mean value is 100, so that the current data block can be classified into an eighteenth idle block linked list.
S102: and when detecting that the idle block linked list meeting the wear leveling condition exists, setting a reset label for the block corresponding to the data block with the lowest erasing frequency.
In this application, when it is detected that there is a free block linked list satisfying a wear leveling condition, a wear leveling operation is started, where the wear leveling operation may include S102, setting a reset tag for a block corresponding to a data block with the lowest erase frequency, and S103. Satisfying the wear leveling condition may be, for example, if the number of data blocks included in the free block linked list that is lower than the erase mean is lower than 8, starting wear leveling. The zone corresponding to the data block with low PE value can be selected to set a recammendedreset mark, and the host end is waited to issue a reset instruction to the zone.
S103: and if the block reset instruction issued by the host end is not received within the preset time threshold, taking the data block with the lowest erasing frequency in each dirty block linked list as a source data block, and taking the data block with the highest erasing frequency in each idle block linked list as a target data block for data transfer.
Wherein, the preset time threshold can be determined according to the actual application scenario, for example, 30s can be selected, if within 30s, the block reset command of the block has not been issued, selecting the zone with low PE from the dirty block linked list as a source data block, selecting the data block with high PE from the idle block linked list as a target data block, moving the data, adding the source data block into the idle block linked list and the target data block into the dirty block linked list after the moving is finished and the block resetting instruction is finished, thus, the data transfer is realized by improving and exchanging the data blocks with low erasing times in the dirty block linked list and the data blocks with high erasing times in the idle block linked list, the total erasing times of the data blocks in the dirty block linked list are increased, the total erasing times of the data blocks in the idle block linked list are reduced, the number of the data blocks in the idle block linked list, which are lower than the average erasing times, is increased, therefore, when zoneopen applies for the data block, the data block with low erasing times can be guaranteed to be provided all the time.
S104: and when a request for applying for the data block is received, selecting the data block from the idle block chain table with the lowest erasing times.
After the wear leveling in S102 and S103, when the zoneopen newly applies for a data block, a data block with a low PE can be provided to the zoneopen at all times.
In the technical scheme provided by the embodiment of the invention, the data blocks are classified into different tables according to the difference between the erasing times and the erasing mean value to realize priority discrimination, so that repeated operation caused by comparison between every two data blocks is avoided, and the priority classification efficiency of the data blocks is improved; the data moving is realized by improving and exchanging the data blocks with low erasing times in the dirty block linked list and the data blocks with high erasing times in the idle block linked list, the total erasing times of the data blocks in the dirty block linked list is increased, the total erasing times of the data blocks in the idle block linked list is reduced, and the number of the data blocks which are lower than the average erasing times in the idle block linked list is increased, so that the data blocks with low erasing times can be provided all the time when zoneopen applies for the data blocks, the wear balance of the solid state disk based on the ZNS protocol is realized, the wear balance of each data block in the solid state disk is favorably ensured, and the service life of the solid state disk is effectively prolonged.
In the above embodiment, how to execute the wear leveling start condition of step S102 is not limited, and a specific set of implementation methods is provided in this embodiment, as shown in fig. 2, in step S102, when it is detected that there is a situation where the total number of data blocks included in the free block chain table whose maximum value of the allowable range of the erase times is lower than the erase mean value is lower than the number threshold, a reset tag is set for a block corresponding to the free block chain table whose erase times is the lowest.
The erase mean value is an average value of erase times, the threshold value of the number may be 8, for example, but may also be other values, and may be determined mainly according to the requirement of wear leveling and the total number of data blocks included in the table, which is not limited in this application.
As another alternative, S104 may include:
s1041: and when a request for applying for the data block is received, determining a target idle block linked list with the lowest erasing times from all the idle block linked lists.
S1042: and feeding back the data block with the lowest erasing times in the target idle block linked list.
In another embodiment, it is understood that, when the erasure average value changes, the data blocks included in the free block linked list and the dirty block linked list change, and based on this, the present application may further include:
s105: and when an erasing mean value changing instruction is received, adjusting the data blocks stored in each idle block chain table and each dirty block chain table based on the difference value between the current erasing times of the data blocks and the updated erasing mean value.
In addition, it can be understood that there may be a case where a large difference between the wear frequency of a large number of dirty data blocks and the erase mean value exists in the solid state disk, and each table establishes a limit based on the wear threshold and the erase mean value, so that the wear frequency of each data block in the solid state disk may be randomized within a preset random range according to the block logic number randomization algorithm, and the specific process of the wear frequency randomization may refer to the implementation process of the block logic number randomization algorithm described in the related art, and thus, details are not repeated here. That is, based on the above-described embodiments, the present application may further include:
s106: and randomizing the abrasion times of each dirty data block in the solid state disk according to a block logic number randomizing algorithm.
It should be noted that, in the present application, there is no strict sequential execution order among the steps, and as long as a logical order is met, the steps may be executed simultaneously or according to a certain preset order, and fig. 1 to fig. 2 are only schematic manners, and do not represent only such an execution order.
The embodiment of the invention also provides a corresponding device for the solid state disk wear leveling method, so that the method has higher practicability. Wherein the means can be described separately from the functional module point of view and the hardware point of view. In the following, the solid state disk wear leveling device provided by the embodiment of the present invention is introduced, and the solid state disk wear leveling device described below and the solid state disk wear leveling method described above may be referred to correspondingly.
Based on the angle of the functional module, referring to fig. 3, fig. 3 is a structural diagram of a solid state disk wear leveling apparatus according to an embodiment of the present invention, where the apparatus may include:
a table pre-construction module 301, configured to pre-construct a plurality of idle block linked lists and dirty block linked lists, which are prioritized by data block erasure times and used for storing data blocks; the erasing times of the data blocks in the same idle block linked list or dirty block linked list are within the same allowable range of the erasing times, and the number of the tables is determined based on a preset abrasion threshold value and an erasing average value.
A data block classification module 302, configured to classify each data block into an idle block linked list or a dirty block linked list based on an erase frequency and an erase mean difference, a block type, and an erase frequency allowable range corresponding to each table; the block types are free blocks and dirty data blocks.
The wear leveling processing module 303 is configured to set a reset tag for a block corresponding to a data block with the lowest erasure number when detecting that an idle block linked list satisfying a wear leveling condition exists; and if the block reset instruction issued by the host end is not received within the preset time threshold, taking the data block with the lowest erasing frequency in each dirty block linked list as a source data block, and taking the data block with the highest erasing frequency in each idle block linked list as a target data block for data transfer.
And the data block providing module 304 is configured to, when a request for applying for a data block is received, select a data block from the free block chain table with the lowest erasure number.
Optionally, in some embodiments of this embodiment, referring to fig. 4, for example, the apparatus may further include a table updating module 305, where the table updating module 305 may be configured to, after receiving the erase mean change instruction, adjust the data blocks stored in each free block chain table and each dirty block chain table based on a difference between a current number of times of erasing the data block and an updated erase mean. The method further includes a randomizing module 306, which is specifically configured to randomize the wear times of each dirty data block in the solid state disk according to a block logical number randomizing algorithm.
In other embodiments of this embodiment, the wear leveling processing module 303 is specifically configured to, when it is detected that there is a situation where the total number of data blocks included in the free block chain table whose maximum value of the allowable range of the erase times is lower than the erase mean is lower than a number threshold, set a reset tag for a block corresponding to the free block chain table with the lowest erase times.
In addition, in an alternative implementation, the data block providing module 304 may be configured to determine, when a request for applying for a data block is received, a target idle block linked list with the lowest erasing frequency from each idle block linked list; and feeding back the data block with the lowest erasing times in the target idle block linked list.
The functions of the functional modules of the wear leveling device for the solid state disk according to the embodiment of the present invention may be specifically implemented according to the method in the embodiment of the method, and the specific implementation process may refer to the related description of the embodiment of the method, which is not described herein again.
Therefore, the embodiment of the invention realizes the wear balance of the solid state disk based on the ZNS protocol, and effectively prolongs the service life of the solid state disk.
The solid state disk wear leveling device mentioned above is described from the perspective of a functional module, and further, the present application also provides a solid state disk wear leveling device described from the perspective of hardware. Fig. 5 is a structural diagram of another solid state disk wear leveling device according to an embodiment of the present application. As shown in fig. 5, the apparatus comprises a memory 50 for storing a computer program;
the processor 51 is configured to implement the steps of the solid state disk wear leveling method according to the above embodiments when executing the computer program.
The processor 51 is configured to implement the steps of the data access and storage method of the board chip mentioned in the above embodiments when executing the computer program.
The processor 51 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 51 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). In some embodiments, the processor 51 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 51 may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
Memory 50 may include one or more computer-readable storage media, which may be non-transitory. Memory 50 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 50 is at least used for storing the following computer program 501, wherein after being loaded and executed by the processor 51, the computer program can implement the relevant steps of the testing method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 50 may also include an operating system 502, data 503, and the like, and the storage manner may be a transient storage manner or a permanent storage manner. Operating system 502 may include Windows, Unix, Linux, etc. Data 503 may include, but is not limited to, data corresponding to test results, and the like.
In some embodiments, the data access device of the board chip may further include a display screen 52, an input/output interface 53, a communication interface 54, a power supply 55, and a communication bus 56.
Those skilled in the art will appreciate that the structure shown in fig. 5 does not constitute a limitation to the data access means of the board chip, and may include more or fewer components than those shown, for example, sensor 57.
The functions of the functional modules of the wear leveling device for the solid state disk according to the embodiment of the present invention may be specifically implemented according to the method in the embodiment of the method, and the specific implementation process may refer to the related description of the embodiment of the method, which is not described herein again.
Therefore, the embodiment of the invention realizes the wear balance of the solid state disk based on the ZNS protocol, and effectively prolongs the service life of the solid state disk.
It is understood that, if the solid state disk wear leveling method in the above embodiments is implemented in the form of a software functional unit and sold or used as a stand-alone product, it may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application may be substantially or partially implemented in the form of a software product, which is stored in a storage medium and executes all or part of the steps of the methods of the embodiments of the present application, or all or part of the technical solutions. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), an electrically erasable programmable ROM, a register, a hard disk, a removable magnetic disk, a CD-ROM, a magnetic or optical disk, and other various media capable of storing program codes.
Based on this, an embodiment of the present invention further provides a computer-readable storage medium, which stores a solid state disk wear leveling program, where the solid state disk wear leveling program is executed by a processor, and the steps of the solid state disk wear leveling method according to any one of the above embodiments are provided.
The functions of the functional modules of the computer-readable storage medium according to the embodiment of the present invention may be specifically implemented according to the method in the foregoing method embodiment, and the specific implementation process may refer to the related description of the foregoing method embodiment, which is not described herein again.
Therefore, the embodiment of the invention realizes the wear balance of the solid state disk based on the ZNS protocol, and effectively prolongs the service life of the solid state disk.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The method, the apparatus, and the computer-readable storage medium for wear leveling of a solid state disk provided in the present application are described in detail above. The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present application.

Claims (10)

1. A method for wear leveling of a solid state disk, comprising:
the method comprises the steps that a plurality of idle block linked lists and dirty block linked lists which are prioritized by the erasing times of data blocks and used for storing the data blocks are constructed in advance, and each data block is classified into the idle block linked list or the dirty block linked list based on the erasing times and the erasing average value difference, the block type and the erasing time allowable range corresponding to each list;
when detecting that an idle block linked list meeting the wear leveling condition exists, setting a reset label for a block corresponding to a data block with the lowest erasing times; if a block reset instruction issued by a host end is not received within a preset time threshold, taking a data block with the lowest erasing frequency in each dirty block linked list as a source data block, and taking a data block with the highest erasing frequency in each idle block linked list as a target data block for data transfer;
when a request for applying for a data block is received, selecting the data block from the idle block chain table with the lowest erasing times;
the erasing times of the data blocks in the same idle block linked list or dirty block linked list are within the same erasing time allowable range, and the number of the tables is determined based on a preset abrasion threshold value and the erasing mean value; the block types are a free block and a dirty data block.
2. The method according to claim 1, wherein when it is detected that there is a free block chain table that meets the wear leveling condition, the method sets a reset tag for a block corresponding to the free block chain table with the lowest erase frequency to:
and when detecting that the total number of the data blocks contained in the free block chain table with the maximum value of the allowable range of the erasing times lower than the erasing average value is lower than a number threshold, setting a reset label for the block corresponding to the free block chain table with the lowest erasing times.
3. The method according to claim 2, wherein when a request for applying for a data block is received, the data block is selected from the free block chain table with the lowest erase count as follows:
when a request for applying for a data block is received, determining a target idle block linked list with the lowest erasing times from each idle block linked list;
and feeding back the data block with the lowest erasing times in the target idle block linked list.
4. The method of claim 1, wherein before the pre-constructing a plurality of free block linked lists and dirty block linked lists that are prioritized by data block erasure count and used for storing data blocks, the method further comprises:
and randomizing the abrasion times of each data block in the solid state disk according to a block logic number randomization algorithm.
5. The method for wear leveling of a solid state disk according to any one of claims 1 to 4, wherein after the pre-constructing a plurality of free block linked lists and dirty block linked lists that are prioritized by data block erasure number and are used for storing data blocks, the method further comprises:
and after the erasing mean value changing instruction is received, adjusting the data blocks stored in each idle block chain table and each dirty block chain table based on the difference value between the current erasing times of the data blocks and the updated erasing mean value.
6. The method for wear leveling of a solid state disk according to claim 5, wherein the allowable range of the number of times of erasing of each free block linked list and each dirty block linked list is determined according to the wear threshold and the total number of tables.
7. A solid state disk wear leveling apparatus, comprising:
the table pre-construction module is used for pre-constructing a plurality of idle block linked lists and dirty block linked lists which are prioritized by the erasing times of the data blocks and are used for storing the data blocks; the erasing times of the data blocks in the same idle block linked list or dirty block linked list are within the same erasing time allowable range, and the number of the tables is determined based on a preset abrasion threshold value and the erasing mean value;
the data block classification module is used for classifying each data block into an idle block linked list or a dirty block linked list based on the erasing times and the erasing average value difference, the block type and the erasing time allowable range corresponding to each table; the block types are idle blocks and dirty data blocks;
the wear leveling processing module is used for setting a reset label for a block corresponding to a data block with the lowest erasing frequency when detecting that an idle block linked list meeting a wear leveling condition exists; if a block reset instruction issued by a host end is not received within a preset time threshold, taking a data block with the lowest erasing frequency in each dirty block linked list as a source data block, and taking a data block with the highest erasing frequency in each idle block linked list as a target data block for data transfer;
and the data block providing module is used for selecting the data block from the idle block chain table with the lowest erasing times when a request for applying for the data block is received.
8. The apparatus according to claim 7, further comprising a table updating module, where the table updating module is configured to, after receiving the erase mean change instruction, adjust the data blocks stored in each free block chain table and each dirty block chain table based on a difference between a current erase count of the data block and an updated erase mean.
9. A solid state disk wear leveling apparatus comprising a processor configured to implement the steps of the solid state disk wear leveling method according to any one of claims 1 to 6 when executing a computer program stored in a memory.
10. A computer-readable storage medium, wherein the computer-readable storage medium stores thereon a solid state disk wear leveling program, and the solid state disk wear leveling program, when executed by a processor, implements the steps of the solid state disk wear leveling method according to any one of claims 1 to 6.
CN201911328658.4A 2019-12-20 2019-12-20 Solid state disk wear leveling method and device and computer readable storage medium Active CN111124305B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201911328658.4A CN111124305B (en) 2019-12-20 2019-12-20 Solid state disk wear leveling method and device and computer readable storage medium
PCT/CN2020/110986 WO2021120665A1 (en) 2019-12-20 2020-08-25 Solid state drive wear balancing method and apparatus, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911328658.4A CN111124305B (en) 2019-12-20 2019-12-20 Solid state disk wear leveling method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111124305A true CN111124305A (en) 2020-05-08
CN111124305B CN111124305B (en) 2021-08-31

Family

ID=70500792

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911328658.4A Active CN111124305B (en) 2019-12-20 2019-12-20 Solid state disk wear leveling method and device and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN111124305B (en)
WO (1) WO2021120665A1 (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112612420A (en) * 2020-12-28 2021-04-06 苏州浪潮智能科技有限公司 Flash wear leveling method, device, equipment and storage medium
WO2021120665A1 (en) * 2019-12-20 2021-06-24 浪潮电子信息产业股份有限公司 Solid state drive wear balancing method and apparatus, and computer-readable storage medium
CN113407126A (en) * 2021-08-20 2021-09-17 苏州浪潮智能科技有限公司 Wear leveling method, device, equipment and readable storage medium
CN113851171A (en) * 2021-09-27 2021-12-28 苏州浪潮智能科技有限公司 PE frequency range determining method of SSD and related components
TWI775268B (en) * 2021-01-07 2022-08-21 慧榮科技股份有限公司 Storage device, flash memory control and control method thereof
US11537305B1 (en) 2021-06-03 2022-12-27 Western Digital Technologies, Inc. Dissimilar write prioritization in ZNS devices
US11537303B1 (en) 2021-06-03 2022-12-27 Western Digital Technologies, Inc. Dissimilar write prioritization in ZNS devices
US11537293B2 (en) 2021-02-18 2022-12-27 Western Digital Technologies, Inc. Wear leveling methods for zoned namespace solid state drive
CN115586874A (en) * 2022-11-24 2023-01-10 苏州浪潮智能科技有限公司 Data block recovery method and device, electronic equipment and storage medium
CN115599308A (en) * 2022-11-28 2023-01-13 苏州浪潮智能科技有限公司(Cn) Garbage recycling method and device for solid state disk, electronic equipment and storage medium

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101777026A (en) * 2009-01-09 2010-07-14 成都市华为赛门铁克科技有限公司 Memory management method, hard disk and memory system
CN102508785A (en) * 2011-11-02 2012-06-20 清华大学 Wear leveling method and device
CN102810068A (en) * 2011-05-30 2012-12-05 三星电子株式会社 Storage device, storage system and method of virtualizing storage device
CN102880556A (en) * 2012-09-12 2013-01-16 浙江大学 Wear leveling method and system of Nand Flash
CN103092770A (en) * 2013-01-18 2013-05-08 山东华芯半导体有限公司 Method for reducing random access memory (RAM) expense in abrasion balanced processing
CN103136121A (en) * 2013-03-25 2013-06-05 中国人民解放军国防科学技术大学 Cache management method for solid-state disc
CN104115127A (en) * 2012-03-15 2014-10-22 株式会社日立制作所 Storage system and data management method
US20140325131A1 (en) * 2010-12-30 2014-10-30 Sandisk Technologies Inc. Controller and Method for Performing Background Operations
CN105468291A (en) * 2014-08-21 2016-04-06 腾讯科技(深圳)有限公司 Dynamic and static wear leveling control methods and apparatuses
CN106339324A (en) * 2016-08-19 2017-01-18 浪潮(北京)电子信息产业有限公司 Method and device for selecting garbage collection block
CN106484323A (en) * 2016-09-13 2017-03-08 郑州云海信息技术有限公司 A kind of loss equalizing method of solid-state storage and system
CN106844227A (en) * 2017-01-14 2017-06-13 郑州云海信息技术有限公司 Solid state hard disc abrasion equilibrium method and device based on grouping mechanism
CN106990926A (en) * 2017-06-14 2017-07-28 郑州云海信息技术有限公司 A kind of processing method of solid state hard disc abrasion equilibrium
CN107562641A (en) * 2017-07-11 2018-01-09 捷开通讯(深圳)有限公司 The balance abrasion mthods, systems and devices of memory space
CN110211622A (en) * 2019-06-14 2019-09-06 山东大学 Improve the data erasing-writing method of multivalue NAND-flash memory data storage total amount

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104731515B (en) * 2013-12-18 2018-02-23 华为技术有限公司 Control the method and apparatus of storage device group of planes abrasion equilibrium
US9336136B2 (en) * 2014-10-08 2016-05-10 HGST Netherlands B.V. Apparatus, systems, and methods for providing wear leveling in solid state devices
CN107562381A (en) * 2017-08-30 2018-01-09 紫光华山信息技术有限公司 A kind of data processing method and device
CN111124305B (en) * 2019-12-20 2021-08-31 浪潮电子信息产业股份有限公司 Solid state disk wear leveling method and device and computer readable storage medium

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101777026A (en) * 2009-01-09 2010-07-14 成都市华为赛门铁克科技有限公司 Memory management method, hard disk and memory system
US20140325131A1 (en) * 2010-12-30 2014-10-30 Sandisk Technologies Inc. Controller and Method for Performing Background Operations
CN102810068A (en) * 2011-05-30 2012-12-05 三星电子株式会社 Storage device, storage system and method of virtualizing storage device
CN102508785A (en) * 2011-11-02 2012-06-20 清华大学 Wear leveling method and device
CN104115127A (en) * 2012-03-15 2014-10-22 株式会社日立制作所 Storage system and data management method
CN102880556A (en) * 2012-09-12 2013-01-16 浙江大学 Wear leveling method and system of Nand Flash
CN103092770A (en) * 2013-01-18 2013-05-08 山东华芯半导体有限公司 Method for reducing random access memory (RAM) expense in abrasion balanced processing
CN103136121A (en) * 2013-03-25 2013-06-05 中国人民解放军国防科学技术大学 Cache management method for solid-state disc
CN105468291A (en) * 2014-08-21 2016-04-06 腾讯科技(深圳)有限公司 Dynamic and static wear leveling control methods and apparatuses
CN106339324A (en) * 2016-08-19 2017-01-18 浪潮(北京)电子信息产业有限公司 Method and device for selecting garbage collection block
CN106484323A (en) * 2016-09-13 2017-03-08 郑州云海信息技术有限公司 A kind of loss equalizing method of solid-state storage and system
CN106844227A (en) * 2017-01-14 2017-06-13 郑州云海信息技术有限公司 Solid state hard disc abrasion equilibrium method and device based on grouping mechanism
CN106990926A (en) * 2017-06-14 2017-07-28 郑州云海信息技术有限公司 A kind of processing method of solid state hard disc abrasion equilibrium
CN107562641A (en) * 2017-07-11 2018-01-09 捷开通讯(深圳)有限公司 The balance abrasion mthods, systems and devices of memory space
CN110211622A (en) * 2019-06-14 2019-09-06 山东大学 Improve the data erasing-writing method of multivalue NAND-flash memory data storage total amount

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘虎生: ""一种固态硬盘混合损耗均衡算法研究"", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021120665A1 (en) * 2019-12-20 2021-06-24 浪潮电子信息产业股份有限公司 Solid state drive wear balancing method and apparatus, and computer-readable storage medium
CN112612420A (en) * 2020-12-28 2021-04-06 苏州浪潮智能科技有限公司 Flash wear leveling method, device, equipment and storage medium
US11593008B2 (en) 2021-01-07 2023-02-28 Silicon Motion, Inc. Control method for flash memory controller and associated flash memory controller and storage device
TWI775268B (en) * 2021-01-07 2022-08-21 慧榮科技股份有限公司 Storage device, flash memory control and control method thereof
US12014063B2 (en) 2021-01-07 2024-06-18 Silicon Motion, Inc. Control method for flash memory controller and associated flash memory controller and storage device
US11537293B2 (en) 2021-02-18 2022-12-27 Western Digital Technologies, Inc. Wear leveling methods for zoned namespace solid state drive
US11537305B1 (en) 2021-06-03 2022-12-27 Western Digital Technologies, Inc. Dissimilar write prioritization in ZNS devices
US11537303B1 (en) 2021-06-03 2022-12-27 Western Digital Technologies, Inc. Dissimilar write prioritization in ZNS devices
CN113407126A (en) * 2021-08-20 2021-09-17 苏州浪潮智能科技有限公司 Wear leveling method, device, equipment and readable storage medium
CN113851171A (en) * 2021-09-27 2021-12-28 苏州浪潮智能科技有限公司 PE frequency range determining method of SSD and related components
CN113851171B (en) * 2021-09-27 2023-11-03 苏州浪潮智能科技有限公司 PE frequency range determining method of SSD and related components
CN115586874A (en) * 2022-11-24 2023-01-10 苏州浪潮智能科技有限公司 Data block recovery method and device, electronic equipment and storage medium
CN115599308A (en) * 2022-11-28 2023-01-13 苏州浪潮智能科技有限公司(Cn) Garbage recycling method and device for solid state disk, electronic equipment and storage medium
WO2024113746A1 (en) * 2022-11-28 2024-06-06 苏州元脑智能科技有限公司 Garbage collection method and apparatus for solid state disk, and electronic device and storage medium

Also Published As

Publication number Publication date
WO2021120665A1 (en) 2021-06-24
CN111124305B (en) 2021-08-31

Similar Documents

Publication Publication Date Title
CN111124305B (en) Solid state disk wear leveling method and device and computer readable storage medium
CN111090398B (en) Garbage recycling method, device and equipment for solid state disk and readable storage medium
EP3786795A1 (en) Memory allocation method and apparatus for neural network
CN109753443B (en) Data processing method and device and electronic equipment
EP3588259B1 (en) Garbage collection method for storage media, storage medium, and program product
CN110673789B (en) Metadata storage management method, device, equipment and storage medium of solid state disk
US20160188227A1 (en) Method and apparatus for writing data into solid state disk
US20140089921A1 (en) Method and system for managing virtual machine disks
CN103229136B (en) Disk array brush method and disk array brush device
CN111324303B (en) SSD garbage recycling method, SSD garbage recycling device, computer equipment and storage medium
CN111159058B (en) Wear leveling method and device and nonvolatile storage equipment
CN111813713B (en) Data acceleration operation processing method and device and computer readable storage medium
CN105095287A (en) LSM (Log Structured Merge) data compact method and device
US9229640B2 (en) Inexpensive solid-state storage by throttling write speed in accordance with empirically derived write policy table
CN104346291A (en) Storage method and storage system for memory
CN105988875B (en) Method and device for running process
CN103677653A (en) Data processing method and electronic device based on solid state disk (SSD)
CN111813347B (en) Garbage recycling space management method and device and computer readable storage medium
CN105224238B (en) Storage management method, memory storage apparatus and memorizer control circuit unit
CN114924923A (en) Method, system, equipment and medium for verifying correctness of hard disk write-in point
CN103713953A (en) Device and method for transferring data in memory
CN105117168A (en) Information processing method and electronic equipment
CN106325764A (en) Memory management method, memory control circuit unit and memory storage apparatus
CN112269535A (en) Space resource allocation method and device of storage system and readable storage medium
CN114385092B (en) Erasing method of solid state disk flash memory array and solid state disk main control chip

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