Logic address history mapping dictionary, construction method thereof and data rollback method

By constructing a logical address history mapping dictionary to record the mapping information of each version of the NAND FLASH storage chip, the problem of unstable data rollback in the existing technology is solved, and stable data recovery is achieved under abnormal conditions.

CN121979447APending Publication Date: 2026-05-05SHENZHEN SHICHUANGYI ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN SHICHUANGYI ELECTRONICS CO LTD
Filing Date
2025-12-31
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Existing technologies rely on journaling file systems at the operating system level to achieve data rollback, which makes it impossible to effectively recover data when the file system is abnormal. This is especially true in non-volatile storage chips such as NAND FLASH, where data write interruptions or logical address mapping errors caused by system power failures or accidental operations cannot be recovered stably and reliably.

Method used

Construct a logical address history mapping dictionary. Obtain mapping information data, including logical address, physical address and timestamp, by parsing the logical mapping table. Construct a logical address history mapping dictionary according to the timestamp information, record the physical address information and update time of each version, and support data rollback operations.

Benefits of technology

It enables stable and reliable data rollback in the event of storage chip failure, avoids dependence on the file system, ensures the integrity and reliability of data recovery, and does not increase the burden on the storage chip.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121979447A_ABST
    Figure CN121979447A_ABST
Patent Text Reader

Abstract

The invention discloses a logical address history mapping dictionary, a construction method thereof and a data rollback method, and relates to the technical field of storage. The logic address historical mapping dictionary construction method comprises the following steps: analyzing a logic mapping table to obtain at least one group of mapping information data; according to mapping information data, stored by different timestamp nodes, of the logic address mapping tables of previous versions, physical addresses pointed by the same logic address at the different timestamp nodes construct a logic address historical mapping dictionary according to timestamp information. The method can perform data rollback based on the logic address history mapping dictionary, and is stable and reliable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of storage technology, and in particular to a logical address history mapping dictionary, its construction method, and a data rollback method. Background Technology

[0002] In non-volatile memory chips such as NAND flash, data rollback is a critical operation to ensure the reliability and data consistency of the storage system. With the widespread deployment of memory chips in consumer electronics, industrial control, cloud computing, and other fields, scenarios such as system power failure, firmware anomalies, and accidental operations can easily lead to interruptions in data writing or errors in logical address mapping. In such cases, a data rollback mechanism is needed to restore the system to a historically valid data state to avoid the loss of critical business data or system crashes.

[0003] Currently, most mainstream data rollback solutions in the industry rely on journaling-based file systems at the operating system level. During rollback, these log entries need to be scanned to locate the storage location of historical data. Therefore, the effectiveness of existing data recovery methods depends entirely on the integrity of the file system's metadata. If the file system itself malfunctions due to virus attacks, media damage, or other abnormalities, valid metadata cannot be extracted from dirty blocks, rendering the data rollback operation completely ineffective. Therefore, a more stable and reliable data rollback method is urgently needed. Summary of the Invention

[0004] The purpose of this application is to provide a stable and reliable logical address history mapping dictionary, its construction method, and a data rollback method.

[0005] This application discloses a method for constructing a logical address history mapping dictionary, including the following steps: S1: Parse the logical mapping table to obtain at least one set of mapping information data; wherein, the mapping information data includes: logical address information, the physical address information to which it points, and timestamp information; S2: Based on the mapping information data of the logical address mapping table of each version stored at different timestamp nodes, construct a logical address history mapping dictionary according to the timestamp information, which represents the physical addresses pointed to by the same logical address at different timestamp nodes.

[0006] Optionally, the logical address history mapping dictionary includes at least one logical address history mapping unit, and the logical address history mapping unit includes at least one logical address history mapping node; Step S2 includes the following steps: S21: Based on the logical address information of the mapping information data, generate or update the corresponding logical address history mapping unit in the logical address history mapping dictionary; S22: Construct a logical address history mapping node in the corresponding logical address history mapping unit based on the physical address information and timestamp information pointed to by the mapping information data.

[0007] Optionally, before step S1, the method further includes the following step: S0: Scan and read all logical mapping tables on the disk.

[0008] Optionally, before step S0, step Q is also included: responding to the rollback request.

[0009] Optionally, after step S0 and before step S1, the following step is also included: N: Identify the logical address mapping table data: Identify all logical address mapping tables by obtaining the tags corresponding to the table data.

[0010] Optionally, in step S2, based on the mapping information data of the logical address mapping table of each version stored at different timestamp nodes, the physical addresses pointed to by the same logical address at different timestamp nodes are classified according to the timestamp information to construct a logical address historical mapping dictionary.

