Data processing method, electronic equipment and storage medium

By using a rollback list to determine the first synchronization point for data rollback through communication between the storage device and the host, the problem of data loss and time consumption during data rollback of the storage device is solved, and the data can be quickly restored to the target state, reducing data loss.

CN121301077APending Publication Date: 2026-01-09SHANGHAI LONGSYS DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410875708.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-01
Publication Date
2026-01-09

AI Technical Summary

Technical Problem

In existing technologies, storage devices are prone to data loss during data rollback, and the process is time-consuming, making it difficult to quickly and effectively restore the device to its target usable state.

Method used

By using a rollback list, the storage device communicates with the host, receives query commands and rollback lengths from the host, determines the first synchronization point, rolls back data according to the synchronization information of that synchronization point, deletes unnecessary synchronization points, and updates the rollback list.

Benefits of technology

It enables the storage device to be quickly and effectively restored to the target usable state, reducing data loss and avoiding large-scale data loss caused by "factory reset".

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121301077A_ABST
    Figure CN121301077A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method, electronic equipment and a storage medium, the data processing method is applied to storage equipment, the storage equipment is in communication connection with a host side, and the data processing method comprises the following steps: receiving a query instruction of the host side, and sending a rollback chain table of the storage equipment to the host side; wherein the rollback chain table comprises at least two synchronization points arranged according to a pointer sequence; receiving a rollback length sent by the host end, and determining a first synchronization point from the at least two synchronization points based on the rollback length; and performing data rollback according to the synchronization information recorded by the first synchronization point. By means of the method, data rollback can be conducted on the data stored in the storage device, and the storage device is restored to the previous target available state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to data processing methods, electronic devices, and storage media. Background Technology

[0002] For storage devices, when data errors occur, such as accidental changes or deletions, a mechanism is needed to quickly and effectively terminate the execution of currently executing storage tasks and to enable the execution of subsequent storage tasks. Furthermore, a rollback mechanism is required to revert data from already executed storage tasks. Data rollback refers to the process of restoring data to its previous correct state after a data processing error.

[0003] In related technologies, data rollback of storage devices can easily lead to data loss, make it difficult to find the target data, and consume a lot of time and resources. Summary of the Invention

[0004] This application provides a data processing method, electronic device, and storage medium that can quickly roll back data on a storage device based on a rollback list to restore the storage device to a previous target usable state, while reducing data loss and minimizing damage.

[0005] To address the aforementioned technical problems, this application provides a data processing method applied to a storage device, wherein the storage device is communicatively connected to a host, comprising: receiving a query instruction from the host and sending a rollback list of the storage device to the host; wherein the rollback list includes at least two synchronization points arranged in pointer order; receiving a rollback length sent by the host and determining a first synchronization point from the at least two synchronization points based on the rollback length; and performing data rollback according to the synchronization information recorded at the first synchronization point.

[0006] In some embodiments, determining a first synchronization point from at least two synchronization points based on the rollback length includes: querying the rollback list in reverse order of the pointer order based on the rollback length, thereby determining the first synchronization point from at least two synchronization points.

[0007] In some embodiments, data rollback according to the synchronization information recorded at the first synchronization point includes: in response to at least one free block associated with the first synchronization point, and at least one free block not being erased, performing data rollback according to the synchronization information recorded at the first synchronization point.

[0008] In some embodiments, the method further includes: in response to any free block being erased, determining a target synchronization point corresponding to any free block; and deleting other synchronization points preceding the target synchronization point in pointer order.

[0009] In some embodiments, after rolling back the data according to the synchronization information recorded at the first synchronization point, the method further includes: deleting other synchronization points located after the first synchronization point according to the pointer order, and determining the first synchronization point as the latest synchronization point of the rollback list.

[0010] In some embodiments, the synchronization information includes at least one of the following: a list of storage block types, a list of storage block states, the physical address of the root node mapping table, and the write location of open blocks.

