Solid state drive log generation method and solid state drive
By recording and storing FTL logs and write request logs on solid-state drives, the problem of long startup of solid-state storage devices is solved, achieving reliable storage and quick startup within a limited time.
Patent Information
- Application Number
- CN202110245837.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2015-07-21
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2035-07-21
AI Technical Summary
The startup process of a solid-state storage device takes too long due to the need to load a complete FTL table during startup, and it is difficult for the existing technology to reliably store the FTL table within a limited time.
By recording and storing FTL logs and write request logs on the SSD, these logs are used to reconstruct the FTL table, thereby quickly completing table reconstruction at startup.
It significantly shortens the startup time of solid-state storage devices and can reliably store FTL tables after power outage to ensure startup is completed within limited power supply time.
Smart Images

Figure CN112765006B
Abstract
Description
[0001] The application date of this application is July 21, 2015, the application number is 2015104301746, and the invention name is "Solid State Hard Drive" Divisional application for "Log generation method and device". Technical Field
[0002] The present invention relates to electronic equipment, and more specifically, to a log generation method and a startup method of a solid state hard disk and a device thereof. Background Art
[0003] See also Figure 1 , taking a solid state storage device (SSD) as an example of an electronic device, Figure 1 A block diagram of a storage device is shown. The storage device 102 is coupled to a host to provide storage capabilities for the host. The host and the storage device 102 can be coupled in a variety of ways, including but not limited to connecting the host and the storage device 102 through, for example, SATA, IDE, USB, PCIE, NVMe (NVM Express), SCSI, Ethernet, Fiber Channel, wireless communication network, etc. The host can be an information processing device that can communicate with the storage device in the above manner, such as a personal computer, a tablet computer, a server, a portable computer, a network switch, a router, a cellular phone, a personal digital assistant, etc. The storage device 102 includes an interface 103, a control component 104, one or more NVM (non-volatile memory) storage chips 105, and a firmware memory 110. The interface 103 can be adapted to exchange data with the host through, for example, SATA, IDE, USB, PCIE, NVMe, SCSI, Ethernet, Fiber Channel, etc. The control component 104 is used to control data transmission between the interface 103, the NVM storage chip 105 and the firmware memory 110, and is also used for storage management, host logical address to flash physical address mapping, erase leveling, bad block management, etc. The control component 104 can be implemented in a variety of ways such as software, hardware, firmware or a combination thereof. The control component 104 can be in the form of an FPGA (Field-programmable gate array), an ASIC (Application Specific Integrated Circuit) or a combination thereof. The control component 104 may also include a processor or a controller. The control component 104 loads firmware from the firmware memory 110 at runtime. The firmware memory 110 may be a NOR flash memory, a ROM, an EEPROM, etc. The firmware is used to provide underlying functions of electronic devices, such as BIOS, operating system loading, etc.
[0004] A memory target is one or more logic units (Logic Unit) within a NAND flash memory package that share a chip enable (CE) signal. Each logic unit has a logic unit number (LUN). A NAND flash memory package may include one or more dies. Typically, a logic unit corresponds to a single die. A logic unit may include multiple planes. Multiple planes within a logic unit can be accessed in parallel, and multiple logic units within a NAND flash memory chip can execute commands and report status independently of each other. In the "Open NAND Flash Interface Specification (Revision 3.0)" available from http: / / www.micron.com / ~ / media / Documents / Products / Other%20Documents / ONFI3_0Gold.ashx, the meanings of target, logic unit, LUN, and plane are provided.
[0005] MLC (Multi-Level Cell) NVM is a non-volatile memory that can store at least two bits of information in each storage cell. Compared with SLC (Single Level Cell) NVM, it has the characteristics of large storage capacity and low cost, but the storage reliability is not as good as SLC, and data corruption or loss may occur.
[0006] In a solid-state storage device, a Flash Translation Layer (FTL) is used to maintain mapping information from logical addresses to physical addresses. The logical address constitutes the storage space of the solid-state storage device perceived by upper-layer software such as the operating system. The physical address is the address used to access the physical storage unit of the solid-state storage device. In the prior art, address mapping can also be implemented using an intermediate address form. For example, the logical address is mapped to an intermediate address, and the intermediate address is further mapped to a physical address.
[0007] The table structure that stores the mapping information from logical addresses to physical addresses is called the FTL table. The FTL table is an important metadata in solid-state storage devices. Usually, the data items of the FTL table record the address mapping relationship in units of data pages in the solid-state storage device. The FTL table of the solid-state storage device has a large size, such as several GB. When the solid-state storage device is turned off, the FTL table needs to be completely saved, and when the solid-state storage device is started, the FTL needs to be fully loaded.
[0008] In the prior art, the logical address corresponding to each data page of the solid-state storage device is additionally stored. When the solid-state storage device is started, all data pages need to be accessed to obtain the logical address corresponding to each data page and rebuild the FTL table. However, such an operation will take a lot of time and cause the solid-state storage device startup process to take a long time. Summary of the invention
[0009] One object of the present invention is to solve the problem that it takes a long time for a solid-state storage device to load an FTL table. Another object of the present invention is to reliably store the FTL table within a limited time after the solid-state storage device loses power.
[0010] According to a first aspect of the present invention, a first solid-state hard disk startup method is provided, including obtaining a storage location of an FTL (Flash Translation Layer) log on a solid-state hard disk, wherein the FTL log includes a plurality of FTL log data frames, each of which records a portion of an FTL table; reading the FTL log and a write request log from the storage location; wherein the write request log includes a plurality of write request log data frames, each of which includes logical addresses and physical addresses corresponding to a plurality of write requests issued to the solid-state hard disk after a previous write request log data frame is generated; reconstructing the FTL table using the FTL log and the write request log; and completing the startup of the solid-state hard disk.
[0011] According to the first solid-state hard disk startup method of the first aspect of the present invention, a second solid-state hard disk startup method of the first aspect of the present invention is provided, wherein reconstructing the FTL table using the FTL log and the write request log includes: using the FTL log to build a first FTL table; using the write request log to update the first FTL table to obtain a second FTL table.
[0012] According to the second solid-state hard disk startup method of the first aspect of the present invention, a third solid-state hard disk startup method of the first aspect of the present invention is provided, wherein the use of the write request log to update the first FTL table includes sequentially using each write request log data frame of the write request log to update the first FTL table.
[0013] According to the first and second solid-state hard disk startup methods of the first aspect of the present invention, a fourth solid-state hard disk startup method of the first aspect of the present invention is provided, wherein the write request log records all write requests issued to the solid-state hard disk during the creation of the FTL log.
[0014] According to one of the above-mentioned solid-state hard disk startup methods of the first aspect of the present invention, a fifth solid-state hard disk startup method of the first aspect of the present invention is provided, wherein the FTL table reflects the correspondence between the logical address and the physical address of the solid-state hard disk.
[0015] According to one of the above-mentioned solid-state hard disk startup methods of the first aspect of the present invention, a sixth solid-state hard disk startup method of the first aspect of the present invention is provided, wherein on the solid-state hard disk, the FTL log data frame is stored in association with the write request log data frame.
[0016] According to one of the above-mentioned solid state hard disk startup methods of the first aspect of the present invention, a seventh solid state hard disk startup method of the first aspect of the present invention is provided, wherein each FTL log data frame records part of the entire FTL table in sequence.
[0017] According to one of the above-mentioned solid-state hard disk startup methods of the first aspect of the present invention, an eighth solid-state hard disk startup method of the first aspect of the present invention is provided, wherein each write request log data frame includes the logical address and physical address corresponding to the write request issued to the solid-state hard disk after the previous write request log data frame is generated and before the next write request log data frame is generated.
[0018] According to one of the above-mentioned solid-state hard disk startup methods of the first aspect of the present invention, a ninth solid-state hard disk startup method of the first aspect of the present invention is provided, wherein the FTL log records information of the entire FTL table.
[0019] According to one of the above-mentioned solid-state hard disk startup methods of the first aspect of the present invention, a tenth solid-state hard disk startup method of the first aspect of the present invention is provided, wherein the solid-state hard disk includes an MLC NVM (Multi-Level Cell Non-Volatile Memory), and when reading the FTL log and writing the request log from the storage location, the NVM is accessed using the pSLC mode.
[0020] According to a second aspect of the present invention, a computer is provided, comprising a machine-readable memory for storing program instructions; one or more processors for executing the program instructions stored in the memory; the program instructions are used to enable the one or more processors to execute one of the solid-state hard disk startup methods according to the first aspect of the present invention.
[0021] According to a third aspect of the present invention, there is provided a computer program which enables a computer to execute one of the solid state hard disk startup methods according to the first aspect of the present invention.
[0022] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium having a program recorded thereon, wherein the program causes the computer to execute one of the solid state drive booting methods according to the first aspect of the present invention.
[0023] According to a fifth aspect of the present invention, a program is provided, which, when executed by a controller of a solid state drive, causes the solid state drive to execute one of the solid state drive startup methods according to the first aspect of the present invention.
[0024] According to a sixth aspect of the present invention, a solid-state hard disk is provided, comprising a machine-readable memory for storing program instructions, and one or more processors or controllers for executing the program instructions stored in the memory, wherein the program instructions are used to enable the one or more processors or controllers to execute one of the solid-state hard disk startup methods according to the first aspect of the present invention.
[0025] According to a seventh aspect of the present invention, a first solid-state hard disk startup device is provided, including a log positioning module, used to obtain the storage location of an FTL (Flash Translation Layer) log on a solid-state hard disk, wherein the FTL log includes multiple FTL log data frames, each of which records a portion of an FTL table; a log acquisition module, which reads the FTL log and a write request log from the storage location; wherein the write request log includes multiple write request log data frames, each of which includes logical addresses and physical addresses corresponding to multiple write requests issued to the solid-state hard disk after the previous write request log data frame is generated; an FTL table reconstruction module, which is used to reconstruct the FTL table using the FTL log and the write request log; and a startup module, which is used to complete the startup of the solid-state hard disk.
[0026] According to the first solid-state hard disk booting device of the seventh aspect of the present invention, a second solid-state hard disk booting device of the seventh aspect of the present invention is provided, wherein the FTL table reconstruction module includes: an FTL table construction module, used to construct a first FTL table using an FTL log; an FTL table update module, used to update the first FTL table using a write request log to obtain a second FTL table.
[0027] According to the second solid-state hard disk startup device of the seventh aspect of the present invention, a third solid-state hard disk startup device of the seventh aspect of the present invention is provided, wherein the FTL table update module includes an FTL sequential update module, which is used to sequentially use each write request log data frame of the write request log to update the first FTL table.
[0028] According to the first or second solid-state hard disk booting device of the seventh aspect of the present invention, a fourth solid-state hard disk booting device of the seventh aspect of the present invention is provided, wherein the write request log records all write requests issued to the solid-state hard disk during the creation of the FTL log.
[0029] According to the above-mentioned solid-state hard disk startup device of the seventh aspect of the present invention, a fifth solid-state hard disk startup device of the seventh aspect of the present invention is provided, wherein the FTL table reflects the correspondence between the logical address and the physical address of the solid-state hard disk.
[0030] According to the above-mentioned solid-state hard disk startup device of the seventh aspect of the present invention, a sixth solid-state hard disk startup device of the seventh aspect of the present invention is provided, wherein on the solid-state hard disk, the FTL log data frame is stored in association with the write request log data frame.
[0031] According to the above-mentioned solid-state hard disk startup device of the seventh aspect of the present invention, a seventh solid-state hard disk startup device of the seventh aspect of the present invention is provided, wherein each FTL log data frame records part of the entire FTL table in sequence.
[0032] According to the above-mentioned solid-state hard disk startup device of the seventh aspect of the present invention, an eighth solid-state hard disk startup device of the seventh aspect of the present invention is provided, wherein each write request log data frame includes the logical address and physical address corresponding to the write request issued to the solid-state hard disk after the previous write request log data frame is generated and before the next write request log data frame is generated.
[0033] According to the above-mentioned solid-state hard disk booting device of the seventh aspect of the present invention, a ninth solid-state hard disk booting device of the seventh aspect of the present invention is provided, wherein the FTL log records the information of the entire FTL table.
[0034] According to the above-mentioned solid-state hard disk startup device of the seventh aspect of the present invention, a tenth solid-state hard disk startup device of the seventh aspect of the present invention is provided, wherein the solid-state hard disk includes an MLC NVM (Multi-Level Cell Non-Volatile Memory), and when reading the FTL log and writing the request log from the storage location, the pSLC mode is used to access the NVM.
[0035] According to an eighth aspect of the present invention, a log generation method for a first solid-state hard disk is provided, including recording a logical address and a physical address for the solid-state hard disk corresponding to a write request issued to the solid-state hard disk; using a plurality of logical addresses and physical addresses for the solid-state hard disk corresponding to a plurality of the write requests to generate a write request log data frame; obtaining a portion of an FTL table to generate an FTL log data frame; storing the write request log data frame and the FTL log data frame on an NVM (Non-Volatile Memory); and recording the address at which the FTL log data frame is stored on the NVM.
[0036] According to the first solid-state hard disk log generation method of the eighth aspect of the present invention, a second solid-state hard disk log generation method of the eighth aspect of the present invention is provided, which also includes: when the solid-state hard disk is turned off or powered off, the address of the FTL log data frame recorded on the NVM is stored in the NVM.
[0037] According to the first or second solid-state hard disk log generation method of the eighth aspect of the present invention, a third solid-state hard disk log generation method of the eighth aspect of the present invention is provided, wherein the write request log data frame and the FTL log data frame are periodically stored on the NVM.
[0038] According to the first or second solid-state hard disk log generation method of the eighth aspect of the present invention, a fourth solid-state hard disk log generation method of the eighth aspect of the present invention is provided, wherein after the write request log data frame is generated, the write request log data frame and the FTL log data frame are stored on the NVM, and wherein the write request log data frame includes a predetermined number of logical address and physical address pairs.
[0039] According to the above-mentioned solid-state hard disk log generation method of the eighth aspect of the present invention, a fifth solid-state hard disk log generation method of the eighth aspect of the present invention is provided, wherein the obtaining of part of the FTL table to generate an FTL log data frame includes: obtaining part of the FTL table that has not been used to generate an FTL log data frame to generate an FTL log data frame.
[0040] According to the first or second solid-state hard disk log generation method of the eighth aspect of the present invention, a sixth solid-state hard disk log generation method of the eighth aspect of the present invention is provided, wherein the part of obtaining the FTL table and generating the FTL log data frame includes: selecting an FTL table of a predetermined length starting from a first address of the FTL table as a part of the FTL table for generating the FTL log data frame, wherein the part of the FTL table before the first address has been used to generate the FTL log data frame.
[0041] According to the first or second solid-state hard disk log generation method of the eighth aspect of the present invention, a seventh solid-state hard disk log generation method of the eighth aspect of the present invention is provided, wherein the obtaining of the portion of the FTL table that has not been used to generate FTL log entries includes: an FTL table of a predetermined length starting from a first address of the FTL table, as a portion of the FTL table, for generating an FTL log data frame, wherein the portion of the FTL table before the first address has been used to generate an FTL log data frame.
[0042] According to one of the fifth to seventh solid-state hard disk log generation methods of the eighth aspect of the present invention, an eighth solid-state hard disk log generation method of the eighth aspect of the present invention is provided, wherein the total size of the write request log data frame and the FTL log data frame is an integer multiple of the data page size of the solid-state hard disk.
[0043] According to one of the sixth to eighth solid-state hard disk log generation methods of the eighth aspect of the present invention, a ninth solid-state hard disk log generation method of the eighth aspect of the present invention is provided, wherein the NVM (Non-Volatile Memory) is an MLC NVM, and when storing the write request log data frame and the FTL log data frame on the NVM, the NVM is accessed using the pSLC mode.
[0044] According to the above-mentioned solid-state hard disk log generation method of the eighth aspect of the present invention, a tenth solid-state hard disk log generation method 10 of the eighth aspect of the present invention is provided, wherein on the NVM, the write request log data frame is stored in association with the FTL log data frame.
[0045] According to the ninth aspect of the present invention, a computer is provided, comprising a machine-readable memory for storing program instructions; one or more processors for executing the program instructions stored in the memory; the program instructions are used to enable the one or more processors to execute one of the solid-state drive log generation methods according to the eighth aspect of the present invention.
[0046] According to a tenth aspect of the present invention, there is provided a computer program which enables a computer to execute one of the methods for generating a solid state drive log according to the eighth aspect of the present invention.
[0047] According to an eleventh aspect of the present invention, there is provided a computer-readable storage medium having a program recorded thereon, wherein the program causes the computer to execute one of the solid state drive log generation methods according to the eighth aspect of the present invention.
[0048] According to a twelfth aspect of the present invention, there is provided a program which, when executed by a controller of a solid state drive, causes the solid state drive to execute one of the solid state drive log generation methods according to the eighth aspect of the present invention.
[0049] According to the thirteenth aspect of the present invention, a solid-state hard disk is provided, comprising a machine-readable memory for storing program instructions, and one or more processors or controllers for executing the program instructions stored in the memory, wherein the program instructions are used to enable the one or more processors or controllers to execute one of the solid-state hard disk log generation methods according to the eighth aspect of the present invention.
[0050] According to the fourteenth aspect of the present invention, a first log generation device for a solid-state hard disk of the fourteenth aspect of the present invention is provided, including a write log recording module, which is used to record the logical address and physical address for the solid-state hard disk corresponding to the write request based on the write request issued to the solid-state hard disk; a "write" log data frame generation module, which is used to generate a write request log data frame using multiple logical addresses and physical addresses for the solid-state hard disk corresponding to multiple write requests; an FTL log data frame generation module, which is used to obtain part of the FTL table and generate an FTL log data frame; a log storage module, which is used to store the write request log data frame and the FTL log data frame on NVM (Non-Volatile Memory); and an address recording module, which is used to record the address of the FTL log data frame stored on the NVM.
[0051] According to the first log generation device for a solid-state hard disk in the fourteenth aspect of the present invention, a second log generation device for a solid-state hard disk in the fourteenth aspect of the present invention is provided, which also includes: a power-off saving module, which is used to store the recorded address of the FTL log data frame stored on the NVM in the NVM when the solid-state hard disk is shut down or powered off.
[0052] According to the above-mentioned log generation device for a solid state hard disk in the fourteenth aspect of the present invention, a third log generation device for a solid state hard disk in the fourteenth aspect of the present invention is provided, wherein the log storage module is used to periodically store the write request log data frame and the FTL log data frame on the NVM.
[0053] According to the first or second log generating device for a solid state hard disk of the fourteenth aspect of the present invention, a fourth log generating device for a solid state hard disk of the fourteenth aspect of the present invention is provided, wherein after the write request log data frame is generated, the write request log data frame and the FTL log data frame are stored on the NVM, and wherein the write request log data frame includes a predetermined number of logical address and physical address pairs.
[0054] According to one of the above-mentioned log generation devices for solid-state hard disks in the fourteenth aspect of the present invention, a fifth log generation device for solid-state hard disks in the fourteenth aspect of the present invention is provided, wherein the FTL log data frame generation module is used to obtain a part of the FTL table that has not been used to generate FTL log data frames to generate FTL log data frames.
[0055] According to one of the first to fourth log generating devices for solid state hard disks of the fourteenth aspect of the present invention, a sixth log generating device for solid state hard disks of the fourteenth aspect of the present invention is provided, wherein the FTL log data frame generating module is used to select an FTL table of a predetermined length starting from a first address of the FTL table as part of the FTL table for generating an FTL log data frame, wherein the FTL table part before the first address has been used to generate the FTL log data frame.
[0056] According to the fifth log generating device for a solid state hard disk of the fourteenth aspect of the present invention, a seventh log generating device for a solid state hard disk of the fourteenth aspect of the present invention is provided, wherein the obtaining of the portion of the FTL table that has not been used to generate FTL log entries includes: an FTL table of a predetermined length starting from a first address of the FTL table, as a portion of the FTL table, used to generate an FTL log data frame, wherein the portion of the FTL table before the first address has been used to generate an FTL log data frame.
[0057] According to one of the fifth to seventh log generation devices for a solid state hard disk in aspect 14 of the present invention, an eighth log generation device for a solid state hard disk in aspect 14 of the present invention is provided, wherein the total size of the write request log data frame and the FTL log data frame is an integer multiple of the data page size of the solid state hard disk.
[0058] According to one of the sixth to eighth log generation devices for solid-state hard disks of the fourteenth aspect of the present invention, a ninth log generation device for solid-state hard disks of the fourteenth aspect of the present invention is provided, wherein the NVM (Non-Volatile Memory) is an MLC NVM, and when storing the write request log data frame and the FTL log data frame on the NVM, the NVM is accessed using the pSLC mode.
[0059] According to one of the above-mentioned log generating devices for solid state hard disks of the fourteenth aspect of the present invention, a tenth log generating device for solid state hard disks of the fourteenth aspect of the present invention is provided, wherein on the NVM, the write request log data frame is stored in association with the FTL log data frame.
[0060] According to a fifteenth aspect of the present invention, a method for a solid-state hard disk is provided, comprising: based on a write request issued to the solid-state hard disk, recording a logical address and a physical address for the solid-state hard disk corresponding to the write request; using a plurality of logical addresses and physical addresses for the solid-state hard disk corresponding to a plurality of the write requests to generate a write request log data frame; obtaining a portion of an FTL table to generate an FTL log data frame; in NVM (Non-Volatile The invention relates to a method for storing a write request log data frame and a FTL log data frame on a solid-state hard disk (SSD); recording an address of storing the FTL log data frame on an NVM; when the solid-state hard disk is turned off or powered off, storing the recorded address of storing the FTL log data frame on the NVM in the NVM; and, when the solid-state hard disk is started, obtaining a storage location of the FTL log on the solid-state hard disk through the address of storing the FTL log data frame on the NVM stored in the NVM, wherein the FTL log includes a plurality of FTL log data frames, each of which records a portion of an FTL table; reading the FTL log and the write request log from the storage location; wherein the write request log includes a plurality of write request log data frames, each of which includes logical addresses and physical addresses corresponding to a plurality of write requests issued to the solid-state hard disk after a previous write request log data frame is generated; reconstructing the FTL table using the FTL log and the write request log; and completing the startup of the solid-state hard disk.
[0061] According to a sixteenth aspect of the present invention, there is provided a device for a solid-state hard disk, comprising: a "write" log recording module, for recording a logical address and a physical address for the solid-state hard disk corresponding to a write request issued to the solid-state hard disk; a "write" log data frame generation module, for generating a write request log data frame using a plurality of logical addresses and physical addresses for the solid-state hard disk corresponding to a plurality of the write requests; an FTL log data frame generation module, for obtaining a portion of an FTL table and generating an FTL log data frame; a log storage module, for storing the FTL data frame in an NVM (Non-Volatile a non-volatile memory) for storing the write request log data frame and the FTL log data frame on the NVM; an address recording module for recording the address of the FTL log data frame stored on the NVM; a power-off protection module for storing the recorded address of the FTL log data frame stored on the NVM in the NVM when the solid-state drive is turned off or powered off; and a log positioning module for obtaining the storage location of the FTL log on the solid-state drive through the address of the FTL log data frame stored on the NVM stored in the NVM when the solid-state drive is started. , wherein the FTL log includes multiple FTL log data frames, each of which records part of the FTL table; a log acquisition module, used to read the FTL log and the write request log from the storage location; wherein the write request log includes multiple write request log data frames, each of which includes logical addresses and physical addresses corresponding to multiple write requests issued to the solid state drive after the previous write request log data frame is generated; an FTL table reconstruction module, used to reconstruct the FTL table using the FTL log and the write request log; and a startup module, used to complete the startup of the solid state drive. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] The invention, together with the preferred mode of use and further objects and advantages thereof, will be best understood by reference to the following detailed description of illustrative embodiments when read in conjunction with the accompanying drawings, in which:
[0063] Figure 1 is a block diagram of a storage device of the prior art;
[0064] Figure 2 is a structural block diagram of an FTL table according to an embodiment of the present invention;
[0065] Figure 3 is a structural block diagram of a "write" log according to an embodiment of the present invention;
[0066] Figure 4 is a structural block diagram of a solid state drive log according to an embodiment of the present invention;
[0067] Figure 5is a flow chart of a method for generating a solid state drive log according to an embodiment of the present invention;
[0068] Figure 6 is a flow chart of a method for generating a solid state drive log according to another embodiment of the present invention; and
[0069] Figure 7 is a flow chart of a device startup method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0070] Figure 2 : is a structural block diagram of an FTL table according to an embodiment of the present invention. The FTL table includes multiple FTL table entries (or table items). In one embodiment, each FTL table entry records the correspondence between a logical page address and a physical page. In another embodiment, each FTL table entry records the correspondence between a logical block address and a physical block address. In still another embodiment, the FTL table records the mapping relationship between the logical block address and the physical block address, and / or the mapping relationship between the logical page address and the physical page address.
[0071] In still another embodiment, the FTL table is stored in a continuous memory address space, each FTL table entry records a physical address, and the memory address of each FTL table entry itself represents a logical address corresponding to the physical address. The number of FTL table entries corresponds to the size of the solid-state storage device logical address space.
[0072] For the purpose of storing the FTL table in a non-volatile storage medium, the FTL table is organized into data frames. Figure 2 , the FTL table includes data frame 1, data frame 2, data frame 3...data frame n. Each FTL table data frame includes multiple FTL table entries. The size of each FTL table data frame corresponds to the minimum write unit of the non-volatile storage medium (for example, a page). The data page size of the non-volatile storage medium is usually 2KB, 4KB, 8KB or 16KB. In one embodiment, the data page size of the non-volatile storage medium is 16KB, and the data frame size of the FTL table is 2KB, 4KB or 8KB. In another embodiment, the data page size of the non-volatile storage medium is 4KB, and the data frame size of the FTL table is 512B, 1KB or 2KB. Generally, the data frame size of the FTL table is selected so that the data page size of the non-volatile storage medium is an integer multiple of the data frame size of the FTL table, so as to store multiple FTL table data frames in the data page of the non-volatile storage medium. In one example, the data frame 1, data frame 2, data frame 3...data frame n contained in the FTL table are stored continuously in the memory according to the memory address.
[0073] When the solid-state storage device processes a write request, a physical address is allocated to the write request, and the correspondence between the logical address and the physical address of the write request is recorded in the FTL table. In another embodiment, the host accessing the solid-state storage device maintains the FTL table, and when a write request needs to be issued to the solid-state storage, the physical address of the solid-state storage device is allocated to the write request, and the correspondence between the logical address and the physical address of the write request is recorded in the FTL table.
[0074] Figure 3 1 is a structural block diagram of a "write" log according to an embodiment of the present invention. When a solid-state storage device processes a write request, a "write" log is also generated. The "write" log records the logical address and physical address corresponding to the write operation.
[0075] For the purpose of storing the "write" log in the non-volatile storage medium, the "write" log is organized into data frames 310 (see Figure 3 ). Each "write" log data frame 310 includes a plurality of "write" log entries (322, 324, 32n) (or "table entries"). Each "write" log entry (322, 324 or 32n) includes a logical address and a corresponding physical address. The "write" log entries are generated and organized in the write log data frame in the order in which the write requests are received. Therefore, in the "write" log, there may be "write" log entries with the same logical address and / or physical address.
[0076] The size of each "write" log data frame corresponds to the minimum write unit of the non-volatile storage medium (e.g., page). The data page size of the non-volatile storage medium is generally 2KB, 4KB, 8KB, or 16KB. In one embodiment, the data page size of the non-volatile storage medium is 16KB, and the data frame size of the "write" log is 2KB, 4KB, 8KB, or 16KB. In another embodiment, the data page size of the non-volatile storage medium is 4KB, and the data frame size of the "write" log is 512B, 1KB, 2KB, or 4KB. Generally, the data frame size of the "write" log is selected so that the data page size of the non-volatile storage medium is an integer multiple of the "write" log data frame size, so as to store one or more "write" log data frames to the data page of the non-volatile storage medium. In another embodiment, one or more FTL table data frames and one or more "write" log data frames constitute a data page of the non-volatile storage medium.
[0077] Figure 4 4 is a structural block diagram of a solid state drive log according to an embodiment of the present invention. In order to quickly rebuild the directory of the FTL table when the solid state drive is started, a solid state drive log 410 is provided according to an embodiment of the present invention. The solid state drive log 410 includes a plurality of solid state drive log data frames. Figure 4In , multiple solid state drive log data are represented as data frame 1 (422), data frame 2 (424), data frame 3, data frame 4, ..., data frame m (42m). Figure 4 In the embodiment of the present invention, each solid state drive log data frame includes three FTL table data frames and one write log data frame. For example, the solid state drive log data frame 1 (422) includes the FTL table data frame 1 (432), the FTL table L data frame 2 (434), the FTL table data frame 3 (436) and the "write" log data frame 1 (438). The solid state drive log data frame 2 (424) includes the FTL table data frame 4 (442), the FTL table data frame 5 (444), the FTL table data frame 6 (446) and the "write" log data frame 2 (448). The solid state drive log data frame n (42m) includes the FTL table data frame n-2 (452), the FTL table data frame n-1 (454), the FTL table data frame n (456) and the "write" log data frame k (438).
[0078] In an embodiment according to the present invention, the size of the solid state drive log data frame is an integer multiple of the data page size of the non-volatile storage medium, so as to store the solid state drive log data frame in the data page of the non-volatile storage medium. In another embodiment according to the present invention, the non-volatile storage medium is an MLC non-volatile storage medium, and when the solid state drive log data frame is stored in the data page of the non-volatile storage medium, the pSLC (pseudo-SLC) mode or SLC mode is used to access the non-volatile storage medium to speed up the solid state drive log data frame storage process and obtain higher data reliability.
[0079] Those skilled in the art will appreciate that other numbers of FTL table data frames and / or "write" log data frames may be included in the data frames of the solid state drive log 410. The FTL table data frames and the "write" log data frames may also be stored separately in the non-volatile storage medium of the solid state drive.
[0080] In an embodiment according to the present invention, the m solid state drive log data frames of the solid state drive log 410 are organized into a circular queue. When writing the solid state drive log to the solid state drive, data frame 1 (422), data frame 2 (424), data frame 3, data frame 4 until data frame m (42m) are written in sequence. After data frame m (42m) is written, when the solid state drive log needs to be written again, data frame 1 (422) is written again. A solid state drive log write pointer 450 is provided to indicate the last write position of the solid state drive log 410. The solid state drive log write pointer 450 is stored on a non-volatile storage medium. In one embodiment, when the solid state drive is working normally, the solid state drive log write pointer 450 is retained in the memory, and when the solid state drive is turned off or powered off, the solid state drive log write pointer is written to the non-volatile storage medium.
[0081] The solid state disk log 410 includes a plurality of FTL table data frames. The FTL table can be reconstructed using the plurality of FTL table data frames in the solid state disk log 410.
[0082] In an embodiment according to the present invention, a complete FTL table includes n FTL table data frames. In the m SSD log data frames of the SSD log 410, a total of n FTL table data frames are stored. In another embodiment according to the present invention, in the m SSD log data frames of the SSD log 410, a total of 2n FTL table data frames are stored. In the multiple SSD log data frames of the SSD log 410, the FTL table data frames are stored in sequence, for example, according to the storage address where the FTL table itself is located, the FTL table data frames are stored from small to large or from large to small. In one embodiment, the FTL table is stored in a continuous memory, and the memory addresses of the FTL table portions corresponding to the FTL table data frames 1 (432), 2 (434), 3 (436), 4 (442), 5 (444), and 6 (446) in the FTL table are increased in sequence. In another embodiment, a bad block record table of a non-volatile storage medium of a solid state drive is provided, and based on the bad block mapping table, an available block is selected to store m solid state drive data frames of the solid state drive log 410. In still another embodiment, in order to reconstruct a complete FTL table from the solid state drive log 410, a person skilled in the art may adopt other FTL table data frame organization methods.
[0083] In an embodiment according to the present invention, "write" log entries are generated and organized in write log data frames in the order in which write requests are received, and "write" log data frame 1 (438), "write" log data frame 2 (448), ..., "write" log data frame k (458) are generated in the order in which write requests are received.
[0084] Next, a method for generating a solid state drive log according to an embodiment of the present invention is described. Figure 5It is a flowchart of a solid-state hard disk log generation method according to an embodiment of the present invention. When processing a write request, it is necessary to record the correspondence between the logical address and the physical address in the write request (510), and update the FTL table accordingly. The correspondence between the logical address and the physical address recorded in the cache, each correspondence between the logical address and the physical address, constitutes a "write" log entry. A certain number of "write" log entries constitute a "write" log data frame. When the correspondence between the cached multiple logical addresses and the physical addresses can constitute a "write" log data frame, the "write" log data frame is generated using the correspondence between the cached multiple logical addresses and the physical addresses (520). Select a portion of the FTL table to generate an FTL table data frame (530). The portion of the FTL table selected is a portion of the FTL table for which an FTL table data frame has not yet been generated. The generated FTL table data frame and the "write" log data frame constitute a solid-state hard disk log data frame (for example, data frame 1 (422), see Figure 4 In a preferred embodiment, the size of the SSD log data frame corresponds to the data page size of the non-volatile storage medium of the SSD, so that the SSD log data frame can be written to the non-volatile storage medium of the SSD through one write operation of the non-volatile storage medium (540).
[0085] According to another embodiment of the present invention, each time a predetermined number of write requests are received, a "write" log data frame is generated, wherein a "write" log data frame can accommodate the mapping relationship between the logical address and the physical address corresponding to the predetermined number of write requests. Each time a "write" log data frame is generated, a portion of the FTL table is selected to generate one or more FTL table data frames, so that the generated "write" log data frame and the FTL table data frame constitute a solid state drive log data frame.
[0086] According to still another embodiment of the present invention, when processing a write request, the correspondence between the logical address and the physical address corresponding to the write request is cached, and each correspondence between the logical address and the physical address constitutes a "write" log entry. And the cached "write" log entries are periodically used to generate a "write" log data frame. And each time a "write" log data frame is generated, a portion of the FTL table is selected to generate one or more FTL table data frames, so that the generated "write" log data frame and the FTL table data frame constitute a solid state drive log data frame.
[0087] According to still another embodiment of the present invention, the "write" log data frame is physically stored separately from the FTL table data frame. The size of the "write" log data frame corresponds to the data page size of the non-volatile storage medium of the solid state drive, and the size of the FTL table data frame also corresponds to the data page size of the non-volatile storage medium of the solid state drive.
[0088] According to still another embodiment of the present invention, when selecting a portion of the FTL table to generate one or more FTL table data frames, the portion of the FTL table is selected according to the memory address of the FTL table itself. For example, when selecting a portion of the FTL for the first time, a portion of the FTL table with a length of L starting from address 0 is selected to form one or more FTL table data frames. When selecting a portion of the FTL table for the second time, a portion of the FTL table with a length of L starting from address L is selected to form one or more FTL table data frames. When selecting a portion of the FTL table for the Nth time, a portion of the FTL table with a length of L starting from address (N-1)*L is selected to form one or more FTL table data frames. When selecting a portion of the FTL table, if the end of the FTL table is reached when selecting a portion of the FTL table, the portion of the FTL table continues to be selected from the head of the FTL table. In this way, a complete FTL table can be recorded in the solid state drive log. For example, if the overall length of the FTL is n=N*L, when selecting a portion of the FTL table for the N+1th time, a portion of the FTL table with a length of L starting from address 0 is selected. For another example, if the overall length of the FTL table is n=N*L+1, then when selecting a portion of the FTL table for the N+1th time, a portion of the FTL table starting from address N*L with a length of 1 and a portion of the FTL table starting from address 0 with a length of L-1 are selected. There are still other ways to select a portion of the FTL table, so that the complete FTL table can be recorded in the SSD log, and a "write" log of all write requests received during the recording of the complete FTL table can also be recorded.
[0089] In this way, one SSD log data frame is stored in the SSD each time. Even if the SSD loses power, only one SSD log data frame needs to be written to the SSD. Thus, the storage of the FTL table can be completed within the limited working time of the backup power supply.
[0090] Those skilled in the art will appreciate that in some cases, the SSD log does not include a complete FTL table. For example, for a new or blank SSD, a power outage occurs after selecting portions of the FTL table three times to generate FTL table data frames. At this time, only three SSD log data frames are recorded in the SSD log. By marking used data blocks and / or unused data blocks in the SSD log, valid data frames in the SSD log are identified, thereby reconstructing the FTL table when the SSD is powered off.
[0091] Figure 6 FIG. 1 is a flow chart of a method for generating a solid state drive log according to another embodiment of the present invention. Figure 6 The method of the embodiment can be implemented by a solid state drive, and can also be implemented by a host accessing the solid state drive.
[0092] When a write request is received (600), the correspondence between the logical address and the physical address in the write request needs to be recorded (610), and the FTL table (615) is updated accordingly. The correspondence between the logical address and the physical address recorded in the cache, each correspondence between the logical address and the physical address, constitutes a "write" log entry. A certain number of "write" log entries constitute a "write" log data frame. Determine whether the correspondence between the cached multiple logical addresses and the physical addresses can constitute a "write" log data frame (620). When the correspondence between the cached multiple logical addresses and the physical addresses can constitute a "write" log data frame, the correspondence between the cached multiple logical addresses and the physical addresses is used to generate a "write" log data frame. If the correspondence between the cached multiple logical addresses and the physical addresses is not enough to fill a "write" log data frame, wait for the arrival of a subsequent write request.
[0093] When the correspondence between the cached logical addresses and the physical addresses can form a "write" log data frame, a portion of the FTL table is also selected to generate an FTL table data frame (630). The selected portion of the FTL table is a portion of the FTL table that has not yet generated an FTL table data frame. The generated FTL table data frame and the "write" log data frame constitute a solid state drive log data frame (for example, data frame 1 (422), see Figure 4 In a preferred embodiment, the size of the SSD log data frame corresponds to the data page size of the non-volatile storage medium of the SSD, so that the SSD log data frame can be written to the non-volatile storage medium of the SSD through one write operation of the non-volatile storage medium (640).
[0094] For the purpose of reading the SSD log from the SSD, each time a data frame of the SSD log is written to the non-volatile storage medium of the SSD, the storage position of the SSD log data frame on the non-volatile storage medium is also recorded (650). In one embodiment, the m SSD log data frames of the SSD log are organized as a circular queue, so that the complete SSD log can be accessed by storing the storage position of the last time the SSD log was written to the non-volatile storage medium of the SSD. In another embodiment, a monotonically changing sequence number is provided in each SSD data frame, and the storage position of the last time the SSD log was written to the non-volatile storage medium of the SSD is known by identifying the sequence number.
[0095] In this way, one SSD log data frame is stored in the SSD each time. Even if the SSD loses power, only one SSD log data frame needs to be written to the SSD. Thus, the storage of the SSD log data frame can be completed within the limited working time of the backup power supply.
[0096] Figure 7is a flow chart of a device startup method according to an embodiment of the present invention. Figure 7 The method of the embodiment can be implemented by a solid-state drive, or by a host accessing the solid-state drive. When a device such as a solid-state drive is started, the storage location of the solid-state drive log is obtained from a predetermined location in a non-volatile storage medium (710). According to one embodiment of the present invention, the predetermined location of the non-volatile storage medium records the storage location of the last stored solid-state drive log data frame. The complete FTL table and the corresponding "write" log are recorded in the m solid-state drive log data frames before the last storage location. Therefore, the starting storage location and the ending storage location of the solid-state drive log can be obtained based on the last storage location.
[0097] According to the storage location of the solid state disk log, the solid state disk log data frame is read from the non-volatile storage medium. In one example, the solid state disk log data frame includes the FTL table data frame and the "write" log data frame (720). In another example, the FTL table data frame and the "write" log data frame are stored in association on the non-volatile storage medium. If the FTL data frame is obtained, the "write" log data frame can be obtained, and vice versa.
[0098] A plurality of FTL table data frames are read from the non-volatile storage medium, each of the plurality of FTL data frames including a portion of the FTL table, and a complete FTL table can be reconstructed from the plurality of FTL table data frames (730).
[0099] In the multiple "write" log data frames corresponding to these multiple FTL table data frames, the write requests processed by the solid state drive during the generation of these multiple FTL table data frames are fully recorded. The processing of the write request means the updating of the FTL table. Therefore, based on the FTL table reconstructed in step (730), the "write" log data frame entries recorded in the multiple "write" log data frames are used sequentially to update the reconstructed FTL table (740), and the FTL table when the last solid state drive log data frame is written to the non-volatile storage medium of the solid state drive is obtained. Next, the startup of the solid state drive device is completed (750), and the updated FTL table can be used to respond to access requests.
[0100] In one embodiment of the present invention, m SSD log data frames of the SSD log are organized into a circular queue, and a complete FTL table of length n is stored in the SSD log data frame before the storage position in the circular queue by obtaining the storage position of the last time the SSD log is written to the non-volatile storage medium of the SSD. A predetermined number of SSD log data frames are read in the circular queue to obtain a complete SSD log, and the FTL table is reconstructed using the FTL table data frames in the SSD log.
[0101] As another example, see again Figure 4 , the SSD log write pointer 450 indicates that the last write position of the SSD log 410 is data frame 4. In the m SSD log data frames of the SSD log 410, a total of n FTL table data frames are stored. Then, in the SSD log data frame 5 (not shown), the SSD log data frame 6 (not shown), the SSD log data frame 7 (not shown), ..., the SSD log data frame m, the SSD log data frame 1, ..., the SSD log data frame 4, a complete FTL table is stored, and the "write" log of the request occurring during the storage of the complete FTL table is recorded in sequence. The m SSD log data frames recording the complete FTL table are read out from the circular queue, 3*m FTL table data frames are extracted from the m SSD log data frames, and the FTL table is reconstructed. And m "write" log data frames are extracted from the m solid-state hard disk log data frames, and the reconstructed FTL table is sequentially updated according to the order in which the m "write" log data frames are generated, using the correspondence between the logical addresses and the physical addresses recorded in the m "write" log data frames, so as to obtain the FTL table when the final solid-state hard disk log data frame is written to the non-volatile storage medium of the solid-state hard disk.
[0102] The log generation method in the storage device and the process of starting the storage device using the generated log have been disclosed above. Those skilled in the art will also realize that the method or operation process disclosed in the present invention can be implemented by software, firmware, hardware and any combination thereof. The software and firmware that implement the method or operation process of the embodiment of the present invention can be executed by the CPU of the host accessing the storage device, or by an embedded processor or controller integrated in the storage device. The software and firmware that implement the method or operation of the embodiment of the present invention can be stored in a network server, a host accessing the storage device and / or a storage device. The method or operation process according to the embodiment of the present invention can also be implemented by FPGA and / or ASIC. The present invention also provides an electronic system and / or control circuit that implements the disclosed method or operation process.
[0103] The description of the present invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to those skilled in the art.
Claims
1. A log generation method for a solid state drive, comprising: Based on a write request issued to the solid state drive, recording a logical address and a physical address for the solid state drive corresponding to the write request; Generate a write request log data frame using a plurality of logical addresses and physical addresses for the solid state drive corresponding to the plurality of write requests; Obtaining a portion of an FTL table and generating an FTL log data frame, wherein the FTL table reflects the correspondence between the logical address and the physical address of the solid state drive; storing the write request log data frame and the FTL log data frame on the NVM; and Recording the address of storing the FTL log data frame on the NVM; The generated write request log data frame and the FTL log data frame generate a solid state drive log data frame, and the solid state drive log includes a plurality of solid state drive log data frames.
2. The method according to claim 1, further comprising: When the solid state drive is shut down or powered off, the address of the FTL log data frame recorded on the NVM is stored in the NVM.
3. The method according to claim 1, wherein The write request log data frame and the FTL log data frame are periodically stored on the NVM.
4. The method according to claim 1, wherein After the write request log data frame is generated, the write request log data frame and the FTL log data frame are stored on the NVM, wherein the write request log data frame includes a predetermined number of logical address and physical address pairs.
5. The method according to any one of claims 1 to 4, wherein The part of obtaining the FTL table and generating the FTL log data frame includes: A portion of the FTL table that has not been used to generate the FTL log data frame is obtained to generate the FTL log data frame.
6. The method according to any one of claims 1 to 4, wherein The part of obtaining the FTL table and generating the FTL log data frame includes: An FTL table of a predetermined length starting from a first address of the FTL table is selected as a portion of the FTL table for generating an FTL log data frame, wherein the portion of the FTL table before the first address has been used to generate the FTL log data frame.
7. The method according to claim 5, wherein The obtaining of the portion of the FTL table that has not been used to generate the FTL log entry comprises: An FTL table of a predetermined length starting from a first address of the FTL table is used as a portion of the FTL table to generate an FTL log data frame, wherein the portion of the FTL table before the first address has been used to generate the FTL log data frame.
8. The method according to any one of claims 5 to 7, wherein the total size of the write request log data frame and the FTL log data frame is an integer multiple of a data page size of a solid state drive.
9. The method according to any one of claims 6 to 8, wherein the NVM is an MLC NVM, and when storing the write request log data frame and the FTL log data frame on the NVM, the NVM is accessed using a pSLC mode.
10. A solid state drive comprising a machine-readable memory for storing program instructions and one or more processors for executing the program instructions stored in the memory, characterized in that: When the one or more processors execute the program instructions, the method according to any one of claims 1-9 is implemented.