[0011] Optionally, step S21 includes the following steps: S211: Classify at least one set of mapping information data corresponding to the same logical address information; S212: Based on the categorized logical address information, construct a logical address history mapping unit corresponding to the logical address information.

[0012] Optionally, after step S22, the method further includes the following step: N2: Arrange multiple logical address history mapping nodes according to the order of timestamp information; among them, after constructing the logical address history mapping unit corresponding to each logical address, a logical address history mapping dictionary structure is formed.

[0013] Optionally, before step S1, the method further includes the following step: S0: Responding to a data write request; In step S1: the logical mapping table of the written data is parsed to obtain the mapping information data corresponding to the written data; wherein, the mapping information data includes: logical address information, the physical address information to which it points, and timestamp information; In step S2: based on the mapping information data of the written data and the mapping information data of the logical address mapping table of each version, the physical addresses pointed to by the same logical address at different timestamp nodes are constructed according to the timestamp information to build a logical address history mapping dictionary.

[0014] Optionally, after step S0 and before step S1, the following step is further included: S01: Determine if there is a corresponding historical logical address mapping table for the logical address information of the written data. If not, create a new logical address mapping table corresponding to the logical address information of the written data. In step S21: based on the logical address information of the mapping information data corresponding to the written data, a new logical address history mapping unit is added to the logical address history mapping dictionary structure; In step S22: the timestamp information of the written data and the physical address information it points to are used to create a new logical address history mapping node in the newly added logical address history mapping unit; the logical address history mapping dictionary structure is updated according to the newly added logical address history mapping unit.

[0015] Optionally, after step S0 and before step S1, the following step is further included: S01: Determine whether there is a corresponding historical logical address mapping table for the logical address information of the written data. If there is, find the historical logical address mapping table corresponding to the logical address information of the written data. In step S21: based on the logical address of the written data, the corresponding logical address history mapping unit is found from the logical address history mapping dictionary structure; In step S22: the timestamp information of the written data and the physical address information it points to are added to the logical address history mapping unit to create a new logical address history mapping node; the logical address history mapping dictionary structure is updated according to the updated logical address history mapping unit.

[0016] Optionally, after step S0 and before step S1, the following step is further included: S01: Determine whether there is a corresponding historical logical address mapping table for the logical address information of the written data. If there is, find the historical logical address mapping table corresponding to the logical address information of the written data. In step S21: based on the logical address of the written data, the corresponding logical address history mapping unit is found from the logical address history mapping dictionary structure; In step S22: the timestamp information of the written data and the physical address information it points to are added to the logical address history mapping unit to create a new logical address history mapping node; the logical address history mapping dictionary structure is updated according to the updated logical address history mapping unit.

[0017] This application also discloses a logical address history mapping dictionary, which is constructed using the logical address history mapping dictionary construction method described above. The logical address history mapping dictionary includes at least one logical address history mapping unit, and the logical address history mapping unit includes at least one logical address history mapping node. The logical address history mapping unit generates or updates the logical address history mapping dictionary according to the corresponding logical address information. The logical address history mapping node includes the physical address information it points to and timestamp information. The logical address history mapping node is constructed in the corresponding logical address history mapping unit according to the physical address information it points to and the timestamp information.

[0018] This application also discloses a data rollback method, which performs data rollback using the logical address history mapping dictionary described above, including the following steps: M1: Responds to the rollback execution command and obtains the target logical address that needs to be rolled back and the target rollback historical time node requirements; M2: Find the physical address that the target logical address points to at different timestamp nodes from the logical address history mapping dictionary; M3: Read the target physical address that meets the requirements of the target rollback historical time node and perform data rollback.

[0019] Optionally, the steps of M3 include: M31: Read the target physical address that meets the requirements of the target rollback history time node from the physical addresses pointed to by the target logical address at different timestamp nodes; M32: Determine if the data at the target physical address is corrupted. If not, roll back the data directly according to the data at the target physical address. If so, skip the node, find the physical address of the previous node, use it as the target physical address, and roll back the data.

[0020] Optionally, the logical address history mapping dictionary includes at least one logical address history mapping unit, the logical address history mapping unit includes at least one logical address history mapping node, and the logical address history mapping node includes: the physical address information it points to, and timestamp information; The logical address history mapping unit generates or updates the logical address history mapping dictionary based on the corresponding logical address information; the logical address history mapping node is constructed in the corresponding logical address history mapping unit based on the physical address information it points to and the timestamp information. In M2: Find the physical address pointed to by the logical address history mapping node of the target logical address from the logical address history mapping unit of the logical address history mapping dictionary; M3: Reads the target physical address of the logical address historical mapping node that meets the requirements of the target rollback historical time node, and performs data rollback.