[0011] In some embodiments, the method further includes: in response to generating new synchronization information, forming target identification information based on the new synchronization information; adding new synchronization points in the rollback list according to pointer order, and using the target identification information as an element in the new synchronization point; wherein the target identification information is used to characterize the storage address of the new synchronization information; and in response to generating a new free block, associating the new free block with the corresponding synchronization point, and updating the rollback list.

[0012] In some embodiments, adding synchronization points to the rollback list in pointer order includes: determining whether the current length of the rollback list is equal to the maximum length; if so, deleting the synchronization point at the head of the rollback list in pointer order and adding the new synchronization point to the tail of the rollback list.

[0013] To address the aforementioned technical problems, this application also provides a data processing method applied to a host device, wherein the host device is communicatively connected to a storage device, comprising: obtaining a rollback list from the storage device; wherein the rollback list includes at least two synchronization points arranged in pointer order; determining a rollback length and sending the rollback length to the storage device, so that the storage device determines a first synchronization point from the at least two synchronization points based on the rollback length, and performs data rollback according to the synchronization information recorded at the first synchronization point.

[0014] To address the aforementioned technical problems, this application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned data processing method.

[0015] To address the aforementioned technical problems, this application also provides a computer-readable storage medium for storing a computer program, which, when executed by a processor, is used to implement the aforementioned data processing method.

[0016] The data processing method proposed in this application can be applied to storage devices. The storage device communicates with the host and can determine the rollback length of the storage device through interaction with the host. Then, based on the rollback length, a first synchronization point corresponding to the synchronization point in the rollback list is determined. Finally, data rollback is performed on the storage device according to the synchronization information recorded at the first synchronization point, restoring the storage device to a usable state consistent with the synchronization information. This rollback method can implement rollback according to actual rollback needs without requiring a "factory reset" operation on the storage device, thus reducing data loss and minimizing damage. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:

[0018] Figure 1 This is a flowchart illustrating the data processing method in some embodiments of this application;

[0019] Figure 2 This is a schematic diagram of the rollback linked list in some embodiments of this application;

[0020] Figure 3 This is a schematic diagram of the rollback linked list in some embodiments of this application;

[0021] Figure 4 This is a schematic diagram of the rollback linked list in some embodiments of this application;

[0022] Figure 5 This is a flowchart illustrating the data processing method in some embodiments of this application;

[0023] Figure 6 This is a flowchart illustrating the data processing method in some embodiments of this application;

[0024] Figure 7 This is a flowchart illustrating the data processing method in some embodiments of this application;

[0025] Figure 8 This is a flowchart illustrating the data processing method in some embodiments of this application;

[0026] Figure 9 This is a schematic diagram illustrating the interaction between the storage device and the host in some embodiments of this application;

[0027] Figure 10 These are schematic diagrams of the electronic devices in some embodiments of this application;

[0028] Figure 11 This is a schematic diagram of the structure of a computer-readable storage medium in some embodiments of this application. Detailed Implementation

[0029] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0030] See Figure 1 , Figure 1 This is a flowchart illustrating a data processing method in some embodiments of this application. The data processing method is applied to a storage device, which is communicatively connected to a host, and includes:

[0031] Step 11: Receive the query command from the host and send the rollback list of the storage device to the host; wherein the rollback list includes at least two synchronization points arranged in pointer order.

[0032] In some embodiments, the storage device generates and records synchronization points during data maintenance and storage maintenance. Since data such as mapping tables are written to the storage device when recording synchronization points, the synchronization point records a complete state of the data stored on the storage device. That is, the synchronization point corresponds to the data on the storage device, and the synchronization point can be used to represent the stored data on the storage device.

[0033] In some embodiments, the synchronization information recorded at each synchronization point includes at least one of the following: a list of storage block types, a list of storage block states, the physical address of the root node mapping table, and the write location of open blocks. The list of storage block types can be used to distinguish between root data, mapping tables, user data, etc.; the list of storage block states is used to distinguish between free blocks, data blocks, and open blocks.

