[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN112433676A - Garbage recycling method and system for solid state disk - Google Patents

Garbage recycling method and system for solid state disk Download PDF

Info

Publication number
CN112433676A
CN112433676A CN202011328107.0A CN202011328107A CN112433676A CN 112433676 A CN112433676 A CN 112433676A CN 202011328107 A CN202011328107 A CN 202011328107A CN 112433676 A CN112433676 A CN 112433676A
Authority
CN
China
Prior art keywords
flash memory
solid state
state disk
block
flash
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
CN202011328107.0A
Other languages
Chinese (zh)
Other versions
CN112433676B (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.)
Hefei Kangxinwei Storage Technology Co Ltd
Original Assignee
Hefei Kangxinwei Storage Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hefei Kangxinwei Storage Technology Co Ltd filed Critical Hefei Kangxinwei Storage Technology Co Ltd
Priority to CN202011328107.0A priority Critical patent/CN112433676B/en
Publication of CN112433676A publication Critical patent/CN112433676A/en
Application granted granted Critical
Publication of CN112433676B publication Critical patent/CN112433676B/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
    • 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/0608Saving storage space on 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/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0653Monitoring storage devices or 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/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Landscapes

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

Abstract

The invention discloses a garbage recycling method and a garbage recycling system for a solid state disk, wherein the garbage recycling method for the solid state disk comprises the following steps: acquiring the total capacity, the reserved space and the total number of flash memory blocks of the solid state disk; monitoring the quantity of valid data and the quantity of blank flash memory blocks in each flash memory block in the solid state disk; acquiring a first threshold according to the reserved space, the total number of the flash memory blocks, the number of effective data in each flash memory block and the total capacity of the solid state disk; when the number of the available flash memory blocks of the solid state disk is equal to the first threshold value, transmitting valid data on the source flash memory blocks into the reserved space, and erasing the content on the source flash memory blocks. The garbage recycling method for the solid state disk can prolong the service life of the solid state disk.

Description

Garbage recycling method and system for solid state disk
Technical Field
The invention belongs to the technical field of storage, and particularly relates to a garbage recycling method and system for a solid state disk.
Background
A Solid State Disk (SSD) is a type of SSD based on a persistent memory, such as a flash memory. The intelligent control system has the advantages of high reading and writing speed, low power consumption, no noise, vibration resistance, low heat, small volume and large working range, and is widely applied to the fields of military affairs, vehicle-mounted, industrial control, video monitoring, network terminals, electric power, medical treatment, aviation and the like, navigation equipment and the like.
When the solid state disk is used for garbage collection, when a user writes data, if an available flash block is smaller than a certain threshold value, the garbage collection is needed to be carried out so as to vacate a space for the user to write, and the garbage collection is called Foreground garbage collection (Foreground, GC). Correspondingly, Background Garbage Collection (GC) is performed when the solid state disk is idle, and garbage collection is actively performed by the solid state disk, so that the write performance of a user is improved. However, in consideration of power consumption, the solid state disk does not need to perform background garbage collection, and when the solid state disk is idle, the solid state disk directly enters a power saving mode. However, the existing garbage collection conditions are fixed, and the garbage collection function is not started according to specific data in the solid state disk, so that the service life of the solid state disk is influenced.
Disclosure of Invention
The invention aims to provide a garbage recycling method and a garbage recycling system for a solid state disk, which can prolong the service life of the solid state disk and ensure that the solid state disk has better stability.
In order to solve the technical problems, the invention is realized by the following technical scheme:
the invention provides a garbage recycling method of a solid state disk, which at least comprises the following steps:
acquiring the total capacity, the reserved space and the total number of flash memory blocks of the solid state disk;
monitoring the quantity of valid data in each flash memory block in the solid state disk and the quantity of blank flash memory blocks;
acquiring a first threshold according to the reserved space, the total number of the flash memory blocks, the number of effective data in each flash memory block and the total capacity of the solid state disk;
when the number of the available flash memory blocks of the solid state disk is equal to the first threshold value, transmitting valid data on the source flash memory blocks into the reserved space, and erasing the content on the source flash memory blocks.
In an embodiment of the present invention, the first threshold is obtained according to the following formula:
Figure BDA0002794897990000021
wherein A is the first threshold, b is the set threshold of the blank flash block, TbcFor the total number of said flash blocks, OP is the coefficient of the reserved space, TbovcFor the amount of valid data in the flash block, TbvcThe total amount of data allowed to be stored for the flash block.
In an embodiment of the present invention, the head space coefficient is obtained according to the following formula:
Figure BDA0002794897990000022
the bare capacity of the solid state disk is the total capacity of the solid state disk, the user capacity is the size of the usable capacity of a system display user, and the bare capacity of the solid state disk is the sum of the user capacity and the reserved space.
In an embodiment of the present invention, when the flash memory block is fully written with data and is invalid, the invalid data in the flash memory block is erased.
In an embodiment of the present invention, the step of transferring valid data on a source flash memory block into the reserved space and erasing contents on the source flash memory block comprises:
selecting the source flash block;
finding the valid data from the source flash block;
writing the valid data into a target flash memory block, and erasing the data in the source flash memory block;
wherein the targeted flash block is located in the reserved space.
In an embodiment of the present invention, the solid state disk includes an information recording unit, and the information recording unit is disposed in the reserved space.
In an embodiment of the present invention, the information recording unit includes a flash translation mapping table, and the flash translation mapping table records a physical address corresponding to each logical block address.
In an embodiment of the present invention, the information recording unit includes a valid block recording table, and when the flash memory block can store data, the valid block recording table marks the flash memory block as the available flash memory block.
In an embodiment of the present invention, the information recording unit includes an erasure count recording table, and when the source flash memory block is selected, the flash memory block with the smallest erasure count is preferentially selected as the source flash memory block.
The invention also provides a garbage recycling system of the solid state disk, which comprises:
the acquisition unit is electrically connected with the flash memory block and used for acquiring the total capacity, the reserved space and the total number of the flash memory blocks of the solid state disk;
the monitoring unit is electrically connected with the flash memory blocks and is used for monitoring the number of valid data and the number of blank flash memory blocks in each flash memory block in the solid state disk;
and the garbage recovery control unit is electrically connected with the acquisition unit, the monitoring unit and the flash memory block and used for acquiring a first threshold value, transmitting the effective data on the source flash memory block to a reserved space when the number of the available flash memory blocks of the solid state disk is equal to the first threshold value, and erasing the content on the source flash memory block.
According to the garbage recycling method and system for the solid state disk, provided by the invention, the lowest threshold for starting garbage recycling is obtained by monitoring the blank flash memory blocks and setting the threshold of the blank flash memory blocks; the first threshold value is set by monitoring the quantity of the effective data in the flash memory block, the garbage recovery function is flexibly started according to the quantity of the effective data in the flash memory block, when the effective data in the flash memory block is less and the garbage data is more, the garbage recovery function is started earlier, the space of the flash memory block is vacated, and the stability of the solid state disk is ensured; when the number of valid data in the flash memory block is large and the number of invalid data is small, starting a garbage recovery function later to prolong the service life of the solid state disk, and when the number of the invalid data in the flash memory block is small, directly erasing the invalid data on the flash memory block without starting the garbage recovery function.
Of course, it is not necessary for any product in which the invention is practiced to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a structure diagram of a solid state disk.
Fig. 2 is a flowchart of a garbage collection processing method for a solid state disk.
Fig. 3 is a block partitioning structure diagram of a solid state disk flash memory.
FIG. 4 is a diagram of a flash block store data.
FIG. 5 is a diagram of another flash block store data.
Fig. 6 is a structural view of an information recording unit.
Fig. 7 is a structural diagram of a garbage recycling system of a solid state disk.
Fig. 8 is a block diagram of a computer-readable storage medium.
Fig. 9 is a schematic block diagram of a structure of an electronic device.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a solid state disk 20 is a storage device using a semiconductor flash memory as a medium. Unlike conventional mechanical hard disks, the solid state disk 20 stores data in a semiconductor, and is implemented using a pure electronic circuit without any mechanical device. A user sends a request to the solid state disk 20 at an application level of an operating system of the host 10, the file system 101 converts the read-write request into corresponding read-write and other commands conforming to a protocol through the underlying driver 102, and the solid state disk 20 executes corresponding operations after receiving the commands through the solid state disk interface 201 and then outputs the results. The input of the solid state disk 20 is a command, the output is data and a command state, and the solid state disk interface 201 receives a user command request and outputs the data or the state required by the user through internal calculation and processing logic.
Referring to fig. 1, the solid state disk 20 mainly includes a solid state disk interface 201, a Flash Translation Layer (FTL) 202, a Flash block interface 203, and a plurality of Flash blocks 204. The front end of the solid state disk 20, that is, the solid state disk interface 201 receives the command and the related data sent by the host 10, and after the command is processed by the solid state disk 20, the solid state disk interface 201 returns the command state or the data to the host 10. The solid state disk interface 201 is, for example, an SATA, SAS, PCIe interface, and the like, connected to the host 10, and implements corresponding ATA, SCSI, NVMe, and other protocols. When the host 10 sends a write command to the solid state disk 20 through the interface, the solid state disk 20 receives the write command and executes the write command, and receives data to be written by the host 10. Data is generally cached in a Random Access Memory (RAM) inside the solid state disk 20, the flash translation layer 202 allocates a flash address to each logical data block, when the data has a certain number, the flash translation layer 202 sends a flash write request to the back end, and the back end writes the data in the RAM into the corresponding flash block 204 according to the flash write request. The solid state disk 20 allocates any possible flash block 204 writes to the data blocks sent from the host 10, and the address translation unit 206 in the flash translation layer 202 can complete the translation or mapping of the logical data blocks to the flash physical space. Meanwhile, the flash translation layer 202 is also provided with a garbage collection unit 207 for erasing invalid data, the flash memory blocks 204 cannot be overwritten, garbage data (invalid data) can be generated in the flash memory blocks 204 along with the continuous writing of user data, the garbage data can occupy the space of the flash memory blocks 204, when the available space of the flash memory blocks 204 is insufficient, the flash translation layer 202 needs to perform garbage collection, namely, the valid data on a plurality of flash memory blocks 204 are moved out and written into a new flash memory block 204, and then the previous flash memory blocks 204 are erased to obtain the available flash memory blocks. In addition, a wear leveling unit 208 for ensuring balanced writing of each flash block 204 and a bad block management unit 205 for implementing bad block management are also included in the flash translation layer 202.
Referring to fig. 1 to fig. 3, in an embodiment of the present invention, a garbage recycling method for a solid state disk is provided, where the garbage recycling method for the solid state disk includes:
s10: acquiring the total capacity, the reserved space 300 and the total number of flash memory blocks of the solid state disk 20;
s11: monitoring the number of valid data and the number of blank flash blocks in each flash block 204 in the solid state disk 20;
s12: acquiring a first threshold value according to the reserved space 300, the total number of the flash memory blocks, the number of the effective data in each flash memory block 204 and the total capacity of the solid state disk;
s13: when the number of available flash memory blocks of the solid state disk 20 is equal to the first threshold value, transferring valid data on the source flash memory block into the reserved space, and erasing the content on the source flash memory block.
Referring to fig. 2, in an embodiment of the invention, the first threshold is obtained according to the following formula:
Figure BDA0002794897990000061
where a is the first threshold, b is the set threshold of the blank flash block, in this embodiment, b is set to 2, for example, that is, the set threshold of the blank flash block is 2, T is set tobcFor the total number of said flash blocks, OP is the coefficient of the reserved space, TbovcIs the quantity of valid data in the flash memory block, namely the sum of the quantity of valid data in each flash memory block, TbvcAnd the total amount of data allowed to be stored for the flash memory blocks is the total capacity of the solid state disk. Among them, in the present embodimentB is the set threshold value of the blank flash memory block, b is set to be 2, when garbage recycling is carried out, the number of the blank flash memory blocks must be larger than the set threshold value of the blank flash memory block, otherwise, no enough temporary storage space is available for storing the valid data, and a new flash memory block 204 is released.
Referring to fig. 2 to fig. 3, in an embodiment of the present invention, the head space coefficient OP of the solid state disk 20 is obtained according to the following formula:
Figure BDA0002794897990000071
the bare capacity 302 of the solid state disk is the total capacity of the solid state disk, the user capacity 301 is the size of the capacity that can be used by a user in a system (Windows/Linux), and the bare capacity 302 of the solid state disk is the sum of the user capacity 301 and the reserved space 300.
Referring to fig. 3, in an embodiment of the invention, a plurality of channels are disposed on a bottom layer of the solid state disk 20, and each channel is connected to a plurality of flash memory blocks 204. The number of channels arranged on the bottom layer of the solid state disk 20 is, for example, 3, and the number of flash memory blocks 204 connected to each channel is, for example, 5. For example, 15 flash memory blocks 204 are shared in the solid state disk 20, the bare capacity 302 of the solid state disk is 15 flash memory blocks, wherein a Block5 on each channel is used as a reserved space, the reserved space 300 is 3 flash memory blocks, and the bare capacity 302 of the solid state disk minus the reserved space 300 is the user capacity 301. In the present embodiment, the size of the user capacity 301 is, for example, 12 flash blocks. The reserved space coefficient OP of the solid state disk 20 is:
Figure BDA0002794897990000072
the reserved space 300 can be used as a mapping table storage space of the flash translation layer 202, a reserved exchange space required by garbage collection, a replacement space of a flash bad block, and the like.
Referring to fig. 4 to 5, in an embodiment of the present invention, the total number of flash memory blocks in the solid state disk 20 is, for example, 7, the number of flash memory blocks 204 used as the user capacity 301 is, for example, 4, the number of flash memory blocks used as the reserved space 300 is, for example, 3, and the total amount of data that can be stored in each flash memory block 204 is, for example, 4096. Referring to fig. 4, in an embodiment of the present invention, the first 4 flash memory blocks 204 are full of data, and the amount of valid data in each flash memory block 204 is 4096, then the first threshold is:
Figure BDA0002794897990000081
referring to fig. 5, in another embodiment of the present invention, the first 4 flash blocks 204 are full of data, but the amount of valid data in each flash block 204 is 1024, then the first threshold is:
Figure BDA0002794897990000082
as can be seen from the above embodiments, with the first threshold set by the present invention, when there is no garbage data in the solid state disk 20, the garbage collection function does not need to be started, so as to prolong the service life of the whole solid state disk 20, and when the amount of garbage data in the solid state disk 20 is larger, the solid state disk 20 starts the garbage collection function earlier, so as to vacate the space of the flash memory block 204, and ensure the stability of the solid state disk 20. By the first threshold mode set by the invention, the garbage recycling function is not unnecessarily started, and the efficiency of the solid state disk 20 is improved.
Referring to fig. 2, in an embodiment of the present invention, the step of transferring valid data on a source flash block into the reserved space and erasing contents on the source flash block includes: selecting the source flash block; finding the valid data from the source flash block; writing the valid data into a target flash block; and erasing the data in the source flash memory block. Wherein the targeted flash block may be located in the reserved space.
Referring to fig. 1 and fig. 6, in an embodiment of the present invention, the solid state disk 20 further includes an information recording unit 404, the information recording unit 404 may be disposed inside the flash memory block 204, or electrically connected to the flash memory block in the flash memory block 204, in this embodiment, the information recording unit 404 is disposed inside the flash memory block 204 and located in the reserved space 300, and when selecting the source flash memory block, the garbage collection control unit 407 can conveniently and quickly query the information of the flash memory block 204. The information recording unit 404 includes a flash memory conversion mapping table 400, and a physical address corresponding to each Logical Block Address (LBA) is recorded in the flash memory conversion mapping table 400, during garbage collection, after the firmware reads data, the Logical block address corresponding to the data is obtained, and to determine whether the data is invalid, the flash memory conversion mapping table 400 needs to be searched to obtain the physical address corresponding to the Logical block address, if the physical address is consistent with the address of the data on the flash memory, the data is valid, otherwise the data is invalid. When data is written fully in a certain flash memory block 204 and all the data are invalid data, a garbage collection function is not required to be started, all the invalid data in the flash memory block 204 are directly erased, and a blank flash memory block is obtained.
Referring to fig. 1 and fig. 6, in an embodiment of the present invention, the information recording unit 404 includes a valid page recording table 401, the valid page recording table 401 records the valid page number on each flash memory block 204, and the larger the amount of valid page number in the valid page recording table 401 is, the more data stored in the flash memory block 204 is. When the garbage collection function is started, the effective page record table 401 is sorted, and the flash memory block 204 with the least effective page number is preferentially selected as the source flash memory block.
Referring to fig. 1 and fig. 6, in an embodiment of the present invention, the information recording unit 404 includes an effective block recording table 402, and the effective block recording table 402 is used for recording the status of each flash memory block 204. For example, when the flash block 204 is in an available state, i.e., the flash block 204 can store data, the valid block record table 402 marks the state of the flash block 204 as 1, which is the available flash block; when a flash block 204 is in an unavailable state, i.e., the flash block 204 is already full of data, the valid block record table 402 marks the state of the flash block 204 as 0.
Referring to fig. 1 and fig. 6, in an embodiment of the present invention, the information recording unit 404 includes an erase count recording table 403, and the erase count recording table 403 is used for recording the erase count of each flash memory block 204. When selecting the source flash block, the flash block 204 with the least number of erasures is preferentially selected as the source flash block.
Referring to fig. 3 and fig. 7, the present invention provides a garbage recycling system for solid state disk, which includes:
a flash block 204 in which an information recording unit 404 is provided for recording the state of the flash block 204 including the number of the valid data and the number of the invalid data in each flash block 204, and the like;
the acquisition unit 405 is electrically connected to the flash memory block 204, and is configured to acquire the total solid state disk capacity, the reserved space 300, and the total flash memory block amount of the solid state disk 20;
a monitoring unit 406, electrically connected to the information recording unit 404, for monitoring the number of valid data and the number of blank flash blocks in each flash block 204 in the solid state disk 20;
the garbage collection control unit 407, electrically connected to the acquisition unit 405, the monitoring unit 406, and the flash memory block 204, is configured to obtain a first threshold, and when the number of available flash memory blocks of the solid state disk 20 is equal to the first threshold, transmit valid data on a source flash memory block to the reserved space 300, and erase content on the source flash memory block.
Referring to fig. 8, the embodiment further provides a computer-readable storage medium 5, where the computer-readable storage medium 5 stores a computer instruction 50, and the computer instruction 50 is used for a garbage collection processing method using the solid state disk. The computer readable storage medium 5 may be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system or propagation medium. The computer-readable storage medium 5 may also include a semiconductor or solid state memory, magnetic tape, a removable computer diskette, a Random Access Memory (RAM), a read-only memory (ROM), a rigid magnetic disk and an optical disk. Optical disks may include compact disk-read only memory (CD-ROM), compact disk-read/write (CD-RW), and DVD.
Referring to fig. 9, the present invention further provides an electronic device, which includes a processor 60 and a memory 70, where the memory 70 stores program instructions, and the processor 60 runs the program instructions to implement the garbage collection processing method of the solid state disk. The Processor 60 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; or a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component; the Memory 70 may include a Random Access Memory (RAM) and may further include a Non-Volatile Memory (Non-Volatile Memory), such as at least one disk Memory. The Memory 70 may also be an internal Memory of Random Access Memory (RAM) type, and the processor 60 and the Memory 70 may be integrated into one or more independent circuits or hardware, such as: application Specific Integrated Circuit (ASIC). Note that the computer program in the memory 70 may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, an electronic device, or a network device) to perform all or part of the steps of the method according to the embodiments of the present invention.
According to the garbage recycling processing method of the solid state disk, the first threshold value is set by monitoring the number of effective data in the flash memory block 204, the garbage recycling function is flexibly started according to the number of the effective data in the flash memory block 204, when the number of the effective data in the flash memory block 204 is small and the number of the garbage data is large, the garbage recycling function is started earlier, the space of the flash memory block is vacated, and the stability of the solid state disk is guaranteed; when the number of valid data in the flash memory block 204 is large and the number of invalid data is small, the garbage collection function is started later, the service life of the solid state disk is prolonged, and when the number of the invalid data in the flash memory block 204 is small, the invalid data in the flash memory block 204 is directly erased without starting the garbage collection function. Meanwhile, the source flash memory block is selected by monitoring the erasing times of each flash memory block 204 and the quantity of the valid data and the invalid data on each flash memory block 204, so that the service life of the solid state disk is prolonged, and the balanced writing and wear balance of the flash memory blocks 204 are ensured.
The embodiments of the invention disclosed above are intended merely to aid in the explanation of the invention. The examples are not intended to be exhaustive or to limit the invention to the precise forms disclosed. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the invention and the practical application, to thereby enable others skilled in the art to best utilize the invention. The invention is limited only by the claims and their full scope and equivalents.