[0021] Optionally, the logical address history mapping dictionary includes at least one logical address history mapping unit, the logical address history mapping unit includes at least one logical address history mapping node, and the logical address history mapping node includes: the physical address information it points to, and timestamp information; The logical address history mapping unit generates or updates the logical address history mapping dictionary based on the corresponding logical address information; the logical address history mapping node is constructed in the corresponding logical address history mapping unit based on the physical address information it points to and the timestamp information. In step M2: the physical address pointed to by the logical address history mapping node of the target logical address is found from the logical address history mapping unit of the logical address history mapping dictionary; In step M3: the target physical address of the logical address historical mapping node that meets the requirements of the target rollback historical time node is read, and data rollback is performed.

[0022] This application constructs a logical address history mapping dictionary to organize the physical address information of each version of the target file data and the timestamp information recording its update time. By querying the logical address history mapping unit corresponding to the target file in the logical address history mapping dictionary, the actual physical address information and update time information corresponding to each updated version of the file can be obtained, making it possible to perform data rollback based on the logical address history mapping dictionary. Attached Figure Description

[0023] The accompanying drawings, which form part of the specification, are used to provide a further understanding of the embodiments of this application and illustrate the implementation methods of this application, together with the textual description, to explain the principles of this application. Obviously, the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any creative effort. In the drawings: Figure 1 This is a schematic diagram of the structure of the logical address history mapping dictionary provided in this application; Figure 2 This is a flowchart illustrating the construction steps of the logical address history mapping dictionary provided in this application; Figure 3 This is a schematic diagram of the process steps of the data rollback method provided in this application; Figure 4 yes Figure 2 A schematic diagram of the further process steps in step S2; Figure 5 yes Figure 3 A flowchart illustrating the alternative steps M2 and M3; Figure 6 This is a schematic diagram of the process steps for initiating data rollback after the logical address history mapping dictionary is constructed, as provided in the first embodiment of this application; Figure 7 yes Figure 6 Step S21 has a further flowchart; Figure 8 yes Figure 6 It also includes flowcharts for steps N and P; Figure 9 This is a schematic diagram illustrating the existence of multiple logical address mapping tables for logical address overwriting provided in this application; Figure 10 This is a schematic diagram of the process steps for constructing the logical address history mapping dictionary provided in the second embodiment of this application; Figure 11 Based on Figure 10 A more detailed flowchart of the steps.

[0024] Among them, 10 is the logical address history mapping dictionary; 100 is the logical address history mapping unit; and 200 is the logical address history mapping node. Detailed Implementation

[0025] It should be understood that the terminology, specific structural and functional details used herein are merely for describing particular embodiments and are representative. However, this application may be implemented in many alternative forms and should not be construed as being limited to the embodiments set forth herein.

[0026] Based on the underlying storage logic of non-volatile memory chips / flash memory such as NAND FLASH, this application proposes a novel data rollback method that makes data rollback operations no longer limited to log information at the operating system or file system level.

[0027] In existing storage devices, due to the limitations of non-volatile memory chips such as NAND flash, data cannot be directly overwritten for each physical address. Each NAND flash memory block (referred to as a block) can only be written to once after an erase. Each time data is updated, although the corresponding logical address remains the same, its physical address changes. The updated data needs to be written to a new physical page, and a new logical address mapping table needs to be generated. If you want to write to an already written page again, you must erase the entire block again and then write to each page.

[0028] This characteristic leads to multiple write operations potentially occurring at the same logical address, meaning multiple copies of data with the same logical address exist within the physical block. Due to limitations in storage device algorithms (such as the FTL algorithm), the front end (i.e., the user of the storage device, such as the operating system) can only access the latest data, i.e., the data written last, viewed chronologically. Similarly, the mapping table between logical and physical addresses is updated multiple times, resulting in multiple logical address mapping tables corresponding to the same logical address. However, the front end can only access the latest logical address mapping table, i.e., the logical address mapping table corresponding to the last written data, viewed chronologically. In other words, within the storage chip, there are actually multiple physical address pages storing various historical versions of data, and multiple historical logical address mapping tables storing the physical address information corresponding to various historical versions of the current logical address. This information can be collected and organized to support data rollback operations.