[0034] In some embodiments, such as Figure 2 As shown, the rollback list includes at least two synchronization points arranged in pointer order. To indicate the pointer order of the synchronization points in the rollback list, each synchronization point can be assigned a number, with the numbers increasing sequentially. For example... Figure 2 As shown, the first synchronization point is numbered 0, the second synchronization point is numbered 1, the third synchronization point is numbered 2, ..., the i-th synchronization point is numbered i-1, that is, the numbers are arranged according to the arithmetic progression with a common difference of 1.

[0035] In other embodiments, the pointer order of synchronization points in the rollback list can also be represented in other ways, such as by sequentially decreasing numbers, which is not limited here.

[0036] Step 12: Receive the rollback length sent by the host and determine the first synchronization point from at least two synchronization points based on the rollback length.

[0037] In some embodiments, each synchronization point in the rollback list can serve as a potential rollback target to provide more options when determining the rollback length on the host side.

[0038] In some embodiments, after obtaining the rollback length from the storage device, the rollback list can be queried in reverse order of the pointer order based on the rollback length, thereby determining the first synchronization point from at least two synchronization points. For example... Figure 2 The rollback list shown can be queried starting from the synchronization point numbered i-1 and proceeding along the head of the rollback list (i.e., the synchronization point numbered 0).

[0039] Step 13: Roll back the data according to the synchronization information recorded at the first synchronization point.

[0040] It's important to note that storage devices perform garbage collection (GC), which moves data from some storage blocks, rendering those blocks free. These newly freed blocks still contain old data before being erased. Therefore, when recording synchronization points, if free blocks are generated, they need to be associated with their corresponding synchronization points to determine whether the synchronization point supports rollback.

[0041] In some embodiments, when associating a free block with a synchronization point, if the free block has a number, it can be associated with the corresponding synchronization point number. Furthermore, when multiple free blocks exist, they can be numbered for differentiation. For example... Figure 3 As shown, the rollback list includes m synchronization points arranged in pointer order. The m synchronization points are numbered 0, 1, 2...m-2, m-1. The synchronization point numbered m-1 is the latest synchronization point, the synchronization point numbered 2 is associated with free blocks b1 and b2, and the synchronization point numbered m-3 is associated with free blocks b3, b4, and b5.

[0042] In some embodiments, in response to the first synchronization point having at least one associated free block, and at least one free block not being erased, data rollback is performed according to the synchronization information recorded at the first synchronization point.

[0043] In addition, after data rollback, other synchronization points located after the first synchronization point can be deleted according to the pointer order, and the first synchronization point can be determined as the latest synchronization point of the rollback list.

[0044] like Figure 3 The rollback list shown shows that if the first synchronization point is determined to be synchronization point number 2 based on the rollback length, it is determined whether at least one of the free blocks b1 and b2 has been erased. If neither free block b1 nor b2 has been erased, the storage device can be rolled back from synchronization point number m-1 to synchronization point number 2. Other synchronization points after synchronization point number 2 can be discarded, making synchronization point number 2 the latest synchronization point in the rollback list. Figure 4 The rollback linked list shown in Figure ①.

[0045] In some embodiments, in response to any free block being erased, a target synchronization point corresponding to any free block is determined, and other synchronization points before the target synchronization point are deleted in pointer order, and the erased free block is deleted.

[0046] It's understandable that the target synchronization point can be the first synchronization point, or it can be any other synchronization point located before the first synchronization point according to pointer order. In this case, the operation of deleting other synchronization points before the target synchronization point is performed before data rollback, that is, the rollback list is updated before data rollback.

