CN113127376A - Control method, device and equipment of solid state drive - Google Patents

Control method, device and equipment of solid state drive Download PDF

Info

Publication number
CN113127376A
CN113127376A CN201911397063.4A CN201911397063A CN113127376A CN 113127376 A CN113127376 A CN 113127376A CN 201911397063 A CN201911397063 A CN 201911397063A CN 113127376 A CN113127376 A CN 113127376A
Authority
CN
China
Prior art keywords
target
solid state
state drive
block
ftl
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
CN201911397063.4A
Other languages
Chinese (zh)
Other versions
CN113127376B (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201911397063.4A priority Critical patent/CN113127376B/en
Publication of CN113127376A publication Critical patent/CN113127376A/en
Application granted granted Critical
Publication of CN113127376B publication Critical patent/CN113127376B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • 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/061Improving I/O performance
    • 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/0629Configuration or reconfiguration of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0643Management of files
    • 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/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0658Controller construction arrangements
    • 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]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7201Logical to physical mapping or translation of blocks or pages

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)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application provides a control method, a device and equipment of a solid-state drive, wherein the method comprises the following steps: determining a target logic block to be erased in a solid state drive, wherein the target logic block is determined according to a forbidden deletion notification command, and the forbidden deletion notification command is used for indicating to delete a target file stored in the solid state drive; according to the target logic block, obtaining a target logic physical L2P mapping table corresponding to the target file in a Flash Translation Layer (FTL); wherein, the mapping tables of L2P corresponding to different files in the FTL are different; the physical address in the target L2P mapping table is set to be deletable. The time consumption for responding to the TRIM command can be reduced.

Description