[0029] Compared to technologies that rely on scanning log information to locate and roll back data based on the operating system or file system, traditional methods rely heavily on the file system. The file system only records when logical addresses were updated and cannot retrieve all historical metadata from dirty blocks. Even if the file system selectively creates archive backups for specific rollback points, it can only roll back to those archived points, making data recovery overly dependent on the file system. This means that even if historical data is stored in physical addresses, it cannot be fully recognized and recovered by the file system. This application, however, leverages the limitations of non-volatile memory chips like NAND flash. It utilizes the characteristic that data cannot be directly overwritten to the same page; updated data must be written to a new physical page, generating a new logical address mapping table. By using the mapping information of logical address mapping tables for each version saved at different timestamps, it constructs a logical address history mapping dictionary based on the timestamp information, connecting the physical addresses pointed to by the same logical address at different timestamps. This supports data rollback operations without adding extra burden to the storage chip, maximizing data rollback performance while ensuring stability and reliability.

[0030] Based on this, this application proposes a scheme to support data rollback by constructing a logical address history mapping dictionary based on the logical address mapping table of each historical version in the storage device.

[0031] Figure 1A schematic diagram of a logical address history mapping dictionary is shown. The logical address history mapping dictionary 10 includes at least one logical address history mapping unit 100, wherein each logical address history mapping unit 100 corresponds to the same logical address. That is, since each update of the same file corresponds to the same logical address, each logical address history mapping unit corresponds one-to-one with each file. The logical address history mapping unit 100 generates or updates the logical address history mapping dictionary 10 according to the corresponding logical address information.

[0032] Each logical address history mapping unit 100 includes at least one logical address history mapping node 200. Each logical address history mapping node 200 includes a pointed-to physical address information and timestamp information. The logical address history mapping nodes 200 are constructed in the corresponding logical address history mapping unit 100 based on the pointed-to physical address information and timestamp information. Each logical address history mapping node 200 represents a historical update version of a file. Assuming that the physical storage pages corresponding to all historical update versions of a file have not been reclaimed, the number of logical address history mapping nodes 200 in each logical address history mapping unit 100 should correspond to the number of updates to the current file.

[0033] By constructing a logical address history mapping dictionary 10, the physical address information of each version of the target file data and the timestamp information recording its update time are organized. By querying the logical address history mapping unit 100 corresponding to the target file in the logical address history mapping dictionary 10, the actual physical address information and update time information corresponding to each updated version of the file can be obtained, making it possible to perform data rollback based on the logical address history mapping dictionary 10.

[0034] Through the logical address history mapping dictionary 10, one can easily obtain the number of historical versions of the current logical address (the number of logical address history mapping nodes 200 contained in the corresponding logical address history mapping unit 100), historical write time information (timestamp information of each logical address history mapping node 200), and historical write metadata (data content corresponding to the physical address information of the logical address history mapping node 200), etc.

[0035] Correspondingly, such as Figure 2 As shown, this embodiment discloses a method for constructing a logical address history mapping dictionary, including the following steps: S1: Parse the logical mapping table to obtain at least one set of mapping information data; wherein, the mapping information data includes: logical address information, the physical address information to which it points, and timestamp information; S2: Based on the mapping information data of the logical address mapping table of each version stored at different timestamp nodes, construct a logical address history mapping dictionary according to the timestamp information, which represents the physical addresses pointed to by the same logical address at different timestamp nodes.

[0036] Figure 3 This illustrates a method for data rollback using the logical address history mapping dictionary constructed according to the above method, including the following steps: M1: Responds to the rollback execution command and obtains the target logical address that needs to be rolled back and the target rollback historical time node requirements; M2: Search the logical address history mapping dictionary for the physical address information that the target logical address of the target file / data points to at different timestamp nodes; M3: Read the target physical address information that meets the requirements of the target rollback historical time node. After knowing the target physical address information, how to perform data rollback operation is an existing technology and will not be described in detail here.

[0037] Figure 4 A specific embodiment of a method for constructing a logical address history mapping dictionary is shown, wherein the logical address history mapping dictionary includes at least one logical address history mapping unit, and the logical address history mapping unit includes at least one logical address history mapping node; The method for constructing the logical address history mapping dictionary includes the following steps: S1: Parse the logical mapping table to obtain at least one set of mapping information data; wherein, the mapping information data includes: logical address information, the physical address information to which it points, and timestamp information; S21: Based on the logical address information of the mapping information data, generate or update the corresponding logical address history mapping unit in the logical address history mapping dictionary; S22: Construct a logical address history mapping node in the corresponding logical address history mapping unit based on the physical address information and timestamp information pointed to by the mapping information data.

[0038] Correspondingly, such as Figure 5 As shown, the data rollback method based on the logical address history mapping dictionary constructed according to the construction method in the above embodiments includes the following steps: M1: Responds to the rollback execution command and obtains the target logical address that needs to be rolled back and the target rollback historical time node requirements; M2': Find the physical address pointed to by the logical address history mapping node of the target logical address from the logical address history mapping unit of the logical address history mapping dictionary; M3': Read the target physical address of the logical address historical mapping node that meets the requirements of the target rollback historical time node, and perform data rollback.

