Data processing method and device, storage system and storage medium
By using business-level implicit snapshots to store and edit data during data recovery, the problem of downtime during data recovery was solved, improving business efficiency and success rate.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SANGFOR TECH INC
- Filing Date
- 2025-12-17
- Publication Date
- 2026-05-19
AI Technical Summary
Existing technologies require downtime for data recovery, leading to business disruptions and low efficiency.
By using implicit snapshots to store edited data for business requests during the data recovery process, and then editing the data based on the implicit snapshots after recovery, business downtime can be avoided.
This enables data recovery processing without downtime, improving business implementation efficiency and success rate, and avoiding issues such as business requests being unable to be processed and waiting for recovery to complete due to downtime.
Smart Images

Figure CN122064532A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic information technology, and more specifically, to a data processing method, apparatus, storage system, and storage medium. Background Technology
[0002] Data recovery refers to restoring the data storage state of a data disk to a specific point in time. For example, restoring the data storage state of a data disk to the state it was in one week ago.
[0003] In related technologies, data recovery processing requires downtime, which leads to business interruption and low business efficiency. Summary of the Invention
[0004] In view of this, embodiments of this application propose a data processing method, apparatus, storage system, and storage medium.
[0005] In a first aspect, embodiments of this application provide a data processing method, the method comprising: during data recovery processing of a target data disk, in response to a business request for the target data disk, adding the edited data requested by the business request to a business implicit snapshot; and in response to the completion of data recovery processing, performing editing processing on the data in the target data disk based on the edited data included in the business implicit snapshot.
[0006] Secondly, embodiments of this application provide a data processing apparatus, comprising: a response module, configured to, during data recovery processing of a target data disk, add edited data requested by a business request for the target data disk to a business implicit snapshot in response to a business request for the target data disk; and an editing module, configured to, upon completion of data recovery processing, edit data in the target data disk based on the edited data included in the business implicit snapshot.
[0007] Optionally, the apparatus further includes a recovery processing module, configured to, in response to a snapshot rollback request for the target data disk, create a business implicit snapshot and a reference implicit snapshot indicating the current data storage state of the target data disk; wherein, the snapshot rollback request is used to request the restoration of the data storage state of the target data disk to the data storage state indicated by the data snapshot at a specified time point; the specified time point is before the time point at which the snapshot rollback request is received; the data snapshot is used to indicate the data storage state of the target data disk; and data recovery processing is performed on the target data disk based on the difference between the data snapshot at the specified time point and the reference implicit snapshot.
[0008] Optionally, the target data disk is divided into multiple storage blocks. The implicit snapshot includes the first data currently stored in each storage block, and the data snapshot at a specified time point includes the second data stored in each storage block at the specified time point. The editing module 820 is also used to traverse the multiple storage blocks. For each traversed storage block, if there is a difference between the first data and the second data of the storage block, the first data currently stored in the storage block is overwritten according to the second data of the storage block to realize the data recovery processing of the storage block.
[0009] Optionally, the editing module is also used to delete reference implicit snapshots and business implicit snapshots.
[0010] Optionally, the recovery processing module is further configured to lock the digital directory of the target data disk in response to a snapshot rollback request for the target data disk; while the digital directory is locked, only the target process corresponding to the snapshot rollback request is allowed to create snapshots and update the digital directory; in response to the digital directory being locked, an indication reference implicit snapshot and a business implicit snapshot are created by the target process; the digital directory is updated by the target process based on the reference implicit snapshot and the business implicit snapshot; and the digital directory is unlocked in response to the completion of the digital directory update.
[0011] Optionally, the response module is also configured to, in response to a new business request for the target data disk, add the edited data requested by the new business request to the business implicit snapshot to update the business implicit snapshot.
[0012] Optionally, the target data disk is divided into multiple storage blocks, and the edit data includes the write data corresponding to the target storage block among the multiple storage blocks; the editing module is also used to overwrite the currently stored data in the target storage block according to the write data corresponding to the target storage block in response to the completion of data recovery processing, so as to realize the data editing processing of the target data disk.
[0013] Thirdly, embodiments of this application provide a storage system including multiple data disks, each data disk being used to execute the above-described method.
[0014] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-readable instructions that, when executed by a processor, implement the above-described method.
[0015] Fifthly, embodiments of this application provide a computer program product including computer-readable instructions that, when executed by a processor, implement the method described above.
[0016] This application provides a data processing method, apparatus, storage system, and storage medium. In the data recovery process, an implicit snapshot is used to store the edited data requested by the business request. After the data recovery process is completed, the data in the target data disk is edited based on the edited data included in the implicit snapshot. Therefore, the business does not need to be shut down during the data recovery process, avoiding the situation where the business cannot be received due to business downtime, resulting in the inability to implement the business, or the situation where the business request can only be received after the data recovery process is completed, resulting in low efficiency in implementing the business request. This improves the success rate and efficiency of business implementation. 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 accompanying 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.
[0018] Figure 1 A schematic diagram illustrating an application scenario applicable to the embodiments of this application is shown; Figure 2 A flowchart illustrating a data processing method according to an embodiment of this application is shown. Figure 3 A flowchart of a data processing method according to yet another embodiment of this application is shown; Figure 4 A flowchart of a data processing method according to another embodiment of this application is shown; Figure 5 A schematic diagram of a snapshot creation process according to an embodiment of this application is shown; Figure 6 A schematic diagram of a differential data copying process according to an embodiment of this application is shown; Figure 7 A schematic diagram of a snapshot deletion process according to an embodiment of this application is shown; Figure 8 A schematic diagram illustrating the data snapshot change process of a data disk in an embodiment of this application is shown; Figure 9 A schematic diagram illustrating the data snapshot change process of another data disk in an embodiment of this application is shown; Figure 10 A schematic diagram illustrating the data snapshot change process of another data disk in an embodiment of this application is shown; Figure 11 A schematic diagram illustrating the data snapshot change process of another data disk in an embodiment of this application is shown; Figure 12 A block diagram of a data processing apparatus according to one embodiment of this application is shown; Figure 13 A structural block diagram of an electronic device for performing a data processing method according to an embodiment of this application is shown. Detailed Implementation
[0019] 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 some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0020] In the following description, the terms "first" and "second" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first" and "second" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit the application. It should be noted that "multiple" as used herein refers to two or more. "And / or" describes the association relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.
[0022] The following is an explanation of the technical terms used in this application: Storage array: A device used for centralized management and storage of large amounts of data, consisting of multiple hard drives; providing access interfaces for block storage protocol standards such as iSCSI and NoF.
[0023] Snapshot: Freezes and saves the system's data state at a specific point in time.
[0024] Snapshot recovery, also known as snapshot rollback, restores business data to the data storage state indicated by a snapshot at a specified point in time. It helps users quickly respond to situations such as accidental deletion, data corruption, or malicious attacks, restoring historically usable data.
[0025] LUN: Logical Unit Number is a number used to identify logical units.
[0026] Please refer to Figure 1 The diagram illustrates an application scenario applicable to the embodiments of this application. This application scenario includes a terminal 110 and a storage system 120.
[0027] Terminal 110 can be, for example, a smartphone, tablet computer, e-book reader, music player, wearable device, smart home device, in-vehicle terminal, etc. Terminal 110 may include a data processing client capable of implementing the data processing method of this application.
[0028] Storage system 120 includes multiple data disks. For example, the storage system includes three data disks: data disk 121, data disk 122, and data disk 123. Each data disk is distinguished by its own LUN. Data disks can be physical disks or virtual disks. A virtual disk is storage space obtained by virtualizing at least one physical disk.
[0029] Specifically, electronic device 110 can access storage system 120 through LUN Initiator block protocol (actually accessing any data disk node in storage system 120). That is, electronic device 110 can send various business requests to storage system 120 through LUN Initiator block protocol.
[0030] Each data disk in storage system 120 has a LUN Target Server (Logical Unit Service), a metadata maintenance center, and a data persistence layer. The logical unit service provides a block protocol parsing and processing unit to handle requests sent by electronic devices through the LUN Initiator block protocol. The metadata center maintains various snapshots generated by the data disk. The data persistence layer is used to persist the data in the data disk, etc.
[0031] In some implementations, electronic device 110 may send a snapshot rollback request to a target data disk (e.g., data disk 121) in storage system 120. In response to the snapshot rollback request, the target data disk performs data recovery processing. During the data recovery process, in response to a service request from electronic device 110 for the target data disk, the edited data requested by the service request is added to the service implicit snapshot. Finally, in response to the completion of the data recovery process, the target data disk performs editing processing on the data in the target data disk based on the edited data included in the service implicit snapshot.
[0032] In some other embodiments, electronic device 110 may simultaneously send a snapshot rollback request for the target data disk and a service request for the target data disk to the target data disk in storage system 120. In this case, in response to the snapshot rollback request for the target data disk, the target data disk performs data recovery processing on the target data disk. At the same time, it creates a service implicit snapshot and adds the edited data requested by the service request to the service implicit snapshot. Finally, in response to the completion of the data recovery processing, the target data disk performs editing processing on the data in the target data disk based on the edited data included in the service implicit snapshot.
[0033] Of course, each data disk in the storage system 120 can also have a management module. That is, the management module integrates the functions of implementing logical unit services, metadata maintenance center and data persistence layer. Thus, the data disk can implement the functions of logical unit services, metadata maintenance center and data persistence layer through its own management module, thereby realizing the data processing method of this application.
[0034] Please see Figure 2 , Figure 2 This application illustrates a flowchart of a data processing method according to an embodiment of the present application. The method is applied to any data disk in a storage system 120 and may include: S110. During the data recovery process of the target data disk, in response to the business request for the target data disk, the edited data requested by the business request is added to the business implicit snapshot.
[0035] The target data disk can be any data disk in the storage system. The storage system (which can be a management node or management module in the storage system) can respond to the data recovery request and perform data recovery processing on the target data disk to restore the target data disk to the point in time specified in the data recovery request.
[0036] Upon receiving a data recovery request, it is determined that data recovery processing should be performed on the target data disk, and a business implicit snapshot of the target data disk is created so as to store the edited data requested by the business request through the business implicit snapshot.
[0037] Of course, if there are multiple target data disks (and data recovery is performed on all target data disks), an implicit business snapshot can be created for each target data disk.
[0038] A business request refers to a business request targeting a target data disk. A business request can be a request to edit data in the target data disk. Business requests can include write requests to write new data to the target data disk, modification requests to modify existing data on the target data disk, and deletion requests to delete data in the target data disk. Correspondingly, editing data can include the data written by the write request (which can include the specific data written, or the data stored on the target data disk after the new data is written), the data modified by the modification request (which can include what data is modified to what data, or the data stored on the target data disk after the data is modified), and the data deleted by the delete request (which can include the deleted data, or the data stored on the target data disk after the data is deleted).
[0039] In some implementations, the target data disk can be divided into multiple storage blocks, each storing corresponding data. A business request may include write data that needs to be written to one or more target storage blocks. This write data is used to overwrite the original data originally stored in the target storage block. That is, the edit data requested by the business request is actually the write data that needs to be written to the target storage block. This write data replaces the original data in the target storage block. If the write data has more content than the original data, the business request is actually a request to write data. If the write data is different from the original data, the business request is actually a request to modify data. If the write data has less content than the original data, the business request is actually a request to delete data.
[0040] S120. In response to the completion of data recovery processing, based on the edited data included in the business implicit snapshot, the data in the target data disk is edited.
[0041] After completing the data recovery process, the data in the target data disk can be edited from the edit data included in the business implicit snapshot. This allows the business requests to continue to be fulfilled after the data in the target data disk is recovered, and the data in the target data disk can be edited according to the edit data requested by the business request.
[0042] Of course, as mentioned above, the target data disk is divided into multiple storage blocks, and the edit data includes the write data corresponding to the target storage block among the multiple storage blocks; that is, the edit data requested by the business request is actually the new data that needs to be written to the target storage block. At this time, S120 may include: in response to the completion of data recovery processing, overwriting the data currently stored in the target storage block according to the write data corresponding to the target storage block, so as to realize the data editing processing of the target data disk.
[0043] In other words, the write data required to be written to the target storage block in the implicit snapshot of the business (which may include the edit data requested by one or more business requests) is overwritten with the currently stored data (that is, the current original data) of the target storage block, thereby realizing the editing processing of the target storage block and thus the editing processing of the data in the target data disk.
[0044] In some implementations, prior to S120, the method may further include: in response to a new business request for the target data disk, adding the edited data requested by the new business request to the business implicit snapshot to update the business implicit snapshot.
[0045] In other words, during the data recovery process of the target data disk, more than one business request for the target data disk is received. Therefore, the edited data of each business request for the target data disk during the data recovery process can be added to the business implicit snapshot, so that the business implicit snapshot can include the edited data of each business request.
[0046] In other words, in this application, the business implicit snapshot is actually a dynamic snapshot that can continuously accommodate the content requested for editing by new business requests. Therefore, during the data recovery process of the target data disk, only one business implicit snapshot needs to be created, instead of creating a business implicit snapshot for each business request. This reduces the number of business implicit snapshots created, eliminates the overhead of creating and managing business implicit snapshots, and effectively reduces resource waste.
[0047] Of course, it is not difficult to understand that after editing the data in the target data disk based on the edit data included in the business implicit snapshot, the data in the target data disk can be edited in real time in response to business requests. If the business implicit snapshot is no longer needed to accommodate the edit data requested by the business request, the business implicit snapshot can be deleted to free up storage space and avoid resource waste.
[0048] In this embodiment, during the data recovery process, the edited data requested by the business request is stored through an implicit business snapshot. After the data recovery process is completed, the data in the target data disk is edited based on the edited data included in the implicit business snapshot. Therefore, the business does not need to be shut down during the data recovery process, avoiding the situation where the business cannot receive business requests due to business downtime, resulting in the inability to implement the business, or the situation where the business request can only be received after the data recovery process is completed, resulting in low efficiency in implementing the business request. This improves the success rate and efficiency of business implementation.
[0049] In some embodiments, such as Figure 3 As shown, before S110, the method further includes: S010. In response to a snapshot rollback request for the target data disk, create a business implicit snapshot and a reference implicit snapshot indicating the current data storage status of the target data disk.
[0050] The snapshot rollback request is used to request the restoration of the data storage state of the target data disk to the data storage state indicated by the data snapshot at a specified time point; the specified time point is before the time point at which the snapshot rollback request is received; the data snapshot is used to indicate the data storage state of the target data disk.
[0051] In other words, a data snapshot of the target data disk indicates the data storage status of the target data disk at a certain point in time. It is a static snapshot. In other words, the data snapshots of the target data disk correspond to their respective points in time, and the data snapshots of the target data disk at different points in time indicate the data storage status of the target data disk at different points in time.
[0052] A snapshot recovery request can be a request with a specified point in time, so that the specified point in time can be determined based on the snapshot recovery request, and a data snapshot at the specified point in time can be obtained as the basis for snapshot rollback.
[0053] The created implicit snapshot for business operations is initially an empty snapshot, unlike a static data snapshot. The implicit snapshot for business operations is actually used to store the edited data requested by the business requests. Furthermore, the implicit snapshot for business operations is a dynamic snapshot, which can continuously add edited data as business requests increase.
[0054] The reference implicit snapshot is used to indicate the current data storage state of the target data disk at a point in time in response to a snapshot rollback request for the target data disk.
[0055] In this embodiment, a data snapshot can be created in real time as a reference implicit snapshot. If no modifications have been made to the data on the target data disk after the previous data snapshot was created, the previously created data snapshot can be directly copied, and the copied data snapshot can be used as a reference implicit snapshot. At this time, although the reference implicit snapshot is not the current data snapshot created on the target data disk, it can still accurately indicate the current data storage status of the target data disk.
[0056] S020. Perform data recovery processing on the target data disk based on the difference between the data snapshot at a specified time point and the reference implicit snapshot.
[0057] After obtaining the reference implicit snapshot, the difference between the data snapshot of the target data disk at a specified time point and the reference implicit snapshot can be compared. Then, based on the difference, data recovery processing is performed on the target data disk to roll back the data storage state of the target data disk to the data storage state at the specified time point, thereby realizing the snapshot rollback of the target data disk.
[0058] Snapshot rollback refers to rolling back the data storage state of a data disk to the data storage state indicated by an existing data snapshot. Thus, snapshot rollback of a target data disk refers to rolling back the data storage state of the target data disk to the data storage state at a specified point in time.
[0059] In some implementations, the target data disk is divided into multiple storage blocks. The reference implicit snapshot includes the first data currently stored in each storage block, and the data snapshot at a specified time point includes the second data stored in each storage block at the specified time point. Correspondingly, S020 may also include: traversing the multiple storage blocks; for each traversed storage block, if there is a difference between the first data and the second data of the storage block, the first data currently stored in the storage block is overwritten according to the second data of the storage block to realize the data recovery processing of the storage block.
[0060] Multiple storage blocks can be arranged in a specified order, allowing for sequential traversal of each block according to that order. This specified order can be set based on requirements, or it can be the order in which the address ranges of the multiple storage blocks are located within the address range of the entire target data disk; this application does not impose any limitations on this. Alternatively, the multiple storage blocks can be unordered, allowing for random traversal until all storage blocks have been traversed.
[0061] For each traversed storage block, if there is a difference between the first and second data of the storage block, it means that the storage block has been edited after the specified time point, and the data stored in the storage block has changed. In this case, the second data of the storage block overwrites the first data stored therein, so as to restore the data storage state of the storage block to the data storage state at the specified time point. Conversely, if there is no difference between the first and second data of the storage block, it means that the storage block has not been edited after the specified time point, and the data stored in the storage block has not changed. In this case, the data storage state of the storage block remains unchanged, and the data storage state of the storage block is also maintained as the data storage state at the specified time point.
[0062] After traversing each storage block in the aforementioned manner, the data recovery process for the target data disk is achieved.
[0063] In some implementations of this embodiment, after S120, the method may further include: deleting the reference implicit snapshot and the business implicit snapshot.
[0064] It is easy to understand that after editing the data in the target data disk based on the edit data included in the business implicit snapshot, the data in the target data disk can be edited in real time in response to business requests. There is no longer a need for the business implicit snapshot to contain the edit data requested by the business request, nor is it necessary to refer to the implicit snapshot for data recovery processing of the target data disk. Therefore, the business implicit snapshot and the reference implicit snapshot can be deleted to free up storage space and avoid resource waste.
[0065] In this embodiment, in response to a snapshot rollback request from the target data disk, a reference implicit snapshot indicating the current data storage status of the target data disk is obtained. Based on the difference between the data snapshot at a specified time point and the reference implicit snapshot, data recovery processing is performed on the target data disk. Only the data of the storage blocks with differences needs to be copied for data recovery processing, instead of overwriting the entire target storage disk with all the data indicated by the data snapshot at the specified time point. This greatly reduces the amount of data that needs to be copied, improves the efficiency of data recovery processing, and avoids the waste of resources caused by copying data of storage blocks without differences.
[0066] In some embodiments, such as Figure 4 As shown, S010 includes: S0101. In response to a snapshot rollback request for the target data disk, lock the digital directory of the target data disk; in response to the digital directory being locked, create a reference implicit snapshot and a business implicit snapshot through the target process.
[0067] The digital directory is locked, allowing only the target process corresponding to the snapshot rollback request to create snapshots and update the digital directory. The digital directory stores snapshot information for the target data disk, which may include a snapshot summary, creation time, and snapshot identifier.
[0068] The target process refers to the process used to perform the snapshot rollback operation requested by the snapshot rollback request (the operation of restoring the data storage state of the target data disk to the data storage state indicated by the data snapshot at a specified point in time). The target process can be created in response to the snapshot rollback request for the target data disk so that the snapshot rollback operation requested by the snapshot rollback request can be implemented through the target process.
[0069] In other words, when responding to a snapshot rollback request for the target data disk, the digital directory of the target data disk is locked first to prevent other processes from creating new data snapshots and updating the digital directory. This avoids overlapping read and write processes and write conflicts, ensuring that data is written in order and preventing data corruption and loss.
[0070] Accordingly, after S0101, the method also includes: S0102 updating the digital catalog based on the reference implicit snapshot and the business implicit snapshot; and unlocking the digital catalog in response to the completion of the digital catalog update.
[0071] In other words, the digital directory is updated by referencing implicit snapshots and business implicit snapshots, so that the updated digital directory stores snapshot information from both the reference implicit snapshot and the business implicit snapshot.
[0072] Once the digital catalog update is complete, the digital catalog will be unlocked. After the digital catalog is unlocked, a new data snapshot can be created on the target data disk, and the digital catalog can be updated based on the new data snapshot.
[0073] Of course, it's easy to understand that after the data recovery process is completed and the data in the target data disk is edited based on the edited data included in the implicit snapshot, the digital directory of the target data disk is locked again. Correspondingly, in this locked state, the digital directory only allows the target deletion process to update the digital directory and delete the reference implicit snapshot and the business implicit snapshot. At this time, in response to the digital directory being locked, the target deletion process can delete the reference implicit snapshot and the business implicit snapshot, and delete the snapshot information of the reference implicit snapshot and the business implicit snapshot in the digital directory to update the digital directory again. After the digital directory is updated again, it can be unlocked in response to the completion of the digital directory update.
[0074] In this embodiment, when creating the reference implicit snapshot and the business implicit snapshot, the digital directory is also locked, which can effectively avoid the crossover and write conflicts of the reading and writing processes of each process, ensure that the data is written in order, and ensure that the data is not damaged or lost.
[0075] To better understand the solution of this application, the data processing method of this application will be explained below with reference to an example.
[0076] First, the snapshot creation phase, such as Figure 5 As shown.
[0077] 1. Snapshot rollback request. Electronic devices send snapshot rollback requests to the logical unit service (LUN Target Server) in the storage system via Remote Procedure Call (RPC). 2. Check if a snapshot exists and if rollback is allowed. The logical unit service checks if a data snapshot exists at the specified point in time to which the snapshot rollback request is to be rolled back. If it exists, rollback is allowed; otherwise, rollback is not allowed. If rollback is not allowed, the electronic device is notified to re-initiate the snapshot rollback request. 3. Snapshot task starts; the logical unit service notifies the metadata center to start the snapshot task; 4. Lock the numeric directory. Lock the numeric directory to allow only the target process to modify it and create snapshots.
[0078] 5. Initiate a snapshot creation request: The metadata center initiates a snapshot creation request to the snapshot service; 6. Record the snapshot creation request and create a new snapshot in memory.
[0079] 7. Snapshot application successful.
[0080] Repeat steps 5-7 twice to request two snapshots: a business implicit snapshot and a reference implicit snapshot.
[0081] 8. Add two snapshots to the target data disk and add a differential data copy attribute to the digital directory. After adding the differential data copy attribute to the digital directory, perform data recovery processing on the target data disk based on this attribute—data recovery processing is performed on the target data disk based on the difference between the data snapshot at a specified time point and the reference implicit snapshot.
[0082] 9. Initiate a snapshot completion request: The metadata center initiates a snapshot completion request to the snapshot service; 10. Record that the snapshot is complete and modify the global snapshot information. At this point, the global snapshot information will include snapshot information for both the business implicit snapshot and the reference implicit snapshot.
[0083] 11. Snapshot application successful.
[0084] Cycle 8-11 twice to request two snapshots: a business implicit snapshot and a reference implicit snapshot.
[0085] 12. Unlock the digital catalog. The metadata center unlocks the digital catalog.
[0086] After unlocking the digital catalog, a prompt message is returned to the electronic device through the logical unit service, so that the electronic device can initiate a new business request.
[0087] Secondly, the data recovery process is as follows Figure 6 As shown.
[0088] 1. Data Recovery. Electronic devices initiate data recovery via remote services.
[0089] 2. Read the differential data copy attributes of the target data disk.
[0090] 3. Initiate the asynchronous copy task. The logical unit service returns a success message to the electronic device indicating that the differential copy task has been successfully initiated, so that the data recovery process can be confirmed based on the message.
[0091] 4. Read the information of the traversed storage blocks.
[0092] 5. Based on snapshots, storage block data offsets, and data lengths, determine whether there are differences in the data of the storage block at different points in time. The persistence layer determines the address range of the storage block based on the storage block data offsets and data lengths.
[0093] 6. Confirmation successful. The persistent layer returned the address range successfully.
[0094] 7. Request to read. The logical unit service notifies the persistence layer to read data from the storage block.
[0095] 8. Read the data from the storage block. The second data in the data snapshot of the persistence layer at the specified point in time, and the first data in the reference implicit snapshot of the storage block at the current point in time.
[0096] 9. Reply with the read data. The first and second read data are then restored to the logical unit.
[0097] 10. Determine if there are discrepancies in the data of the storage block. The logical unit service determines if there are discrepancies between the first and second data of the storage block to determine if there are discrepancies in the data of the storage block at different points in time.
[0098] 11. Based on the differences, perform data copying. If differences exist, the persistence layer copies the second data and overwrites the first data accordingly.
[0099] 12. Copy successful.
[0100] 13. Real-time updates of copy progress.
[0101] 5-13 Asynchronous loops are performed multiple times to traverse each storage block, thereby completing the data recovery process of the target data disk.
[0102] Afterwards, the snapshot deletion process is as follows: Figure 7 As shown.
[0103] 1. Snapshot rollback complete. The electronic device sends a snapshot rollback completion message to the logical unit service in the storage system via a remote service; 2. Check if the difference data has been copied completely. The logical unit service checks whether the difference data between the reference implicit snapshot and the data snapshot at the specified point in time has been copied completely; 3. The snapshot deletion task is started; the logical unit service notifies the metadata center to start the snapshot deletion task; 4. Lock the numeric directory. Lock the numeric directory to allow only the target deletion process to modify the numeric directory and delete snapshots.
[0104] 5. Initiate a snapshot deletion request: The metadata center initiates a snapshot deletion request to the snapshot service; 6. Record snapshot deletion requests and store the snapshots that need to be deleted in memory.
[0105] 7. Snapshot deletion request successful.
[0106] Repeat steps 5-7 twice to request the deletion of two snapshots: the business implicit snapshot and the reference implicit snapshot.
[0107] 8. Delete these two snapshots from the target data disk and remove the differential data copy attribute added to the numeric directory. After deleting the differential data copy attribute from the numeric directory, data recovery processing on the target data disk will no longer be based on the difference between the data snapshot at the specified time point and the reference implicit snapshot.
[0108] 9. Initiate a snapshot deletion completion request: The metadata center initiates a snapshot deletion completion request to the snapshot service; 10. Record that the snapshot deletion is complete, and modify the global snapshot information. At this point, the snapshot information for both the business implicit snapshot and the reference implicit snapshot has been deleted from the global snapshot information.
[0109] 11. Snapshot deletion successful.
[0110] Repeat steps 9-12 twice to request two snapshots: a business implicit snapshot and a reference implicit snapshot.
[0111] 13. Unlock the digital catalog. The metadata center unlocks the digital catalog.
[0112] After unlocking the digital catalog, a prompt message is returned to the electronic device through the logical unit service, so that the electronic device can initiate a new business request.
[0113] In passing Figure 5-7 After the target data disk undergoes data processing, the snapshot change process of the target data disk is as follows: Figure 8 As shown in the diagram. The target data disk has three storage blocks, each storing the corresponding data.
[0114] like Figure 8 The target data disk shown has data snapshot 1, data snapshot 2, and data snapshot 3 created sequentially. Then, as... Figure 9 As shown, in response to a snapshot rollback request for the target data disk and a business request, implicit snapshots 4 and 5 are created. No modifications were made to the target data disk after data snapshot 3 was created, and implicit snapshot 4 contains the same content as data snapshot 3, with identical content across all three storage blocks. Implicit snapshot 5 contains the write data requested by the business request, including data H written to the second data block.
[0115] like Figure 9 As shown, the specified time point requested for the snapshot rollback request is the time point where data snapshot 2 is located. Therefore, the reference implicit snapshot read is data snapshot 2. Based on the difference between data snapshot 2 and data snapshot 4, snapshot rollback processing is performed to achieve data recovery processing on the target data disk.
[0116] After completing the data recovery process on the target data disk, the snapshot change process of the target data disk is as follows: Figure 10 As shown, at this point, implicit snapshot 4 and implicit snapshot 5 can also be deleted to free up storage space.
[0117] After deleting implicit snapshots 4 and 5, the snapshot changes on the target data disk are as follows: Figure 11 As shown, at this point, each data snapshot can be read in chronological order.
[0118] In this example, during the data recovery process, a snapshot rollback is performed using a skip read (skipping to a data snapshot at a specified point in time), and the data is recovered based on the data copying differences between the snapshots, thus quickly restoring the data and achieving rapid data recovery.
[0119] Furthermore, for data disks, the data timeline of snapshot data grows linearly without branching, which facilitates the reclamation and management of overwritten data by log-based storage systems, eliminating the need for application-layer caching of snapshot chain information.
[0120] The data recovery method described in this example can help users quickly respond to situations such as accidental deletion, data corruption, or malicious attacks, restore historically usable data, and improve data security and stability.
[0121] Please see Figure 12 , Figure 12 This illustration shows a block diagram of a data processing apparatus according to an embodiment of the present application. The data processing apparatus 800 includes: The response module 810 is used to add the edited data requested by the business request to the business implicit snapshot during the data recovery process of the target data disk. The editing module 820 is used to edit the data in the target data disk based on the editing data included in the business implicit snapshot in response to the completion of data recovery processing.
[0122] Optionally, the apparatus further includes a recovery processing module, configured to, in response to a snapshot rollback request for the target data disk, create a business implicit snapshot and a reference implicit snapshot indicating the current data storage state of the target data disk; wherein, the snapshot rollback request is used to request the restoration of the data storage state of the target data disk to the data storage state indicated by the data snapshot at a specified time point; the specified time point is before the time point at which the snapshot rollback request is received; the data snapshot is used to indicate the data storage state of the target data disk; and data recovery processing is performed on the target data disk based on the difference between the data snapshot at the specified time point and the reference implicit snapshot.
[0123] Optionally, the target data disk is divided into multiple storage blocks. The implicit snapshot includes the first data currently stored in each storage block, and the data snapshot at a specified time point includes the second data stored in each storage block at the specified time point. The editing module 820 is also used to traverse the multiple storage blocks. For each traversed storage block, if there is a difference between the first data and the second data of the storage block, the first data currently stored in the storage block is overwritten according to the second data of the storage block to realize the data recovery processing of the storage block.
[0124] Optionally, the editing module 820 is also used to delete reference implicit snapshots and business implicit snapshots.
[0125] Optionally, the recovery processing module is further configured to lock the digital directory of the target data disk in response to a snapshot rollback request for the target data disk; while the digital directory is locked, only the target process corresponding to the snapshot rollback request is allowed to create snapshots and update the digital directory; in response to the digital directory being locked, an indication reference implicit snapshot and a business implicit snapshot are created by the target process; the digital directory is updated by the target process based on the reference implicit snapshot and the business implicit snapshot; and the digital directory is unlocked in response to the completion of the digital directory update.
[0126] Optionally, the response module 810 is also configured to, in response to a new business request for the target data disk, add the edited data requested by the new business request to the business implicit snapshot to update the business implicit snapshot.
[0127] Optionally, the target data disk is divided into multiple storage blocks, and the edit data includes the write data corresponding to the target storage block among the multiple storage blocks; the editing module 820 is also used to overwrite the currently stored data in the target storage block according to the write data corresponding to the target storage block in response to the completion of data recovery processing, so as to realize the data editing processing of the target data disk.
[0128] It should be noted that the device embodiments in this application correspond to the aforementioned method embodiments. The specific principles in the device embodiments can be found in the content of the aforementioned method embodiments, and will not be repeated here.
[0129] Figure 13 A structural block diagram of an electronic device for performing a data processing method according to an embodiment of this application is shown. The electronic device may be... Figure 1 Any disk in the storage system 120, etc. It should be noted that... Figure 13 The computer system 1200 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0130] like Figure 13 As shown, the computer system 1200 includes a Central Processing Unit (CPU) 1201, which can perform various appropriate actions and processes, such as executing the methods described in the above embodiments, based on programs stored in Read-Only Memory (ROM) 1202 or programs loaded from storage portion 1208 into Random Access Memory (RAM) 1203. The RAM 1203 also stores various programs and data required for system operation. The CPU 1201, ROM 1202, and RAM 1203 are interconnected via a bus 1204. An Input / Output (I / O) interface 1205 is also connected to the bus 1204.
[0131] The following components are connected to I / O interface 1205: an input section 1206 including a keyboard, mouse, etc.; an output section 1207 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to I / O interface 1205 as needed. Removable media 1211, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1210 as needed so that computer programs read from them can be installed into storage section 1208 as needed.
[0132] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1209, and / or installed from removable medium 1211. When the computer program is executed by central processing unit (CPU) 1201, it performs various functions defined in the system of this application.
[0133] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0134] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer-readable instructions.
[0135] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.
[0136] In another aspect, this application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable storage medium carries computer-readable instructions that, when executed by a processor, implement the methods in any of the above embodiments.
[0137] According to one aspect of the embodiments of this application, a computer program product is provided, the computer program product including computer-readable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-readable instructions from the computer-readable storage medium, and the processor executes the computer-readable instructions, causing the electronic device to perform the methods of any of the above embodiments.
[0138] In the embodiments of this application, the terms "module" or "unit" refer to a part of a computer program with a predetermined function, which works together with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (e.g., processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that functions as a whole.
[0139] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0140] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause an electronic device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the methods according to the embodiments of this application.
[0141] Other embodiments of this application will readily conceive of by those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. It should be understood that this application is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
[0142] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A data processing method, characterized in that, The method includes: During the data recovery process on the target data disk, in response to a business request for the target data disk, the edited data requested by the business request is added to the business implicit snapshot; In response to the completion of the data recovery process, the data in the target data disk is edited based on the edited data included in the business implicit snapshot.
2. The method according to claim 1, characterized in that, During the data recovery process on the target data disk, before adding the edited data requested by the business request to the business implicit snapshot in response to a business request for the target data disk, the method further includes: In response to a snapshot rollback request for the target data disk, an implicit snapshot of the service and a reference implicit snapshot indicating the current data storage state of the target data disk are created; wherein, the snapshot rollback request is used to request the restoration of the data storage state of the target data disk to the data storage state indicated by a data snapshot at a specified time point; the specified time point is before the time point at which the snapshot rollback request is received; the data snapshot is used to indicate the data storage state of the target data disk; Data recovery processing is performed on the target data disk based on the difference between the data snapshot at the specified time point and the reference implicit snapshot.
3. The method according to claim 2, characterized in that, The target data disk is divided into multiple storage blocks, the reference implicit snapshot includes the first data currently stored in each of the storage blocks, and the data snapshot at a specified time point includes the second data stored in each of the storage blocks at the specified time point; The data recovery process for the target data disk based on the difference between the data snapshot at the specified time point and the reference implicit snapshot includes: The plurality of storage blocks are traversed; For each storage block that is traversed, if there is a difference between the first data and the second data of the storage block, the first data currently stored in the storage block is overwritten according to the second data of the storage block, so as to realize the data recovery process of the storage block.
4. The method according to claim 2, characterized in that, In response to the completion of the data recovery process, after editing the data in the target data disk based on the edited data included in the implicit snapshot, the method further includes: Delete the reference implicit snapshot and the business implicit snapshot.
5. The method according to claim 2, characterized in that, The step of creating the business implicit snapshot and a reference implicit snapshot indicating the current data storage state of the target data disk in response to a snapshot rollback request for the target data disk includes: In response to a snapshot rollback request for the target data disk, the digital directory of the target data disk is locked; while the digital directory is locked, only the target process corresponding to the snapshot rollback request is allowed to create snapshots and update the digital directory. In response to the digital directory being locked, the reference implicit snapshot and the business implicit snapshot are created by the target process; The method further includes: The target process updates the digital catalog based on the reference implicit snapshot and the business implicit snapshot. In response to the completion of the digital catalog update, the digital catalog is unlocked.
6. The method according to claim 1, characterized in that, In response to the completion of the data recovery process, before editing the data in the target data disk based on the edit data included in the business implicit snapshot, the method further includes: In response to a new business request for the target data disk, the edited data requested by the new business request is added to the business implicit snapshot to update the business implicit snapshot.
7. The method according to any one of claims 1-6, characterized in that, The target data disk is divided into multiple storage blocks, and the edit data includes the write data corresponding to the target storage block among the multiple storage blocks; In response to the completion of the data recovery process, based on the edit data included in the business implicit snapshot, the data in the target data disk is edited, including: In response to the completion of the data recovery process, the data currently stored in the target storage block is overwritten according to the write data corresponding to the target storage block, so as to realize the data editing process of the target data disk.
8. A data processing apparatus, characterized in that, The device includes: The response module is used to add the edited data requested by the business request to the business implicit snapshot during the data recovery process of the target data disk. An editing module is used to edit the data in the target data disk based on the edit data included in the business implicit snapshot in response to the completion of the data recovery process.
9. A storage system, characterized in that, The storage system includes multiple data disks; each data disk is used to perform the method described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, It stores computer-readable instructions that, when executed by a processor, implement the method as described in any one of claims 1-7.
11. A computer program product, characterized in that, It includes computer-readable instructions that, when executed by a processor, implement the method of any one of claims 1-7.