Control method, device and equipment of solid state drive
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, and a device for controlling a solid state drive.
Background
With the continuous development of computer technology, Solid State Drive (SSD) is colloquially called Solid State disk, and its application is more and more extensive.
Currently, to reduce write amplification of solid state drives, TRIM commands are proposed. Specifically, when the operating system needs to delete a file, the operating system generates a corresponding TRIM command, where the TRIM command may instruct to delete the file in the solid state drive, and further, the operating system may determine a logical block corresponding to the file according to the TRIM command. Further, for the logic block, related data in a Flash Translation Layer (FTL) is updated, so that the SSD can erase invalid data in advance according to the data in the FTL, thereby reducing write amplification. And, in order to avoid access conflict to related data in the FTL, in the process of responding to the TRIM command, a lock is required before updating the related data in the FTL, and an unlock is required after the update is completed.
However, the above method has a problem that it takes a long time to respond to the TRIM command.
Disclosure of Invention
The embodiment of the application provides a control method, a control device and control equipment of a solid-state drive, which are used for solving the problem that time consumption for responding to a TRIM command is long in the prior art.
In a first aspect, an embodiment of the present application provides a method for controlling a solid state drive, including:
determining a target logic block to be erased in a solid state drive, wherein the target logic block is determined according to a forbidden deletion notification command, and the forbidden deletion notification command is used for indicating to delete a target file stored in the solid state drive;
according to the target logic block, obtaining a target logic physical L2P mapping table corresponding to the target file in a Flash Translation Layer (FTL); wherein, the mapping tables of L2P corresponding to different files in the FTL are different;
the physical address in the target L2P mapping table is set to be deletable.
In a second aspect, an embodiment of the present application provides a method for controlling a solid state drive, including:
determining that a physical address in a mapping table of a target logical physical L2P in a Flash Translation Layer (FTL) is set to be deletable; wherein the L2P mapping tables corresponding to different files in the FTL are different, and the target L2P mapping table corresponds to a target file which is indicated to be deleted by the forbidden deletion notification command;
and erasing data in a corresponding storage space in the solid state drive according to the logical address in the target L2P mapping table so as to delete the target file in the solid state drive.
In a third aspect, an embodiment of the present application provides a control apparatus for a solid state drive, including:
the solid state drive comprises a determining module, a deleting module and a judging module, wherein the determining module is used for determining a target logic block to be erased in the solid state drive, the target logic block is determined according to a forbidden deleting notification command, and the forbidden deleting notification command is used for indicating to delete a target file stored in the solid state drive;
an obtaining module, configured to obtain, according to the target logical block, a target logical physical L2P mapping table corresponding to the target file in a flash translation layer FTL; wherein, the mapping tables of L2P corresponding to different files in the FTL are different;
a setting module, configured to set a physical address in the target L2P mapping table to be deletable.
In a fourth aspect, an embodiment of the present application provides a control apparatus for a solid state drive, including:
the determining module is used for determining that the physical address in the mapping table of the target logical physical L2P in the flash translation layer FTL is set to be deletable; wherein the L2P mapping tables corresponding to different files in the FTL are different, and the target L2P mapping table corresponds to a target file which is indicated to be deleted by the forbidden deletion notification command;
and the erasing module is used for erasing data in a corresponding storage space in the solid state drive according to the logical address in the target L2P mapping table so as to delete the target file in the solid state drive.
In a fifth aspect, an embodiment of the present application provides a computer device, including: a memory, a processor; wherein the memory is configured to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the method of any of the first aspects.
In a sixth aspect, an embodiment of the present application provides a solid state drive, including: a memory, a controller; wherein the memory is to store one or more computer instructions, wherein the one or more computer instructions, when executed by the controller, implement the method of any of the first aspects.
In a seventh aspect, an embodiment of the present application provides a solid state drive, including: a memory, a controller; wherein the memory is configured to store one or more computer instructions, wherein the one or more computer instructions, when executed by the controller, implement the method of any of the second aspects.
Embodiments of the present application also provide a computer-readable storage medium storing a computer program, the computer program comprising at least one code, which is executable by a computer to control the computer to perform the method according to any one of the first aspect.
Embodiments of the present application also provide a computer program, which is used to implement the method according to any one of the first aspect when the computer program is executed by a computer.
Embodiments of the present application also provide a computer-readable storage medium storing a computer program, the computer program comprising at least one code, which is executable by a computer to control the computer to perform the method according to any one of the second aspect.
Embodiments of the present application also provide a computer program, which is used to implement the method according to any one of the second aspect when the computer program is executed by a computer.
According to the control method, device and equipment of the solid state drive provided by the embodiment of the application, the target L2P mapping table corresponding to the target file in the FTL is obtained according to the target logical block corresponding to the target file, the physical address in the target L2P mapping table is set to be deletable, and as the L2P mapping tables corresponding to different files in the FTL are different, the conflict access to the L2P mapping table can be avoided, so that in the process of TRIM one file, the locking and unlocking operation on the L2P mapping table of the file is not needed, the time consumed by the locking and unlocking operation is reduced, the time consumed by responding to the forbidding deletion notification command is reduced, and the time consumed by responding to the TRIM command is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic view of an application scenario according to an embodiment of the present application;
fig. 2 is a schematic diagram of writing data to an SSD according to an embodiment of the present application;
fig. 3 is a schematic diagram of an L2P mapping table provided in the embodiment of the present application;
FIG. 4 is a schematic diagram of a VPBM and a VPC provided in an embodiment of the present application;
fig. 5 is a flowchart illustrating a control method of a solid state drive according to an embodiment of the present application;
fig. 6 is a first schematic diagram illustrating mapping tables of different L2P corresponding to different files in an FTL according to an embodiment of the present application;
fig. 7 is a second schematic diagram illustrating that different files in the FTL correspond to different L2P mapping tables according to the embodiment of the present application;
fig. 8 is a flowchart illustrating a method for controlling a solid state drive according to another embodiment of the present application;
FIGS. 9A-9B are schematic diagrams of a PC table provided in an embodiment of the present application;
fig. 10 is a schematic diagram of an L2P mapping table provided in the embodiment of the present application;
fig. 11 is a flowchart illustrating a control method of a solid state drive according to another embodiment of the present application;
fig. 12 is a schematic structural diagram of a control apparatus of a solid state drive according to an embodiment of the present application;
FIG. 13 is a block diagram of a hard disk drive according to an embodiment of the present application;
FIG. 14 is a schematic structural diagram of a computer device according to an embodiment of the present application;
fig. 15 is a schematic structural diagram of a control apparatus of a solid-state drive according to another embodiment of the present application;
fig. 16 is a schematic structural diagram of a hard disk drive according to another embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all 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 application.
The terminology used in the embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the examples of this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise, and "a" and "an" typically include at least two, but do not exclude the presence of at least one.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
It is also noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a good or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such good or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a commodity or system that includes the element.
In addition, the sequence of steps in each method embodiment described below is only an example and is not strictly limited.
Fig. 1 is a schematic view of an application scenario according to an embodiment of the present application, and as shown in fig. 1, the application scenario may include a computer device 11 and a solid state drive 12, where the solid state drive 12 may be understood as an external storage device of the computer device 11, and the solid state drive 12 includes a controller 121 and a Flash memory (Flash) 122. The computer device 11 may have an operating system running thereon, where the operating system may be understood as a host (host) of the solid state drive 12, the operating system may send a write instruction to the controller 121 of the solid state drive 12, the controller 121 may write data into the flash memory 122 according to the write instruction, the operating system may also send a read instruction to the controller 121, and the controller 121 may read data from the flash memory 122 according to the read instruction and return the read data to the operating system. It should be noted that, for convenience of description, in fig. 1, it is assumed that the components of the computer device 11 do not include the solid state drive 12, and alternatively, the solid state drive 12 may be a part of the computer device 11.
When a user deletes a file on the operating system, the operating system does not really delete the data of the file, but only marks the address occupied by the data as 'empty', and the file can be used in a covering manner, the data is not really deleted from the hard disk, but the operating system is marked as deleted, and the next time the file is directly overwritten. Since the read/write process of an SSD using flash memory 122 as a storage carrier is substantially different from that of a conventional Hard Disk Drive (HDD), especially in the write aspect, the HDD can directly overwrite data stored on a Disk, and the SSD needs to erase the original data and then write new data. Overwriting cannot be directly performed, so that the SSD must perform an erasing operation first, and the writing unit of the SSD is a Page (Page) and the erasing unit is a Block (Block), there is a problem of write amplification.
Specifically, as shown in fig. 2, assuming that 1 block in the flash memory 122 in the SSD corresponds to one page, 8 blocks correspond to one block, and all pages in the block store data, when new data needs to be written into a page corresponding to old data in the SSD, that is, when a page corresponding to old data needs to be overwritten, the controller 121 needs to copy all data in the block into a cache (cache) of the SSD, delete and replace the old data in the cache with the new data to obtain data to be written in the block, erase the block of the flash memory 122, and write the data to be written into the block of the flash memory 122 from the cache. It can be seen that although only two pages of data need to be written, the entire block of data needs to be written to the flash memory 122, and therefore there is a problem of write amplification.
In order to make the SSD know data (which may be referred to as invalid data hereinafter) that has been deleted by the operating system as early as possible, to erase the invalid data in advance, and to reduce the occurrence of overwrite, a Disable Delete notification command (Disable Delete notification) is proposed. Disabling the delete notification command allows the operating system to notify the SSD of which data blocks are no longer in use and are erasable, and the controller 121 may erase those data blocks from the flash memory 122 that are no longer in use as notified by the operating system, so that data is not only cleared from the file system's hierarchy, but is also erased from the flash memory 122, thereby achieving less write amplification, higher write throughput, and increased solid state drive lifetime.
It should be noted that the disable deletion notification command may have a specific command name for different command sets. Illustratively, in the Advanced Technology Attachment (ATA) command set, the disable deletion notification command may be specifically referred to as a TRIM command. For example, for a Small Computer System Interface (SCSI) command set, the disable deletion notification command may specifically be an UNMAP command.
Wherein, in response to the delete notification disable command, the process of updating the relevant data in the FTL is mainly completed. The disable deletion notification command may be responded by the controller 121 of the solid state drive for a non-open channel SSD, and may be responded by the operating system for an open-channel SSD. The main difference between an open channel SSD and a non-open channel SSD is that an open channel SSD is a special solid state drive that does not implement the flash translation layer in the drive's firmware, but rather hands over the management tasks of the physical solid state storage to the operating system of the computer.
For example, the related data in the FTL may include a mapping table from a Logical Address (LBA) to a Physical Address (PBA) (hereinafter, referred to as a Logical-Physical mapping table, i.e., L2P mapping table), a Valid Page Bitmap (VPBM), and a Valid Page Count (VPC). The VPBM may record which pages on each block have valid data, and the VPC may record the number of valid pages on each block. The L2P mapping table may be as shown in fig. 3, where LBA0 to LBA7 may represent 8 different logical addresses, and PBAa to PBAh may represent 8 different physical addresses. The VPBM1 and the VPC may be as shown in fig. 4, where 0 and 1 in VPBM2 are bit values, and may indicate that the corresponding page has no valid data when the bit value is 0, and may indicate that the corresponding page has valid data when the bit value is 1, and the corresponding position in VPC has a value of 7 because the number of 1 in VPBM1 is 7, and the corresponding position in VPC has a value of 11 because the number of 1 in VPBM2 is 11.
In general, the general process in response to the disable notification processing command is as follows: 1) clearing the corresponding physical address in the L2P mapping table; 2) clearing the corresponding bit on the VPBM; 3) correspondingly updating the VPC; looping through the above 3 steps until each LBA is completed. Moreover, since the table in the FTL corresponds to the logical block range in a normal case, and one logical block range may include logical blocks of multiple files, multiple files may share one FTL table, and therefore, in order to avoid access conflict to the FTL table, related data needs to be locked during the process of disabling the notification command. On the basis of fig. 3 and fig. 4, taking as an example that the deletion notification command is disabled by deleting data in two logical addresses of LBA0 and LBA7 in fig. 3, and the VPBM of the physical block corresponding to LBA0 is VPBM1, and the VPBM of the physical block corresponding to LBA7 is VPBM2, the processing procedure for disabling the deletion notification command is as follows: locking the L2P table, setting PBAA corresponding to the LBA0 in the L2P table as deletable, and unlocking the L2P table; locking the VPBM1, clearing a bit corresponding to the PBaa in the VPBM1, setting the bit from 1 to 0, and unlocking the VPBM 1; locking the VPC, updating the VPC according to the updated VPBM1, and unlocking the VPC; locking the L2P table, setting the PBAh corresponding to the LBA7 in the L2P table to be deletable, for example, setting the PBA corresponding to the LBA7 to be null, and unlocking the L2P table; locking the VPBM2, clearing a bit corresponding to a PBAh in the VPBM2, setting the bit from 1 to 0, and unlocking the VPBM 2; and locking the VPC, updating the VPC according to the updated VPBM2, and unlocking the VPC.
It can be seen that, in the current process of responding to the disable deletion notification command, since the table in the FTL corresponds to the logical block range, and one logical block range may include logical blocks of multiple files, multiple files may share one FTL table, so that it is necessary to lock related data in the FTL to avoid access conflicts to the FTL table, and since the related data in the FTL is cyclically updated by using a single LBA as a cyclic unit at present, frequent locking and unlocking of the related data in the FTL is required, and since frequent locking and unlocking consumes a long time, a problem that it takes a long time to respond to the disable deletion notification command is caused.
In the embodiment of the application, different files in the FTL correspond to different L2P mapping tables, so that a situation of conflicting access to the L2P mapping table is avoided, and therefore, in the process of one file of the TRIM, locking and unlocking operations for the L2P mapping table of the file are not required, time consumed by the locking and unlocking operations is reduced, and time consumed for responding to the disable delete notification command is reduced.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Fig. 5 is a flowchart illustrating a control method of a solid state drive according to an embodiment of the present application, where an execution subject of the embodiment may be a processor of the computer device 11 in fig. 1 or a controller 121 of the solid state drive 12. As shown in fig. 5, the method of this embodiment may include:
step 501, determining a target logic block to be erased in a solid state drive, where the target logic block is determined according to a disable deletion notification command, where the disable deletion notification command is used to instruct to delete a target file stored in the solid state drive.
In this step, the disable deletion notification command may correspond to a file deletion operation input by the user. After acquiring the file deletion operation input by the user, the operating system may generate a disable deletion notification command corresponding to the file deletion operation, for example, the file deletion operation is used to delete the file 1, and the corresponding disable deletion command may instruct to delete the file 1 stored in the solid state disk.
For example, the operating system may determine the target logical block based on the disable delete notification command. Illustratively, the target logical tile may be determined from an index node (inode) of the target file. It should be noted that the number of the target logical blocks may be multiple, and the multiple target logical blocks may be understood as a block range (block range).
For example, when the execution subject is the processor 11, the step 501 may specifically be that the processor 11 determines a target logical block to be erased in the solid state drive according to the disable deletion notification command. When the execution subject is a controller of the solid state drive 12, step 501 may specifically be receiving indication information sent by the processor 11, where the indication information may indicate a target logical block to be erased in the solid state drive.
Step 502, according to the target logical block, obtaining a target L2P mapping table corresponding to the target file in the FTL.
In this step, the FTL stores the L2P mapping table in units of files, and the L2P mapping tables corresponding to different files in the FTL are different. A file may correspond to one or more L2P mapping tables. Illustratively, one logical block of a file may correspond to one L2P mapping table.
Taking as an example that the FTL includes file x and file y, logical block 1 and logical block 2 are used for storing data of file x (i.e., file 1 corresponds to logical block 1 and logical block 2), logical block 3 and logical block 4 are used for storing data of file y, and one logical block may correspond to one L2P mapping table, the L2P mapping table of file x and file y in the FTL may be specifically as shown in fig. 6. In fig. 6, LBA11-LBA18, LBA21-LBA28, LBA31-LBA38, and LBA41-LBA48 all represent logical addresses, and pba 1-PBAh1, pba 2-PBAh2, pba 3-PBAh3, and pba 4-PBAh4 all represent physical addresses.
Illustratively, the target L2P mapping table may be obtained by determining a first address of a storage space for storing the target L2P mapping table according to the target logical block.
Step 503, setting the physical address in the mapping table of the target L2P as deletable.
In this step, since the L2P mapping table records the mapping relationship from the logical address to the physical address, the physical address of the storage unit used for storing the destination file in the SSD can be determined according to the destination L2P mapping table, so that the physical address can be further set to be deletable to represent that the data stored at the physical address in the SSD is invalid data, and the SSD can erase the invalid data. When a physical address is set to be deletable, the data stored at the physical address in the SSD may be represented as invalid data, and the SSD may erase the invalid data.
It should be noted that, as to the specific manner of setting the physical address in the target L2P mapping table to be deletable, the present application is not limited, and for example, the physical address may be set to be null (zero, Z). Assuming that the target file is file x in FIG. 6, after setting the physical address in the target L2P mapping table to deletable, the L2P mapping table in the FTL may be as shown in FIG. 7.
In this embodiment, a target L2P mapping table corresponding to a target file in the FTL is obtained according to a target logical block corresponding to the target file, and a physical address in the target L2P mapping table is set to be deletable, because L2P mapping tables corresponding to different files in the FTL are different, a collision access to the L2P mapping table can be avoided, so that in the process of TRIM one file, a locking and unlocking operation on the L2P mapping table of the file is not required, a time consumed by the locking and unlocking operation is reduced, and thus time consumed for responding to a deletion prohibition notification command is reduced.
Fig. 8 is a flowchart illustrating a method for controlling a solid state drive according to another embodiment of the present application, where this embodiment mainly describes an alternative implementation manner of step 502 based on the embodiment shown in fig. 5, and as shown in fig. 8, the method of this embodiment may include:
step 801, determining a target logic block to be erased in a solid state drive, where the target logic block is determined according to a disable deletion notification command, where the disable deletion notification command is used to instruct to delete a target file stored in the solid state drive.
It should be noted that step 801 is similar to step 501, and is not described herein again.
Step 802, determine the number of valid pages in the target logical block.
Illustratively, the VPBM may be queried to determine the number of valid pages in the target logical block.
Step 803, according to the number of valid pages, querying data in the FTL to obtain a block location of the target logical block.
In this step, the block location of a logical block can be understood as the first address of the L2P mapping table corresponding to the logical block, so that the L2P mapping table corresponding to the logical block can be obtained from reading according to the block location of the logical block.
In order to improve the efficiency of determining the block location, a table of valid Page numbers (PCs) may be maintained in the FTL, where the PC tables corresponding to different destination files are different, and the PC tables may be used to indicate block information of logical blocks of corresponding files, where the block information includes the valid Page numbers and the block locations. The target PC table is used to indicate block information of each target logical block, and the block information includes a valid page number and a block position. Taking the target file as file x in fig. 6 as an example, the corresponding target PC table can be as shown in fig. 9A. It should be noted that the number of valid pages is the first in fig. 9A, and the block position is the last for example only.
The block position of the target logic block can be directly obtained by inquiring the PC table, and compared with the method of generally inquiring a plurality of tables to determine the block position, the method has the advantages of smaller calculation amount and higher inquiry efficiency.
Illustratively, the block information of the target logical block in the target PC table is sorted according to a preset sorting policy, where the preset sorting policy includes sorting the effective page number quantity from large to small, or sorting the effective page number quantity from small to large. Taking the target file as the file x in fig. 6, where the number of valid pages of the logical block 1 is 9, the number of valid pages of the logical block 2 is 10, and the preset sorting policy is that the number of valid pages is sorted in order from large to small, the corresponding target PC table may be as shown in fig. 9B, and in fig. 9B, since the number of valid pages 10 is greater than the number of valid pages 9, the block information corresponding to the logical block 2 may be sorted at the head (head) of the target PC table, and the block information corresponding to the logical block 1 may be sorted at the tail (tail) of the target PC table.
For example, the target PC table may be queried by a head-to-tail search method according to the number of valid pages, so as to obtain the block location of the target logical block.
For example, when the block information of the target logical block in the target PC table is sorted according to a preset sorting policy, the target PC table may be queried by using a binary search method according to the number of the valid pages, so as to obtain the block position of the target logical block. By adopting the binary search method for query, the query efficiency can be improved, and the query duration can be shortened, so that the duration of forbidding the deletion notification command can be further reduced.
Optionally, the PC table is stored in a linked list form, and one piece of block information in the PC table corresponds to one node of the linked list. Because a new logic block needs to be continuously added in the process of writing data into the SSD by the PC table, through one node of the linked list corresponding to one block information in the PC table, when the PC table is sorted according to a preset sorting strategy, the direction of the pointer can be only changed, and the copying of node data is not involved, so that the sorting efficiency is very high, and the consumption of computing resources in the sorting process can be reduced.
Step 804, reading and obtaining a target L2P mapping table corresponding to the target file according to the block position of the target logical block.
In this step, different files may correspond to different L2P tables, for example, the L2P mapping table may be stored in a linked list form, and a mapping from a logical address to a physical address in the L2P mapping table may correspond to a node in the linked list. As shown in the L2P mapping table shown in fig. 10, taking the L2P mapping table corresponding to the logical block 1 of the file x in fig. 6 as an example, the LBAs 0 to PBAa may serve as a node of a linked list, the LBAs 1 to PBAb may serve as a node, and the LBAs … …, the LBAs 7 to PBAh may serve as a node. For example, the node corresponding to LBA0 may be located at the head of the L2P mapping table, and the node corresponding to LBA7 may be located at the tail of the L2P mapping table.
The mapping from a logical address to a physical address in the L2P mapping table can correspond to a node in the linked list, and when the mapping from a logical address to a physical address in the L2P mapping table is increased, the mapping can be realized by inserting a node, so that the copy of the whole L2P mapping table is avoided, and the consumption of computing resources can be further reduced.
Step 805, the physical address in the mapping table of the target L2P is set to be deletable.
It should be noted that step 805 is similar to step 503, and is not described herein again.
It should be noted that, when the number of target logical blocks is multiple, step 801 to step 805 may be executed in a loop by taking a logical block as a unit, for example, for the file x shown in fig. 6, step 801 may first determine logical block 1 of the file x, step 802 determines the number of valid pages of logical block 1, step 803 determines the block location of logical block 1, step 804 reads the L2P mapping table of logical block 1, and step 805 sets the physical address in the L2P mapping table of logical block 1 to be deletable. Further, logical block 2 of file x may be determined by step 801, the number of valid pages of logical block 2 is determined by step 802, the block location of logical block 2 is determined by step 803, the L2P mapping table of logical block 2 is obtained by reading step 804, and the physical address in the L2P mapping table of logical block 2 is set to be deletable by step 805.
In this embodiment, the number of valid pages in the target logical block is determined, the block position of the target logical block is obtained by querying data in the FTL according to the number of valid pages, the target L2P mapping table corresponding to the target file is read according to the block position of the target logical block, and the physical address in the target L2P mapping table is set to be deletable, because L2P mapping tables corresponding to different files in the FTL are different, a conflicting access to the L2P mapping table can be avoided, and therefore, in the process of TRIM one file, a locking and unlocking operation on the L2P mapping table of the file is not required, a time consumed by the locking and unlocking operation is reduced, and thus, time consumed for responding to a disable deletion notification command is reduced.
On the basis of the foregoing embodiment, for example, when data of a target file is written to the solid state drive, the target L2P mapping table may be updated, and further, the target PC table may be updated. Optionally, step 501 may further include: updating the target L2P mapping table and the target PC table when writing data of the target file to the solid state drive.
Further optionally, the updating the target PC table includes: updating valid page data in the target PC table; and sorting the block information in the target PC table according to a preset sorting strategy according to the updated effective page number in the target PC table. When the data written into the target file in the solid-state drive triggers updating of the PC table, the PC table is sorted according to the preset sorting strategy, so that the target PC table can be directly inquired by adopting a binary search method according to the number of the effective pages when the step 803 is executed, the sorting processing of the target PC table before the step 803 is executed is avoided, the calculation amount of the command for responding the forbidden deletion notification is reduced, and the time consumption for responding the forbidden deletion notification is reduced.
In addition, for the PC table and the L2P table stored in a linked list form, the updated data can be updated in a way that the updated data are all placed at the tail part, the conflict problem when the data are written into the SSD to trigger the updating of the PC table and the L2P table can be avoided, the PC table and the L2P table do not need to be locked when the data are written into the SSD to trigger the updating of the PC table and the L2P table, and the updating efficiency is improved. For example, assuming that the PC table includes 4 nodes, namely node 1, node 2, node 3 and node 4 from beginning to end, when block information corresponding to one logical block needs to be added, node 5 for storing the block information may be generated, and node 5 may be used as a node next to node 4.
On the basis of the above method embodiment, when the FTL includes a VPBM, the method may further include the following steps: and updating the effective page bitmap VPBM in the FTL according to the target logic block. Illustratively, the VPBM may be updated after the steps of the above embodiments are performed. Updating the VPBM allows the SSD to determine which page on which logical block stores valid data according to the VPBM.
Fig. 11 is a flowchart illustrating a control method of a solid state drive according to another embodiment of the present application, where an execution subject of the embodiment may be the controller 121 of the solid state drive 12 in fig. 1. As shown in fig. 11, the method of this embodiment may include:
step 111, determining that the physical address in the mapping table of the target L2P in the FTL is set as deletable; wherein the L2P mapping tables corresponding to different files in the FTL are different, and the target L2P mapping table corresponds to a target file which is indicated to be deleted by the forbidden deletion notification command.
In this step, it may be determined that the physical address in the mapping table of the target L2P in the FTL is set to be deletable by reading the FTL.
It should be noted that, for a specific implementation manner that the physical address in the mapping table of the target L2P in the FTL is set to be deletable, reference may be made to the related description of the foregoing embodiment, and details are not described here again.
Step 112, erasing data in the corresponding storage space in the solid state drive according to the logical address in the target L2P mapping table, so as to delete the target file in the solid state drive.
In this step, a corresponding physical address may be determined according to a logical address in the target L2P mapping table, and data in a corresponding storage space in the solid state drive may be erased according to the physical address.
In this embodiment, by determining that a physical address in a target L2P mapping table in the FTL is set to be deletable, and erasing data in a corresponding storage space in the solid state drive according to a logical address in the target L2P mapping table to delete a target file in the solid state drive, in the case that L2P mapping tables corresponding to different files in the FTL are different, early deletion of the target file in the solid state drive can be completed according to the L2P mapping table, so that the data of the target file is not only cleared from the hierarchy of the file system, but also erased from the flash memory of the solid state drive, thereby achieving less write amplification, higher write throughput, and increasing the lifetime of the solid state drive.
Fig. 12 is a schematic structural diagram of a control apparatus of a solid state drive according to an embodiment of the present application; referring to fig. 12, the present embodiment provides a control apparatus, which may execute the control method of the solid state drive provided in the embodiments shown in fig. 5 and fig. 8, and specifically, the control apparatus may include:
a determining module 121, configured to determine a target logical block to be erased in a solid state drive, where the target logical block is determined according to a disable deletion notification command, and the disable deletion notification command is used to instruct to delete a target file stored in the solid state drive;
an obtaining module 122, configured to obtain, according to the target logical block, a target logical physical L2P mapping table corresponding to the target file in the flash translation layer FTL; wherein, the mapping tables of L2P corresponding to different files in the FTL are different;
a setting module 123, configured to set a physical address in the target L2P mapping table to be deletable.
Optionally, the obtaining module 122 is specifically configured to:
determining a number of valid pages in the target logical block;
according to the number of the effective pages, inquiring data in the FTL to obtain the block position of the target logic block;
and taking the block position of the target logical block as the first address of a target L2P mapping table corresponding to the target file in the FTL to obtain the target L2P mapping table.
Optionally, the obtaining module 122 is configured to query the data in the FTL according to the number of valid pages to obtain the block location of the target logical block, and specifically includes:
inquiring a target effective page number PC table corresponding to the target file in the FTL according to the effective page number to obtain the block position of the target logic block; the PC tables corresponding to different target files are different, the target PC tables are used for indicating the block information of each target logic block, and the block information comprises the number of effective pages and the position of the block.
Optionally, the block information of the target logical block in the target PC table is sorted according to a preset sorting policy, where the preset sorting policy includes sorting the effective page number in a descending order, or sorting the effective page number in a descending order.
Optionally, the obtaining module 122 is configured to query, according to the number of valid pages, a target PC table corresponding to the target file in the FTL, and obtain the block position of the target logical block, where the obtaining module specifically includes:
and querying the target PC table by adopting a binary search method according to the number of the effective pages to obtain the block position of the target logic block.
Optionally, the apparatus may further include: a first updating module, configured to update the target L2P mapping table and the target PC table when writing the data of the target file to the solid state drive.
Optionally, the first updating module is configured to update the target PC table, and specifically includes:
updating valid page data in the target PC table;
and sorting the block information in the target PC table according to a preset sorting strategy according to the updated effective page number in the target PC table.
Optionally, the L2P mapping table is stored in a form of a linked list, and a mapping from a logical address to a physical address in the L2P mapping table corresponds to a node in the linked list.
Optionally, the PC table is stored in a linked list form, and one piece of block information in the PC table corresponds to one node of the linked list.
Optionally, the apparatus may further include: and the second updating module is used for updating the effective page bitmap VPBM in the FTL according to the target logic block.
Optionally, the delete disable notification command includes a TRIM command or an UNMAP command.
Optionally, the apparatus is applied to the solid state drive, or to a computer device in which an external storage device includes the solid state drive.
The apparatus shown in fig. 12 can perform the method of the embodiment shown in fig. 5 and 8, and reference may be made to the related description of the embodiment shown in fig. 5 and 8, for a part not described in detail in this embodiment. The implementation process and technical effect of the technical solution refer to the description in the embodiments shown in fig. 5 and fig. 8, and are not described herein again.
In one possible implementation, the structure of the control device shown in fig. 12 may be implemented as a solid state disk, and the solid state disk may specifically be a non-open channel solid state disk. As shown in fig. 13, the solid state disk may include: a controller 131 and a memory 132. The memory 132 is configured to store a control method for supporting the solid state disk to execute the solid state disk provided in the method embodiments of fig. 5 and 8, and the controller 131 is configured to execute a program stored in the memory 132.
The program includes one or more computer commands, wherein the one or more computer commands, when executed by the controller 131, enable the following steps:
determining a target logic block to be erased in a solid state drive, wherein the target logic block is determined according to a forbidden deletion notification command, and the forbidden deletion notification command is used for indicating to delete a target file stored in the solid state drive;
according to the target logic block, obtaining a target logic physical L2P mapping table corresponding to the target file in a Flash Translation Layer (FTL); wherein, the mapping tables of L2P corresponding to different files in the FTL are different;
the physical address in the target L2P mapping table is set to be deletable.
Optionally, the controller 131 is further configured to perform all or part of the steps in the method embodiments of fig. 5 and 8.
The solid state disk may further include a communication interface 133 in the structure, and the communication interface is used for the solid state disk to communicate with other devices or a communication network.
In one possible implementation, the structure of the control apparatus shown in fig. 12 may be implemented as a computer device, and the computer device may specifically be a computer device in which the external storage device includes an open channel solid state disk. As shown in fig. 14, the computer apparatus may include: a processor 141 and a memory 142. The memory 142 is used for storing a control method for supporting the computer device to execute the solid state disk provided in the above method embodiments, and the processor 141 is configured to execute the program stored in the memory 142.
The program includes one or more computer commands, wherein the one or more computer commands, when executed by processor 141, enable the following steps:
determining a target logic block to be erased in a solid state drive, wherein the target logic block is determined according to a forbidden deletion notification command, and the forbidden deletion notification command is used for indicating to delete a target file stored in the solid state drive;
according to the target logic block, obtaining a target logic physical L2P mapping table corresponding to the target file in a Flash Translation Layer (FTL); wherein, the mapping tables of L2P corresponding to different files in the FTL are different;
the physical address in the target L2P mapping table is set to be deletable.
Optionally, the processor 141 is further configured to perform all or part of the steps in the foregoing method embodiments of fig. 5 and 8.
The computer device may further include a communication interface 143 for communicating with other devices or a communication network.
Fig. 15 is a schematic structural diagram of a control apparatus of a solid-state drive according to another embodiment of the present application; referring to fig. 15, the present embodiment provides a control apparatus, which may execute the control method of the solid-state drive shown in fig. 11, and specifically, the control apparatus may include:
a determining module 151, configured to determine that a physical address in a mapping table of a target logical physical L2P in the flash translation layer FTL is set to be deletable; wherein the L2P mapping tables corresponding to different files in the FTL are different, and the target L2P mapping table corresponds to a target file which is indicated to be deleted by the forbidden deletion notification command;
an erasing module 152, configured to erase data in a corresponding storage space in the solid state drive according to a logical address in the target L2P mapping table, so as to delete the target file in the solid state drive.
The apparatus shown in fig. 15 can perform the method of the embodiment shown in fig. 11, and reference may be made to the related description of the embodiment shown in fig. 11, for a part of this embodiment that is not described in detail. The implementation process and technical effect of the technical solution refer to the description in the embodiment shown in fig. 11, and are not described herein again.
In one possible implementation, the structure of the control device shown in fig. 15 may be implemented as a solid state disk, and the solid state disk may specifically be a non-open channel solid state disk or an open channel solid state disk. As shown in fig. 16, the solid state disk may include: a controller 161 and a memory 162. The memory 162 is used for storing a control method for supporting the solid state disk to execute the solid state disk provided in the embodiment of the method in fig. 11, and the controller 161 is configured to execute the program stored in the memory 162.
The program includes one or more computer commands, wherein the one or more computer commands, when executed by the controller 161, enable the following steps to be performed:
determining that a physical address in a mapping table of a target logical physical L2P in a Flash Translation Layer (FTL) is set to be deletable; wherein the L2P mapping tables corresponding to different files in the FTL are different, and the target L2P mapping table corresponds to a target file which is indicated to be deleted by the forbidden deletion notification command;
and erasing data in a corresponding storage space in the solid state drive according to the logical address in the target L2P mapping table so as to delete the target file in the solid state drive.
Optionally, the controller 161 is further configured to perform all or part of the steps in the method embodiment of fig. 11.
The solid state disk may further include a communication interface 163, which is used for the solid state disk to communicate with other devices or a communication network.
In addition, the present application provides a computer storage medium for storing computer software commands, which includes a program for executing the method embodiments described above.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that the embodiments can be implemented by adding necessary general hardware platform, and of course, can also be implemented by a combination of hardware and software. With this understanding in mind, the above-described technical solutions and/or portions thereof that contribute to the conventional art may be embodied in the form of a computer program product, which may be embodied on one or more computer-usable storage media having computer-usable program code embodied therein (including but not limited to disk storage, CD-ROM, optical storage, etc.).
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable commands, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (18)