[0039] The logical address history mapping dictionary can be constructed in response to rollback requests from users or the system. When a user or system needs to roll back data, it triggers the construction process of the logical address history mapping dictionary by sending a rollback request command carrying the target logical address of the target file / data to be rolled back and the target rollback historical time node requirements. After the logical address history mapping dictionary is constructed, a rollback execution command is automatically triggered to perform the data rollback operation steps.

[0040] Reference Appendix Figure 6 The following is a further explanation of an implementation of temporarily constructing a logical address history mapping dictionary in response to user or system rollback requests: A method for constructing a logical address history mapping dictionary, comprising the following steps: Q: Respond to the rollback request; S0: Scan and read all logical mapping tables in the disk, traverse all current logical mapping tables and all historical mapping tables, and can construct all logical address historical mapping units corresponding to all logical addresses in one go; S1: Parse all the obtained logical address mapping tables to obtain multiple sets of mapping information data in all logical address mapping tables. Each set of mapping information data includes: logical address information, the physical address information to which it points, and the timestamp information of the data. S21: Based on the logical address information of the mapping information data, generate or update the corresponding logical address history mapping unit in the logical address history mapping dictionary; S22: Construct logical address history mapping nodes in the corresponding logical address history mapping units based on the physical address information and timestamp information pointed to by the mapping information data; wherein, after constructing the logical address history mapping units corresponding to each logical address, a logical address history mapping dictionary structure is formed; after the logical address history mapping dictionary is constructed, a rollback execution command is generated to trigger step M1; M1: Responds to the rollback execution command and obtains the target logical address that needs to be rolled back and the target rollback historical time node requirements; M2': Find the physical address pointed to by the logical address history mapping node of the target logical address from the logical address history mapping unit of the logical address history mapping dictionary and use it as the target physical address; M3': Read the target physical address of the logical address historical mapping node that meets the requirements of the target rollback historical time node, and perform data rollback.

[0041] The rollback request can be a private command built into the firmware, triggered externally via standard protocol commands.

[0042] Due to the characteristics of NAND Flash memory chips, data cannot be directly overwritten for each physical address. Each block of NAND Flash can only be written to each page once after an erase. Even if only a small portion of the data is updated, the updated data must be written to a new physical page. If you want to write to an already written page, you must erase the entire block again and then write to each page. Therefore, it's possible that an entire block storing a page from a historical version might be erased and reclaimed, and new data written to it. Correspondingly, the generated logical address history mapping dictionary might contain instances where certain logical address history mapping nodes have been erased and corrupted, affecting the accuracy of rollback. Therefore, to address this situation, as another embodiment, the following operation can be performed in step M3: M31: Read the target physical address that meets the requirements of the target rollback historical time node from the physical address pointed to by the target logical address in different logical address history mapping nodes (time stamp nodes); M32: Determine if the data at the target physical address is corrupted. If not, roll back the data directly according to the data at the target physical address. If so, skip the node, find the physical address of the previous node, use it as the target physical address, and roll back the data.

[0043] After parsing all the mapping information data in the logical mapping tables, the mapping information data can be categorized as another example, such as... Figure 7 As shown, a method for constructing a logical address history mapping dictionary includes the following steps: Q: Respond to the rollback request; S0: Scan and read all logical mapping tables on the disk; S1: Parse all the obtained logical address mapping tables to obtain multiple sets of mapping information data in all logical address mapping tables. Each set of mapping information data includes: logical address information, the physical address information to which it points, and the timestamp information of the data. S2: Based on the mapping information data of the logical address mapping table of each version stored at different timestamp nodes, the physical addresses pointed to by the same logical address at different timestamp nodes are classified according to the timestamp information to construct a logical address history mapping dictionary.

[0044] The complete execution process is as follows: Q: Respond to the rollback request; S0: Scan and read all logical mapping tables on the disk; S1: Parse all the obtained logical address mapping tables to obtain multiple sets of mapping information data in all logical address mapping tables. Each set of mapping information data includes: logical address information, the physical address information to which it points, and the timestamp information of the data. S211: Classify at least one set of mapping information data corresponding to the same logical address information; S212: Based on the categorized logical address information, construct a logical address history mapping unit corresponding to the logical address information; S22: Construct logical address history mapping nodes in the corresponding logical address history mapping units based on the physical address information and timestamp information pointed to by the mapping information data; wherein, after constructing the logical address history mapping units corresponding to each logical address, a logical address history mapping dictionary structure is formed.