Claims (10)

1. A garbage recycling method for a solid state disk is characterized by at least comprising the following steps:
acquiring the total capacity, the reserved space and the total number of flash memory blocks of the solid state disk;
monitoring the quantity of valid data in each flash memory block in the solid state disk and the quantity of blank flash memory blocks;
acquiring a first threshold according to the reserved space, the total number of the flash memory blocks, the number of effective data in each flash memory block and the total capacity of the solid state disk;
when the number of the available flash memory blocks of the solid state disk is equal to the first threshold value, transmitting valid data on the source flash memory blocks into the reserved space, and erasing the content on the source flash memory blocks.
2. The method according to claim 1, wherein the first threshold is obtained according to the following formula:
Figure FDA0002794897980000011
wherein A is the first threshold, b is the set threshold of the blank flash block, TbcFor the total number of said flash blocks, OP is the coefficient of the reserved space, TbovcFor the amount of valid data in the flash block, TbvcThe total amount of data allowed to be stored for the flash block.
3. The garbage collection processing method of the solid state disk according to claim 2, wherein the head space coefficient is obtained according to the following formula:
Figure FDA0002794897980000012
the bare capacity of the solid state disk is the total capacity of the solid state disk, the user capacity is the size of the usable capacity of a system display user, and the bare capacity of the solid state disk is the sum of the user capacity and the reserved space.
4. The garbage collection processing method of claim 1, wherein when the flash memory block is full of data and is invalid data, the invalid data in the flash memory block is erased.
5. The garbage collection processing method of the solid state disk as claimed in claim 1, wherein the step of transferring valid data on a source flash block into the reserved space and erasing contents on the source flash block comprises:
selecting the source flash block;
finding the valid data from the source flash block;
writing the valid data into a target flash memory block, and erasing the data in the source flash memory block;
wherein the targeted flash block is located in the reserved space.
6. The method as claimed in claim 1, wherein the solid state disk includes an information recording unit, and the information recording unit is disposed in the reserved space.
7. The method according to claim 6, wherein the information recording unit includes a flash translation mapping table, and the flash translation mapping table records a physical address corresponding to each logical block address.
8. The garbage collection processing method of the solid state disk as claimed in claim 6, wherein the information recording unit comprises a valid block recording table, and when the flash memory block can store data, the valid block recording table marks the flash memory block as the available flash memory block.
9. The garbage collection and disposal method of a solid state disk according to claim 6, wherein said information recording unit comprises an erasure number recording table, and when selecting said source flash block, the flash block with the least erasure number is preferentially selected as said source flash block.
10. The utility model provides a garbage recycling system of solid state hard drives which characterized in that, garbage recycling system of solid state hard drives includes:
the acquisition unit is electrically connected with the flash memory block and used for acquiring the total capacity, the reserved space and the total number of the flash memory blocks of the solid state disk;
the monitoring unit is electrically connected with the flash memory blocks and is used for monitoring the number of valid data and the number of blank flash memory blocks in each flash memory block in the solid state disk;
and the garbage recovery control unit is electrically connected with the acquisition unit, the monitoring unit and the flash memory block and used for acquiring a first threshold value, transmitting the effective data on the source flash memory block to a reserved space when the number of the available flash memory blocks of the solid state disk is equal to the first threshold value, and erasing the content on the source flash memory block.
CN202011328107.0A 2020-11-24 2020-11-24 Garbage recycling method and system for solid state disk Active CN112433676B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011328107.0A CN112433676B (en) 2020-11-24 2020-11-24 Garbage recycling method and system for solid state disk

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011328107.0A CN112433676B (en) 2020-11-24 2020-11-24 Garbage recycling method and system for solid state disk