1. A method of controlling a solid state drive, comprising:
determining a target logic block to be erased in a solid state drive, wherein the target logic block is determined according to a forbidden deletion notification command, and the forbidden deletion notification command is used for indicating to delete a target file stored in the solid state drive;
according to the target logic block, obtaining a target logic physical L2P mapping table corresponding to the target file in a Flash Translation Layer (FTL); wherein, the mapping tables of L2P corresponding to different files in the FTL are different;
the physical address in the target L2P mapping table is set to be deletable.
2. The method of claim 1, wherein the obtaining, according to the target logical block, a target L2P mapping table corresponding to the target file in an FTL comprises:
determining a number of valid pages in the target logical block;
according to the number of the effective pages, inquiring data in the FTL to obtain the block position of the target logic block;
and taking the block position of the target logical block as the first address of a target L2P mapping table corresponding to the target file in the FTL to obtain the target L2P mapping table.
3. The method of claim 2, wherein the querying the data in the FTL for the block location of the target logical block according to the number of valid pages comprises:
inquiring a target effective page number PC table corresponding to the target file in the FTL according to the effective page number to obtain the block position of the target logic block; the PC tables corresponding to different target files are different, the target PC tables are used for indicating the block information of each target logic block, and the block information comprises the number of effective pages and the position of the block.
4. The method according to claim 3, wherein the block information of the target logical blocks in the target PC table is sorted according to a preset sorting policy, and the preset sorting policy includes sorting the effective page number in a descending order or sorting the effective page number in a descending order.
5. The method of claim 4, wherein the querying a target PC table corresponding to the target file in the FTL according to the number of valid pages to obtain a block location of the target logical block comprises:
and querying the target PC table by adopting a binary search method according to the number of the effective pages to obtain the block position of the target logic block.
6. The method of claim 3, wherein prior to determining the target logical block to be erased in the solid state drive, further comprising:
updating the target L2P mapping table and the target PC table when writing data of the target file to the solid state drive.
7. The method of claim 6, wherein said updating said target PC table comprises:
updating valid page data in the target PC table;
and sorting the block information in the target PC table according to a preset sorting strategy according to the updated effective page number in the target PC table.
8. The method of any of claims 1-7, wherein the L2P mapping table is stored as a linked list, and wherein a logical address to physical address mapping in the L2P mapping table corresponds to a node in the linked list.
9. The method according to any of claims 3-7, wherein the PC table is stored in a linked list format, and one block information in the PC table corresponds to one node of the linked list.
10. The method according to any one of claims 1-7, further comprising:
and updating the effective page bitmap VPBM in the FTL according to the target logic block.
11. The method of any of claims 1-7, wherein the disable deletion notification command comprises a TRIM command or an UNMAP command.
12. The method according to any of claims 1-7, wherein the method is applied to the solid state drive or to a computer device in which the external storage device comprises the solid state drive.
13. A method of controlling a solid state drive, comprising:
determining that a physical address in a mapping table of a target logical physical L2P in a Flash Translation Layer (FTL) is set to be deletable; wherein the L2P mapping tables corresponding to different files in the FTL are different, and the target L2P mapping table corresponds to a target file which is indicated to be deleted by the forbidden deletion notification command;
and erasing data in a corresponding storage space in the solid state drive according to the logical address in the target L2P mapping table so as to delete the target file in the solid state drive.
14. A control apparatus of a solid state drive, comprising:
the solid state drive comprises a determining module, a deleting module and a judging module, wherein the determining module is used for determining a target logic block to be erased in the solid state drive, the target logic block is determined according to a forbidden deleting notification command, and the forbidden deleting notification command is used for indicating to delete a target file stored in the solid state drive;
an obtaining module, configured to obtain, according to the target logical block, a target logical physical L2P mapping table corresponding to the target file in a flash translation layer FTL; wherein, the mapping tables of L2P corresponding to different files in the FTL are different;
a setting module, configured to set a physical address in the target L2P mapping table to be deletable.
15. A control apparatus of a solid state drive, comprising:
the determining module is used for determining that the physical address in the mapping table of the target logical physical L2P in the flash translation layer FTL is set to be deletable; wherein the L2P mapping tables corresponding to different files in the FTL are different, and the target L2P mapping table corresponds to a target file which is indicated to be deleted by the forbidden deletion notification command;
and the erasing module is used for erasing data in a corresponding storage space in the solid state drive according to the logical address in the target L2P mapping table so as to delete the target file in the solid state drive.
16. A computer device, comprising: a memory, a processor; wherein the memory is to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the method of any of claims 1 to 12.
17. A solid state drive, comprising: a memory, a controller; wherein the memory is to store one or more computer instructions, wherein the one or more computer instructions, when executed by the controller, implement the method of any of claims 1 to 12.
18. A solid state drive, comprising: a memory, a controller; wherein the memory is to store one or more computer instructions, wherein the one or more computer instructions, when executed by the controller, implement the method of claim 13.
CN201911397063.4A 2019-12-30 2019-12-30 Control method, device and equipment for solid state drive Active CN113127376B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911397063.4A CN113127376B (en) 2019-12-30 2019-12-30 Control method, device and equipment for solid state drive

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911397063.4A CN113127376B (en) 2019-12-30 2019-12-30 Control method, device and equipment for solid state drive

