Data processing method and device
By creating a storage snapshot on the storage module and writing it to the object storage server, a correspondence between the file identifier and the data storage address is established, which solves the problem of requiring additional installation of proxy nodes in the existing technology, achieves efficient data backup and recovery, and improves the user experience.
Patent Information
- Application Number
- CN202110172074.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-08
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2041-02-08
AI Technical Summary
The existing technology requires the installation of additional proxy nodes during data backup and recovery, which affects the user experience, is inefficient, and cannot adapt to different virtualization platforms.
By creating a storage snapshot on the storage module and writing it to the object storage server, a correspondence between the file identifier and the data storage address is established, enabling backup and recovery processing without relying on other nodes.
It improves the processing efficiency of data backup and recovery, ensures data security and integrity, and enhances user experience.
Smart Images

Figure CN113297007B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of computer technology, and in particular to data processing methods and devices. Background Art
[0002] With the development of internet technology, users are increasingly demanding storage services. To ensure data security and availability, service providers typically back up data on cloud disks at set times. When data recovery is needed, data loss can be avoided by simply locating the data in the backup. Existing technologies for data backup and recovery not only require the installation of additional proxy nodes but also fail to guarantee backup / recovery efficiency, significantly impacting the user experience with storage services. Therefore, an effective solution is urgently needed to address these issues. Summary of the Invention
[0003] In view of this, the embodiments of this specification provide a data processing method. This specification also relates to a data processing apparatus, a computing device, and a computer-readable storage medium to address the technical deficiencies in the prior art.
[0004] According to a first aspect of an embodiment of this specification, there is provided a data processing method, including:
[0005] Obtaining a backup request submitted for a storage module, and creating a storage snapshot corresponding to the storage module according to the backup request;
[0006] Writing the storage snapshot to the object storage server, and creating a correspondence between the file identifier in the storage snapshot and the data storage address according to the writing result;
[0007] When a data recovery request is received, the corresponding relationship is read according to the target file identifier carried in the data recovery request to obtain the target data storage address;
[0008] Target data is extracted from the object storage server based on the target data storage address, and a target file corresponding to the target file identifier is restored in the storage module according to the target data.
[0009] Optionally, obtaining a backup request submitted for a storage module and creating a storage snapshot corresponding to the storage module according to the backup request includes:
[0010] Obtaining the backup request, and determining a first storage submodule and a second storage submodule according to the backup request;
[0011] The storage snapshots corresponding to the first storage sub-module and the second storage sub-module are created based on the backup request.
[0012] Optionally, the creating the storage snapshot corresponding to the first storage submodule and the second storage submodule based on the backup request includes:
[0013] Creating a first storage snapshot corresponding to the first storage sub-module based on the backup request;
[0014] The data contained in the second storage submodule is written into the first storage snapshot, and the storage snapshot is generated according to the writing result.
[0015] Optionally, writing the storage snapshot to an object storage server and creating a correspondence between a file identifier in the storage snapshot and a data storage address according to the writing result includes:
[0016] Determining data corresponding to each file identifier contained in the storage snapshot, and writing the data to the object storage server;
[0017] Determine the data storage address of the data corresponding to each file identifier according to the writing result, create a snapshot relationship table based on the data storage location and the file identifier, and use the snapshot relationship table as the corresponding relationship.
[0018] Optionally, after the step of creating a correspondence between the file identifier and the data storage address in the storage snapshot according to the writing result is executed, the method further includes:
[0019] The corresponding relationship is updated to the storage snapshot in the object storage server.
[0020] Optionally, reading the corresponding relationship according to the target file identifier carried in the data recovery request to obtain the target data storage address includes:
[0021] Parsing the data recovery request to obtain the target file identifier;
[0022] The snapshot relationship table is read based on the target file identifier to obtain the target data storage address.
[0023] Optionally, the recovering the target file corresponding to the target file identifier in the storage module according to the target data includes:
[0024] Determine the storage address of the target file in the storage module according to the target file identifier;
[0025] The target data is written into the storage address in the storage module, and the target file is restored in the storage module according to the writing result.
[0026] Optionally, after the step of creating a correspondence between the file identifier and the data storage address in the storage snapshot according to the writing result is executed, the method further includes:
[0027] In the case of receiving a release request, determining a storage location of the storage snapshot in the object storage server according to the release request;
[0028] The storage snapshot in the storage location is deleted to release storage space of the object storage server.
[0029] According to a second aspect of the embodiments of this specification, there is provided a data processing device, including:
[0030] an acquisition module configured to acquire a backup request submitted to a storage module and create a storage snapshot corresponding to the storage module according to the backup request;
[0031] a creation module configured to write the storage snapshot into an object storage server and create a correspondence between a file identifier in the storage snapshot and a data storage address according to the writing result;
[0032] A reading module is configured to, upon receiving a data recovery request, read the corresponding relationship according to the target file identifier carried in the data recovery request to obtain a target data storage address;
[0033] The recovery module is configured to extract target data from the object storage server based on the target data storage address, and restore the target file corresponding to the target file identifier in the storage module according to the target data.
[0034] Optionally, the acquisition module is further configured to:
[0035] The backup request is obtained, and a first storage submodule and a second storage submodule are determined according to the backup request; and the storage snapshots corresponding to the first storage submodule and the second storage submodule are created based on the backup request.
[0036] Optionally, the acquisition module is further configured to:
[0037] A first storage snapshot corresponding to the first storage submodule is created based on the backup request; data contained in the second storage submodule is written into the first storage snapshot, and the storage snapshot is generated according to the writing result.
[0038] Optionally, the creation module is further configured to:
[0039] Determine the data corresponding to each file identifier contained in the storage snapshot, and write the data to the object storage server; determine the data storage address of the data corresponding to each file identifier based on the writing result, create a snapshot relationship table based on the data storage location and the file identifier, and use the snapshot relationship table as the corresponding relationship.
[0040] Optionally, the data processing device further includes:
[0041] An updating module is configured to update the corresponding relationship to the storage snapshot in the object storage server.
[0042] Optionally, the reading module is further configured to:
[0043] The data recovery request is parsed to obtain the target file identifier; and the snapshot relationship table is read based on the target file identifier to obtain the target data storage address.
[0044] Optionally, the recovery module is further configured to:
[0045] Determine the storage address of the target file in the storage module according to the target file identifier;
[0046] The target data is written into the storage address in the storage module, and the target file is restored in the storage module according to the writing result.
[0047] Optionally, the data processing device further includes:
[0048] The release module is configured to, upon receiving a release request, determine the storage location of the storage snapshot in the object storage server according to the release request; delete the storage snapshot in the storage location to release the storage space of the object storage server.
[0049] According to a third aspect of an embodiment of this specification, a computing device is provided, including:
[0050] memory and processor;
[0051] The memory is configured to store computer-executable instructions, and the processor is configured to execute the computer-executable instructions:
[0052] Obtaining a backup request submitted for a storage module, and creating a storage snapshot corresponding to the storage module according to the backup request;
[0053] Writing the storage snapshot to the object storage server, and creating a correspondence between the file identifier in the storage snapshot and the data storage address according to the writing result;
[0054] When a data recovery request is received, the corresponding relationship is read according to the target file identifier carried in the data recovery request to obtain the target data storage address;
[0055] Target data is extracted from the object storage server based on the target data storage address, and a target file corresponding to the target file identifier is restored in the storage module according to the target data.
[0056] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the data processing method are implemented.
[0057] The data processing method provided in this specification, when a backup request submitted to a storage module is obtained, will create a storage snapshot of the storage module according to the backup request, and then write the storage snapshot to the object storage server, and create a correspondence between the file identifier and the data storage address according to the writing result, so that the backup processing can be completed without combining with other nodes during the backup process, and the processing efficiency of the subsequent recovery of the target file can be effectively improved by creating the correspondence; based on this, when a data recovery request is received, the correspondence can be directly read according to the target file identifier carried in the data recovery request, so as to determine the target data storage address, and finally, the target data can be extracted from the object storage server based on the target data storage address, so as to complete the recovery operation of the target file corresponding to the target file identifier, thereby effectively improving the processing efficiency of data backup and data recovery without relying on additional proxy nodes. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 This is a flow chart of a data processing method provided in one embodiment of this specification;
[0059] Figure 2 This is a schematic diagram of data backup and recovery in a data processing method provided in an embodiment of this specification;
[0060] Figure 3 This is a schematic diagram of data backup in a data processing method provided in one embodiment of this specification;
[0061] Figure 4 This is a schematic diagram of data recovery in a data processing method provided in one embodiment of this specification;
[0062] Figure 5 This is a processing flow chart of a data processing method applied to a backup and recovery scenario provided in an embodiment of this specification;
[0063] Figure 6This is a structural diagram of a data processing device provided in one embodiment of this specification;
[0064] Figure 7 This is a structural block diagram of a computing device provided in one embodiment of this specification. DETAILED DESCRIPTION
[0065] The following description sets forth many specific details to facilitate a thorough understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the scope of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0066] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a," "the," and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0067] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0068] In this specification, a data processing method is provided. This specification also relates to a data processing apparatus, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0069] In actual applications, when backing up and restoring files, two solutions are usually adopted. One is a backup solution that relies on a specific virtualization platform. During recovery, the backup is virtualized into a disk copy file to complete the file backup and recovery. The other is to install an agent in the Guest OS to perform backup by reading specified files. During recovery, the agent is still required to complete the file backup and recovery. However, the shortcomings of the above two solutions are that they cannot handle different virtualization platforms, or the installation of additional agents in the Guest OS will occupy the network bandwidth of the virtual machine itself. Therefore, a solution that is independent of the virtualization platform and has no impact on the Guest OS is urgently needed to address the shortcomings of the existing technology.
[0070] The data processing method provided in this specification, when a backup request submitted to a storage module is obtained, will create a storage snapshot of the storage module according to the backup request, and then write the storage snapshot to the object storage server, and create a correspondence between the file identifier and the data storage address according to the writing result, so that the backup processing can be completed without combining with other nodes during the backup process, and the processing efficiency of the subsequent recovery of the target file can be effectively improved by creating the correspondence; based on this, when a data recovery request is received, the correspondence can be directly read according to the target file identifier carried in the data recovery request, so as to determine the target data storage address, and finally, the target data can be extracted from the object storage server based on the target data storage address, so as to complete the recovery operation of the target file corresponding to the target file identifier, thereby effectively improving the processing efficiency of data backup and data recovery without relying on additional proxy nodes.
[0071] Figure 1 A flowchart of a data processing method according to an embodiment of the present invention is shown, which specifically includes the following steps:
[0072] Step S102: obtaining a backup request submitted for a storage module, and creating a storage snapshot corresponding to the storage module according to the backup request.
[0073] Specifically, the backup request specifically refers to a request for backing up files and their corresponding data in the storage module. In actual applications, the backup request can be a request automatically generated by the system at set intervals, or a request submitted by a backup supervisor. This embodiment does not impose any restrictions on this. Correspondingly, the storage module specifically refers to a device for storing files and their corresponding data. The storage module can be a cloud disk of an instance in a storage service, and / or a disk of an instance in a storage service. The storage snapshot (Snapshot) specifically refers to a backup of valid data on the storage module. It should be noted that the size of the storage snapshot is the same as the size of the storage module, so that all data on the storage module can be backed up to ensure the completeness of the data.
[0074] See also Figure 2 In order to be able to back up and restore data on different virtualization platforms and avoid installing additional agents, when a backup request is received, a storage snapshot can be created for the cloud disk through OpenAPI, and the disk data can be written to the storage snapshot through OpenAPI. The created storage snapshot is then written to the object storage server (OSS, Object Storage Service); at the same time, in order to improve the recovery efficiency when restoring files later, a corresponding relationship can be created for the storage snapshot written to the object storage server, and the corresponding relationship between the data storage address and the file identifier is recorded in the corresponding relationship. When it is necessary to restore a file, the target file can be restored through OpenAPI, that is, the data storage address of the file to be restored is determined through the corresponding relationship of the storage snapshot, and the data can be directly extracted from the object storage server according to the address to perform the recovery process of the target file, thereby avoiding the loss of the file and its corresponding data, and the integrity of the target file can be guaranteed through the file-level recovery processing operation.
[0075] Based on this, when writing storage snapshots to the object storage server, they are stored in blocks. This allows for rapid retrieval of the target data based on the data storage address when restoring the target file, further improving data recovery efficiency. It should be noted that since the object storage server is the provider of the storage service, data security is further ensured.
[0076] Furthermore, in the process of creating the storage snapshot, since the cloud disk and the disk store data in different devices, the storage snapshot needs to be created according to actual needs. In this embodiment, the specific implementation method is as follows:
[0077] Obtaining the backup request, and determining a first storage submodule and a second storage submodule according to the backup request;
[0078] Creating a first storage snapshot corresponding to the first storage sub-module based on the backup request;
[0079] The data contained in the second storage submodule is written into the first storage snapshot, and the storage snapshot is generated according to the writing result.
[0080] Specifically, the first storage sub-module specifically refers to the storage device corresponding to the cloud disk, and the second storage sub-module specifically refers to the storage device corresponding to the disk. It should be noted that the cloud disk is used to store online data, and the disk user stores offline data; accordingly, the first storage snapshot specifically refers to the storage snapshot created for the first storage sub-module.
[0081] Based on this, after obtaining the backup request, the backup request is parsed to determine that the first storage sub-module and the second storage sub-module need to be backed up. Since the storage devices corresponding to the first storage sub-module and the second storage sub-module are different, in order to complete the backup processing for both storage sub-modules, the first storage sub-module corresponding to the storage device of the cloud disk can be determined first, and then the first storage snapshot is created for the first storage sub-module. Secondly, the data contained in the second storage sub-module is written into the first storage snapshot. Finally, the storage snapshot can be generated based on the writing result, so that the data of different virtualization platforms can be backed up at the same time.
[0082] In actual applications, the storage snapshot may be created for the first storage submodule separately to implement separate backup of the first storage submodule. For specific implementation methods, please refer to the corresponding description in this embodiment, which will not be elaborated here.
[0083] For example, a platform that provides cloud storage servers needs to back up cloud disks and local disks at set time intervals to avoid data loss and losses to customers. Based on this, after the backup system generates a backup request, it will determine the need to back up the instance's cloud disks and disks based on the backup request. Since the instance's cloud disks are native block devices, and the instance's disk data is not a native block device, in order to be able to complete the backup of files on both the cloud disk and the disk at the same time, a storage snapshot of the cloud disk will be created through OpenAPI, and then the files on the disk will be written directly to the storage snapshot through OpenAPI, thereby completing the creation of the instance's cloud disk and disk snapshots for subsequent backup processing.
[0084] It should be noted that the first storage submodule and the second storage submodule mentioned in this specification specifically refer to two different types of storage submodules, and each type of storage submodule may correspond to one or more storage devices.
[0085] In summary, since different storage sub-modules require different backup processing methods for backup, in order to improve the backup efficiency of the service provider, a storage snapshot will be created for the first storage sub-module, and then the data in the second storage sub-module will be written to the storage snapshot, so that the backup pre-processing of the two types of storage sub-modules can be completed through one storage snapshot, which can effectively ensure the subsequent backup processing efficiency.
[0086] Step S104: write the storage snapshot into the object storage server, and create a correspondence between the file identifier and the data storage address in the storage snapshot according to the writing result.
[0087] Specifically, based on the creation of the storage snapshot for the storage module, the above processing indicates that the files and data in the storage module have been copied. At this time, the copied files and data need to be stored so that they can be used during recovery processing; and in order to ensure the security of the backed-up files and data, the storage snapshot can be written to the object storage server, which specifically refers to the server corresponding to the storage service owned by the service provider of the storage service.
[0088] Furthermore, after the storage snapshot is written to the object storage server, in order to facilitate subsequent recovery processing, data can be quickly extracted from the object storage server to restore the target file. After the storage snapshot is written, a correspondence between the file identifier in the storage snapshot and the data storage address stored in the object storage server can be created based on the writing result, wherein the file identifier specifically refers to the unique identifier corresponding to the file in the storage module, which can be a file name or an identifier composed of a set string. This embodiment does not impose any restrictions on this; accordingly, the data storage address specifically refers to the storage address of the underlying data corresponding to the file in the object storage server.
[0089] In actual applications, in order to facilitate subsequent file recovery, the data in the storage module can be stored in the object storage server according to data blocks during backup, that is, the data corresponding to the file in the storage snapshot is divided into multiple data blocks, and then the data blocks are written to the object storage server. Each data block can correspond to the data of one file or multiple files, and this embodiment does not impose any restrictions on this.
[0090] Furthermore, since the files and corresponding data contained in the storage snapshot are large in volume, if they are written directly to the object storage server, a large amount of computing power may be consumed to accurately extract the target data during subsequent data recovery. In order to facilitate subsequent rapid data recovery, a correspondence between file identifiers and data storage addresses can be established in advance. In this embodiment, the specific implementation method is as follows:
[0091] Determining data corresponding to each file identifier contained in the storage snapshot, and writing the data to the object storage server;
[0092] Determine the data storage address of the data corresponding to each file identifier according to the writing result, create a snapshot relationship table based on the data storage location and the file identifier, and use the snapshot relationship table as the corresponding relationship.
[0093] Specifically, first determine the data corresponding to the file identifier of each file in the storage snapshot, and store it in the object storage server in the form of data blocks. After the storage is completed, determine the data storage address of the data corresponding to each file in the object storage server. At this time, create the snapshot relationship table according to the data storage address and the file identifier. The correspondence between the file identifier and the data storage address can be determined through the snapshot relationship table. When data recovery is required, it is only necessary to read the snapshot relationship table to determine the data storage address corresponding to the file to be restored, thereby improving the efficiency of data recovery processing.
[0094] In specific implementation, since the snapshot relationship table needs to be created based on the storage address and file identifier in the object storage server, in order to improve the backup efficiency, the creation of the snapshot relationship table can be completed through the Catalog Parser. The Catalog Parser can not only read the storage snapshot, but also analyze the storage snapshot to extract the file identifier and the data storage address in the object storage server to realize the creation of the snapshot relationship table.
[0095] Furthermore, since the storage snapshot after the backup is intended to be used during data recovery, the corresponding relationship established based on the file identifier and the data storage address can be updated to the storage snapshot in the object storage server, so that when data is recovered, only the corresponding relationship needs to be read to quickly complete data recovery. The snapshot relationship table is shown in the following table (1):
[0096] File identification Storage address ID_1 ADD_1 ID_2 ADD_2 … … ID_n ADD_n
[0097] Table 1
[0098] See also Figure 3As shown in the backup processing diagram, when data backup is required, a storage snapshot will be created and sent to the backup node. The backup node will upload the data corresponding to the storage snapshot to the object storage server (OSS). After the object storage server completes the data storage, it will feedback the completion information to the backup node. At this time, the backup node can inform the service party that submitted the backup request that the backup is complete. Furthermore, in order to improve the efficiency of subsequent file recovery, the backup node can generate a correspondence between the file identifier and the data storage address, and send it to the catalog parser for processing. The catalog parser will obtain the snapshot data of the storage snapshot and the data storage address in the object storage server from the object storage server, and then complete the creation of the correspondence by parsing the file system. When the correspondence is created, the correspondence will be uploaded to the object storage server again for writing the correspondence into the storage snapshot. Finally, feedback is given to the backup node based on the write completion request returned by the object storage server. The backup node can inform the service party that file-level recovery processing can be performed when recovering the file.
[0099] In summary, after the storage snapshot is written to the object storage server, in order to improve the processing efficiency during data recovery, a correspondence between the file identifier and the data storage address is created according to the writing result, so that during subsequent data recovery processing, only the correspondence needs to be read to quickly determine the storage location of the target data in the object storage server, thereby quickly completing the data recovery process.
[0100] Step S106: When a data recovery request is received, the corresponding relationship is read according to the target file identifier carried in the data recovery request to obtain the target data storage address.
[0101] Specifically, on the basis of completing the backup processing as mentioned above, further, if the data recovery request is received, it means that one or more files in the storage module are lost and need to be restored. At this time, the corresponding relationship can be read according to the target file identifier carried in the data recovery request to determine the target data storage address corresponding to the target file identifier based on the reading result, wherein the target file identifier specifically refers to the identifier corresponding to the file to be restored, and the target data storage address specifically refers to the storage address of the file to be restored in the object storage server.
[0102] Furthermore, in order to quickly restore the target file corresponding to the target file identifier, the snapshot relationship table can be read to determine the address of the data backup corresponding to the target file in the object storage server for subsequent recovery processing. In this embodiment, the specific implementation method is as follows:
[0103] Parsing the data recovery request to obtain the target file identifier;
[0104] The snapshot relationship table is read based on the target file identifier to obtain the target data storage address.
[0105] Specifically, when the data recovery request is received, it indicates that a file loss problem has occurred in the storage module. In order to restore the file, the file to be restored can be found in the backup storage snapshot for recovery processing; based on this, the data recovery request is first parsed to obtain the target file identifier corresponding to the file to be restored, and then the snapshot relationship table is read based on the target file identifier. Finally, according to the reading result, the target data storage address in the object storage server when the data backup corresponding to the target file is obtained.
[0106] Continuing with the above example, the instance's cloud disk and disk are backed up via the object storage server OSS, and a correspondence between the data storage address and the file name is created based on the backup results. Based on this, when a file with the file name ID_S on the disk is lost, the service provider will initiate a data recovery request in order to promptly recover the lost file. By parsing the data recovery request, the file name to be recovered is ID_S. Based on the file name ID_S, the snapshot relationship table is queried to determine that the storage address for the data with the file name ID_S in the object storage server OSS is ADD_S. Subsequently, the recovery of the file ID_S can be completed by reading the data in the storage address ADD_S.
[0107] In summary, during the data recovery process, since the correspondence between file identifiers and data storage locations is pre-recorded, there is no need to perform data-level retrieval processing. Only the snapshot relationship table needs to be retrieved to determine the address of the data to be recovered, thereby improving the processing efficiency of data recovery.
[0108] Step S108 : extracting target data from the object storage server based on the target data storage address, and restoring the target file corresponding to the target file identifier in the storage module according to the target data.
[0109] Specifically, on the basis of reading the target data storage address, further, based on the target data storage address, the location of the data backup corresponding to the target file to be restored in the object storage server can be determined, and then the target data corresponding to the target file can be extracted from the target storage address in the object storage server. Finally, according to the target data, the target file corresponding to the target file identifier can be restored in the storage module.
[0110] Among them, the target data specifically refers to the data required to restore the target file corresponding to the target file identifier contained in the data recovery request, and the target file specifically refers to the file that needs to be restored; it should be noted that, since the data loss situation is uncertain, the data recovery requests received at different times will be for different numbers of target files, so the target file that needs to be restored in the data recovery request can be one or more, and this embodiment does not impose any limitations on this.
[0111] In addition, if the storage module fails and all files are lost, the storage snapshot can be directly extracted from the object storage server to restore the files. At this time, the target file is the lost file in the storage module, and the corresponding target data is the underlying data corresponding to all the lost files.
[0112] Furthermore, in the process of restoring the target file, considering that the restored target file needs to be used, the target file can be restored to the storage module based on the target data after obtaining the target data. In this embodiment, the specific implementation method is as follows:
[0113] Determine the storage address of the target file in the storage module according to the target file identifier;
[0114] The target data is written into the storage address in the storage module, and the target file is restored in the storage module according to the writing result.
[0115] Specifically, first, the storage address of the target file to be restored in the storage module is determined according to the target file identifier, and then the target data extracted from the object storage server is added to the storage address. Finally, the target file can be restored in the storage module according to the storage result, wherein the storage address specifically refers to the location where the data needs to be written when restoring the target file.
[0116] See also Figure 4 As shown in the recovery processing diagram, when a data recovery request is obtained, the recovery node can read the correspondence between the file identifier and the data storage location in the object storage server according to the target file identifier contained in the recovery request, and the target data storage address corresponding to the target file identifier can be determined based on the correspondence. The recovery node can then read the target data in the object storage server according to the address. When the reading is completed, the target data can be written to the storage address of the target file in the storage module to realize recovery of the target file and ensure that the user's data is not lost.
[0117] In summary, completing the recovery of the target file through the corresponding relationship can not only speed up the recovery efficiency of the target file, but also further ensure the security and effectiveness of the data, thereby improving the user experience.
[0118] In addition, when no data recovery request is received, it indicates that no file loss problem has occurred in the storage module. In order to avoid wasting resources, when backing up the files and their corresponding data in the storage module next time, the files and their corresponding data that have been backed up by the previous node can be deleted. In this embodiment, the specific implementation method is as follows:
[0119] In the case of receiving a release request, determining a storage location of the storage snapshot in the object storage server according to the release request;
[0120] The storage snapshot in the storage location is deleted to release storage space of the object storage server.
[0121] Specifically, when the release request is received, it means that the storage module of the current time node has been backed up, that is, a snapshot has been created and stored for the storage module of the current node. In order to save storage resources, the storage snapshot that has been backed up last time can be deleted from the object storage server.
[0122] Based on this, the storage location of the storage snapshot in the object storage server is determined according to the release request, and then the storage snapshot in the storage location is deleted, thereby releasing the storage space in the object storage server to meet the backup and recovery needs of subsequent processing nodes, further improving space utilization.
[0123] The data processing method provided in this embodiment, when a backup request submitted to a storage module is obtained, will create a storage snapshot of the storage module according to the backup request, and then write the storage snapshot to the object storage server, and create a correspondence between the file identifier and the data storage address according to the writing result, so that the backup processing can be completed without combining with other nodes during the backup process, and the processing efficiency of the subsequent recovery of the target file can be effectively improved by creating the correspondence; based on this, when a data recovery request is received, the correspondence can be directly read according to the target file identifier carried in the data recovery request, so as to determine the target data storage address, and finally, the target data can be extracted from the object storage server based on the target data storage address, so as to complete the recovery operation of the target file corresponding to the target file identifier, thereby effectively improving the processing efficiency of data backup and data recovery without relying on additional proxy nodes.
[0124] The following combined Figure 5 , taking the application of the data processing method provided in this specification in the backup and recovery scenario as an example, the data processing method is further explained. Figure 5 A processing flow chart of a data processing method applied to a backup and recovery scenario provided in an embodiment of this specification is shown, which specifically includes the following steps:
[0125] Step S502: Obtain a backup request, and determine the cloud disk and disk of the instance according to the backup request.
[0126] Step S504: Create a storage snapshot corresponding to the cloud disk based on the backup request, and write the data in the disk into the storage snapshot.
[0127] Step S506: Back up the storage snapshot to the object storage server based on the backup request.
[0128] Step S508: Determine the data storage address of the data corresponding to each file identifier in the storage snapshot according to the backup result.
[0129] Step S510: Create a snapshot relationship table based on the data storage address and the file identifier, and update the snapshot relationship table to the storage snapshot in the object storage server.
[0130] Step S512: When a data recovery request is received, the data recovery request is parsed to obtain a target file identifier.
[0131] Step S514: query the snapshot relationship table based on the target file identifier to obtain the target data storage address.
[0132] Step S516: Read the target data from the object storage server based on the target data storage address.
[0133] Step S518: Restore the target file corresponding to the target file identifier according to the target data.
[0134] To sum up, when a backup request submitted to a storage module is obtained, a storage snapshot of the storage module will be created according to the backup request, and then the storage snapshot will be written to the object storage server, and a correspondence between the file identifier and the data storage address will be created according to the writing result, so that the backup processing can be completed without combining with other nodes during the backup process, and the processing efficiency of the subsequent recovery of the target file can be effectively improved by creating the correspondence; based on this, when a data recovery request is received, the correspondence can be directly read according to the target file identifier carried in the data recovery request, so as to determine the target data storage address, and finally, the target data can be extracted from the object storage server based on the target data storage address, so as to complete the recovery operation of the target file corresponding to the target file identifier, thereby effectively improving the processing efficiency of data backup and data recovery without relying on additional proxy nodes.
[0135] Corresponding to the above method embodiment, this specification also provides a data processing device embodiment, Figure 6 FIG1 shows a schematic diagram of the structure of a data processing device provided by an embodiment of this specification. Figure 6 As shown, the device includes:
[0136] An acquisition module 602 is configured to acquire a backup request submitted for a storage module and create a storage snapshot corresponding to the storage module according to the backup request;
[0137] A creation module 604 is configured to write the storage snapshot to an object storage server and create a correspondence between a file identifier and a data storage address in the storage snapshot according to the writing result;
[0138] The reading module 606 is configured to, upon receiving a data recovery request, read the corresponding relationship according to the target file identifier carried in the data recovery request to obtain a target data storage address;
[0139] The recovery module 608 is configured to extract target data from the object storage server based on the target data storage address, and recover the target file corresponding to the target file identifier in the storage module according to the target data.
[0140] In an optional embodiment, the acquisition module 602 is further configured to:
[0141] The backup request is obtained, and a first storage submodule and a second storage submodule are determined according to the backup request; and the storage snapshots corresponding to the first storage submodule and the second storage submodule are created based on the backup request.
[0142] In an optional embodiment, the acquisition module 602 is further configured to:
[0143] A first storage snapshot corresponding to the first storage submodule is created based on the backup request; data contained in the second storage submodule is written into the first storage snapshot, and the storage snapshot is generated according to the writing result.
[0144] In an optional embodiment, the creation module 604 is further configured to:
[0145] Determine the data corresponding to each file identifier contained in the storage snapshot, and write the data to the object storage server; determine the data storage address of the data corresponding to each file identifier based on the writing result, create a snapshot relationship table based on the data storage location and the file identifier, and use the snapshot relationship table as the corresponding relationship.
[0146] In an optional embodiment, the data processing device further includes:
[0147] An updating module is configured to update the corresponding relationship to the storage snapshot in the object storage server.
[0148] In an optional embodiment, the reading module 606 is further configured to:
[0149] The data recovery request is parsed to obtain the target file identifier; and the snapshot relationship table is read based on the target file identifier to obtain the target data storage address.
[0150] In an optional embodiment, the recovery module 608 is further configured to:
[0151] Determine the storage address of the target file in the storage module according to the target file identifier;
[0152] The target data is written into the storage address in the storage module, and the target file is restored in the storage module according to the writing result.
[0153] In an optional embodiment, the data processing device further includes:
[0154] The release module is configured to, upon receiving a release request, determine the storage location of the storage snapshot in the object storage server according to the release request; delete the storage snapshot in the storage location to release the storage space of the object storage server.
[0155] The data processing device provided in this embodiment, when obtaining a backup request submitted to the storage module, will create a storage snapshot of the storage module according to the backup request, and then write the storage snapshot to the object storage server, and create a correspondence between the file identifier and the data storage address according to the writing result, so that the backup processing can be completed without combining with other nodes during the backup process, and the processing efficiency of the subsequent recovery of the target file can be effectively improved by creating the correspondence; based on this, when a data recovery request is received, the correspondence can be directly read according to the target file identifier carried in the data recovery request, so as to determine the target data storage address, and finally, the target data can be extracted from the object storage server based on the target data storage address, so as to complete the recovery operation of the target file corresponding to the target file identifier, thereby effectively improving the processing efficiency of data backup and data recovery without relying on additional proxy nodes.
[0156] The above is a schematic diagram of a data processing device according to this embodiment. It should be noted that the technical solution of the data processing device and the technical solution of the above-mentioned data processing method are based on the same concept. For details not described in detail in the technical solution of the data processing device, please refer to the description of the technical solution of the above-mentioned data processing method.
[0157] Figure 7 7 shows a block diagram of a computing device 700 according to an embodiment of the present disclosure. Components of the computing device 700 include, but are not limited to, a memory 710 and a processor 720. The processor 720 is connected to the memory 710 via a bus 730, and a database 750 is used to store data.
[0158] The computing device 700 also includes an access device 740 that enables the computing device 700 to communicate via one or more networks 760. Examples of such networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 740 may include one or more of any type of network interface (e.g., a network interface card (NIC)), whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0159] In one embodiment of the present specification, the above components of the computing device 700 and Figure 7 Other components not shown in the figure may also be connected to each other, for example, via a bus. Figure 7The computing device structure block diagram shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art may add or replace other components as needed.
[0160] Computing device 700 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook computer, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. Computing device 700 can also be a mobile or stationary server.
[0161] The processor 720 is configured to execute the following computer-executable instructions:
[0162] Obtaining a backup request submitted for a storage module, and creating a storage snapshot corresponding to the storage module according to the backup request;
[0163] Writing the storage snapshot to the object storage server, and creating a correspondence between the file identifier in the storage snapshot and the data storage address according to the writing result;
[0164] When a data recovery request is received, the corresponding relationship is read according to the target file identifier carried in the data recovery request to obtain the target data storage address;
[0165] Target data is extracted from the object storage server based on the target data storage address, and a target file corresponding to the target file identifier is restored in the storage module according to the target data.
[0166] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned data processing method are of the same concept. For details not described in detail in the technical scheme of the computing device, please refer to the description of the technical scheme of the above-mentioned data processing method.
[0167] An embodiment of the present specification further provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, are used to:
[0168] Obtaining a backup request submitted for a storage module, and creating a storage snapshot corresponding to the storage module according to the backup request;
[0169] Writing the storage snapshot to the object storage server, and creating a correspondence between the file identifier in the storage snapshot and the data storage address according to the writing result;
[0170] When a data recovery request is received, the corresponding relationship is read according to the target file identifier carried in the data recovery request to obtain the target data storage address;
[0171] Target data is extracted from the object storage server based on the target data storage address, and a target file corresponding to the target file identifier is restored in the storage module according to the target data.
[0172] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned data processing method are based on the same concept. For details not described in detail in the technical scheme of the storage medium, please refer to the description of the technical scheme of the above-mentioned data processing method.
[0173] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0174] The computer instructions include computer program code, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0175] It should be noted that for the aforementioned method embodiments, for ease of description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that this specification is not limited to the order of the actions described, because according to this specification, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this specification.
[0176] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0177] The preferred embodiments disclosed above are intended only to help illustrate this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations are possible based on the content of this specification. These embodiments are selected and described in detail in this specification to better explain the principles and practical applications of this specification, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A data processing method, comprising: Obtaining a backup request submitted for a storage module, and creating a storage snapshot corresponding to the storage module according to the backup request, wherein the storage module includes a first storage submodule and a second storage submodule, the first storage submodule refers to a storage device corresponding to a cloud disk, and the second storage submodule refers to a storage device corresponding to a magnetic disk, and obtaining the backup request submitted for the storage module and creating a storage snapshot corresponding to the storage module according to the backup request include: creating a first storage snapshot corresponding to the first storage submodule based on the backup request; writing data contained in the second storage submodule into the first storage snapshot, and generating the storage snapshot according to the writing result; Writing the storage snapshot to the object storage server, and creating a correspondence between the file identifier in the storage snapshot and the data storage address according to the writing result; When a data recovery request is received, the corresponding relationship is read according to the target file identifier carried in the data recovery request to obtain the target data storage address; Target data is extracted from the object storage server based on the target data storage address, and a target file corresponding to the target file identifier is restored in the storage module according to the target data.
2. The data processing method according to claim 1, wherein writing the storage snapshot to the object storage server and creating a correspondence between the file identifier and the data storage address in the storage snapshot according to the writing result comprises: Determining data corresponding to each file identifier contained in the storage snapshot, and writing the data to the object storage server; Determine the data storage address of the data corresponding to each file identifier according to the writing result, create a snapshot relationship table based on the data storage location and the file identifier, and use the snapshot relationship table as the corresponding relationship.
3. The data processing method according to claim 1 or 2, further comprising: after executing the step of creating a correspondence between the file identifier and the data storage address in the storage snapshot according to the writing result: The corresponding relationship is updated to the storage snapshot in the object storage server.
4. The data processing method according to claim 2, wherein the step of reading the corresponding relationship according to the target file identifier carried in the data recovery request to obtain the target data storage address comprises: Parsing the data recovery request to obtain the target file identifier; The snapshot relationship table is read based on the target file identifier to obtain the target data storage address.
5. The data processing method according to claim 1, wherein the step of restoring the target file corresponding to the target file identifier in the storage module according to the target data comprises: Determine the storage address of the target file in the storage module according to the target file identifier; The target data is written into the storage address in the storage module, and the target file is restored in the storage module according to the writing result.
6. The data processing method according to claim 1, further comprising: after executing the step of creating a correspondence between the file identifier and the data storage address in the storage snapshot according to the writing result: In the case of receiving a release request, determining a storage location of the storage snapshot in the object storage server according to the release request; The storage snapshot in the storage location is deleted to release storage space of the object storage server.
7. A data processing device comprising: an acquisition module configured to acquire a backup request submitted for a storage module and create a storage snapshot corresponding to the storage module according to the backup request, the storage module including a first storage submodule and a second storage submodule, the first storage submodule being a storage device corresponding to a cloud disk, and the second storage submodule being a storage device corresponding to a magnetic disk, wherein acquiring the backup request submitted for the storage module and creating the storage snapshot corresponding to the storage module according to the backup request comprises: creating a first storage snapshot corresponding to the first storage submodule based on the backup request; writing data contained in the second storage submodule into the first storage snapshot, and generating the storage snapshot according to the writing result; a creation module configured to write the storage snapshot into an object storage server and create a correspondence between a file identifier in the storage snapshot and a data storage address according to the writing result; A reading module is configured to, upon receiving a data recovery request, read the corresponding relationship according to the target file identifier carried in the data recovery request to obtain a target data storage address; The recovery module is configured to extract target data from the object storage server based on the target data storage address, and restore the target file corresponding to the target file identifier in the storage module according to the target data.
8. A computing device comprising: memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the following method: Obtaining a backup request submitted for a storage module, and creating a storage snapshot corresponding to the storage module according to the backup request, wherein the storage module includes a first storage submodule and a second storage submodule, the first storage submodule refers to a storage device corresponding to a cloud disk, and the second storage submodule refers to a storage device corresponding to a magnetic disk, and obtaining the backup request submitted for the storage module and creating a storage snapshot corresponding to the storage module according to the backup request include: creating a first storage snapshot corresponding to the first storage submodule based on the backup request; writing data contained in the second storage submodule into the first storage snapshot, and generating the storage snapshot according to the writing result; Writing the storage snapshot to the object storage server, and creating a correspondence between the file identifier in the storage snapshot and the data storage address according to the writing result; When a data recovery request is received, the corresponding relationship is read according to the target file identifier carried in the data recovery request to obtain the target data storage address; Target data is extracted from the object storage server based on the target data storage address, and a target file corresponding to the target file identifier is restored in the storage module according to the target data.
9. A computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the data processing method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the data processing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Data backup method and device, data recovery method and device, electronic equipment and storage medium
CN109597717A
Data backup method, device and system
CN111078464A
Object storage data protection method and device based on snapshot technology
CN111309522A