Data mapping method and related device
By establishing a relocation mapping table in storage-level memory, the wear problem of SCM in the FTL mapping table is solved, the management efficiency is improved, data exceptions and loss is avoided, and the SCM is reduced without adding additional overhead number of writes.
Patent Information
- Application Number
- CN202411242297.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2024-12-27
AI Technical Summary
Frequent writes of storage-level memory (SCM) in solid-state drives (SSDs) lead to wear and tear, resulting in data abnormalities or loss, and the prior art is difficult to effectively solve this problem.
During data writing operation, the FTL mapping table entry is read according to the LBA address. If the number of writes reaches the preset threshold, add new items in the relocation map table and store them in volatile memory to avoid direct Write in SCM to reduce the number of writes to SCM.
By establishing a relocation mapping table, the number of operations on FTL mapping table entries is reduced, the SCM is excessively worn, management efficiency is improved, data abnormalities and loss risks are reduced, while maintaining high-speed performance.
Smart Images

Figure CN119201785A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of storage, and in particular to a data mapping method and related devices. Background Art
[0002] Storage Class Memory (SCM) is an emerging storage technology that combines the characteristics of traditional memory and flash memory. It has both the high-speed read and write performance of memory and the persistent storage capability of flash memory.
[0003] If SCM is used for the FTL (Flash Translate Layer) mapping table of a solid state disk (SSD), the time overhead of saving, restoring, and rebuilding the FTL mapping table can be reduced, and there is no need to reserve nand-flash storage required to save the FTL mapping table, which greatly reduces management and nand-flash storage overhead. However, SCM is not infinitely writable. If certain areas of SCM are written too frequently, the frequently written SCM area will wear out, causing data anomalies or data loss in that area.
[0004] Therefore, how to overcome the SCM wear problem caused by the FTL mapping table of the SCM used in the solid-state drive has become a technical problem that needs to be solved urgently by people in this field. Summary of the invention
[0005] In view of the above problems, the present invention provides a data mapping method and related devices that overcome the above problems or at least partially solve the above problems.
[0006] In a first aspect, a data mapping method includes:
[0007] When performing a data write operation, reading a corresponding FTL mapping table entry according to the LBA address, wherein the FTL mapping table entry is stored in a storage class memory SCM;
[0008] If the content of the FTL mapping table entry is an FBA address, the write count of the FTL mapping table entry increases by 1;
[0009] If the number of write times of the FTL mapping table entry increases by 1 and reaches a preset number threshold, a new relocation mapping table entry is added to the relocation mapping table, and the RAM address of the newly added relocation mapping table entry is written into the FTL mapping table entry, wherein the original content of the FTL mapping table entry is overwritten by the RAM address, and the relocation mapping table is stored in DRAM or SRAM;
[0010] If the write count of the FTL mapping table entry increases by 1 and still does not reach the preset count threshold, the content of the FTL mapping table entry is updated to a new FBA address, wherein the new FBA address is arranged after the most recently updated FBA address, and the original content of the FTL mapping table entry is overwritten by the new FBA address.
[0011] Optionally, in some optional implementations, after reading the corresponding FTL mapping table entry according to the LBA address during the data writing operation, the method further includes:
[0012] If the content of the FTL mapping table entry is a RAM address, the content of the relocation mapping table entry corresponding to the RAM address in the relocation mapping table is updated to a new FBA address, wherein the original content of the relocation mapping table entry corresponding to the RAM address is overwritten by the new FBA address.
[0013] Optionally, in some optional embodiments, the method further comprises:
[0014] Mark the overwritten content to facilitate recycling of the overwritten content.
[0015] Optionally, in some optional embodiments, the method further comprises:
[0016] When performing a data read operation, the corresponding FTL mapping table entry is read according to the LBA address;
[0017] If the content of the FTL mapping table entry is an FBA address, data corresponding to the FBA address is read from the Nand-flash memory.
[0018] Optionally, in some optional implementations, after reading the corresponding FTL mapping table entry according to the LBA address during the data reading operation, the method further includes:
[0019] If the content of the FTL mapping table entry is a RAM address, then reading the content corresponding to the RAM address, wherein the content corresponding to the RAM address is an FBA address;
[0020] According to the FBA address corresponding to the RAM address, corresponding data is read from the Nand-flash memory.
[0021] In a second aspect, a data mapping device includes: a data write operation unit, a write times increasing unit, a remapping adding unit and an FTL updating unit;
[0022] The data writing operation unit is used to read the corresponding FTL mapping table entry according to the LBA address when performing the data writing operation, wherein the FTL mapping table entry is stored in the storage class memory SCM;
[0023] The write count increasing unit is used to increase the write count of the FTL mapping table entry by 1 if the content of the FTL mapping table entry is an FBA address;
[0024] The remapping adding unit is used for adding a relocation mapping table entry in the relocation mapping table if the number of write times of the FTL mapping table entry increases by 1 and reaches a preset number threshold, and writing the RAM address of the newly added relocation mapping table entry into the FTL mapping table entry, wherein the original content of the FTL mapping table entry is overwritten by the RAM address, and the relocation mapping table is stored in DRAM or SRAM;
[0025] The FTL update unit is used to update the content of the FTL mapping table entry to a new FBA address if the number of write times of the FTL mapping table entry increases by 1 and still does not reach the preset number threshold, wherein the new FBA address is arranged after the most recently updated FBA address, and the original content of the FTL mapping table entry is overwritten by the new FBA address.
[0026] Optionally, in certain optional implementations, the apparatus further comprises: a remapping update unit;
[0027] The remapping update unit is used to update the content of the relocation mapping table entry corresponding to the RAM address in the relocation mapping table to a new FBA address after reading the corresponding FTL mapping table entry according to the LBA address during the data write operation, if the content of the FTL mapping table entry is a RAM address, wherein the original content of the relocation mapping table entry corresponding to the RAM address is overwritten by the new FBA address.
[0028] Optionally, in certain optional embodiments, the device further comprises: a label recovery unit;
[0029] The marking recovery unit is used to mark the covered content so as to facilitate recovery of the covered content.
[0030] In a third aspect, a computer-readable storage medium stores a program, wherein the program, when executed by a processor, implements any of the above-mentioned data mapping methods.
[0031] In a fourth aspect, an electronic device comprises at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other through the bus; and the processor is used to call program instructions in the memory to execute any of the data mapping methods described above.
[0032] By means of the above technical scheme, a data mapping method and related devices provided by the present invention can read the corresponding FTL mapping table entry according to the LBA address when performing a data write operation, wherein the FTL mapping table entry is stored in a storage-level memory SCM; if the content of the FTL mapping table entry is an FBA address, the number of write times of the FTL mapping table entry increases by 1; if the number of write times of the FTL mapping table entry increases by 1 and reaches a preset number threshold, a new relocation mapping table entry is added to the relocation mapping table, and the RAM address of the newly added relocation mapping table entry is written to the FTL mapping table entry, wherein the original content of the FTL mapping table entry is overwritten by the RAM address, and the relocation mapping table is stored in a DRAM or SRAM; if the number of write times of the FTL mapping table entry increases by 1 and still does not reach the preset number threshold, the content of the FTL mapping table entry is updated to a new FBA address, wherein the new FBA address is arranged after the most recently updated FBA address, and the original content of the FTL mapping table entry is overwritten by the new FBA address. It can be seen from this that the present invention establishes a corresponding relocation mapping table entry for an LBA address that is written more times, and data operations can be performed based on the relocation mapping table entry subsequently, reducing the number of operations on the FTL mapping table entry corresponding to the LBA address. Without adding other SCMs, it can avoid data anomalies and data loss caused by excessive wear of the SCM.
[0033] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0035] Figure 1 A flow chart of a first data mapping method provided by the present invention is shown;
[0036] Figure 2 A flow chart of a second data mapping method provided by the present invention is shown;
[0037] Figure 3 A flow chart of a third data mapping method provided by the present invention is shown;
[0038] Figure 4 A mapping diagram of data mapping provided by the present invention is shown;
[0039] Figure 5 A schematic structural diagram of a data mapping device provided by the present invention is shown;
[0040] Figure 6 A structural schematic diagram of an electronic device provided by the present invention is shown. DETAILED DESCRIPTION
[0041] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0042] like Figure 1 As shown, the present invention provides a data mapping method, including: S100, S200, S300 and S400;
[0043] S100, when performing a data write operation, reading a corresponding FTL mapping table entry according to an LBA address, wherein the FTL mapping table entry is stored in a storage class memory SCM;
[0044] Optionally, LBA address refers to: Logical Block Address. That is, the host side abstracts the SSD into a continuous logical block address and accesses it randomly. It should be noted that when the program accesses data in the SSD (including data writing and data reading), it generally sends a request based on the LBA address. Therefore, the present invention can read the corresponding FTL mapping table entry based on the LBA address.
[0045] Optionally, the mapping relationship between LBA addresses and FBA addresses is recorded in the FTL mapping table. Since the FTL mapping table is frequently accessed when reading or writing data, the FTL mapping table is generally stored in high-speed memory and refreshed regularly. For large-capacity disks, the FTL mapping table will occupy a large amount of memory. For example, for a 4TB SSD, if each 4KB LBA address corresponds to a 4-byte FTL mapping table entry, then the FTL mapping table will occupy 4GB of memory.
[0046] At present, for high-performance SSDs, the FTL mapping table is usually placed on DRAM. The data write operation will modify the FTL mapping table. Due to the characteristics of DRAM losing data when power is off, these modifications need to be flushed to the Nand-flash memory, and considering the size of the FTL mapping table, even if there is a capacitor, it is impossible to ensure that all modified FTL mapping tables can be flushed in time when power is off. Therefore, it is necessary to introduce mechanisms such as segmented storage, reverse mapping table, garbage collection, and power-on recovery and reconstruction to ensure that after power is restored, the FTL mapping table is consistent with that before power is off, otherwise there will be data loss and abnormalities. The introduction of these mechanisms has brought defects such as write amplification, performance fluctuations, and longer power-on time. The characteristics of SCM now have both the high-speed read and write performance of memory and the persistent storage capacity of flash memory. Therefore, the present invention uses SCM instead of DRAM to store the FTL mapping table, while maintaining high-speed performance, it also avoids the defects caused by the above mechanisms.
[0047] Optionally, the FTL mapping table of the present invention may include multiple FTL mapping table entries, and one FTL mapping table entry corresponds to one LBA address. It should be noted that the content recorded in the FTL mapping table entry may be an FBA address or a RAM address (the RAM address stores the FBA address). Therefore, when reading the content of the FTL mapping table entry, the present invention needs to determine whether the read content is an FBA address or a RAM address. The specific judgment method can be to judge based on the different formats or specific identifiers of the FBA address and the RAM address, and the present invention does not limit this.
[0048] Optionally, in some optional embodiments, after S100, the method further includes: step 1.1;
[0049] Step 1.1: If the content of the FTL mapping table entry is a RAM address, the content of the relocation mapping table entry corresponding to the RAM address in the relocation mapping table is updated to a new FBA address, wherein the original content of the relocation mapping table entry corresponding to the RAM address is overwritten by the new FBA address.
[0050] Optionally, the relocation mapping table established by the present invention is stored in a volatile memory (SRAM or DRAM), and the relocation mapping table can support unlimited writing, so that the subsequent FTL mapping table item update does not need to consider the problem of wear and tear. The FTL mapping table item will not be written again after writing the RMA address of the relocation mapping table item, and only needs to obtain the corresponding FBA address according to the RMA address addressing, even if the FBA address needs to be updated, it is also to update the content (i.e., FBA address) stored in the RMA address of the relocation mapping table item, and does not involve the update of the content in the FTL mapping table item (RMA address is fixed).
[0051] Optionally, the FBA address changes with the data. When new data is written, a corresponding new FBA address needs to be established for the data. Generally, a new FBA address is created in sequence based on the previous FBA address. The present invention does not impose any restrictions on this.
[0052] Optionally, since the content of the FTL mapping table entry is a RAM address, it means that the program has frequently written data based on the LBA address before, and a corresponding relocation mapping table entry has been established for the LBA address. That is, at this time, the content corresponding to the LBA address in the FTL mapping table entry is a fixed RAM address, so the FBA address corresponding to the data (i.e., the new FBA address) should be updated to the relocation mapping table entry, and the original FBA address of the relocation mapping table entry is overwritten by the new FBA address, and the present invention does not limit this.
[0053] S200, if the content of the FTL mapping table entry is an FBA address, the write count of the FTL mapping table entry is increased by 1;
[0054] Optionally, as mentioned above, for LBA addresses (or FTL mapping table entries, because LBA addresses correspond to FTL mapping table entries one-to-one) where data is frequently written, the present invention can accumulate the number of writes within a certain period of time, so as to subsequently establish corresponding relocation mapping table entries for FTL mapping table entries whose number of writes reaches a preset number threshold, and the present invention does not limit this.
[0055] It should be noted that the present invention is not limited to increasing by 1 each time, and may also be increased by 2, or statistics may be performed by subtraction. That is, any statistical method that can reflect whether data is written frequently belongs to the protection scope of the present invention, and the present invention does not limit this.
[0056] S300, if the number of write times of the FTL mapping table entry increases by 1 and reaches a preset number threshold, a new relocation mapping table entry is added to the relocation mapping table, and the RAM address of the newly added relocation mapping table entry is written to the FTL mapping table entry, wherein the original content of the FTL mapping table entry is overwritten by the RAM address, and the relocation mapping table is stored in DRAM or SRAM;
[0057] Optionally, the preset number threshold mentioned in the present invention can be set according to actual needs, and any feasible method belongs to the protection scope of the present invention.
[0058] Optionally, when the number of writes reaches a certain preset number threshold, a relocation mapping table entry needs to be allocated. The allocation mechanism of the relocation mapping table entry is relatively simple, and a relocation mapping table entry can be incrementally added to the position of the allocated relocation mapping table entry.
[0059] Optionally, since volatile memory is used, the relocation mapping table needs to be refreshed and restored. Considering the total writable amount of the SSD and the number of writable times of the SCM, only a very small number of FTL mapping table entries will reach the preset number threshold.
[0060] Taking a 4TB SSD as an example, the FTL mapping table size is 4GB, and the acceptable write volume of the Nand-flash memory is estimated to be 4T×3000 (the number of times the Nand-flash memory can be written) = 12PB. With 4K data as the FTL mapping table granularity, the FTL mapping table entry size is 4B. Therefore, the write volume of the FTL mapping table is 12TB. Assuming that the write threshold of the SCM is 10 8 (10 to the 8th power), then the maximum number of SCMs that can be written is: 12TB÷10 8 =120K, and now the development of SCM technology, 10 8 The preset number threshold is a relatively conservative value. Therefore, in practice, the relocation mapping table may only be tens of KB or even a few KB. Compared with the FTL mapping table, the size of the relocation mapping table is extremely small, and the overhead of refreshing and power-on recovery introduced by it is almost negligible.
[0061] S400. If the number of write times of the FTL mapping table entry increases by 1 and still does not reach the preset number threshold, the content of the FTL mapping table entry is updated to a new FBA address, wherein the new FBA address is arranged after the most recently updated FBA address, and the original content of the FTL mapping table entry is overwritten by the new FBA address.
[0062] Optionally, if the number of write times of the FTL mapping table entry increases by 1 and still does not reach the preset number threshold, the data write operation of the FTL mapping table entry is not particularly frequent, and there is no need to use the relocation mapping table. It is only necessary to update the FTL mapping table normally. The present invention does not limit this.
[0063] Optionally, in certain optional embodiments, the method further comprises: step 2.1;
[0064] Step 2.1: Mark the covered content to facilitate recycling of the covered content.
[0065] Optionally, the present invention may mark the aforementioned covered content as "invalid" so that the marked content can be garbage collected and storage space can be recovered based on the "invalid" mark, and the present invention does not impose any limitation on this.
[0066] Optionally, the above description is a data writing solution. The overall process is as follows: Figure 2 As shown, Figure 2 Please refer to the above explanation for the content, which will not be repeated in this article. The following describes the data reading scheme, that is, in some optional implementations, the method further includes: step 3.1 and step 3.2;
[0067] Step 3.1, when performing a data read operation, read the corresponding FTL mapping table entry according to the LBA address;
[0068] Step 3.2: If the content of the FTL mapping table entry is an FBA address, read the data corresponding to the FBA address from the Nand-flash memory.
[0069] Optionally, if the content of the FTL mapping table entry is an FBA address, the data in the Nand-flash memory can be directly read according to the FBA address according to a conventional reading process, and the present invention does not impose any limitation on this.
[0070] Optionally, in certain optional embodiments, after step 3.1, the method further comprises: step 3.3 and step 3.4;
[0071] Step 3.3: If the content of the FTL mapping table entry is a RAM address, read the content corresponding to the RAM address, wherein the content corresponding to the RAM address is an FBA address;
[0072] Step 3.4: Read corresponding data from the Nand-flash memory according to the FBA address corresponding to the RAM address.
[0073] If the content of the FTL mapping table entry is a RAM address, it is necessary to first perform addressing according to the RAM address, query the content corresponding to the RAM address (FBA address), and then read the data in the Nand-flash memory according to the FBA address obtained by addressing. The present invention does not limit this.
[0074] Optionally, the overall solution for reading the above data is as follows: Figure 3 As stated, Figure 3 Please refer to the above explanation for the content, which will not be elaborated in this article.
[0075] Optionally, in order to further clarify the solution of the present invention, the present invention provides the following Figure 4 The mapping diagram, the mapping relationship between the above relocation mapping table, FTL mapping table and Nand-flash memory is as follows Figure 4 As shown, the present invention is not limited to this.
[0076] The present invention is based on the fact that most LBA addresses can find corresponding FBA addresses by reading FTL mapping table entries once, thereby reducing performance overhead to a certain extent.
[0077] In summary, the present invention solves the wear problem of the SCM used for the FTL mapping table, so that the SCM can be used for the FTL mapping table of the SSD, greatly improving the management efficiency of the FTL mapping table.
[0078] The present invention solves the data anomaly caused by excessive wear of the SCM with a relatively small additional overhead, and can make full use of the SCM to eliminate various defects caused by using the volatile memory as the FTL mapping table: a large amount of Nand-flash memory space required to store the FTL mapping table, performance fluctuations caused by refreshing the FTL mapping table, and a large power-on reconstruction time overhead.
[0079] like Figure 5 As shown, the present invention provides a data mapping device, comprising: a data writing operation unit 100, a writing times increasing unit 200, a remapping adding unit 300 and a FTL updating unit 400;
[0080] The data writing operation unit 100 is used to read the corresponding FTL mapping table entry according to the LBA address when performing the data writing operation, wherein the FTL mapping table entry is stored in the storage class memory SCM;
[0081] The write count increasing unit 200 is used to increase the write count of the FTL mapping table entry by 1 if the content of the FTL mapping table entry is an FBA address;
[0082] The remapping adding unit 300 is used for adding a relocation mapping table entry to the relocation mapping table if the number of write times of the FTL mapping table entry increases by 1 and reaches a preset number threshold, and writing the RAM address of the newly added relocation mapping table entry into the FTL mapping table entry, wherein the original content of the FTL mapping table entry is overwritten by the RAM address, and the relocation mapping table is stored in DRAM or SRAM;
[0083] The FTL update unit 400 is used to update the content of the FTL mapping table entry to a new FBA address if the number of write times of the FTL mapping table entry increases by 1 and still does not reach the preset number threshold, wherein the new FBA address is arranged after the most recently updated FBA address, and the original content of the FTL mapping table entry is overwritten by the new FBA address.
[0084] Optionally, in certain optional implementations, the apparatus further comprises: a remapping update unit;
[0085] The remapping update unit is used to update the content of the relocation mapping table entry corresponding to the RAM address in the relocation mapping table to a new FBA address after reading the corresponding FTL mapping table entry according to the LBA address during the data write operation, if the content of the FTL mapping table entry is a RAM address, wherein the original content of the relocation mapping table entry corresponding to the RAM address is overwritten by the new FBA address.
[0086] Optionally, in certain optional embodiments, the device further comprises: a label recovery unit;
[0087] The marking recovery unit is used to mark the covered content so as to facilitate recovery of the covered content.
[0088] Optionally, in some optional embodiments, the device further comprises: a data reading operation unit and a first data reading unit;
[0089] The data reading operation unit is used to read the corresponding FTL mapping table entry according to the LBA address when performing a data reading operation;
[0090] The first data reading unit is used to read data corresponding to the FBA address from the Nand-flash memory if the content of the FTL mapping table entry is an FBA address.
[0091] Optionally, in certain optional embodiments, the device further comprises: a RAM address reading unit and a second data reading unit;
[0092] The RAM address reading unit is used for, after reading the corresponding FTL mapping table entry according to the LBA address during the data reading operation, if the content of the FTL mapping table entry is a RAM address, reading the content corresponding to the RAM address, wherein the content corresponding to the RAM address is the FBA address;
[0093] The second data reading unit is used to read corresponding data from the Nand-flash memory according to the FBA address corresponding to the RAM address.
[0094] The present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the data mapping method described in any one of the above items is implemented.
[0095] like Figure 6 As shown, the present invention provides an electronic device 70, which includes at least one processor 701, and at least one memory 702 and a bus 703 connected to the processor 701; wherein the processor 701 and the memory 702 communicate with each other through the bus 703; the processor 701 is used to call the program instructions in the memory 702 to execute any of the data mapping methods described above.
[0096] In the present invention, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0097] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0098] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined in the present invention may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown in the present invention, but will conform to the widest scope consistent with the principles and novel features disclosed in the present invention.
[0099] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A data mapping method, characterized in that: include: When performing a data write operation, reading a corresponding FTL mapping table entry according to the LBA address, wherein the FTL mapping table entry is stored in a storage class memory SCM; If the content of the FTL mapping table entry is an FBA address, the write count of the FTL mapping table entry increases by 1; If the number of write times of the FTL mapping table entry increases by 1 and reaches a preset number threshold, a new relocation mapping table entry is added to the relocation mapping table, and the RAM address of the newly added relocation mapping table entry is written into the FTL mapping table entry, wherein the original content of the FTL mapping table entry is overwritten by the RAM address, and the relocation mapping table is stored in DRAM or SRAM; If the write count of the FTL mapping table entry increases by 1 and still does not reach the preset count threshold, the content of the FTL mapping table entry is updated to a new FBA address, wherein the new FBA address is arranged after the most recently updated FBA address, and the original content of the FTL mapping table entry is overwritten by the new FBA address.
2. The method according to claim 1, characterized in that When performing the data writing operation, after reading the corresponding FTL mapping table entry according to the LBA address, the method further includes: If the content of the FTL mapping table entry is a RAM address, the content of the relocation mapping table entry corresponding to the RAM address in the relocation mapping table is updated to a new FBA address, wherein the original content of the relocation mapping table entry corresponding to the RAM address is overwritten by the new FBA address.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: Mark the overwritten content to facilitate recycling of the overwritten content.
4. The method according to claim 1, characterized in that The method further comprises: When performing a data read operation, the corresponding FTL mapping table entry is read according to the LBA address; If the content of the FTL mapping table entry is an FBA address, data corresponding to the FBA address is read from the Nand-flash memory.
5. The method according to claim 4, characterized in that When performing the data reading operation, after reading the corresponding FTL mapping table entry according to the LBA address, the method further includes: If the content of the FTL mapping table entry is a RAM address, then reading the content corresponding to the RAM address, wherein the content corresponding to the RAM address is an FBA address; According to the FBA address corresponding to the RAM address, corresponding data is read from the Nand-flash memory.
6. A data mapping device, characterized in that: include: Data write operation unit, write times increase unit, remapping addition unit and FTL update unit; The data writing operation unit is used to read the corresponding FTL mapping table entry according to the LBA address when performing the data writing operation, wherein the FTL mapping table entry is stored in the storage class memory SCM; The write count increasing unit is used to increase the write count of the FTL mapping table entry by 1 if the content of the FTL mapping table entry is an FBA address; The remapping adding unit is used for adding a relocation mapping table entry in the relocation mapping table if the number of write times of the FTL mapping table entry increases by 1 and reaches a preset number threshold, and writing the RAM address of the newly added relocation mapping table entry into the FTL mapping table entry, wherein the original content of the FTL mapping table entry is overwritten by the RAM address, and the relocation mapping table is stored in DRAM or SRAM; The FTL update unit is used to update the content of the FTL mapping table entry to a new FBA address if the number of write times of the FTL mapping table entry increases by 1 and still does not reach the preset number threshold, wherein the new FBA address is arranged after the most recently updated FBA address, and the original content of the FTL mapping table entry is overwritten by the new FBA address.
7. The device according to claim 6, characterized in that The apparatus further comprises: a remapping update unit; The remapping update unit is used to update the content of the relocation mapping table entry corresponding to the RAM address in the relocation mapping table to a new FBA address after reading the corresponding FTL mapping table entry according to the LBA address during the data write operation, if the content of the FTL mapping table entry is a RAM address, wherein the original content of the relocation mapping table entry corresponding to the RAM address is overwritten by the new FBA address.
8. The device according to claim 6 or 7, characterized in that: The device also includes: a marking recovery unit; The marking recovery unit is used to mark the covered content so as to facilitate recovery of the covered content.
9. A computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, the data mapping method according to any one of claims 1 to 5 is implemented.
10. An electronic device, characterized in that: The electronic device includes at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other through the bus; and the processor is used to call program instructions in the memory to execute the data mapping method as described in any one of claims 1 to 5.
Citation Information
Cited By
Solid state disk and data access acceleration method thereof
CN120973698A