[0047] like Figure 3 The rollback list shown allows you to delete any of the free blocks b1, b2, b3, b4, and b5 if any of them is erased. Then, following the pointer order, you can delete the other synchronization points preceding the corresponding synchronization point. For example, if free block b1 is erased / used, you can delete the synchronization points numbered 0 and 1 preceding synchronization point number 2, as well as delete the free block b1 within synchronization point number 2, resulting in the following... Figure 4 The rollback list shown in Figure ②; for example, if free blocks b3 and b4 are both erased / used, the synchronization points numbered 0 to m-4 before the synchronization point numbered m-3 can be deleted, as well as the free blocks b3 and b4 in the synchronization point numbered m-3 can be deleted, resulting in the following... Figure 4 The rollback linked list shown in Figure ③.

[0048] Additionally, when multiple free blocks at synchronization points are erased / used, you can either delete the used free blocks and their corresponding synchronization points directly from the synchronization point closest to the latest synchronization point, or delete the used free blocks and their corresponding synchronization points sequentially, following the pointer order; there is no restriction here. For example... Figure 3The rollback list shown can be used to delete synchronization points numbered 0 to m-4 before synchronization point numbered m-3 in one step if free blocks b1, b3, and b4 are erased / used. Alternatively, synchronization points numbered 0 and 1 before synchronization point numbered 2 can be deleted first, and then synchronization points numbered 2 to m-4 before synchronization point numbered m-3 can be deleted.

[0049] It is worth noting that in some embodiments, in response to any free block being erased, the target synchronization point corresponding to any free block is determined, and other synchronization points before the target synchronization point are deleted according to the pointer order, and the erased free block is deleted to obtain the deleted rollback list. At this time, any synchronization point in the deleted rollback list can be used as a potential rollback position, which can be determined according to the rollback length.

[0050] In one application scenario, after determining the first synchronization point, it is necessary to determine whether the first synchronization point has any associated free blocks, and to determine whether any of the at least one associated free blocks have been erased.

[0051] If the first synchronization point has associated free blocks, and these free blocks have not been erased, it indicates that the synchronization information recorded at the first synchronization point is complete, supporting data rollback by the storage device. In this case, the storage device can roll back the data according to the synchronization information recorded at the first synchronization point, ensuring that the data in the storage device corresponds to the synchronization information recorded at the first synchronization point. Furthermore, after the storage device completes the data rollback, the synchronization information recorded by other synchronization points after the first synchronization point will become invalid according to the pointer order. To maintain the validity and simplicity of the rollback list, these other synchronization points can be deleted to update the rollback list.

[0052] If the first synchronization point has an associated free block and at least one free block is erased, the data in the free block does not exist, so rollback is not possible. That is, according to the pointer order, other synchronization points before the first synchronization point do not support backtracking to the first synchronization point and other synchronization points after the first synchronization point. In order to keep the rollback list valid and concise, other synchronization points before the first synchronization point can be deleted to update the rollback list.

[0053] The data processing method for storage devices provided in some embodiments of this application is applied to storage devices. It can determine the rollback length through interaction with the host, then determine a first synchronization point corresponding to the synchronization point in the rollback list based on the rollback length, and then roll back the data on the storage device based on the synchronization information recorded at the first synchronization point, so as to restore the storage device to a usable state consistent with the synchronization information. Furthermore, compared to the "factory reset" solution in related rollback technologies, which suffers from the loss of all data and significant losses, the data rollback method provided in this application can reduce data loss and minimize damage.

[0054] See Figure 5 , Figure 5 This is a flowchart illustrating a data processing method in some embodiments of this application, applied to a storage device, which is communicatively connected to a host, and includes:

[0055] Step 21: Receive the query command from the host and send the rollback list of the storage device to the host; wherein the rollback list includes at least two synchronization points arranged in pointer order.

[0056] Step 22: Receive the rollback length sent by the host and determine the first synchronization point from at least two synchronization points based on the rollback length.

[0057] Step 23: Roll back the data according to the synchronization information recorded at the first synchronization point.

[0058] It is understandable that after the storage device performs data rollback, the storage device will perform data maintenance and storage maintenance again, which will generate new synchronization points and synchronization information. At this time, step 24 can be executed.

[0059] Step 24: In response to the generation of new synchronization information, form target identification information based on the new synchronization information.

[0060] In some embodiments, the target identification information may be a handle, address, or other information, which is not limited here.

[0061] Step 25: Add new synchronization points in the rollback list according to the pointer order, and use the target identification information as an element in the new synchronization point; where the target identification information is used to represent the storage address of the new synchronization information.

[0062] In some embodiments, after data rollback, the rollback list deletes other synchronization points after the first synchronization point. At this time, the newly added synchronization point will be the latest synchronization point and will be arranged after the first synchronization point according to the pointer order.

[0063] It is understandable that each synchronization point in the rollback list has target identification information, and different synchronization points have different target identification information. After receiving the rollback length sent by the host, the storage device can find the first synchronization point and its target identification information based on the rollback length, and then call the corresponding synchronization information based on the target identification information to perform data rollback on the storage device.

[0064] The data processing methods provided in some embodiments of this application can perform data rollback on storage devices, restoring the storage device to a previous usable state as needed, which is quite flexible. Furthermore, compared to the "factory reset" solution in related rollback technologies, the data rollback method provided in this application can reduce data loss and minimize damage.

[0065] See Figure 6 , Figure 6 This is a flowchart illustrating a data processing method in some embodiments of this application, applied to a storage device, which is communicatively connected to a host, and includes:

[0066] Step 31: Receive the query command from the host and send the rollback list of the storage device to the host; wherein the rollback list includes at least two synchronization points arranged in pointer order.

[0067] Step 32: Receive the rollback length sent by the host and determine the first synchronization point from at least two synchronization points based on the rollback length.

[0068] Step 33: Roll back the data according to the synchronization information recorded at the first synchronization point.

[0069] Step 34: In response to the generation of new synchronization information, target identification information is formed based on the new synchronization information.

[0070] Step 35: Add new synchronization points in the rollback list according to the pointer order, and use the target identification information as an element in the new synchronization point; whereby the target identification information is used to represent the storage address of the new synchronization information.

[0071] It is understandable that after obtaining a new synchronization point, it is necessary to determine whether a new free block has been generated. If a new free block has been generated, step 36 can be executed.

[0072] Step 36: In response to the creation of a new free block, associate the new free block with the corresponding synchronization point and update the rollback list.

[0073] The data processing methods provided in some embodiments of this application can perform data rollback on storage devices. The rollback position can be determined as needed to restore the storage device to a previous usable state, which is quite flexible.

[0074] See Figure 7 See Figure 7 , Figure 7 This is a flowchart illustrating a data processing method in some embodiments of this application, applied to a storage device, which is communicatively connected to a host, and includes:

[0075] Step 41: Receive the query command from the host and send the rollback list of the storage device to the host; wherein the rollback list includes at least two synchronization points arranged in pointer order.

[0076] Step 42: Receive the rollback length sent by the host and determine the first synchronization point from at least two synchronization points based on the rollback length.

[0077] Step 43: Roll back the data according to the synchronization information recorded at the first synchronization point.

[0078] Step 44: In response to the generation of new synchronization information, target identification information is formed based on the new synchronization information.

[0079] In some embodiments, in order to reduce the memory space occupied by the rollback list and to maintain the efficiency of the rollback list, the length of the rollback list can be limited, such as setting the length of the rollback list to be less than or equal to the maximum length. The actual value range of the maximum length can be set independently and is not limited here.

[0080] Therefore, before adding the synchronization point to the rollback list, it is necessary to determine the relationship between the current length and the maximum length of the rollback list, and then execute step 45 or step 46.

[0081] Step 45: In response to the current length of the rollback list being equal to the maximum length, delete the synchronization points located at the head of the rollback list in pointer order, and add the new synchronization points to the tail of the rollback list.

[0082] It's understandable that if the current length of the rollback list equals the maximum length, adding a new synchronization point to the rollback list requires deleting / discarding the existing synchronization points. This can be done by deleting / discarding the synchronization point at the head of the list in pointer order, and then adding the new synchronization point to the tail of the rollback list in pointer order.

[0083] Step 46: In response to the current length of the rollback list being less than the maximum length, add the new synchronization point to the tail of the rollback list in pointer order, so that the new synchronization point becomes the latest synchronization point.

[0084] It is understandable that when the current length of the rollback list is less than the maximum length, the new synchronization point can be added directly to the end of the rollback list according to the pointer order, without needing to delete / discard the synchronization points in the rollback list.

[0085] Step 47: Use the target identification information as an element in the new synchronization point; whereby the target identification information is used to represent the storage address of the new synchronization information.

[0086] It is understandable that after obtaining a new synchronization point, it is necessary to determine whether a new free block has been generated. If a new free block has been generated, step 48 can be executed.

[0087] Step 48: In response to the creation of a new free block, associate the new free block with the corresponding synchronization point and update the rollback list.

[0088] The data processing method provided in some embodiments of this application can perform data rollback on the storage device. The rollback position can be determined autonomously by the host as needed to restore the storage device to an available state corresponding to the rollback position.

[0089] See Figure 8 , Figure 8 This is a flowchart illustrating a data processing method in some embodiments of this application, applied to a host device, wherein the host device is communicatively connected to a storage device, and includes:

[0090] Step 51: Obtain the rollback list of the storage device; wherein the rollback list includes at least two synchronization points arranged in pointer order.

[0091] Step 52: Determine the rollback length and send the rollback length to the storage device so that the storage device can determine the first synchronization point from at least two synchronization points based on the rollback length, and perform data rollback according to the synchronization information recorded at the first synchronization point.

[0092] The data processing method provided in some embodiments of this application is applied to the host side. It can determine the rollback length of the storage device through interaction with the storage device, enabling the storage device to determine a first synchronization point corresponding to the synchronization point in the rollback list based on the rollback length. Then, it performs data rollback on the storage device according to the synchronization information recorded at the first synchronization point, restoring the storage device to a usable state consistent with the synchronization information. Furthermore, compared to the "factory reset" solution in related rollback technologies, which suffers from the loss of all data and significant losses, the data rollback method provided in this application can reduce data loss and minimize damage.

[0093] See Figure 9 , Figure 9 These are schematic diagrams illustrating the interaction between the storage device and the host in some embodiments of this application, including:

[0094] S1: Send a query command to the storage device.

[0095] S2: Send the rollback list to the host.

[0096] S3: Determine the rollback length based on the rollback list.

[0097] S4: Send the rollback length to the storage device.

[0098] S5: Receive the rollback length and determine the first synchronization point from at least two synchronization points based on the rollback length.

[0099] S6: Obtain the synchronization information recorded at the first synchronization point.

[0100] S7: Perform data rollback based on synchronization information.

[0101] In one application scenario, the host queries the storage device for the rollback length, and the storage device returns the length of the rollback list that can be rolled back to the host. The host then specifies the rollback length, so that the storage device can find the target synchronization point (i.e., the first synchronization point) in the rollback list according to the specified rollback length. The synchronization point corresponding to the rollback position (i.e., the target synchronization point) is then applied to the storage device to complete the rollback.

[0102] See Figure 10 , Figure 10 This is a schematic diagram of the structure of an electronic device in some embodiments of this application. The electronic device 10 includes a memory 101 and a processor 102. The memory 101 stores a computer program, and the processor 102 is used to execute the computer program to implement the data processing method described in any of the above embodiments, which will not be described in detail here.

