Movatterモバイル変換


[0]ホーム

URL:


CN115599706B - Garbage recycling method of data storage device and data storage device - Google Patents

Garbage recycling method of data storage device and data storage device
Download PDF

Info

Publication number
CN115599706B
CN115599706BCN202211592389.4ACN202211592389ACN115599706BCN 115599706 BCN115599706 BCN 115599706BCN 202211592389 ACN202211592389 ACN 202211592389ACN 115599706 BCN115599706 BCN 115599706B
Authority
CN
China
Prior art keywords
flash memory
memory block
type
recovered
data
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.)
Active
Application number
CN202211592389.4A
Other languages
Chinese (zh)
Other versions
CN115599706A (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 LtdfiledCriticalHefei Kangxinwei Storage Technology Co Ltd
Priority to CN202211592389.4ApriorityCriticalpatent/CN115599706B/en
Publication of CN115599706ApublicationCriticalpatent/CN115599706A/en
Application grantedgrantedCritical
Publication of CN115599706BpublicationCriticalpatent/CN115599706B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The invention discloses a garbage recycling method of a data storage device and the data storage device, and belongs to the technical field of storage. The garbage recycling and processing method comprises the following steps: acquiring the number of idle flash memory blocks, and judging whether the number of the idle flash memory blocks is smaller than a first threshold value or not; when the number of the idle flash memory blocks is larger than or equal to the first threshold value, judging whether the ratio of the effective data in the first type of flash memory blocks to be recovered and the second type of flash memory blocks to be recovered is smaller than a second threshold value; when the ratio of the effective data in the first type of flash memory block to be recovered and the effective data in the second type of flash memory block to be recovered is smaller than a second threshold value, performing garbage recovery; otherwise, copying the data in the flash memory page with the bit reversal in the first type of flash memory block to be recovered to a backup flash memory block. The garbage recycling method of the data storage equipment can improve the garbage recycling efficiency and prolong the service life of the flash memory block.

Description

Garbage recycling method of data storage device and data storage device
Technical Field
The invention belongs to the technical field of storage, and particularly relates to a garbage recycling method of a data storage device and the data storage device.
Background
A Solid State Disk (SSD) is a computer storage device 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.
In a part of flash memory blocks of the solid state disk, when the data stored in the flash memory pages reaches the deadline, the data can have bit flipping, and the data with the bit flipping can be corrected. Uncorrectable errors occur when the data bits in a flash page flip too much or too long. When the flash memory blocks are garbage collected, when the effective data in the flash memory blocks are too much, the garbage collection efficiency is extremely low, and a large amount of time is consumed.
Disclosure of Invention
The invention aims to provide a garbage recycling method of a data storage device and the data storage device.
In order to solve the technical problems, the invention is realized by the following technical scheme:
the invention provides a garbage recycling method of data storage equipment, which at least comprises the following steps:
acquiring the number of idle flash memory blocks, and judging whether the number of the idle flash memory blocks is smaller than a first threshold value or not;
when the number of the idle flash memory blocks is larger than or equal to the first threshold value, acquiring a first type of flash memory blocks to be recovered and a second type of flash memory blocks to be recovered, wherein the first type of flash memory blocks to be recovered is flash memory blocks to be recovered, which have bit reversal caused by the time limit of data storage and need garbage recovery, and the second type of flash memory blocks is flash memory blocks to be recovered, which need garbage recovery because the data on the flash memory blocks become invalid data;
judging whether the ratio of the effective data in the first type of flash memory block to be recovered and the effective data in the second type of flash memory block to be recovered is smaller than a second threshold value;
when the ratio of the effective data in the first type to-be-recovered flash memory block and the second type to-be-recovered flash memory block is smaller than the second threshold value, performing garbage recovery;
when the ratio of the effective data in the first type of flash memory block to be recovered and the effective data in the second type of flash memory block to be recovered is larger than or equal to a second threshold value, copying the data in the flash memory page with the bit reversal in the first type of flash memory block to be recovered to a backup flash memory block.
In an embodiment of the present invention, when the number of the idle flash memory blocks is smaller than the first threshold, performing forced garbage collection.
In an embodiment of the present invention, when the first type of flash memory block to be recycled is obtained, one or more first type of flash memory blocks to be recycled are obtained.
In an embodiment of the present invention, when acquiring the second type of to-be-recycled flash memory block, one or more second type of to-be-recycled flash memory blocks with least valid data are acquired.
In an embodiment of the present invention, the backup flash memory block is a flash memory block in which the storage unit in the flash memory page is in a single-layer flash memory storage mode.
In an embodiment of the present invention, after copying data in a flash memory page with a bit flip in the first type of flash memory block to be recovered to a backup flash memory block, the garbage recovery processing method further includes the following steps: and establishing a physical-to-physical address mapping table, and storing the physical address of the backed-up flash memory block in the backup flash memory block.
In an embodiment of the present invention, the number of backup flash blocks is greater than or equal to 2.
In an embodiment of the present invention, the garbage recycling method further includes the following steps: and when one backup flash memory block is fully written, performing garbage recovery processing on the backup flash memory block corresponding to the backup flash memory block.
In an embodiment of the present invention, when performing garbage collection processing on the backed-up flash memory block, another backup flash memory block is used to back up a flash memory page with a bit reversal in the first type of flash memory block to be collected.
The present invention also provides a data storage device comprising:
a cache unit storing program instructions;
and the control unit runs the program instructions to realize the data writing method of the data storage device.
As described above, the garbage collection processing method of the data storage device and the data storage device provided by the present invention first determine the necessity of garbage collection, and perform forced garbage collection when the number of idle flash memory blocks is too small. When the number of idle flash memory blocks is sufficient, if the garbage recovery efficiency is not high, the flash memory pages in the flash memory blocks to be recovered, which have bit reversal, are backed up. Thereby increasing the efficiency of garbage recovery and simultaneously prolonging the service life of the flash memory block.
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 schematic structural diagram of a data storage device.
FIG. 2 is a schematic diagram of a memory cell structure.
FIG. 3 is a diagram of a structure of a linked list of flash blocks.
Fig. 4 is a flowchart of a garbage collection processing method of a data storage device.
Fig. 5 is a block diagram of a computer-readable storage medium.
Fig. 6 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, adata storage device 20 is described herein that includes a novel architecture for controlling a mass storage module that includes flash memory chips. The entiredata storage device 20 is shown in a highly schematic form in fig. 1. As with the other block diagrams herein, the elements shown in FIG. 1 are conceptual in nature, illustrating the nature of the interrelationship between these functional blocks and are not intended to represent an actual physical circuit level implementation.
Referring to fig. 1, the present application provides an electronic device, which includes ahost 10 and adata storage device 20. Wherein thehost 10 and thedata storage device 20 may be implemented as separate chips, modules, or devices, or may be included in a single device. In this embodiment, thedata storage device 20 may be an integrated unitary storage device, which is then connected to thehost 10. However, the present disclosure is not limited to this example. That is, in another embodiment, thehost 10 and thedata storage device 20 may be integrated into a single device.
Referring to fig. 1, in an embodiment of the present invention, thehost 10 is formed by, for example, a personal computer, a CPU core, or a server connected to a network. The user sends a request to theelectronic device 20 at the application level of the operating system of thehost 10, thefile system 101 converts the read-write request into corresponding read-write and other instruction data conforming to the protocol through thebottom driver 102, and after thedata storage device 20 receives the instruction data through the interface, the instruction data is executed through internal calculation and processing logic, and a corresponding reply is fed back to thehost 10.
Referring to fig. 1, in an embodiment of the invention, thedata storage device 20 is a storage device using a semiconductor flash memory as a medium, such as an Embedded multimedia memory Card (eMMC). And in this embodiment thedata storage device 20 comprises afront end layer 21, anintermediate layer 22 and aback end layer 23. The front-end Layer 21 includes acontrol unit 211 and acache unit 212, where thecache unit 212 is, for example, a Random Access Memory (RAM), themiddle Layer 22 is, for example, a Flash Translation Layer (FTL), and the back-end Layer 23 includes a plurality of Flashmemory blocks 231. After thedata storage device 20 receives the instruction data sent by thehost 10, the data is verified, the related data is stored in thecache unit 212 first, theintermediate layer 22 allocates a flash memory address to each logical data block, after the data has a certain number, theintermediate layer 22 sends a flash memory writing request to the back-end layer 23, and the back-end layer 23 writes the data in thecache unit 212 into the correspondingflash memory block 231 or reads the data in the correspondingflash memory block 231 according to the instruction data request.
Referring to fig. 1, in an embodiment of the invention, theintermediate layer 22 includes an address translation unit 222 for performing the translation or mapping of the logical data block to the flash physical space. Meanwhile, theintermediate layer 22 is also provided with a garbage collection unit 223 for erasing invalid data, theflash memory block 231 cannot be overwritten, as user data is continuously written, garbage data (invalid data) can be generated in theflash memory block 231, the garbage data can occupy the space of theflash memory block 231, when the available space of theflash memory block 231 is insufficient, the garbage collection unit 223 needs to collect garbage, that is, the valid data on a plurality offlash memory blocks 231 is moved out and written into a newflash memory block 231, and then the previousflash memory blocks 231 are erased to obtain the available flash memory blocks. In addition, themiddle layer 22 includes a wear leveling unit 208 for ensuring balanced writing of eachflash block 231, and a bad block management unit 205 for managing bad blocks.
Referring to fig. 1 and fig. 2, in an embodiment of the present invention, in the back-end layer 23, a plurality of Channels (CH) are disposed on the bottom layer of thedata storage device 20, and fig. 2 illustrates an embodiment of a channel 0. And inside each channel there are multiple parallel Logical Units (LUs). In the present embodiment, two logic cells, i.e., logic cell 0 andlogic cell 1, are provided in each channel. In other embodiments, multiple logic units may be disposed in each channel. Each logic unit includes a plurality of planes, a Page Register (Page Register) and a Cache Register (Cache Register), wherein the Page Register and the Cache Register store data to be written into a physical storage unit or read out from the storage unit. In the present embodiment, two planes, i.e., a plane 0 and aplane 1, are provided in each logic cell. In other embodiments, multiple planes may be provided in each logic cell. In each plane, a page register and a cache register are provided. In each plane, a plurality of flash blocks (blocks) 231 are provided, and a plurality of flash pages (pages) are provided in eachflash block 231, each flash Page further including a plurality of memory cells therein. In the present embodiment, 990 flash blocks, for example, are provided in each plane, and 1152 flash pages, for example, are provided in each flash block. In this embodiment, each memory cell is, for example, a floating gate transistor. Where the address of the memory where data actually exists is referred to as a physical address, thecontrol unit 211 uses a logical address, which corresponds to the physical address. Theintermediate layer 22 may be utilized to manage physical and logical addresses. And the physical address and the logical address may be stored in the form of a mapping table. The memory Cell data blocks in theflash memory block 231 may be configured into different storage modes according to actual requirements, and the memory cells include, for example, an SLC (Single-Level Cell,1 bit/Cell) storage mode and an XLC storage mode. The SLC storage mode means that only one bit of data is stored in each character string cell (cell) of theflash block 231, and the memory cells of the SLC storage mode have a high erase count, for example, 50000 to 100000 times. The XLC storage mode refers to that each character string Cell (Cell) in theflash block 231 stores a plurality of bits of data, and includes an MLC (Multi-Level Cell,2 bit/Cell) storage mode, a TLC (triple-Level Cell,3 bit/Cell) storage mode, and a QLC (Quad-Level Cell,4 bit/Cell) storage mode, and the memory cells of the XLC storage mode have a lower erase count, for example, 500 to 10000 times. The performance of the SLC storage mode memory cell is more stable than the XLC storage mode memory cell. When storing data, the data is written in memory cells of the XLC storage mode, and more important data is stored in memory cells of the SLC storage mode.
Referring to fig. 3, in an embodiment of the present invention, the flash memory blocks may be classified according to the purpose of the flash memory block class, and the flash memory blocks are stored in a linked list form to form a flash memory block linkedlist 230, so as to prevent loss due to power failure. In the application, the flash memory blocks are divided into a flash memory block linked list for storing host data in an XLC storage mode, a flash memory block linked list for storing host data in an SLC storage mode, a flash memory block linked list for storing a mapping table from a logical address to a physical address, and an idle flash memory block linked list, and the number of the flash memory blocks in each linked list is set according to requirements. The host data storage method comprises the steps that a flash memory block chain table for storing host data in an XLC storage mode and a flash memory block in a flash memory block chain table for storing the host data in an SLC storage mode are used for storing data written by a host, a flash memory block in the flash memory block chain table for storing a mapping table from a logical address to a physical address is used for storing a mapping table from the logical address to the physical address, and a flash memory block in an idle flash memory block chain table is used as a reserved space and used for storing transferred effective data during garbage collection.
Referring to fig. 1 to 4, in an embodiment of the present invention, a garbage collection processing method of a data storage device is provided, the garbage collection processing method of the data storage device can be stored in a cache unit, and a control unit runs a program instruction to implement the garbage collection processing method of the data storage device stored in the cache unit. The garbage recycling processing method of the data storage device comprises the following steps:
and S110, acquiring the number of idle flash blocks.
S111, judging whether the number of the idle flash memory blocks is smaller than a first threshold value, executing the step S112 when the number of the idle flash memory blocks is smaller than the first threshold value, and executing the step S113 when the number of the idle flash memory blocks is larger than or equal to the first threshold value.
And S112, performing forced garbage collection.
S113, acquiring a first type of flash block to be recovered due to bit flipping and a second type of flash block to be recovered with invalid data.
S114, judging whether the ratio of the effective data in the first type of flash memory block to be recovered and the second type of flash memory block to be recovered is smaller than a second threshold value, if the ratio of the effective data in the first type of flash memory block to be recovered and the second type of flash memory block to be recovered is smaller than the second threshold value, executing a step S115, and if the ratio of the effective data in the first type of flash memory block to be recovered and the second type of flash memory block to be recovered is larger than or equal to the second threshold value, executing a step S116.
And S115, carrying out garbage collection.
And S116, copying the data in the flash memory page with the bit reversal in the first type of flash memory block to be recovered to the backup flash memory block.
Referring to fig. 4, in an embodiment of the present invention, in the garbage collection processing method, the number of idle flash blocks is first determined from step S111 to step S112. At this time, the number of the flash memory blocks in the idle flash memory blocks can be checked to obtain the number of the idle flash memory blocks. When the number of idle flash memory blocks is smaller than the first threshold, it indicates that the number of available idle flash memory blocks is too small, and forced garbage collection must be performed immediately. At this time, the flash memory blocks with more invalid data in the flash memory blocks can be selected for garbage collection, so that more flash memory blocks are released as idle flash memory blocks. Or selecting the flash memory blocks with bit reversal to perform garbage collection so as to release more flash memory blocks as idle flash memory blocks. The number of the first threshold values can be flexibly set according to the working state of the data storage device. In this embodiment, the first threshold is, for example, 4 to 10, and specifically, for example, 4. Namely, when the number of the idle flash memory blocks is less than 4, the garbage is forcibly recycled so as to avoid using no idle flash memory blocks when the garbage is recycled.
Referring to fig. 4, in an embodiment of the invention, as shown in steps S113 to S116, when the number of idle flash blocks in the data storage device exceeds a first threshold, the garbage collection is not required to be performed. In this case, when garbage collection is performed, not only the type of garbage collection but also the efficiency of garbage collection need to be considered. When the efficiency of garbage collection is too low, garbage collection may not be performed temporarily. In the application, for example, the ratio of the valid data in the flash memory block to be recovered is used to measure the efficiency of garbage recovery, the larger the ratio of the valid data in the flash memory block to be recovered is, the lower the efficiency of garbage recovery is, and the smaller the ratio of the valid data in the flash memory block to be recovered is, the higher the efficiency of garbage recovery is. The number of the flash memory blocks to be recovered is, for example, 5, and the proportion of the valid data in each flash memory block to be recovered is 20%, after garbage is recovered, one flash memory block is used for storing the valid data in the 5 flash memory blocks to be recovered, which is equivalent to releasing 4 idle flash memory blocks. At this time, the efficiency of garbage collection was 80%. Therefore, the smaller the proportion of the valid data in the flash memory block to be recovered is, the higher the garbage recovery efficiency is.
Referring to FIG. 4, in one embodiment of the present invention, there are two types of flash blocks to be recycled in the data storage device. Some flash memory pages to be recycled are caused by the fact that the storage time of data reaches the deadline, the data can be subjected to bit flipping, and at the moment, the data can be repaired. However, if the data bits in the flash memory page are flipped too much or too long, uncorrectable errors occur, so that it is necessary to garbage-collect the flash memory blocks with bit flips. In the application, a to-be-recycled flash memory block which has bit reversal caused by the fact that the data storage time reaches the deadline and needs garbage recycling is defined as a first type to-be-recycled flash memory block. When data in the flash memory block becomes invalid data after the host repeatedly writes, erases or invalidates the flash memory block in the data storage device, garbage collection needs to be performed on the flash memory block with too much invalid data and too little valid data. And defining the flash memory block to be recycled which needs garbage recycling as the second type flash memory block to be recycled because the data on the flash memory block becomes invalid data.
Referring to fig. 4, in an embodiment of the invention, in steps S113 to S116, it is further required to improve the efficiency of garbage collection during garbage collection. If the garbage collection efficiency is too low, the space of the flash memory released in each garbage collection is too small, which not only affects the speed of the host, but also affects the service life of the flash memory block.
Referring to fig. 4, in an embodiment of the present invention, garbage collection is performed on a plurality of flash memory blocks each time garbage collection is performed. And when garbage recovery is carried out each time, the quantity of the recovered first type to-be-recovered flash memory blocks and the quantity of the recovered second type to-be-recovered flash memory blocks are not limited so that the garbage recovery of the first type to-be-recovered flash memory blocks and the second type to-be-recovered flash memory blocks is realized. In this embodiment. At each line garbage collection, for example, 5 flash blocks are subjected to garbage collection, and the number of the first type flash blocks to be collected is, for example, 1, and the number of the second type flash blocks to be collected is, for example, 4. And when garbage collection is carried out each time, whether the first type of flash memory blocks to be collected can be judged, and the collected second type of flash memory blocks to be collected is one or more flash memory blocks with least effective data and most invalid data.
Referring to fig. 4, in an embodiment of the invention, in step S114, the second threshold may be set according to a requirement, for example, 10% to 40%. In the present embodiment, the second threshold value is, for example, 20%. Namely, when the ratio of the effective data in the first type of flash memory block to be recovered and the second type of flash memory block to be recovered is less than 20%, performing garbage recovery. Namely, when 1 first type of flash memory block to be recovered and 4 second type of flash memory blocks to be recovered are recovered, the quantity of valid data on the first type of flash memory block to be recovered and the second type of flash memory block to be recovered is less than the data quantity stored by one flash memory block. And when the effective data ratio of the first type to-be-recovered flash memory block and the second type to-be-recovered flash memory block is greater than or equal to 20%, copying the data in the flash memory page with the bit reversal in the first type to-be-recovered flash memory block into the backup flash memory block.
Referring to fig. 4, in an embodiment of the present invention, since the flash page with XLC storage mode is more prone to bit flipping due to the expiration of storage time than the flash page with SLC storage mode, the backup flash block is a flash block with SLC storage mode flash page, i.e. the flash block with single layer flash storage mode.
Referring to fig. 4, in an embodiment of the present invention, after data in a flash memory page with bit flipping in a first type of flash memory block to be recycled is copied to a backup flash memory block, a mapping table from a physical address to a physical address (P2P) is created and stored in the flash memory block. The backup flash memory block stores the physical address of the flash memory block where the physical address-to-physical address mapping table is located. The backup flash memory block stores the physical address of the backup flash memory block, and a plurality of backup flash memory blocks are stored in a linked list form, such as a backup flash memory block linked list. When the relevant data needs to be read, the physical address can be found through the logical address, and whether the flash memory block where the physical address is located is in the backup flash memory block linked list or not can be checked. And if the backup flash block linked list does not exist, directly reading the data stored in the physical address. If the backup flash block linked list exists, the physical address is searched in a mapping table from the physical address to the physical address, when the physical address is searched, the data stored in the physical address corresponding to the physical address is searched, and if the physical address is not searched, the data stored in the physical address is directly read.
Referring to fig. 4, the number of the backup flash memory blocks is not limited to a large number, but the number of the backup flash memory blocks is at least 2, that is, the number of the backup flash memory blocks is equal to or greater than 2. In the garbage recovery processing process, when a backup flash memory block is fully written, garbage recovery processing is performed on a backed-up flash memory block corresponding to the backup flash memory block, and garbage recovery processing is performed on the backup flash memory block at the same time. And when the backed-up flash memory blocks are subjected to garbage recovery processing, the other backup flash memory block is used for backing up the flash memory pages with bit reversal in the first type of flash memory blocks to be recovered. When a backup flash block is fully written, it indicates that the data in the backup flash block is stored in two copies, and if garbage collection processing is not performed, the waste of flash memory resources is caused by excessive backup data. After garbage recovery processing is carried out on the backup flash memory block, the backup flash memory block can be used for next backup. At least 2 backup flash blocks are required.
Referring to fig. 4, after the data in the flash memory page with bit flipping in the first type of flash memory block to be recycled is copied to the backup flash memory block, the data storage device will continue to operate. After the host repeatedly writes, erases or invalidates the flash memory blocks in the data storage device, the proportion of valid data on the first type of flash memory blocks to be recovered and the second type of flash memory blocks to be recovered is less and less. And the garbage recovery processing method is executed all the time, and when the proportion of the effective data on the second type of flash memory block to be recovered is smaller than a second threshold value, the first type of flash memory block to be recovered and the second type of flash memory block to be recovered are subjected to garbage recovery processing.
Referring to fig. 5, the embodiment further provides a computer-readable storage medium 3, where the computer-readable storage medium 3stores computer instructions 30, and thecomputer instructions 30 are used for a garbage collection processing method using the data storage device. The computer readable storage medium 3 may be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system or a propagation medium. The computer-readable storage medium 3 may also include 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. 6, the present invention further provides an electronic device, which includes aprocessor 40 and amemory 50, where thememory 50 stores program instructions, and theprocessor 40 runs the program instructions to implement the garbage collection processing method of the data storage device.Processor 40 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; 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; theMemory 50 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. TheMemory 50 may also be an internal Memory of Random Access Memory (RAM) type, and theprocessor 40 and theMemory 50 may be integrated into one or more independent circuits or hardware, such as: application Specific Integrated Circuit (ASIC). Note that the computer program in thememory 50 may be implemented in the form of a software functional unit and may be stored in a computer readable storage medium when it is sold or used as a separate 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.
The invention provides a garbage recycling method of a data storage device, which comprises the steps of firstly obtaining the number of idle flash memory blocks and judging whether the number of the idle flash memory blocks is smaller than a first threshold value or not. When the number of idle flash memory blocks is smaller than a first threshold value, garbage recycling is forced, and the stability of the flash memory is guaranteed. When the number of the idle flash memory blocks is larger than or equal to a first threshold value, acquiring a first type of flash memory blocks to be recovered and a second type of flash memory blocks to be recovered, and judging whether the ratio of effective data in the first type of flash memory blocks to be recovered and the second type of flash memory blocks to be recovered is smaller than a second threshold value or not; and when the ratio of the effective data in the first type to-be-recovered flash memory block and the second type to-be-recovered flash memory block is smaller than a second threshold value, performing garbage recovery. When the ratio of the effective data in the first type of flash memory block to be recovered and the effective data in the second type of flash memory block to be recovered is greater than or equal to a second threshold value, copying the data in the flash memory page with the bit reversal in the first type of flash memory block to be recovered into the backup flash memory block, and improving the garbage recovery efficiency.
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)