[0045] Therefore, if only a specific file needs to be rolled back, it is only necessary to categorize one or more logical addresses corresponding to the target file and generate one or more corresponding logical address history mapping units, which can save a lot of construction time. After the logical address history mapping dictionary structure is constructed, the data rollback execution command is triggered and the data rollback is performed. For details, please refer to the data rollback steps described above, which will not be repeated here.

[0046] Since flash memory also stores other types of tables besides the logical address mapping table, various types of tables may be scanned in step S0. Therefore, in the method for constructing the logical address history mapping dictionary, a step for identifying the logical address mapping table data can be added: such as... Figure 8 As shown, after step S0 is completed, step N is also included: identifying the logical address mapping table data: since different types of tables will have different labels, all logical address mapping tables can be identified by obtaining the labels corresponding to the table data, and only the logical address mapping tables are parsed to improve efficiency.

[0047] Furthermore, the logical address history mapping nodes within the logical address history mapping units of the constructed logical address history mapping dictionary can be sorted chronologically for easier retrieval during subsequent rollback operations. For example... Figure 8 As shown, after performing step S22, the following step is also included: P: Arrange multiple logical address history mapping nodes according to the chronological order of their timestamp information; the logical address history mapping dictionary structure is formed after constructing the logical address history mapping unit corresponding to each logical address. The arrangement can be either from earliest to latest timestamp information or from latest to earliest timestamp information; the specific arrangement is not limited, as long as it facilitates rollback operations.

[0048] The following reference Figure 9 Here's an example to further illustrate the build and rollback process: The first file update writes the content "SCY", which corresponds to the logical address 0x55AA. The physical address pointed to by the first logical address mapping table is Block: 21, Page: 5. The second file update updated the content to "Niubility", but the actual data written during storage was "SCY Niubility"; its corresponding logical address was still 0x55AA, and the physical address pointed to by the second logical address mapping table was Block: 300, Page: 1032. The third file update contains the word "awesome", but in actual storage, the data written is "SCYNiubility awesome". Its corresponding logical address is still 0x55AA, and the physical address pointed to by the third logical address mapping table is Block: 116, Page: 0.

[0049] Because overwriting logical address 0x55AA will generate multiple metadata entries, and regardless of how many copies of the logical address mapping table exist, there will always be two important pieces of information: timestamp information and the physical address information it points to. That is, there are multiple logical address mapping tables for logical address 0x55AA, namely, the data from the first copy of the logical address mapping table, the second copy of the logical address mapping table, and the third copy of the logical address mapping table.

[0050] After obtaining the three logical address mapping tables, by parsing the timestamp information and the physical address information corresponding to the logical address information, and classifying and sorting them, we can construct the logical address history mapping node for each logical address, construct the logical address history mapping unit corresponding to this logical address, and build a logical address history mapping dictionary. When performing data rollback, the rollback can be performed by referring to the logical address history mapping node in this logical address history mapping unit.

[0051] Figure 10This is a schematic diagram of another embodiment of this application. Unlike the previous embodiments, this embodiment does not temporarily construct the logical address history mapping dictionary in response to a rollback request. Instead, in response to a data write request initiated by the upper-layer operating system or file system, each time a data write operation is performed on the storage chip, in addition to the conventional response to the data write request, logical address addressing, writing the data to the corresponding physical address, and generating or updating the logical mapping table, a separate step of synchronously constructing and updating the logical address history mapping dictionary is executed. That is, the action of constructing and updating the logical address history mapping dictionary is broken down into parts and included in each data write request. In this way, when a rollback request is received, the real-time updated logical address history mapping dictionary can be directly called to perform the data rollback operation, resulting in a faster response.

[0052] Specifically, a method for constructing a logical address history mapping dictionary includes the following steps: T: Responds to data write requests and generates or updates a logical mapping table for the data to be written; S1: Parse the logical mapping table of the written data to obtain the mapping information data corresponding to the written data; wherein, the mapping information data includes: logical address information, the physical address information to which it points, and timestamp information; S2: Based on the mapping information of the written data and the mapping information of the logical address mapping table of previous versions, construct a logical address history mapping dictionary according to the timestamp information for the physical addresses pointed to by the same logical address at different timestamp nodes.

[0053] Figure 11 The specific execution steps of the method for constructing the logical address history mapping dictionary in the previous embodiment are shown below for reference. The steps include: T: Responds to data write requests and generates or updates a logical mapping table for the data to be written; S01: Determine if there is a corresponding historical logical address mapping table for the logical address information of the written data. If not, create a new logical address mapping table corresponding to the logical address information of the written data; and execute steps S1', S21', and S22' in sequence; that is: S1': Parse the logical mapping table of the written data to obtain the mapping information data corresponding to the written data; wherein, the mapping information data includes: logical address information, the physical address information to which it points, and timestamp information; S21': Based on the logical address information of the mapping information data corresponding to the written data, add a new logical address history mapping unit in the logical address history mapping dictionary structure; S22': Create a new logical address history mapping node in the newly added logical address history mapping unit by taking the timestamp information of the written data and the physical address information it points to; update the logical address history mapping dictionary structure according to the newly added logical address history mapping unit.