Publications (2)

Publication Number Publication Date
CN113127376A true CN113127376A (en) 2021-07-16
CN113127376B CN113127376B (en) 2024-02-27

Family

ID=76767839

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911397063.4A Active CN113127376B (en) 2019-12-30 2019-12-30 Control method, device and equipment for solid state drive

Country Status (1)

Country Link
CN (1) CN113127376B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114201331A (en) * 2022-02-17 2022-03-18 深圳佰维存储科技股份有限公司 Method, device, equipment and storage medium for detecting instruction conflict of solid state disk

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104182349A (en) * 2013-05-27 2014-12-03 联想(北京)有限公司 Information processing method and electronic device
CN105009094A (en) * 2013-03-05 2015-10-28 西部数据技术公司 Methods, devices and systems for two stage power-on map rebuild with free space accounting in a solid state drive
CN105027090A (en) * 2012-10-05 2015-11-04 西部数据技术公司 Methods, devices and systems for physical-to-logical mapping in solid state drives
WO2018072420A1 (en) * 2016-10-20 2018-04-26 华为技术有限公司 Storage management method and storage device
CN109840049A (en) * 2017-11-24 2019-06-04 三星电子株式会社 The storage facilities of data managing method and the operation for executing it
CN110568998A (en) * 2019-09-16 2019-12-13 深圳忆联信息***有限公司 trim command implementation method and device based on solid state disk and computer equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105027090A (en) * 2012-10-05 2015-11-04 西部数据技术公司 Methods, devices and systems for physical-to-logical mapping in solid state drives
CN105009094A (en) * 2013-03-05 2015-10-28 西部数据技术公司 Methods, devices and systems for two stage power-on map rebuild with free space accounting in a solid state drive
CN104182349A (en) * 2013-05-27 2014-12-03 联想(北京)有限公司 Information processing method and electronic device
WO2018072420A1 (en) * 2016-10-20 2018-04-26 华为技术有限公司 Storage management method and storage device
CN109840049A (en) * 2017-11-24 2019-06-04 三星电子株式会社 The storage facilities of data managing method and the operation for executing it
CN110568998A (en) * 2019-09-16 2019-12-13 深圳忆联信息***有限公司 trim command implementation method and device based on solid state disk and computer equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
秦晓安 等: "基于NAND闪存存储器的一种超级块闪存翻译层机制研究", 计算机应用与软件, vol. 32, no. 6 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114201331A (en) * 2022-02-17 2022-03-18 深圳佰维存储科技股份有限公司 Method, device, equipment and storage medium for detecting instruction conflict of solid state disk