Publications (2)

Publication Number Publication Date
CN112433676A true CN112433676A (en) 2021-03-02
CN112433676B CN112433676B (en) 2024-07-16

Family

ID=74694536

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011328107.0A Active CN112433676B (en) 2020-11-24 2020-11-24 Garbage recycling method and system for solid state disk

Country Status (1)

Country Link
CN (1) CN112433676B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113867651A (en) * 2021-12-03 2021-12-31 武汉深之度科技有限公司 Hard disk data cleaning method and device and computing equipment
CN114020208A (en) * 2021-09-30 2022-02-08 苏州浪潮智能科技有限公司 Data garbage recovery method and device, computer equipment and storage medium
CN115599706A (en) * 2022-12-13 2023-01-13 合肥康芯威存储技术有限公司(Cn) Garbage recycling method of data storage device and data storage device
CN116909495A (en) * 2023-09-14 2023-10-20 合肥康芯威存储技术有限公司 Storage device and control method thereof
CN118152301A (en) * 2024-05-09 2024-06-07 江苏华存电子科技有限公司 Solid state disk garbage recycling method capable of achieving self-adaptive learning
WO2024198470A1 (en) * 2023-03-29 2024-10-03 华为技术有限公司 Storage management method and apparatus

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080034154A1 (en) * 1999-08-04 2008-02-07 Super Talent Electronics Inc. Multi-Channel Flash Module with Plane-Interleaved Sequential ECC Writes and Background Recycling to Restricted-Write Flash Chips
CN103336744A (en) * 2013-06-20 2013-10-02 华中科技大学 Garbage recovery method for solid-state storage device and system for garbage recovery method
CN103902465A (en) * 2014-03-19 2014-07-02 华为技术有限公司 Method and system for recycling solid state disk junk and solid state disk controller
US20150067239A1 (en) * 2013-08-30 2015-03-05 Silicon Motion, Inc. Data storage device and flash memory control method
CN106681935A (en) * 2016-12-29 2017-05-17 郑州云海信息技术有限公司 Trash recycling method for solid state disk
CN107506136A (en) * 2017-08-07 2017-12-22 成都华为技术有限公司 A kind of method and apparatus of garbage reclamation
US10025708B1 (en) * 2017-09-08 2018-07-17 Phison Electronics Corp. Memory management method, memory control circuit unit and memory storage apparatus
CN108595112A (en) * 2018-03-14 2018-09-28 深圳忆联信息系统有限公司 A kind of the SSD rubbish recovering methods and solid state disk of optimization trigger mechanism
US10303397B1 (en) * 2017-05-25 2019-05-28 Amazon Technologies, Inc. Read disturb handling in storage devices
WO2020007030A1 (en) * 2018-07-06 2020-01-09 华为技术有限公司 System controller and system garbage recovery method
CN111090398A (en) * 2019-12-13 2020-05-01 北京浪潮数据技术有限公司 Garbage recycling method, device and equipment for solid state disk and readable storage medium
CN111352593A (en) * 2020-02-29 2020-06-30 杭州电子科技大学 Solid state disk data writing method for distinguishing fast writing from normal writing

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080034154A1 (en) * 1999-08-04 2008-02-07 Super Talent Electronics Inc. Multi-Channel Flash Module with Plane-Interleaved Sequential ECC Writes and Background Recycling to Restricted-Write Flash Chips
CN103336744A (en) * 2013-06-20 2013-10-02 华中科技大学 Garbage recovery method for solid-state storage device and system for garbage recovery method
US20150067239A1 (en) * 2013-08-30 2015-03-05 Silicon Motion, Inc. Data storage device and flash memory control method
CN103902465A (en) * 2014-03-19 2014-07-02 华为技术有限公司 Method and system for recycling solid state disk junk and solid state disk controller
CN106681935A (en) * 2016-12-29 2017-05-17 郑州云海信息技术有限公司 Trash recycling method for solid state disk
US10303397B1 (en) * 2017-05-25 2019-05-28 Amazon Technologies, Inc. Read disturb handling in storage devices
CN107506136A (en) * 2017-08-07 2017-12-22 成都华为技术有限公司 A kind of method and apparatus of garbage reclamation
US10025708B1 (en) * 2017-09-08 2018-07-17 Phison Electronics Corp. Memory management method, memory control circuit unit and memory storage apparatus
CN108595112A (en) * 2018-03-14 2018-09-28 深圳忆联信息系统有限公司 A kind of the SSD rubbish recovering methods and solid state disk of optimization trigger mechanism
WO2020007030A1 (en) * 2018-07-06 2020-01-09 华为技术有限公司 System controller and system garbage recovery method
CN111090398A (en) * 2019-12-13 2020-05-01 北京浪潮数据技术有限公司 Garbage recycling method, device and equipment for solid state disk and readable storage medium
CN111352593A (en) * 2020-02-29 2020-06-30 杭州电子科技大学 Solid state disk data writing method for distinguishing fast writing from normal writing

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
朱增昌;: "基于擦除上限的动态阈值磨损均衡算法", 电脑知识与技术, no. 12, pages 229 - 231 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114020208A (en) * 2021-09-30 2022-02-08 苏州浪潮智能科技有限公司 Data garbage recovery method and device, computer equipment and storage medium
CN114020208B (en) * 2021-09-30 2023-08-22 苏州浪潮智能科技有限公司 Data garbage collection method, device, computer equipment and storage medium
CN113867651A (en) * 2021-12-03 2021-12-31 武汉深之度科技有限公司 Hard disk data cleaning method and device and computing equipment
CN113867651B (en) * 2021-12-03 2022-02-25 武汉深之度科技有限公司 Hard disk data cleaning method and device and computing equipment
CN115599706A (en) * 2022-12-13 2023-01-13 合肥康芯威存储技术有限公司(Cn) Garbage recycling method of data storage device and data storage device
CN115599706B (en) * 2022-12-13 2023-03-14 合肥康芯威存储技术有限公司 Garbage recycling method of data storage device and data storage device
WO2024198470A1 (en) * 2023-03-29 2024-10-03 华为技术有限公司 Storage management method and apparatus
CN116909495A (en) * 2023-09-14 2023-10-20 合肥康芯威存储技术有限公司 Storage device and control method thereof
CN116909495B (en) * 2023-09-14 2023-12-15 合肥康芯威存储技术有限公司 Storage device and control method thereof
CN118152301A (en) * 2024-05-09 2024-06-07 江苏华存电子科技有限公司 Solid state disk garbage recycling method capable of achieving self-adaptive learning

