Data processing method and device and electronic equipment
By using a linked list array of specified sizes and a P2L reverse mapping table in the SSD architecture, the relative offset of the L2P forward mapping table is calculated and recorded, and the problems of low query efficiency and high memory consumption in the existing technology are solved, achieving more efficient random write performance and lower memory usage.
Patent Information
- Application Number
- CN202411616631.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-13
AI Technical Summary
In the existing SSD architecture, the query efficiency of P2L reverse map tables is low and the additional memory consumption is large, resulting in a degradation of random write performance.
By obtaining the linked list array of specified size and the P2L reverse mapping table to be updated, traversing each logical offset address, calculating the number of the L2P forward mapping table to which it belongs. This number uses the method of taking the remaining amount of the specified size, the relative offset corresponding to the L2P forward mapping table is uniformly recorded in each linked list, and the physical offset address of the logical offset address indicated by the relative offset in each linked list is updated.
It improves query efficiency, reduces memory consumption, and improves the performance of small-scale random writes. It is suitable for DRAM-Less architecture.
Smart Images

Figure CN119621606A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data processing method, device and electronic equipment. Background Art
[0002] In the SSD (Solid State Disk) architecture, after the Host data is written into the Nand Flash, its logical address information is usually stored in the P2L (Physical To Logic) reverse mapping table. When the number of entries in the P2L reverse mapping table meets certain conditions, the mapping information in the P2L reverse mapping table needs to be updated to the L2P (Logic To Physical) forward mapping table. In the related technology, a memory segment can be allocated according to the size of the first-level forward mapping table FLM (First Level Map), and a one-way linked list header is stored every 4 bytes. At the same time, a memory segment of the same size as the P2L reverse mapping table to be updated is allocated to store the index information of the linked list. Each linked list stores the logical offset address LAA of the P2L Entry record belonging to the same L2P range. Before the P2L reverse mapping table is synchronously updated, all entries are traversed, and the L2P Index is calculated according to the LAA, and added to the corresponding one-way linked list. When all P2L After the entry is linked, all non-empty one-way linked lists are traversed in turn to load, update and flush L2P until all P2L entries are synchronously updated. However, this solution still has the problem of low query efficiency and large additional memory consumption. Summary of the invention
[0003] The object of the present invention is to provide a data processing method, device and electronic device to improve query efficiency and reduce memory consumption.
[0004] The present invention provides a data processing method, which comprises: obtaining a linked list array of a specified size and a P2L reverse mapping table to be updated; wherein the P2L reverse mapping table to be updated contains multiple logical offset addresses; traversing each logical offset address to determine the number of the L2P forward mapping table to which each logical offset address belongs; for each L2P forward mapping table, calculating the relative offset between each logical offset address in the P2L reverse mapping table to be updated and the specified logical offset address, wherein the specified logical offset address is the first logical offset address in the P2L reverse mapping table to be updated; dividing the number of the L2P forward mapping table by the specified size to obtain a remainder value; adding each relative offset corresponding to the L2P forward mapping table to the linked list corresponding to the remainder value; and updating the physical offset address corresponding to the logical offset address indicated by each relative offset in each linked list.
[0005] Furthermore, the step of updating the physical offset address corresponding to the logical offset address of each relative offset indication in each linked list includes: for each linked list, loading the first L2P forward mapping table to which the first logical offset address of the first relative offset indication in the head node of the linked list belongs; traversing the second logical offset addresses of all second relative offset indications in the linked list that belong to the first L2P forward mapping table, updating the physical offset address corresponding to each second logical offset address, and delinking each second relative offset whose update is completed; repeating the step of loading the first L2P forward mapping table to which the first logical offset address of the first relative offset indication in the head node of the linked list belongs until all relative offsets in the linked list are delinked.
[0006] Furthermore, the method also includes: generating an offset record table based on each relative offset.
[0007] Furthermore, the position of each data in the offset record table corresponds one-to-one to the position of each logical offset address in the P2L reverse mapping table to be updated; for each position, the data in the current position in the offset record table is: the relative offset between the next logical offset address belonging to the same L2P forward mapping table as the current logical offset address in the P2L reverse mapping table to be updated and the specified logical offset address; wherein the current logical offset address is: the logical offset address corresponding to the current position in the P2L reverse mapping table to be updated.
[0008] Furthermore, in the offset record table, each data occupies 2 bytes.
[0009] Furthermore, the linked list array includes a number of linked list headers corresponding to the specified size; the step of adding each relative offset corresponding to the L2P forward mapping table to the linked list corresponding to the remainder value includes: selecting a target linked list header with the remainder value as the subscript from the linked list array; adding each relative offset corresponding to the L2P forward mapping table to the linked list corresponding to the target linked list header.
[0010] Furthermore, each linked list header occupies 4 bytes.
[0011] The present invention provides a data processing device, which comprises: a first acquisition module, which is used to acquire a linked list array of a specified size and a P2L reverse mapping table to be updated; wherein the P2L reverse mapping table to be updated contains multiple logical offset addresses; a traversal module, which is used to traverse each logical offset address and determine the number of the L2P forward mapping table to which each logical offset address belongs; a calculation module, which is used to calculate, for each L2P forward mapping table, the relative offset between each logical offset address in the P2L reverse mapping table to be updated and the specified logical offset address, wherein the specified logical offset address is the first logical offset address in the P2L reverse mapping table to be updated; a second acquisition module, which divides the number of the L2P forward mapping table by a specified size to obtain a remainder value; an adding module, which is used to add each relative offset corresponding to the L2P forward mapping table to the linked list corresponding to the remainder value; and an updating module, which is used to update the physical offset address corresponding to the logical offset address indicated by each relative offset in each linked list.
[0012] An electronic device provided by the present invention includes a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement any of the above data processing methods.
[0013] The present invention provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement any of the above-mentioned data processing methods.
[0014] The data processing method, device and electronic device provided by the present invention obtain a linked list array of a specified size and a P2L reverse mapping table to be updated; wherein the P2L reverse mapping table to be updated contains multiple logical offset addresses; traverse each logical offset address to determine the number of the L2P forward mapping table to which each logical offset address belongs; for each L2P forward mapping table, calculate the relative offset between each logical offset address in the P2L reverse mapping table to be updated and the specified logical offset address, wherein the specified logical offset address is the first logical offset address in the P2L reverse mapping table to be updated; divide the number of the L2P forward mapping table by the specified size to obtain a remainder value; add each relative offset corresponding to the L2P forward mapping table to the linked list corresponding to the remainder value; and update the physical offset address corresponding to the logical offset address indicated by each relative offset in each linked list. This method uses a linked list array of a specified size. By taking the modulo of the specified size by the number of the L2P forward mapping table to which the logical offset address belongs, each relative offset corresponding to the L2P forward mapping table is evenly recorded in each linked list, which can improve query efficiency and reduce memory consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0016] Figure 1 A schematic diagram of a data processing method in the prior art;
[0017] Figure 2 A schematic diagram of another data processing method in the prior art;
[0018] Figure 3 A flowchart of a data processing method provided by an embodiment of the present invention;
[0019] Figure 4 A schematic diagram of a chain hanging rule provided by an embodiment of the present invention;
[0020] Figure 5 A schematic diagram of a data processing method provided by an embodiment of the present invention;
[0021] Figure 6 A schematic diagram of a record table provided in an embodiment of the present invention;
[0022] Figure 7 A schematic diagram of the structure of a data processing device provided by an embodiment of the present invention;
[0023] Figure 8 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0024] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] Currently, there are usually two synchronous update solutions for updating the mapping information in the P2L reverse mapping table to the L2P forward mapping table:
[0026] Existing solution 1: Figure 1The schematic diagram of a data processing method in the prior art is shown, firstly, an L2P forward mapping table to which an LAA that has not been updated synchronously in a P2L reverse mapping table belongs is loaded, the P2L reverse mapping table is traversed, all LAAs belonging to this L2P forward mapping table are found, the corresponding physical offset address PAA (Logical Access Address) in the L2P forward mapping table is updated, and these entries are marked as updated, and then the L2P forward mapping table is refreshed; the next P2L Entry that needs to be updated synchronously is searched, the L2P forward mapping table where it is located is calculated and loaded, and the P2L reverse mapping table is traversed to perform the same update and refresh operation until the synchronous update of all P2L Entries is completed.
[0027] Existing solution 2: Figure 2 The schematic diagram of another data processing method in the prior art is shown, a memory is allocated according to the size of the first-level forward mapping table FLM (First Level Map, each 4 bytes records the PAA of an L2P), and a one-way linked list header is stored every 4 bytes (corresponding to the second table in the figure), and a memory of the same size as the P2L reverse mapping table is allocated to store the index information of the linked list (not shown in the figure), and each linked list stores the logical offset address of the P2L Entry within the range of the same L2P forward mapping table; before the P2L reverse mapping table is synchronously updated, all entries are traversed, and the L2P forward mapping table to which they belong is calculated according to the LAA, and added to the corresponding one-way linked list. After all P2L Entries are linked, all non-empty one-way linked lists are traversed in turn to load, update and flush the L2P forward mapping table until the synchronous update of all P2L Entries is completed.
[0028] However, the above schemes still have some problems. The following describes the shortcomings of the two existing schemes respectively. Disadvantages of existing scheme 1: Although this scheme does not require additional memory overhead, it occupies a large amount of CPU resources for invalid P2L in random write scenarios. Entry query, assuming that there are a total of M entries in the P2L reverse mapping table to be updated synchronously, and the LAAs in these entries are distributed on X L2P forward mapping tables. Since each L2P forward mapping table needs to traverse the entire P2L reverse mapping table from the first unupdated entry, the number of queries is Count = (2M + 1-X) × X / 2; taking 1G range random write as an example, assuming that the size of the P2L reverse mapping table is 4K, containing 1024 entries, and one L2P forward mapping table maps 32M data, then the 1G range contains 32 L2P forward mapping tables, which need to be queried 32272 times. For more extreme full-disk random, each entry belongs to a different L2P forward mapping table, which needs to be queried 524800 times; Therefore, this solution consumes a lot of CPU resources to query invalid entries, resulting in a decrease in random performance, and its performance will significantly decrease with the increase of the P2L reverse mapping table.
[0029] Disadvantages of the existing solution 2: Assuming that the size of the P2L reverse mapping table to be updated synchronously is 4K and contains 1024 entries, after the solution traverses the P2L reverse mapping table to complete all entry chaining operations, since the chain operation does not need to query invalid P2L entries, the entire update process needs to query P2L entries 1024 times in total, saving a lot of query time; however, this solution needs to consume a lot of time to query non-empty linked lists, and the number of queries is related to the size of FLM. Taking 512G capacity as an example, assuming that an L2P forward mapping table maps 32M data, a total of 16K linked list headers are required, and a total of 16384 linked list headers are required to query the linked list headers; at the same time, the additional memory overhead of this solution is large. First, 4K memory is required to store the logical offset address of P2LEntry. Secondly, the same size of memory as FLM is required to store the same number of linked list headers as the L2P forward mapping table, which is used to index the P2L in the P2L reverse mapping table that is in the same L2P forward mapping table range as LAA. Entry, also taking 512G capacity as an example, assuming that one L2P forward mapping table maps 32M data, a total of 16K L2P forward mapping tables are required, therefore, 64K memory is required to store the linked list header, a total of 68K additional memory is required, and a 1T capacity disk requires 132K additional memory; this solution consumes a large amount of additional memory, which is extremely unfriendly to the DRAM-Less (referring to a solid-state hard disk without DRAM cache, where DRAM is called Dynamic Random Access Memory in English, and dynamic random access memory in Chinese) architecture. Based on this, the embodiment of the present invention provides a data processing method, device and electronic device, which can be applied to applications that require synchronous update of the P2L reverse mapping table.
[0030] To facilitate understanding of this embodiment, a data processing method disclosed in an embodiment of the present invention is first introduced. Figure 3 As shown, the method comprises the following steps:
[0031] Step S302, obtaining a linked list array of a specified size and a P2L reverse mapping table to be updated; wherein the P2L reverse mapping table to be updated includes a plurality of logical offset addresses;
[0032] The above-mentioned specified size can be set according to actual needs, for example, it can be 32, etc. The size of the linked list array is generally set with reference to the range of random write test. For example, the commonly used performance testing tools ASSD (a solid state drive detection tool) and CDM (a hard disk performance testing tool) will test the random write performance of the 1G range. Assuming that there are 32 L2P forward mapping tables in the 1G range, the size of the linked list array is generally set to 32, so that the nodes of each linked list belong to an L2P forward mapping table, and all are processed after traversing once. If there are 32 nodes, only 32 queries are required; if the size of the linked list array is set to 16, then each linked list contains nodes of two L2P forward mapping tables. If there are 32 nodes, 32+16 queries are required; the 1G range array size is set to 64, half of the linked lists are empty, and the non-empty linked list also contains 32 valid nodes. The empty header query caused by the excessively large array will also affect the overall query efficiency. Therefore, it is necessary to set a suitable linked list array size based on actual needs.
[0033] The above-mentioned linked list array usually includes multiple linked list headers. For example, if the specified size is 32, it means that the linked list array includes 32 linked list headers, and each linked list header corresponds to a linked list; the above-mentioned P2L reverse mapping table to be updated usually records the logical address of the data stored in a continuous physical space. Each entry in the table occupies 4 bytes. The entry records the logical offset address of the Host data in the table entry mapping granularity (usually 4K), that is, LAA (Logic Access Address). LAA refers to the address used by the user when programming in the computer system; in actual implementation, when the P2L reverse mapping table to be updated needs to be updated synchronously, that is, when the mapping information in the P2L reverse mapping table to be updated needs to be updated to the L2P forward mapping table, the above-mentioned P2L reverse mapping table to be updated can be obtained first, and the pre-configured linked list array of the specified size can be obtained at the same time.
[0034] Step S304, traverse each logical offset address, and determine the number of the L2P forward mapping table to which each logical offset address belongs;
[0035] The number of the above-mentioned L2P forward mapping table can be expressed as L2P Index; in actual implementation, after obtaining the above-mentioned P2L reverse mapping table to be updated, each logical offset address in the P2L reverse mapping table to be updated can be traversed to determine the number of the L2P forward mapping table to which each logical offset address belongs; for example, the number of LAAs contained in each L2P forward mapping table is usually pre-configured. For example, taking each L2P table containing 8 LAAs as an example, LAA0~LAA7 can correspond to the first L2P forward mapping table L2P0, LAA8~LAA15 can correspond to the second L2P forward mapping table L2P1, and so on. According to each logical offset address, the number of the L2P forward mapping table to which it belongs can be determined.
[0036] Step S306, for each L2P forward mapping table, calculating the relative offset between each logical offset address in the P2L reverse mapping table to be updated and the specified logical offset address, wherein the specified logical offset address is the first logical offset address in the P2L reverse mapping table to be updated;
[0037] In actual implementation, for each L2P forward mapping table, the relative offset between each logical offset address in the L2P forward mapping table and the first logical offset address in the P2L reverse mapping table to be updated can be calculated respectively. For example, the relative offset between a certain logical offset address belonging to the first L2P forward mapping table L2P0 and the first logical offset address in the P2L reverse mapping table to be updated is 5, etc.
[0038] Step S308, dividing the number of the L2P forward mapping table by a specified size to obtain a remainder value;
[0039] In actual implementation, after determining the number of the L2P forward mapping table to which each logical offset address belongs, the number of the L2P forward mapping table to which each logical offset address belongs can be divided by the specified size of the linked list array and the remainder value can be taken. The minimum remainder value can be 0 and the maximum can be (specified size - 1).
[0040] Step S310, adding each relative offset corresponding to the L2P forward mapping table to the linked list corresponding to the remainder value;
[0041] Step S312: Update the physical offset address corresponding to each logical offset address indicated by each relative offset in each linked list.
[0042] In actual implementation, after determining the remainder value corresponding to each L2P forward mapping table, each relative offset corresponding to the L2P forward mapping table can be added to the linked list corresponding to the corresponding remainder value for each L2P forward mapping table. For example, the L2P forward mapping table to which the logical offset address belongs is numbered I, and the specified size of the linked list array is Y. Then, each relative offset corresponding to the L2P forward mapping table can be added to the linked list ast_ListHead[I%Y]; and then, the physical offset address corresponding to the logical offset address indicated by each relative offset in each linked list can be updated.
[0043] The above data processing method obtains a linked list array of a specified size and a P2L reverse mapping table to be updated; wherein the P2L reverse mapping table to be updated contains multiple logical offset addresses; traverses each logical offset address to determine the number of the L2P forward mapping table to which each logical offset address belongs; for each L2P forward mapping table, calculates the relative offset between each logical offset address in the P2L reverse mapping table to be updated and the specified logical offset address, wherein the specified logical offset address is the first logical offset address in the P2L reverse mapping table to be updated; divides the number of the L2P forward mapping table by the specified size to obtain a remainder value; adds each relative offset corresponding to the L2P forward mapping table to the linked list corresponding to the remainder value; and updates the physical offset address corresponding to the logical offset address indicated by each relative offset in each linked list. This method uses a linked list array of a specified size. By taking the modulo of the specified size by the number of the L2P forward mapping table to which the logical offset address belongs, each relative offset corresponding to the L2P forward mapping table is evenly recorded in each linked list, which can improve query efficiency and reduce memory consumption.
[0044] The embodiment of the present invention also provides another data processing method, which is implemented on the basis of the method of the above embodiment. In this method, the linked list array includes a number of linked list headers corresponding to the specified size. The specified size is Y, and the multiple linked list headers included in the linked list array can be respectively expressed as: ast_ListHead[0], ast_ListHead[1]...ast_ListHead[Y-1]; each linked list header occupies 4 bytes, that is, one linked list header is stored every 4 bytes. The method comprises the following steps:
[0045] Step 1: Obtain a linked list array of a specified size and a P2L reverse mapping table to be updated; wherein the P2L reverse mapping table to be updated includes multiple logical offset addresses;
[0046] Step 2: traverse each logical offset address and determine the number of the L2P forward mapping table to which each logical offset address belongs;
[0047] Step 3: For each L2P forward mapping table, calculate the relative offset between each logical offset address in the P2L reverse mapping table to be updated and the specified logical offset address, wherein the specified logical offset address is the first logical offset address in the P2L reverse mapping table to be updated;
[0048] Step 4: Divide the number of the L2P forward mapping table by the specified size to obtain a remainder value;
[0049] Step 5, select the target linked list header with the remainder value as the subscript from the linked list array;
[0050] For example, taking the multiple linked list headers included in the linked list array as: ast_ListHead[0], ast_ListHead[1]...ast_ListHead
[31] as an example, if the calculated remainder value is 0, ast_ListHead[0] can be selected as the target linked list header. If the calculated remainder value is 31, ast_ListHead
[31] can be selected as the target linked list header.
[0051] Step 6: Add each relative offset corresponding to the L2P forward mapping table to the linked list corresponding to the target linked list header.
[0052] For example, if the target linked list header is ast_ListHead[0], each relative offset corresponding to the L2P forward mapping table can be added to the linked list corresponding to the target linked list header ast_ListHead[0]. Figure 4 As shown in the schematic diagram of a chain link rule, the specified size of the linked list array is Y, and X is any integer such as 0, 1, 2, etc., then the number of the L2P forward mapping table corresponding to the first linked list header ast_ListHead[0] is X times Y, such as L2P[0], L2P[Y], L2P[X×Y], etc., and so on, the number of the L2P forward mapping table corresponding to each subsequent linked list header can be determined.
[0053] For another example, assuming that the linked list array is array[] and the specified size is 32, it is array
[32] . Since 0%32=0, 32%32=0, 64%32=0, etc., the nodes in the forward mapping table L2P0, forward mapping table L2P332, forward mapping table L2P64, and forward mapping table L2P32×X are all added to array[0], which corresponds to the first linked list header ast_ListHead[0]. Since 1%32=1, 33%32=1, 65%32=1, etc., the nodes in the forward mapping table L2P 1. All nodes in the range of forward mapping table L2P33, forward mapping table L2P65, and forward mapping table L2P32×X+1 are added to array[1], which corresponds to the second linked list head ast_ListHead[1]. Similarly, all nodes in the range of forward mapping table L2P31, forward mapping table L2P63, forward mapping table L2P127, and forward mapping table L2P32×X+31 are added to array
[31] , which corresponds to the last linked list head ast_ListHead
[31] .
[0054] Step 7: For each linked list, load the first L2P forward mapping table to which the first logical offset address indicated by the first relative offset in the head node of the linked list belongs;
[0055] The above-mentioned head node can be understood as the first node of the linked list; the above-mentioned first relative offset is the relative offset located in the first node; in actual implementation, the first L2P forward mapping table to which it belongs can be loaded according to the first logical offset address indicated by the first relative offset located in the head node.
[0056] Step 8, traversing the second logical offset addresses of all second relative offset indications belonging to the first L2P forward mapping table in the linked list, updating the physical offset address corresponding to each second logical offset address, and delinking each updated second relative offset;
[0057] All the second relative offsets traversed above include the first relative offset, and correspondingly, the second logical offset addresses indicated by all the second relative offsets also include the first logical offset address. In actual implementation, the linked list can be traversed to traverse all the second relative offsets belonging to the first L2P forward mapping table from the linked list, and then determine the second logical offset address indicated by each second relative offset. For example, taking each L2P forward mapping table containing 8 LAAs as an example, the logical offset address indicated by the first relative offset in the head node is LAA0, and the first L2P forward mapping table to which it belongs is L2P0. By traversing the linked list, it is determined that the second logical offset addresses indicated by all the second relative offsets belonging to the first L2P forward mapping table in the linked list include LAA0, LAA7 and LAA4. Then, the physical offset addresses PAA of LAA0, LAA7 and LAA4 can be updated sequentially. After the update is completed, each traversed second relative offset can be unlinked from the linked list.
[0058] Step nine, repeatedly executing the step of loading the first L2P forward mapping table to which the first logical offset address indicated by the first relative offset in the head node of the linked list belongs, until all relative offsets in the linked list are unlinked.
[0059] In actual implementation, since the relative offset is linked by taking the modulo the specified size of the linked list array by the number of the L2P forward mapping table to which the logical offset address belongs, the same linked list may contain relative offsets belonging to different L2P forward mapping tables. At this time, the process in steps seven to nine above can be repeated until all relative offsets in the linked list are unlinked; for example, continuing with the example in step eight above, since the relative offsets corresponding to LAA0, LAA7 and LAA4 have been unlinked in the linked list, the first logical offset address indicated by the first relative offset in the head node in the updated linked list obtained after unlinking is also updated, and correspondingly, the first L2P forward mapping table to which it belongs is also updated. By repeatedly executing the above process, the update of the physical offset address corresponding to the second logical offset address of each second relative offset indication in the linked list can be completed.
[0060] For easier understanding, see Figure 5 1 is a schematic diagram of a data processing method shown in FIG. 1 , in which each L2P forward mapping table contains 8 LAAs, and the linked list corresponding to the first linked list header ast_ListHead[0] is taken as an example. It should be noted that what is actually added to the linked list is a relative offset. For the convenience of explanation, Figure 5The logical offset address indicated by each relative offset is shown in the figure; the L2P where the address LAA is located is loaded in sequence, and the linked list is traversed to update the PAA corresponding to all LAAs in the range of this L2P, and the link is removed at the same time, and the current L2P forward mapping table is refreshed, and then the next L2P pointed to by the head node is processed until all nodes in the current linked list are processed; then the next linked list is processed, and finally all non-empty linked lists are processed, and the P2L reverse mapping table is updated synchronously. Specifically, as Figure 5 As shown in FIG. 1 , the nodes in the linked list header ast_ListHead[0] are distributed on L2P 0, L2P 32, and L2P 64. The first step is to query the LAA 0 indicated by the relative offset in the head node, calculate the L2P where it is located as L2P 0, load L2P 0, update the nodes within the range of L2P 0 (LAA 0, LAA 7, LAA 4), and remove the corresponding relative offsets. After the processing, the node status is as shown in STEP 2; the second step is to query the LAA 257 indicated by the relative offset in the head node, calculate the L2P where it is located as L2P 32, load L2P 32, update the nodes within the range of L2P 32 (LAA 257, LAA 258, LAA 256), and remove the corresponding relative offsets; the third step is to query the LAA 517 indicated by the relative offset in the head node, calculate the L2P where it is located as L2P 64. Do the same operation after loading; until all nodes are processed and the P2L reverse mapping table is updated synchronously.
[0061] Step ten: Generate an offset record table based on each relative offset.
[0062] The position of each data in the offset record table corresponds one-to-one to the position of each logical offset address in the P2L reverse mapping table to be updated; for each position, the data in the current position in the offset record table is: in the P2L reverse mapping table to be updated, the relative offset between the next logical offset address belonging to the same L2P forward mapping table as the current logical offset address and the specified logical offset address; wherein the current logical offset address is: the logical offset address corresponding to the current position in the P2L reverse mapping table to be updated.
[0063] For easier understanding, see Figure 6 A schematic diagram of a record table shown in FIG. 1 ; the diagram takes an L2P that can store 8 LAAs as an example, Figure 6The second table in the table is the table used in the existing solution 2 to record the absolute physical address. The L2P0 corresponding linked list head points to 0x10000010→0x10000014→0x10000034→0x10000044→0x10000070→0x10000074→0x1000007c→0xffffffff; for example, the 16-byte 0x10000014 corresponds to the decimal 20, and each entry is 4 bytes, then 20 / 4=5, corresponding to Figure 6 The offset in the first table is 5 (the first position in the first table starts at 0), that is, 0x10000014 is the next address pointed to.
[0064] Figure 6 The third table in the figure is the offset record table used in this solution to record relative offsets. The head of the linked list corresponding to L2P0 points to the offset 4→5→13→17→28→29→31→0xffff. The data in each cell is the relative offset between the next logical offset address and the first logical offset address in the P2L reverse mapping table to be updated in the same L2P forward mapping table. For example, Figure 6 The data in the first position of the third table is 4. In the P2L reverse mapping table to be updated, the logical offset address in the first position is LAA1, which belongs to the forward mapping table L2P0. When traversing the P2L reverse mapping table to be updated, the next logical offset address traversed belonging to the forward mapping table L2P0 is LAA5. The relative offset between LAA5 and LAA1 is 4, which is the data in the first position in the third table.
[0065] In this embodiment, in the offset record table, each data occupies 2 bytes, that is, only 2 bytes are used to record the relative offset of a P2LEntry. The maximum supported size of the P2L reverse mapping table is 256K, which is much larger than the size of the mainstream P2L reverse mapping table (usually 32K). This is different from the existing solution 2 that uses 4 bytes to record the absolute physical position of a P2L Entry. This embodiment uses a one-way linked list for recording to reduce the CPU time consumed by querying invalid entries during the synchronization of the P2L reverse mapping table, and compared with the existing solution 2, it saves half the memory space of the P2L table.
[0066] In terms of query efficiency for the above data processing method, assuming that the P2L reverse mapping table to be updated contains M Entries, each Entry in the P2L reverse mapping table contains X L2P forward mapping tables, and the size of the linked list array is Y. When X < Y, the number of times to query P2L Entries is fixed at 1024 times. When X >= Y, the number of times to query P2L Entries Count = MX / (2Y) + M / 2, and the number of times to query the linked list header is Y times. The comprehensive query efficiency is better than that of Solution 1, and because the total number of queries in this solution is small, the performance is basically not affected by the increase in the P2L reverse mapping table. Compared with the existing Solution 2, taking the example of random write in a 1G random range of a common random performance testing tool, assuming that one L2P forward mapping table maps 32M of data, then there are a total of 32 L2P forward mapping tables. Assuming the size of the linked list array is 32, the number of times to query P2L Entries in this solution is 1024 times, the same as that of the existing Solution 2, but the number of times to query the linked list header is 32 times, much lower than 16384 times (512G capacity) of Solution 2. Therefore, this solution uses a linked list array of a fixed size and evenly records the randomly written P2L Entries in each linked list by taking the remainder of the L2P Index with respect to the array size N, further improving the random write performance in a small range. In terms of the query efficiency of random write in a small range, this solution is better than Solution 2. For full-disk random, the number of times to query P2L Entries in this solution is 16896 times, and the number of times to query the linked list header is 32 times, while the corresponding query times of the existing Solution 2 are 1024 times and 16384 times (512G capacity) respectively, with a small difference from this solution. Generally speaking, the query efficiency of this solution is better than that of the existing Solution 2.
[0067] In terms of memory usage, this solution uses the relative offset method to record the position information of P2L Entries, and only needs half of the memory space of the existing Solution 2 to store the index information of the linked list. Secondly, this solution uses a linked list array with a fixed size of Y, and only needs an additional 4×Y Byte of memory. Taking the SSD capacity of 512G, the size of the P2L reverse mapping table of 4K, one L2P forward mapping table mapping 32M of data, and the size of the linked list array of 32 as an example, this solution needs an additional 2K + 128 Byte of memory, where 2K is the total memory occupied by the offset record table, and 128 Byte is obtained by 4×32 when the linked list array is 32. While the existing Solution 2 needs an additional 4K + 64K of memory. Therefore, this solution saves a large amount of memory space, realizes a large improvement in random performance with a small space cost, and has higher feasibility in the DRAM-Less architecture.
[0068] An embodiment of the present invention provides a data processing device, as Figure 7As shown, the device includes: a first acquisition module 70, which is used to obtain a linked list array of a specified size and a P2L reverse mapping table to be updated; wherein the P2L reverse mapping table to be updated contains multiple logical offset addresses; a traversal module 71, which is used to traverse each logical offset address and determine the number of the L2P forward mapping table to which each logical offset address belongs; a calculation module 72, which is used to calculate, for each L2P forward mapping table, in the P2L reverse mapping table to be updated, the relative offset of each logical offset address belonging to the L2P forward mapping table and the specified logical offset address, wherein the specified logical offset address is the first logical offset address in the P2L reverse mapping table to be updated; a second acquisition module 73, which divides the number of the L2P forward mapping table by a specified size to obtain a remainder value; an adding module 74, which is used to add each relative offset corresponding to the L2P forward mapping table to the linked list corresponding to the remainder value; an updating module 75, which is used to update the physical offset address corresponding to the logical offset address indicated by each relative offset in each linked list.
[0069] The above-mentioned data processing device uses a linked list array of a specified size. By taking the modulo of the specified size by the number of the L2P forward mapping table to which the logical offset address belongs, each relative offset corresponding to the L2P forward mapping table is evenly recorded in each linked list, thereby improving query efficiency and reducing memory consumption.
[0070] Furthermore, the update module is also used to: for each linked list, load the first L2P forward mapping table to which the first logical offset address indicated by the first relative offset in the head node of the linked list belongs; traverse the second logical offset addresses of all second relative offset indications in the linked list that belong to the first L2P forward mapping table, update the physical offset address corresponding to each second logical offset address, and delink each second relative offset after the update; repeat the steps of loading the first L2P forward mapping table to which the first logical offset address indicated by the first relative offset in the head node of the linked list belongs until all relative offsets in the linked list are delinked.
[0071] Furthermore, the device is also used to generate an offset record table based on each relative offset.
[0072] Furthermore, the position of each data in the offset record table corresponds one-to-one to the position of each logical offset address in the P2L reverse mapping table to be updated; for each position, the data in the current position in the offset record table is: the relative offset between the next logical offset address belonging to the same L2P forward mapping table as the current logical offset address in the P2L reverse mapping table to be updated and the specified logical offset address; wherein the current logical offset address is: the logical offset address corresponding to the current position in the P2L reverse mapping table to be updated.
[0073] Furthermore, in the offset record table, each data occupies 2 bytes.
[0074] Furthermore, the linked list array includes a number of linked list headers corresponding to the specified size; the adding module is also used to: select a target linked list header with the remainder value as the subscript from the linked list array; and add each relative offset corresponding to the L2P forward mapping table to the linked list corresponding to the target linked list header.
[0075] Furthermore, each linked list header occupies 4 bytes.
[0076] The data processing device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned data processing method embodiment. For the sake of brief description, for matters not mentioned in the data processing device embodiment, reference may be made to the corresponding contents in the aforementioned data processing method embodiment.
[0077] The embodiment of the present invention further provides an electronic device, see Figure 8 As shown, the electronic device includes a processor 130 and a memory 131 , wherein the memory 131 stores machine executable instructions that can be executed by the processor 130 , and the processor 130 executes the machine executable instructions to implement the above data processing method.
[0078] Further, Figure 8 The electronic device shown further includes a bus 132 and a communication interface 133 , and the processor 130 , the communication interface 133 and the memory 131 are connected via the bus 132 .
[0079] The memory 131 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 133 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 132 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0080] The processor 130 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 130. The above processor 130 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 131, and the processor 130 reads the information in the memory 131 and completes the steps of the method of the above embodiment in combination with its hardware.
[0081] An embodiment of the present invention also provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned data processing method. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0082] The computer program products of the data processing methods, devices and electronic devices provided in the embodiments of the present invention include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be found in the method embodiments and will not be repeated here.
[0083] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0084] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A data processing method, characterized in that: The method comprises: Obtaining a linked list array of a specified size and a P2L reverse mapping table to be updated; wherein the P2L reverse mapping table to be updated includes multiple logical offset addresses; Traversing each logical offset address, and determining the number of the L2P forward mapping table to which each logical offset address belongs; For each L2P forward mapping table, calculate the relative offset between each logical offset address in the P2L reverse mapping table to be updated and the specified logical offset address, wherein the specified logical offset address is the first logical offset address in the P2L reverse mapping table to be updated; Dividing the serial number of the L2P forward mapping table by the specified size to obtain a remainder value; adding each relative offset corresponding to the L2P forward mapping table to the linked list corresponding to the remainder value; In each linked list, the physical offset address corresponding to each logical offset address indicated by the relative offset is updated.
2. The method according to claim 1, characterized in that The step of updating the physical offset address corresponding to each logical offset address indicated by the relative offset in each linked list comprises: For each linked list, load a first L2P forward mapping table to which the first logical offset address indicated by the first relative offset in the head node of the linked list belongs; Traversing the linked list, the second logical offset addresses of all second relative offset indications belonging to the first L2P forward mapping table, updating the physical offset address corresponding to each second logical offset address, and performing a delinking process on each second relative offset after the update; The step of loading the first L2P forward mapping table to which the first logical offset address indicated by the first relative offset in the head node of the linked list belongs is repeated until all relative offsets in the linked list are unlinked.
3. The method according to claim 1, characterized in that The method further comprises: Based on each of the relative offsets, an offset record table is generated.
4. The method according to claim 3, characterized in that The position of each data in the offset record table corresponds one-to-one to the position of each logical offset address in the P2L reverse mapping table to be updated; for each position, the data in the current position in the offset record table is: the relative offset between the next logical offset address in the P2L reverse mapping table to be updated, which belongs to the same L2P forward mapping table as the current logical offset address, and the specified logical offset address; wherein the current logical offset address is: the logical offset address corresponding to the current position in the P2L reverse mapping table to be updated.
5. The method according to claim 4, characterized in that In the offset record table, each data occupies 2 bytes.
6. The method according to claim 1, characterized in that The linked list array includes a number of linked list headers corresponding to the specified size; the step of adding each relative offset corresponding to the L2P forward mapping table to the linked list corresponding to the remainder value includes: Selecting a target linked list header with the remainder value as the subscript from the linked list array; Each relative offset corresponding to the L2P forward mapping table is added to the linked list corresponding to the header of the target linked list.
7. The method according to claim 6, characterized in that Each of the linked list headers occupies 4 bytes.
8. A data processing device, characterized in that: The device comprises: A first acquisition module is used to acquire a linked list array of a specified size and a P2L reverse mapping table to be updated; wherein the P2L reverse mapping table to be updated contains a plurality of logical offset addresses; A traversal module, used to traverse each logical offset address and determine the number of the L2P forward mapping table to which each logical offset address belongs; a calculation module, configured to calculate, for each L2P forward mapping table, a relative offset between each logical offset address in the P2L reverse mapping table to be updated and a specified logical offset address, wherein the specified logical offset address is a first logical offset address in the P2L reverse mapping table to be updated; A second acquisition module divides the serial number of the L2P forward mapping table by the specified size to obtain a remainder value; An adding module, used for adding each relative offset corresponding to the L2P forward mapping table to the linked list corresponding to the remainder value; The updating module is used to update the physical offset address corresponding to each logical offset address indicated by the relative offset in each linked list.
9. An electronic device, characterized in that: The invention comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the data processing method according to any one of claims 1 to 7.
10. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the data processing method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for conducting data reading and writing on storage device
CN104090730A
Address mapping processing method and address mapping processing device
CN104102586A
Method for loading logical-to-physical mapping table to cache of memory controller
CN113892140A
Tuple encoding aware direct memory access engine for scratchpad enabled multicore processors
US20170270052A1
Memory system and method of operating method thereof
US20220012181A1
Cited By
P2L dynamic synchronization method, device and equipment based on BitMap statistics
CN120428913A
L2P linked list establishing method in storage controller and storage device
CN121833548A
Methods for establishing L2P linked lists in storage controllers and storage devices
CN121833548B