[0054] If, in step S01, it is determined that the logical address information of the written data has a corresponding historical logical address mapping table, then the historical logical address mapping table corresponding to the logical address information of the written data is found, and steps S1'', S21'', and S22'' are executed sequentially; that is: S1'': Parse the logical mapping table of the written data to obtain the mapping information data corresponding to the written data; wherein, the mapping information data includes: logical address information, the physical address information to which it points, and timestamp information; S21'': Based on the logical address of the written data, find the corresponding logical address history mapping unit from the logical address history mapping dictionary structure; S22'': Add a new logical address history mapping node to the logical address history mapping unit by appending the timestamp information of the written data and the physical address information it points to; update the logical address history mapping dictionary structure according to the updated logical address history mapping unit.

[0055] Due to the characteristics of NAND Flash memory chips, data cannot be directly overwritten for each physical address. Each block of NAND Flash can only be written to each page once after an erase. Even if only a small portion of the data is updated, the updated data must be written to a new physical page. If you want to write to a page that has already been written, you must erase the entire block again and then write to each page. Therefore, it's possible for an entire block storing a historical version of a page to be erased and reclaimed, and then new data written to it. Therefore, in the constructed logical address history mapping dictionary structure, it's necessary to synchronously delete the invalid logical address history mapping nodes in the logical address history mapping unit corresponding to a specific logical address.

[0056] Therefore, the method for constructing the logical address history mapping dictionary further includes performing the following steps when it is detected that the storage page corresponding to a certain physical address information has been reclaimed by the system or has been corrupted: In all logical address history mapping units associated with this physical address information, all invalid logical address history mapping nodes are synchronously deleted.

[0057] It should be noted that the limitations on each step involved in this solution are not considered as limiting the order of steps, provided that they do not affect the implementation of the specific solution. The steps listed first can be executed first, later, or even simultaneously. As long as this solution can be implemented, it should be considered to fall within the scope of protection of this application.

[0058] It should be noted that the inventive concept of this application can form many embodiments, but due to the limited space of the application documents, they cannot all be listed. Therefore, without conflict, the embodiments described above or the technical features can be arbitrarily combined to form new embodiments. After the embodiments or technical features are combined, the original technical effect will be enhanced.

[0059] The above description, in conjunction with specific optional embodiments, provides a further detailed explanation of this application and should not be construed as limiting the specific implementation of this application to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of this application, and all such modifications or substitutions should be considered within the scope of protection of this application.

Claims

1. A method for constructing a logical address history mapping dictionary, characterized in that, Including the following steps: S1: Parse the logical mapping table to obtain at least one set of mapping information data; wherein, the mapping information data includes: logical address information, the physical address information to which it points, and timestamp information; S2: Based on the mapping information data of the logical address mapping table of each version stored at different timestamp nodes, construct a logical address history mapping dictionary according to the timestamp information, which represents the physical addresses pointed to by the same logical address at different timestamp nodes.

2. The method for constructing a logical address history mapping dictionary as described in claim 1, characterized in that, The logical address history mapping dictionary includes at least one logical address history mapping unit, and the logical address history mapping unit includes at least one logical address history mapping node; Step S2 includes the following steps: S21: Based on the logical address information of the mapping information data, generate or update the corresponding logical address history mapping unit in the logical address history mapping dictionary; S22: Construct a logical address history mapping node in the corresponding logical address history mapping unit based on the physical address information and timestamp information pointed to by the mapping information data.

3. The method for constructing a logical address history mapping dictionary as described in claim 2, characterized in that, Before step S1, there is also step S0: scanning and reading all logical mapping tables in the disk.

4. The method for constructing a logical address history mapping dictionary as described in claim 3, characterized in that, Before step S0, there is also step Q: responding to the rollback request.

5. The method for constructing a logical address history mapping dictionary as described in claim 3, characterized in that, After step S0 and before step S1, step N is included: identifying the logical address mapping table data: by obtaining the tags corresponding to the table data, all logical address mapping tables are identified.

6. The method for constructing a logical address history mapping dictionary as described in claim 3, characterized in that, In step S2, based on the mapping information data of the logical address mapping table of each version stored at different timestamp nodes, the physical addresses pointed to by the same logical address at different timestamp nodes are classified according to the timestamp information to construct a logical address history mapping dictionary.