Also Published As

Publication number Publication date
CN112433676B (en) 2024-07-16

Similar Documents

Publication Publication Date Title
CN112433676B (en) Garbage recycling method and system for solid state disk
US11579773B2 (en) Memory system and method of controlling memory system
US10776278B2 (en) Storage control apparatus and computer-readable storage medium storing storage control program
US8521949B2 (en) Data deleting method and apparatus
CN108628542B (en) File merging method and controller
KR20110119408A (en) Data storage device and method for operating thereof
US11747979B2 (en) Electronic device, computer system, and control method
US9201784B2 (en) Semiconductor storage device and method for controlling nonvolatile semiconductor memory
KR20130017748A (en) Memory controller and data management method
WO2021035555A1 (en) Data storage method and apparatus for solid state disk and solid state disk (ssd)
KR20130112210A (en) Page replace method and memory system using the same
JP2015507798A (en) Method for erasing data entities in a memory module
CN113419675B (en) Write operation method and read operation method for memory
CN111984441B (en) Instant power-off recovery processing method and device and computer readable storage medium
JP2021533467A (en) Logical vs. physical table fragment
CN115599706B (en) Garbage recycling method of data storage device and data storage device
CN114185492A (en) Solid state disk garbage recycling algorithm based on reinforcement learning
CN115729439A (en) Data management method and device and solid state disk
CN116235138A (en) Data reading method and related device applied to solid state disk SSD
EP4307129A1 (en) Method for writing data into solid-state hard disk
JP2008262452A (en) Cache method of recording device, and recording device
KR102210536B1 (en) Data storage system of on-volatile memory apparatus and method of the same
US10860233B2 (en) Half-match deduplication
EP3862863A1 (en) Method for managing performance of logical disk, and storage array
CN110968528B (en) Assembling data for nonvolatile storage medium by using unified cache architecture

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