CN202211592389.4A2022-12-132022-12-13Garbage recycling method of data storage device and data storage deviceActiveCN115599706B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202211592389.4ACN115599706B (en)2022-12-132022-12-13Garbage recycling method of data storage device and data storage device

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202211592389.4ACN115599706B (en)2022-12-132022-12-13Garbage recycling method of data storage device and data storage device

Publications (2)

Publication NumberPublication Date
CN115599706A CN115599706A (en)2023-01-13
CN115599706Btrue CN115599706B (en)2023-03-14

Family

ID=84853411

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202211592389.4AActiveCN115599706B (en)2022-12-132022-12-13Garbage recycling method of data storage device and data storage device

Country Status (1)

CountryLink
CN (1)CN115599706B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN116610596B (en)*2023-07-192023-10-03合肥康芯威存储技术有限公司Memory device and data processing method thereof
CN117033268B (en)*2023-10-092024-02-09苏州元脑智能科技有限公司SSD controller, data processing method, device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112433676A (en)*2020-11-242021-03-02合肥康芯威存储技术有限公司Garbage recycling method and system for solid state disk
CN112486415A (en)*2020-11-302021-03-12北京泽石科技有限公司Garbage recycling method and device of storage device
CN113590502A (en)*2021-07-232021-11-02合肥康芯威存储技术有限公司Garbage recovery method and garbage recovery system of non-volatile memory storage device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US10210041B2 (en)*2015-11-052019-02-19SK Hynix Inc.Systems and methods for low latency copy operations in non-volatile memory
TWI681295B (en)*2017-07-072020-01-01群聯電子股份有限公司Memory management method, memory control circuit unit and memory storage device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112433676A (en)*2020-11-242021-03-02合肥康芯威存储技术有限公司Garbage recycling method and system for solid state disk
CN112486415A (en)*2020-11-302021-03-12北京泽石科技有限公司Garbage recycling method and device of storage device
CN113590502A (en)*2021-07-232021-11-02合肥康芯威存储技术有限公司Garbage recovery method and garbage recovery system of non-volatile memory storage device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于逻辑区间冷热分离的NAND闪存垃圾回收算法;覃仁谅等;《微电子学与计算机》(第05期);全文*