[0103] See Figure 11 , Figure 11 This is a schematic diagram of the structure of a computer-readable storage medium in some embodiments of this application. The computer-readable storage medium 100 is used to store a computer program 1001. When the computer program 1001 is executed by the processor 102, it is used to implement the data processing method described in any of the above embodiments, which will not be repeated here.

[0104] The processor 102 involved in this application may be referred to as a CPU (Central Processing Unit), which may be an integrated circuit chip, or a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component.

[0105] The computer-readable storage medium 100 used in this application includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), or optical discs.

[0106] In summary, the data processing methods provided in some embodiments of this application can be applied to the host and storage devices. Through communication and interaction between the host and storage devices, on the one hand, the host can autonomously determine the rollback length to achieve autonomous control over the rollback position, which is more flexible. On the other hand, the storage device can query the rollback list through the rollback length fed back by the host to determine the first synchronization point, and then use the synchronization information recorded at the first synchronization point to perform data rollback on the storage device, which can reduce data loss and reduce losses. Furthermore, the rollback list in this application is updated in real time, and can be deleted or added when conditions are met, which can reduce the time and space costs consumed during data rollback.

[0107] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A data processing method, characterized in that, Applied to a storage device that is communicatively connected to a host, the method includes: The system receives a query command from the host and sends the rollback list of the storage device to the host; wherein the rollback list includes at least two synchronization points arranged in pointer order. Receive the rollback length sent by the host, and determine the first synchronization point from at least two synchronization points based on the rollback length; Data rollback is performed based on the synchronization information recorded at the first synchronization point.

2. The method according to claim 1, characterized in that, The step of determining the first synchronization point from at least two synchronization points based on the rollback length includes: Based on the rollback length, the rollback list is queried in the reverse order of the pointers to determine the first synchronization point from the at least two synchronization points.

3. The method according to claim 1, characterized in that, The data rollback based on the synchronization information recorded at the first synchronization point includes: In response to the first synchronization point having at least one associated free block, and none of the at least one free block being erased, a rollback is performed according to the synchronization information recorded by the first synchronization point.

4. The method according to claim 3, characterized in that, The method further includes: In response to any free block being erased, determine the target synchronization point corresponding to that free block; Delete the other synchronization points before the target synchronization point according to the pointer order.

5. The method according to any one of claims 1-3, characterized in that, After performing data rollback according to the synchronization information recorded at the first synchronization point, the method further includes: According to the pointer order, delete other synchronization points located after the first synchronization point, and determine the first synchronization point as the latest synchronization point of the rollback list.

6. The method according to any one of claims 1-3, characterized in that, The synchronization information includes at least one of the following: a list of storage block types, a list of storage block statuses, the physical address of the root node mapping table, and the write location of open blocks.

7. The method according to claim 1, characterized in that, The method further includes: In response to the generation of new synchronization information, target identification information is formed based on the new synchronization information; Synchronization points are added to the rollback list in the order of the pointers, and the target identification information is used as an element in the new synchronization point; wherein, the target identification information is used to characterize the storage address of the new synchronization information; In addition, in response to the generation of a new free block, the new free block is associated with the corresponding synchronization point, and the rollback list is updated.

8. The method according to claim 7, characterized in that, The step of adding synchronization points to the rollback list according to the pointer order includes: Determine whether the current length of the rollback list is equal to the maximum length; If so, delete the synchronization point located at the head of the rollback list in the order of the pointers, and add the newly added synchronization point to the tail of the rollback list.

9. A data processing method, characterized in that, Applied to a host device, wherein the host device is communicatively connected to a storage device, the method includes: Obtain the rollback list of the storage device; wherein the rollback list includes at least two synchronization points arranged in pointer order; The rollback length is determined and sent to the storage device so that the storage device determines a first synchronization point from at least two synchronization points based on the rollback length, and performs data rollback according to the synchronization information recorded at the first synchronization point.

10. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method as described in any one of claims 1-9.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program, which, when executed by a processor, is used to implement the method as described in any one of claims 1-9.