7. The method for constructing a logical address history mapping dictionary as described in claim 6, characterized in that, Step S21 includes the following steps: S211: Classify at least one set of mapping information data corresponding to the same logical address information; S212: Based on the categorized logical address information, construct a logical address history mapping unit corresponding to the logical address information.

8. The method for constructing a logical address history mapping dictionary as described in claim 7, characterized in that, Following step S22, the following step is also included: N2: Arrange multiple logical address history mapping nodes according to the order of timestamp information; among them, after constructing the logical address history mapping unit corresponding to each logical address, a logical address history mapping dictionary structure is formed.

9. The method for constructing a logical address history mapping dictionary as described in claim 1, characterized in that, Before step S1, the following step is also included: S0: Responding to a data write request; In step S1: the logical mapping table of the written data is parsed to obtain the mapping information data corresponding to the written data; wherein, the mapping information data includes: logical address information, the physical address information to which it points, and timestamp information; In step S2: based on the mapping information data of the written data and the mapping information data of the logical address mapping table of each version, the physical addresses pointed to by the same logical address at different timestamp nodes are constructed according to the timestamp information to build a logical address history mapping dictionary.

10. The method for constructing a logical address history mapping dictionary as described in claim 2, characterized in that, After step S0 and before step S1, the following step is also included: S01: Determine if there is a corresponding historical logical address mapping table for the logical address information of the written data. If not, create a new logical address mapping table corresponding to the logical address information of the written data. In step S21: based on the logical address information of the mapping information data corresponding to the written data, a new logical address history mapping unit is added to the logical address history mapping dictionary structure; In step S22: the timestamp information of the written data and the physical address information it points to are used to create a new logical address history mapping node in the newly added logical address history mapping unit; the logical address history mapping dictionary structure is updated according to the newly added logical address history mapping unit.

11. The method for constructing a logical address history mapping dictionary as described in claim 2, characterized in that, After step S0 and before step S1, the following step is also included: S01: Determine whether there is a corresponding historical logical address mapping table for the logical address information of the written data. If there is, find the historical logical address mapping table corresponding to the logical address information of the written data. In step S21: based on the logical address of the written data, the corresponding logical address history mapping unit is found from the logical address history mapping dictionary structure; In step S22: the timestamp information of the written data and the physical address information it points to are added to the logical address history mapping unit to create a new logical address history mapping node; the logical address history mapping dictionary structure is updated according to the updated logical address history mapping unit.

12. A logical address history mapping dictionary, characterized in that, The dictionary is constructed using the method for constructing a logical address history mapping dictionary as described in any one of claims 1-11. The logical address history mapping dictionary includes at least one logical address history mapping unit, and the logical address history mapping unit includes at least one logical address history mapping node. The logical address history mapping unit generates or updates the logical address history mapping dictionary based on the corresponding logical address information; the logical address history mapping node includes the physical address information it points to and the timestamp information, and the logical address history mapping node is constructed in the corresponding logical address history mapping unit based on the physical address information it points to and the timestamp information.

13. A data rollback method, characterized in that, Performing data rollback using the logical address history mapping dictionary as described in claim 12 includes the following steps: M1: Responds to the rollback execution command and obtains the target logical address that needs to be rolled back and the target rollback historical time node requirements; M2: Find the physical address that the target logical address points to at different timestamp nodes from the logical address history mapping dictionary; M3: Read the target physical address that meets the requirements of the target rollback historical time node and perform data rollback.

14. The data rollback method as described in claim 13, characterized in that, The steps of M3 include: M31: Read the target physical address that meets the requirements of the target rollback history time node from the physical addresses pointed to by the target logical address at different timestamp nodes; M32: Determine if the data at the target physical address is corrupted. If not, roll back the data directly according to the data at the target physical address. If so, skip the node, find the physical address of the previous node, use it as the target physical address, and roll back the data.

15. The data rollback method as described in claim 13, characterized in that, The logical address history mapping dictionary includes at least one logical address history mapping unit, and the logical address history mapping unit includes at least one logical address history mapping node. The logical address history mapping node includes: the physical address information it points to, and the timestamp information. The logical address history mapping unit generates or updates the logical address history mapping dictionary based on the corresponding logical address information; the logical address history mapping node is constructed in the corresponding logical address history mapping unit based on the physical address information it points to and the timestamp information. In step M2: the physical address pointed to by the logical address history mapping node of the target logical address is found from the logical address history mapping unit of the logical address history mapping dictionary; In step M3: the target physical address of the logical address historical mapping node that meets the requirements of the target rollback historical time node is read, and data rollback is performed.