Data recovery method, device and equipment and readable storage medium
By determining the target superblock with the least data in the solid-state drive and querying the LMA information set in its P2L table, the problem that the prior art cannot be applied to large-capacity SSDs of 32T and above is solved, and a more efficient data recovery effect is achieved.
Patent Information
- Application Number
- CN202311214906.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-19
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2043-09-19
AI Technical Summary
The mapping table of the existing garbage collection mechanism cannot be used for large-capacity SSDs of 32T and above, and cannot map more physical addresses.
By determining the target superblock with the least data in the solid-state drive and querying the LMA information set of the target data in its corresponding P2L table, a single LMA is a target length greater than 32 bits. If the LMA information set does not exceed the LMA range of the solid state hard disk, and the target data is not Trim operation, and the target PMA information set is consistent with the storage location of the target data, the target data is read from the target super block according to the target PMA information set and stored in the target super block.
The applicability of the garbage collection mechanism has been improved, making it suitable for large-capacity SSDs of 32T and above, and can map more physical addresses, improving the effectiveness and efficiency of data recycling.
Smart Images

Figure CN119668485A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data recovery method, device, equipment and readable storage medium. Background Art
[0002] As the speed and amount of user data generation increases, the amount of data that needs to be stored also increases dramatically. Large-capacity storage hard drives of 16TB (terabytes) and 32TB have emerged. However, the mapping table used by the current garbage collection mechanism cannot map more physical addresses and is not suitable for large-capacity SSDs of 32T and above.
[0003] Therefore, how to make the garbage collection mechanism suitable for SSDs with large capacities of 32T or above is a problem that those skilled in the art need to solve. Summary of the invention
[0004] In view of this, the purpose of this application is to provide a data recovery method, device, equipment and readable storage medium, so that the garbage collection mechanism is applicable to SSDs with large capacities of 32T and above. The specific scheme is as follows:
[0005] In a first aspect, the present application provides a data recovery method, comprising:
[0006] If a data recovery instruction is received, a target super block with the least data is determined in the solid state drive;
[0007] Query the LMA information set corresponding to the target data stored in the target super block in the P2L table corresponding to the target super block; a single LMA is a target length greater than 32 bits;
[0008] If the LMA information set does not exceed the LMA range of the solid state drive, and the target data has not been trimmed, and the target PMA information set corresponding to the LMA information set found in the L2P table is consistent with the storage location of the target data in the target super block, then the target data is read from the target super block according to the target PMA information set, and the target data is stored in the destination super block.
[0009] Optionally, querying the LMA information set corresponding to the target data stored in the target super block in the P2L table corresponding to the target super block includes:
[0010] Determining each media unit occupied by the target data in the target super block;
[0011] Query the LMA corresponding to each medium unit in the P2L table;
[0012] The LMAs corresponding to all the media units are aggregated to obtain the LMA information set.
[0013] Optionally, querying the LMA corresponding to each medium unit in the P2L table includes:
[0014] If the characters of the target length are arranged in sequence in the P2L table, the LMA of the target length corresponding to each media unit is read from the P2L table in the order of each media unit;
[0015] or
[0016] If in the P2L table, 32-bit characters are arranged in sequence and the remaining D-bit characters are arranged in sequence, when the LMA corresponding to each medium unit is queried in the P2L table, the first 32 bits of the current LMA are read first, and then the last D bits of the current LMA are read, and the first 32 bits and the last D bits are concatenated to obtain the LMA of the target length of the current medium unit; D is equal to the target length minus 32.
[0017] Optionally, the value of D is calculated according to a target formula, where R / S≤2 X , where R is the total capacity of the solid state drive, S=4K, and X is the target length, where X is rounded up.
[0018] Optionally, the LMA information set does not exceed the LMA range of the solid state drive, including: any LMA in the LMA information set is not larger than the LMA range.
[0019] Optionally, storing the target data in a destination super block includes:
[0020] Selecting a super block with the least number of erase / write times from among the free super blocks included in the solid state drive as the destination super block;
[0021] Determining, in the destination superblock, a destination PMA information set corresponding to the LMA information set;
[0022] The target data is stored in the destination super block according to the destination PMA information set.
[0023] Optionally, after storing the target data in the destination super block, the method further includes:
[0024] Record the mapping relationship between the destination PMA information set and the LMA information set in the P2L table corresponding to the destination super block;
[0025] The target PMA information set corresponding to the LMA information set in the L2P table is changed to the destination PMA information set.
[0026] Optionally, determining the target super block with the least data in the solid state drive includes:
[0027] Determining the amount of valid data stored in each super block in the solid state drive in a traversal manner;
[0028] The super block with the least amount of valid data is selected as the target super block.
[0029] In a second aspect, the present application provides a data recovery device, comprising:
[0030] A determination module, configured to determine a target super block with the least data in the solid state drive if a data recovery instruction is received;
[0031] A query module, used to query the LMA information set corresponding to the target data stored in the target super block in the P2L table corresponding to the target super block; a single LMA is a target length greater than 32 bits;
[0032] A recovery module is used to read the target data from the target super block according to the target PMA information set and store the target data in the destination super block if the LMA information set does not exceed the LMA range of the solid state drive and the target data has not been trimmed, and the target PMA information set corresponding to the LMA information set found in the L2P table is consistent with the storage location of the target data in the target super block.
[0033] In a third aspect, the present application provides an electronic device, including:
[0034] Memory for storing computer programs;
[0035] The processor is used to execute the computer program to implement the data recovery method disclosed above.
[0036] In a fourth aspect, the present application provides a readable storage medium for storing a computer program, wherein the computer program implements the aforementioned disclosed data recovery method when executed by a processor.
[0037] It can be seen from the above scheme that the present application provides a data recovery method, including: if a data recovery instruction is received, determining the target super block with the least data in the solid-state hard disk; querying the LMA information set corresponding to the target data stored in the target super block in the P2L table corresponding to the target super block; a single LMA is a target length greater than 32 bits; if the LMA information set does not exceed the LMA range of the solid-state hard disk, and the target data has not been Trim operated, and the target PMA information set corresponding to the LMA information set found in the L2P table is consistent with the storage position of the target data in the target super block, then reading the target data from the target super block according to the target PMA information set, and storing the target data in the destination super block.
[0038] It can be seen that the data recovery method provided by the present application is suitable for SSDs with large capacities of 32T and above, because the single LMA provided by the present application is a target length greater than 32 bits, which can map more physical addresses. In addition, the present application also performs validity judgment on the LMA information set in the P2L table, which can improve the validity and efficiency of data recovery. When the LMA information set does not exceed the LMA range of the solid state drive, and the target data is not trimmed, and the target PMA information set corresponding to the LMA information set found in the L2P table is consistent with the storage location of the target data in the target super block, the target data is read from the target super block according to the target PMA information set, and the target data is stored in the destination super block to complete the garbage recovery operation.
[0039] Correspondingly, a data recovery device, equipment and readable storage medium provided by the present application also have the above-mentioned technical effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0041] Figure 1 A flow chart of a data recovery method disclosed in this application;
[0042] Figure 2 A schematic diagram of an LMA layout disclosed in this application;
[0043] Figure 3 A schematic diagram of a data recovery device disclosed in this application;
[0044] Figure 4A schematic diagram of an electronic device disclosed in this application;
[0045] Figure 5 A schematic diagram of a P2L table entry structure disclosed in this application;
[0046] Figure 6 This is another schematic diagram of the P2L table entry structure disclosed in this application;
[0047] Figure 7 A schematic diagram of a garbage recycling process disclosed in this application;
[0048] Figure 8 This is a schematic diagram of an offset index disclosed in this application. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0050] At present, with the increase in the speed and amount of user data generation, the amount of data to be stored has also increased dramatically, and 16TB (terabyte) and 32TB large-capacity storage hard disks have also emerged. However, the mapping table used by the current garbage collection mechanism cannot map more physical addresses and is not suitable for SSDs with a capacity of 32T or more. To this end, the present application provides a data recovery solution that can make the garbage collection mechanism applicable to SSDs with a capacity of 32T or more, thereby improving the effectiveness and efficiency of data recovery.
[0051] See also Figure 1 As shown, the embodiment of the present application discloses a data recovery method, including:
[0052] S101: If a data recovery instruction is received, a target super block with the least data is determined in the solid state drive.
[0053] In this embodiment, determining the target super block with the least data in the solid state drive includes: determining the amount of valid data stored in each super block in the solid state drive in a traversal manner; selecting the super block with the least amount of valid data as the target super block, that is, the block whose space is to be reclaimed.
[0054] S102, querying the LMA information set corresponding to the target data stored in the target super block in the P2L table corresponding to the target super block; a single LMA (Logic Mapping Address) is a target length greater than 32 bits.
[0055] Among them, the P2L (Physical address to Logical address) table uses the physical NAND address as the index and stores the logical address LMA. The L2P (Logical address to Physical address) table uses the logical address LMA as the index and stores the physical address. The L2P table is required in the processes of user data writing, reading, trimming, and GC (Garbage Collection); the P2L table is used in scenarios such as GC and power-on recovery of the L2P table. The validity of the data can also be determined by comparing the LMA data in the table.
[0056] In one embodiment, the LMA information set corresponding to the target data stored in the target super block is searched in the P2L table corresponding to the target super block, including: determining each medium unit (i.e., Au, the minimum read unit of the medium) occupied by the target data in the target super block; searching the LMA corresponding to each medium unit in the P2L table; and summarizing the LMAs corresponding to all medium units to obtain the LMA information set. That is, the LMA information set includes multiple LMAs, each LMA takes a target length, and the target length is greater than 32 bits.
[0057] It should be noted that there are two layout methods for LMA with multiple target lengths: Figure 2 As shown, method 1 is: arrange multiple LMAs of target length in sequence; method 2 is: first arrange multiple 32-bit characters (the lower 32 bits of each LMA) in sequence, and then arrange the high D bits of each LMA. The target length minus 32 equals D. When reading LMAs according to method 1, multiple LMAs of target length can be read in sequence. When reading LMAs according to method 1, it is necessary to first read the lower 32 bits of each LMA, then read the high D bits of each LMA, and then splice the lower 32 bits and high D bits of each LMA to obtain complete LMAs of multiple target lengths.
[0058] In one embodiment, the LMA corresponding to each media unit is queried in the P2L table, including: if the characters of the target length are arranged in sequence in the P2L table, the LMA of the target length corresponding to each media unit is read from the P2L table according to the order of each media unit; or if the characters of 32 bits are arranged in sequence and the remaining D bits are arranged in sequence in the P2L table, when the LMA corresponding to each media unit is queried in the P2L table, the first 32 bits of the current LMA are read first, and then the last D bits of the current LMA are read, and the read first 32 bits and last D bits are concatenated to obtain the LMA of the target length of the current media unit; D is equal to the target length minus 32.
[0059] In one implementation, the value of D is calculated according to the target formula, and the target formula is: R / S≤2X , where R is the total capacity of the SSD, S=4K, and X is the target length, which is rounded up. It can be seen that when the value of S is fixed, the larger the total capacity of the SSD is, the larger the length of a single LMA can be set.
[0060] S103. If the LMA information set does not exceed the LMA range of the solid state drive, and the target data has not been trimmed, and the target PMA information set corresponding to the LMA information set found in the L2P table is consistent with the storage location of the target data in the target super block, then the target data is read from the target super block according to the target PMA information set, and the target data is stored in the destination super block.
[0061] In one implementation, the LMA information set does not exceed the LMA range of the solid state drive, including: any LMA in the LMA information set is not greater than the LMA range. The LMA range of the solid state drive is calculated based on the total capacity of the solid state drive.
[0062] In one embodiment, storing the target data in a destination super block includes: selecting a super block with the least number of erases and writes from a free super block included in a solid-state hard disk as the destination super block; determining a destination PMA information set corresponding to an LMA information set in the destination super block; and storing the target data in the destination super block according to the destination PMA information set.
[0063] In one embodiment, after storing the target data in the destination super block, it also includes: recording the mapping relationship between the destination PMA information set and the LMA information set in the P2L table corresponding to the destination super block to complete the update of the P2L table; changing the target PMA information set corresponding to the LMA information set in the L2P table to the destination PMA information set to complete the update of the L2P table.
[0064] It can be seen that the data recovery method provided in this embodiment is suitable for SSDs with large capacities of 32T and above, because the single LMA provided in this application is a target length greater than 32 bits, which can map more physical addresses. In addition, this application also performs validity judgment on the LMA information set in the P2L table, which can improve the effectiveness and efficiency of data recovery. When the LMA information set does not exceed the LMA range of the solid state drive, and the target data has not been trimmed, and the target PMA information set corresponding to the LMA information set found in the L2P table is consistent with the storage location of the target data in the target super block, the target data is read from the target super block according to the target PMA information set, and the target data is stored in the destination super block to complete the garbage recovery operation.
[0065] A data recovery device provided in an embodiment of the present application is introduced below. The data recovery device described below can be referenced to other embodiments described in this document.
[0066] See also Figure 3 As shown, the embodiment of the present application discloses a data recovery device, including:
[0067] The determination module 301 is used to determine the target super block with the least data in the solid state drive if a data recovery instruction is received;
[0068] A query module 302 is used to query the LMA information set corresponding to the target data stored in the target super block in the P2L table corresponding to the target super block; a single LMA is a target length greater than 32 bits;
[0069] The recovery module 303 is used to read the target data from the target super block according to the target PMA information set and store the target data in the destination super block if the LMA information set does not exceed the LMA range of the solid state drive and the target data has not been trimmed, and the target PMA information set corresponding to the LMA information set found in the L2P table is consistent with the storage location of the target data in the target super block.
[0070] In one implementation, the query module is specifically used to:
[0071] Determine each media unit occupied by the target data in the target super block;
[0072] Query the LMA corresponding to each medium unit in the P2L table;
[0073] The LMAs corresponding to all media units are summarized to obtain an LMA information set.
[0074] In one implementation, the query module is specifically used to:
[0075] If the characters of the target length are arranged in sequence in the P2L table, the LMA of the target length corresponding to each media unit is read from the P2L table in the order of each media unit;
[0076] or
[0077] If in the P2L table, 32-bit characters are arranged in sequence and the remaining D-bit characters are arranged in sequence, when the LMA corresponding to each medium unit is queried in the P2L table, the first 32 bits of the current LMA are read first, and then the last D bits of the current LMA are read, and the first 32 bits and the last D bits are concatenated to obtain the LMA of the target length of the current medium unit; D is equal to the target length minus 32.
[0078] In one implementation, the value of D is calculated according to the target formula, and the target formula is: R / S≤2 X , where R is the total capacity of the SSD, S=4K, and X is the target length, which is rounded up.
[0079] In one implementation, the LMA information set does not exceed the LMA range of the solid state drive, including: any LMA in the LMA information set is not larger than the LMA range.
[0080] In one embodiment, the recovery module is specifically used to:
[0081] Selecting a super block with the least number of erase / write times from among the free super blocks included in the solid state drive as the destination super block;
[0082] Determine the destination PMA information set corresponding to the LMA information set in the destination superblock;
[0083] The target data is stored in the target super block according to the target PMA information set.
[0084] In one embodiment, it further includes:
[0085] The table update module is used to record the mapping relationship between the destination PMA information set and the LMA information set in the P2L table corresponding to the destination super block after storing the target data in the destination super block; and change the target PMA information set corresponding to the LMA information set in the L2P table to the destination PMA information set.
[0086] In one implementation, the determination module is specifically configured to:
[0087] Determine the amount of valid data stored in each super block in the solid state drive in a traversal manner;
[0088] Select the super block with the least amount of valid data as the target super block.
[0089] Among them, for more specific working processes of each module and unit in this embodiment, reference can be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.
[0090] It can be seen that this embodiment provides a data recovery device suitable for SSDs with large capacities of 32T and above, because the single LMA provided in this application has a target length greater than 32 bits, can map more physical addresses, and can also judge the validity of the LMA information set in the P2L table.
[0091] An electronic device provided in an embodiment of the present application is introduced below. The electronic device described below can be referenced to other embodiments described in this document.
[0092] See also Figure 4 As shown, the embodiment of the present application discloses an electronic device, including:
[0093] Memory 401, used for storing computer programs;
[0094] The processor 402 is used to execute the computer program to implement the method disclosed in any of the above embodiments.
[0095] A readable storage medium provided in an embodiment of the present application is introduced below. The readable storage medium described below can be cross-referenced with other embodiments described in this document.
[0096] A readable storage medium is used to store a computer program, wherein the computer program, when executed by a processor, implements the data recovery method disclosed in the above embodiment. The specific steps of the method can refer to the corresponding contents disclosed in the above embodiment, and will not be repeated here.
[0097] The present application is further described below using a 34-bit LMA as an example. First, the LMA in the P2L table is changed to 34 bits, and the layout of the P2L is modified to meet the reading and writing of the LMA in the table, thereby making the P2L table adaptable to large-capacity non-volatile memory and realizing non-volatile storage products with a capacity of 32T or more.
[0098] In one example, starting from the head of the P2L table, the lower 32 bits of each LMA are arranged in sequence, and starting from the end of the P2L table, the upper 2 bits of each LMA are arranged in sequence. When updating and accessing the P2L table, the lower 32 bits of any LMA are combined with its upper 2 bits to form a complete 34-bit data. In another example, starting from the head of the P2L table, each 34-bit LMA is arranged in sequence, and the index number is directly used to find the complete 34-bit LMA when updating and obtaining the LMA. The above two designs can both meet the design of large-capacity P2L tables, so that the space occupied by the P2L table can be minimized while achieving the functionality.
[0099] See also Figure 5 The P2L table entry structure mainly includes three parts: LMA, timestamp and validity bitmap. LMA is the main data of the mapping table, which records the specific logical address corresponding to the physical address; the timestamp (TS) mainly records the time when the user data is written to NAND, which is used when the L2P table is restored after power-on. By comparing the timestamp in the P2L table with the timestamp in the L2P table, the latest valid table entry can be obtained; the validity bitmap is used to describe whether the currently recorded LMA is user data. Among them, Figure 5 The table structure shown can be modified to Figure 6 , so that the P2L table records the 34-bit LMA.
[0100] Update the P2L entry when user data is written to NAND. Figure 6If the table structure 1 in the table is updated, the LMA needs to be split into two parts, the low-order LMA0_0 and the high-order LMA0_1. The low-order 32 bits are taken and the data is written to the position of the low-order LMA of the P2L table, and the high-order 2 bits are taken and the data is written to the position of the high-order LMA of the P2L table. Figure 6 The table structure 2 in the table is directly filled with the 34-bit data of LMA in the P2L table. The updated LMA is determined as follows: the current LMA is equal to P2L[Slma], Slma is the starting bit position of the currently updated LMA in the P2L table, and the starting bit position of the currently updated LMA in the P2L table is equal to its index number (corresponding to the physical address) multiplied by 34.
[0101] It should be noted that garbage collection can free up free space for user data writing. The specific process is: move valid data to a new NAND location. During this process, the P2L table needs to be loaded, and valid data is determined in turn according to the LMA therein, and then the valid data is read and written to the new NAND location. Therefore, GC data movement is divided into three steps: ① Scan P2L to determine data validity, ② Read valid data, and ③ Write data to the new super block address. The first step is to use the LMA data in the P2L table, so the physical address is indexed into the LMA in the table, and then the physical address is obtained again through the L2P table. By comparing the two physical addresses in pairs, it can be determined whether the data is valid. If the physical addresses are equal, it means that the data is valid.
[0102] See also Figure 7 , the LMA splicing and reading process of the P2L table entry is mainly reflected in the GC function. After the garbage collection selects the super block with the smallest valid user data, the data on the super block will be moved. Among them, a parameter of the number of valid user data will be maintained for each super block, and a comparison will be made when the GC selects the source, and the smallest super block will be selected for migration. Before moving the data, it is necessary to load the P2L table of the entire super block, and then parse and read the P2L table, and splice to obtain the LMA data. After the LMA is verified, the valid data is read and written to the new NAND location. Among them, a specific task can be used to splice to obtain the complete LMA, and then judge its validity. The validity judgment includes: whether the LMA is within the user data range max_lma_cnt (the LMA range of the solid-state drive, the solid-state drive is divided by 4K); use the current LMA to index the PMA in the L2P table to determine whether it is equal to the physical location currently scanned.
[0103] See also Figure 8According to the physical address, the 32-bit data of the low-order LMA and the high-order 2-bit data in the P2L table can be indexed. Because the P2L table indexes the logical address with the physical address, its index unit is the Au offset in the super block. That is, according to the offset of each Au on the super block, the P2L table can be checked to obtain the high-order and low-order LMA data, and then the two data are spliced to obtain a complete LMA data.
[0104] It can be seen that this embodiment changes the size of the LMA stored in the P2L table to 34 bits, and modifies the layout of the P2L table. Solution ① groups the lower 32 bits of all LMA data in the P2L table into a set and places it in the front, and the higher 2 bits form another set and place it in the back; Solution ② directly arranges the LMA in the P2L table in 34 bits in a compact manner. The obtained P2L table can meet the needs of SSD systems with a capacity of 32T or above, and saves the space for storing data to the greatest extent, greatly saving DRAM and NAND resources.
[0105] The "first", "second", "third", "fourth", etc. (if any) referred to in this application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods or devices.
[0106] It should be noted that the descriptions involving "first", "second", etc. in this application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0107] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0108] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of readable storage medium known in the art.
[0109] Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A data recovery method, characterized in that: include: If a data recovery instruction is received, a target super block with the least data is determined in the solid state drive; Query the LMA information set corresponding to the target data stored in the target super block in the P2L table corresponding to the target super block; a single LMA is a target length greater than 32 bits; If the LMA information set does not exceed the LMA range of the solid state drive, and the target data has not been trimmed, and the target PMA information set corresponding to the LMA information set found in the L2P table is consistent with the storage location of the target data in the target super block, then the target data is read from the target super block according to the target PMA information set, and the target data is stored in the destination super block.
2. The method according to claim 1, characterized in that The step of searching the LMA information set corresponding to the target data stored in the target super block in the P2L table corresponding to the target super block includes: Determining each media unit occupied by the target data in the target super block; Query the LMA corresponding to each medium unit in the P2L table; The LMAs corresponding to all the media units are aggregated to obtain the LMA information set.
3. The method according to claim 2, characterized in that The querying of the LMA corresponding to each medium unit in the P2L table includes: If the characters of the target length are arranged in sequence in the P2L table, the LMA of the target length corresponding to each media unit is read from the P2L table in the order of each media unit; or If in the P2L table, 32-bit characters are arranged in sequence and the remaining D-bit characters are arranged in sequence, when the LMA corresponding to each medium unit is queried in the P2L table, the first 32 bits of the current LMA are read first, and then the last D bits of the current LMA are read, and the first 32 bits and the last D bits are concatenated to obtain the LMA of the target length of the current medium unit; D is equal to the target length minus 32.
4. The method according to claim 3, characterized in that The value of D is calculated according to the target formula, and the target formula is: R / S≤2 X , where R is the total capacity of the solid state drive, S=4K, and X is the target length, where X is rounded up.
5. The method according to claim 1, characterized in that The LMA information set does not exceed the LMA range of the solid state drive, including: any LMA in the LMA information set is not larger than the LMA range.
6. The method according to any one of claims 1 to 5, characterized in that: The storing the target data into the destination super block comprises: Selecting a super block with the least number of erase / write times from among the free super blocks included in the solid state drive as the destination super block; Determining, in the destination superblock, a destination PMA information set corresponding to the LMA information set; The target data is stored in the destination super block according to the destination PMA information set.
7. The method according to any one of claims 1 to 5, characterized in that: After storing the target data in the destination super block, the method further includes: Record the mapping relationship between the destination PMA information set and the LMA information set in the P2L table corresponding to the destination super block; The target PMA information set corresponding to the LMA information set in the L2P table is changed to the destination PMA information set.
8. A data recovery device, characterized in that: include: A determination module, configured to determine a target super block with the least data in the solid state drive if a data recovery instruction is received; A query module, used to query the LMA information set corresponding to the target data stored in the target super block in the P2L table corresponding to the target super block; a single LMA is a target length greater than 32 bits; A recovery module is used to read the target data from the target super block according to the target PMA information set and store the target data in the destination super block if the LMA information set does not exceed the LMA range of the solid state drive and the target data has not been trimmed, and the target PMA information set corresponding to the LMA information set found in the L2P table is consistent with the storage location of the target data in the target super block.
9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the method according to any one of claims 1 to 7.
10. A readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Garbage recycling method, device and equipment for solid state disk and medium
CN114489489A
Data writing protection method and storage device
CN115639959A
Flash memory device and data management method thereof
CN115994101A
Flash disk array and controller
US20130019057A1