Also Published As

Publication number Publication date
CN113127376B (en) 2024-02-27

Similar Documents

Publication Publication Date Title
US10649910B2 (en) Persistent memory for key-value storage
US7694087B2 (en) Duplicate data storing system, duplicate data storing method, and duplicate data storing program for storage device
KR101813786B1 (en) System and method for copy on write on an ssd
US7895394B2 (en) Storage system
US11782632B2 (en) Selective erasure of data in a SSD
CN110018989B (en) Snapshot comparison method and device
KR101933766B1 (en) Methods and systems for improving flash memory flushing
KR20120090965A (en) Apparatus, system, and method for caching data on a solid-state strorage device
KR20100132244A (en) Memory system and method of managing memory system
KR101336258B1 (en) Apparatus and method of processing data of non-volatile memory
US10120583B2 (en) Performance penalty avoidance for solid state drive
CN107704466B (en) Data storage system
US11409451B2 (en) Systems, methods, and storage media for using the otherwise-unutilized storage space on a storage device
US11397530B2 (en) Techniques for prolonging lifespan of storage drives
US10282371B1 (en) Object storage device with probabilistic data structure
CN113127376B (en) Control method, device and equipment for solid state drive
CN118051179A (en) Techniques for partition namespace storage using multiple partitions
CN113157600A (en) Space allocation method of shingled hard disk, file storage system and server
US8909875B1 (en) Methods and apparatus for storing a new version of an object on a content addressable storage system
JP2005316708A (en) Hierarchical storage device, its restoring method and restoration program
US9063656B2 (en) System and methods for digest-based storage
US11461225B2 (en) Storage device, control method of storage device, and storage medium
KR101465426B1 (en) Extent mapping flash device
KR100939814B1 (en) Method of managing and writing log file for flash memory
CN113703671B (en) Data block erasing method and related device

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