Also Published As

Publication numberPublication date
CN115599706A (en)2023-01-13

Similar Documents

PublicationPublication DateTitle
TWI399644B (en)Block management method for a non-volatile memory
US10564690B2 (en)Power interrupt management
US9158700B2 (en)Storing cached data in over-provisioned memory in response to power loss
US20180373428A1 (en)Methods and systems for managing data migration in solid state non-volatile memory
CN115599706B (en)Garbage recycling method of data storage device and data storage device
CN101777026B (en)Memory management method, hard disk and memory system
CN108038026B (en)Flash memory-based data rapid recovery method and system
CN110045913A (en)Method, memory storage and its controller and electronic device of garbage collection
US20170285954A1 (en)Data storage device and data maintenance method thereof
CN114730300A (en) Enhanced filesystem support for zone namespace storage
CN101689140A (en) memory system
WO2014074449A2 (en)Wear leveling in flash memory devices with trim commands
CN115114180A (en)Method and related controller for performing wear leveling operation in flash memory and storage system
CN111104045B (en)Storage control method, device, equipment and computer storage medium
CN107092563B (en) Method and device for recycling garbage
CN102073600B (en) Data backup method, flash memory controller and flash memory storage system
US10339045B2 (en)Valid data management method and storage controller
Khanbadr et al.A novel method for victim block selection for NAND flash-based solid state drives based on scoring.
TWI747191B (en)Data storage device and data processing method
CN112015339B (en)Data storage system, data storage method and data storage system of memory
CN108089993A (en)Multiple field memory location nand flash memory, critical data storage method and rubbish recovering method
CN119479768B (en) A memory chip testing method and testing device
TWI867597B (en)Method for performing data access management of memory device with aid of randomness-property control, memory device, electronic device, and memory controller of memory device
TWI814590B (en)Data processing method and the associated data storage device
US20250217284A1 (en)Garbage collection for flash translation layer tables

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp